devel/gmake/ndmake.sh
$ cat ndmake.sh
#!/bin/sh -ue
NAME=gmake
VERSION=4.4.1
RELEASE=1
SOURCE="https://gnu.mirror.constant.com/make/make-${VERSION}.tar.gz"
build() {
msg "patching Makefile.am for hell..."
# this is test-suite shell stuff, not part of the build
sed -i '184,206d' Makefile.am || die "Makefile.am patch failed"
msg "generating hell metadata..."
demiurge . || die "demiurge failed"
msg "generating ninja files with hell..."
satan gen \
-DCFLAGS="${CFLAGS} -std=gnu89" \
-DCOND_HAVE_GUILE=0 \
-DUNDEF_HAVE_GUILE=1 \
-DCOND_USE_CUSTOMS=0 \
-DREMOTE=stub \
-DCOND_WINDOWSENV=0 \
-DUNDEF_WINDOWS32=1 \
-DUNDEF_HAVE_DOS_PATHS=1 \
-DCOND_KNOWN_PREFIX=1 \
-DUNDEF_MAKE_LOAD=1 \
-DCOND_GL_GENERATE_ALLOCA_H=1 \
-DCOND_GL_COND_OBJ_GETLOADAVG=0 \
-DCOND_USE_SYSTEM_GLOB=0 \
-DLIBINTL= \
-DGETLOADAVG_LIBS= \
-DAM_LDFLAGS= \
-DDEF_FILE_TIMESTAMP_HI_RES=1 \
-DDEF_HAVE_DECL_BSD_SIGNAL=1 \
-DDEF_HAVE_DECL_GETLOADAVG=1 \
-DDEF_HAVE_STDBOOL_H=1 \
-DDEF_HAVE_DIRENT_H=1 \
-DDEF_HAVE_STRUCT_DIRENT_D_TYPE=1 \
-DDEF_ST_MTIM_NSEC=st_mtim.tv_nsec \
-DUNDEF_HAVE_UNION_WAIT=1 \
-DCHECK_PKG= \
-DEXTRA_PKG= \
PREFIX="$PREFIX" DESTDIR="$PKG" . || die "satan gen failed"
msg "fixing generated config headers..."
cp src/config.h config.h || die "config.h copy failed"
sed -i "/^#define PATH_SEPARATOR_CHAR /c\\#define PATH_SEPARATOR_CHAR ':'" config.h || die "config.h patch failed"
sed -i "/^#define PATH_SEPARATOR_CHAR /c\\#define PATH_SEPARATOR_CHAR ':'" src/config.h || die "src/config.h patch failed"
msg "building gmake with hell..."
samu || die "samu build failed"
msg "installing gmake..."
samu install || die "samu install failed"
msg "fixing install layout..."
mkdir -p "$PKG$PREFIX/bin" "$PKG$PREFIX/share/man/man1" "$PKG$PREFIX/include" || die "mkdir failed"
[ -f "$PKG$PREFIX/bin/make" ] || die "installed make binary missing"
mv "$PKG$PREFIX/bin/make" "$PKG$PREFIX/bin/gmake" || die "failed to rename make to gmake"
install -m 644 doc/make.1 "$PKG$PREFIX/share/man/man1/gmake.1" || die "failed to install gmake.1"
[ -f "$PKG$PREFIX/include/src/gnumake.h" ] && mv "$PKG$PREFIX/include/src/gnumake.h" "$PKG$PREFIX/include/gnumake.h"
[ -d "$PKG$PREFIX/include/src" ] && rmdir "$PKG$PREFIX/include/src" 2>/dev/null || true
}
. ${0%/*}/../../libsh/libdmake.sh
