git.iko.soy/typeable/nixpkgs
on master help sign in
pngpp: darwin support

1) Building with clang is addressed by navigating a minor #if in some of the code. 2) I noticed that even when things were building correctly, passing `${out}` as a variable assignment to `make` was actually not working: there were compiler warnings about missing include directories whose bogus paths involved the literal string `out`. I ended up fixing this by performing the assignment to the make variable `PREFIX` in the `Makefile` itself.

commited559bf5d31e5c0d69f44a91e1dc34ba2d14d31a authorAnthony Cowley <acowley@gmail.com> dateThu 11 Jan 2018, 15:44 (9 years ago) parent310ad43
1 file changed+9−5
pkgs/development/libraries/png++/default.nix+9−5
pkgs/development/libraries/png++/default.nix+9−5
@@ -21,13 +21,17 @@ stdenv.mkDerivation rec {
2121
2222 postCheck = "cat test/test.log";
2323
24− buildInputs = [ ]
25− ++ stdenv.lib.optional docSupport doxygen;
24+ buildInputs = stdenv.lib.optional docSupport doxygen;
2625
2726 propagatedBuildInputs = [ libpng ];
2827
29− makeFlags = [ "PREFIX=\${out}" ]
30− ++ stdenv.lib.optional docSupport "docs";
28+ preConfigure = stdenv.lib.optionalString stdenv.isDarwin ''
29+ substituteInPlace error.hpp --replace "#if (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !_GNU_SOURCE" "#if (__clang__ || _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !_GNU_SOURCE"
30+ '' + ''
31+ sed "s|\(PNGPP := .\)|PREFIX := ''${out}\n\\1|" -i Makefile
32+ '';
33+
34+ makeFlags = stdenv.lib.optional docSupport "docs";
3135
3236 enableParallelBuilding = true;
3337
@@ -35,7 +39,7 @@ stdenv.mkDerivation rec {
3539 homepage = http://www.nongnu.org/pngpp/;
3640 description = "C++ wrapper for libpng library";
3741 license = licenses.bsd3;
38− platforms = platforms.linux;
42+ platforms = platforms.unix;
3943 maintainers = [ maintainers.ramkromberg ];
4044 };
4145}