mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-28 00:24:18 +00:00
kanidm: add back 1.3 compatibility
This commit is contained in:
parent
33fe023937
commit
97958e72e8
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user