diff options
author | Daniƫl de Kok <me@danieldk.eu> | 2020-09-01 08:53:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-01 08:53:40 +0200 |
commit | 09d1aa9622ff6a8da333199fa754c48a551e8482 (patch) | |
tree | 1edaeceecf3ef296b02019589230bdc10bae7e8a /pkgs/servers/sql | |
parent | 60d0746a846bb498b4fd0422905a1bc116e895d3 (diff) | |
parent | 58ba6ca2fe390f1c6ada3cf1d6510e9a93990d34 (diff) |
Merge pull request #96025 from danieldk/age-0.2.0
postgresqlPackages.age: init at 0.2.0
Diffstat (limited to 'pkgs/servers/sql')
-rw-r--r-- | pkgs/servers/sql/postgresql/ext/age.nix | 65 | ||||
-rw-r--r-- | pkgs/servers/sql/postgresql/packages.nix | 2 |
2 files changed, 67 insertions, 0 deletions
diff --git a/pkgs/servers/sql/postgresql/ext/age.nix b/pkgs/servers/sql/postgresql/ext/age.nix new file mode 100644 index 0000000000000..09021317cd13b --- /dev/null +++ b/pkgs/servers/sql/postgresql/ext/age.nix @@ -0,0 +1,65 @@ +{ stdenv, fetchFromGitHub, bison, flex, postgresql }: + +stdenv.mkDerivation rec { + pname = "age"; + version = "0.2.0"; + + src = fetchFromGitHub { + owner = "bitnine-oss"; + repo = "AgensGraph-Extension"; + rev = "v${version}"; + sha256 = "0way59lj30727jlz2qz6rnw4fsxcd5028xcwgrwk7jxcaqi5fa17"; + }; + + buildInputs = [ postgresql ]; + + makeFlags = [ + "BISON=${bison}/bin/bison" + "FLEX=${flex}/bin/flex" + ]; + + installPhase = '' + install -D -t $out/lib *.so + install -D -t $out/share/postgresql/extension *.sql + install -D -t $out/share/postgresql/extension *.control + ''; + + passthru.tests = stdenv.mkDerivation { + inherit version src; + + pname = "age-regression"; + + dontConfigure = true; + + buildPhase = let + postgresqlAge = postgresql.withPackages (ps: [ ps.age ]); + in '' + # The regression tests need to be run in the order specified in the Makefile. + echo -e "include Makefile\nfiles:\n\t@echo \$(REGRESS)" > Makefile.regress + REGRESS_TESTS=$(make -f Makefile.regress files) + + ${postgresql}/lib/pgxs/src/test/regress/pg_regress \ + --inputdir=./ \ + --bindir='${postgresqlAge}/bin' \ + --encoding=UTF-8 \ + --load-extension=age \ + --inputdir=./regress --outputdir=./regress --temp-instance=./regress/instance \ + --port=61958 --dbname=contrib_regression \ + $REGRESS_TESTS + ''; + + installPhase = '' + touch $out + ''; + }; + + meta = with stdenv.lib; { + description = "A graph database extension for PostgreSQL"; + homepage = "https://github.com/bitnine-oss/AgensGraph-Extension"; + changelog = "https://github.com/bitnine-oss/AgensGraph-Extension/releases/tag/v${version}"; + maintainers = with maintainers; [ danieldk ]; + platforms = postgresql.meta.platforms; + license = licenses.asl20; + broken = versionOlder postgresql.version "11.0"; + }; +} diff --git a/pkgs/servers/sql/postgresql/packages.nix b/pkgs/servers/sql/postgresql/packages.nix index 44e560a5f8375..6dbb7a8ed11ab 100644 --- a/pkgs/servers/sql/postgresql/packages.nix +++ b/pkgs/servers/sql/postgresql/packages.nix @@ -1,5 +1,7 @@ self: super: { + age = super.callPackage ./ext/age.nix { }; + periods = super.callPackage ./ext/periods.nix { }; postgis = super.callPackage ./ext/postgis.nix { |