nixpkgs/pkgs/os-specific/darwin/native-x11-and-opengl/default.nix
Eric Kow 1be6aae4b4 darwin x11/opengl: only copy subset of files (close #1165)
Copy only the pc files related to X11 and OpenGL.

This should allow us to build our own version of libraries like
cairo without having the native ones be accidentally dynamically
linked in to things that depend on them.

Before this patch if we `dyldinfo -dylibs libpangocairo` we can
see that it was dynamically linked against the OS X (but seemingly
built against include files from the nix one, as we would get a
runtime complaint about missing symbols)
2013-11-07 10:39:28 +01:00

17 lines
437 B
Nix

{ stdenv, writeScript }:
assert stdenv.isDarwin;
stdenv.mkDerivation rec {
name = "darwin-native-x11-and-opengl";
builder = writeScript "${name}-builder.sh" ''
/bin/mkdir -p $out
/bin/mkdir $out/lib
/bin/ln -sv /usr/X11/lib/{*.dylib,X11,xorg} $out/lib
/bin/mkdir $out/lib/pkgconfig
/bin/ln -sv /usr/X11/lib/pkgconfig/{x*.pc,gl*.pc} $out/lib/pkgconfig
/bin/ln -sv /usr/X11/{bin,include,share} $out/
'';
}