libplist: 2.2.0 -> 2.2.0+date=2022-04-05, cleanup, use Python 3

This commit is contained in:
Thomas Watson 2022-05-22 19:58:25 -05:00
parent f758d33d27
commit 742dc5ea13

View File

@ -1,34 +1,46 @@
{ lib, stdenv, autoreconfHook, fetchFromGitHub, pkg-config, enablePython ? false, python ? null, glib }:
{ lib
, stdenv
, fetchFromGitHub
, autoreconfHook
, pkg-config
, enablePython ? false
, python3
}:
stdenv.mkDerivation rec {
pname = "libplist";
version = "2.2.0";
version = "2.2.0+date=2022-04-05";
outputs = [ "bin" "dev" "out" ] ++ lib.optional enablePython "py";
src = fetchFromGitHub {
owner = "libimobiledevice";
repo = pname;
rev = version;
sha256 = "1vxhpjxniybqsg5wcygmdmr5dv7p2zb34dqnd3bi813rnnzsdjm6";
rev = "db93bae96d64140230ad050061632531644c46ad";
hash = "sha256-8e/PFDhsyrOgmI3vLT1YhcROmbJgArDAJSe8Z2bZafo=";
};
outputs = ["bin" "dev" "out" ] ++ lib.optional enablePython "py";
postPatch = ''
echo '${version}' > .tarball-version
'';
nativeBuildInputs = [
pkg-config
autoreconfHook
] ++ lib.optionals enablePython [
python
python.pkgs.cython
pkg-config
];
buildInputs = lib.optionals enablePython [
python3
python3.pkgs.cython
];
configureFlags = lib.optionals (!enablePython) [
"--without-cython"
];
propagatedBuildInputs = [ glib ];
postFixup = lib.optionalString enablePython ''
moveToOutput "lib/${python.libPrefix}" "$py"
moveToOutput "lib/${python3.libPrefix}" "$py"
'';
meta = with lib; {
@ -36,6 +48,6 @@ stdenv.mkDerivation rec {
homepage = "https://github.com/libimobiledevice/libplist";
license = licenses.lgpl21Plus;
maintainers = with maintainers; [ infinisil ];
platforms = platforms.linux ++ platforms.darwin;
platforms = platforms.unix;
};
}