diff options
author | Charadon <dev@iotib.net> | 2022-09-27 16:01:10 -0400 |
---|---|---|
committer | Charadon <dev@iotib.net> | 2022-09-27 16:01:10 -0400 |
commit | 6b89e4444bd85b88579fd7010cc6738afd5b8d50 (patch) | |
tree | 0e60bd3a2c86ee392846ef63099be9ec136660d0 | |
parent | 79bcce4e30c2f089bdbb348917afe835df274028 (diff) | |
download | Pong-C-6b89e4444bd85b88579fd7010cc6738afd5b8d50.tar.gz |
distribute.sh: Added more platforms
distribute.sh: Switched from xz to gzip for more portability.
-rwxr-xr-x | distribute.sh | 44 |
1 files changed, 39 insertions, 5 deletions
diff --git a/distribute.sh b/distribute.sh index 55f684c..2700fac 100755 --- a/distribute.sh +++ b/distribute.sh @@ -12,7 +12,8 @@ else fi set -u -WINDOWS="false" +WINDOWS="false" # Windows needs special treatment +mkdir -p "$CONFIG_INSTALL_PREFIX/libs" case "$(uname -s)" in MINGW*) for i in $(ldd "$CONFIG_BUILD_DIR"/bin/Pong* | awk '/mingw*/ {print $3}'); @@ -21,14 +22,47 @@ case "$(uname -s)" in done WINDOWS="true" ;; - *) - mkdir -p "$CONFIG_INSTALL_PREFIX/libs" - # This is a catch all, above are specific loops for specific platforms. + Linux) for i in $(ldd "$CONFIG_BUILD_DIR"/bin/Pong* | awk '/usr/ {print $3}'); do cp "$i" "$CONFIG_INSTALL_PREFIX/libs/" done ;; + NetBSD) + # NetBSD, unlike the other BSDs keep their packages in /usr/pkg + for i in $(ldd "$CONFIG_BUILD_DIR"/bin/Pong* | awk '/usr\/pkg/ {print $3}'); + do + cp "$i" "$CONFIG_INSTALL_PREFIX/libs/" + done + ;; + *BSD) + # BSDs keep installed packages in /usr/local + for i in $(ldd "$CONFIG_BUILD_DIR"/bin/Pong* | awk '/usr\/local/ {print $3}'); + do + cp "$i" "$CONFIG_INSTALL_PREFIX/libs/" + done + ;; + Darwin) + # Try to see if my otool-tree program is there, if not, just use otool. + # (WARNING: otool on it's own, only shows directly linked libraries, but + # doesn't show the libraries needed by those said libraries. + if which otool-tree > /dev/null; + then + for i in $(otool-tree "$CONFIG_BUILD_DIR"/bin/Pong* | awk '/usr\/local/'); + do + cp "$i" "$CONFIG_INSTALL_PREFIX/libs/" + done + else + for i in $(otool -L "$CONFIG_BUILD_DIR"/bin/Pong* | awk '/usr\/local/{print $1}'); + do + cp "$i" "$CONFIG_INSTALL_PREFIX/libs/" + done + fi + ;; + *) + echo "Unsupported System for distribute.sh, you'll have to package it yourself. =(" + exit 1 + ;; esac cd "$CONFIG_INSTALL_PREFIX" @@ -51,5 +85,5 @@ else rm libs/libdrm* # Remove libstdc++ rm libs/libstdc++* - bsdtar --options xz:compression-level=9 -caf ../Pong_"$(uname -s)-$(uname -r)-$(uname -m)".txz -- * + bsdtar --options gzip:compression-level=9 -caf ../Pong_"$(uname -s)-$(uname -r)-$(uname -m)".tgz -- * fi |