about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/development/libraries/SDL/default.nix36
-rw-r--r--pkgs/development/libraries/SDL2/default.nix18
-rw-r--r--pkgs/development/libraries/freetype/default.nix7
-rw-r--r--pkgs/development/libraries/libdrm/default.nix6
-rw-r--r--pkgs/development/libraries/libpng/12.nix5
-rw-r--r--pkgs/development/libraries/libssh2/default.nix18
6 files changed, 22 insertions, 68 deletions
diff --git a/pkgs/development/libraries/SDL/default.nix b/pkgs/development/libraries/SDL/default.nix
index 5e1c527eb8b5..7e96cf84686f 100644
--- a/pkgs/development/libraries/SDL/default.nix
+++ b/pkgs/development/libraries/SDL/default.nix
@@ -15,24 +15,6 @@ with lib;
 assert !stdenv.isDarwin -> alsaSupport || pulseaudioSupport;
 assert openglSupport -> (stdenv.isDarwin || x11Support && libGL != null && libGLU != null);
 
-let
-
-  configureFlagsFun = attrs: [
-    "--disable-oss"
-    "--disable-video-x11-xme"
-    "--enable-rpath"
-  # Building without this fails on Darwin with
-  #
-  #   ./src/video/x11/SDL_x11sym.h:168:17: error: conflicting types for '_XData32'
-  #   SDL_X11_SYM(int,_XData32,(Display *dpy,register long *data,unsigned len),(dpy,data,len),return)
-  #
-  # Please try revert the change that introduced this comment when updating SDL.
-  ] ++ optional stdenv.isDarwin "--disable-x11-shared"
-    ++ optional (!x11Support) "--without-x"
-    ++ optional alsaSupport "--with-alsa-prefix=${attrs.alsaLib.out}/lib";
-
-in
-
 stdenv.mkDerivation rec {
   name    = "SDL-${version}";
   version = "1.2.15";
@@ -62,11 +44,19 @@ stdenv.mkDerivation rec {
     ++ optional (!hostPlatform.isMinGW) audiofile
     ++ optionals stdenv.isDarwin [ AudioUnit CoreAudio CoreServices Kernel OpenGL ];
 
-  configureFlags = configureFlagsFun { inherit alsaLib; };
-
-  crossAttrs = {
-    configureFlags = configureFlagsFun { alsaLib = alsaLib.crossDrv; };
-  };
+  configureFlags = [
+    "--disable-oss"
+    "--disable-video-x11-xme"
+    "--enable-rpath"
+  # Building without this fails on Darwin with
+  #
+  #   ./src/video/x11/SDL_x11sym.h:168:17: error: conflicting types for '_XData32'
+  #   SDL_X11_SYM(int,_XData32,(Display *dpy,register long *data,unsigned len),(dpy,data,len),return)
+  #
+  # Please try revert the change that introduced this comment when updating SDL.
+  ] ++ optional stdenv.isDarwin "--disable-x11-shared"
+    ++ optional (!x11Support) "--without-x"
+    ++ optional alsaSupport "--with-alsa-prefix=${alsaLib.out}/lib";
 
   patches = [
     ./find-headers.patch
diff --git a/pkgs/development/libraries/SDL2/default.nix b/pkgs/development/libraries/SDL2/default.nix
index fe19ecadd0ef..d852b594f6dd 100644
--- a/pkgs/development/libraries/SDL2/default.nix
+++ b/pkgs/development/libraries/SDL2/default.nix
@@ -19,15 +19,6 @@ with lib;
 assert !stdenv.isDarwin -> alsaSupport || pulseaudioSupport;
 assert openglSupport -> (stdenv.isDarwin || x11Support && libGL != null);
 
-let
-
-  configureFlagsFun = attrs: [
-    "--disable-oss"
-  ] ++ optional (!x11Support) "--without-x"
-    ++ optional alsaSupport "--with-alsa-prefix=${attrs.alsaLib.out}/lib";
-
-in
-
 stdenv.mkDerivation rec {
   name = "SDL2-${version}";
   version = "2.0.8";
@@ -61,11 +52,10 @@ stdenv.mkDerivation rec {
   #   pointer-constraints-unstable-v1-client-protocol.h: No such file or directory
   enableParallelBuilding = false;
 
-  configureFlags = configureFlagsFun { inherit alsaLib; };
-
-  crossAttrs = {
-    configureFlags = configureFlagsFun { alsaLib = alsaLib.crossDrv; };
-  };
+  configureFlags = [
+    "--disable-oss"
+  ] ++ optional (!x11Support) "--without-x"
+    ++ optional alsaSupport "--with-alsa-prefix=${alsaLib.out}/lib";
 
   postInstall = ''
     moveToOutput lib/libSDL2main.a "$dev"
diff --git a/pkgs/development/libraries/freetype/default.nix b/pkgs/development/libraries/freetype/default.nix
index 4d2455d4872b..23aa86af377c 100644
--- a/pkgs/development/libraries/freetype/default.nix
+++ b/pkgs/development/libraries/freetype/default.nix
@@ -62,11 +62,4 @@ in stdenv.mkDerivation rec {
     wrapProgram "$dev/bin/freetype-config" \
       --set PKG_CONFIG_PATH "$PKG_CONFIG_PATH:$dev/lib/pkgconfig"
   '';
-
-  crossAttrs = stdenv.lib.optionalAttrs (hostPlatform.libc or null != "msvcrt") {
-    # Somehow it calls the unwrapped gcc, "i686-pc-linux-gnu-gcc", instead
-    # of gcc. I think it's due to the unwrapped gcc being in the PATH. I don't
-    # know why it's on the PATH.
-    configureFlags = "--disable-static CC_BUILD=gcc";
-  };
 }
diff --git a/pkgs/development/libraries/libdrm/default.nix b/pkgs/development/libraries/libdrm/default.nix
index ccae6ce50142..50d9a565a6cf 100644
--- a/pkgs/development/libraries/libdrm/default.nix
+++ b/pkgs/development/libraries/libdrm/default.nix
@@ -22,9 +22,9 @@ stdenv.mkDerivation rec {
   configureFlags = [ "--enable-install-test-programs" ]
     ++ stdenv.lib.optionals (stdenv.isAarch32 || stdenv.isAarch64)
       [ "--enable-tegra-experimental-api" "--enable-etnaviv-experimental-api" ]
-    ++ stdenv.lib.optional stdenv.isDarwin "-C";
-
-  crossAttrs.configureFlags = configureFlags ++ [ "--disable-intel" ];
+    ++ stdenv.lib.optional stdenv.isDarwin "-C"
+    ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "--disable-intel"
+    ;
 
   meta = {
     homepage = https://dri.freedesktop.org/libdrm/;
diff --git a/pkgs/development/libraries/libpng/12.nix b/pkgs/development/libraries/libpng/12.nix
index 457f99ef13bd..01a828f95da5 100644
--- a/pkgs/development/libraries/libpng/12.nix
+++ b/pkgs/development/libraries/libpng/12.nix
@@ -18,11 +18,6 @@ stdenv.mkDerivation rec {
 
   passthru = { inherit zlib; };
 
-  crossAttrs = stdenv.lib.optionalAttrs (hostPlatform.libc == "libSystem") {
-    propagatedBuildInputs = [];
-    passthru = {};
-  };
-
   configureFlags = "--enable-static";
 
   postInstall = ''mv "$out/bin" "$dev/bin"'';
diff --git a/pkgs/development/libraries/libssh2/default.nix b/pkgs/development/libraries/libssh2/default.nix
index a09a76707390..f85b709cf397 100644
--- a/pkgs/development/libraries/libssh2/default.nix
+++ b/pkgs/development/libraries/libssh2/default.nix
@@ -12,22 +12,8 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" "devdoc" ];
 
-  buildInputs = [ openssl zlib ];
-
-  crossAttrs = {
-    # link against cross-built libraries
-    configureFlags = [
-      "--with-openssl"
-      "--with-libssl-prefix=${openssl.crossDrv}"
-      "--with-libz"
-      "--with-libz-prefix=${zlib.crossDrv}"
-    ];
-  } // stdenv.lib.optionalAttrs (hostPlatform.libc == "msvcrt") {
-    # mingw needs import library of ws2_32 to build the shared library
-    preConfigure = ''
-      export LDFLAGS="-L${windows.mingw_w64}/lib $LDFLAGS"
-    '';
-  };
+  buildInputs = [ openssl zlib ]
+    ++ stdenv.lib.optional hostPlatform.isMinGW windows.mingw_w64;
 
   meta = {
     description = "A client-side C library implementing the SSH2 protocol";