1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/servers/sql/postgresql/timescaledb/default.nix

45 lines
1.4 KiB
Nix
Raw Normal View History

{ stdenv, fetchFromGitHub, cmake, postgresql }:
2017-09-19 00:42:16 +01:00
2017-09-29 11:16:17 +01:00
# # To enable on NixOS:
# config.services.postgresql = {
# extraPlugins = [ pkgs.timescaledb ];
# extraConfig = "shared_preload_libraries = 'timescaledb'";
# }
2017-09-19 00:42:16 +01:00
stdenv.mkDerivation rec {
name = "timescaledb-${version}";
version = "0.9.2";
2017-09-19 00:42:16 +01:00
nativeBuildInputs = [ cmake ];
2017-09-19 00:42:16 +01:00
buildInputs = [ postgresql ];
src = fetchFromGitHub {
owner = "timescale";
repo = "timescaledb";
rev = "refs/tags/${version}";
sha256 = "1zgyd407skqbsw2zj3l9hixwlisnj82yb6hbq5khjg9k0ifvvgyp";
2017-09-19 00:42:16 +01: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.
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
2017-09-19 00:42:16 +01:00
'';
meta = with stdenv.lib; {
2017-09-29 11:16:17 +01:00
description = "Scales PostgreSQL for time-series data via automatic partitioning across time and space";
homepage = https://www.timescale.com/;
2017-09-19 00:42:16 +01:00
maintainers = with maintainers; [ volth ];
platforms = platforms.linux;
license = licenses.postgresql;
2017-09-19 00:42:16 +01:00
};
}