add get* helper functions and mass-replace manual outputs search with them

This commit is contained in:
Nikolay Amiantov
2016-04-14 19:00:39 +03:00
parent c779e30d53
commit 5ff40ddedf
20 changed files with 67 additions and 64 deletions

View File

@@ -17,8 +17,8 @@ assert enableThreading -> (stdenv ? glibc);
let
libc = if stdenv.cc.libc or null != null then stdenv.cc.libc else "/usr";
libcInc = libc.dev or libc;
libcLib = libc.out or libc;
libcInc = lib.getDev libc;
libcLib = lib.getLib libc;
common = { version, sha256 }: stdenv.mkDerivation rec {
name = "perl-${version}";

View File

@@ -25,10 +25,9 @@ let
++ stdenv.lib.optional (stdenv ? cc && stdenv.cc.libc != null) stdenv.cc.libc
++ stdenv.lib.optional zlibSupport zlib;
C_INCLUDE_PATH = stdenv.lib.concatStringsSep ":" (map (p: "${p.dev or p}/include") buildInputs);
LIBRARY_PATH = stdenv.lib.concatStringsSep ":" (map (p: "${p.lib or p.out or p}/lib") buildInputs);
LD_LIBRARY_PATH = stdenv.lib.concatStringsSep ":" (map (p: "${p.lib or p.out or p}/lib")
(stdenv.lib.filter (x : x.outPath != stdenv.cc.libc.outPath or "") buildInputs));
C_INCLUDE_PATH = stdenv.lib.makeSearchPathOutput "dev" "include" buildInputs;
LIBRARY_PATH = stdenv.lib.makeLibraryPath buildInputs;
LD_LIBRARY_PATH = stdenv.lib.makeLibraryPath (stdenv.lib.filter (x : x.outPath != stdenv.cc.libc.outPath or "") buildInputs);
preConfigure = ''
# hint pypy to find nix ncurses

View File

@@ -53,8 +53,8 @@ let
++ optional zlibSupport zlib;
mkPaths = paths: {
C_INCLUDE_PATH = concatStringsSep ":" (map (p: "${p.dev or p}/include") paths);
LIBRARY_PATH = concatStringsSep ":" (map (p: "${p.lib or (p.out or p)}/lib") paths);
C_INCLUDE_PATH = makeSearchPathOutput "dev" "include" paths;
LIBRARY_PATH = makeLibraryPath paths;
};
# Build the basic Python interpreter without modules that have

View File

@@ -102,8 +102,8 @@ let
propagatedBuildInputs = optional stdenv.isDarwin configd;
mkPaths = paths: {
C_INCLUDE_PATH = concatStringsSep ":" (map (p: "${p.dev or p}/include") paths);
LIBRARY_PATH = concatStringsSep ":" (map (p: "${p.lib or (p.out or p)}/lib") paths);
C_INCLUDE_PATH = makeSearchPathOutput "dev" "include" paths;
LIBRARY_PATH = makeLibraryPath paths;
};
# Build the basic Python interpreter without modules that have

View File

@@ -44,8 +44,8 @@ stdenv.mkDerivation {
${optionalString stdenv.isDarwin ''export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -msse2"''}
configureFlagsArray=( --enable-shared --with-threads --with-wide-unicode
CPPFLAGS="${concatStringsSep " " (map (p: "-I${p.dev or p}/include") buildInputs)}"
LDFLAGS="${concatStringsSep " " (map (p: "-L${p.lib or (p.out or p)}/lib") buildInputs)}"
CPPFLAGS="${makeSearchPathOutput "dev" "include" buildInputs}"
LDFLAGS="${makeLibraryPath buildInputs}"
LIBS="${optionalString (!stdenv.isDarwin) "-lcrypt"} ${optionalString (ncurses != null) "-lncurses"}"
)
'';

View File

@@ -46,8 +46,8 @@ stdenv.mkDerivation {
${optionalString stdenv.isDarwin ''export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -msse2"''}
configureFlagsArray=( --enable-shared --with-threads
CPPFLAGS="${concatStringsSep " " (map (p: "-I${p.dev or p}/include") buildInputs)}"
LDFLAGS="${concatStringsSep " " (map (p: "-L${p.lib or (p.out or p)}/lib") buildInputs)}"
CPPFLAGS="${makeSearchPathOutput "dev" "include" buildInputs}"
LDFLAGS="${makeLibraryPath buildInputs}"
LIBS="${optionalString (!stdenv.isDarwin) "-lcrypt"} ${optionalString (ncurses != null) "-lncurses"}"
)
'';

View File

@@ -58,8 +58,8 @@ stdenv.mkDerivation {
''}
configureFlagsArray=( --enable-shared --with-threads
CPPFLAGS="${concatStringsSep " " (map (p: "-I${p.dev or p}/include") buildInputs)}"
LDFLAGS="${concatStringsSep " " (map (p: "-L${p.lib or (p.out or p)}/lib") buildInputs)}"
CPPFLAGS="${makeSearchPathOutput "dev" "include" buildInputs}"
LDFLAGS="${makeLibraryPath buildInputs}"
LIBS="${optionalString (!stdenv.isDarwin) "-lcrypt"} ${optionalString (ncurses != null) "-lncurses"}"
)
'';

View File

@@ -58,8 +58,8 @@ stdenv.mkDerivation {
''}
configureFlagsArray=( --enable-shared --with-threads
CPPFLAGS="${concatStringsSep " " (map (p: "-I${p.dev or p}/include") buildInputs)}"
LDFLAGS="${concatStringsSep " " (map (p: "-L${p.lib or (p.out or p)}/lib") buildInputs)}"
CPPFLAGS="${makeSearchPathOutput "dev" "include" buildInputs}"
LDFLAGS="${makeLibraryPath buildInputs}"
LIBS="${optionalString (!stdenv.isDarwin) "-lcrypt"} ${optionalString (ncurses != null) "-lncurses"}"
)
'';