2023-04-12 12:48:02 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, postgresql, openssl, libkrb5, enableUnfree ? true }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2023-04-12 12:48:02 +00:00
|
|
|
pname = "timescaledb${lib.optionalString (!enableUnfree) "-apache"}";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "2.12.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;
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-bZHgkcCmkheTupVLOBZ5UsgIVyy7aIJoge+ot2SmMFg=";
|
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" ]
|
2023-04-12 12:48:02 +00:00
|
|
|
++ lib.optionals (!enableUnfree) [ "-DAPACHE_ONLY=ON" ]
|
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/";
|
2023-10-19 13:55:26 +00:00
|
|
|
changelog = "https://github.com/timescale/timescaledb/blob/${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;
|
2023-04-12 12:48:02 +00:00
|
|
|
license = with licenses; if enableUnfree then tsl else asl20;
|
2022-03-05 16:20:37 +00:00
|
|
|
broken = versionOlder postgresql.version "12";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|