unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#61594] [PATCH][WIP] gnu: Add norns.
@ 2023-02-18  5:05 Antero Mejr via Guix-patches via
  2023-02-18  5:15 ` [bug#61594] [PATCH] gnu: Add libmonome Antero Mejr via Guix-patches via
  0 siblings, 1 reply; 2+ messages in thread
From: Antero Mejr via Guix-patches via @ 2023-02-18  5:05 UTC (permalink / raw)
  To: 61594; +Cc: Antero Mejr

* gnu/packages/music.scm (norns): New variable.
---
Launches OK, can't fully test because Supercollider/Jack don't work on my
machine currently. I will try to report back with test results and/or a V2
patch, but not sure when that will happen.
Please apply the libmonome patch first when everything is ready.

 gnu/local.mk                                  |   1 +
 gnu/packages/music.scm                        | 109 ++++++++++++++++++
 .../patches/norns-remove-nonfree-fonts.patch  |  41 +++++++
 3 files changed, 151 insertions(+)
 create mode 100644 gnu/packages/patches/norns-remove-nonfree-fonts.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index aaf125ce7b..4f6ce69e85 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1579,6 +1579,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/network-manager-meson.patch		\
   %D%/packages/patches/nginx-socket-cloexec.patch		\
   %D%/packages/patches/nnpack-system-libraries.patch		\
+  %D%/packages/patches/norns-remove-nonfree-fonts.patch		\
   %D%/packages/patches/nsis-env-passthru.patch			\
   %D%/packages/patches/nss-getcwd-nonnull.patch			\
   %D%/packages/patches/nss-increase-test-timeout.patch		\
diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index 7f0e9dd793..9de4faca32 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -95,6 +95,7 @@ (define-module (gnu packages music)
   #:use-module (gnu packages audio)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages assembly)
+  #:use-module (gnu packages avahi)
   #:use-module (gnu packages backup)
   #:use-module (gnu packages base) ;libbdf
   #:use-module (gnu packages bash)
@@ -151,6 +152,7 @@ (define-module (gnu packages music)
   #:use-module (gnu packages mpd)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages netpbm)
+  #:use-module (gnu packages networking)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages pdf)
   #:use-module (gnu packages perl)
@@ -7115,6 +7117,113 @@ (define-public libmonome
 FFI.")
     (license license:isc)))
 
+(define-public norns
+  (package
+    (name "norns")
+    (version "2.7.3")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/monome/norns")
+             (commit (string-append "v" version))
+             (recursive? #t)))
+       (file-name (git-file-name name version))
+       (patches (search-patches
+                 "norns-remove-nonfree-fonts.patch"))
+       (modules '((guix build utils)))
+       (snippet #~(begin (delete-file-recursively "third-party")
+                         (delete-file "sc/install.sh") ;do this manually
+                         (for-each delete-file ;remove non-free vera font
+                                   (find-files "resources" "[V|v]era*"))
+                         (substitute* "wscript"
+                           (("'VERSION_HASH', get_version_hash\\(\\)")
+                            "'VERSION_HASH', ''")
+                           (("lua53") "lua-5.3")
+                           (("bld\\.recurse\\('third-party'\\)") ""))
+                         (substitute* "matron/wscript"
+                           (("matron_libs = \\[")
+                            "matron_libs = ['lua', 'abl_link',"))
+                         (substitute* "matronrc.lua" ;run SDL version
+                           (("-- _boot\\.add_io\\('input:sdl', \\{\\}\\)")
+                            "_boot.add_io('input:sdl', {})")
+                           (("^init_norns")
+                            "init_desktop"))))
+       (sha256
+        (base32 "1y8hiy0dlv7c66q874znfsgl0ndlddfm81dgyvd5rz8f8g8iqavp"))))
+    (build-system waf-build-system)
+    (arguments
+     (list #:tests? #f ;no target
+           #:configure-flags #~(list "--desktop")
+           #:phases #~(modify-phases %standard-phases
+                        (add-after 'unpack 'patch-src
+                          (lambda _
+                            (substitute* "sc/norns-config.sc"
+                              (("Platform\\.userHomeDir")
+                               (string-append #$output "/share/norns/sc")))
+                            (substitute* "matron/src/hardware/screen.c"
+                              (("%s/norns/resources/%s\", getenv\\(\"HOME\"\\),")
+                               (string-append
+                                #$output "/share/norns/resources/%s\",")))
+                            (substitute* "matron/wscript"
+                              (("\\.\\./third-party/link/extensions/abl_link/include")
+                               (string-append
+                                #$(this-package-input "ableton-link")
+                                "/include/extensions/abl_link")))))
+                        (add-before 'build 'set-desktop-env
+                          (lambda _
+                            (setenv "NORNS_DESKTOP" "true")))
+                        (add-after 'install 'install-resources
+                          (lambda _
+                            (let ((scdir (string-append
+                                          #$output "/share/norns/sc"))
+                                  (fontdir (string-append
+                                            #$output "/share/norns/resources")))
+                              (mkdir-p scdir)
+                              (copy-recursively "sc" scdir)
+                              (mkdir-p fontdir)
+                              (copy-recursively "resources" fontdir)
+                              (install-file
+                               "matronrc.lua"
+                               (string-append #$output "/share/norns")))))
+                        (add-after 'install 'install-docs
+                          (lambda _
+                            ;; TODO: build docs using ldoc, luarocks
+                            (copy-recursively "doc" (string-append
+                                                     #$output "/share/doc")))))))
+    (native-inputs (list pkg-config))
+    (inputs (list ableton-link
+                  alsa-lib
+                  avahi
+                  cairo
+                  eudev
+                  jack-2
+                  libevdev
+                  liblo
+                  libmonome
+                  libsndfile
+                  lua
+                  nanomsg
+                  ncurses
+                  readline
+                  sdl2))
+    (home-page "https://monome.org/docs/norns/")
+    (synopsis "Desktop version of the norns sound computer")
+    (description "The package provides a SDL implementation of norns, the sound
+computer that dynamically runs scripts and
+@acronym{DSP, Digital Signal Processors}, such as:
+@itemize
+@item sample-cutter
+@item polysynth
+@item algorithmic drum machine
+@item drone box
+@item granulator
+@item asynchronous looper
+@item polyphasic sequencer
+@end itemize")
+    (license (list license:gpl3 ;code
+                   license:asl2.0)))) ;Roboto font
+
 ;;;
 ;;; 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
diff --git a/gnu/packages/patches/norns-remove-nonfree-fonts.patch b/gnu/packages/patches/norns-remove-nonfree-fonts.patch
new file mode 100644
index 0000000000..716fd435be
--- /dev/null
+++ b/gnu/packages/patches/norns-remove-nonfree-fonts.patch
@@ -0,0 +1,41 @@
+Author: Antero Mejr <antero@mailbox.org>
+Notes: It appears that the Bitstream Vera license restricts commercial
+redistribution so patch those fonts out.
+
+diff --git a/matron/src/hardware/screen.c b/matron/src/hardware/screen.c
+index d0cf86e0..1fe494ec 100644
+--- a/matron/src/hardware/screen.c
++++ b/matron/src/hardware/screen.c
+@@ -31,7 +31,7 @@
+     }
+ #endif
+ 
+-#define NUM_FONTS 67
++#define NUM_FONTS 57
+ #define NUM_OPS 29
+ 
+ static char font_path[NUM_FONTS][32];
+@@ -107,21 +107,11 @@ void screen_init(void) {
+     strcpy(font_path[11], "Roboto-MediumItalic.ttf");
+     strcpy(font_path[12], "Roboto-BoldItalic.ttf");
+     strcpy(font_path[13], "Roboto-BlackItalic.ttf");
+-    strcpy(font_path[14], "VeraBd.ttf");
+-    strcpy(font_path[15], "VeraBI.ttf");
+-    strcpy(font_path[16], "VeraIt.ttf");
+-    strcpy(font_path[17], "VeraMoBd.ttf");
+-    strcpy(font_path[18], "VeraMoBI.ttf");
+-    strcpy(font_path[19], "VeraMoIt.ttf");
+-    strcpy(font_path[20], "VeraMono.ttf");
+-    strcpy(font_path[21], "VeraSeBd.ttf");
+-    strcpy(font_path[22], "VeraSe.ttf");
+-    strcpy(font_path[23], "Vera.ttf");
+     //------------------
+     // bitmap fonts
+-    strcpy(font_path[24], "bmp/tom-thumb.bdf");
++    strcpy(font_path[14], "bmp/tom-thumb.bdf");
+     // FIXME: this is totally silly...
+-    int i = 25;
++    int i = 15;
+     strcpy(font_path[i++], "bmp/creep.bdf");
+     strcpy(font_path[i++], "bmp/ctrld-fixed-10b.bdf");
+     strcpy(font_path[i++], "bmp/ctrld-fixed-10r.bdf");
-- 
2.38.1





^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [bug#61594] [PATCH] gnu: Add libmonome.
  2023-02-18  5:05 [bug#61594] [PATCH][WIP] gnu: Add norns Antero Mejr via Guix-patches via
@ 2023-02-18  5:15 ` Antero Mejr via Guix-patches via
  0 siblings, 0 replies; 2+ messages in thread
