2021-05-20 23:08:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, postgresql, openssl, libkrb5 }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# # To enable on NixOS:
|
|
|
|
# config.services.postgresql = {
|
|
|
|
# extraPlugins = [ pkgs.timescaledb ];
|
|
|
|
# extraConfig = "shared_preload_libraries = 'timescaledb'";
|
|
|
|
# }
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "timescaledb";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "2.7.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
2021-05-20 23:08:51 +00:00
|
|
|
buildInputs = [ postgresql openssl libkrb5 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-03-05 16:20:37 +00:00
|
|
|
owner = "timescale";
|
|
|
|
repo = "timescaledb";
|
2022-04-27 09:35:20 +00:00
|
|
|
rev = version;
|
2022-08-12 12:06:08 +00:00
|
|
|
sha256 = "sha256-roM4a+WWn8aODkS/kvouM6rO4TnVR7hAZmCkJkLpHKQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-08-22 07:53:02 +00:00
|
|
|
cmakeFlags = [ "-DSEND_TELEMETRY_DEFAULT=OFF" "-DREGRESS_CHECKS=OFF" "-DTAP_CHECKS=OFF" ]
|
2021-04-17 00:35:05 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [ "-DLINTER=OFF" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# 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.
|
2021-04-17 00:35:05 +00:00
|
|
|
postPatch = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
for x in CMakeLists.txt sql/CMakeLists.txt; do
|
|
|
|
substituteInPlace "$x" \
|
|
|
|
--replace 'DESTINATION "''${PG_SHAREDIR}/extension"' "DESTINATION \"$out/share/postgresql/extension\""
|
|
|
|
done
|
|
|
|
|
|
|
|
for x in src/CMakeLists.txt src/loader/CMakeLists.txt tsl/src/CMakeLists.txt; do
|
|
|
|
substituteInPlace "$x" \
|
|
|
|
--replace 'DESTINATION ''${PG_PKGLIBDIR}' "DESTINATION \"$out/lib\""
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Scales PostgreSQL for time-series data via automatic partitioning across time and space";
|
2022-03-05 16:20:37 +00:00
|
|
|
homepage = "https://www.timescale.com/";
|
|
|
|
changelog = "https://github.com/timescale/timescaledb/raw/${version}/CHANGELOG.md";
|
2022-07-14 12:49:19 +00:00
|
|
|
maintainers = with maintainers; [ marsam ];
|
2022-03-05 16:20:37 +00:00
|
|
|
platforms = postgresql.meta.platforms;
|
|
|
|
license = licenses.asl20;
|
|
|
|
broken = versionOlder postgresql.version "12";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|