aboutsummaryrefslogtreecommitdiff
path: root/extra/efivar/build
diff options
context:
space:
mode:
authorCem Keylan <cem@ckyln.com>2020-06-25 09:58:38 +0300
committerCem Keylan <cem@ckyln.com>2020-06-25 09:58:38 +0300
commit2ac055d2850e4cadd8e0e7b789d5694937c3c0d0 (patch)
tree5d7ca6d65e00169d89d55dff659860154506546a /extra/efivar/build
parentf24fd83d42ffbc0dc843f55e381b130833fea74d (diff)
downloadrepository-2ac055d2850e4cadd8e0e7b789d5694937c3c0d0.tar.gz
efivar: link statically
Diffstat (limited to 'extra/efivar/build')
-rwxr-xr-xextra/efivar/build41
1 files changed, 31 insertions, 10 deletions
diff --git a/extra/efivar/build b/extra/efivar/build
index 47473ecc..e51181da 100755
--- a/extra/efivar/build
+++ b/extra/efivar/build
@@ -1,13 +1,11 @@
#!/bin/sh -e
-# The order here matters.
-patch -p1 < b98ba8921010d03f46704a476c69861515deb1ca.patch
-patch -p1 < c3c553db85ff10890209d0fe48fb4856ad68e4e0.patch
-patch -p1 < 0dad6d78a7fb5f6c5fb4a1d646040539db6cf865.patch
-patch -p1 < fdb803402fb32fa6d020bac57a40c7efe4aabb7d.patch
-patch -p1 < 4e04afc2df9bbc26e5ab524b53a6f4f1e61d7c9e.patch
-
-# Avoid repeating ourselves.
+export LDFLAGS="$LDFLAGS -static"
+
+for patch in *.patch; do
+ patch -p1 < "$patch"
+done
+
mk() {
make \
libdir=/usr/lib/ \
@@ -17,5 +15,28 @@ mk() {
"$@"
}
-mk
-mk DESTDIR="$1" install
+(
+ cd src
+
+ # Build static targets.
+ mk libefiboot.a libefivar.a efivar-static efiboot.pc efivar.pc
+
+ # Install the binary.
+ install -Dm755 efivar-static "$1/usr/bin/efivar"
+
+ # Install libraries.
+ install -Dm644 libefiboot.a "$1/usr/lib/libefiboot.a"
+ install -Dm644 libefivar.a "$1/usr/lib/libefivar.a"
+
+ # Install pkgconf files.
+ install -Dm644 efiboot.pc "$1/usr/lib/pkgconfig/efiboot.pc"
+ install -Dm644 efivar.pc "$1/usr/lib/pkgconfig/efivar.pc"
+
+ # Install headers.
+ find include -type f | while read -r header; do
+ install -Dm644 "$header" "$1/usr/$header"
+ done
+)
+
+
+mk -C docs DESTDIR="$1" install