2021-02-01 18:59:24 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, pkg-config
|
|
|
|
, intltool
|
|
|
|
, itstool
|
|
|
|
, libxml2
|
|
|
|
, gtk3
|
|
|
|
, openssl
|
2021-05-07 23:18:14 +02:00
|
|
|
, gnome
|
2021-02-01 18:59:24 +01:00
|
|
|
, gobject-introspection
|
|
|
|
, vala
|
|
|
|
, libgee
|
|
|
|
, overrideCC
|
|
|
|
, gcc6
|
|
|
|
, fetchpatch
|
|
|
|
, autoreconfHook
|
|
|
|
, gtk-doc
|
|
|
|
, autoconf-archive
|
|
|
|
, yelp-tools
|
|
|
|
, mysqlSupport ? false
|
|
|
|
, libmysqlclient ? null
|
|
|
|
, postgresSupport ? false
|
|
|
|
, postgresql ? null
|
2018-02-24 12:23:08 +01:00
|
|
|
}:
|
|
|
|
|
2019-09-22 09:38:09 +02:00
|
|
|
assert mysqlSupport -> libmysqlclient != null;
|
2018-02-24 12:23:08 +01:00
|
|
|
assert postgresSupport -> postgresql != null;
|
2016-09-18 21:35:23 +02:00
|
|
|
|
2018-08-25 10:36:52 +02:00
|
|
|
(if stdenv.isAarch64 then overrideCC stdenv gcc6 else stdenv).mkDerivation rec {
|
2018-12-11 23:42:28 +01:00
|
|
|
pname = "libgda";
|
2020-11-18 15:06:03 +01:00
|
|
|
version = "5.2.10";
|
2018-02-25 21:07:20 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-01-21 18:00:13 +01:00
|
|
|
url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
|
2020-11-18 15:06:03 +01:00
|
|
|
sha256 = "1j1l4dwjgw6w4d1v4bl5a4kwyj7bcih8mj700ywm7xakh1xxyv3g";
|
2018-02-25 21:07:20 +01:00
|
|
|
};
|
2021-01-07 20:12:01 +01:00
|
|
|
|
|
|
|
patches = [
|
|
|
|
# fix compile error with mysql
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://gitlab.gnome.org/GNOME/libgda/-/commit/9859479884fad5f39e6c37e8995e57c28b11b1b9.diff";
|
|
|
|
sha256 = "158sncc5bg9lkri1wb0i1ri1nhx4c34rzi47gbfkwphlp7qd4qqv";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-02-01 18:59:24 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
intltool
|
|
|
|
itstool
|
|
|
|
libxml2
|
|
|
|
gobject-introspection
|
|
|
|
vala
|
|
|
|
autoreconfHook
|
|
|
|
gtk-doc
|
|
|
|
autoconf-archive
|
|
|
|
yelp-tools
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
gtk3
|
|
|
|
openssl
|
|
|
|
libgee
|
|
|
|
] ++ lib.optionals mysqlSupport [
|
|
|
|
libmysqlclient
|
|
|
|
] ++ lib.optionals postgresSupport [
|
|
|
|
postgresql
|
|
|
|
];
|
|
|
|
|
|
|
|
configureFlags = [
|
2019-10-15 19:58:08 +02:00
|
|
|
"--with-mysql=${if mysqlSupport then "yes" else "no"}"
|
|
|
|
"--with-postgres=${if postgresSupport then "yes" else "no"}"
|
2019-10-15 20:00:17 +02:00
|
|
|
|
|
|
|
# macOS builds use the sqlite source code that comes with libgda,
|
|
|
|
# as opposed to using the system or brewed sqlite3, which is not supported on macOS,
|
|
|
|
# as mentioned in https://github.com/GNOME/libgda/blob/95eeca4b0470f347c645a27f714c62aa6e59f820/libgda/sqlite/README#L31,
|
|
|
|
# which references the paper https://web.archive.org/web/20100610151539/http://lattice.umiacs.umd.edu/files/functions_tr.pdf
|
|
|
|
# See also https://github.com/Homebrew/homebrew-core/blob/104f9ecd02854a82372b64d63d41356555378a52/Formula/libgda.rb
|
|
|
|
"--enable-system-sqlite=${if stdenv.isDarwin then "no" else "yes"}"
|
2019-10-15 19:58:08 +02:00
|
|
|
];
|
2016-09-18 21:35:23 +02:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
hardeningDisable = [ "format" ];
|
|
|
|
|
2018-12-11 23:42:28 +01:00
|
|
|
passthru = {
|
2021-05-07 23:18:14 +02:00
|
|
|
updateScript = gnome.updateScript {
|
2018-12-11 23:42:28 +01:00
|
|
|
packageName = pname;
|
2021-03-21 00:57:24 +01:00
|
|
|
versionPolicy = "odd-unstable";
|
2018-12-11 23:42:28 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-01-21 18:00:13 +01:00
|
|
|
meta = with lib; {
|
2016-09-18 21:35:23 +02:00
|
|
|
description = "Database access library";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://www.gnome-db.org/";
|
2021-02-01 18:59:24 +01:00
|
|
|
license = with licenses; [
|
|
|
|
# library
|
|
|
|
lgpl2Plus
|
|
|
|
# CLI tools
|
|
|
|
gpl2Plus
|
|
|
|
];
|
2020-04-01 14:40:51 +02:00
|
|
|
maintainers = teams.gnome.members;
|
2021-02-01 18:59:24 +01:00
|
|
|
platforms = platforms.unix;
|
2016-09-18 21:35:23 +02:00
|
|
|
};
|
|
|
|
}
|