Skip to content

Commit

Permalink
Update timescale derivation to disallow non-apache configs (#1232)
Browse files Browse the repository at this point in the history
* update timescale derivation to disallow non-apache configs

* remove enableUnfree flag
  • Loading branch information
olirice authored Sep 24, 2024
1 parent 9b5146e commit 2dda773
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
9 changes: 4 additions & 5 deletions nix/ext/timescaledb.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ lib, stdenv, fetchFromGitHub, cmake, postgresql, openssl, libkrb5, enableUnfree ? true }:
{ lib, stdenv, fetchFromGitHub, cmake, postgresql, openssl, libkrb5 }:

stdenv.mkDerivation rec {
pname = "timescaledb${lib.optionalString (!enableUnfree) "-apache"}";
pname = "timescaledb-apache";
version = "2.16.1";

nativeBuildInputs = [ cmake ];
Expand All @@ -14,8 +14,7 @@ stdenv.mkDerivation rec {
hash = "sha256-sLxWdBmih9mgiO51zLLxn9uwJVYc5JVHJjSWoADoJ+w=";
};

cmakeFlags = [ "-DSEND_TELEMETRY_DEFAULT=OFF" "-DREGRESS_CHECKS=OFF" "-DTAP_CHECKS=OFF" ]
++ lib.optionals (!enableUnfree) [ "-DAPACHE_ONLY=ON" ]
cmakeFlags = [ "-DSEND_TELEMETRY_DEFAULT=OFF" "-DREGRESS_CHECKS=OFF" "-DTAP_CHECKS=OFF" "-DAPACHE_ONLY=1" ]
++ lib.optionals stdenv.isDarwin [ "-DLINTER=OFF" ];

# Fix the install phase which tries to install into the pgsql extension dir,
Expand All @@ -38,7 +37,7 @@ stdenv.mkDerivation rec {
changelog = "https://github.com/timescale/timescaledb/blob/${version}/CHANGELOG.md";
maintainers = with maintainers; [ samrose ];
platforms = postgresql.meta.platforms;
license = with licenses; if enableUnfree then tsl else asl20;
license = licenses.asl20;
broken = versionOlder postgresql.version "13";
};
}
7 changes: 7 additions & 0 deletions nix/tests/expected/timescale.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-- Confirm we're running the apache version
show timescaledb.license;
timescaledb.license
---------------------
apache
(1 row)

-- Create schema v
create schema v;
-- Create a table in the v schema
Expand Down
3 changes: 3 additions & 0 deletions nix/tests/sql/timescale.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Confirm we're running the apache version
show timescaledb.license;

-- Create schema v
create schema v;

Expand Down

0 comments on commit 2dda773

Please sign in to comment.