Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to activate custom defines ? #18

Open
bcopy opened this issue Aug 23, 2016 · 9 comments
Open

How to activate custom defines ? #18

bcopy opened this issue Aug 23, 2016 · 9 comments

Comments

@bcopy
Copy link

bcopy commented Aug 23, 2016

For instance, I would like to activate the EXTRA MATCH flag for Boost Regex.
The boost recommendation is to go to src/main/include/boost/regex/user.hpp
and to uncomment :

define BOOST_REGEX_MATCH_EXTRA

which is what I have done prior to reinstalling the regex NAR.

However, is there a nicer way to do this, from the maven command line for instance ?

@dproteus13
Copy link

dproteus13 commented Aug 23, 2016

Maven also supports the -D = argument similar to Make,
though I don't think NAR automatically passes those through (it's caused
confusion / headaches for make users). So we could potentially add a
property to support arbitrary defines, though I'm not sure how elegant
that would be for more than 1 define... I've done this on a project where
we occasionally wanted to add one define for testing...

On Tue, Aug 23, 2016, 5:53 AM Brice Copy [email protected] wrote:

For instance, I would like to activate the EXTRA MATCH flag for Boost
Regex.
The boost recommendation is to go to src/main/include/boost/regex/user.hpp
and to uncomment :
#define BOOST_REGEX_MATCH_EXTRA

which is what I have done prior to reinstalling the regex NAR.

However, is there a nicer way to do this, from the maven command line for
instance ?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#18, or mute the thread
https://github.com/notifications/unsubscribe-auth/ACgBswy2y8rBR1fqvhZ9vbpqUwrP4Z5hks5qisL8gaJpZM4Jqvqu
.

@bcopy
Copy link
Author

bcopy commented Aug 23, 2016

What about aol.properties to specify BOOST defines ?

http://maven-nar.github.io/aol.html

@dproteus13
Copy link

dproteus13 commented Aug 23, 2016

That's an interesting thought... aol.properties is intended to be used for
AOL specific things, though it might give you a slightly smother way to add
those defines in.

I'd also recommend looking at the properties-maven-plugin (
http://www.mojohaus.org/properties-maven-plugin/) as an option to do this
without needing to repeat yourself for every AOL and thus making things
feel "unnatural". Though this route might require you to be a bit more
explicit in your pom (adding a to use the new property).

Hope this helps!

On Tue, Aug 23, 2016, 8:07 AM Brice Copy [email protected] wrote:

What about aol.properties to specify BOOST defines ?

http://maven-nar.github.io/aol.html


You are receiving this because you commented.

Reply to this email directly, view it on GitHub
#18 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACgBs-l59k-Iyq3sRvSwT63ObbiEptSUks5qiuJmgaJpZM4Jqvqu
.

@bcopy
Copy link
Author

bcopy commented Aug 24, 2016

Thanks, I'll give it a go.

@markjohndoyle
Copy link
Owner

markjohndoyle commented Aug 25, 2016

For us (we also mavensied asio as a header only dependency) we used the options in the nar plugin config to enable symbols in the headers, e.g.:

<options combine.children="append">
    <option>-std=c++11</option>
   <!-- This one disables the boost requirement on asio -->
    <option>-DASIO_STANDALONE</option>
</options>

Of course, like @dproteus13 alluded to, this only works for header symbols that can be processed at compile time. If the symbols changes the binary library itself we'll need another solution.

Your specific case where the original mechanism is to go in an edit source code is also a bit of a pain!

Maybe we could simply have different artefacts? We do this for different linux dists since the AOL mechanism doesn't go far enough to support libraries compiled against different system libs. So we add qualifiers to the verison e.g. 4.3.2+libc2.12 is version 4.3.2 of a library compiled against glibc 2.12.
You do begin to lose portability here though unless you add profiles to your pom. Ideally, the nar plugin would detect the glibc and use an AOL that has that information in.

@markjohndoyle
Copy link
Owner

markjohndoyle commented Aug 25, 2016

On a side note, I created a python utility to create maven nars from existing binaries and headers. It's a bit of a rush job and needs a clean up (you have to repeat yourself once or twice) but it works fine.

