about summary refs log tree commit diff
path: root/pkgs/development/tools
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2018-02-16 09:13:12 +0100
committerVladimír Čunát <vcunat@gmail.com>2018-02-16 09:13:12 +0100
commitb5aaaf87a7741f1c20672c584ca08a01fa1a1129 (patch)
tree8cd4b2948285c21ad71abb1258dd5d41f17fdc01 /pkgs/development/tools
parent90252481bfe233c3fe5a54f9d6d73e93f08e1e27 (diff)
parent2b851d14d9f7fa09120a407fecf3a81cea12bebe (diff)
downloadnixlib-b5aaaf87a7741f1c20672c584ca08a01fa1a1129.tar
nixlib-b5aaaf87a7741f1c20672c584ca08a01fa1a1129.tar.gz
nixlib-b5aaaf87a7741f1c20672c584ca08a01fa1a1129.tar.bz2
nixlib-b5aaaf87a7741f1c20672c584ca08a01fa1a1129.tar.lz
nixlib-b5aaaf87a7741f1c20672c584ca08a01fa1a1129.tar.xz
nixlib-b5aaaf87a7741f1c20672c584ca08a01fa1a1129.tar.zst
nixlib-b5aaaf87a7741f1c20672c584ca08a01fa1a1129.zip
Merge staging and PR #35021
It's the last staging commit (mostly) built on Hydra,
and a minimal fix for Darwin regression in pysqlite.
Diffstat (limited to 'pkgs/development/tools')
-rw-r--r--pkgs/development/tools/build-managers/cmake/default.nix16
-rwxr-xr-xpkgs/development/tools/build-managers/cmake/setup-hook.sh10
-rw-r--r--pkgs/development/tools/build-managers/gnumake/4.2/default.nix2
-rw-r--r--pkgs/development/tools/misc/autoconf/default.nix3
-rw-r--r--pkgs/development/tools/misc/autogen/default.nix19
-rw-r--r--pkgs/development/tools/misc/lsof/default.nix4
-rw-r--r--pkgs/development/tools/misc/patchelf/unstable.nix6
7 files changed, 53 insertions, 7 deletions
diff --git a/pkgs/development/tools/build-managers/cmake/default.nix b/pkgs/development/tools/build-managers/cmake/default.nix
index fed88561cf9c..97c02cd9cc12 100644
--- a/pkgs/development/tools/build-managers/cmake/default.nix
+++ b/pkgs/development/tools/build-managers/cmake/default.nix
@@ -83,11 +83,25 @@ stdenv.mkDerivation rec {
   configureFlags = [ "--docdir=share/doc/${name}" ]
     ++ (if useSharedLibraries then [ "--no-system-jsoncpp" "--system-libs" ] else [ "--no-system-libs" ]) # FIXME: cleanup
     ++ optional (useQt4 || withQt5) "--qt-gui"
-    ++ optionals (!useNcurses) [ "--" "-DBUILD_CursesDialog=OFF" ];
+    ++ ["--"]
+    ++ optionals (!useNcurses) [ "-DBUILD_CursesDialog=OFF" ]
+    ++ optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
+      "-DCMAKE_CXX_COMPILER=${stdenv.cc.targetPrefix}c++"
+      "-DCMAKE_C_COMPILER=${stdenv.cc.targetPrefix}cc"
+      "-DCMAKE_AR=${getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ar"
+      "-DCMAKE_RANLIB=${getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ranlib"
+      "-DCMAKE_STRIP=${getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}strip"
+      # TODO: Why are ar and friends not provided by the bintools wrapper?
+    ];
 
   dontUseCmakeConfigure = true;
   enableParallelBuilding = true;
 
