Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
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.2.0+date=2022-04-05";
14
15 outputs = [ "bin" "dev" "out" ] ++ lib.optional enablePython "py";
16
17 src = fetchFromGitHub {
18 owner = "libimobiledevice";
19 repo = pname;
20 rev = "db93bae96d64140230ad050061632531644c46ad";
21 hash = "sha256-8e/PFDhsyrOgmI3vLT1YhcROmbJgArDAJSe8Z2bZafo=";
22 };
23
24 postPatch = ''
25 echo '${version}' > .tarball-version
26 '';
27
28 nativeBuildInputs = [
29 autoreconfHook
30 pkg-config
31 ];
32
33 buildInputs = lib.optionals enablePython [
34 python3
35 python3.pkgs.cython
36 ];
37
38 configureFlags = lib.optionals (!enablePython) [
39 "--without-cython"
40 ];
41
42 postFixup = lib.optionalString enablePython ''
43 moveToOutput "lib/${python3.libPrefix}" "$py"
44 '';
45
46 meta = with lib; {
47 description = "A library to handle Apple Property List format in binary or XML";
48 homepage = "https://github.com/libimobiledevice/libplist";
49 license = licenses.lgpl21Plus;
50 maintainers = with maintainers; [ infinisil ];
51 platforms = platforms.unix;
52 };
53}