From 204fed0d63ecc3a8887204d96e45bcc396fad67d Mon Sep 17 00:00:00 2001 From: Oliver Rice Date: Tue, 24 Sep 2024 10:35:39 -0500 Subject: [PATCH 1/2] update timescale derivation to disallow non-apache configs --- nix/ext/timescaledb.nix | 5 ++--- nix/tests/expected/timescale.out | 7 +++++++ nix/tests/sql/timescale.sql | 3 +++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/nix/ext/timescaledb.nix b/nix/ext/timescaledb.nix index b4c1563bf..4bc5c1377 100644 --- a/nix/ext/timescaledb.nix +++ b/nix/ext/timescaledb.nix @@ -1,7 +1,7 @@ { lib, stdenv, fetchFromGitHub, cmake, postgresql, openssl, libkrb5, enableUnfree ? true }: stdenv.mkDerivation rec { - pname = "timescaledb${lib.optionalString (!enableUnfree) "-apache"}"; + pname = "timescaledb-apache"; version = "2.16.1"; nativeBuildInputs = [ cmake ]; @@ -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, diff --git a/nix/tests/expected/timescale.out b/nix/tests/expected/timescale.out index d32b8e9f3..0812954ec 100644 --- a/nix/tests/expected/timescale.out +++ b/nix/tests/expected/timescale.out @@ -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 diff --git a/nix/tests/sql/timescale.sql b/nix/tests/sql/timescale.sql index 939612a4a..baa96f48b 100644 --- a/nix/tests/sql/timescale.sql +++ b/nix/tests/sql/timescale.sql @@ -1,3 +1,6 @@ +-- Confirm we're running the apache version +show timescaledb.license; + -- Create schema v create schema v; From d1966e9cd54d04e4a8cfa178cdd1ef5e8e499586 Mon Sep 17 00:00:00 2001 From: Oliver Rice Date: Tue, 24 Sep 2024 10:40:52 -0500 Subject: [PATCH 2/2] remove enableUnfree flag --- nix/ext/timescaledb.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nix/ext/timescaledb.nix b/nix/ext/timescaledb.nix index 4bc5c1377..1c87916be 100644 --- a/nix/ext/timescaledb.nix +++ b/nix/ext/timescaledb.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, cmake, postgresql, openssl, libkrb5, enableUnfree ? true }: +{ lib, stdenv, fetchFromGitHub, cmake, postgresql, openssl, libkrb5 }: stdenv.mkDerivation rec { pname = "timescaledb-apache"; @@ -37,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"; }; }