matrix-authentication-service: fix http_listener_assets_path_default() (#432594)

This commit is contained in:
Emily 2025-08-11 19:49:56 +02:00 committed by GitHub
commit 5bb0267a60
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -63,13 +63,13 @@ rustPlatform.buildRustPackage (finalAttrs: {
postPatch = ''
substituteInPlace crates/config/src/sections/http.rs \
--replace ./frontend/dist/ "$out/share/$pname/assets/"
--replace-fail ./share/assets/ "$out/share/$pname/assets/"
substituteInPlace crates/config/src/sections/templates.rs \
--replace ./share/templates/ "$out/share/$pname/templates/" \
--replace ./share/translations/ "$out/share/$pname/translations/" \
--replace ./share/manifest.json "$out/share/$pname/assets/manifest.json"
--replace-fail ./share/templates/ "$out/share/$pname/templates/" \
--replace-fail ./share/translations/ "$out/share/$pname/translations/" \
--replace-fail ./share/manifest.json "$out/share/$pname/assets/manifest.json"
substituteInPlace crates/config/src/sections/policy.rs \
--replace ./share/policy.wasm "$out/share/$pname/policy.wasm"
--replace-fail ./share/policy.wasm "$out/share/$pname/policy.wasm"
'';
preBuild = ''
@ -77,9 +77,10 @@ rustPlatform.buildRustPackage (finalAttrs: {
(cd "$npmRoot" && npm run build)
'';
# Adopted from https://github.com/element-hq/matrix-authentication-service/blob/main/Dockerfile
# Adapted from https://github.com/element-hq/matrix-authentication-service/blob/v0.20.0/.github/workflows/build.yaml#L75-L84
postInstall = ''
install -Dm444 -t "$out/share/$pname" "policies/policy.wasm"
install -Dm444 -t "$out/share/$pname" "$npmRoot/dist/manifest.json"
install -Dm444 -t "$out/share/$pname/assets" "$npmRoot/dist/"*
cp -r templates "$out/share/$pname/templates"
cp -r translations "$out/share/$pname/translations"