From b7833945e56800646b4df1537c30265ef160858b Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Tue, 7 May 2024 10:47:15 +0000 Subject: [PATCH] furnace: 0.6.2 -> 0.6.3 - Disable new Metal renderer, unable to compile it - Handle new OpenGL 1 renderer - Explicitly enable freetype & use system-installed one - Migrate to by-name, switch to finalAttrs pattern - Fix installing on Darwin Co-authored-by: OPNA2608 --- .../fu/furnace/package.nix} | 64 ++++++++++--------- .../audio => by-name/fu}/furnace/update.sh | 0 pkgs/top-level/all-packages.nix | 4 -- 3 files changed, 35 insertions(+), 33 deletions(-) rename pkgs/{applications/audio/furnace/default.nix => by-name/fu/furnace/package.nix} (66%) rename pkgs/{applications/audio => by-name/fu}/furnace/update.sh (100%) diff --git a/pkgs/applications/audio/furnace/default.nix b/pkgs/by-name/fu/furnace/package.nix similarity index 66% rename from pkgs/applications/audio/furnace/default.nix rename to pkgs/by-name/fu/furnace/package.nix index cc52c197974d..10d55b9871ae 100644 --- a/pkgs/applications/audio/furnace/default.nix +++ b/pkgs/by-name/fu/furnace/package.nix @@ -8,6 +8,7 @@ , makeWrapper , fftw , fmt_8 +, freetype , libsndfile , libX11 , rtmidi @@ -16,7 +17,7 @@ , withJACK ? stdenv.hostPlatform.isUnix , libjack2 , withGUI ? true -, Cocoa +, darwin , portaudio , alsa-lib # Enable GL/GLES rendering @@ -25,23 +26,23 @@ , preferGLES ? stdenv.hostPlatform.isAarch }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "furnace"; - version = "0.6.2"; + version = "0.6.3"; src = fetchFromGitHub { owner = "tildearrow"; repo = "furnace"; - rev = "v${version}"; + rev = "v${finalAttrs.version}"; fetchSubmodules = true; - hash = "sha256-Pv9Sx+bdoy8uV5o9i1rUSuokwQVA8EPYFkZXM8Fynmk="; + hash = "sha256-z0WvJvkry/9T4Fgp2fX83CxPpDBoOPNVtyX2OUk26FI="; }; postPatch = lib.optionalString stdenv.hostPlatform.isLinux '' # To offer scaling detection on X11, furnace checks if libX11.so is available via dlopen and uses some of its functions # But it's being linked against a versioned libX11.so.VERSION via SDL, so the unversioned one is not on the rpath substituteInPlace src/gui/scaling.cpp \ - --replace 'libX11.so' '${lib.getLib libX11}/lib/libX11.so' + --replace-fail 'libX11.so' '${lib.getLib libX11}/lib/libX11.so' ''; nativeBuildInputs = [ @@ -54,6 +55,7 @@ stdenv.mkDerivation rec { buildInputs = [ fftw fmt_8 + freetype libsndfile rtmidi SDL2 @@ -64,26 +66,30 @@ stdenv.mkDerivation rec { ] ++ lib.optionals stdenv.hostPlatform.isLinux [ # portaudio pkg-config is pulling this in as a link dependency, not set in propagatedBuildInputs alsa-lib - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ + ] ++ lib.optionals stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [ Cocoa - ]; + ]); cmakeFlags = [ - "-DBUILD_GUI=${if withGUI then "ON" else "OFF"}" - "-DSYSTEM_FFTW=ON" - "-DSYSTEM_FMT=ON" - "-DSYSTEM_LIBSNDFILE=ON" - "-DSYSTEM_RTMIDI=ON" - "-DSYSTEM_SDL2=ON" - "-DSYSTEM_ZLIB=ON" - "-DSYSTEM_PORTAUDIO=ON" - "-DWITH_JACK=${if withJACK then "ON" else "OFF"}" - "-DWITH_PORTAUDIO=ON" - "-DWITH_RENDER_SDL=ON" - "-DWITH_RENDER_OPENGL=${lib.boolToString withGL}" - "-DWARNINGS_ARE_ERRORS=ON" - ] ++ lib.optionals withGL [ - "-DUSE_GLES=${lib.boolToString preferGLES}" + (lib.cmakeBool "BUILD_GUI" withGUI) + (lib.cmakeBool "SYSTEM_FFTW" true) + (lib.cmakeBool "SYSTEM_FMT" true) + (lib.cmakeBool "SYSTEM_LIBSNDFILE" true) + (lib.cmakeBool "SYSTEM_RTMIDI" true) + (lib.cmakeBool "SYSTEM_SDL2" true) + (lib.cmakeBool "SYSTEM_ZLIB" true) + (lib.cmakeBool "USE_FREETYPE" true) + (lib.cmakeBool "SYSTEM_FREETYPE" true) + (lib.cmakeBool "WITH_JACK" withJACK) + (lib.cmakeBool "WITH_PORTAUDIO" true) + (lib.cmakeBool "SYSTEM_PORTAUDIO" true) + (lib.cmakeBool "WITH_RENDER_SDL" true) + (lib.cmakeBool "WITH_RENDER_OPENGL" withGL) + (lib.cmakeBool "USE_GLES" (withGL && preferGLES)) + (lib.cmakeBool "WITH_RENDER_METAL" false) # fails to build + (lib.cmakeBool "WITH_RENDER_OPENGL1" (withGL && !preferGLES)) + (lib.cmakeBool "WARNINGS_ARE_ERRORS" true) + (lib.cmakeBool "FORCE_APPLE_BIN" true) ]; postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' @@ -109,13 +115,13 @@ stdenv.mkDerivation rec { }; }; - meta = with lib; { + meta = { description = "Multi-system chiptune tracker compatible with DefleMask modules"; homepage = "https://github.com/tildearrow/furnace"; - changelog = "https://github.com/tildearrow/furnace/releases/tag/v${version}"; - license = with licenses; [ gpl2Plus ]; - maintainers = with maintainers; [ OPNA2608 ]; - platforms = platforms.all; + changelog = "https://github.com/tildearrow/furnace/releases/tag/v${finalAttrs.version}"; + license = with lib.licenses; [ gpl2Plus ]; + maintainers = with lib.maintainers; [ OPNA2608 ]; + platforms = lib.platforms.all; mainProgram = "furnace"; }; -} +}) diff --git a/pkgs/applications/audio/furnace/update.sh b/pkgs/by-name/fu/furnace/update.sh similarity index 100% rename from pkgs/applications/audio/furnace/update.sh rename to pkgs/by-name/fu/furnace/update.sh diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c526f939d01d..e1f62b7a8c96 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -30664,10 +30664,6 @@ with pkgs; expenses = callPackage ../applications/misc/expenses { }; - furnace = callPackage ../applications/audio/furnace { - inherit (darwin.apple_sdk.frameworks) Cocoa; - }; - furtherance = callPackage ../applications/misc/furtherance { }; gigalixir = callPackage ../tools/misc/gigalixir { };