]> git.armaanb.net Git - asd-repo.git/blobdiff - ccache/build
ccache: new package at 4.3
[asd-repo.git] / ccache / build
diff --git a/ccache/build b/ccache/build
new file mode 100755 (executable)
index 0000000..fdefd5d
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh -e
+
+export DESTDIR="$1"
+export CFLAGS="$CFLAGS -static"
+export CXXFLAGS="$CXXFLAGS -static"
+
+cmake -B build \
+    -DCMAKE_INSTALL_PREFIX=/usr \
+    -DCMAKE_BUILD_TYPE=Release \
+    -DENABLE_TESTING=OFF \
+    -DZSTD_LIBRARY=/usr/lib/libzstd.a
+
+cmake --build   build
+cmake --install build
+
+mkdir -p "$1/usr/lib/ccache/bin"
+host=$(cc -dumpmachine)
+
+for link in \
+    cc  "$host-cc"  \
+    cpp "$host-cpp" \
+    c++ "$host-c++" \
+    clang clang++
+do
+    ln -sf /usr/bin/ccache "$1/usr/lib/ccache/bin/$link"
+done