Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to install a package's sources?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
krokoziabla
n00b
n00b


Joined: 09 May 2013
Posts: 38
Location: Russia

PostPosted: Wed Jun 26, 2013 11:54 am    Post subject: How to install a package's sources? Reply with quote

I would never started such a topic but forum search gives no result on source search pattern.

I need to know how to install sources for a package. I believe a package's sources are supposed to be installed in /usr/src folder, aren't they?

If it is package dependent my main interest is gtkmm and gtk+ packages.
_________________
Vitaly
Back to top
View user's profile Send private message
xaviermiller
Administrator
Administrator


Joined: 23 Jul 2004
Posts: 5867
Location: ~Brussels - Belgique

PostPosted: Wed Jun 26, 2013 11:55 am    Post subject: Reply with quote

the sources are downloaded by default to /usr/portage/distfiles
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
krokoziabla
n00b
n00b


Joined: 09 May 2013
Posts: 38
Location: Russia

PostPosted: Wed Jun 26, 2013 12:03 pm    Post subject: Reply with quote

But isn't distfiles folder supposed to be used by portage internally? And moreover the sources are kept there in zipped form. I know I can unzip them somewhere (or even download source repositories separately) and use as I want but I'd like to know if there is a way to do it automatically and keep them centrally (e.g. like /usr/src/linux sources).
_________________
Vitaly
Back to top
View user's profile Send private message
bug_report
n00b
n00b


Joined: 17 Sep 2010
Posts: 71
Location: Frankfurt, Germany

PostPosted: Wed Jun 26, 2013 12:17 pm    Post subject: Reply with quote

It's a bit unclear what you really want.

Try "ebuild /usr/portage/dev-cpp/gtkmm/gtkmm-3.8.1.ebuild unpack"

This will fetch all required sources and unpack and patch everything to /var/tmp/portage/dev-cpp/gtkmm-3.8.1/work.
After that, move /var/tmp/portage/dev-cpp/gtkmm-3.8.1/work to a place of your choice.
Back to top
View user's profile Send private message
krokoziabla
n00b
n00b


Joined: 09 May 2013
Posts: 38
Location: Russia

PostPosted: Wed Jun 26, 2013 12:27 pm    Post subject: Reply with quote

Well, my final goal is to have sources for gtkmm/gtk+ packages somewhere in the file system which correspond to the binaries installed and which I can use to debug a GTK+ based application I'm developing. The approach I'm using now is to refer to GTK+/gtkmm GIT repositories which I downloaded earlier. But I'd like to know if there is a way to install those binaries automatically (maybe a special USE flag sources or something like this).

For example Linux's sources are kept in /usr/src/linux and some packages use them, for instance, for compilation of kernel modules.
_________________
Vitaly
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 8282
Location: Somewhere over Atlanta, Georgia

PostPosted: Wed Jun 26, 2013 12:57 pm    Post subject: Reply with quote

You're looking for
Code:
FEATURES="installsources"
See the make.conf man page for details.

- John
_________________
I can confirm that I have received between 0 and 999 National Security Letters.
Back to top
View user's profile Send private message
krokoziabla
n00b
n00b


Joined: 09 May 2013
Posts: 38
Location: Russia

PostPosted: Wed Jun 26, 2013 1:24 pm    Post subject: Reply with quote

Thank you! That's the thing I need. Although I do not completely understand what debugedit is and why it is needed here but it's trifles. :-)
_________________
Vitaly
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 8282
Location: Somewhere over Atlanta, Georgia

PostPosted: Wed Jun 26, 2013 1:46 pm    Post subject: Reply with quote

debugedit is a package (alas, not a very well documented one). However, you can just emerge it like anything else.

- John
_________________
I can confirm that I have received between 0 and 999 National Security Letters.
Back to top
View user's profile Send private message
krokoziabla
n00b
n00b


Joined: 09 May 2013
Posts: 38
Location: Russia

PostPosted: Wed Jun 26, 2013 1:47 pm    Post subject: Reply with quote

Yes, yes. I've already done everything, although not understanding what I'm doing. :-)
_________________
Vitaly
Back to top
View user's profile Send private message
Hu
Watchman
Watchman


Joined: 06 Mar 2007
Posts: 9324

PostPosted: Wed Jun 26, 2013 10:22 pm    Post subject: Reply with quote

The object files are compiled to refer to the sources in $PORTAGE_TMPDIR. Portage can use debugedit to rewrite those references to point to the /usr/src directory, so that when you use gdb on the built package, gdb will search for the sources in /usr/src, and find them there.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming 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