Files
BMLFS/build-scripts/libgcrypt.build
2025-06-20 22:35:40 -05:00

83 lines
3.4 KiB
Bash

#! /bin/bash
# libgcrypt
# Source: https://www.gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.11.1.tar.bz2
#
# $BUILD = Directory to temporarily install
# $PKGS = Directory to store built packages
#
# DEPS
# Required: libgpg-error
# Recommended: NONE
# Optional: Pth
# If optimizing with GCC
export CFLAGS="-march=native -pipe "
export CFLAGS+="-O3 -Os -fdata-sections -ffat-lto-objects "
export CFLAGS+="-ffunction-sections -flto=auto -fno-semantic-interposition "
export CFLAGS+="-fstack-protector-strong -fzero-call-used-regs=used "
export LDFLAGS="-flto=auto -Wl,-O2 -Wl,--as-needed "
export PVER="1.11.1"
case $(uname -m) in
arm*) export gcry_cv_gcc_arm_platform_as_ok=no ;;
i686 | x86_64) export ECONFIG="--enable-padlock-support" ;;
esac &&
# If building with LLVM-17's LLD, set the LDFLAGS
# https://github.com/termux/termux-packages/issues/18761#issuecomment-1864098542
LDFLAGS="-Wl,--undefined-version" \
ac_cv_sys_symbol_underscore=no \
./configure --prefix=/usr $BUILDTRUPLE ${ECONFIG} &&
read -p "Compile?" && make -j2 &&
unset ECONFIG &&
sudo -S make DESTDIR=$BUILD install &&
sudo -S mkdir -pv /BMAN/install
sudo -S mkdir -pv /BMAN/usr/share
sudo -S mv $BUILD/usr/share/info /BMAN/usr/share/
sudo -S mv $BUILD/usr/share/man /BMAN/usr/share/
cd $BUILD && sudo -S mkdir -v ${BUILD}/install &&
cat > /tmp/slack-desc << "EOF"
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
libgcrypt: libgcrypt (general purpose cryptographic library)
libgcrypt:
libgcrypt: This is a general purpose cryptographic library based on the code
libgcrypt: from GnuPG. It provides functions for all cryptograhic building
libgcrypt: blocks: symmetric ciphers (AES, DES, Blowfish, CAST5, Twofish,
libgcrypt: Arcfour), hash algorithms (MD4, MD5, RIPE-MD160, SHA-1, TIGER-192),
libgcrypt: MACs (HMAC for all hash algorithms), public key algorithms
libgcrypt: (RSA, ElGamal, DSA), large integer functions, random numbers and a
libgcrypt: lot of supporting functions.
libgcrypt:
libgcrypt: libgcrypt home: http://directory.fsf.org/security/libgcrypt.html
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S makepkg -l y -c n $PKGS/libgcrypt-$PVER-$PSUFFIX &&
cd /BMAN
cat > /tmp/slack-desc << "EOF"
libgcrypt-doc: Manuals for libgcrypt (general purpose cryptographic library)
libgcrypt-doc:
libgcrypt-doc: This is a general purpose cryptographic library based on the code
libgcrypt-doc: from GnuPG. It provides functions for all cryptograhic building
libgcrypt-doc: blocks: symmetric ciphers (AES, DES, Blowfish, CAST5, Twofish,
libgcrypt-doc: Arcfour), hash algorithms (MD4, MD5, RIPE-MD160, SHA-1, TIGER-192),
libgcrypt-doc: MACs (HMAC for all hash algorithms), public key algorithms
libgcrypt-doc: (RSA, ElGamal, DSA), large integer functions, random numbers and a
libgcrypt-doc: lot of supporting functions.
libgcrypt-doc: libgcrypt home: http://directory.fsf.org/security/libgcrypt.html
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S makepkg -l y -c n $PKGS/libgcrypt-doc-$PVER-$NOPSUFFIX
sudo -S rm -rf /BMAN/*
sudo -S rm -rf ${BUILD}/*
unset PVER