#!/bin/sh # Build script for dmenu (suckless, plain Makefile - NOT a template build). # Deps: libX11, libXft, libXinerama, fontconfig (all ported). # # Same class of fix as base/st: dmenu's shipped config.mk hardcodes # X11INC/X11LIB to /usr/X11R6 (doesn't exist on Hammerhead) and links # -lX11/-lXinerama/-lfontconfig/-lXft directly instead of going through # pkg-config. Rewrite config.mk to resolve everything via pkg-config # against $PREFIX. set -e cd "$SRCDIR" export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig:$PREFIX/share/pkgconfig:/usr/lib/pkgconfig:$PKG_CONFIG_PATH" # NOTE: dmenu 5.4's config.mk (unlike st's) has no PKG_CONFIG variable at # all - use the literal `pkg-config` binary name directly rather than a # $(PKG_CONFIG) make-variable reference that would expand to nothing. sed -i \ -e "s#^PREFIX = .*#PREFIX = $PREFIX#" \ -e '/^X11INC/d' -e '/^X11LIB/d' \ -e '/^XINERAMALIBS/d' -e '/^FREETYPELIBS/d' -e '/^FREETYPEINC/d' \ -e 's#^INCS = .*#INCS = `pkg-config --cflags x11 xft xinerama fontconfig`#' \ -e 's#^LIBS = .*#LIBS = `pkg-config --libs x11 xft xinerama fontconfig`#' \ config.mk # __EXTENSIONS__: hidden POSIX/SysV prototypes on illumos headers - same # gotcha as every other X11 port here. Add rpath since /usr/local/lib is # not on Hammerhead's default ld.so search path. sed -i \ -e 's#^CFLAGS = .*#CFLAGS = -std=c99 -pedantic -Wall -Os $(INCS) $(CPPFLAGS) -D__EXTENSIONS__#' \ -e "s#^LDFLAGS = .*#LDFLAGS = \$(LIBS) -Wl,-R,$PREFIX/lib#" \ config.mk gmake CC=gcc PREFIX="$PREFIX" mkdir -p "$PKGDIR$PREFIX/bin" gmake PREFIX="$PREFIX" DESTDIR="$PKGDIR" install # dmenu - dynamic menu (suckless) # https://tools.suckless.org/dmenu/ [package] name = "dmenu" version = "5.4" release = 1 description = "Dynamic menu for X, driven by dmenu_run/openbox" url = "https://tools.suckless.org/dmenu/" license = "MIT" maintainer = "Chris Tusa " arch = "x86_64" [dependencies] runtime = ["libX11", "libXft", "libXinerama", "fontconfig"] build = ["libX11", "libXft", "libXinerama", "fontconfig"] [[source]] file = "dmenu-5.4.tar.gz" urls = ["https://dl.suckless.org/tools/dmenu-5.4.tar.gz"] checksum = "8fbace2a0847aa80fe861066b118252dcc7b4ca0a0a8f3a93af02da8fb6cd453" [build] parallel = true