2023-10-09 19:29:22 +00:00
|
|
|
{ lib, stdenv, bison, fetchFromGitHub, flex, perl, postgresql }:
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
let
|
|
|
|
hashes = {
|
2024-01-25 14:12:00 +00:00
|
|
|
"16" = "sha256-sXh/vmGyYj00ALfFVdeql2DZ6nCJQDNKyNgzlOZnPAw=";
|
|
|
|
"15" = "sha256-webZWgWZGnSoXwTpk816tjbtHV1UIlXkogpBDAEL4gM=";
|
|
|
|
"14" = "sha256-jZXhcYBubpjIJ8M5JHXKV5f6VK/2BkypH3P7nLxZz3E=";
|
|
|
|
"13" = "sha256-HR6nnWt/V2a0rD5eHHUsFIZ1y7lmvLz36URt9pPJnCw=";
|
|
|
|
"12" = "sha256-JFNk17ESsIt20dwXrfBkQ5E6DbZzN/Q9eS6+WjCXGd4=";
|
2023-10-09 19:29:22 +00:00
|
|
|
};
|
|
|
|
in
|
2020-09-25 04:45:31 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "age";
|
2024-01-25 14:12:00 +00:00
|
|
|
version = "1.5.0-rc0";
|
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";
|
2023-10-09 19:29:22 +00:00
|
|
|
rev = "PG${lib.versions.major postgresql.version}/v${builtins.replaceStrings ["."] ["_"] version}";
|
|
|
|
hash = hashes.${lib.versions.major postgresql.version} or (throw "Source for Age is not available for ${postgresql.version}");
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ postgresql ];
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"BISON=${bison}/bin/bison"
|
|
|
|
"FLEX=${flex}/bin/flex"
|
2023-10-09 19:29:22 +00:00
|
|
|
"PERL=${perl}/bin/perl"
|
2020-09-25 04:45:31 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
installPhase = ''
|
2024-01-25 14:12:00 +00:00
|
|
|
install -D -t $out/lib *${postgresql.dlSuffix}
|
2020-09-25 04:45:31 +00:00
|
|
|
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)
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
${lib.getDev postgresql}/lib/pgxs/src/test/regress/pg_regress \
|
2020-09-25 04:45:31 +00:00
|
|
|
--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; {
|
2023-10-09 19:29:22 +00:00
|
|
|
broken = !builtins.elem (versions.major postgresql.version) (builtins.attrNames hashes);
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Graph database extension for PostgreSQL";
|
2021-10-04 12:37:57 +00:00
|
|
|
homepage = "https://age.apache.org/";
|
2023-10-09 19:29:22 +00:00
|
|
|
changelog = "https://github.com/apache/age/raw/v${src.rev}/RELEASE";
|
2024-07-31 10:19:44 +00:00
|
|
|
maintainers = [ ];
|
2020-09-25 04:45:31 +00:00
|
|
|
platforms = postgresql.meta.platforms;
|
|
|
|
license = licenses.asl20;
|
|
|
|
};
|
|
|
|
}
|