diff mbox series

[bug#40440,2/3] gnu: Add mruby-zest.

Message ID dfcc38290135d0438a9d322426e7d0d3628a7195.camel@zrythm.org
State Work in progress
Headers show
Series [bug#40439,1/3] gnu: Add libuv-static. | expand

Checks

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

Commit Message

Alexandros Theodotou April 4, 2020, 9:10 p.m. UTC
Hi,

This patch adds mruby-zest, a dependency of zynfusion. I had some help
from the developer for making it build without connecting to the
internet.

Thanks,
Alex

Comments

Christopher Baines April 14, 2020, 6:41 p.m. UTC | #1
Alexandros Theodotou <alex@zrythm.org> writes:

> This patch adds mruby-zest, a dependency of zynfusion. I had some help
> from the developer for making it build without connecting to the
> internet.

Hey Alex,

Thanks for taking the time to package mruby-zest.

> +(define-public mruby-zest
> +  (package
> +    (name "mruby-zest")
> +    (version "3.0.5-ba39aabd")
> +    (source
> +      (origin
> +        (method git-fetch)
> +        (uri (git-reference
> +               ;; this is a meta repo that packs the mruby dependencies
> +               ;; as submodules
> +               (url "https://github.com/mruby-zest/mruby-zest-build.git")
> +               ;; ghaction branch - suggested by the developer to avoid
> +               ;; automatic downloading of some unneeded and
> +               ;; hard-to-package dependencies used for debugging
> +               (commit  "ba39aabd8d4ddc5f14137083b6f9a96c536f5f12")
> +               (recursive? #t)))

So I spotted the use of a "deps" directory, which is a bad sign, as
dependencies should be other packages, not things as part of this
package.

I then spotted that the source for this package isn't the upstream Git
repository, but a Git repository that pulls together the mruby-zest
source code, with code from ~16 other Git repositories.

Would it be possible to create Guix packages for these dependencies?

I know that would involve quite a bit of work, but unfortunately that
kind of work is necessary to ensure Guix as a collection of packages can
be maintained in the long term.

> +        (file-name (git-file-name name version))
> +        (sha256
> +         (base32
> +          "1vqzdds30sr982dp7fclg4r19l44rv8pbz6h4a8vcginj494gvjn"))))
Alexandros Theodotou April 14, 2020, 6:48 p.m. UTC | #2
Hi Christopher,

Thanks for the review.

It would indeed be best to package each dependency first, but I don't
really have time to package all those dependencies, and I also don't
have much knowledge about ruby. If someone else is willing to do it,
please go ahead.

Thanks,
Alex

On Tue, 2020-04-14 at 19:41 +0100, Christopher Baines wrote:
> Alexandros Theodotou <alex@zrythm.org> writes:
> 
> > This patch adds mruby-zest, a dependency of zynfusion. I had some
> > help
> > from the developer for making it build without connecting to the
> > internet.
> 
> Hey Alex,
> 
> Thanks for taking the time to package mruby-zest.
> 
> > +(define-public mruby-zest
> > +  (package
> > +    (name "mruby-zest")
> > +    (version "3.0.5-ba39aabd")
> > +    (source
> > +      (origin
> > +        (method git-fetch)
> > +        (uri (git-reference
> > +               ;; this is a meta repo that packs the mruby
> > dependencies
> > +               ;; as submodules
> > +               (url "
> > https://github.com/mruby-zest/mruby-zest-build.git")
> > +               ;; ghaction branch - suggested by the developer to
> > avoid
> > +               ;; automatic downloading of some unneeded and
> > +               ;; hard-to-package dependencies used for debugging
> > +               (commit  "ba39aabd8d4ddc5f14137083b6f9a96c536f5f12"
> > )
> > +               (recursive? #t)))
> 
> So I spotted the use of a "deps" directory, which is a bad sign, as
> dependencies should be other packages, not things as part of this
> package.
> 
> I then spotted that the source for this package isn't the upstream
> Git
> repository, but a Git repository that pulls together the mruby-zest
> source code, with code from ~16 other Git repositories.
> 
> Would it be possible to create Guix packages for these dependencies?
> 
> I know that would involve quite a bit of work, but unfortunately that
> kind of work is necessary to ensure Guix as a collection of packages
> can
> be maintained in the long term.
> 
> > +        (file-name (git-file-name name version))
> > +        (sha256
> > +         (base32
> > +          "1vqzdds30sr982dp7fclg4r19l44rv8pbz6h4a8vcginj494gvjn"))
> > ))
diff mbox series

Patch

From fd6550f32f534591cb6aba4b9575bae405bc1094 Mon Sep 17 00:00:00 2001
From: Alexandros Theodotou <alex@zrythm.org>
Date: Sat, 4 Apr 2020 22:03:31 +0100
Subject: [PATCH 2/3] gnu: Add mruby-zest.

* gnu/packages/audio.scm (mruby-zest): New variable.
---
 gnu/packages/audio.scm | 93 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 93 insertions(+)

diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm
index f368fedee7..99f3737ed2 100644
--- a/gnu/packages/audio.scm
+++ b/gnu/packages/audio.scm
@@ -66,6 +66,7 @@ 
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages gettext)
+  #:use-module (gnu packages gl)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnome)
   #:use-module (gnu packages gnunet) ; libmicrohttpd
@@ -75,6 +76,7 @@ 
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
   #:use-module (gnu packages libbsd)
+  #:use-module (gnu packages libevent)
   #:use-module (gnu packages libusb)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -93,6 +95,7 @@ 
   #:use-module (gnu packages qt)
   #:use-module (gnu packages rdf)
   #:use-module (gnu packages readline)
+  #:use-module (gnu packages ruby)
   #:use-module (gnu packages sdl)
   #:use-module (gnu packages serialization)
   #:use-module (gnu packages telephony)
@@ -4160,3 +4163,93 @@  minimum.")
      `(("librsvg" ,librsvg)
        ,@(package-inputs ztoolkit)))
     (synopsis "ZToolkit with SVG support")))
+
+(define-public mruby-zest
+  (package
+    (name "mruby-zest")
+    (version "3.0.5-ba39aabd")
+    (source
+      (origin
+        (method git-fetch)
+        (uri (git-reference
+               ;; this is a meta repo that packs the mruby dependencies
+               ;; as submodules
+               (url "https://github.com/mruby-zest/mruby-zest-build.git")
+               ;; ghaction branch - suggested by the developer to avoid
+               ;; automatic downloading of some unneeded and
+               ;; hard-to-package dependencies used for debugging
+               (commit  "ba39aabd8d4ddc5f14137083b6f9a96c536f5f12")
+               (recursive? #t)))
+        (file-name (git-file-name name version))
+        (sha256
+         (base32
+          "1vqzdds30sr982dp7fclg4r19l44rv8pbz6h4a8vcginj494gvjn"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f ; no check target
+       #:make-flags
+       (list (string-append "CC=gcc"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'use-installed-libuv
+          (lambda* (#:key inputs outputs #:allow-other-keys)
+            (let* ((libuv (assoc-ref inputs "libuv-static")))
+              (copy-file (string-append libuv "/lib/libuv.a")
+                         "deps/libuv.a")
+              (substitute* "Makefile"
+                           (("\\.\\./\\.\\./deps/\\$\\(UV_DIR\\)/include")
+                            (string-append libuv "/include")))
+              (substitute* "Makefile"
+                           (("\\./deps/\\$\\(UV_DIR\\)/\\.libs/libuv\\.a")
+                            (string-append libuv "/lib/libuv.a"))))))
+         (add-after 'unpack 'disable-unused-deps
+          (lambda _
+            (substitute* "build_config.rb"
+                         (("conf\\.gem 'deps/mruby-file-stat'")
+                          "#"))
+            (substitute* "deps/mruby-dir-glob/mrbgem.rake"
+                         (("spec\\.add_dependency 'mruby-file-stat'")
+                          "#"))
+            #t))
+         (replace 'configure
+           (lambda _
+             (invoke "make" "builddep")))
+        (add-before 'install 'pack
+          (lambda _
+            (setenv "CC" "gcc")
+            (invoke "make" "pack")))
+         (replace 'install
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out   (assoc-ref outputs "out"))
+                    (lib   (string-append out "/lib/zynfusion")))
+               (mkdir-p lib)
+               (copy-recursively "package" lib)
+               #t)))
+         (add-after 'install 'rename-to-zyn-fusion
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref %outputs "out"))
+                    (lib (string-append out "/lib/zynfusion")))
+               (rename-file (string-append lib "/zest")
+                            ;; zynfusion expects this name
+                            (string-append lib "/zyn-fusion"))
+               #t))))))
+    (inputs
+     `(("libx11" ,libx11)
+       ("cairo" ,cairo)
+       ("mesa" ,mesa)
+       ("libuv-static" ,libuv-static)
+       ("ruby" ,ruby)
+       ("mruby" ,mruby)))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("bison" ,bison)
+       ("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("python-2" ,python-2)))
+    (home-page "https://github.com/mruby-zest/mruby-zest")
+    (synopsis "Widget classes for ZynFusion")
+    (description
+     "MRuby-Zest is a set of widgets needed to create the 'ZynFusion'
+user interface of ZynAddSubFX.")
+    (license license:lgpl2.1+)))
-- 
2.26.0