about summary refs log tree commit diff
path: root/pkgs/development/tools/misc
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2017-07-05 08:55:26 +0200
committerVladimír Čunát <vcunat@gmail.com>2017-07-05 08:55:26 +0200
commit5328aac7be5b7ebf794349f915a379efd04b018b (patch)
tree029547f7673a785c42f12770a68a3ec31a297bf9 /pkgs/development/tools/misc
parentf203b32bb8e824a75f89fd9805680b4a8e92d2a5 (diff)
parentc73f0caea5f0822ea044b4f90de4b64706d91362 (diff)
downloadnixlib-5328aac7be5b7ebf794349f915a379efd04b018b.tar
nixlib-5328aac7be5b7ebf794349f915a379efd04b018b.tar.gz
nixlib-5328aac7be5b7ebf794349f915a379efd04b018b.tar.bz2
nixlib-5328aac7be5b7ebf794349f915a379efd04b018b.tar.lz
nixlib-5328aac7be5b7ebf794349f915a379efd04b018b.tar.xz
nixlib-5328aac7be5b7ebf794349f915a379efd04b018b.tar.zst
nixlib-5328aac7be5b7ebf794349f915a379efd04b018b.zip
Merge branch 'staging'
Comparison looks OK; I'll try some fixes on master directly.
http://hydra.nixos.org/eval/1372577?compare=1372497
Diffstat (limited to 'pkgs/development/tools/misc')
-rw-r--r--pkgs/development/tools/misc/binutils/default.nix12
-rw-r--r--pkgs/development/tools/misc/gdb/default.nix5
-rw-r--r--pkgs/development/tools/misc/help2man/1.40.4-cygwin-nls.patch10
-rw-r--r--pkgs/development/tools/misc/help2man/default.nix7
-rw-r--r--pkgs/development/tools/misc/pkgconfig/2.36.3-not-win32.patch13
-rw-r--r--pkgs/development/tools/misc/pkgconfig/default.nix2
6 files changed, 36 insertions, 13 deletions
diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix
index 82eb7f77bb4c..ae58c72b786d 100644
--- a/pkgs/development/tools/misc/binutils/default.nix
+++ b/pkgs/development/tools/misc/binutils/default.nix
@@ -8,10 +8,13 @@ let
   version = "2.28";
   basename = "binutils-${version}";
   inherit (stdenv.lib) optional optionals optionalString;
