Skip to content

Commit aebbd63

Browse files
committed
Merge branch 'timescaledb-2.9.1' into pcnc/15.6-test
2 parents dd8b87a + be24e6a commit aebbd63

File tree

3 files changed

+56
-3
lines changed

3 files changed

+56
-3
lines changed

flake.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
ourExtensions = [
108108
./nix/ext/rum.nix
109109
./nix/ext/timescaledb.nix
110+
./nix/ext/timescaledb-2.9.1.nix
110111
./nix/ext/pgroonga.nix
111112
./nix/ext/index_advisor.nix
112113
./nix/ext/wal2json.nix

nix/ext/timescaledb-2.9.1.nix

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{ lib, stdenv, fetchFromGitHub, cmake, postgresql, openssl, libkrb5 }:
2+
3+
stdenv.mkDerivation rec {
4+
pname = "timescaledb-apache";
5+
version = "2.9.1";
6+
7+
nativeBuildInputs = [ cmake ];
8+
buildInputs = [ postgresql openssl libkrb5 ];
9+
10+
src = fetchFromGitHub {
11+
owner = "timescale";
12+
repo = "timescaledb";
13+
rev = version;
14+
hash = "sha256-fvVSxDiGZAewyuQ2vZDb0I6tmlDXl6trjZp8+qDBtb8=";
15+
};
16+
17+
cmakeFlags = [ "-DSEND_TELEMETRY_DEFAULT=OFF" "-DREGRESS_CHECKS=OFF" "-DTAP_CHECKS=OFF" "-DAPACHE_ONLY=1" ]
18+
++ lib.optionals stdenv.isDarwin [ "-DLINTER=OFF" ];
19+
20+
# Fix the install phase which tries to install into the pgsql extension dir,
21+
# and cannot be manually overridden. This is rather fragile but works OK.
22+
postPatch = ''
23+
for x in CMakeLists.txt sql/CMakeLists.txt; do
24+
substituteInPlace "$x" \
25+
--replace 'DESTINATION "''${PG_SHAREDIR}/extension"' "DESTINATION \"$out/share/postgresql/extension\""
26+
done
27+
28+
for x in src/CMakeLists.txt src/loader/CMakeLists.txt tsl/src/CMakeLists.txt; do
29+
substituteInPlace "$x" \
30+
--replace 'DESTINATION ''${PG_PKGLIBDIR}' "DESTINATION \"$out/lib\""
31+
done
32+
'';
33+
34+
35+
# timescaledb-2.9.1.so already exists in the lib directory
36+
# we have no need for the timescaledb.so or control file
37+
postInstall = ''
38+
rm $out/lib/timescaledb.so
39+
mv $out/share/postgresql/extension/timescaledb.control $out/share/postgresql/extension/timescaledb-2.9.1.control
40+
'';
41+
42+
meta = with lib; {
43+
description = "Scales PostgreSQL for time-series data via automatic partitioning across time and space";
44+
homepage = "https://www.timescale.com/";
45+
changelog = "https://github.com/timescale/timescaledb/blob/${version}/CHANGELOG.md";
46+
maintainers = with maintainers; [ samrose ];
47+
platforms = postgresql.meta.platforms;
48+
license = licenses.asl20;
49+
broken = versionOlder postgresql.version "13";
50+
};
51+
}

nix/tests/expected/extensions_sql_interface.out

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ where
2020
installed_version is null
2121
order by
2222
name asc;
23-
name
24-
---------
23+
name
24+
-------------------
2525
pg_cron
26-
(1 row)
26+
timescaledb-2.9.1
27+
(2 rows)
2728

2829
/*
2930

0 commit comments

Comments
 (0)