diff options
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/iniparser')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/iniparser/default.nix | 48 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/iniparser/no-usr.patch | 13 |
2 files changed, 61 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/iniparser/default.nix b/nixpkgs/pkgs/development/libraries/iniparser/default.nix new file mode 100644 index 000000000000..8beda8663c5c --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/iniparser/default.nix @@ -0,0 +1,48 @@ +{ stdenv, fetchFromGitHub }: + +stdenv.mkDerivation rec { + name = "iniparser-${version}"; + version = "4.1"; + + src = fetchFromGitHub { + owner = "ndevilla"; + repo = "iniparser"; + rev = "v${version}"; + sha256 = "0dhab6pad6wh816lr7r3jb6z273njlgw2vpw8kcfnmi7ijaqhnr5"; + }; + + patches = ./no-usr.patch; + + postPatch = stdenv.lib.optionalString stdenv.isDarwin '' + substituteInPlace Makefile \ + --replace -Wl,-soname= -Wl,-install_name, + ''; + + doCheck = true; + preCheck = "patchShebangs test/make-tests.sh"; + + installPhase = '' + mkdir -p $out/lib + + mkdir -p $out/include + cp src/*.h $out/include + + mkdir -p $out/share/doc/${name} + for i in AUTHORS INSTALL LICENSE README.md; do + bzip2 -c -9 $i > $out/share/doc/${name}/$i.bz2; + done; + cp -r html $out/share/doc/${name} + + cp libiniparser.a $out/lib + cp libiniparser.so.1 $out/lib + ln -s libiniparser.so.1 $out/lib/libiniparser.so + ''; + + meta = with stdenv.lib; { + inherit (src.meta) homepage; + description = "Free standalone ini file parsing library"; + license = licenses.mit; + platforms = platforms.unix; + maintainers = [ maintainers.primeos ]; + }; +} diff --git a/nixpkgs/pkgs/development/libraries/iniparser/no-usr.patch b/nixpkgs/pkgs/development/libraries/iniparser/no-usr.patch new file mode 100644 index 000000000000..a3c568cdde43 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/iniparser/no-usr.patch @@ -0,0 +1,13 @@ +--- a/Makefile 2017-10-20 20:30:41.494608284 +0200 ++++ b/Makefile 2017-10-20 20:33:22.279212026 +0200 +@@ -20,8 +20,8 @@ + ARFLAGS = rcv + + SHLD = ${CC} ${CFLAGS} +-LDSHFLAGS = -shared -Wl,-Bsymbolic +-LDFLAGS += -Wl,-rpath -Wl,/usr/lib -Wl,-rpath,/usr/lib ++LDSHFLAGS = -shared ++LDFLAGS = + + # .so.0 is for version 3.x, .so.1 is 4.x + SO_TARGET ?= libiniparser.so.1 |