From f43a46f8b8a26e636711da6ac6e216ad70e9be89 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Mon, 10 Jul 2023 17:14:09 +0200 Subject: [PATCH] fluidsynth: Fix CMake config Upstream is concatenating CMAKE_INSTALL_LIBDIR onto CMAKE_INSTALL_PREFIX to get a directory to use for the install_name on Darwin. This is not the right way of making CMAKE_INSTALL_LIBDIR absolute. The config was first set up for breakage when the CMAKE_INSTALL_LIBDIR was made relative, in order to work around the wrong concatenation. This caused the _IMPORT_PREFIX to be computed by walking up the directory tree from the config file, instead of using the absolute CMAKE_INSTALL_LIBDIR. Then outputs were introduced to the derivation and the config was moved to a different output. Now the prefix it walks up to is the wrong prefix, and the config is busted. Fix by reverting the original workaround so we have an absolute CMAKE_INSTALL_LIBDIR, and pulling a patch that fixes the bad concatenation. --- pkgs/applications/audio/fluidsynth/default.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/audio/fluidsynth/default.nix b/pkgs/applications/audio/fluidsynth/default.nix index 41ee34847a84..81dbbf2921b4 100644 --- a/pkgs/applications/audio/fluidsynth/default.nix +++ b/pkgs/applications/audio/fluidsynth/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchFromGitHub, buildPackages, pkg-config, cmake +{ stdenv, lib, fetchFromGitHub, fetchpatch, buildPackages, pkg-config, cmake , alsa-lib, glib, libjack2, libsndfile, libpulseaudio , AppKit, AudioUnit, CoreAudio, CoreMIDI, CoreServices }: @@ -14,6 +14,16 @@ stdenv.mkDerivation rec { sha256 = "sha256-BSJu3jB7b5G2ThXBUHUNnBGl55EXe3nIzdBdgfOWDSM="; }; + patches = [ + # Fixes bad CMAKE_INSTALL_PREFIX + CMAKE_INSTALL_LIBDIR concatenation for Darwin install name dir + # Remove when PR merged & in release + (fetchpatch { + name = "0001-Fix-incorrect-way-of-turning-CMAKE_INSTALL_LIBDIR-absolute.patch"; + url = "https://github.com/FluidSynth/fluidsynth/pull/1261/commits/03cd38dd909fc24aa39553d869afbb4024416de8.patch"; + hash = "sha256-nV+MbFttnbNBO4zWnPLpnnEuoiESkV9BGFlUS9tQQfk="; + }) + ]; + outputs = [ "out" "dev" "man" ]; nativeBuildInputs = [ buildPackages.stdenv.cc pkg-config cmake ]; @@ -24,8 +34,6 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-Denable-framework=off" - # set CMAKE_INSTALL_NAME_DIR to correct value on darwin - "-DCMAKE_INSTALL_LIBDIR=lib" ]; meta = with lib; {