+  # The prefix prepended to binary names to allow multiple binuntils on the
+  # PATH to both be usable.
+  prefix = optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-";
 in
 
 stdenv.mkDerivation rec {
-  name = optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-" + basename;
+  name = prefix + basename;
 
   src = fetchurl {
     url = "mirror://gnu/binutils/${basename}.tar.bz2";
@@ -78,15 +81,20 @@ stdenv.mkDerivation rec {
     then "-Wno-string-plus-int -Wno-deprecated-declarations"
     else "-static-libgcc";
 
+  # TODO(@Ericson2314): Always pass "--target" and always prefix.
+  configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
   configureFlags =
     [ "--enable-shared" "--enable-deterministic-archives" "--disable-werror" ]
     ++ optional (stdenv.system == "mips64el-linux") "--enable-fix-loongson2f-nop"
-    ++ optional (targetPlatform != hostPlatform) "--target=${targetPlatform.config}" # TODO: make this unconditional
     ++ optionals gold [ "--enable-gold" "--enable-plugins" ]
     ++ optional (stdenv.system == "i686-linux") "--enable-targets=x86_64-linux-gnu";
 
   enableParallelBuilding = true;
 
+  passthru = {
+    inherit prefix;
+  };
+
   meta = with stdenv.lib; {
     description = "Tools for manipulating binaries (linker, assembler, etc.)";
     longDescription = ''
diff --git a/pkgs/development/tools/misc/gdb/default.nix b/pkgs/development/tools/misc/gdb/default.nix
index 1e9cf910857c..78dd4a1e3f55 100644
--- a/pkgs/development/tools/misc/gdb/default.nix
+++ b/pkgs/development/tools/misc/gdb/default.nix
@@ -48,6 +48,9 @@ stdenv.mkDerivation rec {
 
   NIX_CFLAGS_COMPILE = "-Wno-format-nonliteral";
 
+  # TODO(@Ericson2314): Always pass "--target" and always prefix.
+  configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
+
   configureFlags = with stdenv.lib; [
     "--with-gmp=${gmp.dev}" "--with-mpfr=${mpfr.dev}" "--with-system-readline"
     "--with-system-zlib" "--with-expat" "--with-libexpat-prefix=${expat.dev}"
@@ -55,8 +58,6 @@ stdenv.mkDerivation rec {
       # TODO(@Ericson2314): make this conditional on whether host platform is NixOS
       "--with-separate-debug-dir=/run/current-system/sw/lib/debug"
     ++ stdenv.lib.optional (!pythonSupport) "--without-python"
-    # TODO(@Ericson2314): This should be done in stdenv, not per-package
-    ++ stdenv.lib.optional (targetPlatform != hostPlatform) "--target=${targetPlatform.config}"
     ++ stdenv.lib.optional multitarget "--enable-targets=all";
 
   postInstall =
diff --git a/pkgs/development/tools/misc/help2man/1.40.4-cygwin-nls.patch b/pkgs/development/tools/misc/help2man/1.40.4-cygwin-nls.patch
index 20b99998154d..82f8cf1cb37b 100644
--- a/pkgs/development/tools/misc/help2man/1.40.4-cygwin-nls.patch
+++ b/pkgs/development/tools/misc/help2man/1.40.4-cygwin-nls.patch
@@ -16,8 +16,8 @@ that we're trying to help2man).
 
  install_preload: install_dirs preload
 -	$(INSTALL_PROGRAM) $(preload).so $(DESTDIR)$(pkglibdir)
-+	$(INSTALL_PROGRAM) lib/cygintl-8.dll $(DESTDIR)$(pkglibdir)
-+	ln -sf cygintl-8.dll $(DESTDIR)$(pkglibdir)/$(preload).so
++	$(INSTALL_PROGRAM) lib/cygintl-9.dll $(DESTDIR)$(pkglibdir)
++	ln -sf cygintl-9.dll $(DESTDIR)$(pkglibdir)/$(preload).so
 
  install_l10n: install_dirs msg_l10n man_l10n info_l10n
         set -e; \
@@ -27,8 +27,8 @@ that we're trying to help2man).
  $(preload).so: $(srcdir)/$(preload).c
 -	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ -fPIC -shared $? $(LIBS)
 +	mkdir -p lib
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o lib/cygintl-8.dll -shared $? $(LIBS)
-+	ln -sf lib/cygintl-8.dll $@
++	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o lib/cygintl-9.dll -shared $? $(LIBS)
++	ln -sf lib/cygintl-9.dll $@
 
  man: $(target).1
  $(target).1: $(srcdir)/$(target).PL $(srcdir)/$(target).h2m.PL
@@ -62,7 +62,7 @@ that we're trying to help2man).
          return;
  
 +#ifdef __CYGWIN__
-+    if (!(RTLD_NEXT = dlopen("/usr/bin/cygintl-8.dll", RTLD_LAZY)))
++    if (!(RTLD_NEXT = dlopen("/usr/bin/cygintl-9.dll", RTLD_LAZY)))
 +        die("libintl8 not found");
 +#endif
 +
diff --git a/pkgs/development/tools/misc/help2man/default.nix b/pkgs/development/tools/misc/help2man/default.nix
index 8bf3db59147b..5e2edce56f0d 100644
--- a/pkgs/development/tools/misc/help2man/default.nix
+++ b/pkgs/development/tools/misc/help2man/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl, gettext, LocaleGettext, makeWrapper }:
+{ stdenv, hostPlatform, fetchurl, perl, gettext, LocaleGettext, makeWrapper }:
 
 stdenv.mkDerivation rec {
   name = "help2man-1.47.4";
@@ -12,11 +12,12 @@ stdenv.mkDerivation rec {
 
   doCheck = false;                                # target `check' is missing
 
-  patches = if stdenv.isCygwin then [ ./1.40.4-cygwin-nls.patch ] else null;
+  patches = if hostPlatform.isCygwin then [ ./1.40.4-cygwin-nls.patch ] else null;
 
   postInstall =
     '' wrapProgram "$out/bin/help2man" \
-         --prefix PERL5LIB : "$(echo ${LocaleGettext}/lib/perl*/site_perl)"
+         --prefix PERL5LIB : "$(echo ${LocaleGettext}/lib/perl*/site_perl)" \
+         ${stdenv.lib.optionalString hostPlatform.isCygwin "--prefix PATH : ${gettext}/bin"}
     '';
 
 
diff --git a/pkgs/development/tools/misc/pkgconfig/2.36.3-not-win32.patch b/pkgs/development/tools/misc/pkgconfig/2.36.3-not-win32.patch
index 246173d465af..c1dd808e6008 100644
--- a/pkgs/development/tools/misc/pkgconfig/2.36.3-not-win32.patch
+++ b/pkgs/development/tools/misc/pkgconfig/2.36.3-not-win32.patch
@@ -309,3 +309,16 @@
  # else
  
    /* On old systems which lack it, use setlocale or getenv.  */
+diff --git a/glib/gtypes.h b/glib/gtypes.h
+index c18e0bf..816685a 100644
+--- a/glib/glib/gtypes.h
++++ b/glib/glib/gtypes.h
+@@ -462,7 +462,7 @@ G_END_DECLS
+  * properly get exported in Windows DLLs.
+  */
+ #ifndef GLIB_VAR
+-#  ifdef G_PLATFORM_WIN32
++#  ifdef G_OS_WIN32
+ #    ifdef GLIB_STATIC_COMPILATION
+ #      define GLIB_VAR extern
+ #    else /* !GLIB_STATIC_COMPILATION */
diff --git a/pkgs/development/tools/misc/pkgconfig/default.nix b/pkgs/development/tools/misc/pkgconfig/default.nix
index 10358df69c22..5be42855a9c7 100644
--- a/pkgs/development/tools/misc/pkgconfig/default.nix
+++ b/pkgs/development/tools/misc/pkgconfig/default.nix
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
   configureFlags = [ "--with-internal-glib" ]
     ++ optional (stdenv.isSunOS) [ "--with-libiconv=gnu" "--with-system-library-path" "--with-system-include-path" "CFLAGS=-DENABLE_NLS" ];
 
-  postInstall = ''rm "$out"/bin/*-pkg-config''; # clean the duplicate file
+  postInstall = ''rm -f "$out"/bin/*-pkg-config''; # clean the duplicate file
 
   meta = {
     description = "A tool that allows packages to find out information about other packages";