Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to manually install a C++ library?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Draenin
n00b
n00b


Joined: 24 Mar 2016
Posts: 60

PostPosted: Wed Apr 01, 2020 4:14 pm    Post subject: How to manually install a C++ library? Reply with quote

Hello,

For a personal project I want to install a C++ graphics library, i.e. IO2D (https://github.com/cpp-io2d/P0267_RefImpl).

I didn't find it in the Gentoo packages catalog. It is ok, I can install it manually. But my Gentoo system has been running flawlessly from some time now (amazing work from Gentoo's mantainers). And, I don't want to screw things up.

I am planning to clone the library from the repository in:
Code:
/usr/local/lib
And run CMake there (the CMake part as per the library's instructions).

Would that be ok? I don't want to break Portage. Should I do something more/else? In other words, more generic, what would be the proper way to manually install a library in my Gentoo system?

Thanks in advance.
_________________
Linux enthusiast
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7653
Location: Saint Amant, Acadiana

PostPosted: Wed Apr 01, 2020 4:25 pm    Post subject: Reply with quote

The proper way would be to write an ebuild for it. However, you can build it in some subdirectory in your home and then install it to /usr/local. Note, if it is in your path before /usr then whatever installed there will be used instead of portage installed version - if it exists.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
Draenin
n00b
n00b


Joined: 24 Mar 2016
Posts: 60

PostPosted: Thu Apr 02, 2020 5:34 pm    Post subject: Reply with quote

Jaglover, thank you very much for the information.

Given my knowledge, writing an ebuild will be a bit too much out of my league now, though I will take a look at it (https://wiki.gentoo.org/wiki/Basic_guide_to_write_Gentoo_Ebuilds).

So, I will install things in my /home and, after building, move resulting files to /user/local.

Another question if you don't mind. Or if you want me to open a new thread, just tell me I'll happily do it. It seems the Boost libraries for C++ (https://packages.gentoo.org/packages/dev-libs/boost) have a bug (https://github.com/boostorg/parameter/pull/99) that is breaking the libraries I am trying to build in my /home (the before mentioned IO2D). They (the Boost people) already patched the bug in their repository. The patch involves modfying a couple of lines in one file: /user/include/boost/parameter/aux_/tagged_argument.hpp.

Would it be too crazy if I add that patch manually in my machine? I think worst case scenario is (in my next update) emerge overwriting, i.e. reverting, my change to what is in Gentoo's repository (in other words, what I have right now). Am I wrong?

To compile the package with the parch applied, would it be enough to run?:
Code:
emerge --ask --buildpkgonly dev-libs/boost

_________________
Linux enthusiast
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7653
Location: Saint Amant, Acadiana

PostPosted: Thu Apr 02, 2020 7:06 pm    Post subject: Reply with quote

Check this out. https://wiki.gentoo.org/wiki//etc/portage/patches

You configure your build with prefix /usr/local and it will go there when you run install. No manual copy.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
Draenin
n00b
n00b


Joined: 24 Mar 2016
Posts: 60

PostPosted: Thu Apr 02, 2020 11:17 pm    Post subject: Reply with quote

Thanks again for the help Jaglover,

I decided to just not mess at all with the base system. It is just one personal project I am doing, so I am going to do everything from /home.

I pulled IO2D in /home. Pull the copy I need of the Boost library in /home. I am linking IO2D against this /home copy of Boost. And I am going to link my project against my /home ID2D.

I will read though the information you posted, in case I need in the future do something similar in a more formal way.
_________________
Linux enthusiast
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 15294

PostPosted: Fri Apr 03, 2020 1:08 am    Post subject: Reply with quote

Draenin wrote:
Given my knowledge, writing an ebuild will be a bit too much out of my league now, though I will take a look at it (https://wiki.gentoo.org/wiki/Basic_guide_to_write_Gentoo_Ebuilds).
If you can figure out how to build the program by hand, and write that up as instructions we can follow, then you can write those up as an ebuild that Portage can follow. :)
Draenin wrote:
Would it be too crazy if I add that patch manually in my machine? I think worst case scenario is (in my next update) emerge overwriting, i.e. reverting, my change to what is in Gentoo's repository (in other words, what I have right now). Am I wrong?
That should be fine. I would recommend you take the patch-based path that Jaglover suggested, but if you want to quickly test whether the change works and don't mind losing it on next rebuild of boost, directly modifying the installed file is fine.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum