diff mbox series

[bug#51085,7/7] gnu: Add mixxx.

Message ID 20211007142941.46591-7-monego@posteo.net
State Accepted
Headers show
Series Add Mixxx. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Vinicius Monego Oct. 7, 2021, 2:29 p.m. UTC
* gnu/packages/music.scm (mixxx): New variable.
* gnu/packages/patches/mixxx-link-qtscriptbytearray-qtscript.patch: New
patch.
* gnu/packages/patches/mixxx-system-googletest-benchmark.patch: New patch.
* gnu/local.mk (dist_patch_DATA): Add patches.
---
 gnu/local.mk                                  |   2 +
 gnu/packages/music.scm                        | 116 ++++++++++++++++++
 ...ixxx-link-qtscriptbytearray-qtscript.patch |  25 ++++
 .../mixxx-system-googletest-benchmark.patch   |  43 +++++++
 4 files changed, 186 insertions(+)
 create mode 100644 gnu/packages/patches/mixxx-link-qtscriptbytearray-qtscript.patch
 create mode 100644 gnu/packages/patches/mixxx-system-googletest-benchmark.patch
diff mbox series

Patch

diff --git a/gnu/local.mk b/gnu/local.mk
index d415b892e9..36ed1bb755 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1476,6 +1476,8 @@  dist_patch_DATA =						\
   %D%/packages/patches/minisat-install.patch			\
   %D%/packages/patches/mit-krb5-hurd.patch			\
   %D%/packages/patches/mit-krb5-qualify-short-hostnames.patch	\
+  %D%/packages/patches/mixxx-link-qtscriptbytearray-qtscript.patch	\
+  %D%/packages/patches/mixxx-system-googletest-benchmark.patch	\
   %D%/packages/patches/mpc123-initialize-ao.patch		\
   %D%/packages/patches/mpg321-CVE-2019-14247.patch		\
   %D%/packages/patches/module-init-tools-moduledir.patch	\
diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index ae4626dc8a..759b56d5e0 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -71,6 +71,7 @@ 
   #:use-module (guix build-system meson)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module (guix build-system scons)
   #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system qt)
@@ -88,6 +89,7 @@ 
   #:use-module (gnu packages backup)
   #:use-module (gnu packages base) ;libbdf
   #:use-module (gnu packages bash)
+  #:use-module (gnu packages benchmark)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages build-tools)
@@ -2219,6 +2221,120 @@  Editor.  It is compatible with Power Tab Editor 1.7 and Guitar Pro.")
 users to select LV2 plugins and run them with jalv.")
     (license license:public-domain)))
 
+(define-public mixxx
+  (package
+    (name "mixxx")
+    (version "2.3.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/mixxxdj/mixxx")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (patches
+        (search-patches "mixxx-link-qtscriptbytearray-qtscript.patch"
+                        "mixxx-system-googletest-benchmark.patch"))
+       (sha256
+        (base32 "04781s4ajdlwgvf12v2mvh6ia5grhc5pn9d75b468qci3ilnmkg8"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         ;; Delete libraries that we already have or don't need.
+         (add-after 'unpack 'delete-third-parties
+           (lambda _
+             (let ((third-parties '("apple" "benchmark" "googletest" "hidapi"
+                                    "libebur128")))
+               (with-directory-excursion "lib"
+                 (map (lambda (third-party)
+                        (delete-file-recursively third-party))
+                      third-parties)))))
+         ;; Tests need a running X server.
+         (add-before 'check 'prepare-x-for-test
+           (lambda _
+             (system "Xvfb &")
+             (setenv "DISPLAY" ":0")))
+         (replace 'check
+           (lambda* (#:key tests? #:allow-other-keys)
+             (when tests?
+               ;; This test fails.  I don't know why.
+               (invoke "ctest" "-E" "TagLibTest.WriteID3v2Tag"))))
+         (add-after 'install 'wrap-executable
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (faad2 (assoc-ref inputs "faad2")))
+               (wrap-program (string-append out "/bin/mixxx")
+                 `("LD_LIBRARY_PATH" ":" prefix
+                   ,(list (string-append faad2 "/lib"))))))))))
+    (native-inputs
+     `(("benchmark" ,benchmark)
+       ("googletest" ,googletest)
+       ("python" ,python-wrapper)
+       ("qttools" ,qttools)
+       ("xorg-server" ,xorg-server-for-tests)))
+    (inputs
+     `(("bash" ,bash-minimal)
+       ("chromaprint" ,chromaprint)
+       ("faad2" ,faad2)
+       ("ffmpeg" ,ffmpeg)
+       ("fftw" ,fftw)
+       ("flac" ,flac)
+       ("glu" ,glu)
+       ("hidapi" ,hidapi)
+       ("jack" ,jack-1)
+       ("lame" ,lame)
+       ("libdjinterop" ,libdjinterop)
+       ("libebur128" ,libebur128)
+       ("libid3tag" ,libid3tag)
+       ("libkeyfinder" ,libkeyfinder)
+       ("libmad" ,libmad)
+       ("libmp4v2" ,libmp4v2)
+       ("libmodplug" ,libmodplug)
+       ("libsndfile" ,libsndfile)
+       ("libshout" ,libshout)
+       ;; TODO: Mixxx requires libshout-idjc >= 2.4.6 which was not released
+       ;; at the time of packaging.
+       ;; ("libshout-idjc" ,libshout-idjc)
+       ("libusb" ,libusb)
+       ("libvorbis" ,libvorbis)
+       ("lilv" ,lilv)
+       ("mp3guessenc" ,mp3guessenc)
+       ("openssl" ,openssl)
+       ("opus" ,opus) ;for opus_multistream.h
+       ("opusfile" ,opusfile)
+       ("portaudio" ,portaudio)
+       ("portmidi" ,portmidi)
+       ("protobuf" ,protobuf)
+       ("qtbase" ,qtbase-5)
+       ("qtdeclarative" ,qtdeclarative)
+       ("qtkeychain" ,qtkeychain)
+       ("qtscript" ,qtscript)
+       ("qtsvg" ,qtsvg)
+       ("qtx11extras" ,qtx11extras)
+       ("rubberband" ,rubberband)
+       ("soundtouch" ,soundtouch)
+       ("sqlite" ,sqlite)
+       ("taglib" ,taglib)
+       ("upower" ,upower)
+       ("vamp" ,vamp)
+       ("wavpack" ,wavpack)))
+    (home-page "https://www.mixxx.org/")
+    (synopsis "DJ software to perform live mixes")
+    (description "Mixxx integrates the tools DJs need to perform creative live
+mixes with digital music files.
+
+Whether you are a new DJ with just a laptop or an experienced turntablist,
+Mixxx can support your style and techniques of mixing.")
+    ;; TODO: Try to unbundle some of these (see lib/).
+    (license (list license:gpl2+ ; Mixxx, fidlib, qm-dsp
+                   license:gpl2 ; xwax
+                   license:gpl3+ ; reverb
+                   license:expat ; kaitai, scspqueue, portaudio
+                   license:bsd-3 ; qtbytescriptarray
+                   license:lgpl2.1+ ; replaygain, mp3guessenc
+                   license:lgpl2.0+)))) ; libshout-idjc (Library, not Lesser)
+
 (define-public synthv1
   (package
     (name "synthv1")
diff --git a/gnu/packages/patches/mixxx-link-qtscriptbytearray-qtscript.patch b/gnu/packages/patches/mixxx-link-qtscriptbytearray-qtscript.patch
new file mode 100644
index 0000000000..d7cd1c0d28
--- /dev/null
+++ b/gnu/packages/patches/mixxx-link-qtscriptbytearray-qtscript.patch
@@ -0,0 +1,25 @@ 
+From 7554aefc886d4ebc4b4c139a5cddcab6163cf72f Mon Sep 17 00:00:00 2001
+From: Vinicius Monego <monego@posteo.net>
+Date: Thu, 30 Sep 2021 23:37:29 -0300
+Subject: [PATCH] Link QtScriptByteArray with QtScript.
+
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 492ccae..05fec08 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -2077,7 +2077,7 @@ add_library(QtScriptByteArray STATIC EXCLUDE_FROM_ALL
+   lib/qtscript-bytearray/bytearrayprototype.cpp
+ )
+ set_target_properties(QtScriptByteArray PROPERTIES AUTOMOC ON)
+-target_link_libraries(QtScriptByteArray Qt5::Core)
++target_link_libraries(QtScriptByteArray Qt5::Core Qt5::Script)
+ target_include_directories(mixxx-lib SYSTEM PUBLIC lib/qtscript-bytearray)
+ target_link_libraries(mixxx-lib PRIVATE QtScriptByteArray)
+ 
+-- 
+2.30.2
+
diff --git a/gnu/packages/patches/mixxx-system-googletest-benchmark.patch b/gnu/packages/patches/mixxx-system-googletest-benchmark.patch
new file mode 100644
index 0000000000..7adbe66208
--- /dev/null
+++ b/gnu/packages/patches/mixxx-system-googletest-benchmark.patch
@@ -0,0 +1,43 @@ 
+From eb2079d467f8658eea13e2ed86cc69d864632866 Mon Sep 17 00:00:00 2001
+From: Vinicius Monego <monego@posteo.net>
+Date: Wed, 29 Sep 2021 19:07:35 -0300
+Subject: [PATCH] Use system googletest and benchmark.
+
+---
+ CMakeLists.txt | 13 +++----------
+ 1 file changed, 3 insertions(+), 10 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 10e9b0a..492ccae 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1467,12 +1467,7 @@ set(gtest_force_shared_crt ON CACHE BOOL "Pass Mixxx compiler/linker options to
+ # Prevent installation of GoogleTest libraries
+ set(INSTALL_GTEST OFF CACHE BOOL "Disable installation of GoogleTest" FORCE)
+ 
+-# Add googletest directly to our build. This adds the following targets:
+-# gtest, gtest_main, gmock and gmock_main
+-add_subdirectory(
+-  "${CMAKE_CURRENT_SOURCE_DIR}/lib/googletest"
+-  "${CMAKE_CURRENT_BINARY_DIR}/lib/googletest"
+-)
++find_package(GTest CONFIG REQUIRED)
+ 
+ add_executable(mixxx-test
+   src/test/analyserwaveformtest.cpp
+@@ -1582,10 +1577,8 @@ set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "" FORCE)
+ # Prevent installation of google/benchmark artifacts
+ set(BENCHMARK_ENABLE_INSTALL OFF CACHE BOOL "Disable installation of google/benchmark" FORCE)
+ 
+-add_subdirectory(
+-  "${CMAKE_CURRENT_SOURCE_DIR}/lib/benchmark"
+-  "${CMAKE_CURRENT_BINARY_DIR}/lib/benchmark"
+-)
++find_package(benchmark CONFIG REQUIRED)
++
+ target_link_libraries(mixxx-test PRIVATE benchmark)
+ 
+ # Test Suite
+-- 
+2.30.2
+