2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, bison, flex, postgresql }:
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "age";
|
2022-07-18 16:21:45 +00:00
|
|
|
version = "1.0.0-rc1";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-10-04 12:37:57 +00:00
|
|
|
owner = "apache";
|
2022-07-18 16:21:45 +00:00
|
|
|
repo = "age";
|
2020-09-25 04:45:31 +00:00
|
|
|
rev = "v${version}";
|
2022-07-18 16:21:45 +00:00
|
|
|
sha256 = "sha256-b5cBpS5xWaohRZf5H0DwzNq0BodqWDjkAP44osPVYps=";
|
2020-09-25 04:45:31 +00: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-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2022-07-18 16:21:45 +00:00
|
|
|
# Only supports PostgreSQL 11 https://github.com/apache/age/issues/225
|
|
|
|
broken = versions.major postgresql.version != "11";
|
2020-09-25 04:45:31 +00:00
|
|
|
description = "A graph database extension for PostgreSQL";
|
2021-10-04 12:37:57 +00:00
|
|
|
homepage = "https://age.apache.org/";
|
2022-07-18 16:21:45 +00:00
|
|
|
changelog = "https://github.com/apache/age/raw/v${version}/RELEASE";
|
2021-09-18 10:52:07 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-09-25 04:45:31 +00:00
|
|
|
platforms = postgresql.meta.platforms;
|
|
|
|
license = licenses.asl20;
|
|
|
|
};
|
|
|
|
}
|