#!/bin/sh # Build script for XNEdit 1.6.3 (classic NEdit-style, target-keyed plain # Makefile - NOT Template A/autotools). The top-level Makefile has no # uname-autodetect: it dispatches on an explicit `make ` name to # `makefiles/Makefile.`, so we add our own # makefiles/Makefile.hammerhead (patches/0001-add-makefile-hammerhead.patch) # rather than adapting an existing OS's file in place. set -e PORTDIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) cd "$SRCDIR" for p in "$PORTDIR"/patches/*.patch; do [ -f "$p" ] || continue echo "==> Applying patch: $(basename "$p")" patch -p1 < "$p" done export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig:$PREFIX/share/pkgconfig:/usr/lib/pkgconfig:$PKG_CONFIG_PATH" gmake -j${JOBS:-1} hammerhead # `install:` target respects PREFIX/DESTDIR as make ARGs (not env) - # see the openssl-vendor-wrapper DESTDIR gotcha. gmake install PREFIX="$PREFIX" DESTDIR="$PKGDIR" # XNEdit - classic NEdit-style Motif text editor # https://github.com/unixwork/xnedit [package] name = "xnedit" version = "1.6.3" release = 1 description = "NEdit-style plain text editor (Motif)" url = "https://github.com/unixwork/xnedit" license = "GPL-2.0-or-later" maintainer = "Chris Tusa " arch = "x86_64" [dependencies] runtime = ["motif", "libXt", "libX11", "libXext", "libXft", "fontconfig"] build = ["motif", "libXt", "libX11", "libXext", "libXft", "fontconfig"] [[source]] file = "xnedit-1.6.3.tar.gz" urls = ["https://github.com/unixwork/xnedit/archive/refs/tags/v1.6.3.tar.gz"] checksum = "069f4d40445ef5db636975e0f268ca11ec828bbc62bf4e6d7343d57b0697ecb0" [build] parallel = false From: Chris Tusa Subject: Add makefiles/Makefile.hammerhead XNEdit's top-level Makefile is target-based (`make `, matching a file `makefiles/Makefile.`) - there is no uname-autodetect path to adapt, only per-platform templates to add to. None of the shipped templates fit Hammerhead: Makefile.solaris hardcodes illumos paths that don't exist here (/usr/openwin/include, /usr/sfw/lib/64) and links -lsocket -lnsl (not used/needed on Hammerhead's libc); the `:sh=`-based pkg-config assignment it uses is also not portable GNU make syntax. Base this instead on the shape of Makefile.linux, pointed at /usr/local (our port prefix) and using $(shell pkg-config ...) throughout, plus the GCC14 old-C flags (-fpermissive -fcommon) and the usual illumos header-gating defines. diff --git a/makefiles/Makefile.hammerhead b/makefiles/Makefile.hammerhead new file mode 100644 index 0000000..0000000 --- /dev/null +++ b/makefiles/Makefile.hammerhead @@ -0,0 +1,26 @@ +# Makefile.hammerhead - Hammerhead (illumos-derivative, GNU toolchain) port. +# Modeled on Makefile.linux: Motif/X11/Xft/fontconfig all live under +# /usr/local (our $PREFIX) rather than /usr/X11R6 or illumos's +# /usr/openwin - use pkg-config throughout instead of hardcoded paths. +# +# GCC14 old-C compat: XNEdit/Xlt/Microline are classic pre-2015-idiom C - +# -fpermissive demotes GCC14's new implicit-decl/incompatible-pointer/ +# int-conversion errors back to warnings; -fcommon undoes GCC10+'s +# -fno-common default (tentative-definition multiple-definition errors). +# -D__EXTENSIONS__ / -D_POSIX_PTHREAD_SEMANTICS unlock the usual +# illumos-hidden POSIX/SysV prototypes and _r signatures. +CC=gcc +AR=ar + +C_OPT_FLAGS?=-O + +CFLAGS=$(C_OPT_FLAGS) -std=gnu99 -I/usr/local/include -DUSE_LPR_PRINT_CMD \ + -D__EXTENSIONS__ -D_POSIX_PTHREAD_SEMANTICS -fpermissive -fcommon \ + $(shell pkg-config --cflags xft fontconfig) + +ARFLAGS=-urs + +LIBS=$(LD_OPT_FLAGS) -L/usr/local/lib -R/usr/local/lib -lXm -lXt -lX11 \ + -lXext -lXrender -lm -lpthread $(shell pkg-config --libs xft fontconfig) + +include Makefile.common