https://github.com/markjohndoyle/bin-to-nar

I'll mention it on the nar plugin page.

@dproteus13
Copy link

Also worth mentioning is NAR's good support for the legacy GNU AutoConf
toolsuite / lifecycle. Place a tool that builds using that tool suite
into src/gnu, and NAR will automatically run through those tools.

On Thu, Aug 25, 2016, 5:07 AM markjohndoyle [email protected]
wrote:

On a side note, I create a python utility to create maven nars from
existing binaries and headers. It's a bit of a rush job and needs a clean
up (you have to repeat yourself once or twice) but it works fine.

https://github.com/markjohndoyle/bin-to-nar

I'll mention it on the nar plugin page.


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
#18 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACgBs086kvDm82RNwlEzo1Rl3Cz_hVlYks5qjVtFgaJpZM4Jqvqu
.

@bcopy
Copy link
Author

bcopy commented Aug 25, 2016

About gnu support, I tried it for google test.. but there's no "install"
make goal so the nar ends up empty. Where is NAR expecting the gtest libs
exactly to be able to package them ? I suspect it's /usr/lib ??

On 25 Aug 2016 11:48 am, "dproteus13" [email protected] wrote:

Also worth mentioning is NAR's good support for the legacy GNU AutoConf
toolsuite / lifecycle. Place a tool that builds using that tool suite
into src/gnu, and NAR will automatically run through those tools.

On Thu, Aug 25, 2016, 5:07 AM markjohndoyle [email protected]
wrote:

On a side note, I create a python utility to create maven nars from
existing binaries and headers. It's a bit of a rush job and needs a clean
up (you have to repeat yourself once or twice) but it works fine.

https://github.com/markjohndoyle/bin-to-nar

I'll mention it on the nar plugin page.


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
<#18 (comment)
242324434>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/
ACgBs086kvDm82RNwlEzo1Rl3Cz_hVlYks5qjVtFgaJpZM4Jqvqu>
.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#18 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAekNXBRgVbrmfH2k9jINb2IRAxEl1R9ks5qjWUIgaJpZM4Jqvqu
.

@dproteus13
Copy link

Google test doesn't build with the GNU AutoConf suite, just Make... but
it's even easier than that, it works great if you just put the Google test
source in src/main/cpp and src/main/include... the only nuance is because
of the way Google test includes cpp files, you need to add src/main/cpp to
the include path. Also works similarly for Google mock. I recommend
pulling the main files out into separate modules if you want to support
multiple modes of using those libraries :-D

On Thu, Aug 25, 2016, 7:43 AM Brice Copy [email protected] wrote:

About gnu support, I tried it for google test.. but there's no "install"
make goal so the nar ends up empty. Where is NAR expecting the gtest libs
exactly to be able to package them ? I suspect it's /usr/lib ??

On 25 Aug 2016 11:48 am, "dproteus13" [email protected] wrote:

Also worth mentioning is NAR's good support for the legacy GNU AutoConf
toolsuite / lifecycle. Place a tool that builds using that tool suite
into src/gnu, and NAR will automatically run through those tools.

On Thu, Aug 25, 2016, 5:07 AM markjohndoyle [email protected]
wrote:

On a side note, I create a python utility to create maven nars from
existing binaries and headers. It's a bit of a rush job and needs a
clean
up (you have to repeat yourself once or twice) but it works fine.

https://github.com/markjohndoyle/bin-to-nar

I'll mention it on the nar plugin page.


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
<#18 (comment)
242324434>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/
ACgBs086kvDm82RNwlEzo1Rl3Cz_hVlYks5qjVtFgaJpZM4Jqvqu>
.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<
#18 (comment)
,
or mute the thread
<
https://github.com/notifications/unsubscribe-auth/AAekNXBRgVbrmfH2k9jINb2IRAxEl1R9ks5qjWUIgaJpZM4Jqvqu

.


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
#18 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACgBs2WvlRPDrGfPf7Ys3YRTojC5WpqPks5qjX_ggaJpZM4Jqvqu
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants