Merge pull request #243298 from doronbehar/pkg/musescore

musescore: 4.0.2 -> 4.1.0

authored by Pol Dellaiera and committed by GitHub 446b09fd 815a2d26

+113 -65
-35
pkgs/applications/audio/musescore/darwin.nix
··· 1 - { stdenv, lib, fetchurl, undmg }: 2 - 3 - let 4 - versionComponents = [ "4" "0" "1" ]; 5 - appName = "MuseScore ${builtins.head versionComponents}"; 6 - ref = "230121751"; 7 - in 8 - 9 - stdenv.mkDerivation rec { 10 - pname = "musescore-darwin"; 11 - version = lib.concatStringsSep "." versionComponents; 12 - 13 - # The disk image contains the .app and a symlink to /Applications. 14 - sourceRoot = "${appName}.app"; 15 - 16 - src = fetchurl { 17 - url = "https://github.com/musescore/MuseScore/releases/download/v${version}/MuseScore-${version}.${ref}.dmg"; 18 - hash = "sha256-tkIEV+tCS0SYh2TlC70/zEBUEOSg//EaSKDGA7kH/vo="; 19 - }; 20 - 21 - buildInputs = [ undmg ]; 22 - installPhase = '' 23 - mkdir -p "$out/Applications/${appName}.app" 24 - cp -R . "$out/Applications/${appName}.app" 25 - chmod a+x "$out/Applications/${appName}.app/Contents/MacOS/mscore" 26 - ''; 27 - 28 - meta = with lib; { 29 - description = "Music notation and composition software"; 30 - homepage = "https://musescore.org/"; 31 - license = licenses.gpl3Only; 32 - platforms = platforms.darwin; 33 - maintainers = []; 34 - }; 35 - }
+112 -24
pkgs/applications/audio/musescore/default.nix
··· 1 - { mkDerivation, lib, fetchFromGitHub, fetchpatch, cmake, pkg-config, ninja 2 - , alsa-lib, freetype, libjack2, lame, libogg, libpulseaudio, libsndfile, libvorbis 3 - , portaudio, portmidi, qtbase, qtdeclarative, qtgraphicaleffects, flac 4 - , qtquickcontrols2, qtscript, qtsvg, qttools 5 - , qtwebengine, qtxmlpatterns, qtnetworkauth, qtx11extras 1 + { stdenv 2 + , lib 3 + , fetchFromGitHub 4 + , fetchpatch 5 + , cmake 6 + , wrapQtAppsHook 7 + , pkg-config 8 + , ninja 9 + , alsa-lib 10 + , freetype 11 + , libjack2 12 + , lame 13 + , libogg 14 + , libpulseaudio 15 + , libsndfile 16 + , libvorbis 17 + , portaudio 18 + , portmidi 19 + , qtbase 20 + , qtdeclarative 21 + , qtgraphicaleffects 22 + , flac 23 + , qtquickcontrols 24 + , qtquickcontrols2 25 + , qtscript 26 + , qtsvg 27 + , qtxmlpatterns 28 + , qtnetworkauth 29 + , qtx11extras 6 30 , nixosTests 31 + , darwin 7 32 }: 8 33 9 - mkDerivation rec { 34 + let 35 + stdenv' = if stdenv.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv; 36 + # portaudio propagates Darwin frameworks. Rebuild it using the 11.0 stdenv 37 + # from Qt and the 11.0 SDK frameworks. 38 + portaudio' = if stdenv.isDarwin then portaudio.override { 39 + stdenv = stdenv'; 40 + inherit (darwin.apple_sdk_11_0.frameworks) 41 + AudioUnit 42 + AudioToolbox 43 + CoreAudio 44 + CoreServices 45 + Carbon 46 + ; 47 + } else portaudio; 48 + in stdenv'.mkDerivation rec { 10 49 pname = "musescore"; 11 - version = "4.0.2"; 50 + version = "4.1.0"; 12 51 13 52 src = fetchFromGitHub { 14 53 owner = "musescore"; 15 54 repo = "MuseScore"; 16 55 rev = "v${version}"; 17 - sha256 = "sha256-3NSHUdTyAC/WOhkB6yBrqtV3LV4Hl1m3poB3ojtJMfs="; 56 + sha256 = "sha256-CqW1f0VsF2lW79L3FY2ev+6FoHLbYOJ9LWHeBlWegeU="; 18 57 }; 19 58 patches = [ 20 - # See https://github.com/musescore/MuseScore/issues/15571 59 + # Upstream from some reason wants to install qml files from qtbase in 60 + # installPhase, this patch removes this behavior. See: 61 + # https://github.com/musescore/MuseScore/issues/18665 21 62 (fetchpatch { 22 - url = "https://github.com/musescore/MuseScore/commit/365be5dfb7296ebee4677cb74b67c1721bc2cf7b.patch"; 23 - hash = "sha256-tJ2M21i3geO9OsjUQKNatSXTkJ5U9qMT4RLNdJnyoKw="; 63 + url = "https://github.com/doronbehar/MuseScore/commit/f48448a3ede46f5a7ef470940072fbfb6742487c.patch"; 64 + hash = "sha256-UEc7auscnW0KMfWkLKQtm+UstuTNsuFeoNJYIidIlwM="; 24 65 }) 25 66 ]; 26 67 27 68 cmakeFlags = [ 28 - "-DMUSESCORE_BUILD_CONFIG=release" 29 - # Disable the _usage_ of the `/bin/crashpad_handler` utility. See: 30 - # https://github.com/musescore/MuseScore/pull/15577 31 - "-DBUILD_CRASHPAD_CLIENT=OFF" 69 + "-DMUSESCORE_BUILD_MODE=release" 70 + # Disable the build and usage of the `/bin/crashpad_handler` utility - it's 71 + # not useful on NixOS, see: 72 + # https://github.com/musescore/MuseScore/issues/15571 73 + "-DMUE_BUILD_CRASHPAD_CLIENT=OFF" 32 74 # Use our freetype 33 75 "-DUSE_SYSTEM_FREETYPE=ON" 76 + # From some reason, in $src/build/cmake/SetupBuildEnvironment.cmake, 77 + # upstream defaults to compiling to x86_64 only, unless this cmake flag is 78 + # set 79 + "-DMUE_COMPILE_BUILD_MACOS_APPLE_SILICON=ON" 80 + # Don't bundle qt qml files, relevant really only for darwin, but we set 81 + # this for all platforms anyway. 82 + "-DMUE_COMPILE_INSTALL_QTQML_FILES=OFF" 34 83 ]; 35 84 36 85 qtWrapperArgs = [ 37 86 # MuseScore JACK backend loads libjack at runtime. 38 - "--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libjack2 ]}" 87 + "--prefix ${lib.optionalString stdenv.isDarwin "DY"}LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libjack2 ]}" 88 + ] ++ lib.optionals (!stdenv.isDarwin) [ 39 89 # There are some issues with using the wayland backend, see: 40 90 # https://musescore.org/en/node/321936 41 91 "--set-default QT_QPA_PLATFORM xcb" 42 92 ]; 43 93 44 - nativeBuildInputs = [ cmake pkg-config ninja ]; 94 + # HACK `propagatedSandboxProfile` does not appear to actually propagate the 95 + # sandbox profile from `qtbase`, see: 96 + # https://github.com/NixOS/nixpkgs/issues/237458 97 + sandboxProfile = toString qtbase.__propagatedSandboxProfile or null; 98 + 99 + nativeBuildInputs = [ 100 + wrapQtAppsHook 101 + cmake 102 + pkg-config 103 + ninja 104 + ]; 45 105 46 106 buildInputs = [ 47 - alsa-lib libjack2 freetype lame libogg libpulseaudio libsndfile libvorbis 48 - portaudio portmidi flac # tesseract 49 - qtbase qtdeclarative qtgraphicaleffects qtquickcontrols2 50 - qtscript qtsvg qttools qtwebengine qtxmlpatterns qtnetworkauth qtx11extras 107 + libjack2 108 + freetype 109 + lame 110 + libogg 111 + libpulseaudio 112 + libsndfile 113 + libvorbis 114 + portaudio' 115 + portmidi 116 + flac 117 + qtbase 118 + qtdeclarative 119 + qtgraphicaleffects 120 + qtquickcontrols 121 + qtquickcontrols2 122 + qtscript 123 + qtsvg 124 + qtxmlpatterns 125 + qtnetworkauth 126 + qtx11extras 127 + ] ++ lib.optionals stdenv.isLinux [ 128 + alsa-lib 51 129 ]; 52 130 131 + postInstall = '' 132 + # Remove unneeded bundled libraries and headers 133 + rm -r $out/{include,lib} 134 + '' + lib.optionalString stdenv.isDarwin '' 135 + mkdir -p "$out/Applications" 136 + mv "$out/mscore.app" "$out/Applications/mscore.app" 137 + mkdir -p $out/bin 138 + ln -s $out/Applications/mscore.app/Contents/MacOS/mscore $out/bin/mscore. 139 + ''; 140 + 53 141 passthru.tests = nixosTests.musescore; 54 142 55 143 meta = with lib; { ··· 57 145 homepage = "https://musescore.org/"; 58 146 license = licenses.gpl3Only; 59 147 maintainers = with maintainers; [ vandenoever turion doronbehar ]; 60 - # Darwin requires CoreMIDI from SDK 11.3, we use the upstream built .dmg 61 - # file in ./darwin.nix in the meantime. 62 - platforms = platforms.linux; 148 + # on aarch64-linux: 149 + # error: cannot convert '<brace-enclosed initializer list>' to 'float32x4_t' in assignment 150 + broken = (stdenv.isLinux && stdenv.isAarch64); 63 151 mainProgram = "mscore"; 64 152 }; 65 153 }
+1 -6
pkgs/top-level/all-packages.nix
··· 33441 33441 autoreconfHook = buildPackages.autoreconfHook269; 33442 33442 }; 33443 33443 33444 - # TODO: we should probably merge these 2 33445 - musescore = 33446 - if stdenv.isDarwin then 33447 - callPackage ../applications/audio/musescore/darwin.nix { } 33448 - else 33449 - libsForQt5.callPackage ../applications/audio/musescore { }; 33444 + musescore = libsForQt5.callPackage ../applications/audio/musescore { }; 33450 33445 33451 33446 music-player = callPackage ../applications/audio/music-player { }; 33452 33447