New comment by sgn on void-packages repository https://github.com/void-linux/void-packages/pull/39360#issuecomment-1251001665 Comment: > I think it's better to patch their Makefile to have let's say -include config.mk and put the option there. Whoever want some custom option could put the config into files directory. With that approach, we won't need to care for nnn's change in build option whatsoever. As for build dependencies, just add them all. nnn is always a leaf (as in graph) packages. Here is possible implementation, no build options required: ```diff srcpkgs/nnn/patches/config.patch | 11 +++++++++++ srcpkgs/nnn/template | 5 ++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/srcpkgs/nnn/patches/config.patch b/srcpkgs/nnn/patches/config.patch new file mode 100644 index 0000000000..e7d7238276 --- /dev/null +++ b/srcpkgs/nnn/patches/config.patch @@ -0,0 +1,11 @@ +--- a/Makefile ++++ b/Makefile +@@ -36,6 +36,8 @@ O_GITSTATUS := 0 # add git status to det + O_NAMEFIRST := 0 # print file name first, add uid and guid to detail view + O_RESTOREPREVIEW := 0 # add preview pipe to close and restore preview pane + ++-include config.mk ++ + # convert targets to flags for backwards compatibility + ifneq ($(filter debug,$(MAKECMDGOALS)),) + O_DEBUG := 1 diff --git a/srcpkgs/nnn/template b/srcpkgs/nnn/template index cea82d3681..32f5fec3c1 100644 --- a/srcpkgs/nnn/template +++ b/srcpkgs/nnn/template @@ -5,7 +5,7 @@ revision=1 build_style=gnu-makefile make_install_target="install install-desktop" hostmakedepends="pkg-config" -makedepends="ncurses-devel readline-devel" +makedepends="ncurses-devel readline-devel gpm-devel pcre-devel" short_desc="Missing terminal file browser for X" maintainer="Dennis Kraus " license="BSD-2-Clause" @@ -22,6 +22,9 @@ pre_build() { if [ "$XBPS_TARGET_LIBC" = "musl" ]; then export LDLIBS=-lfts fi + if [ -f "$FILESDIR/config.mk" ]; then + cp "$FILESDIR/config.mk" . + fi } post_install() { ``` Then: ```sh mkdir -p srcpkgs/nnn/files cat <<-EOF >srcpkgs/nnn/files/config.mk O_ICONS := 1 EOF ```