+  # This isn't an autoconf configure script; triples are passed via
+  # CMAKE_SYSTEM_NAME, etc.
+  configurePlatforms = [ ];
+
+
   meta = with stdenv.lib; {
     homepage = http://www.cmake.org/;
     description = "Cross-Platform Makefile Generator";
diff --git a/pkgs/development/tools/build-managers/cmake/setup-hook.sh b/pkgs/development/tools/build-managers/cmake/setup-hook.sh
index a0f1cf00814c..c796c31cb70a 100755
--- a/pkgs/development/tools/build-managers/cmake/setup-hook.sh
+++ b/pkgs/development/tools/build-managers/cmake/setup-hook.sh
@@ -33,7 +33,15 @@ cmakeConfigurePhase() {
         # By now it supports linux builds only. We should set the proper
         # CMAKE_SYSTEM_NAME otherwise.
         # http://www.cmake.org/Wiki/CMake_Cross_Compiling
-        cmakeFlags="-DCMAKE_CXX_COMPILER=$crossConfig-g++ -DCMAKE_C_COMPILER=$crossConfig-gcc $cmakeFlags"
+        #
+        # Unfortunately cmake seems to expect absolute paths for ar, ranlib, and
+        # strip. Otherwise they are taken to be relative to the source root of
+        # the package being built.
+        cmakeFlags="-DCMAKE_CXX_COMPILER=$crossConfig-c++ $cmakeFlags"
+        cmakeFlags="-DCMAKE_C_COMPILER=$crossConfig-cc $cmakeFlags"
+        cmakeFlags="-DCMAKE_AR=$(command -v $crossConfig-ar) $cmakeFlags"
+        cmakeFlags="-DCMAKE_RANLIB=$(command -v $crossConfig-ranlib) $cmakeFlags"
+        cmakeFlags="-DCMAKE_STRIP=$(command -v $crossConfig-strip) $cmakeFlags"
     fi
 
     # This installs shared libraries with a fully-specified install
diff --git a/pkgs/development/tools/build-managers/gnumake/4.2/default.nix b/pkgs/development/tools/build-managers/gnumake/4.2/default.nix
index 7914d8ebb4f8..e175205143fc 100644
--- a/pkgs/development/tools/build-managers/gnumake/4.2/default.nix
+++ b/pkgs/development/tools/build-managers/gnumake/4.2/default.nix
@@ -22,7 +22,7 @@ stdenv.mkDerivation {
     ./pselect.patch
   ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = stdenv.lib.optionals guileSupport [ pkgconfig ];
   buildInputs = stdenv.lib.optionals guileSupport [ guile ];
 
   configureFlags = stdenv.lib.optional guileSupport "--with-guile";
diff --git a/pkgs/development/tools/misc/autoconf/default.nix b/pkgs/development/tools/misc/autoconf/default.nix
index 472f437978bf..579dea33df47 100644
--- a/pkgs/development/tools/misc/autoconf/default.nix
+++ b/pkgs/development/tools/misc/autoconf/default.nix
@@ -8,7 +8,8 @@ stdenv.mkDerivation rec {
     sha256 = "113nlmidxy9kjr45kg9x3ngar4951mvag1js2a3j8nxcz34wxsv4";
   };
 
-  buildInputs = [ m4 perl ];
+  nativeBuildInputs = [ m4 perl ];
+  buildInputs = [ m4 ];
 
   # Work around a known issue in Cygwin.  See
   # http://thread.gmane.org/gmane.comp.sysutils.autoconf.bugs/6822 for
diff --git a/pkgs/development/tools/misc/autogen/default.nix b/pkgs/development/tools/misc/autogen/default.nix
index 28034f9d5492..77944297a972 100644
--- a/pkgs/development/tools/misc/autogen/default.nix
+++ b/pkgs/development/tools/misc/autogen/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, which, pkgconfig, perl, guile, libxml2 }:
+{ stdenv, buildPackages, fetchurl, which, pkgconfig, texinfo, perl, guile, libxml2 }:
 
 stdenv.mkDerivation rec {
   name = "autogen-${version}";
@@ -11,8 +11,21 @@ stdenv.mkDerivation rec {
 
   outputs = [ "bin" "dev" "lib" "out" "man" "info" ];
 
-  nativeBuildInputs = [ which pkgconfig perl ];
-  buildInputs = [ guile libxml2 ];
+  nativeBuildInputs = [ which pkgconfig perl ]
+    # autogen needs a build autogen when cross-compiling
+    ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+      buildPackages.autogen buildPackages.texinfo ];
+  buildInputs = [
+    guile libxml2
+  ];
+
+  configureFlags = stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+    "--with-libxml2=${libxml2.dev}"
+    "--with-libxml2-cflags=-I${libxml2.dev}/include/libxml2"
+    # the configure check for regcomp wants to run a host program
+    "libopts_cv_with_libregex=yes"
+    #"MAKEINFO=${buildPackages.texinfo}/bin/makeinfo"
+  ];
 
   postPatch = ''
     # Fix a broken sed expression used for detecting the minor
diff --git a/pkgs/development/tools/misc/lsof/default.nix b/pkgs/development/tools/misc/lsof/default.nix
index aa6bd003ed3f..224e0aba6ef7 100644
--- a/pkgs/development/tools/misc/lsof/default.nix
+++ b/pkgs/development/tools/misc/lsof/default.nix
@@ -30,6 +30,10 @@ stdenv.mkDerivation rec {
 
   patches = [ ./dfile.patch ];
 
+  postPatch = stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+    substituteInPlace dialects/linux/dlsof.h --replace "defined(__UCLIBC__)" 1
+  '';
+
   # Stop build scripts from searching global include paths
   LSOF_INCLUDE = "${stdenv.cc.libc}/include";
   configurePhase = "LINUX_CONF_CC=$CC_FOR_BUILD LSOF_CC=$CC LSOF_AR=\"$AR cr\" LSOF_RANLIB=$RANLIB ./Configure -n ${dialect}";
diff --git a/pkgs/development/tools/misc/patchelf/unstable.nix b/pkgs/development/tools/misc/patchelf/unstable.nix
index 626478798658..de68a4066d7d 100644
--- a/pkgs/development/tools/misc/patchelf/unstable.nix
+++ b/pkgs/development/tools/misc/patchelf/unstable.nix
@@ -10,6 +10,12 @@ stdenv.mkDerivation rec {
     sha256 = "1f1s8q3as3nrhcc1a8qc2z7imm644jfz44msn9sfv4mdynp2m2yb";
   };
 
+  # Drop test that fails on musl (?)
+  postPatch = stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+    substituteInPlace tests/Makefile.am \
+      --replace "set-rpath-library.sh" ""
+  '';
+
   setupHook = [ ./setup-hook.sh ];
 
   nativeBuildInputs = [ autoreconfHook ];