velocity: make Nix register dependencies of native libraries

Also fix and enable strictDeps.

(cherry picked from commit d0027f93ac)
This commit is contained in:
FliegendeWurst
2025-05-19 18:45:01 +02:00
committed by github-actions[bot]
parent 031f393b52
commit 3643b0d814

View File

@@ -44,19 +44,21 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-CJVUEwYnpXDaYgXoi1Qk0uyB/CHM3UDQzQfhtDxDKdE=";
};
nativeBuildInputs =
[
gradle_jdk17
makeBinaryWrapper
]
++ lib.optionals withVelocityNative [
# libraries for velocity-native
openssl
libdeflate
nativeBuildInputs = [
gradle_jdk17
makeBinaryWrapper
];
# needed for building velocity-native jni
jdk17
];
buildInputs = lib.optionals withVelocityNative [
# libraries for velocity-native
openssl
libdeflate
# needed for building velocity-native jni
jdk17
];
strictDeps = true;
mitmCache = gradle_jdk17.fetchDeps {
inherit (finalAttrs) pname;
@@ -99,6 +101,13 @@ stdenv.mkDerivation (finalAttrs: {
makeWrapper ${lib.getExe jre_headless} "$out/bin/velocity" \
--append-flags "-jar $out/share/velocity/velocity.jar"
${lib.optionalString withVelocityNative ''
# Nix doesn't pick up references in compressed JAR file
mkdir $out/nix-support
echo ${lib.getLib openssl} >> $out/nix-support/runtime-dependencies
echo ${lib.getLib libdeflate} >> $out/nix-support/runtime-dependencies
''}
runHook postInstall
'';