python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / development / libraries / libgda / default.nix
blobe29482a34d4e82b5ee6b5204fe7d38fb996a74e6
1 { lib
2 , stdenv
3 , fetchurl
4 , pkg-config
5 , intltool
6 , itstool
7 , libxml2
8 , gtk3
9 , openssl
10 , gnome
11 , gobject-introspection
12 , vala
13 , libgee
14 , fetchpatch
15 , autoreconfHook
16 , gtk-doc
17 , autoconf-archive
18 , yelp-tools
19 , mysqlSupport ? false
20 , libmysqlclient
21 , postgresSupport ? false
22 , postgresql
25 stdenv.mkDerivation rec {
26   pname = "libgda";
27   version = "5.2.10";
29   src = fetchurl {
30     url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
31     sha256 = "1j1l4dwjgw6w4d1v4bl5a4kwyj7bcih8mj700ywm7xakh1xxyv3g";
32   };
34   patches = [
35     # fix compile error with mysql
36     (fetchpatch {
37       url = "https://gitlab.gnome.org/GNOME/libgda/-/commit/9859479884fad5f39e6c37e8995e57c28b11b1b9.diff";
38       sha256 = "158sncc5bg9lkri1wb0i1ri1nhx4c34rzi47gbfkwphlp7qd4qqv";
39     })
40   ];
42   nativeBuildInputs = [
43     pkg-config
44     intltool
45     itstool
46     gobject-introspection
47     vala
48     autoreconfHook
49     gtk-doc
50     autoconf-archive
51     yelp-tools
52   ];
54   buildInputs = [
55     gtk3
56     openssl
57     libgee
58   ] ++ lib.optionals mysqlSupport [
59     libmysqlclient
60   ] ++ lib.optionals postgresSupport [
61     postgresql
62   ];
64   propagatedBuildInputs = [
65     libxml2
66   ];
68   configureFlags = [
69     "--with-mysql=${if mysqlSupport then "yes" else "no"}"
70     "--with-postgres=${if postgresSupport then "yes" else "no"}"
72     # macOS builds use the sqlite source code that comes with libgda,
73     # as opposed to using the system or brewed sqlite3, which is not supported on macOS,
74     # as mentioned in https://github.com/GNOME/libgda/blob/95eeca4b0470f347c645a27f714c62aa6e59f820/libgda/sqlite/README#L31,
75     # which references the paper https://web.archive.org/web/20100610151539/http://lattice.umiacs.umd.edu/files/functions_tr.pdf
76     # See also https://github.com/Homebrew/homebrew-core/blob/104f9ecd02854a82372b64d63d41356555378a52/Formula/libgda.rb
77     "--enable-system-sqlite=${if stdenv.isDarwin then "no" else "yes"}"
78   ];
80   enableParallelBuilding = true;
82   hardeningDisable = [ "format" ];
84   passthru = {
85     updateScript = gnome.updateScript {
86       packageName = pname;
87       versionPolicy = "odd-unstable";
88       freeze = true;
89     };
90   };
92   meta = with lib; {
93     description = "Database access library";
94     homepage = "https://www.gnome-db.org/";
95     license = with licenses; [
96       # library
97       lgpl2Plus
98       # CLI tools
99       gpl2Plus
100     ];
101     maintainers = teams.gnome.members;
102     platforms = platforms.unix;
103   };