about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/drumstick
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/drumstick')
-rw-r--r--nixpkgs/pkgs/development/libraries/drumstick/default.nix41
-rw-r--r--nixpkgs/pkgs/development/libraries/drumstick/drumstick-fluidsynth.patch9
-rw-r--r--nixpkgs/pkgs/development/libraries/drumstick/drumstick-plugins.patch12
3 files changed, 62 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/drumstick/default.nix b/nixpkgs/pkgs/development/libraries/drumstick/default.nix
new file mode 100644
index 000000000000..21572e52e235
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/drumstick/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchurl
+, cmake, docbook_xml_dtd_45, docbook_xsl, doxygen, pkg-config, wrapQtAppsHook
+, alsaLib, fluidsynth, qtbase, qtsvg, libpulseaudio
+}:
+
+stdenv.mkDerivation rec {
+  pname = "drumstick";
+  version = "1.1.3";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/drumstick/${version}/${pname}-${version}.tar.bz2";
+    sha256 = "1n9wvg79yvkygrkc8xd8pgrd3d7hqmr7gh24dccf0px23lla9b3m";
+  };
+
+  patches = [
+    ./drumstick-fluidsynth.patch
+    ./drumstick-plugins.patch
+  ];
+
+  postPatch = ''
+    substituteInPlace library/rt/backendmanager.cpp --subst-var out
+  '';
+
+  outputs = [ "out" "dev" "man" ];
+
+  nativeBuildInputs = [
+    cmake docbook_xml_dtd_45 docbook_xml_dtd_45 docbook_xsl doxygen pkg-config wrapQtAppsHook
+  ];
+
+  buildInputs = [
+    alsaLib fluidsynth libpulseaudio qtbase qtsvg
+  ];
+
+  meta = with lib; {
+    maintainers = with maintainers; [ solson ];
+    description = "MIDI libraries for Qt5/C++";
+    homepage = "http://drumstick.sourceforge.net/";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/drumstick/drumstick-fluidsynth.patch b/nixpkgs/pkgs/development/libraries/drumstick/drumstick-fluidsynth.patch
new file mode 100644
index 000000000000..b8cdf63fb649
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/drumstick/drumstick-fluidsynth.patch
@@ -0,0 +1,9 @@
+It works with fluidsynth 2.
+
+Backported from r400: https://sourceforge.net/p/drumstick/code/400/
+
+--- a/library/rt-backends/CMakeLists.txt
++++ b/library/rt-backends/CMakeLists.txt
+@@ -54,1 +54,1 @@ if (PKG_CONFIG_FOUND)
+-    pkg_check_modules(FLUIDSYNTH fluidsynth>=1.1.1 fluidsynth<=1.1.11)
++    pkg_check_modules(FLUIDSYNTH fluidsynth>=1.1.1)
diff --git a/nixpkgs/pkgs/development/libraries/drumstick/drumstick-plugins.patch b/nixpkgs/pkgs/development/libraries/drumstick/drumstick-plugins.patch
new file mode 100644
index 000000000000..cbb0a0e34896
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/drumstick/drumstick-plugins.patch
@@ -0,0 +1,12 @@
+Make it look for its plugin in its own installation directory.
+
+--- a/library/rt/backendmanager.cpp
++++ b/library/rt/backendmanager.cpp
+@@ -159,6 +159,7 @@ namespace rt {
+         foreach(const QString& path, QCoreApplication::libraryPaths()) {
+             d->appendDir( path + QDir::separator() + QSTR_DRUMSTICK, result );
+         }
++        d->appendDir( "@out@/lib/drumstick", result );
+         return result;
+     }
+