1{
2 fetchurl,
3 lib,
4 stdenv,
5 meson,
6 ninja,
7 vala,
8 gtk-doc,
9 docbook_xsl,
10 docbook_xml_dtd_412,
11 pkg-config,
12 glib,
13 gtk3,
14 cairo,
15 sqlite,
16 gnome,
17 clutter-gtk,
18 libsoup_2_4,
19 libsoup_3,
20 gobject-introspection, # , libmemphis
21 withLibsoup3 ? false,
22}:
23
24stdenv.mkDerivation rec {
25 pname = "libchamplain";
26 version = "0.12.21";
27
28 outputs = [
29 "out"
30 "dev"
31 ]
32 ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ "devdoc" ];
33
34 src = fetchurl {
35 url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
36 sha256 = "qRXNFyoMUpRMVXn8tGg/ioeMVxv16SglS12v78cn5ac=";
37 };
38
39 nativeBuildInputs = [
40 meson
41 ninja
42 pkg-config
43 gobject-introspection
44 vala
45 ]
46 ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [
47 gtk-doc
48 docbook_xsl
49 docbook_xml_dtd_412
50 ];
51
52 buildInputs = [
53 sqlite
54 (if withLibsoup3 then libsoup_3 else libsoup_2_4)
55 ];
56
57 propagatedBuildInputs = [
58 glib
59 gtk3
60 cairo
61 clutter-gtk
62 ];
63
64 mesonFlags = [
65 (lib.mesonBool "gtk_doc" (stdenv.buildPlatform == stdenv.hostPlatform))
66 "-Dvapi=true"
67 (lib.mesonBool "libsoup3" withLibsoup3)
68 ];
69
70 passthru = {
71 updateScript = gnome.updateScript {
72 packageName = pname;
73 versionPolicy = "odd-unstable";
74 };
75 };
76
77 meta = with lib; {
78 homepage = "https://gitlab.gnome.org/GNOME/libchamplain";
79 license = licenses.lgpl2Plus;
80
81 description = "C library providing a ClutterActor to display maps";
82
83 longDescription = ''
84 libchamplain is a C library providing a ClutterActor to display
85 maps. It also provides a GTK widget to display maps in GTK
86 applications. Python and Perl bindings are also available. It
87 supports numerous free map sources such as OpenStreetMap,
88 OpenCycleMap, OpenAerialMap, and Maps for free.
89 '';
90
91 teams = [
92 teams.gnome
93 teams.pantheon
94 ];
95 platforms = platforms.unix;
96 };
97}