mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-12 02:40:31 +08:00
velocity: make Nix register dependencies of native libraries
Also fix and enable strictDeps.
This commit is contained in:
@@ -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
|
||||
'';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user