Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 May 2022 16:00:29 +0200
From:      Christian Weisgerber <naddy@mips.inka.de>
To:        "\"Pat Maddox\"" <pat@patmaddox.com>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: How to override port Makefile to point to local directory?
Message-ID:  <YoT7/Zcgbw8FenEH@lorvorc.mips.inka.de>
In-Reply-To: <C4E1018F-B37F-48E1-BDCB-FD9150DBDB6E@patmaddox.com>
References:  <C4E1018F-B37F-48E1-BDCB-FD9150DBDB6E@patmaddox.com>

next in thread | previous in thread | raw e-mail | index | archive | help
"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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YoT7/Zcgbw8FenEH>