Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Jan 2021 04:36:51 +0100
From:      Tomasz CEDRO <tomek@cedro.info>
To:        FreeBSD Questions Mailing List <freebsd-questions@freebsd.org>,  freebsd-ports <freebsd-ports@freebsd.org>, freebsd-hamradio@freebsd.org
Cc:        db@freebsd.org, pcc@gmx.net
Subject:   Re: %%CONFIGURE_TARGET%% in Makefile and pkg-plist
Message-ID:  <CAM8r67DxxNmB7WkfRXNQ7o3bGnuwVDBEPBDqgVDou-90jD3dsQ@mail.gmail.com>
In-Reply-To: <CAM8r67BQ=Ernw4%2Bn1NbLsh19zk3ynKXypo=VSW3hu=yxpH=6gw@mail.gmail.com>
References:  <CAM8r67BQ=Ernw4%2Bn1NbLsh19zk3ynKXypo=VSW3hu=yxpH=6gw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Jan 3, 2021 at 8:41 PM Tomasz CEDRO wrote:
> Hello world :-)
> The new port is comms/limesuite. The pkg-plist line affected is:
> %%OCTAVE%%lib/octave/%%OCTAVE_VERSION%%/site/oct/%%CONFIGURE_TARGET%%/LimeSuite.oct
>
> The problem is as reported in [1]. First variable %%OCTAVE_VERSION%%
> gets replaced and taken from .include
> "../../math/octave/Makefile.version" (I would really prefer to see
> currently installed octave here). Second variable %%CONFIGURE_TARGET%%
> does not get replaced in make package or gets replaced with invalid
> value in stage (i.e. 12.1 on 12.2 platform) leading to invalid
> pkg-plist generation and then problems with make package.

Allright, mystery solved, that full path is provided by the
octave-config utility that is part of the Octave suite, this magic
path in Stage was taken from a CMAKE and provided by octave-config
binary build for pkg on 12.1 system, so we need to obtain this path as
well in Port Makefile (I found VAR!=exec very handy) and then
substitute that full path in a pkg-plist. Now our port fully adapts to
existing Octave Suite binary :-)

Makefile.diff:
-PLIST_SUB+=            OCTAVE_VERSION=${OCTAVE_VERSION}
+OCTAVE_OCT_SITE_DIR!=  (octave-config --oct-site-dir)
+OCTAVE_M_SITE_DIR!=    (octave-config --m-site-dir)
+PLIST_SUB+=            OCTAVE_OCT_SITE_DIR=${OCTAVE_OCT_SITE_DIR}
+PLIST_SUB+=            OCTAVE_M_SITE_DIR=${OCTAVE_M_SITE_DIR}

pkg-plist.diff:
-%%OCTAVE%%lib/octave/%%OCTAVE_VERSION%%/site/oct/%%CONFIGURE_TARGET%%/LimeSuite.oct
-%%OCTAVE%%share/octave/%%OCTAVE_VERSION%%/site/m/LoadLimeSuite.m
+%%OCTAVE%%%%OCTAVE_OCT_SITE_DIR%%/LimeSuite.oct
+%%OCTAVE%%%%OCTAVE_M_SITE_DIR%%/LoadLimeSuite.m

CONFIGURE_TARGET is not even necessary here and works as expected it
just needs an assignment in a way:
PLIST_SUB+= CONFIGURE_TARGET=${CONFIGURE_TARGET}

Because at the moment we use this port mainly for debugging USB driver
problem I have also added and enabled by default DEBUG build option
that will generate binaries ready do debug. Original port stripped
them sorry and manual build with debug may be a blocker for testers.

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252350

Feedback and Testing welcome Radio-Amateurs :-)

Happy New Year :-)

-- 
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info



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