Unverified Commit 099325e6 authored by Aleksana's avatar Aleksana Committed by GitHub
Browse files

[Backport release-25.05] velocity: make Nix register dependencies of native libraries (#409725)

parents 6cb1302c 3643b0d8
Loading
Loading
Loading
Loading
+22 −13
Original line number Diff line number Diff line
@@ -44,12 +44,12 @@ stdenv.mkDerivation (finalAttrs: {
    hash = "sha256-CJVUEwYnpXDaYgXoi1Qk0uyB/CHM3UDQzQfhtDxDKdE=";
  };

  nativeBuildInputs =
    [
  nativeBuildInputs = [
    gradle_jdk17
    makeBinaryWrapper
    ]
    ++ lib.optionals withVelocityNative [
  ];

  buildInputs = lib.optionals withVelocityNative [
    # libraries for velocity-native
    openssl
    libdeflate
@@ -58,6 +58,8 @@ stdenv.mkDerivation (finalAttrs: {
    jdk17
  ];

  strictDeps = true;

  mitmCache = gradle_jdk17.fetchDeps {
    inherit (finalAttrs) pname;
    data = ./deps.json;
@@ -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
  '';