Re: New port: math/polymake -- some questions and help needed

From: Philipp Ost <pj_at_smo.de>
Date: Tue, 15 Jun 2021 18:36:16 UTC
On 6/14/21 11:12 PM, Thierry Thomas wrote:
>> I've been working on a port of polymake (polymake.org). Most of the work
>> is done, but there are some questions. Please advise:
> 
> Remark: this is a resurrection
> 
> $ grep polymake /usr/ports/MOVED
> math/polymake||2014-06-22|Has expired: Does not build with any supported version of Perl

I suspected as much. A FreeBSD port is hinted at on the polymake forums, 
but I didn't dig deeper.

That said, it was SVN revision 358827 which removed polymake from the 
ports tree.

> 
>> - How to deal with machine/installation dependent path names?
>> polymake installs a helper library into
>> ${PREFIX}/libexec/polymake/perlx/%%PERL_VERSION%%/amd64-freebsd-thread-multi/auto/Polymake/Ext/Ext.so
>>
>> amd64-freebsd-thread-multi is the output of
>>
>> 	perl -E 'use Config; print "$Config::Config{archname}\n";'
>>
>> How do I correctly handle this entry in pkg-plist?
> 
> You can define a variable to be passed in plist:
> PLIST_SUB=     ARCH=${ARCH}
> 
> and then %%ARCH%% will be available.

I'm aware of %%ARCH%%. The trouble I have with that particular directory 
name is its dependency on the options chosen in lang/perl5.*. If someone 
builds perl with both of these options set to off or without threading 
support, the directory name is going to be one of ${ARCH}-freebsd or 
${ARCH}-freebsd-multi. How to handle these cases? I don't think it's 
safe to assume that no one fiddles with these options.


>> - From reading the Porters Handbook, I get the impression that setting
>> DESTDIR is frowned upon. However, if I don't set DESTDIR=${STAGEDIR} in
>> the do-install target, "make stage" dumps everything to ${PREFIX}. Any
>> comments on this?
> 
> I guess that you’ll have to patch the Makefile…

I thought so… Compilation is handled using ninja, everything else is 
handled by custom perl scripts.

I'll work on a better solution.

[...]
> What is the output of `ldconfig -r | grep polymake'?
> 
> On FreeBSD, if your library is libpolymake.so.4.4, you should also
> install a symlink for libpolymake.so and libpolymake.so.4.
> Without that, it won’t be registered in the libraries hints file.

I wasn't aware of that. Thanks for the hint! It used to come up empty, 
but it's fixed now:

$ ldconfig -r | grep polymake
         274:-lpolymake.4 => /usr/local/lib/libpolymake.so.4

Now 'portlint -A' is happy, too. :-)

> 
> Thanks for this revival!
> 

It's been quite the learning curve! There are still some open issues, 
but I'm making progress.

Thanks for the help!

Philipp