diff options
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libgda')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/libgda/6.x.nix | 108 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/libgda/default.nix | 104 |
2 files changed, 212 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libgda/6.x.nix b/nixpkgs/pkgs/development/libraries/libgda/6.x.nix new file mode 100644 index 000000000000..c02c6116e648 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/libgda/6.x.nix @@ -0,0 +1,108 @@ +{ lib +, stdenv +, fetchurl +, fetchpatch +, pkg-config +, intltool +, meson +, ninja +, itstool +, libxml2 +, python3 +, gtk3 +, json-glib +, isocodes +, openssl +, gnome +, gobject-introspection +, vala +, libgee +, sqlite +, gtk-doc +, yelp-tools +, mysqlSupport ? false +, libmysqlclient ? null +, postgresSupport ? false +, postgresql ? null +}: + +assert mysqlSupport -> libmysqlclient != null; +assert postgresSupport -> postgresql != null; + +stdenv.mkDerivation rec { + pname = "libgda"; + version = "6.0.0"; + + src = fetchurl { + url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; + sha256 = "0w564z7krgjk19r39mi5qn4kggpdg9ggbyn9pb4aavb61r14npwr"; + }; + + patches = [ + # Fix undefined behavior + (fetchpatch { + url = "https://gitlab.gnome.org/GNOME/libgda/-/commit/657b2f8497da907559a6769c5b1d2d7b5bd40688.patch"; + sha256 = "Qx4S9KQsTAr4M0QJi0Xr5kKuHSp4NwZJHoRPYyxIyTk="; + }) + + # Fix building vapi + (fetchpatch { + url = "https://gitlab.gnome.org/GNOME/libgda/-/commit/57f618a3b2a3758ee3dcbf9bbdc566122dd8566d.patch"; + sha256 = "pyfymUd61m1kHaGyMbUQMma+szB8mlqGWwcFBBQawf8="; + }) + ]; + + nativeBuildInputs = [ + pkg-config + intltool + meson + ninja + itstool + libxml2 + python3 + gobject-introspection + vala + gtk-doc + yelp-tools + ]; + + buildInputs = [ + gtk3 + json-glib + isocodes + openssl + libgee + sqlite + ] ++ lib.optionals mysqlSupport [ + libmysqlclient + ] ++ lib.optionals postgresSupport [ + postgresql + ]; + + postPatch = '' + patchShebangs \ + providers/raw_spec.py \ + providers/mysql/gen_bin.py + ''; + + passthru = { + updateScript = gnome.updateScript { + packageName = pname; + attrPath = "libgda6"; + versionPolicy = "odd-unstable"; + }; + }; + + meta = with lib; { + description = "Database access library"; + homepage = "https://www.gnome-db.org/"; + license = with licenses; [ + # library + lgpl2Plus + # CLI tools + gpl2Plus + ]; + maintainers = teams.gnome.members; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/development/libraries/libgda/default.nix b/nixpkgs/pkgs/development/libraries/libgda/default.nix new file mode 100644 index 000000000000..a9993b7255a9 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/libgda/default.nix @@ -0,0 +1,104 @@ +{ lib +, stdenv +, fetchurl +, pkg-config +, intltool +, itstool +, libxml2 +, gtk3 +, openssl +, gnome +, gobject-introspection +, vala +, libgee +, fetchpatch +, autoreconfHook +, gtk-doc +, autoconf-archive +, yelp-tools +, mysqlSupport ? false +, libmysqlclient ? null +, postgresSupport ? false +, postgresql ? null +}: + +assert mysqlSupport -> libmysqlclient != null; +assert postgresSupport -> postgresql != null; + +stdenv.mkDerivation rec { + pname = "libgda"; + version = "5.2.10"; + + src = fetchurl { + url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; + sha256 = "1j1l4dwjgw6w4d1v4bl5a4kwyj7bcih8mj700ywm7xakh1xxyv3g"; + }; + + patches = [ + # fix compile error with mysql + (fetchpatch { + url = "https://gitlab.gnome.org/GNOME/libgda/-/commit/9859479884fad5f39e6c37e8995e57c28b11b1b9.diff"; + sha256 = "158sncc5bg9lkri1wb0i1ri1nhx4c34rzi47gbfkwphlp7qd4qqv"; + }) + ]; + + 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 = [ + "--with-mysql=${if mysqlSupport then "yes" else "no"}" + "--with-postgres=${if postgresSupport then "yes" else "no"}" + + # 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"}" + ]; + + enableParallelBuilding = true; + + hardeningDisable = [ "format" ]; + + passthru = { + updateScript = gnome.updateScript { + packageName = pname; + versionPolicy = "odd-unstable"; + freeze = true; + }; + }; + + meta = with lib; { + description = "Database access library"; + homepage = "https://www.gnome-db.org/"; + license = with licenses; [ + # library + lgpl2Plus + # CLI tools + gpl2Plus + ]; + maintainers = teams.gnome.members; + platforms = platforms.unix; + }; +} |