fire: init at 1.0.0.3 (#188515)

authored by Christoph Neidahl and committed by GitHub 81231a82 bc2035ba

+184
+62
pkgs/applications/audio/fire/0001-Remove-FetchContent-usage.patch
··· 1 + From fbf2ddd872db6a3640bc7d693356b99be9dd70f5 Mon Sep 17 00:00:00 2001 2 + From: OPNA2608 <christoph.neidahl@gmail.com> 3 + Date: Thu, 18 Aug 2022 20:12:07 +0200 4 + Subject: [PATCH] Remove FetchContent usage 5 + 6 + --- 7 + CMakeLists.txt | 27 +++++---------------------- 8 + 1 file changed, 5 insertions(+), 22 deletions(-) 9 + 10 + diff --git a/CMakeLists.txt b/CMakeLists.txt 11 + index 84c66a7..5234903 100644 12 + --- a/CMakeLists.txt 13 + +++ b/CMakeLists.txt 14 + @@ -30,20 +30,9 @@ project(Fire VERSION 0.9.9) 15 + # or 16 + # add_subdirectory(JUCE) # If you've put JUCE in a subdirectory called JUCE 17 + 18 + -include(FetchContent) 19 + -FetchContent_Declare( 20 + - JUCE 21 + - GIT_REPOSITORY https://github.com/juce-framework/JUCE.git 22 + - GIT_TAG 7.0.1 23 + -) 24 + -FetchContent_MakeAvailable(JUCE) 25 + - 26 + -FetchContent_Declare( 27 + - readerwriterqueue 28 + - GIT_REPOSITORY https://github.com/cameron314/readerwriterqueue 29 + - GIT_TAG v1.0.6 30 + -) 31 + -FetchContent_MakeAvailable(readerwriterqueue) 32 + +add_subdirectory(JUCE EXCLUDE_FROM_ALL) 33 + + 34 + +add_subdirectory(readerwriterqueue EXCLUDE_FROM_ALL) 35 + 36 + # If you are building a VST2 or AAX plugin, CMake needs to be told where to find these SDKs on your 37 + # system. This setup should be done before calling `juce_add_plugin`. 38 + @@ -172,13 +161,7 @@ set(TestFiles 39 + test/CatchMain.cpp 40 + test/PluginTest.cpp) 41 + 42 + -# Download the tagged version of Catch2 43 + -Include(FetchContent) 44 + -FetchContent_Declare( 45 + - Catch2 46 + - GIT_REPOSITORY https://github.com/catchorg/Catch2.git 47 + - GIT_TAG v2.13.7) 48 + -FetchContent_MakeAvailable(Catch2) 49 + +add_subdirectory(Catch2 EXCLUDE_FROM_ALL) 50 + 51 + # Setup the test executable, again C++ 20 please 52 + add_executable(Tests ${TestFiles}) 53 + @@ -199,4 +182,4 @@ source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/test PREFIX "" FILES ${TestFiles}) 54 + # We have to manually provide the source directory here for now 55 + # https://github.com/catchorg/Catch2/issues/2026 56 + include(${Catch2_SOURCE_DIR}/contrib/Catch.cmake) 57 + -catch_discover_tests(Tests) 58 + \ No newline at end of file 59 + +catch_discover_tests(Tests) 60 + -- 61 + 2.36.0 62 +
+117
pkgs/applications/audio/fire/default.nix
··· 1 + { stdenv 2 + , lib 3 + , fetchFromGitHub 4 + , cmake 5 + , pkg-config 6 + , catch2 7 + , libX11 8 + , libXrandr 9 + , libXinerama 10 + , libXext 11 + , libXcursor 12 + , freetype 13 + , alsa-lib 14 + , Cocoa 15 + , WebKit 16 + , CoreServices 17 + , DiscRecording 18 + , CoreAudioKit 19 + , MetalKit 20 + , simd 21 + }: 22 + 23 + let 24 + # FetchContent replacement, check CMakeLists.txt for requested versions (Nixpkgs' Catch2 works) 25 + readerwriterqueue = fetchFromGitHub { 26 + owner = "cameron314"; 27 + repo = "readerwriterqueue"; 28 + rev = "v1.0.6"; 29 + sha256 = "sha256-g7NX7Ucl5GWw3u6TiUOITjhv7492ByTzACtWR0Ph2Jc="; 30 + }; 31 + in 32 + stdenv.mkDerivation rec { 33 + pname = "fire"; 34 + version = "1.0.0.3"; 35 + 36 + src = fetchFromGitHub { 37 + owner = "jerryuhoo"; 38 + repo = "Fire"; 39 + rev = "v${version}"; 40 + fetchSubmodules = true; 41 + sha256 = "sha256-X3pzTrNd0G6BouCDkr3dukQTFDzZ7qblIYxFQActKGE="; 42 + }; 43 + 44 + patches = [ 45 + ./0001-Remove-FetchContent-usage.patch 46 + ]; 47 + 48 + postPatch = '' 49 + # 1. Remove hardcoded LTO flags: needs extra setup on Linux, 50 + # possibly broken on Darwin 51 + # https://github.com/NixOS/nixpkgs/issues/19098 52 + # 2. Disable automatic copying of built plugins during buildPhase, it defaults 53 + # into user home and we want to have building & installing separated. 54 + sed -i \ 55 + -e '/juce::juce_recommended_lto_flags/d' \ 56 + -e 's/COPY_PLUGIN_AFTER_BUILD TRUE/COPY_PLUGIN_AFTER_BUILD FALSE/g' \ 57 + CMakeLists.txt 58 + ''; 59 + 60 + preConfigure = '' 61 + ln -s ${readerwriterqueue} readerwriterqueue 62 + ln -s ${catch2.src} Catch2 63 + ''; 64 + 65 + nativeBuildInputs = [ 66 + cmake 67 + pkg-config 68 + ]; 69 + 70 + buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ 71 + libX11 72 + libXrandr 73 + libXinerama 74 + libXext 75 + libXcursor 76 + freetype 77 + alsa-lib 78 + ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ 79 + Cocoa 80 + WebKit 81 + CoreServices 82 + DiscRecording 83 + CoreAudioKit 84 + MetalKit 85 + simd 86 + ]; 87 + 88 + installPhase = let 89 + vst3Dir = "${placeholder "out"}/${if stdenv.hostPlatform.isDarwin then "Library/Audio/Plug-Ins/VST3" else "lib/vst3"}"; 90 + auDir = "${placeholder "out"}/Library/Audio/Plug-Ins/Components"; 91 + in '' 92 + runHook preInstall 93 + 94 + mkdir -p ${vst3Dir} 95 + # Exact path of the build artefact depends on used CMAKE_BUILD_TYPE 96 + cp -R Fire_artefacts/*/VST3/* ${vst3Dir}/ 97 + '' + lib.optionalString stdenv.hostPlatform.isDarwin '' 98 + mkdir -p ${auDir} 99 + cp -R Fire_artefacts/*/AU/* ${auDir}/ 100 + '' + '' 101 + 102 + runHook postInstall 103 + ''; 104 + 105 + # Fails to find fp.h on its own 106 + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-isystem ${CoreServices}/Library/Frameworks/CoreServices.framework/Versions/Current/Frameworks/CarbonCore.framework/Versions/Current/Headers/"; 107 + 108 + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; 109 + 110 + meta = with lib; { 111 + description = "Multi-band distortion plugin by Wings"; 112 + homepage = "https://github.com/jerryuhoo/Fire"; 113 + license = licenses.agpl3Only; # Not clarified if Only or Plus 114 + platforms = platforms.unix; 115 + maintainers = with maintainers; [ OPNA2608 ]; 116 + }; 117 + }
+5
pkgs/top-level/all-packages.nix
··· 28038 28038 28039 28039 filezilla = callPackage ../applications/networking/ftp/filezilla { }; 28040 28040 28041 + fire = darwin.apple_sdk_11_0.callPackage ../applications/audio/fire { 28042 + inherit (darwin.apple_sdk_11_0.frameworks) Cocoa WebKit CoreServices DiscRecording CoreAudioKit MetalKit; 28043 + inherit (darwin.apple_sdk_11_0.libs) simd; 28044 + }; 28045 + 28041 28046 buildMozillaMach = opts: callPackage (import ../applications/networking/browsers/firefox/common.nix opts) {}; 28042 28047 28043 28048 firefoxPackages = recurseIntoAttrs (callPackage ../applications/networking/browsers/firefox/packages.nix {});