From 97a8d845517ba547c82a7d6f2c87fc7718aef70b Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Fri, 24 Apr 2026 14:45:43 +0200 Subject: [PATCH] orioledb: init at 17.20 --- pkgs/by-name/or/orioledb/extension.nix | 46 ++++++++++++++++++++++++ pkgs/by-name/or/orioledb/package.nix | 50 ++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 pkgs/by-name/or/orioledb/extension.nix create mode 100644 pkgs/by-name/or/orioledb/package.nix diff --git a/pkgs/by-name/or/orioledb/extension.nix b/pkgs/by-name/or/orioledb/extension.nix new file mode 100644 index 000000000000..c77b03cb0bb1 --- /dev/null +++ b/pkgs/by-name/or/orioledb/extension.nix @@ -0,0 +1,46 @@ +{ + curl, + fetchFromGitHub, + lib, + postgresql, + postgresqlBuildExtension, + postgresqlTestExtension, + python3, +}: + +postgresqlBuildExtension (finalAttrs: { + pname = "orioledb"; + # SQL extension version is 1.8, official version is beta16-pre-3 + version = "1.8-beta16-pre-3"; + + src = fetchFromGitHub { + owner = "orioledb"; + repo = "orioledb"; + tag = "beta16-pre-3"; + hash = "sha256-nBLyc9VFETRo75HfBSLmQ13a6Vcc9rlSCp06y/SnDqQ="; + }; + + buildInputs = postgresql.buildInputs ++ [ + curl + ]; + + nativeBuildInputs = [ + python3 + ]; + + makeFlags = [ "USE_PGXS=1" ]; + + meta = + # Inheriting maintainers from `postgresql` is only OK to do, + # because it's the orioledb-specific fork of PostgreSQL. + # Once these patches are upstreamed and the extension can + # run on stock PG, this meta section needs to be adjusted. + assert postgresql.pname == "orioledb-postgres"; + { + inherit (postgresql.meta) description maintainers; + license = lib.licenses.OR [ + lib.licenses.asl20 + lib.licenses.postgresql + ]; + }; +}) diff --git a/pkgs/by-name/or/orioledb/package.nix b/pkgs/by-name/or/orioledb/package.nix new file mode 100644 index 000000000000..85fbfee5ab66 --- /dev/null +++ b/pkgs/by-name/or/orioledb/package.nix @@ -0,0 +1,50 @@ +{ + fetchFromGitHub, + lib, + postgresql_17, +}: + +let + orioledb-postgres = postgresql_17.overrideAttrs ( + finalAttrs: oldAttrs: { + pname = "orioledb-postgres"; + version = "17.20"; + + src = fetchFromGitHub { + owner = "orioledb"; + repo = "postgres"; + tag = "patches17_20"; + hash = "sha256-3dC00fFpD8fJDKed37oQvILMtA3GKBsWo1GEdUQzXzQ="; + }; + + # Configure extracts the patch version from the git tag. This + # is required by the extension build to verify it builds against + # the correctly patched postgresql version. + postPatch = oldAttrs.postPatch or "" + '' + substituteInPlace configure \ + --replace-fail "git describe --tags --exact-match" "echo '${finalAttrs.src.tag}'" + ''; + + # orioledb seems to have made pg_rewind extensible somehow. For that reason, + # there is now a header file in the -dev output for it. Until reported otherwise + # we'll just strip that reference to avoid a cycle between outputs. + postInstall = oldAttrs.postInstall or "" + '' + remove-references-to -t "$dev" -t "$doc" -t "$man" "$out/bin/pg_rewind" + ''; + + meta = { + inherit (oldAttrs.meta) + license + pkgConfigModules + platforms + broken + ; + description = "Cloud-native storage engine for PostgreSQL"; + maintainers = [ + lib.maintainers.wolfgangwalther + ]; + }; + } + ); +in +orioledb-postgres.withPackages (pkgs: [ (pkgs.callPackage ./extension.nix { }) ])