postgresql: refactor to move musl patches into versioned .nix files
This makes it obvious that the required argument muslPatches must be passed when creating a new version file. Pure refactor, not changing any derivations.
This commit is contained in:
@@ -1,4 +1,10 @@
|
||||
import ./generic.nix {
|
||||
version = "12.18";
|
||||
hash = "sha256-T5kZcl2UHOmGjgf+HtHTqGdIWZtIM4ZUdYOSi3TDkYo=";
|
||||
muslPatches = {
|
||||
icu-collations-hack = {
|
||||
url = "https://git.alpinelinux.org/aports/plain/testing/postgresql12/icu-collations-hack.patch?id=d5227c91adda59d4e7f55f13468f0314e8869174";
|
||||
hash = "sha256-wuwjvGHArkRNwFo40g3p43W32OrJohretlt6iSRlJKg=";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,14 @@
|
||||
import ./generic.nix {
|
||||
version = "13.14";
|
||||
hash = "sha256-uN8HhVGJiWC9UA3F04oXfpkFN234H+fytmChQH+mpe0=";
|
||||
muslPatches = {
|
||||
icu-collations-hack = {
|
||||
url = "https://git.alpinelinux.org/aports/plain/main/postgresql14/icu-collations-hack.patch?id=56999e6d0265ceff5c5239f85fdd33e146f06cb7";
|
||||
hash = "sha256-wuwjvGHArkRNwFo40g3p43W32OrJohretlt6iSRlJKg=";
|
||||
};
|
||||
disable-test-collate-icu-utf8 = {
|
||||
url = "https://git.alpinelinux.org/aports/plain/main/postgresql13/disable-test-collate.icu.utf8.patch?id=69faa146ec9fff3b981511068f17f9e629d4688b";
|
||||
hash = "sha256-jS/qxezaiaKhkWeMCXwpz1SDJwUWn9tzN0uKaZ3Ph2Y=";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,14 @@
|
||||
import ./generic.nix {
|
||||
version = "14.11";
|
||||
hash = "sha256-pnC9fc4i3K1Cl7JhE2s7HUoJpvVBcZViqhTKY78paKg=";
|
||||
muslPatches = {
|
||||
icu-collations-hack = {
|
||||
url = "https://git.alpinelinux.org/aports/plain/main/postgresql14/icu-collations-hack.patch?id=56999e6d0265ceff5c5239f85fdd33e146f06cb7";
|
||||
hash = "sha256-wuwjvGHArkRNwFo40g3p43W32OrJohretlt6iSRlJKg=";
|
||||
};
|
||||
disable-test-collate-icu-utf8 = {
|
||||
url = "https://git.alpinelinux.org/aports/plain/main/postgresql14/disable-test-collate.icu.utf8.patch?id=56999e6d0265ceff5c5239f85fdd33e146f06cb7";
|
||||
hash = "sha256-jXe23AxnFjEl+TZQm4R7rStk2Leo08ctxMNmu1xr5zM=";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
import ./generic.nix {
|
||||
version = "15.6";
|
||||
hash = "sha256-hFUUbtnGnJOlfelUrq0DAsr60DXCskIXXWqh4X68svs=";
|
||||
muslPatches = {
|
||||
icu-collations-hack = {
|
||||
url = "https://git.alpinelinux.org/aports/plain/main/postgresql15/icu-collations-hack.patch?id=f424e934e6d076c4ae065ce45e734aa283eecb9c";
|
||||
hash = "sha256-HgtmhF4OJYU9macGJbTB9PjQi/yW7c3Akm3U0niWs8I=";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
import ./generic.nix {
|
||||
version = "16.2";
|
||||
hash = "sha256-RG6IKU28LJCFq0twYaZG+mBLS+wDUh1epnHC5a2bKVI=";
|
||||
muslPatches = {
|
||||
icu-collations-hack = {
|
||||
url = "https://git.alpinelinux.org/aports/plain/main/postgresql16/icu-collations-hack.patch?id=08a24be262339fd093e641860680944c3590238e";
|
||||
hash = "sha256-+urQdVIlADLdDPeT68XYv5rljhbK8M/7mPZn/cF+FT0=";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ let
|
||||
, this, self, newScope, buildEnv
|
||||
|
||||
# source specification
|
||||
, version, hash
|
||||
, version, hash, muslPatches
|
||||
|
||||
# for tests
|
||||
, testers, nixosTests, thisAttr
|
||||
@@ -121,48 +121,7 @@ let
|
||||
})
|
||||
|
||||
] ++ lib.optionals stdenv'.hostPlatform.isMusl (
|
||||
let
|
||||
self = {
|
||||
"12" = {
|
||||
icu-collations-hack = fetchurl {
|
||||
url = "https://git.alpinelinux.org/aports/plain/testing/postgresql12/icu-collations-hack.patch?id=d5227c91adda59d4e7f55f13468f0314e8869174";
|
||||
hash = "sha256-wuwjvGHArkRNwFo40g3p43W32OrJohretlt6iSRlJKg=";
|
||||
};
|
||||
};
|
||||
"13" = {
|
||||
inherit (self."14") icu-collations-hack;
|
||||
disable-test-collate-icu-utf8 = fetchurl {
|
||||
url = "https://git.alpinelinux.org/aports/plain/main/postgresql13/disable-test-collate.icu.utf8.patch?id=69faa146ec9fff3b981511068f17f9e629d4688b";
|
||||
hash = "sha256-jS/qxezaiaKhkWeMCXwpz1SDJwUWn9tzN0uKaZ3Ph2Y=";
|
||||
};
|
||||
};
|
||||
"14" = {
|
||||
icu-collations-hack = fetchurl {
|
||||
url = "https://git.alpinelinux.org/aports/plain/main/postgresql14/icu-collations-hack.patch?id=56999e6d0265ceff5c5239f85fdd33e146f06cb7";
|
||||
hash = "sha256-wuwjvGHArkRNwFo40g3p43W32OrJohretlt6iSRlJKg=";
|
||||
};
|
||||
disable-test-collate-icu-utf8 = fetchurl {
|
||||
url = "https://git.alpinelinux.org/aports/plain/main/postgresql14/disable-test-collate.icu.utf8.patch?id=56999e6d0265ceff5c5239f85fdd33e146f06cb7";
|
||||
hash = "sha256-jXe23AxnFjEl+TZQm4R7rStk2Leo08ctxMNmu1xr5zM=";
|
||||
};
|
||||
};
|
||||
"15" = {
|
||||
icu-collations-hack = fetchurl {
|
||||
url = "https://git.alpinelinux.org/aports/plain/main/postgresql15/icu-collations-hack.patch?id=f424e934e6d076c4ae065ce45e734aa283eecb9c";
|
||||
hash = "sha256-HgtmhF4OJYU9macGJbTB9PjQi/yW7c3Akm3U0niWs8I=";
|
||||
};
|
||||
};
|
||||
"16" = {
|
||||
icu-collations-hack = fetchurl {
|
||||
url = "https://git.alpinelinux.org/aports/plain/main/postgresql16/icu-collations-hack.patch?id=08a24be262339fd093e641860680944c3590238e";
|
||||
hash = "sha256-+urQdVIlADLdDPeT68XYv5rljhbK8M/7mPZn/cF+FT0=";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
patchesForVersion = self.${lib.versions.major version} or (throw "no musl patches for postgresql ${version}");
|
||||
in
|
||||
lib.attrValues patchesForVersion
|
||||
map fetchurl (lib.attrValues muslPatches)
|
||||
) ++ lib.optionals stdenv'.isLinux [
|
||||
(if atLeast "13" then ./patches/socketdir-in-run-13.patch else ./patches/socketdir-in-run.patch)
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user