dotnet: improve language coverage of passthru.tests for dotnet sdks (#370789)
[NixPkgs.git] / pkgs / development / libraries / libgda / default.nix
blob8de4af61686b0b30b62f44660154f33ec39aa772
2   lib,
3   stdenv,
4   fetchurl,
5   pkg-config,
6   intltool,
7   itstool,
8   libxml2,
9   gtk3,
10   openssl,
11   gnome,
12   gobject-introspection,
13   vala,
14   libgee,
15   fetchpatch,
16   autoreconfHook,
17   gtk-doc,
18   autoconf-archive,
19   yelp-tools,
20   mysqlSupport ? false,
21   libmysqlclient,
22   postgresSupport ? false,
23   postgresql,
26 stdenv.mkDerivation rec {
27   pname = "libgda";
28   version = "5.2.10";
30   src = fetchurl {
31     url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
32     sha256 = "1j1l4dwjgw6w4d1v4bl5a4kwyj7bcih8mj700ywm7xakh1xxyv3g";
33   };
35   patches = [
36     # fix compile error with mysql
37     (fetchpatch {
38       url = "https://gitlab.gnome.org/GNOME/libgda/-/commit/9859479884fad5f39e6c37e8995e57c28b11b1b9.diff";
39       sha256 = "158sncc5bg9lkri1wb0i1ri1nhx4c34rzi47gbfkwphlp7qd4qqv";
40     })
41     (fetchpatch {
42       name = "CVE-2021-39359.patch";
43       url = "https://src.fedoraproject.org/rpms/libgda5/raw/72bb769f12e861e27e883dac5fab34f1ba4bd97e/f/bebdffb4de586fb43fd07ac549121f4b22f6812d.patch";
44       sha256 = "sha256-hIKuY5NEqOzntdlLb541bA4xZU5ypTRmV1u765K6KbM=";
45     })
46   ];
48   nativeBuildInputs = [
49     pkg-config
50     intltool
51     itstool
52     gobject-introspection
53     vala
54     autoreconfHook
55     gtk-doc
56     autoconf-archive
57     yelp-tools
58   ];
60   buildInputs =
61     [
62       gtk3
63       openssl
64       libgee
65     ]
66     ++ lib.optionals mysqlSupport [
67       libmysqlclient
68     ]
69     ++ lib.optionals postgresSupport [
70       postgresql
71     ];
73   propagatedBuildInputs = [
74     libxml2
75   ];
77   configureFlags = [
78     "--with-mysql=${if mysqlSupport then "yes" else "no"}"
79     "--with-postgres=${if postgresSupport then "yes" else "no"}"
81     # macOS builds use the sqlite source code that comes with libgda,
82     # as opposed to using the system or brewed sqlite3, which is not supported on macOS,
83     # as mentioned in https://github.com/GNOME/libgda/blob/95eeca4b0470f347c645a27f714c62aa6e59f820/libgda/sqlite/README#L31,
84     # which references the paper https://web.archive.org/web/20100610151539/http://lattice.umiacs.umd.edu/files/functions_tr.pdf
85     # See also https://github.com/Homebrew/homebrew-core/blob/104f9ecd02854a82372b64d63d41356555378a52/Formula/libgda.rb
86     "--enable-system-sqlite=${if stdenv.hostPlatform.isDarwin then "no" else "yes"}"
87   ];
89   env.NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types";
91   enableParallelBuilding = true;
93   hardeningDisable = [ "format" ];
95   passthru = {
96     updateScript = gnome.updateScript {
97       packageName = pname;
98       versionPolicy = "odd-unstable";
99       freeze = true;
100     };
101   };
103   meta = with lib; {
104     description = "Database access library";
105     homepage = "https://www.gnome-db.org/";
106     license = with licenses; [
107       # library
108       lgpl2Plus
109       # CLI tools
110       gpl2Plus
111     ];
112     maintainers = teams.gnome.members;
113     platforms = platforms.unix;
114   };