Unverified Commit 8a904130 authored by Mitchell Skaggs's avatar Mitchell Skaggs
Browse files

recordbox: add workaround for `glycin-loaders` to allow discovery by `glycin` Rust crate

parent 91f0f77b
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@
  desktop-file-utils,
  fetchFromGitea,
  glib,
  glycin-loaders,
  gst_all_1,
  gtk4,
  hicolor-icon-theme,
@@ -84,6 +85,22 @@ stdenv.mkDerivation (finalAttrs: {
  doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
  cargoCheckType = if (finalAttrs.mesonBuildType != "debug") then "release" else "debug";

  # Workaround copied from https://github.com/NixOS/nixpkgs/blob/e39fe935fc7537bee0440935c12f5c847735a291/pkgs/by-name/lo/loupe/package.nix#L60-L74
  preConfigure = ''
    # Dirty approach to add patches after cargoSetupPostUnpackHook
    # We should eventually use a cargo vendor patch hook instead
    pushd ../$(stripHash $cargoDeps)/glycin-2.*
      patch -p3 < ${glycin-loaders.passthru.glycinPathsPatch}
    popd
  '';
  preFixup = ''
    # Needed for the glycin crate to find loaders.
    # https://gitlab.gnome.org/sophie-h/glycin/-/blob/0.1.beta.2/glycin/src/config.rs#L44
    gappsWrapperArgs+=(
      --prefix XDG_DATA_DIRS : "${glycin-loaders}/share"
    )
  '';

  checkPhase = ''
    runHook preCheck