pkgsrc: build from the source tree, no archive

The recipe set DISTFILES and built from a tarball that tools/ext-dist.sh
made, and its distinfo had to be regenerated after every commit.  It now
does what pkgsrc itself does for a package that lives in a tree (net/fetch,
pkgtools/pkg_install): DISTFILES= # empty, do-extract fills WRKSRC.

The copy is made by tools/ext-extract.sh (called from do-extract), not by
cp -R: a work directory is extracted once, so a plain copy would keep the
files of the commit it was extracted from.

Verified: bmake -C pkgsrc/misc/splinter package built splinter-0.1.tgz in
build/packages/All with no distinfo present.
This commit is contained in:
lotherk committed 2026-11-23 19:50:20 +00:00
1 parent 4fc7614cc5
commit 719c436f5c
2 files changed
+30 -10

No files matched your search

+30 -5
View File
@@ -1,17 +1,35 @@
# $NetBSD$
# $Makronix$
#
# Makronix: splinter is the project's own C99/POSIX agent harness
# (ext/src/splinter, IMPORT). It is built from the archive tools/ext-dist.sh
# makes out of ext/src/splinter, so there is no MASTER_SITES.
# splinter -- the project's own C99/POSIX agent harness.
#
# The source is not a tarball: it is ext/src/splinter in this repository, the
# tree that git tracks and a person edits. pkgsrc builds it from there the way
# net/fetch and pkgtools/pkg_install build from their files/ directory -- no
# DISTFILES, no distinfo, no archive to regenerate after a commit, and
# `do-extract' puts the tree into WRKSRC. Build output stays in the work
# directory (tools/pkgsrc-cross.mk.conf: WRKOBJDIR), never in the source.
#
# The mirror in pkgsrc/misc/splinter is made by tools/ext-sync.sh: symlinks to
# this file, so this is the only copy of the recipe.
DISTNAME= splinter-0.1
CATEGORIES= misc
DISTFILES= ${DISTNAME}${EXTRACT_SUFX}
MASTER_SITES= # empty
DISTFILES= # empty
MAINTAINER= lotherk@lother.io
COMMENT= C99/POSIX agent harness with a curses interface
LICENSE= modified-bsd
# The tree this recipe belongs to: three levels above the directory pkgsrc
# builds in, which is /home/lotherk/src/makronix here, /mnt inside the build
# chroot and /usr/src on an installed system -- the same relative position in
# all three, so nothing has to be passed in. `pwd -P': pkgsrc refuses a WRKDIR
# path that is not canonical ("must be canonical"), and the mirror in pkgsrc/ is
# reached through a symlink.
_MAKRONIX_TOP!= cd ${.CURDIR}/../../.. && pwd -P
SPLSRC= ${_MAKRONIX_TOP}/ext/src/splinter
# The top Makefile is POSIX make; it runs the vendored NetBSD curses through
# $(MAKE) -f GNUmakefile, which is GNU make. The build host's GNU make is
# what USE_TOOLS brings; the target compiler comes from pkgsrc's wrappers.
@@ -50,5 +68,12 @@ MAKE_FLAGS+= CURSES_LIB=-lcurses\ -lterminfo
# Makefile defaults it to $(CURSES_LIB) for the vendored tree.
MAKE_FLAGS+= CURSES_DEP=""
# The source tree as it is, without the history: a .git in WRKSRC would be a
# copy of the submodule's repository inside a package build.
# The copy is made by a script, not by ${CP} -R: pkgsrc extracts once, and
# a commit after that never reached the work directory (tools/ext-extract.sh).
do-extract:
${RUN}${SH} ${_MAKRONIX_TOP}/tools/ext-extract.sh ${SPLSRC} ${WRKSRC}
.include "../../mk/pthread.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
-5
View File
@@ -1,5 +0,0 @@
$NetBSD$
BLAKE2s (splinter-0.1.tar.gz) = 5aaf06f3c4fe35ef7fdc3d7c3e7f15475eb9847da6cf91e6297e1fd2eae0ce72
SHA512 (splinter-0.1.tar.gz) = 5d332ca4b2c234e62aa5c0e10ce45db7476f788cd3adf14ab814dc2ab6f3d0855ebc33ce67f64ce7837ee630ff37198b3442ee0ceda349a5b029a6ec90743f48
Size (splinter-0.1.tar.gz) = 1463397 bytes