1{
2 stdenv,
3 lib,
4 fetchurl,
5 fetchpatch,
6 perlPackages,
7 gtk-doc,
8 intltool,
9 autoreconfHook,
10 pkg-config,
11 glib,
12 libxml2,
13 sqlite,
14 sg3_utils,
15 gdk-pixbuf,
16 taglib,
17 libimobiledevice,
18 monoSupport ? false,
19 mono,
20 udevCheckHook,
21 gtk-sharp-2_0,
22}:
23
24stdenv.mkDerivation rec {
25 pname = "libgpod";
26 version = "0.8.3";
27
28 src = fetchurl {
29 url = "mirror://sourceforge/gtkpod/libgpod-${version}.tar.bz2";
30 hash = "sha256-Y4p5WdBOlfHmKrrQK9M3AuTo3++YSFrH2dUDlcN+lV0=";
31 };
32
33 outputs = [
34 "out"
35 "dev"
36 ];
37
38 patches = [
39 (fetchpatch {
40 name = "libplist-2.3.0-compatibility.patch";
41 url = "https://sourceforge.net/p/gtkpod/patches/48/attachment/libplist-2.3.0-compatibility.patch";
42 hash = "sha256-aVkuYE1N/jdEhVhiXEVhApvOC+8csIMMpP20rAJwEVQ=";
43 })
44 ];
45
46 postPatch = ''
47 # support libplist 2.2
48 substituteInPlace configure.ac --replace 'libplist >= 1.0' 'libplist-2.0 >= 2.2'
49 '';
50
51 preAutoreconf = ''
52 gettextize --force --copy
53 intltoolize --force --copy
54 '';
55
56 configureFlags = [
57 "--without-hal"
58 "--enable-udev"
59 "--with-udev-dir=${placeholder "out"}/lib/udev"
60 ]
61 ++ lib.optionals monoSupport [ "--with-mono" ];
62
63 dontStrip = monoSupport;
64
65 nativeBuildInputs = [
66 autoreconfHook
67 gtk-doc
68 intltool
69 pkg-config
70 udevCheckHook
71 ]
72 ++ (with perlPackages; [
73 perl
74 XMLParser
75 ])
76 ++ lib.optional monoSupport mono;
77
78 buildInputs = [
79 libxml2
80 sg3_utils
81 sqlite
82 taglib
83 ]
84 ++ lib.optional monoSupport gtk-sharp-2_0;
85
86 propagatedBuildInputs = [
87 gdk-pixbuf
88 glib
89 libimobiledevice
90 ];
91
92 doInstallCheck = true;
93
94 env = lib.optionalAttrs stdenv.cc.isGNU {
95 NIX_CFLAGS_COMPILE = toString [
96 "-Wno-error=implicit-int"
97 "-Wno-error=incompatible-pointer-types"
98 ];
99 };
100
101 meta = with lib; {
102 homepage = "https://sourceforge.net/projects/gtkpod/";
103 description = "Library used by gtkpod to access the contents of an ipod";
104 mainProgram = "ipod-read-sysinfo-extended";
105 license = licenses.lgpl21Plus;
106 platforms = platforms.linux;
107 maintainers = [ ];
108 };
109}