about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/audio/musescore
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/audio/musescore')
-rw-r--r--nixpkgs/pkgs/applications/audio/musescore/darwin.nix37
-rw-r--r--nixpkgs/pkgs/applications/audio/musescore/default.nix54
-rw-r--r--nixpkgs/pkgs/applications/audio/musescore/remove_qtwebengine_install_hack.patch19
3 files changed, 110 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/audio/musescore/darwin.nix b/nixpkgs/pkgs/applications/audio/musescore/darwin.nix
new file mode 100644
index 000000000000..131417293207
--- /dev/null
+++ b/nixpkgs/pkgs/applications/audio/musescore/darwin.nix
@@ -0,0 +1,37 @@
+{ stdenv, lib, fetchurl, undmg }:
+
+let
+  versionComponents = [ "2" "1" ];
+  appName = "MuseScore ${builtins.head versionComponents}";
+in
+
+with lib;
+
+stdenv.mkDerivation rec {
+  pname = "musescore-darwin";
+  version = concatStringsSep "." versionComponents;
+
+  # The disk image contains the .app and a symlink to /Applications.
+  sourceRoot = "${appName}.app";
+
+  src = fetchurl {
+    url =  "ftp://ftp.osuosl.org/pub/musescore/releases/MuseScore-${concatStringsSep "." (take 3 versionComponents)}/MuseScore-${version}.dmg";
+    sha256 = "19xkaxlkbrhvfip6n3iw6q7463ngr6y5gfisrpjqg2xl2igyl795";
+  };
+
+  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.gpl2;
+    platforms = platforms.darwin;
+    maintainers = [];
+    repositories.git = "https://github.com/musescore/MuseScore";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/audio/musescore/default.nix b/nixpkgs/pkgs/applications/audio/musescore/default.nix
new file mode 100644
index 000000000000..c2a2e7b96031
--- /dev/null
+++ b/nixpkgs/pkgs/applications/audio/musescore/default.nix
@@ -0,0 +1,54 @@
+{ mkDerivation, lib, fetchFromGitHub, cmake, pkg-config
+, alsa-lib, freetype, libjack2, lame, libogg, libpulseaudio, libsndfile, libvorbis
+, portaudio, portmidi, qtbase, qtdeclarative, qtgraphicaleffects
+, qtquickcontrols2, qtscript, qtsvg, qttools
+, qtwebengine, qtxmlpatterns
+, nixosTests
+}:
+
+mkDerivation rec {
+  pname = "musescore";
+  version = "3.6.2";
+
+  src = fetchFromGitHub {
+    owner = "musescore";
+    repo = "MuseScore";
+    rev = "v${version}";
+    sha256 = "sha256-GBGAD/qdOhoNfDzI+O0EiKgeb86GFJxpci35T6tZ+2s=";
+  };
+
+  patches = [
+    ./remove_qtwebengine_install_hack.patch
+  ];
+
+  cmakeFlags = [
+    "-DMUSESCORE_BUILD_CONFIG=release"
+    "-DUSE_SYSTEM_FREETYPE=ON"
+  ];
+
+  qtWrapperArgs = [
+    # Work around crash on update from 3.4.2 to 3.5.0
+    # https://bugreports.qt.io/browse/QTBUG-85967
+    "--set QML_DISABLE_DISK_CACHE 1"
+  ];
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  buildInputs = [
+    alsa-lib libjack2 freetype lame libogg libpulseaudio libsndfile libvorbis
+    portaudio portmidi # tesseract
+    qtbase qtdeclarative qtgraphicaleffects qtquickcontrols2
+    qtscript qtsvg qttools qtwebengine qtxmlpatterns
+  ];
+
+  passthru.tests = nixosTests.musescore;
+
+  meta = with lib; {
+    description = "Music notation and composition software";
+    homepage = "https://musescore.org/";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ vandenoever turion ];
+    platforms = platforms.linux;
+    repositories.git = "https://github.com/musescore/MuseScore";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/audio/musescore/remove_qtwebengine_install_hack.patch b/nixpkgs/pkgs/applications/audio/musescore/remove_qtwebengine_install_hack.patch
new file mode 100644
index 000000000000..57a6092d5852
--- /dev/null
+++ b/nixpkgs/pkgs/applications/audio/musescore/remove_qtwebengine_install_hack.patch
@@ -0,0 +1,19 @@
+--- a/main/CMakeLists.txt
++++ b/main/CMakeLists.txt
+@@ -220,16 +219,0 @@ else (MINGW)
+-      ## install qwebengine core
+-      if (NOT APPLE AND USE_WEBENGINE)
+-         install(PROGRAMS
+-            ${QT_INSTALL_LIBEXECS}/QtWebEngineProcess
+-            DESTINATION bin
+-            )
+-         install(DIRECTORY
+-            ${QT_INSTALL_DATA}/resources
+-            DESTINATION lib/qt5
+-            )
+-         install(DIRECTORY
+-            ${QT_INSTALL_TRANSLATIONS}/qtwebengine_locales
+-            DESTINATION lib/qt5/translations
+-            )
+-      endif(NOT APPLE AND USE_WEBENGINE)
+-