aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'gkbuilds/libgcrypt.gkbuild')
-rw-r--r--gkbuilds/libgcrypt.gkbuild46
1 files changed, 46 insertions, 0 deletions
diff --git a/gkbuilds/libgcrypt.gkbuild b/gkbuilds/libgcrypt.gkbuild
new file mode 100644
index 0000000..a6686d3
--- /dev/null
+++ b/gkbuilds/libgcrypt.gkbuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+src_configure() {
+ export ac_cv_sys_symbol_underscore=no
+
+ local myconf=(
+ --enable-static=yes
+ --disable-padlock-support
+ --enable-static=yes
+ )
+
+ gkconf "${myconf[@]}"
+}
+
+src_install() {
+ default
+
+ rm -rf \
+ "${D}"/usr/bin/dumpsexp \
+ "${D}"/usr/bin/hmac256 \
+ "${D}"/usr/bin/mpicalc \
+ "${D}"/usr/share
+
+ # libgcrypt-config tries to be smart and will omit include
+ # and lib dir due to set prefix
+ sed -i \
+ -e "s|/usr/include|/dont-try-to-be-smart|" \
+ -e "s|/usr/lib|/dont-try-to-be-smart|" \
+ "${D}"/usr/bin/libgcrypt-config \
+ || die "Failed to make libgcrypt-config dumb!"
+
+ mv "${D}"/usr/bin/libgcrypt-config "${D}"/usr/bin/libgcrypt-config.ori \
+ || die "Failed to rename '${D}/usr/bin/libgcrypt-config' to '${D}/usr/bin/libgcrypt-config.ori'!"
+
+ cat >"${D}"/usr/bin/libgcrypt-config <<-EOF
+ #!/bin/sh
+
+ SYSROOT=\$(dirname "\$(dirname "\$(dirname "\$(readlink -fm "\$0")")")")
+
+ exec "\${SYSROOT}"/usr/bin/libgcrypt-config.ori "\$@" | sed -e 's#/#'\${SYSROOT}'/#'
+ EOF
+
+ chmod +x "${D}"/usr/bin/libgcrypt-config \
+ || die "Failed to chmod of '${D}/bin/libgcrypt-config'!"
+}