Discussion:
How to correctly reference WRKSRC of another port?
Philipp Ost
2021-05-24 18:16:47 UTC
Permalink
Hi everyone,

I'm currently working on a port (my first ;-)) which has a (optional)
build time dependency on the sources of math/nauty.

Currently, I've hardwired '/usr/ports/math/nauty/work/nauty27r1' as
argument to the configure script, but that's clearly not the way to do it.

The Porter's Handbook mentions using WRKDIRPREFIXPORTSDIR [0], but that
does not work. A search for WRKDIRPREFIXPORTSDIR in /usr/ports/Mk comes
up empty. Do I explicitly have to define this variable?

I've set NAUTY_BUILD_DEPENDS=nauty>0:math/nauty:extract. How do I
correctly reference nauty's WRKSRC?

It would be nice if anyone could point me in the right direction.

Thanks in advance!

Philipp


[0]
https://docs.freebsd.org/en/books/porters-handbook/porting-dads/#porting-wrkdirprefix
Jan Beich
2021-05-24 18:57:35 UTC
Permalink
Post by Philipp Ost
The Porter's Handbook mentions using WRKDIRPREFIXPORTSDIR [0], but
that does not work. A search for WRKDIRPREFIXPORTSDIR in /usr/ports/Mk
comes up empty. Do I explicitly have to define this variable?
That's a typo: WRKDIRPREFIXPORTSDIR -> WRKDIRPREFIX + PORTSDIR
Post by Philipp Ost
I've set NAUTY_BUILD_DEPENDS=nauty>0:math/nauty:extract. How do I
correctly reference nauty's WRKSRC?
NAUTY_WRKSRC= ${:!${MAKE} -V WRKSRC -C ${.CURDIR:H:H}/math/nauty!}
Tatsuki Makino
2021-05-24 21:17:25 UTC
Permalink
Hello.

That would mean ${WRKDIRPREFIX}${PORTSDIR}, wouldn't it?

The same goes for https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253721 :)
The Porter's Handbook mentions using WRKDIRPREFIXPORTSDIR [0], but that does not work. A search for WRKDIRPREFIXPORTSDIR in /usr/ports/Mk comes up empty. Do I explicitly have to define this variable?
[0] https://docs.freebsd.org/en/books/porters-handbook/porting-dads/#porting-wrkdirprefix
Ronald Klop
2021-05-25 11:27:33 UTC
Permalink
Van: Philipp Ost <***@smo.de>
Datum: maandag, 24 mei 2021 20:16
Aan: ***@freebsd.org
Onderwerp: How to correctly reference WRKSRC of another port?
Post by Philipp Ost
Hi everyone,
I'm currently working on a port (my first ;-)) which has a (optional) build time dependency on the sources of math/nauty.
Currently, I've hardwired '/usr/ports/math/nauty/work/nauty27r1' as argument to the configure script, but that's clearly not the way to do it.
The Porter's Handbook mentions using WRKDIRPREFIXPORTSDIR [0], but that does not work. A search for WRKDIRPREFIXPORTSDIR in /usr/ports/Mk comes up empty. Do I explicitly have to define this variable?
I've set NAUTY_BUILD_DEPENDS=nauty>0:math/nauty:extract. How do I correctly reference nauty's WRKSRC?
It would be nice if anyone could point me in the right direction.
Thanks in advance!
Philipp
[0] https://docs.freebsd.org/en/books/porters-handbook/porting-dads/#porting-wrkdirprefix
Hi,

I have no opinion on this, but just trying to think along.
Isn't it easier to add the math/nauty sources to the DISTFILES of your port?

