Skip to content

Instantly share code, notes, and snippets.

@CyberShadow
Created September 25, 2021 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CyberShadow/df49946888ad1ea683729f57c5e59d8a to your computer and use it in GitHub Desktop.
Save CyberShadow/df49946888ad1ea683729f57c5e59d8a to your computer and use it in GitHub Desktop.
btdu-static-x86_64 build script
#!/bin/bash
set -eEuo pipefail
cd ..
args=(
ldc2
-i
-ofbtdu-static-x86_64
-L-Lrelease
-L-l:libtermcap.a
-L-l:libncursesw.a
-L-l:libtinfo.a
-L-lz
-flto=full
# -defaultlib=phobos2-ldc-lto,druntime-ldc-lto
# -nodefaultlib
# -L-l:libphobos2-ldc-lto.a
# -L-l:libdruntime-ldc-lto.a
# # ,druntime-ldc-lto
# -link-defaultlib-shared=false
-static
-O --release
source/btdu/main
)
while read -r path
do
args+=(-I"$path")
done < <(dub describe | jq -r '.targets[] | select(.rootPackage=="btdu") | .buildSettings.importPaths[]')
# patch -N -p 1 -d ~/.dub/packages/ncurses-0*/ncurses < release/d-ncurses.patch || true
"${args[@]}"
strip btdu-static-x86_64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment