-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(prebuild): support of Alpine binaries
- update dependencies - rework binding.gyp - rework msys bundle for Windows - add bundle for MUSL (Alpine) - rework bundle scripts and ci moved to prebuild
- Loading branch information
Showing
22 changed files
with
335 additions
and
543 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env sh | ||
|
||
apk --no-cache add build-base cairo-dev jpeg-dev pango-dev giflib-dev librsvg-dev pixman-dev patchelf lddtree |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env sh | ||
|
||
apk --purge del build-base cairo* jpeg* pango* giflib* librsvg* pixman* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env sh | ||
|
||
TARGET=./source/build/Release | ||
|
||
for lib in $(lddtree -l ${TARGET}/canvas.node|sed -r -e '/canvas.node$/d'); do | ||
echo "Copy ${lib}" | ||
cp -L "${lib}" "${TARGET}" | ||
patchelf --force-rpath --set-rpath '$ORIGIN' "${TARGET}/$(basename -- "${lib}")" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
|
||
apt-get update | ||
apt-get install -y build-essential libcairo2-dev libjpeg-dev libpango1.0-dev libgif-dev librsvg2-dev libpixman-1-dev patchelf pax-utils |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
apt-get purge -y build-essential libcairo2* libjpeg* libpango1.0* libgif* librsvg2* libpixman-1* | ||
#apt-get autoremove --purge -y |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/usr/bin/env sh | ||
|
||
LIBS=() | ||
|
||
WINDIR=$(cygpath -u -W) | ||
|
||
shopt -s nocasematch | ||
function addToLibs() { | ||
local TARGET=${1} && shift | ||
if [[ "$(which "${TARGET}")" == "${WINDIR}"* ]]; then | ||
: | ||
else | ||
for lib in ${LIBS[@]}; do | ||
if [[ "${lib}" == "${TARGET}" ]]; then | ||
return | ||
fi | ||
done | ||
echo $TARGET | ||
fi | ||
} | ||
|
||
RECURSE_INDEX=0 | ||
|
||
function getLibsForBinary() { | ||
local TARGET=$1 && shift | ||
|
||
local -i count=0 | ||
for binLib in $(objdump -p "$(cygpath -u "${TARGET}")" | grep "DLL Name:"| sed -e 's/^\s*DLL\sName:\s*//'); do | ||
if [[ ! -z "$(addToLibs ${binLib})" ]]; then | ||
echo "added ${binLib}" | ||
count=$count+1 | ||
LIBS+=("${binLib}") | ||
fi | ||
done | ||
|
||
if [[ count -gt 0 ]]; then | ||
local CURRENT_INDEX=${RECURSE_INDEX} | ||
RECURSE_INDEX=${#LIBS[@]} | ||
# recurse if any added from last checked | ||
echo "recurse check after ${count} added" | ||
for lib in ${LIBS[@]:${CURRENT_INDEX}}; do | ||
getLibsForBinary "$(which "${lib}")" | ||
done | ||
fi | ||
} | ||
|
||
function copyLibs() { | ||
local TARGET=$1 && shift | ||
local TARGET_PATH=$(cygpath -u "${TARGET}") | ||
for lib in ${LIBS[@]}; do | ||
echo "copy ${lib} to destination" | ||
cp "$(which "${lib}")" "${TARGET_PATH}" | ||
done | ||
} | ||
|
||
getLibsForBinary "./source/build/Release/canvas.node" | ||
copyLibs "./source/build/Release" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.