kanidm: fix 1.3 build and permit hydra to build it (#363662)

This commit is contained in:
Christina Sørensen 2024-12-10 07:08:43 +01:00 committed by GitHub
commit 940f800164
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 24 additions and 13 deletions

View File

@ -55,18 +55,24 @@ rustPlatform.buildRustPackage rec {
postPatch =
let
format = (formats.toml { }).generate "${KANIDM_BUILD_PROFILE}.toml";
profile = {
admin_bind_path = "/run/kanidmd/sock";
cpu_flags = if stdenv.hostPlatform.isx86_64 then "x86_64_legacy" else "none";
default_config_path = "/etc/kanidm/server.toml";
default_unix_shell_path = "${lib.getBin bashInteractive}/bin/bash";
htmx_ui_pkg_path = "@htmx_ui_pkg_path@";
};
profile =
{
admin_bind_path = "/run/kanidmd/sock";
cpu_flags = if stdenv.hostPlatform.isx86_64 then "x86_64_legacy" else "none";
default_config_path = "/etc/kanidm/server.toml";
default_unix_shell_path = "${lib.getBin bashInteractive}/bin/bash";
htmx_ui_pkg_path = "@htmx_ui_pkg_path@";
}
// lib.optionalAttrs (lib.versions.majorMinor version == "1.3") {
web_ui_pkg_path = "@web_ui_pkg_path@";
};
in
''
cp ${format profile} libs/profiles/${KANIDM_BUILD_PROFILE}.toml
substituteInPlace libs/profiles/${KANIDM_BUILD_PROFILE}.toml \
--replace-fail '@htmx_ui_pkg_path@' "$out/ui/hpkg"
substituteInPlace libs/profiles/${KANIDM_BUILD_PROFILE}.toml --replace-fail '@htmx_ui_pkg_path@' "$out/ui/hpkg"
''
+ lib.optionalString (lib.versions.majorMinor version == "1.3") ''
substituteInPlace libs/profiles/${KANIDM_BUILD_PROFILE}.toml --replace-fail '@web_ui_pkg_path@' "$out/ui/pkg"
'';
nativeBuildInputs = [
@ -83,10 +89,14 @@ rustPlatform.buildRustPackage rec {
];
# The UI needs to be in place before the tests are run.
postBuild = ''
mkdir -p $out/ui
cp -r server/core/static $out/ui/hpkg
'';
postBuild =
''
mkdir -p $out/ui
cp -r server/core/static $out/ui/hpkg
''
+ lib.optionalString (lib.versions.majorMinor version == "1.3") ''
cp -r server/web_ui/pkg $out/ui/pkg
'';
# Upstream runs with the Rust equivalent of -Werror,
# which breaks when we upgrade to new Rust before them.

View File

@ -35,6 +35,7 @@
# so users choosing to allow don't have to rebuild them every time.
permittedInsecurePackages = [
"olm-3.2.16" # see PR #347899
"kanidm_1_3-1.3.3"
];
}; }