Re: How to override port Makefile to point to local directory?

From: Christian Weisgerber <naddy_at_mips.inka.de>
Date: Wed, 18 May 2022 14:00:29 UTC
"Pat Maddox":

> I am writing software that I would eventually like to install on 
> FreeBSD. I'm currently stuck trying to write a Makefile that will point 
> to my local git dir, so I can build and install it while I'm developing. 

Set an empty DISTFILES and define a do-extract target that copies
(downloads, checks out, ...) the source tree.

For trying devel/got -current between releases, I add this to the
port Makefile:

------------------->
--- devel/got/Makefile
+++ devel/got/Makefile
@@ -13,6 +13,13 @@ USES=		uidfix
 
 CONFLICTS_INSTALL=	p5-App-GitGot
 
+DISTFILES=
+do-extract:
+	@cd ${WRKDIR} && got checkout /home/naddy/got.git ${WRKSRC}
+	@cd ${WRKSRC} && got ref -d `got info | \
+	    awk '/work tree UUID:/ { print "refs/got/worktree/base-" $$NF }'`
+	@sed -i '' 's/GOT_RELEASE=No/GOT_RELEASE=Yes/' ${WRKSRC}/got-version.mk
+
 # Insert #include "openbsd-compat.h" into each source file,
 # after the <...> includes and before the "..." ones.
 n=		${.newline}

<-------------------

In fact, I have a branch "current", whose first commit is the above,
and where I accumulate other port changes as they become necessary.
Then, once there is a new Got release, I merge the changes into
"main".

If I were using git, I'd probably have some sort of
"git archive ... | tar xf -" invocation in do-extract.

-- 
Christian "naddy" Weisgerber                          naddy@mips.inka.de