diff --git a/contrib/reproducible/guix/build.sh b/contrib/reproducible/guix/build.sh index 17cd8731..d8d6535d 100755 --- a/contrib/reproducible/guix/build.sh +++ b/contrib/reproducible/guix/build.sh @@ -35,11 +35,19 @@ RUSTC_BOOTSTRAP=1 cargo -vvv \ --release \ --target-dir "/out" -# Assume 64bits. Even bitcoind doesn't ship 32bits binaries for x86. -# FIXME: is there a cleaner way than using patchelf for this? -patchelf --set-interpreter /lib64/ld-linux-x86-64.so.2 "/out/release/$BINARY_NAME" +if [ "$IS_GUI" = "1" ]; then + BIN_NAMES="liana-gui" +else + BIN_NAMES="lianad liana-cli" +fi -# FIXME: Find a way to use GUIX_LD_WRAPPER_DISABLE_RPATH=yes instead -patchelf --remove-rpath "/out/release/$BINARY_NAME" +for bin_name in $BIN_NAMES; do + # Assume 64bits. Even bitcoind doesn't ship 32bits binaries for x86. + # FIXME: is there a cleaner way than using patchelf for this? + patchelf --set-interpreter /lib64/ld-linux-x86-64.so.2 "/out/release/$bin_name" + + # FIXME: Find a way to use GUIX_LD_WRAPPER_DISABLE_RPATH=yes instead + patchelf --remove-rpath "/out/release/$bin_name" +done set +ex diff --git a/contrib/reproducible/guix/guix-build.sh b/contrib/reproducible/guix/guix-build.sh index d08687b5..128cbcc6 100755 --- a/contrib/reproducible/guix/guix-build.sh +++ b/contrib/reproducible/guix/guix-build.sh @@ -104,9 +104,9 @@ for project_folder in "" "gui"; do # FIXME: find a cleaner way to get the binary name, or get rid of patchelf entirely # Note: we also rely on it in manifest.scm if [ "$project_folder" = "" ]; then - BINARY_NAME="lianad" + IS_GUI=0 elif [ "$project_folder" = "gui" ]; then - BINARY_NAME="liana-gui" + IS_GUI=1 else echo "Can't determine binary name" exit 1 @@ -114,10 +114,10 @@ for project_folder in "" "gui"; do # Bootstrap a reproducible environment as specified by the manifest in an isolated # container, and build the project. - # NOTE: it looks like "--rebuild-cache" is necessary for the BINARY_NAME variable to + # NOTE: it looks like "--rebuild-cache" is necessary for the IS_GUI variable to # be taken into account when building the container (otherwise the GUI container could # miss some dependencies). - BINARY_NAME="$BINARY_NAME" time_machine shell --no-cwd \ + IS_GUI="$IS_GUI" time_machine shell --no-cwd \ --expose="$PROJECT_ROOT/src=/liana/src" \ --expose="$PWD/gui/static=/liana/static" \ --expose="$PROJECT_ROOT/Cargo.toml=/liana/Cargo.toml" \ @@ -131,7 +131,7 @@ for project_folder in "" "gui"; do --fallback \ --rebuild-cache \ -m $PWD/contrib/reproducible/guix/manifest.scm \ - -- env CC=gcc VENDOR_DIR="$PROJECT_VENDOR_DIR" TARGET_DIR="$PROJECT_OUT_DIR" BINARY_NAME="$BINARY_NAME" JOBS="$JOBS" \ + -- env CC=gcc VENDOR_DIR="$PROJECT_VENDOR_DIR" TARGET_DIR="$PROJECT_OUT_DIR" IS_GUI="$IS_GUI" JOBS="$JOBS" \ /bin/sh -c "cd /liana && ./build.sh" done diff --git a/contrib/reproducible/guix/manifest.scm b/contrib/reproducible/guix/manifest.scm index 5ea7a81a..8bba3395 100644 --- a/contrib/reproducible/guix/manifest.scm +++ b/contrib/reproducible/guix/manifest.scm @@ -6,9 +6,9 @@ "patchelf" "gcc-toolchain@10.3.0") ;; Additional dependencies for building the GUI - (let ((binary_name (getenv "BINARY_NAME"))) + (let ((is_gui (getenv "IS_GUI"))) (if - (string=? binary_name "liana-gui") + (string=? is_gui "1") (list "pkg-config" "eudev" "fontconfig")