Skip to content

Commit d61b69d

Browse files
committed
feat: enable orioledb build with specific revision
Allow specifying git revision hash instead of version tags for orioledb sources, enabling builds from specific commits rather than only tagged releases.
1 parent 8ac1c90 commit d61b69d

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

nix/config.nix

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ let
2020
options = {
2121
version = lib.mkOption { type = lib.types.str; };
2222
hash = lib.mkOption { type = lib.types.str; };
23+
revision = lib.mkOption {
24+
type = lib.types.nullOr lib.types.str;
25+
default = null;
26+
};
2327
};
2428
};
2529
supabaseSubmodule = lib.types.submodule {
@@ -53,7 +57,8 @@ in
5357
orioledb = {
5458
"17" = {
5559
version = "17_11";
56-
hash = "sha256-RZYU955PmGZExfX2JKw1dIQMMuuswtAXpXjZ9CLbOsw=";
60+
hash = "sha256-+YJxHrkd+q2zWbXYeUWdA2OuJRFB7HRb8SDvx9lyuZk=";
61+
revision = "00aff1ddc299330310c57ddc087e83b1f819e191";
5762
};
5863
};
5964
};

nix/postgresql/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ let
2020
pkgs.lib.nameValuePair "${namePrefix}${versionSuffix}" (
2121
pkgs.callPackage ./generic.nix {
2222
inherit isOrioleDB;
23-
inherit (config) version hash;
23+
inherit (config) version hash revision;
2424
jitSupport = jitSupport;
2525
self = pkgs;
2626
}

nix/postgresql/generic.nix

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ let
4646
# source specification
4747
version,
4848
hash,
49+
revision ? null,
4950
muslPatches ? { },
5051

5152
# for tests
@@ -88,11 +89,17 @@ let
8889
pname = pname + lib.optionalString jitSupport "-jit";
8990

9091
src =
91-
if (builtins.match "[0-9][0-9]_.*" version != null) then
92-
fetchurl {
93-
url = "https://github.com/orioledb/postgres/archive/refs/tags/patches${version}.tar.gz";
94-
inherit hash;
95-
}
92+
if isOrioleDB then
93+
if revision != null then
94+
fetchurl {
95+
url = "https://github.com/orioledb/postgres/archive/${revision}.tar.gz";
96+
inherit hash;
97+
}
98+
else
99+
fetchurl {
100+
url = "https://github.com/orioledb/postgres/archive/refs/tags/patches${version}.tar.gz";
101+
inherit hash;
102+
}
96103
else
97104
fetchurl {
98105
url = "mirror://postgresql/source/v${version}/${pname}-${version}.tar.bz2";
@@ -126,7 +133,7 @@ let
126133
++ lib.optionals (!stdenv'.isDarwin) [ libossp_uuid ]
127134
++
128135
lib.optionals
129-
((builtins.match "[0-9][0-9]_.*" version != null) || (lib.versionAtLeast version "17"))
136+
(isOrioleDB || (lib.versionAtLeast version "17"))
130137
[
131138
perl
132139
bison

0 commit comments

Comments
 (0)