From 6ac2b11d13d94319dceaa9dc57053714e5f824a8 Mon Sep 17 00:00:00 2001 From: Austin Seipp Date: Mon, 2 Apr 2018 02:40:07 -0500 Subject: [PATCH] timescaledb: 0.6.0 -> 0.9.1 Signed-off-by: Austin Seipp --- .../sql/postgresql/timescaledb/default.nix | 36 +++++++++++-------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/pkgs/servers/sql/postgresql/timescaledb/default.nix b/pkgs/servers/sql/postgresql/timescaledb/default.nix index 223bd6e470b..e1a4aed3b7e 100644 --- a/pkgs/servers/sql/postgresql/timescaledb/default.nix +++ b/pkgs/servers/sql/postgresql/timescaledb/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, postgresql }: +{ stdenv, fetchFromGitHub, cmake, postgresql }: # # To enable on NixOS: # config.services.postgresql = { @@ -8,29 +8,37 @@ stdenv.mkDerivation rec { name = "timescaledb-${version}"; - version = "0.6.0"; + version = "0.9.1"; + nativeBuildInputs = [ cmake ]; buildInputs = [ postgresql ]; src = fetchFromGitHub { - owner = "timescale"; - repo = "timescaledb"; - rev = version; - sha256 = "061z1ll3x7ca7fj12rl2difkdvmqykksqhpsql552qkkylg7iq4d"; + owner = "timescale"; + repo = "timescaledb"; + rev = "refs/tags/${version}"; + sha256 = "00k8fk5a1xpv9nxlmafnngk31wh80h6m72vsl1hnyq7nhby7ylic"; }; - installPhase = '' - mkdir -p $out/bin - install -D timescaledb.so -t $out/lib - install -D timescaledb.control -t $out/share/extension - cp -dpR sql/* $out/share/extension/ + # Fix the install phase which tries to install into the pgsql extension dir, + # and cannot be manually overridden. This is rather fragile but works OK. + patchPhase = '' + for x in CMakeLists.txt sql/CMakeLists.txt; do + substituteInPlace "$x" \ + --replace 'DESTINATION "''${PG_SHAREDIR}/extension"' "DESTINATION \"$out/share/extension\"" + done + + for x in src/CMakeLists.txt src/loader/CMakeLists.txt; do + substituteInPlace "$x" \ + --replace 'DESTINATION ''${PG_PKGLIBDIR}' "DESTINATION \"$out/lib\"" + done ''; meta = with stdenv.lib; { description = "Scales PostgreSQL for time-series data via automatic partitioning across time and space"; - homepage = https://www.timescale.com/; + homepage = https://www.timescale.com/; maintainers = with maintainers; [ volth ]; - platforms = platforms.linux; - license = licenses.postgresql; + platforms = platforms.linux; + license = licenses.postgresql; }; }