Subject: [bug#72664] [PATCH] Add uhhyou-plugins package

From: Apoorv <[email-masked]>
Date: Fri, 16 Aug 2024 12:40:21 +0200 (CEST)

This is a patch to add a new package, `uhhyou-plugins` to `gnu/packages/music.scm`.

-- 
 Sent with Tuta; enjoy secure & ad-free emails: 
 https://tuta.com
>From e3a942e088de6f7d408f289dcc319fe916a2bfe8 Mon Sep 17 00:00:00 2001
From: apoorv569 <[email-masked]>
Date: Fri, 16 Aug 2024 15:33:22 +0530
Subject: [PATCH 08/13] Add uhhyou-plugins package

---
 gnu/packages/music.scm | 73 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)

diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index 387901dc09..dedbb7b961 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -8331,6 +8331,79 @@ (define-public cardinal
 being a fully self-contained plugin version.")
      (license license:gpl3))))
 
+(define-public uhhyou-plugins
+  (let ((commit "2450315b739a6889928af5d96d87a07a634b42e3")
+        (revision "1"))
+    (package
+     (name "uhhyou-plugins")
+     (version (git-version "0.62.0" revision commit))
+     (source
+      (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/ryukau/VSTPlugins.git")
+             (recursive? #t)
+             (commit commit)))
+       (sha256
+        (base32 "05pxyrrrr4fhiayj6v7y12zi2b7bd3fg7wyw1jdh9yx9mdgsmzqn"))
+       (file-name (git-file-name name version))))
+     (build-system cmake-build-system)
+     (arguments
+      (list
+       #:tests? #f ;no test target
+       #:configure-flags #~(list "-DSMTG_RUN_VST_VALIDATOR=OFF"
+                                 "-DSMTG_CREATE_PLUGIN_LINK=OFF")
+       #:build-type "Release"
+       #:phases
+       #~(modify-phases
+          %standard-phases
+          (add-before 'configure 'patch-vst3sdk
+                      (lambda* (#:key inputs outputs #:allow-other-keys)
+                        (let* ((src (assoc-ref inputs "source"))
+                               (patch-src
+                                (string-append src "/ci/linux_patch/cairocontext.cpp"))
+                               (patch-dest
+                                (string-append "lib/vst3sdk/vstgui4/vstgui/lib/platform/linux/cairocontext.cpp")))
+                          (copy-file patch-src patch-dest))))
+          ;; no install target
+          (replace 'install
+                   (lambda* (#:key inputs outputs #:allow-other-keys)
+                     (let* ((src (assoc-ref inputs "source"))
+                            (out (assoc-ref outputs "out"))
+                            (bin (string-append out "/bin"))
+                            (vst3 (string-append out "/lib/vst3"))
+                            (doc (string-append out "/share/doc")))
+                       ;; Install VST3s
+                       (for-each
+                        (lambda (file)
+                          (copy-recursively file
+                                            (string-append vst3 "/" (basename file))))
+                        (find-files "VST3/Release" "\\.vst3$"
+                                    #:directories? #t))
+                       ;; install documentation
+                       (with-directory-excursion
+                        (string-append src "/docs")
+                        (for-each
+                         (lambda (file)
+                           (install-file file
+                                         (string-append doc "/" #$name "/" (dirname file))))
+                         (find-files "." "\\.(html|png|svg)")))
+                       #t))))))
+     (inputs (list cairo xcb-util-cursor xcb-util-keysyms xcb-util libxcb))
+     (native-inputs (list freetype
+                          sqlite
+                          fontconfig
+                          gtkmm-3
+                          jack-2
+                          libx11
+                          libxkbcommon
+                          pango
+                          pkg-config))
+     (home-page "https://ryukau.github.io/VSTPlugins")
+     (synopsis "Uhhyou Plugins VST3")
+     (description "Uhhyou Plugins VST3")
+     (license license:gpl3))))
+
 ;;;
 ;;; Avoid adding new packages to the end of this file. To reduce the chances
 ;;; of a merge conflict, place them above by existing packages with similar
-- 
2.45.2