Ronald.
Chris
2021-05-25 16:59:26 UTC
Permalink
Post by Ronald Klop
Datum: maandag, 24 mei 2021 20:16
Onderwerp: How to correctly reference WRKSRC of another port?
Post by Philipp Ost
Hi everyone,
I'm currently working on a port (my first ;-)) which has a (optional) build
time dependency on the sources of math/nauty.
Currently, I've hardwired '/usr/ports/math/nauty/work/nauty27r1' as
argument to the configure script, but that's clearly not the way to do it.
The Porter's Handbook mentions using WRKDIRPREFIXPORTSDIR [0], but that
does not work. A search for WRKDIRPREFIXPORTSDIR in /usr/ports/Mk comes up
empty. Do I explicitly have to define this variable?
I've set NAUTY_BUILD_DEPENDS=nauty>0:math/nauty:extract. How do I correctly
reference nauty's WRKSRC?
It would be nice if anyone could point me in the right direction.
Thanks in advance!
Philipp
[0]
https://docs.freebsd.org/en/books/porters-handbook/porting-dads/#porting-wrkdirprefix
Hi,
I have no opinion on this, but just trying to think along.
Isn't it easier to add the math/nauty sources to the DISTFILES of your port?
There must be a 101 ways to do this. But not having looked at the source for
your
port, I'm inclined with Ronald.
It wouldn't be unlike getting/using 2 sources from GitHub and combining them
for
the build. Simply use knob set aside for extra sources. IOW fetch the "extra"
source
and unpack it in the ${WRKSRC} tree along with your source && include the
needed
headers from there.

HTH and good luck!

--Chris
Post by Ronald Klop
Ronald.
Philipp Ost
2021-05-25 23:27:53 UTC
Permalink
[snip]
Post by Chris
Post by Ronald Klop
I have no opinion on this, but just trying to think along.
Isn't it easier to add the math/nauty sources to the DISTFILES of your port?
There must be a 101 ways to do this. But not having looked at the source
for your
port, I'm inclined with Ronald.
It wouldn't be unlike getting/using 2 sources from GitHub and combining
them for
the build. Simply use knob set aside for extra sources. IOW fetch the
"extra" source
and unpack it in the ${WRKSRC} tree along with your source && include
the needed
headers from there.
Yes, that would work, too. On the other hand, wouldn't that cause
maintenance trouble down the line? I was trying to make use of as much
infrastructure already in place as possible.
Post by Chris
HTH and good luck!
Thanks!

Philipp
Chris
2021-05-26 17:41:08 UTC
Permalink
Post by Philipp Ost
[snip]
Post by Chris
Post by Ronald Klop
I have no opinion on this, but just trying to think along.
Isn't it easier to add the math/nauty sources to the DISTFILES of your port?
There must be a 101 ways to do this. But not having looked at the source
for your
port, I'm inclined with Ronald.
It wouldn't be unlike getting/using 2 sources from GitHub and combining
them for
the build. Simply use knob set aside for extra sources. IOW fetch the
"extra" source
and unpack it in the ${WRKSRC} tree along with your source && include the
needed
headers from there.
Yes, that would work, too. On the other hand, wouldn't that cause
maintenance
trouble down the line? I was trying to make use of as much infrastructure
already
in place as possible.
Hmm. To me it just seems like a trade-off. IOW 6 of one && half a dozen on
the other.
Both seem to require as much work in the Makefile. But in my tiny little
mind. My
suggestion seemed less complicated. :-)
I'm NOT trying to suggest that my proposal was the best solution. Just wanted
to
throw it out there in case it helped. :-)

--Chris
Post by Philipp Ost
Post by Chris
HTH and good luck!
Thanks!
Philipp
Mathieu Arnold
2021-05-25 14:16:41 UTC
Permalink
Post by Philipp Ost
Hi everyone,
I'm currently working on a port (my first ;-)) which has a (optional) build
time dependency on the sources of math/nauty.
Currently, I've hardwired '/usr/ports/math/nauty/work/nauty27r1' as argument
to the configure script, but that's clearly not the way to do it.
The Porter's Handbook mentions using WRKDIRPREFIXPORTSDIR [0], but that does
not work. A search for WRKDIRPREFIXPORTSDIR in /usr/ports/Mk comes up empty.
Do I explicitly have to define this variable?
I've set NAUTY_BUILD_DEPENDS=nauty>0:math/nauty:extract. How do I correctly
reference nauty's WRKSRC?
It would be nice if anyone could point me in the right direction.
Thanks in advance!
Philipp
[0] https://docs.freebsd.org/en/books/porters-handbook/porting-dads/#porting-wrkdirprefix
So, that section has just been made a bit more readable, it should not
have been WRKDIRPREFIXPORTSDIR but ${WRKDIRPREFIX}${PORTSDIR}, which
makes much more sense.

There is no best way to achieve what you need. The probably easiest way
would be to follow what audio/pulseaudio-module-xrdp does, mainly:

BUILD_DEPENDS= ${NONEXISTENT}:math/nauty:patch
NAUTY_WRKSRC= $$(${MAKE} -C ${PORTSDIR}/math/nauty -VWRKSRC)

