2021-01-11 08:54:33 +01:00
|
|
|
{ lib, stdenv, fetchFromGitHub, bison, flex, postgresql }:
|
2020-08-22 19:03:28 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "age";
|
2021-10-01 06:20:00 +02:00
|
|
|
version = "0.6.0";
|
2020-08-22 19:03:28 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-10-01 06:20:00 +02:00
|
|
|
owner = "apache";
|
|
|
|
repo = "incubator-age";
|
2020-08-22 19:03:28 +02:00
|
|
|
rev = "v${version}";
|
2021-10-01 06:20:00 +02:00
|
|
|
sha256 = "1cl6p9qz2yhgm603ljlyjdn0msk3hzga1frjqsmqmpp3nw4dbkka";
|
2020-08-22 19:03:28 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-08-22 19:03:28 +02:00
|
|
|
description = "A graph database extension for PostgreSQL";
|
2021-10-01 06:20:00 +02:00
|
|
|
homepage = "https://age.apache.org/";
|
|
|
|
changelog = "https://github.com/apache/incubator-age/releases/tag/v${version}";
|
2021-09-12 16:42:12 +02:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-08-22 19:03:28 +02:00
|
|
|
platforms = postgresql.meta.platforms;
|
|
|
|
license = licenses.asl20;
|
|
|
|
broken = versionOlder postgresql.version "11.0";
|
|
|
|
};
|
|
|
|
}
|