From 514901ed9f2a9076d1835e0a15d49594eafcdf45 Mon Sep 17 00:00:00 2001 From: JEAN-FRANCOIS GUILLAUME Date: Fri, 3 Feb 2023 13:18:04 +0100 Subject: [PATCH] keeping propriaritay licencing as we need CommunityLicense features --- glicid/packages/databases.scm | 72 +++++++++++++++++++++++++++++++++-- 1 file changed, 69 insertions(+), 3 deletions(-) diff --git a/glicid/packages/databases.scm b/glicid/packages/databases.scm index 351e266..f4ea7a9 100644 --- a/glicid/packages/databases.scm +++ b/glicid/packages/databases.scm @@ -1,12 +1,17 @@ (define-module (glicid packages databases) #:use-module (guix git-download) + #:use-module (guix download) #:use-module (guix packages) - #:use-module ((gnu packages databases)#:prefix gnu:) + #:use-module ((gnu packages databases) #:prefix gnu:) + #:use-module (gnu packages tls) + #:use-module (guix build-system cmake) + #:use-module (ice-9 match) + #:use-module (guix gexp) + #:use-module ((guix licenses) #:prefix license:) ) (define-public timescaledb (package - (inherit gnu:timescaledb) (name "timescaledb") (version "2.9.2") (source (origin @@ -15,4 +20,65 @@ (url "https://github.com/timescale/timescaledb") (commit version))) (file-name (git-file-name name version)) - (sha256 (base32 "0siijqypx53lkb19y6zz7bx1bnbhk40b5ky5l74ckhv80nlffzfy")))))) + (sha256 (base32 "0siijqypx53lkb19y6zz7bx1bnbhk40b5ky5l74ckhv80nlffzfy")) )) + (build-system cmake-build-system) + (arguments + (list #:imported-modules `((guix build union) + ,@%cmake-build-system-modules) + #:modules `(,@%cmake-build-system-modules + (guix build union) + (ice-9 match)) + #:configure-flags #~(list "-DSEND_TELEMETRY_DEFAULT=OFF") + #:test-target "regresschecklocal" + #:phases + #~(modify-phases (@ (guix build cmake-build-system) %standard-phases) + (add-after 'unpack 'patch-install-location + (lambda _ + (substitute* '("CMakeLists.txt" + "cmake/GenerateScripts.cmake" + "sql/CMakeLists.txt") + (("\\$\\{PG_SHAREDIR\\}/extension") (string-append #$output "/share/extension"))) + (substitute* '("src/CMakeLists.txt" + "src/loader/CMakeLists.txt" + "tsl/src/CMakeLists.txt") + (("\\$\\{PG_PKGLIBDIR\\}") (string-append #$output "/lib"))))) + (add-after 'unpack 'remove-kernel-version + (lambda _ + (substitute* "src/config.h.in" + (("BUILD_OS_VERSION ..CMAKE_SYSTEM_VERSION.") + "BUILD_OS_VERSION \"")))) + (delete 'check) + (add-after 'install 'prepare-tests + (lambda* (#:key inputs #:allow-other-keys) + (let ((pg-data (string-append (getcwd) "/../pg-data")) + (pg-union (string-append (getcwd) "/../pg-union"))) + (match inputs + (((names . directories) ...) + (union-build pg-union (cons #$output directories) + #:symlink + (lambda (old new) + (if (file-is-directory? old) + (copy-recursively old new) + (copy-file old new)))))) + (setenv "PATH" (string-append pg-union "/bin:" (getenv "PATH"))) + (invoke "initdb" "-D" pg-data) + (copy-file "test/postgresql.conf" (string-append pg-data "/postgresql.conf")) + (invoke "pg_ctl" "-D" pg-data + "-o" (string-append "-k " pg-data) + "-l" (string-append pg-data "/db.log") + "start")))) + (add-after 'prepare-tests 'check + (assoc-ref %standard-phases 'check))))) + (inputs (list openssl gnu:postgresql)) + (home-page "https://www.timescale.com/") + (synopsis "Time-series extension for PostgreSQL") + (description "TimescaleDB is a database designed to make SQL scalable for + time-series data. It is engineered up from PostgreSQL and packaged as a + PostgreSQL extension, providing automatic partitioning across time and space + (partitioning key), as well as full SQL support.") + (license license:asl2.0))) + +(define-public timescaledb-pg15 + (package + (inherit timescaledb) + (inputs (list openssl gnu:postgresql-15))))