unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Giacomo Leidi <goodoldpaul@autistici.org>
To: 41053@debbugs.gnu.org
Cc: Giacomo Leidi <goodoldpaul@autistici.org>
Subject: [bug#41053] [PATCH 1/2] gnu: Add ableton-link.
Date: Tue,  5 May 2020 22:27:15 +0200	[thread overview]
Message-ID: <20200505202716.1481-1-goodoldpaul@autistici.org> (raw)
In-Reply-To: <7ab14d0b64acca502e134f57bd1c4ac9@autistici.org>

* gnu/packages/audio.scm (ableton-link): New variable.
* gnu/packages/patches/ableton-link-system-libraries-debian.patch: Patch
CMakeLists.txt to use system libraries.
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk                                  |   1 +
 gnu/packages/audio.scm                        | 102 ++++++++++++++++++
 ...ableton-link-system-libraries-debian.patch |  29 +++++
 3 files changed, 132 insertions(+)
 create mode 100644 gnu/packages/patches/ableton-link-system-libraries-debian.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 4e0521baa5..a949301b5b 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -725,6 +725,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/a2ps-CVE-2014-0466.patch	\
   %D%/packages/patches/a2ps-CVE-2015-8107.patch	\
   %D%/packages/patches/abcl-fix-build-xml.patch	\
+  %D%/packages/patches/ableton-link-system-libraries-debian.patch	\
   %D%/packages/patches/abiword-explictly-cast-bools.patch	\
   %D%/packages/patches/adb-add-libraries.patch			\
   %D%/packages/patches/aegis-constness-error.patch         	\
diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm
index 3a452f1458..922df4b356 100644
--- a/gnu/packages/audio.scm
+++ b/gnu/packages/audio.scm
@@ -88,6 +88,7 @@
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages music)
   #:use-module (gnu packages ncurses)
+  #:use-module (gnu packages networking)
   #:use-module (gnu packages onc-rpc)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
@@ -4283,3 +4284,104 @@ between 700 and 3200 bit/s.  The main application is low bandwidth HF/VHF
 digital radio.")
     (home-page "https://www.rowetel.com/?page_id=452")
     (license license:lgpl2.1)))
