nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ stdenv, fetchurl, pkgconfig, intltool, itstool, libxml2, gtk3, openssl, gnome3, gobject-introspection, vala, libgee
2, overrideCC, gcc6
3, mysqlSupport ? false, libmysqlclient ? null
4, postgresSupport ? false, postgresql ? null
5}:
6
7assert mysqlSupport -> libmysqlclient != null;
8assert postgresSupport -> postgresql != null;
9
10(if stdenv.isAarch64 then overrideCC stdenv gcc6 else stdenv).mkDerivation rec {
11 pname = "libgda";
12 version = "5.2.9";
13
14 src = fetchurl {
15 url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
16 sha256 = "16vxv2qvysh22s8h9h6irx96sacagxkz0i4qgi1wc6ibly6fvjjr";
17 };
18 configureFlags = with stdenv.lib; [
19 "--enable-gi-system-install=no"
20 "--with-mysql=${if mysqlSupport then "yes" else "no"}"
21 "--with-postgres=${if postgresSupport then "yes" else "no"}"
22
23 # macOS builds use the sqlite source code that comes with libgda,
24 # as opposed to using the system or brewed sqlite3, which is not supported on macOS,
25 # as mentioned in https://github.com/GNOME/libgda/blob/95eeca4b0470f347c645a27f714c62aa6e59f820/libgda/sqlite/README#L31,
26 # which references the paper https://web.archive.org/web/20100610151539/http://lattice.umiacs.umd.edu/files/functions_tr.pdf
27 # See also https://github.com/Homebrew/homebrew-core/blob/104f9ecd02854a82372b64d63d41356555378a52/Formula/libgda.rb
28 "--enable-system-sqlite=${if stdenv.isDarwin then "no" else "yes"}"
29 ];
30
31 enableParallelBuilding = true;
32
33 hardeningDisable = [ "format" ];
34
35 nativeBuildInputs = [ pkgconfig intltool itstool libxml2 gobject-introspection vala ];
36 buildInputs = with stdenv.lib; [ gtk3 openssl libgee ]
37 ++ optional (mysqlSupport) libmysqlclient
38 ++ optional (postgresSupport) postgresql;
39
40 passthru = {
41 updateScript = gnome3.updateScript {
42 packageName = pname;
43 };
44 };
45
46 meta = with stdenv.lib; {
47 description = "Database access library";
48 homepage = "https://www.gnome-db.org/";
49 license = [ licenses.lgpl2 licenses.gpl2 ];
50 maintainers = teams.gnome.members;
51 platforms = platforms.linux ++ platforms.darwin;
52 };
53}