2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub }:
|
2010-07-28 11:55:54 +00:00
|
|
|
|
2017-11-07 07:47:48 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "iniparser";
|
2017-11-07 07:47:48 +00:00
|
|
|
version = "4.1";
|
2017-10-20 18:37:36 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ndevilla";
|
|
|
|
repo = "iniparser";
|
|
|
|
rev = "v${version}";
|
2017-11-07 07:47:48 +00:00
|
|
|
sha256 = "0dhab6pad6wh816lr7r3jb6z273njlgw2vpw8kcfnmi7ijaqhnr5";
|
2010-07-28 11:55:54 +00:00
|
|
|
};
|
2008-01-28 19:45:19 +00:00
|
|
|
|
2010-07-28 11:55:54 +00:00
|
|
|
patches = ./no-usr.patch;
|
2008-01-28 19:45:19 +00:00
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
postPatch = lib.optionalString stdenv.isDarwin ''
|
2018-03-19 21:57:31 +00:00
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace -Wl,-soname= -Wl,-install_name,
|
|
|
|
'';
|
|
|
|
|
2017-10-20 18:37:36 +00:00
|
|
|
doCheck = true;
|
|
|
|
preCheck = "patchShebangs test/make-tests.sh";
|
|
|
|
|
2010-07-28 11:55:54 +00:00
|
|
|
installPhase = ''
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p $out/lib
|
2008-01-28 19:45:19 +00:00
|
|
|
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p $out/include
|
2010-07-28 11:55:54 +00:00
|
|
|
cp src/*.h $out/include
|
2008-01-28 19:45:19 +00:00
|
|
|
|
2019-08-15 12:41:18 +00:00
|
|
|
mkdir -p $out/share/doc/${pname}-${version}
|
2017-10-20 18:37:36 +00:00
|
|
|
for i in AUTHORS INSTALL LICENSE README.md; do
|
2019-08-15 12:41:18 +00:00
|
|
|
bzip2 -c -9 $i > $out/share/doc/${pname}-${version}/$i.bz2;
|
2010-07-28 11:55:54 +00:00
|
|
|
done;
|
2019-08-15 12:41:18 +00:00
|
|
|
cp -r html $out/share/doc/${pname}-${version}
|
2015-04-07 17:41:44 +00:00
|
|
|
|
|
|
|
cp libiniparser.a $out/lib
|
2017-11-07 07:47:48 +00:00
|
|
|
cp libiniparser.so.1 $out/lib
|
|
|
|
ln -s libiniparser.so.1 $out/lib/libiniparser.so
|
2021-03-13 07:11:03 +00:00
|
|
|
|
|
|
|
mkdir -p $out/lib/pkgconfig
|
|
|
|
substituteAll ${./iniparser.pc.in} $out/lib/pkgconfig/iniparser.pc
|
2017-11-07 07:47:48 +00:00
|
|
|
'';
|
2008-01-28 19:45:19 +00:00
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2017-10-20 18:37:36 +00:00
|
|
|
inherit (src.meta) homepage;
|
2010-07-28 11:55:54 +00:00
|
|
|
description = "Free standalone ini file parsing library";
|
2017-11-07 07:47:48 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = [ maintainers.primeos ];
|
2010-07-28 11:55:54 +00:00
|
|
|
};
|
2008-01-28 19:45:19 +00:00
|
|
|
}
|