1{ lib
2, stdenv
3, fetchFromGitHub
4, autoreconfHook
5, pkg-config
6
7, enablePython ? false
8, python3
9}:
10
11stdenv.mkDerivation rec {
12 pname = "libplist";
13 version = "2.6.0";
14
15 outputs = [ "bin" "dev" "out" ] ++ lib.optional enablePython "py";
16
17 src = fetchFromGitHub {
18 owner = "libimobiledevice";
19 repo = pname;
20 rev = version;
21 hash = "sha256-hitRcOjbF+L9Og9/qajqFqOhKfRn9+iWLoCKmS9dT80=";
22 };
23
24 nativeBuildInputs = [
25 autoreconfHook
26 pkg-config
27 ];
28
29 buildInputs = lib.optionals enablePython [
30 python3
31 python3.pkgs.cython
32 ];
33
34 preAutoreconf = ''
35 export RELEASE_VERSION=${version}
36 '';
37
38 configureFlags = [
39 "--enable-debug"
40 ] ++ lib.optionals (!enablePython) [
41 "--without-cython"
42 ];
43
44 doCheck = true;
45
46 postFixup = lib.optionalString enablePython ''
47 moveToOutput "lib/${python3.libPrefix}" "$py"
48 '';
49
50 meta = with lib; {
51 description = "Library to handle Apple Property List format in binary or XML";
52 homepage = "https://github.com/libimobiledevice/libplist";
53 license = licenses.lgpl21Plus;
54 maintainers = [ ];
55 platforms = platforms.unix;
56 mainProgram = "plistutil";
57 };
58}