mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-18 01:54:34 +00:00
Merge pull request #243298 from doronbehar/pkg/musescore
musescore: 4.0.2 -> 4.1.0
This commit is contained in:
commit
446b09fd3d
@ -1,35 +0,0 @@
|
|||||||
{ stdenv, lib, fetchurl, undmg }:
|
|
||||||
|
|
||||||
let
|
|
||||||
versionComponents = [ "4" "0" "1" ];
|
|
||||||
appName = "MuseScore ${builtins.head versionComponents}";
|
|
||||||
ref = "230121751";
|
|
||||||
in
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
|
||||||
pname = "musescore-darwin";
|
|
||||||
version = lib.concatStringsSep "." versionComponents;
|
|
||||||
|
|
||||||
# The disk image contains the .app and a symlink to /Applications.
|
|
||||||
sourceRoot = "${appName}.app";
|
|
||||||
|
|
||||||
src = fetchurl {
|
|
||||||
url = "https://github.com/musescore/MuseScore/releases/download/v${version}/MuseScore-${version}.${ref}.dmg";
|
|
||||||
hash = "sha256-tkIEV+tCS0SYh2TlC70/zEBUEOSg//EaSKDGA7kH/vo=";
|
|
||||||
};
|
|
||||||
|
|
||||||
buildInputs = [ undmg ];
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p "$out/Applications/${appName}.app"
|
|
||||||
cp -R . "$out/Applications/${appName}.app"
|
|
||||||
chmod a+x "$out/Applications/${appName}.app/Contents/MacOS/mscore"
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = with lib; {
|
|
||||||
description = "Music notation and composition software";
|
|
||||||
homepage = "https://musescore.org/";
|
|
||||||
license = licenses.gpl3Only;
|
|
||||||
platforms = platforms.darwin;
|
|
||||||
maintainers = [];
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,55 +1,143 @@
|
|||||||
{ mkDerivation, lib, fetchFromGitHub, fetchpatch, cmake, pkg-config, ninja
|
{ stdenv
|
||||||
, alsa-lib, freetype, libjack2, lame, libogg, libpulseaudio, libsndfile, libvorbis
|
, lib
|
||||||
, portaudio, portmidi, qtbase, qtdeclarative, qtgraphicaleffects, flac
|
, fetchFromGitHub
|
||||||
, qtquickcontrols2, qtscript, qtsvg, qttools
|
, fetchpatch
|
||||||
, qtwebengine, qtxmlpatterns, qtnetworkauth, qtx11extras
|
, cmake
|
||||||
|
, wrapQtAppsHook
|
||||||
|
, pkg-config
|
||||||
|
, ninja
|
||||||
|
, alsa-lib
|
||||||
|
, freetype
|
||||||
|
, libjack2
|
||||||
|
, lame
|
||||||
|
, libogg
|
||||||
|
, libpulseaudio
|
||||||
|
, libsndfile
|
||||||
|
, libvorbis
|
||||||
|
, portaudio
|
||||||
|
, portmidi
|
||||||
|
, qtbase
|
||||||
|
, qtdeclarative
|
||||||
|
, qtgraphicaleffects
|
||||||
|
, flac
|
||||||
|
, qtquickcontrols
|
||||||
|
, qtquickcontrols2
|
||||||
|
, qtscript
|
||||||
|
, qtsvg
|
||||||
|
, qtxmlpatterns
|
||||||
|
, qtnetworkauth
|
||||||
|
, qtx11extras
|
||||||
, nixosTests
|
, nixosTests
|
||||||
|
, darwin
|
||||||
}:
|
}:
|
||||||
|
|
||||||
mkDerivation rec {
|
let
|
||||||
|
stdenv' = if stdenv.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv;
|
||||||
|
# portaudio propagates Darwin frameworks. Rebuild it using the 11.0 stdenv
|
||||||
|
# from Qt and the 11.0 SDK frameworks.
|
||||||
|
portaudio' = if stdenv.isDarwin then portaudio.override {
|
||||||
|
stdenv = stdenv';
|
||||||
|
inherit (darwin.apple_sdk_11_0.frameworks)
|
||||||
|
AudioUnit
|
||||||
|
AudioToolbox
|
||||||
|
CoreAudio
|
||||||
|
CoreServices
|
||||||
|
Carbon
|
||||||
|
;
|
||||||
|
} else portaudio;
|
||||||
|
in stdenv'.mkDerivation rec {
|
||||||
pname = "musescore";
|
pname = "musescore";
|
||||||
version = "4.0.2";
|
version = "4.1.0";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "musescore";
|
owner = "musescore";
|
||||||
repo = "MuseScore";
|
repo = "MuseScore";
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "sha256-3NSHUdTyAC/WOhkB6yBrqtV3LV4Hl1m3poB3ojtJMfs=";
|
sha256 = "sha256-CqW1f0VsF2lW79L3FY2ev+6FoHLbYOJ9LWHeBlWegeU=";
|
||||||
};
|
};
|
||||||
patches = [
|
patches = [
|
||||||
# See https://github.com/musescore/MuseScore/issues/15571
|
# Upstream from some reason wants to install qml files from qtbase in
|
||||||
|
# installPhase, this patch removes this behavior. See:
|
||||||
|
# https://github.com/musescore/MuseScore/issues/18665
|
||||||
(fetchpatch {
|
(fetchpatch {
|
||||||
url = "https://github.com/musescore/MuseScore/commit/365be5dfb7296ebee4677cb74b67c1721bc2cf7b.patch";
|
url = "https://github.com/doronbehar/MuseScore/commit/f48448a3ede46f5a7ef470940072fbfb6742487c.patch";
|
||||||
hash = "sha256-tJ2M21i3geO9OsjUQKNatSXTkJ5U9qMT4RLNdJnyoKw=";
|
hash = "sha256-UEc7auscnW0KMfWkLKQtm+UstuTNsuFeoNJYIidIlwM=";
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
cmakeFlags = [
|
cmakeFlags = [
|
||||||
"-DMUSESCORE_BUILD_CONFIG=release"
|
"-DMUSESCORE_BUILD_MODE=release"
|
||||||
# Disable the _usage_ of the `/bin/crashpad_handler` utility. See:
|
# Disable the build and usage of the `/bin/crashpad_handler` utility - it's
|
||||||
# https://github.com/musescore/MuseScore/pull/15577
|
# not useful on NixOS, see:
|
||||||
"-DBUILD_CRASHPAD_CLIENT=OFF"
|
# https://github.com/musescore/MuseScore/issues/15571
|
||||||
|
"-DMUE_BUILD_CRASHPAD_CLIENT=OFF"
|
||||||
# Use our freetype
|
# Use our freetype
|
||||||
"-DUSE_SYSTEM_FREETYPE=ON"
|
"-DUSE_SYSTEM_FREETYPE=ON"
|
||||||
|
# From some reason, in $src/build/cmake/SetupBuildEnvironment.cmake,
|
||||||
|
# upstream defaults to compiling to x86_64 only, unless this cmake flag is
|
||||||
|
# set
|
||||||
|
"-DMUE_COMPILE_BUILD_MACOS_APPLE_SILICON=ON"
|
||||||
|
# Don't bundle qt qml files, relevant really only for darwin, but we set
|
||||||
|
# this for all platforms anyway.
|
||||||
|
"-DMUE_COMPILE_INSTALL_QTQML_FILES=OFF"
|
||||||
];
|
];
|
||||||
|
|
||||||
qtWrapperArgs = [
|
qtWrapperArgs = [
|
||||||
# MuseScore JACK backend loads libjack at runtime.
|
# MuseScore JACK backend loads libjack at runtime.
|
||||||
"--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libjack2 ]}"
|
"--prefix ${lib.optionalString stdenv.isDarwin "DY"}LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libjack2 ]}"
|
||||||
|
] ++ lib.optionals (!stdenv.isDarwin) [
|
||||||
# There are some issues with using the wayland backend, see:
|
# There are some issues with using the wayland backend, see:
|
||||||
# https://musescore.org/en/node/321936
|
# https://musescore.org/en/node/321936
|
||||||
"--set-default QT_QPA_PLATFORM xcb"
|
"--set-default QT_QPA_PLATFORM xcb"
|
||||||
];
|
];
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake pkg-config ninja ];
|
# HACK `propagatedSandboxProfile` does not appear to actually propagate the
|
||||||
|
# sandbox profile from `qtbase`, see:
|
||||||
|
# https://github.com/NixOS/nixpkgs/issues/237458
|
||||||
|
sandboxProfile = toString qtbase.__propagatedSandboxProfile or null;
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
wrapQtAppsHook
|
||||||
|
cmake
|
||||||
|
pkg-config
|
||||||
|
ninja
|
||||||
|
];
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
alsa-lib libjack2 freetype lame libogg libpulseaudio libsndfile libvorbis
|
libjack2
|
||||||
portaudio portmidi flac # tesseract
|
freetype
|
||||||
qtbase qtdeclarative qtgraphicaleffects qtquickcontrols2
|
lame
|
||||||
qtscript qtsvg qttools qtwebengine qtxmlpatterns qtnetworkauth qtx11extras
|
libogg
|
||||||
|
libpulseaudio
|
||||||
|
libsndfile
|
||||||
|
libvorbis
|
||||||
|
portaudio'
|
||||||
|
portmidi
|
||||||
|
flac
|
||||||
|
qtbase
|
||||||
|
qtdeclarative
|
||||||
|
qtgraphicaleffects
|
||||||
|
qtquickcontrols
|
||||||
|
qtquickcontrols2
|
||||||
|
qtscript
|
||||||
|
qtsvg
|
||||||
|
qtxmlpatterns
|
||||||
|
qtnetworkauth
|
||||||
|
qtx11extras
|
||||||
|
] ++ lib.optionals stdenv.isLinux [
|
||||||
|
alsa-lib
|
||||||
];
|
];
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
# Remove unneeded bundled libraries and headers
|
||||||
|
rm -r $out/{include,lib}
|
||||||
|
'' + lib.optionalString stdenv.isDarwin ''
|
||||||
|
mkdir -p "$out/Applications"
|
||||||
|
mv "$out/mscore.app" "$out/Applications/mscore.app"
|
||||||
|
mkdir -p $out/bin
|
||||||
|
ln -s $out/Applications/mscore.app/Contents/MacOS/mscore $out/bin/mscore.
|
||||||
|
'';
|
||||||
|
|
||||||
passthru.tests = nixosTests.musescore;
|
passthru.tests = nixosTests.musescore;
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
@ -57,9 +145,9 @@ mkDerivation rec {
|
|||||||
homepage = "https://musescore.org/";
|
homepage = "https://musescore.org/";
|
||||||
license = licenses.gpl3Only;
|
license = licenses.gpl3Only;
|
||||||
maintainers = with maintainers; [ vandenoever turion doronbehar ];
|
maintainers = with maintainers; [ vandenoever turion doronbehar ];
|
||||||
# Darwin requires CoreMIDI from SDK 11.3, we use the upstream built .dmg
|
# on aarch64-linux:
|
||||||
# file in ./darwin.nix in the meantime.
|
# error: cannot convert '<brace-enclosed initializer list>' to 'float32x4_t' in assignment
|
||||||
platforms = platforms.linux;
|
broken = (stdenv.isLinux && stdenv.isAarch64);
|
||||||
mainProgram = "mscore";
|
mainProgram = "mscore";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -33441,12 +33441,7 @@ with pkgs;
|
|||||||
autoreconfHook = buildPackages.autoreconfHook269;
|
autoreconfHook = buildPackages.autoreconfHook269;
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO: we should probably merge these 2
|
musescore = libsForQt5.callPackage ../applications/audio/musescore { };
|
||||||
musescore =
|
|
||||||
if stdenv.isDarwin then
|
|
||||||
callPackage ../applications/audio/musescore/darwin.nix { }
|
|
||||||
else
|
|
||||||
libsForQt5.callPackage ../applications/audio/musescore { };
|
|
||||||
|
|
||||||
music-player = callPackage ../applications/audio/music-player { };
|
music-player = callPackage ../applications/audio/music-player { };
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user