From: Antero Mejr via Guix-patches via @ 2023-02-18  5:15 UTC (permalink / raw)
  To: 61594; +Cc: Antero Mejr

* gnu/packages/music.scm (libmonome): New variable.
---
Also I apologize if WIP patches are not good for this mailing list,
please let me know if that is the case and I will stop sending them.

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

diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index 59f295cc14..7f0e9dd793 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -7084,6 +7084,37 @@ (define-public orca-music
       (home-page "https://100r.co/site/orca.html")
       (license license:expat))))
 
+(define-public libmonome
+  (package
+    (name "libmonome")
+    (version "1.4.6")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/monome/libmonome")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (modules '((guix build utils)))
+       (snippet #~(substitute* "wscript" ;version string not updated
+                    (("VERSION = \".*\"")
+                     "VERSION = \"1.4.6\"")))
+       (sha256
+        (base32 "1p0m6myzbmj0zy7vs80blmym0vs1dbzsgl9k7rg98l466yh61mi0"))))
+    (build-system waf-build-system)
+    (arguments
+     (list #:tests? #f ;No target
+           #:configure-flags #~(list (string-append "LDFLAGS=-Wl,-rpath="
+                                                    #$output "/lib"))))
+    (inputs (list eudev liblo))
+    (home-page "https://github.com/monome/libmonome")
+    (synopsis "Library for interacting with monome audio devices")
+    (description "libmonome is a library for interacting with monome devices.
+It was developed to make monome devices easy to use with programming languages
+like C and Python, and for adding wrappers for use in languages with suitable
+FFI.")
+    (license license:isc)))
+
 ;;;
 ;;; 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.38.1





^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-18  5:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-18  5:05 [bug#61594] [PATCH][WIP] gnu: Add norns Antero Mejr via Guix-patches via
2023-02-18  5:15 ` [bug#61594] [PATCH] gnu: Add libmonome Antero Mejr via Guix-patches via

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).