summary refs log tree commit diff
path: root/pkgs/development/libraries/ustr
diff options
context:
space:
mode:
authorWilliam A. Kennington III <william@wkennington.com>2015-07-31 12:38:36 -0700
committerWilliam A. Kennington III <william@wkennington.com>2015-07-31 17:11:10 -0700
commit308da3054e60c286ae525488a311445a7693a0ec (patch)
tree80f57e6ae912a60c4b8365319cb4abbb16b4bce1 /pkgs/development/libraries/ustr
parent40f45dcb6d8fa8c0e7831667b9bbe1a0575ff7d2 (diff)
downloadnixpkgs-308da3054e60c286ae525488a311445a7693a0ec.tar
nixpkgs-308da3054e60c286ae525488a311445a7693a0ec.tar.gz
nixpkgs-308da3054e60c286ae525488a311445a7693a0ec.tar.bz2
nixpkgs-308da3054e60c286ae525488a311445a7693a0ec.tar.lz
nixpkgs-308da3054e60c286ae525488a311445a7693a0ec.tar.xz
nixpkgs-308da3054e60c286ae525488a311445a7693a0ec.tar.zst
nixpkgs-308da3054e60c286ae525488a311445a7693a0ec.zip
ustr: Cleanup
Diffstat (limited to 'pkgs/development/libraries/ustr')
-rw-r--r--pkgs/development/libraries/ustr/default.nix30
1 files changed, 23 insertions, 7 deletions
diff --git a/pkgs/development/libraries/ustr/default.nix b/pkgs/development/libraries/ustr/default.nix
index b016a6f715c..9a7475969c6 100644
--- a/pkgs/development/libraries/ustr/default.nix
+++ b/pkgs/development/libraries/ustr/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchurl, glibc }:
-stdenv.mkDerivation rec {
+{ stdenv, fetchurl }:
 
+stdenv.mkDerivation rec {
   name = "ustr-${version}";
   version = "1.0.4";
 
@@ -9,14 +9,30 @@ stdenv.mkDerivation rec {
     sha256 = "1i623ygdj7rkizj7985q9d6vj5amwg686aqb5j3ixpkqkyp6xbrx";
   };
 
-  prePatch = "substituteInPlace Makefile --replace /usr/include/ ${glibc}/include/";
+  # Fixes bogus warnings that failed libsemanage
+  patches = [ ./va_args.patch ];
+
+  # Work around gcc5 switch to gnu11
+  NIX_CFLAGS_COMPILE = "-std=gnu89";
+
+  # Fix detection of stdint.h
+  postPatch = ''
+    sed -i 's,\(have_stdint_h\)=0,\1=1,g' Makefile
+    sed -i 's,\(USTR_CONF_HAVE_STDINT_H\) 0,\1 1,g' ustr-import.in
+  '';
 
-  patches = [ ./va_args.patch ]; # fixes bogus warnings that failed libsemanage
+  buildTargets = [ "all-shared" ];
 
-  makeFlags = "DESTDIR=$(out) prefix= LDCONFIG=echo";
+  preBuild = ''
+    makeFlagsArray+=("prefix=$out")
+    makeFlagsArray+=("LDCONFIG=echo")
+    makeFlagsArray+=("HIDE=")
+  '';
 
-  configurePhase = "make ustr-import";
-  buildInputs = [ glibc ];
+  # Remove debug libraries
+  postInstall = ''
+    find $out/lib -name \*debug\* -delete
+  '';
 
   meta = with stdenv.lib; {
     homepage = http://www.and.org/ustr/;