Files
BMLFS/build-scripts/nspr.build
2020-10-13 00:18:23 -05:00

65 lines
2.3 KiB
Bash

#! /bin/bash
# NSPR 4.29
# Source: https://archive.mozilla.org/pub/nspr/releases/v4.29/src/nspr-4.29.tar.gz
#
# $BUILD = Directory to temporarily install
# $PKGS = Directory to store built packages
#
# DEPS
# Required: NONE
# Recommended: NONE
# Optional: NONE
export CFLAGS="$CFLAGS -D_PR_POLL_AVAILABLE -D_PR_HAVE_OFF64_T -D_PR_INET6 -D_PR_HAVE_INET_NTOP -D_PR_HAVE_GETHOSTBYNAME2 -D_PR_HAVE_GETADDRINFO -D_PR_INET6_PROBE"
cd nspr &&
sed -ri 's#^(RELEASE_BINS =).*#\1#' pr/src/misc/Makefile.in &&
sed -i 's#$(LIBRARY) ##' config/rules.mk &&
./configure --prefix=/usr \
--with-mozilla --enable-ipv6 --libdir=/usr/lib \
--with-pthreads --enable-optimize --includedir=/usr/include/nspr \
$([ $(uname -m) = x86_64 ] && echo --enable-64bit) $BUILDTRUPLE &&
read -p "Compile?" && make -j2 &&
read -p "Install?" &&
# If not using any package manager:
#sudo -S make install &&
sudo -S make DESTDIR=$BUILD install &&
unset CFLAGS &&
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------------------------------------------------------|
nspr: nspr (Netscape Portable Runtime)
nspr:
nspr: Netscape Portable Runtime (NSPR) provides a platform-neutral API for
nspr: system level and libc like functions. The API is used in the Mozilla
nspr: clients and many of Red Hat's, Sun's, and other software offerings.
nspr:
nspr: Homepage: https://www.mozilla.org/projects/nspr/
nspr:
nspr:
nspr:
nspr:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S sed -i "s|\(-specs=.*hardened-ld\)||g" usr/bin/nspr-config &&
sudo -S ln -s nspr.pc usr/lib/pkgconfig/mozilla-nspr.pc &&
sudo -S rm -r usr/bin/{compile-et.pl,prerr.properties} \
usr/include/nspr/md &&
sudo -S makepkg -l y -c n $PKGS/nspr-4.29-$(uname -m)-mlfs.txz &&
sudo -S rm -rf ${BUILD}/*