and then wherever you hardcoded the /usr/ports/... just put
${NAUTY_WRKSRC}.

Note that the special BUILD_DEPENDS is required, otherwise, there is no
guarantee that the sources will actually be there. Also, the :patch at
the end is the target youu actually need the sources to be in, maybe it
should be :configure or :build.
--
Mathieu Arnold
Philipp Ost
2021-05-25 22:46:20 UTC
Permalink
Thanks everyone for your help and suggestions so far!
[snip]>
Post by Mathieu Arnold
There is no best way to achieve what you need. The probably easiest way
BUILD_DEPENDS= ${NONEXISTENT}:math/nauty:patch
NAUTY_WRKSRC= $$(${MAKE} -C ${PORTSDIR}/math/nauty -VWRKSRC)
and then wherever you hardcoded the /usr/ports/... just put
${NAUTY_WRKSRC}.
Jan suggested essentially the same. ;-)
Post by Mathieu Arnold
Note that the special BUILD_DEPENDS is required, otherwise, there is no
guarantee that the sources will actually be there. Also, the :patch at
the end is the target youu actually need the sources to be in, maybe it
should be :configure or :build.
The :extract target did work fine, it's actually just the raw sources
which are needed. In the meantime some gremlins have crept in and now
nothing seems to work as it did yesterday... Now I can't get the nauty
sources to extract properly, neither using :extract or :patch.
NAUTY_WRKSRC is set correctly; right now I don't know what might be
amiss. If I can't figure it out myself I fear I have to bug the list again.

Philipp
Mathieu Arnold
2021-05-27 12:31:44 UTC
Permalink
Post by Philipp Ost
Thanks everyone for your help and suggestions so far!
[snip]>
Post by Mathieu Arnold
There is no best way to achieve what you need. The probably easiest way
BUILD_DEPENDS= ${NONEXISTENT}:math/nauty:patch
NAUTY_WRKSRC= $$(${MAKE} -C ${PORTSDIR}/math/nauty -VWRKSRC)
and then wherever you hardcoded the /usr/ports/... just put
${NAUTY_WRKSRC}.
Jan suggested essentially the same. ;-)
Post by Mathieu Arnold
Note that the special BUILD_DEPENDS is required, otherwise, there is no
guarantee that the sources will actually be there. Also, the :patch at
the end is the target youu actually need the sources to be in, maybe it
should be :configure or :build.
The :extract target did work fine, it's actually just the raw sources which
are needed. In the meantime some gremlins have crept in and now nothing
seems to work as it did yesterday... Now I can't get the nauty sources to
extract properly, neither using :extract or :patch. NAUTY_WRKSRC is set
correctly; right now I don't know what might be amiss. If I can't figure it
out myself I fear I have to bug the list again.
If you only need the sources, it is probably better to simply add the
nauty distribution file to DISTFILES.
--
Mathieu Arnold
Dan Mahoney
2021-05-27 14:07:42 UTC
Permalink
Post by Mathieu Arnold
Post by Philipp Ost
Thanks everyone for your help and suggestions so far!
[snip]>
Post by Mathieu Arnold
There is no best way to achieve what you need. The probably easiest way
BUILD_DEPENDS= ${NONEXISTENT}:math/nauty:patch
NAUTY_WRKSRC= $$(${MAKE} -C ${PORTSDIR}/math/nauty -VWRKSRC)
and then wherever you hardcoded the /usr/ports/... just put
${NAUTY_WRKSRC}.
Jan suggested essentially the same. ;-)
Post by Mathieu Arnold
Note that the special BUILD_DEPENDS is required, otherwise, there is no
guarantee that the sources will actually be there. Also, the :patch at
the end is the target youu actually need the sources to be in, maybe it
should be :configure or :build.
This feels like the kind of thing that a "How Do I"...wiki would benefit from.
Post by Mathieu Arnold
Post by Philipp Ost
The :extract target did work fine, it's actually just the raw sources which
are needed. In the meantime some gremlins have crept in and now nothing
seems to work as it did yesterday... Now I can't get the nauty sources to
extract properly, neither using :extract or :patch. NAUTY_WRKSRC is set
correctly; right now I don't know what might be amiss. If I can't figure it
out myself I fear I have to bug the list again.
If you only need the sources, it is probably better to simply add the
nauty distribution file to DISTFILES.
--
Mathieu Arnold
Loading...