NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
12.19k stars 1.47k forks source link

The pan newsreader example in the manual doesn't build #2922

Closed JorisE closed 3 years ago

JorisE commented 5 years ago

The manual uses the Pan newsreader as an example for showing how Nix sets up a complete build environment.

[nix-shell]$ tar xf $src
[nix-shell]$ cd pan-*
[nix-shell]$ ./configure
[nix-shell]$ make
[nix-shell]$ ./pan/gui/pan

However, since gtk2 was removed as a dependency of the nixpkg, the configure script needs the flag --with-gtk3 to run successful. Even if you add that flag, the derivative for Pan uses wrapProgram to include gpg in it's environment, but that is not available in the nix-shell environment.

Adding gtk2 and gpg to the dependencies to fix the manual is probably not the best solution. Maybe pan could be replaced with a package that doesn't need configure flags? I searched around for a package that fits this purpose, but found that surprisingly difficult.

edolstra commented 5 years ago

Needing configure flags is not a problem, we just need to change ./configure to configurePhase or ./configure $configureFlags.

JorisE commented 5 years ago

Cool, thanks! That works, so than ./configure would become ./configure $configureFlags.

I tried to mimic the postInstall wrapper by doing PATH=${gnupg}/bin/:$PATH ./pan/gui/pan, but that doesn't work. Am I mistaken in thinking that gnupg should be available in the shell somehow?