anvil-editor: init at 0.4
[NixPkgs.git] / pkgs / development / libraries / libgda / 6.x.nix
blob72f4741fd2e761ee22de3aef08f0fff3f08972c9
1 { lib
2 , stdenv
3 , fetchurl
4 , fetchpatch
5 , pkg-config
6 , intltool
7 , meson
8 , ninja
9 , itstool
10 , libxml2
11 , python3
12 , gtk3
13 , json-glib
14 , isocodes
15 , openssl
16 , gnome
17 , gobject-introspection
18 , vala
19 , libgee
20 , sqlite
21 , gtk-doc
22 , yelp-tools
23 , mysqlSupport ? false
24 , libmysqlclient ? null
25 , postgresSupport ? false
26 , postgresql ? null
29 assert mysqlSupport -> libmysqlclient != null;
30 assert postgresSupport -> postgresql != null;
32 stdenv.mkDerivation rec {
33   pname = "libgda";
34   version = "6.0.0";
36   src = fetchurl {
37     url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
38     sha256 = "0w564z7krgjk19r39mi5qn4kggpdg9ggbyn9pb4aavb61r14npwr";
39   };
41   patches = [
42     # Fix undefined behavior
43     (fetchpatch {
44       url = "https://gitlab.gnome.org/GNOME/libgda/-/commit/657b2f8497da907559a6769c5b1d2d7b5bd40688.patch";
45       sha256 = "Qx4S9KQsTAr4M0QJi0Xr5kKuHSp4NwZJHoRPYyxIyTk=";
46     })
48     # Fix building vapi
49     (fetchpatch {
50       url = "https://gitlab.gnome.org/GNOME/libgda/-/commit/57f618a3b2a3758ee3dcbf9bbdc566122dd8566d.patch";
51       sha256 = "pyfymUd61m1kHaGyMbUQMma+szB8mlqGWwcFBBQawf8=";
52     })
54     (fetchpatch {
55       name = "CVE-2021-39359.patch";
56       url = "https://gitlab.gnome.org/GNOME/libgda/-/commit/bebdffb4de586fb43fd07ac549121f4b22f6812d.patch";
57       sha256 = "sha256-UjHP1nhb5n6TOdaMdQeE2s828T4wv/0ycG3FAk+I1QA=";
58     })
59   ];
61   nativeBuildInputs = [
62     pkg-config
63     intltool
64     meson
65     ninja
66     itstool
67     libxml2
68     python3
69     gobject-introspection
70     vala
71     gtk-doc
72     yelp-tools
73   ];
75   buildInputs = [
76     gtk3
77     json-glib
78     isocodes
79     openssl
80     libgee
81     sqlite
82   ] ++ lib.optionals mysqlSupport [
83     libmysqlclient
84   ] ++ lib.optionals postgresSupport [
85     postgresql
86   ];
88   env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=incompatible-function-pointer-types";
90   postPatch = ''
91     patchShebangs \
92       providers/raw_spec.py \
93       providers/mysql/gen_bin.py
94   '';
96   passthru = {
97     updateScript = gnome.updateScript {
98       packageName = pname;
99       attrPath = "libgda6";
100       versionPolicy = "odd-unstable";
101     };
102   };
104   meta = with lib; {
105     description = "Database access library";
106     homepage = "https://www.gnome-db.org/";
107     license = with licenses; [
108       # library
109       lgpl2Plus
110       # CLI tools
111       gpl2Plus
112     ];
113     maintainers = teams.gnome.members;
114     platforms = platforms.unix;
115   };