Skip to content

Commit

Permalink
Merge pull request #7 from VitoVan/fix-windows-libzstd
Browse files Browse the repository at this point in the history
fix: add libzstd.dll when packing windows binary
  • Loading branch information
VitoVan authored Sep 30, 2022
2 parents 0a78539 + b3052d1 commit 88e01f4
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,12 @@ jobs:
unzip
p7zip
mingw-w64-x86_64-gcc
mingw-w64-x86_64-zstd
make
diffutils
git
- name: Install Host SBCL
shell: msys2 {0}
run: |
Expand Down
12 changes: 11 additions & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ then
fi
mkdir -p out/tmp
cp ./bin/color-picker.exe ./out/tmp/color-picker.exe
# copy libzstd
ls -lah /d/msys64/
cp /d/msys64/mingw64/bin/libzstd.dll ./out/tmp/libzstd.dll
bin/rh/rh.exe -open ./bin/tclkit-gui.exe -save ./out/tmp/tclkit-gui-noicon.exe -action delete -mask ICONGROUP,,
bin/rh/rh.exe -open ./out/tmp/tclkit-gui-noicon.exe -save ./out/tmp/tclkit-gui.exe -action addskip -res ./resources/iconfile.ico -mask ICONGROUP,TK
rm -rf ./out/tmp/tclkit-gui-noicon.exe
Expand All @@ -80,7 +83,14 @@ then
mkdir -p $OSX_APP_DIR
cp ./resources/Info.plist $OSX_APP_DIR/
mkdir -p $OSX_APP_DIR/MacOS
cp ./bin/color-picker ./bin/tclkit-gui $OSX_APP_DIR/MacOS
cp ./bin/color-picker $OSX_APP_DIR/MacOS/color-picker-bin
cp ./bin/tclkit-gui $OSX_APP_DIR/MacOS/

# copy libzstd
cp /usr/local/lib/libzstd.1.dylib $OSX_APP_DIR/MacOS/
# set DYLD fallback
cp ./resources/color-picker.sh $OSX_APP_DIR/MacOS/color-picker
chmod +x $OSX_APP_DIR/MacOS/*
mkdir -p $OSX_APP_DIR/Resources
cp ./resources/iconfile.icns $OSX_APP_DIR/Resources
cd out && zip -r -9 color-picker$APP.zip color-picker.app && cd ..
Expand Down
25 changes: 25 additions & 0 deletions resources/color-picker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
export USER_DIR=$(pwd)/

# https://stackoverflow.com/questions/59895/how-can-i-get-the-source-directory-of-a-bash-script-from-within-the-script-itsel
SOURCE="${BASH_SOURCE[0]:-$0}";
while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname -- "$SOURCE"; )" &> /dev/null && pwd 2> /dev/null; )";
SOURCE="$( readlink -- "$SOURCE"; )";
[[ $SOURCE != /* ]] && SOURCE="${DIR}/${SOURCE}"; # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR="$( cd -P "$( dirname -- "$SOURCE"; )" &> /dev/null && pwd 2> /dev/null; )";

cd $DIR



if [[ "$OSTYPE" == "linux-gnu"* ]]; then
# LD_LIBRARY_PATH=./ ./color-picker-bin
echo "NO NEED TO CALL THIS FILE"
elif [[ "$OSTYPE" == "darwin"* ]]; then
DYLD_FALLBACK_LIBRARY_PATH=./ ./color-picker-bin
else
echo "Unknown Platform."
fi

0 comments on commit 88e01f4

Please sign in to comment.