Lets say I want to compile libpng instead of using the prebuilt guix version. Can I do this using guix and get access to the source code of the libpng package?
Hello @mirkoh,
Assuming you already have the url for the source code of libpng
, a part of the answer could be:
git clone https://github.com/pnggroup/libpng.git
guix build libpng --with-source=./libpng
guix build
will apply the recipe (package definition of libpng
) to build the package and save it into your store.
You can remove this package from the store with:
guix gc -D /gnu/store/path-to-my-libpng-1.6.39
You can also tweak the building process. Please take a look at the documentation about Package Transformation Options.
I highly recommend reading this post from Futurile. It’s a very well documented and there are plenty other good ressources on Guix in general.
Thank you, my use case is to compile the library using a different version of gcc (the one included in the PS2SDK , which is a modified gcc ). The build option seems really useful for that, I will explore that approach but I’m assuming that guix only works with a set of official build systems (it would be fantastic if this is not the case and custom ones can actually be created). Just extracting the source code from the package would be enough to facilitate compilation.
My other use case is to generate gtags, usually I do it using the C_INCLUDE_PATH variable that guix exports (using guix shell --search-paths). It works great for autocomplete with company-gtags but sometimes I would like to navigate the definitions and the complete source code is needed for that.