+
+(define-public ableton-link
+  (package
+    (name "ableton-link")
+    (version "3.0.2")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/Ableton/link.git")
+                    (commit (string-append "Link-" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0262vm0v7hmqjhqx5xikh529p3c065p1yld6ymaiz74yq1dnnjir"))
+              (modules '((guix build utils)))
+              (patches
+               (search-patches "ableton-link-system-libraries-debian.patch"))
+              (snippet
+               '(begin
+                  ;; Tests assume that CMake's "build" directory is a
+                  ;; sub-directory of the source tree, so we fix it.
+                  (substitute* "ci/run-tests.py"
+                    (("root_dir,") "root_dir, os.pardir,"))
+                  ;; Unbundle dependencies.
+                  (delete-file-recursively "third_party")
+                  (delete-file-recursively "modules")
+                  #t))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("catch" ,catch-framework)
+       ("python" ,python)       ;for running tests
+       ("portaudio" ,portaudio) ;for portaudio examples
+       ("qtbase" ,qtbase)       ;for Qt examples
+       ("qtdeclarative" ,qtdeclarative)
+       ("qttools" ,qttools)))
+    (inputs
+     `(("jack" ,jack-1)                       ;for JACK examples
+       ("qtquickcontrols" ,qtquickcontrols))) ;for Qt examples
+    (propagated-inputs
+     ;; This is because include/ableton/platforms/asio/AsioWrapper.hpp
+     ;; contains '#include <asio.hpp>'.
+     `(("asio" ,asio)))
+    (arguments
+     `(#:configure-flags
+       '("-DLINK_BUILD_QT_EXAMPLES=ON"
+         "-DLINK_BUILD_JACK=ON")
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let* ((python (string-append (assoc-ref inputs "python")
+                                          "/bin/python3"))
+                   (run-tests (string-append "../ableton-link-"
+                                             ,version
+                                             "-checkout/ci/run-tests.py")))
+               (invoke python run-tests "--target" "LinkCoreTest")
+               (invoke python run-tests "--target" "LinkDiscoveryTest"))))
+         (add-before 'install 'patch-cmake
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let* ((source (string-append "../ableton-link-"
+                                                ,version
+                                                "-checkout/")))
+               (substitute* (string-append source
+                                           "cmake_include/AsioStandaloneConfig.cmake")
+                 (((string-append "\\$\\{CMAKE_CURRENT_LIST_DIR\\}/\\.\\./"
+                                  "modules/asio-standalone/asio/include"))
+                  (string-append (assoc-ref inputs "asio")
+                                 "/include")))
+               (substitute* (string-append source "AbletonLinkConfig.cmake")
+                 (("\\$\\{CMAKE_CURRENT_LIST_DIR\\}/include")
+                  "${CMAKE_CURRENT_LIST_DIR}/../../../include")
+                 (("\\$\\{CMAKE_CURRENT_LIST_DIR\\}/include/ableton/Link\\.hpp")
+                  "${CMAKE_CURRENT_LIST_DIR}/../../../include/ableton/Link.hpp"))
+               #t)))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin (string-append out "/bin"))
+                    (lib-cmake (string-append out "/lib/cmake/ableton-link"))
+                    (source (string-append "../ableton-link-" ,version "-checkout")))
+               (for-each (lambda (test-file)
+                           (delete-file test-file))
+                         '("bin/LinkDiscoveryTest" "bin/LinkCoreTest"))
+               (copy-recursively "bin" bin)
+               (copy-recursively (string-append source "/include/ableton")
+                                 (string-append out "/include/ableton"))
+               (install-file (string-append source "/AbletonLinkConfig.cmake")
+                             lib-cmake)
+               (install-file (string-append source
+                                            "/cmake_include/AsioStandaloneConfig.cmake")
+                             (string-append lib-cmake "/cmake_include"))
+               #t))))))
+    (home-page "https://github.com/Ableton/link")
+    (synopsis "Synchronize musical beat, tempo, and phase across multiple applications")
+    (description
+     "Ableton Link is a C++ library that synchronizes musical beat, tempo, and phase
+across multiple applications running on one or more devices.  Applications on devices
+connected to a local network discover each other automatically and form a musical
+session in which each participant can perform independently: anyone can start or stop
+while still staying in time.")
+    (license license:gpl2+)))
diff --git a/gnu/packages/patches/ableton-link-system-libraries-debian.patch b/gnu/packages/patches/ableton-link-system-libraries-debian.patch
new file mode 100644
index 0000000000..184896ee61
--- /dev/null
+++ b/gnu/packages/patches/ableton-link-system-libraries-debian.patch
@@ -0,0 +1,29 @@
+This patch was borrowed from Debian's package:
+https://salsa.debian.org/multimedia-team/ableton-link/-/blob/9c65141bf5bba0872811c179af77ac95770352cc/debian/patches/DEBIAN_system_libraries.patch
+Description: Drop dependencies on included 3rd-party libs
+ upstream includes git-submodules for Catch and ASIO (not found in the tarball).
+ on Debian we want to use the system provided libraries.
+Author: IOhannes m zmölnig
+Origin: Debian
+Forwarded: not-needed
+Last-Update: 2016-10-26
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- ableton-link.orig/cmake_include/AsioStandaloneConfig.cmake
++++ ableton-link/cmake_include/AsioStandaloneConfig.cmake
+@@ -1,6 +1,2 @@
+ add_library(AsioStandalone::AsioStandalone IMPORTED INTERFACE)
+ 
+-set_property(TARGET AsioStandalone::AsioStandalone APPEND PROPERTY
+-  INTERFACE_INCLUDE_DIRECTORIES
+-  ${CMAKE_CURRENT_LIST_DIR}/../modules/asio-standalone/asio/include
+-)
+--- ableton-link.orig/cmake_include/CatchConfig.cmake
++++ ableton-link/cmake_include/CatchConfig.cmake
+@@ -1,6 +1,2 @@
+ add_library(Catch::Catch IMPORTED INTERFACE)
+ 
+-set_property(TARGET Catch::Catch APPEND PROPERTY
+-  INTERFACE_INCLUDE_DIRECTORIES
+-  ${CMAKE_SOURCE_DIR}/third_party/catch
+-)
-- 
2.26.2





  parent reply	other threads:[~2020-05-05 20:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-03 16:03 [bug#41053] [PATCH] gnu: supercollider: Update to 3.11.0 goodoldpaul
2020-05-03 16:06 ` [bug#41053] [PATCH 1/2] gnu: Add ableton-link Giacomo Leidi
2020-05-03 16:06   ` [bug#41053] [PATCH 2/2] gnu: supercollider: Update to 3.11.0 Giacomo Leidi
2020-05-05 17:39     ` Marius Bakke
2020-05-05 20:19       ` goodoldpaul
2020-05-06 20:44         ` bug#41053: " Marius Bakke
2020-05-05 17:34   ` [bug#41053] [PATCH 1/2] gnu: Add ableton-link Marius Bakke
2020-05-05 20:19     ` goodoldpaul
2020-05-05 20:27 ` Giacomo Leidi [this message]
2020-05-05 20:27   ` [bug#41053] [PATCH 2/2] gnu: supercollider: Update to 3.11.0 Giacomo Leidi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200505202716.1481-1-goodoldpaul@autistici.org \
    --to=goodoldpaul@autistici.org \
    --cc=41053@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).