From 90fdf2dcae2f9f70196a245faa98c717d0dd09bf Mon Sep 17 00:00:00 2001 From: Alex Mosky Date: Wed, 22 Apr 2020 11:30:10 +0200 Subject: [PATCH] .#156: fixed upgrade for the tabbed version fatty is compiled directly at build time moved fatty to https://github.com/juho-p/fatty.git --- .gitignore | 8 ++--- VERSION | 2 +- {src/icons => icons}/README.txt | 0 {src/icons => icons}/script.ico | Bin {src/icons => icons}/script.png | Bin {src/icons => icons}/script.svg | 0 {src/icons => icons}/terminal.ico | Bin {src/icons => icons}/terminal.png | Bin {src/icons => icons}/terminal.svg | 0 {src/icons => icons}/text.ico | Bin {src/icons => icons}/text.png | Bin {src/icons => icons}/text.svg | 0 scripts/build.sh | 16 +++++++++ scripts/build_fatty.sh | 31 +++++++++++++++++ {src => scripts}/check-update.sh | 0 scripts/compile_fatty.sh | 12 +++++++ scripts/package.sh | 56 ++++++++++++++++++++++++++++++ {src => scripts}/prepare.sh | 16 +++++---- src/build.bat | 14 -------- src/cmdtool | 39 +++++++++++++-------- src/package.sh | 49 -------------------------- 21 files changed, 154 insertions(+), 89 deletions(-) rename {src/icons => icons}/README.txt (100%) rename {src/icons => icons}/script.ico (100%) rename {src/icons => icons}/script.png (100%) rename {src/icons => icons}/script.svg (100%) rename {src/icons => icons}/terminal.ico (100%) rename {src/icons => icons}/terminal.png (100%) rename {src/icons => icons}/terminal.svg (100%) rename {src/icons => icons}/text.ico (100%) rename {src/icons => icons}/text.png (100%) rename {src/icons => icons}/text.svg (100%) create mode 100644 scripts/build.sh create mode 100644 scripts/build_fatty.sh rename {src => scripts}/check-update.sh (100%) mode change 100755 => 100644 create mode 100644 scripts/compile_fatty.sh create mode 100644 scripts/package.sh rename {src => scripts}/prepare.sh (81%) mode change 100755 => 100644 delete mode 100644 src/build.bat delete mode 100755 src/package.sh diff --git a/.gitignore b/.gitignore index 6da54f5..1fb1668 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,7 @@ -[._]*.s[a-w][a-z] -[._]s[a-w][a-z] -/src/build +/build /output -/src/wsl-terminal +/release *.exe *.zip *.7z -.debug +.debug \ No newline at end of file diff --git a/VERSION b/VERSION index 899f24f..f514a2f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.0 \ No newline at end of file +0.9.1 \ No newline at end of file diff --git a/src/icons/README.txt b/icons/README.txt similarity index 100% rename from src/icons/README.txt rename to icons/README.txt diff --git a/src/icons/script.ico b/icons/script.ico similarity index 100% rename from src/icons/script.ico rename to icons/script.ico diff --git a/src/icons/script.png b/icons/script.png similarity index 100% rename from src/icons/script.png rename to icons/script.png diff --git a/src/icons/script.svg b/icons/script.svg similarity index 100% rename from src/icons/script.svg rename to icons/script.svg diff --git a/src/icons/terminal.ico b/icons/terminal.ico similarity index 100% rename from src/icons/terminal.ico rename to icons/terminal.ico diff --git a/src/icons/terminal.png b/icons/terminal.png similarity index 100% rename from src/icons/terminal.png rename to icons/terminal.png diff --git a/src/icons/terminal.svg b/icons/terminal.svg similarity index 100% rename from src/icons/terminal.svg rename to icons/terminal.svg diff --git a/src/icons/text.ico b/icons/text.ico similarity index 100% rename from src/icons/text.ico rename to icons/text.ico diff --git a/src/icons/text.png b/icons/text.png similarity index 100% rename from src/icons/text.png rename to icons/text.png diff --git a/src/icons/text.svg b/icons/text.svg similarity index 100% rename from src/icons/text.svg rename to icons/text.svg diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100644 index 0000000..1998ebe --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,16 @@ +#!/bin/bash +set -e + + +./prepare.sh && +../build/ahk/Compiler/Ahk2Exe.exe /in ../src/open-wsl.ahk /out ../build/open-wsl.exe /icon ../icons/terminal.ico && +../build/ahk/Compiler/Ahk2Exe.exe /in ../src/open-wsl.ahk /out ../build/run-wsl-file.exe /icon ../icons/script.ico && +../build/ahk/Compiler/Ahk2Exe.exe /in ../src/open-wsl.ahk /out ../build/vim.exe /icon ../icons/text.ico && +../build/ahk/Compiler/Ahk2Exe.exe /in ../src/open-wsl.ahk /out ../build/emacs.exe /icon ../icons/text.ico && +./package.sh && +echo Build succeeded. && +exit + +echo Build failed. && +echo failed +exit 1 diff --git a/scripts/build_fatty.sh b/scripts/build_fatty.sh new file mode 100644 index 0000000..8dae2fc --- /dev/null +++ b/scripts/build_fatty.sh @@ -0,0 +1,31 @@ +#!/bin/bash +#this will run in WSL environment +set -e + + +if [[ ! -d fatty_build ]]; then + mkdir fatty_build +fi + +cd fatty_build + +if [[ ! -d fatty ]]; then + git clone --depth 1 https://github.com/paolo-sz/fatty.git +fi + +cd fatty +#remove any links as cygwin cannot handle links properly +for link in $(find src/ -type l) +do + loc="$(dirname "$link")" + file="$(readlink "$link")" + rm $link + cp "src/$file" "$loc" +done +pwd +#build using cygwin +/mnt/c/cygwin64/bin/bash.exe -c ../../../scripts/compile_fatty.sh + +version=$(printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"-1) +rm -f ../../fatty-$version.7z +7z a ../../fatty-$version.7z fatty diff --git a/src/check-update.sh b/scripts/check-update.sh old mode 100755 new mode 100644 similarity index 100% rename from src/check-update.sh rename to scripts/check-update.sh diff --git a/scripts/compile_fatty.sh b/scripts/compile_fatty.sh new file mode 100644 index 0000000..854217c --- /dev/null +++ b/scripts/compile_fatty.sh @@ -0,0 +1,12 @@ +#!/bin/bash +#this will run in cygwin environment +export PATH=/bin + +make -j +strip src/fatty.exe + +mkdir -p fatty/{bin,doc,etc/lang} +cp bin/fatty.exe fatty/bin +cp /bin/{cyggcc_s-seh-1.dll,cygstdc++-6.dll,cygwin-console-helper.exe,cygwin1.dll} fatty/bin +cp VERSION LICENSE* README.md fatty/doc +cp lang/*.po fatty/etc/lang diff --git a/scripts/package.sh b/scripts/package.sh new file mode 100644 index 0000000..c6189b2 --- /dev/null +++ b/scripts/package.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +set -e + +if [[ ! -d ../release ]]; then + mkdir -p ../release +fi + + +cd ../build +[[ -e .debug ]] && { + mkdir -p wsl-terminal + cd wsl-terminal + cp -r build/{bin,etc} . + cp -r {*.exe,tools,cmdtool} ../../VERSION . + exit +} + +rm -rf wsl-terminal +mkdir -p wsl-terminal +cd wsl-terminal + +cp -r ../{bin,etc,doc} . +cp -r ../../src/{tools,cmdtool} ../../VERSION ../*.exe . +cp -r ../../{LICENSE,README.md} doc/ +rm -f ../*.exe +cd .. + +version="$(cat ../VERSION)" +rm -f ../release/wsl-terminal-${version}.7z +7z a ../release/wsl-terminal-${version}.7z wsl-terminal +rm -f ../release/wsl-terminal-${version}.zip +7z a ../release/wsl-terminal-${version}.zip wsl-terminal + +rm -rf ../output && cp -r wsl-terminal ../output + +# fatty +cd wsl-terminal +cp ../fatty/bin/fatty.exe bin/mintty.exe +cp ../fatty/bin/*.dll bin/ +cp -r ../fatty/doc/ doc/fatty +rm -r etc/lang +cp -r ../fatty/etc/lang etc/ +rm -r doc/mintty +mv etc/minttyrc etc/fattyrc +echo "_tabbed" >> VERSION +cd .. + +mv wsl-terminal wsl-terminal-tabbed + +rm -f ../release/wsl-terminal-tabbed-${version}.7z +7z a ../release/wsl-terminal-tabbed-${version}.7z wsl-terminal-tabbed +rm -f ../release/wsl-terminal-tabbed-${version}.zip +7z a ../release/wsl-terminal-tabbed-${version}.zip wsl-terminal-tabbed + +rm -r wsl-terminal-tabbed diff --git a/src/prepare.sh b/scripts/prepare.sh old mode 100755 new mode 100644 similarity index 81% rename from src/prepare.sh rename to scripts/prepare.sh index 2a1a97d..aba0b3e --- a/src/prepare.sh +++ b/scripts/prepare.sh @@ -2,8 +2,8 @@ set -e -cygwin_version="3.1.2-1" -mintty_version="3.1.0-1" +cygwin_version="3.1.4-1" +mintty_version="3.1.4-1" fatty_version="r2549.ee7e4a1-1" wslbridge2_version="0.5" @@ -19,14 +19,18 @@ type wget >/dev/null && \ exit 1 } +cd .. mkdir -p build && cd build + + wget -nc http://mirrors.kernel.org/sourceware/cygwin/x86_64/release/cygwin/cygwin-${cygwin_version}.tar.xz wget -nc http://mirrors.kernel.org/sourceware/cygwin/x86_64/release/mintty/mintty-${mintty_version}.tar.xz -wget -nc https://github.com/goreliu/fatty-prebuilds/releases/download/${fatty_version}/fatty-${fatty_version}.7z wget -nc https://github.com/Biswa96/wslbridge2/releases/download/v${wslbridge2_version}/wslbridge2_cygwin_x86_64.7z wget -nc https://autohotkey.com/download/ahk.zip +../scripts/build_fatty.sh +pwd rm -rf bin etc usr doc tar -xvf cygwin-${cygwin_version}.tar.xz \ @@ -35,7 +39,7 @@ tar -xvf cygwin-${cygwin_version}.tar.xz \ usr/share/doc/Cygwin tar -xvf mintty-${mintty_version}.tar.xz usr/bin/mintty.exe usr/share/doc usr/share/mintty/lang -7z x -y fatty-${fatty_version}.7z fatty/bin/{fatty.exe,cyggcc_s-seh-1.dll,cygstdc++-6.dll} fatty/doc fatty/etc/lang +7z x -y fatty-*.7z fatty/bin/{fatty.exe,cyggcc_s-seh-1.dll,cygstdc++-6.dll} fatty/doc fatty/etc/lang 7z x -y wslbridge2_cygwin_x86_64.7z -ousr/bin @@ -43,7 +47,7 @@ rm usr/bin/rawpty.exe mkdir -p usr/share/doc/wslbridge2 wget -nc https://raw.githubusercontent.com/Biswa96/wslbridge2/v${wslbridge2_version}/LICENSE -Ousr/share/doc/wslbridge2/LICENSE -cp -r ../etc . +cp -r ../src/etc . rm -rf bin doc mv usr/bin usr/share/doc . mv usr/share/mintty/lang etc/ @@ -55,5 +59,5 @@ cd .. cat > "doc/wsl-terminal home.url" <