package_release.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. #!/usr/bin/env bash
  2. # Packs a finished build into a relocatable tarball: the binary, its library, CEF's runtime files
  3. # and the shared kissfft, all found through the $ORIGIN runpath `cmake --install` sets. The install
  4. # tree also carries the dependencies' own tools, headers and static libs, those are left out.
  5. #
  6. # Usage:
  7. # tools/package_release.sh <build-dir> <package-name> <output-dir>
  8. #
  9. # Writes <output-dir>/<package-name>.tar.gz with a single <package-name>/ folder inside.
  10. set -euo pipefail
  11. build_dir="$(realpath "$1")"
  12. name="$2"
  13. out_dir="$(realpath "$3")"
  14. work="$(mktemp -d)"
  15. trap 'rm -rf "$work"' EXIT
  16. cmake --install "$build_dir" --prefix "$work/install" >/dev/null
  17. pkg="$work/$name"
  18. mkdir -p "$pkg/lib"
  19. cd "$work/install"
  20. cp -a linux-wallpaperengine liblinux-wallpaperengine-lib.so libcef.so libEGL.so libGLESv2.so \
  21. libvk_swiftshader.so vk_swiftshader_icd.json chrome-sandbox icudtl.dat v8_context_snapshot.bin \
  22. ./*.pak locales "$pkg/"
  23. cp -a lib/libkissfft-float.so* "$pkg/lib/"
  24. # CEF ships libcef.so with debug symbols, 1.4 GB instead of about 220 MB
  25. strip --strip-unneeded "$pkg/linux-wallpaperengine" "$pkg/liblinux-wallpaperengine-lib.so" "$pkg/libcef.so"
  26. mkdir -p "$out_dir"
  27. tar -czf "$out_dir/$name.tar.gz" -C "$work" "$name"
  28. echo "Wrote $out_dir/$name.tar.gz"