2010-07-28 13:55:54 +02:00
|
|
|
{ stdenv, fetchurl }:
|
|
|
|
|
2015-04-07 19:41:44 +02:00
|
|
|
let
|
|
|
|
inherit (stdenv.lib) optional;
|
|
|
|
in
|
2008-01-28 20:45:19 +01:00
|
|
|
stdenv.mkDerivation rec{
|
2015-01-03 02:17:34 +01:00
|
|
|
name = "iniparser-3.1";
|
2008-01-28 20:45:19 +01:00
|
|
|
|
2010-07-28 13:55:54 +02:00
|
|
|
src = fetchurl {
|
2015-01-03 02:17:34 +01:00
|
|
|
url = "${meta.homepage}/iniparser-3.1.tar.gz";
|
|
|
|
sha256 = "1igmxzcy0s25zcy9vmcw0kd13lh60r0b4qg8lnp1jic33f427pxf";
|
2010-07-28 13:55:54 +02:00
|
|
|
};
|
2008-01-28 20:45:19 +01:00
|
|
|
|
2010-07-28 13:55:54 +02:00
|
|
|
patches = ./no-usr.patch;
|
2008-01-28 20:45:19 +01:00
|
|
|
|
2015-04-07 19:41:44 +02:00
|
|
|
# TODO: Build dylib on Darwin
|
2015-08-04 18:55:29 +02:00
|
|
|
buildFlags = (if stdenv.isDarwin then [ "libiniparser.a" ] else [ "libiniparser.so" ]) ++ [ "CC=cc" ];
|
2008-01-28 20:45:19 +01:00
|
|
|
|
2010-07-28 13:55:54 +02:00
|
|
|
installPhase = ''
|
2012-01-18 21:16:00 +01:00
|
|
|
mkdir -p $out/lib
|
2008-01-28 20:45:19 +01:00
|
|
|
|
2012-01-18 21:16:00 +01:00
|
|
|
mkdir -p $out/include
|
2010-07-28 13:55:54 +02:00
|
|
|
cp src/*.h $out/include
|
2008-01-28 20:45:19 +01:00
|
|
|
|
2012-01-18 21:16:00 +01:00
|
|
|
mkdir -p $out/share/doc/${name}
|
2010-07-28 13:55:54 +02:00
|
|
|
for i in AUTHORS INSTALL LICENSE README; do
|
|
|
|
bzip2 -c -9 $i > $out/share/doc/${name}/$i.bz2;
|
|
|
|
done;
|
|
|
|
cp -r html $out/share/doc/${name}
|
2015-04-07 19:41:44 +02:00
|
|
|
|
|
|
|
'' + (if stdenv.isDarwin then ''
|
|
|
|
cp libiniparser.a $out/lib
|
|
|
|
'' else ''
|
|
|
|
cp libiniparser.so.0 $out/lib
|
|
|
|
ln -s libiniparser.so.0 $out/lib/libiniparser.so
|
|
|
|
'');
|
2008-01-28 20:45:19 +01:00
|
|
|
|
2010-07-28 13:55:54 +02:00
|
|
|
meta = {
|
|
|
|
homepage = http://ndevilla.free.fr/iniparser;
|
|
|
|
description = "Free standalone ini file parsing library";
|
2014-06-19 06:19:00 +02:00
|
|
|
license = stdenv.lib.licenses.mit;
|
2016-08-02 19:50:55 +02:00
|
|
|
platforms = stdenv.lib.platforms.unix;
|
2010-07-28 13:55:54 +02:00
|
|
|
};
|
2008-01-28 20:45:19 +01:00
|
|
|
}
|