[bug#74723,18/19] gnu: Add lmms-1.3.

Message ID b5265694094c9f2232c1e387238af87239433f99.1733563475.git.sughosha@disroot.org
State New
Headers
Series gnu: lmms, carla: New features, fixes and updates. |

Commit Message

Sughosha Dec. 7, 2024, 12:20 p.m. UTC
  * gnu/packages/music.scm (lmms-1.3): New variable.

Change-Id: Ia921c482948d6d18d88ef1cba3630a7994fac5a3
---
 gnu/packages/music.scm | 84 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 84 insertions(+)
  

Patch

diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index 5ec58119ff..42688f2eac 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -163,6 +163,7 @@  (define-module (gnu packages music)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages lua)
   #:use-module (gnu packages man)
+  #:use-module (gnu packages maths)
   #:use-module (gnu packages mp3)
   #:use-module (gnu packages mpd)
   #:use-module (gnu packages ncurses)
@@ -213,6 +214,7 @@  (define-module (gnu packages music)
   #:use-module (gnu packages xiph)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
+  #:use-module (ice-9 match)
   #:use-module ((srfi srfi-1) #:select (last)))
 
 (define-public alsa-scarlett-gui
@@ -5374,6 +5376,88 @@  (define-public lmms
 can receive input from a MIDI keyboard.")
     (license license:gpl2+)))
 
+;;; This package variant tracks the latest in-development 1.3 release.
+(define-public lmms-1.3
+  (let ((commit "d9737881cf482e89969948f56da954cbf5c11aca") ;from master branch
+        (revision "0"))
+    (package/inherit lmms
+      (version (git-version "1.3.0-alpha.1" revision commit))
+      (source
+       (origin
+         (inherit (package-source lmms))
+         (uri (git-reference
+                (url "https://github.com/LMMS/lmms")
+                (commit commit)
+                ;; Clone recursively for optional plugins.
+                (recursive? #t)))
+         (file-name (git-file-name (package-name lmms) version))
+         (sha256
+          (base32 "0hscgnbladrkbvv551bv7vzi5949gjhf397j35wghd07hwd2lrb0"))
+         (modules '((guix build utils)))
+         (snippet
+          '(begin
+             ;; Delete the bundled 3rd party libraries.
+             (for-each delete-file-recursively
+               (list "plugins/CarlaBase/carla"
+                     "plugins/OpulenZ/adplug"
+                     "plugins/Xpressive/exprtk"
+                     "src/3rdparty"))
+             (substitute* "CMakeLists.txt"
+               ;; Do not check the submodules.
+               ((".*CheckSubmodules.*") "")
+               ;; Unuse the bundled weakjack.
+               (("JACK libraries\" ON") "JACK libraries\" OFF"))
+             (substitute* "src/CMakeLists.txt"
+               ((".*3rdparty.*") "")
+               ;; Use adplug and ringbuffer from the system.
+               (("\\$\\{EXTRA_LIBRARIES\\}")
+                "${EXTRA_LIBRARIES}\n\tadplug\n\tringbuffer"))
+             (with-directory-excursion "plugins"
+               ;; Use carla from the system.
+               (substitute* "CarlaBase/Carla.h"
+                 (("#include <CarlaDefines")
+                  "#include <carla/includes/CarlaDefines")
+                 (("#include <CarlaNative")
+                  "#include <carla/includes/CarlaNative")
+                 (("#include <CarlaBackend") "#include <carla/CarlaBackend")
+                 (("#include <CarlaUtils") "#include <carla/CarlaUtils"))
+               (with-directory-excursion "OpulenZ"
+                 ;; Unuse the bundled adplug.
+                 (substitute* "CMakeLists.txt"
+                   ((".*adplug .*") "")
+                   ((".*adplug/.*") "")
+                   (("^\\)") "")
+                   (("\\.png\"") ".png\"\n)"))
+                 ;; Use adplug from the system.
+                 (substitute* "OpulenZ.cpp"
+                   (("<opl\\.h>") "<adplug/opl.h>")
+                   (("<temuopl\\.h>") "<adplug/temuopl.h>")
+                   (("<mididata\\.h>") "<adplug/mididata.h>")))
+               ;; Unuse the bundled exprtk.
+               (substitute* "Xpressive/CMakeLists.txt"
+                 ((".*\\(exprtk .*") "")
+                 ((".*xpressive exprtk.*") "")))))))
+      (inputs
+       (modify-inputs (package-inputs lmms)
+         (delete "rpmalloc")
+         (replace "carla" carla)
+         (replace "sdl12-compat" sdl2)
+         (append adplug
+                 exprtk
+                 lame
+                 libxml2
+                 lilv
+                 lv2
+                 perl
+                 perl-list-moreutils
+                 perl-xml-parser
+                 ringbuffer
+                 suil)))
+      (native-search-paths
+       (list (search-path-specification
+              (variable "LV2_PATH")
+              (files '("lib/lv2"))))))))
+
 (define-public stargate
   (package
     (name "stargate")