Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Aug 2020 04:17:50 +0200
From:      Polytropon <freebsd@edvax.de>
To:        louis.forums@xs4all.nl
Cc:        "louis.forums@xs4all.nl" <lsrbreda@xs4all.nl>, <freebsd-questions@freebsd.org>
Subject:   Re: How to build a package from local source keeping all the original used (gnu autotools) build options !??
Message-ID:  <20200819041750.5784a1f9.freebsd@edvax.de>
In-Reply-To: <000701d67598$0c8aa560$259ff020$@xs4all.nl>
References:  <000001d67566$e2acd5a0$a80680e0$@xs4all.nl> <000701d67598$0c8aa560$259ff020$@xs4all.nl>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On Tue, 18 Aug 2020 21:44:54 +0200, louis.forums@xs4all.nl wrote:
> Hello,
> 
>  �

Something is wrong with your mailer - it damaged commands
so they become incorrect - oh, never mind, "Microsoft Outlook",
let's see if I can fix that a bit. ;-)



> After downloading a project from GitHub and making some changes,
> I can build and install that project using the GNU autotools 
> 
> cd /var/git/<project>
> 
> ./autogen.sh
> 
> ./configure – option-A=/abc  �– option-B=/def  � � �etc (*required* options)
              ^
That is probably a case of "smart substitution" where you want
to have "--", but got "– ", and I have no idea what "�" could
have been in your original input (it appears in many places).



> make
> 
> make install
> 
> make dist
> 
>  �
> 
> However than I need to make a distribution package for that project 
> 
> cp /var/git/<project>/<distfile> � cd /usr/ports/<distfiles>
> 
> cd /usr/ports/<category>/<project>

At this point, all make commands will use the options set for
the port - which have not been set yet, i. e., the default
port options will apply (as you have noticed in the result).
The reason is that you built source outside (!) of the ports
tree, and you set those options outside of the tree with means
that are not part of the "ports options framework".



> make makesum
> 
> make stage
> 
> make stage-qa
> 
> make package
> 
> That however does not work in the right way. 

As I said, it works in the _intended_ way.

What you would need to do is to obtain the sources you need,
usually by getting the most recent version of the ports tree
(using svn), and then use "make config" so the ports framework
can store the options.

If you need sources that are _different_ from those provided
by the ports collection, you could try to copy the source tree
obtained by git into the work/ subdirectory of the port.



> The problem is that “Port” is building the sources *again*
> (in  �cd /usr/ports/<category>/work/<project>/ 
> 
> And more severe …. It is building the package without and
> *required* options ……. (the same as defined for the original build!)

That is exactly how it is supposed to work. :-)



> So my question: “is how to build an package having the same
> build settings as in the original autotools build”
> (using same generated makefile, config etc.)

It might sound strange, but you're trying a "non-supported thing",
which doesn't mean it couldn't work. As I mentioned, try to use
the generated source tree, copied into the ports tree, from
within (!) the ports tree, by revisiting the "make config"
screen to make sure all options are met as intended.


> Perhaps !!?? the whole rebuild process by the port-tools is
> not required at all (just my feeling(!) 

The rebuild will only be performed if an existing package does
not meet the requirements of the options set (option mismatch)
or if the version is different (version mismatch). In any other
cases, existing built and/or installed packages will be kept.

So the ports framework has no idea of which options have been
applied to the files now available in distfiles/, that's why
it needs to rebuild the (unsuited, because default option)
packages as they do not exist yet.

The best idea here probably is to use "ports only" as a means
to build stuff to avoid both version mismatch and options
mismatch.



> If port could!!?? only do all the packaging stuff for the
> already build files! ☹ 😊
>  �

That is probably possible. Have you looked into poudriere?
For a "one-time action", using the regular ports tree might
be okay, but if you're going to do updating and rebuilding
more than once, maybe dedicating a poudriere installation
with your custom options would be more convenient on the
long run.

I hope I did understand your intentions correctly.



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?20200819041750.5784a1f9.freebsd>