From d7f79349e1b1bae8a4bd848977f7e25045ba71bf Mon Sep 17 00:00:00 2001
From: Cem Keylan <cem@ckyln.com>
Date: Fri, 24 Jun 2022 16:16:31 +0200
Subject: xz: link binaries statically

---
 core/xz/build | 12 ++++++++++++
 1 file changed, 12 insertions(+)

(limited to 'core/xz/build')

diff --git a/core/xz/build b/core/xz/build
index 6daf22f8..606cc351 100755
--- a/core/xz/build
+++ b/core/xz/build
@@ -5,3 +5,15 @@
 
 make
 make DESTDIR="$1" install
+
+# Link the binaries statically
+cd src
+rm -f xz/xz lzmainfo/lzmainfo xzdec/lzmadec xzdec/xzdec
+
+make LDFLAGS=-all-static -C xz
+make LDFLAGS=-all-static -C lzmainfo
+make LDFLAGS=-all-static -C xzdec
+
+for bin in xz/xz lzmainfo/lzmainfo xzdec/lzmadec xzdec/xzdec; do
+    clinst -m755 "$bin" "$1/usr/bin/${bin##*/}"
+done
-- 
cgit v1.2.3