unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH 0/7] Add Extempore.
@ 2016-09-14  9:38 Ricardo Wurmus
  2016-09-14  9:38 ` [PATCH 1/7] gnu: Add nanovg-for-extempore Ricardo Wurmus
                   ` (8 more replies)
  0 siblings, 9 replies; 21+ messages in thread
From: Ricardo Wurmus @ 2016-09-14  9:38 UTC (permalink / raw)
  To: guix-devel

Hi Guix,

This patch set adds Extempore, a Scheme-like language for live coding of audio
and graphics.  Extempore comes with an Emacs mode to facilitate live coding
from within Emacs (much like using Geiser for Guile).

Extempore depends on a few libraries that have been forked from their upstream
releases, hence the many "*-for-extempore" packages.  "llvm-for-extempore"
annoys me most, because it's almost exactly the same as upstream LLVM with
just a tiny fix that the developers say upstream isn't interested in.  It
takes a lot of time to compile.

I've tried to ensure that the AOT compilation of the language's libraries are
done in a generic fashion to allow for binary substitutes.

I've tested the very basics only because I'm not yet familiar with Extempore.
Here's an example that works for me:

    (bind-func sine:DSP
      (lambda (in time chan dat)
        (* .1 (cos (* (convert time) .04)))))

    ;; tell Extempore to use `sine` as the audio output sink
    (dsp:set! sine)

Thanks in advance to the brave soul willing to review this!

~~ Ricardo

Ricardo Wurmus (7):
  gnu: Add nanovg-for-extempore.
  gnu: Add assimp.
  gnu: Add stb-image-for-extempore.
  gnu: Add llvm-for-extempore.
  gnu: Add kiss-fft-for-extempore.
  gnu: Add portmidi-for-extempore.
  gnu: Add Extempore.

 gnu/packages/algebra.scm  |  24 +++++++
 gnu/packages/gl.scm       |  25 +++++++
 gnu/packages/graphics.scm |  31 ++++++++-
 gnu/packages/image.scm    |  26 ++++++++
 gnu/packages/llvm.scm     |   8 +++
 gnu/packages/music.scm    | 164 ++++++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 277 insertions(+), 1 deletion(-)

-- 
2.10.0

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

* [PATCH 1/7] gnu: Add nanovg-for-extempore.
  2016-09-14  9:38 [PATCH 0/7] Add Extempore Ricardo Wurmus
@ 2016-09-14  9:38 ` Ricardo Wurmus
  2016-09-14 14:23   ` Thompson, David
  2016-09-14  9:38 ` [PATCH 2/7] gnu: Add assimp Ricardo Wurmus
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Ricardo Wurmus @ 2016-09-14  9:38 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/gl.scm (nanovg-for-extempore): New variable.
---
 gnu/packages/gl.scm | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
index 1aa1201..707e3d4 100644
--- a/gnu/packages/gl.scm
+++ b/gnu/packages/gl.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2014, 2016 David Thompson <davet@gnu.org>
 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2016 ng0 <ng0@we.make.ritual.n0.is>
+;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -573,3 +574,27 @@ OpenGL.")
 desktop computers.  It provides a simple API for creating windows, contexts
 and surfaces, receiving input and events.")
     (license license:zlib)))
+
+(define-public nanovg-for-extempore
+  (package
+    (name "nanovg-for-extempore")
+    (version "0.7.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/extemporelang/nanovg/"
+                                  "archive/"  version ".tar.gz"))
+              (file-name (string-append name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0ivs1sagq19xiw8jxd9f8w2b39svi0n9hrbmdvckwvqg95r8701g"))))
+    (build-system cmake-build-system)
+    (arguments `(#:tests? #f)) ; no tests included
+    (inputs
+     `(("mesa" ,mesa)))
+    (home-page "https://github.com/extemporelang/nanovg")
+    (synopsis "2D vector drawing library on top of OpenGL")
+    (description "NanoVG is small antialiased vector graphics rendering
+library for OpenGL.  It has lean API modeled after HTML5 canvas API.  It is
+aimed to be a practical and fun toolset for building scalable user interfaces
+and visualizations.")
+    (license license:zlib)))
-- 
2.10.0

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

* [PATCH 2/7] gnu: Add assimp.
  2016-09-14  9:38 [PATCH 0/7] Add Extempore Ricardo Wurmus
  2016-09-14  9:38 ` [PATCH 1/7] gnu: Add nanovg-for-extempore Ricardo Wurmus
@ 2016-09-14  9:38 ` Ricardo Wurmus
  2016-09-14 14:15   ` Thompson, David
  2016-09-14  9:38 ` [PATCH 3/7] gnu: Add stb-image-for-extempore Ricardo Wurmus
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Ricardo Wurmus @ 2016-09-14  9:38 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/graphics.scm (assimp): New variable.
---
 gnu/packages/graphics.scm | 31 ++++++++++++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm
index d0df830..930e198 100644
--- a/gnu/packages/graphics.scm
+++ b/gnu/packages/graphics.scm
@@ -60,7 +60,8 @@
   #:use-module (gnu packages sdl)
   #:use-module (gnu packages video)
   #:use-module (gnu packages xml)
-  #:use-module (gnu packages xorg))
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages zip))
 
 (define-public blender
   (package
@@ -138,6 +139,34 @@ compositing and motion tracking, even video editing and game creation.  The
 application can be customized via its API for Python scripting.")
     (license license:gpl2+)))
 
+(define-public assimp
+  (package
+    (name "assimp")
+    (version "3.2")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/assimp/assimp/archive/v"
+                                  version ".zip"))
+              (file-name (string-append name "-" version ".zip"))
+              (sha256
+               (base32
+                "11sfahmbwnjjpd8vpzdsng1bx5mb0cmaqb20dz6sdwapqanqwmar"))))
+    (build-system cmake-build-system)
+    (inputs
+     `(("zlib" ,zlib)))
+    (native-inputs
+     `(("unzip" ,unzip)))
+    (home-page "http://assimp.org/")
+    (synopsis "Asset import library")
+    (description
+     "The Open Asset Import Library loads more than 40 3D file formats into
+one unified data structure.  Additionally, assimp features various mesh post
+processing tools: normals and tangent space generation, triangulation, vertex
+cache locality optimization, removal of degenerate primitives and duplicate
+vertices, sorting by primitive type, merging of redundant materials and many
+more.")
+    (license license:bsd-3)))
+
 (define-public cgal
   (package
     (name "cgal")
-- 
2.10.0

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

* [PATCH 3/7] gnu: Add stb-image-for-extempore.
  2016-09-14  9:38 [PATCH 0/7] Add Extempore Ricardo Wurmus
  2016-09-14  9:38 ` [PATCH 1/7] gnu: Add nanovg-for-extempore Ricardo Wurmus
  2016-09-14  9:38 ` [PATCH 2/7] gnu: Add assimp Ricardo Wurmus
@ 2016-09-14  9:38 ` Ricardo Wurmus
  2016-09-14 14:16   ` Thompson, David
  2016-09-14  9:38 ` [PATCH 4/7] gnu: Add llvm-for-extempore Ricardo Wurmus
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Ricardo Wurmus @ 2016-09-14  9:38 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/image.scm (stb-image-for-extempore): New variable.
---
 gnu/packages/image.scm | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm
index 1b10846..e40fa9a 100644
--- a/gnu/packages/image.scm
+++ b/gnu/packages/image.scm
@@ -49,6 +49,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system cmake)
   #:use-module (srfi srfi-1))
@@ -904,3 +905,28 @@ kinds of image- and audio-files.  The color- respectivly sample-frequencies
 are not changed thus making the embedding resistant against first-order
 statistical tests.")
     (license license:gpl2+)))
+
+(define-public stb-image-for-extempore
+  (let ((revision "1")
+        (commit "152a250a702bf28951bb0220d63bc0c99830c498"))
+    (package
+      (name "stb-image-for-extempore")
+      (version (string-append "0-" revision "." (string-take commit 9)))
+      (source
+       (origin (method git-fetch)
+               (uri (git-reference
+                     (url "https://github.com/extemporelang/stb.git")
+                     (commit commit)))
+               (sha256
+                (base32
+                 "0y0aa20pj9311x2ii06zg8xs34idg14hfgldqc5ymizc6cf1qiqv"))
+               (file-name (string-append name "-" version "-checkout"))))
+      (build-system cmake-build-system)
+      (arguments `(#:tests? #f))        ; no tests included
+      (home-page "https://github.com/extemporelang/stb")
+      (synopsis "Image library for Extempore")
+      (description
+       "This package is a collection of assorted single-file libraries.  Of
+all included libraries only the image loading and decoding library is
+installed as @code{stb_image}.")
+      (license license:public-domain))))
-- 
2.10.0

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

* [PATCH 4/7] gnu: Add llvm-for-extempore.
  2016-09-14  9:38 [PATCH 0/7] Add Extempore Ricardo Wurmus
                   ` (2 preceding siblings ...)
  2016-09-14  9:38 ` [PATCH 3/7] gnu: Add stb-image-for-extempore Ricardo Wurmus
@ 2016-09-14  9:38 ` Ricardo Wurmus
  2016-09-14 14:24   ` Thompson, David
  2016-09-14 14:32   ` Danny Milosavljevic
  2016-09-14  9:38 ` [PATCH 5/7] gnu: Add kiss-fft-for-extempore Ricardo Wurmus
                   ` (4 subsequent siblings)
  8 siblings, 2 replies; 21+ messages in thread
From: Ricardo Wurmus @ 2016-09-14  9:38 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/llvm.scm (llvm-for-extempore): New variable.
---
 gnu/packages/llvm.scm | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index a9eba79..b55a200 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2016 Dennis Mungai <dmngaie@gmail.com>
+;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -267,3 +268,10 @@ code analysis tools.")
 (define-public clang-3.5
   (clang-from-llvm llvm-3.5 clang-runtime-3.5
                    "0846h8vn3zlc00jkmvrmy88gc6ql6014c02l4jv78fpvfigmgssg"))
+
+(define-public llvm-for-extempore
+  (package (inherit llvm-3.7)
+    (source
+     (origin
+       (inherit (package-source llvm-3.7))
+       (patches (list (search-patch "llvm-for-extempore.patch")))))))
-- 
2.10.0

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

* [PATCH 5/7] gnu: Add kiss-fft-for-extempore.
  2016-09-14  9:38 [PATCH 0/7] Add Extempore Ricardo Wurmus
                   ` (3 preceding siblings ...)
  2016-09-14  9:38 ` [PATCH 4/7] gnu: Add llvm-for-extempore Ricardo Wurmus
@ 2016-09-14  9:38 ` Ricardo Wurmus
  2016-09-14 14:17   ` Thompson, David
  2016-09-14  9:38 ` [PATCH 6/7] gnu: Add portmidi-for-extempore Ricardo Wurmus
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Ricardo Wurmus @ 2016-09-14  9:38 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/algebra.scm (kiss-fft-for-extempore): New variable.
---
 gnu/packages/algebra.scm | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm
index 4fb15c6..83f03a0 100644
--- a/gnu/packages/algebra.scm
+++ b/gnu/packages/algebra.scm
@@ -505,6 +505,30 @@ syntax is similar to that of C, so basic usage is familiar.  It also includes
 \"dc\", a reverse-polish calculator.")
     (license license:gpl2+)))
 
+;; The original kiss-fft does not have a complete build system and does not
+;; build any shared libraries.  This is a fork used by Extempore.
+(define-public kiss-fft-for-extempore
+  (package
+    (name "kiss-fft-for-extempore")
+    (version "1.3.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/extemporelang/kiss_fft/archive/"
+                                  version ".tar.gz"))
+              (file-name (string-append name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0hkp9l6l4c92fb1l2sh6a6zv1hynpvb2s4d03vd8vxyvybc0l4pv"))))
+    (build-system cmake-build-system)
+    (arguments `(#:tests? #f)) ; no tests included
+    (home-page "https://github.com/extemporelang/kiss_fft")
+    (synopsis "Mixed-radix Fast Fourier Transform")
+    (description
+     "Kiss FFT attempts to be a reasonably efficient, moderately useful FFT
+that can use fixed or floating data types and can easily be incorporated into
+a C program.")
+    (license license:bsd-3)))
+
 (define-public fftw
   (package
     (name "fftw")
-- 
2.10.0

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

* [PATCH 6/7] gnu: Add portmidi-for-extempore.
  2016-09-14  9:38 [PATCH 0/7] Add Extempore Ricardo Wurmus
                   ` (4 preceding siblings ...)
  2016-09-14  9:38 ` [PATCH 5/7] gnu: Add kiss-fft-for-extempore Ricardo Wurmus
@ 2016-09-14  9:38 ` Ricardo Wurmus
  2016-09-14 14:25   ` Thompson, David
  2016-09-14  9:38 ` [PATCH 7/7] gnu: Add Extempore Ricardo Wurmus
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Ricardo Wurmus @ 2016-09-14  9:38 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/music.scm (portmidi-for-extempore): New variable.
---
 gnu/packages/music.scm | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index f294564..c62dbbc 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -1081,6 +1081,23 @@ projects.")
 using a system-independent interface.")
     (license license:expat)))
 
+(define-public portmidi-for-extempore
+  (package (inherit portmidi)
+    (name "portmidi-for-extempore")
+    (version "217")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/extemporelang/portmidi/"
+                                  "archive/" version ".tar.gz"))
+              (file-name (string-append name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0gjikwciyr8kk4y3qiv1pcq58xpgw38ql1m2gs6g0qc1s8sx4235"))))
+    (build-system cmake-build-system)
+    (arguments `(#:tests? #f)) ; no tests
+    (native-inputs '())
+    (home-page "https://github.com/extemporelang/portmidi/")))
+
 (define-public python-pyportmidi
   (package
     (name "python-pyportmidi")
-- 
2.10.0

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

* [PATCH 7/7] gnu: Add Extempore.
  2016-09-14  9:38 [PATCH 0/7] Add Extempore Ricardo Wurmus
                   ` (5 preceding siblings ...)
  2016-09-14  9:38 ` [PATCH 6/7] gnu: Add portmidi-for-extempore Ricardo Wurmus
@ 2016-09-14  9:38 ` Ricardo Wurmus
  2016-09-16 15:33 ` [PATCH 0/7] " Ricardo Wurmus
  2016-09-18  7:38 ` Andreas Enge
  8 siblings, 0 replies; 21+ messages in thread
From: Ricardo Wurmus @ 2016-09-14  9:38 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/music.scm (extempore): New variable.
---
 gnu/packages/music.scm | 147 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 147 insertions(+)

diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index c62dbbc..c512d53 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -37,6 +37,7 @@
   #:use-module (guix build-system waf)
   #:use-module (gnu packages)
   #:use-module (gnu packages algebra)
+  #:use-module (gnu packages apr)
   #:use-module (gnu packages audio)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages backup)
@@ -51,6 +52,7 @@
   #:use-module (gnu packages cyrus-sasl)
   #:use-module (gnu packages docbook)
   #:use-module (gnu packages documentation)
+  #:use-module (gnu packages emacs)
   #:use-module (gnu packages file)
   #:use-module (gnu packages flex)
   #:use-module (gnu packages fltk)
@@ -71,11 +73,14 @@
   #:use-module (gnu packages imagemagick)
   #:use-module (gnu packages java)
   #:use-module (gnu packages linux) ; for alsa-utils
+  #:use-module (gnu packages libffi)
+  #:use-module (gnu packages llvm)
   #:use-module (gnu packages man)
   #:use-module (gnu packages mp3)
   #:use-module (gnu packages mpd)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages netpbm)
+  #:use-module (gnu packages pcre)
   #:use-module (gnu packages pdf)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
@@ -262,6 +267,148 @@ many input formats and provides a customisable Vi-style user interface.")
 enable professional yet simple and intuitive pattern-based drum programming.")
     (license license:gpl2+)))
 
+(define-public extempore
+  (package
+    (name "extempore")
+    (version "0.7.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://github.com/digego/extempore/archive/"
+                    version ".tar.gz"))
+              (sha256
+               (base32
+                "1wap1mvsicrhlazikf7l8zxg37fir8bmnh9rin28m1rix730vcch"))
+              (file-name (string-append name "-" version ".tar.gz"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(;; The default target also includes ahead-of-time compilation of the
+       ;; standard libraries.  However, during the "install" phase this would
+       ;; happen *again* for unknown reasons.  Hence we only build the
+       ;; extempore executable during the build phase.
+       #:make-flags '("extempore")
+       #:configure-flags '("-DJACK=ON"
+                           ;; We want to distribute.
+                           "-DIN_TREE=OFF"
+                           ;; Don't download any dependencies.
+                           "-DBUILD_DEPS=OFF")
+       #:modules ((ice-9 match)
+                  (guix build cmake-build-system)
+                  (guix build utils))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-directories
+           (lambda* (#:key outputs #:allow-other-keys)
+             ;; Rewrite default path to runtime directory
+             (substitute* "src/Extempore.cpp"
+               (("runtimedir \\+= \"runtime\"")
+                (string-append "runtimedir = \""
+                               (assoc-ref outputs "out")
+                               "/lib/extempore/runtime\"")))
+             (substitute* "extras/extempore.el"
+               (("\\(runtime-directory \\(concat default-directory \"runtime\"\\)\\)")
+                (string-append "(runtime-directory \""
+                               (assoc-ref outputs "out")
+                               "/lib/extempore/runtime"
+                               "\")")))
+             #t))
+         (add-after 'unpack 'link-with-additional-libs
+           (lambda _
+             ;; The executable must be linked with libffi and zlib.
+             (substitute* "CMakeLists.txt"
+               (("add_dependencies\\(aot_extended extended_deps\\)") "")
+               (("target_link_libraries\\(extempore PRIVATE dl" line)
+                (string-append line " ffi z")))
+             #t))
+         ;; FIXME: AOT compilation of the nanovg bindings fail with the error:
+         ;; "Compiler Error  could not bind _nvgLinearGradient"
+         (add-after 'unpack 'disable-nanovg
+           (lambda _
+             (substitute* "CMakeLists.txt"
+               (("aotcompile_lib\\(libs/external/nanovg.xtm.*") ""))
+             #t))
+         ;; FIXME: All examples that are used as tests segfault for some
+         ;; unknown reason.
+         (add-after 'unpack 'disable-broken-tests
+           (lambda _
+             (substitute* "CMakeLists.txt"
+               (("extempore_add_example_as_test\\(.*") ""))
+             #t))
+         (add-after 'unpack 'hardcode-external-lib-paths
+           (lambda* (#:key inputs #:allow-other-keys)
+             (use-modules (ice-9 match))
+             (for-each
+              (match-lambda
+                ((file-name lib pkg-name)
+                 (substitute* (string-append "libs/external/" file-name ".xtm")
+                   ((lib) (string-append (assoc-ref inputs pkg-name)
+                                         "/lib/" lib)))))
+              '(("assimp"    "libassimp.so"    "assimp")
+                ("portmidi"  "libportmidi.so"  "portmidi")
+                ("sndfile"   "libsndfile.so"   "libsndfile")
+                ("fft"       "libkiss_fft.so"  "kiss-fft")
+                ("stb_image" "libstb_image.so" "stb-image")
+                ("nanovg"    "libnanovg.so"    "nanovg")
+                ("glext"     "libGL.so"        "mesa")
+                ("glfw3"     "libglfw.so"      "glfw")
+                ("gl/glcore-directbind"   "libGL.so" "mesa")
+                ("gl/glcompat-directbind" "libGL.so" "mesa")))
+             #t))
+         (add-after 'unpack 'use-own-llvm
+          (lambda* (#:key inputs #:allow-other-keys)
+            (setenv "EXT_LLVM_DIR" (assoc-ref inputs "llvm"))
+            ;; Our LLVM builds shared libraries, so Extempore should use
+            ;; those.
+            (substitute* "CMakeLists.txt"
+              (("CMAKE_STATIC_LIBRARY") "CMAKE_SHARED_LIBRARY"))
+            #t))
+         (add-after 'unpack 'fix-aot-compilation
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "CMakeLists.txt"
+               ;; EXT_SHARE_DIR does not exist before installation, so the
+               ;; working directory should be the source directory instead.
+               (("WORKING_DIRECTORY \\$\\{EXT_SHARE_DIR\\}")
+                "WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}")
+               ;; Extempore needs to be told where the runtime is to be found.
+               ;; While we're at it we disable automatic tuning for a specific
+               ;; CPU to make binary substitution possible.
+               (("COMMAND extempore" prefix)
+                (string-append prefix " --sharedir " (getcwd)
+                               " --mcpu=generic --attr=none")))
+             #t)))))
+    (inputs
+     `(("llvm" ,llvm-for-extempore)
+       ("libffi" ,libffi)
+       ("jack" ,jack-1)
+       ("libsndfile" ,libsndfile)
+       ("glfw" ,glfw)
+       ("apr" ,apr)
+       ("stb-image" ,stb-image-for-extempore)
+       ("kiss-fft" ,kiss-fft-for-extempore)
+       ("nanovg" ,nanovg-for-extempore)
+       ("portmidi" ,portmidi-for-extempore)
+       ("assimp" ,assimp)
+       ("alsa-lib" ,alsa-lib)
+       ("portaudio" ,portaudio)
+       ("mesa" ,mesa)
+       ("pcre" ,pcre)
+       ("zlib" ,zlib)))
+    (native-inputs
+     `(("perl" ,perl)
+       ("emacs" ,emacs-no-x)))
+    (home-page "http://benswift.me/extempore-docs/index.html")
+    (synopsis "Programming environment for live coding of multimedia")
+    (description
+     "Extempore is a programming language and runtime environment designed
+with live programming in mind.  It supports interactive programming in a REPL
+style, compiling and binding code just-in-time.  Although Extempore has its
+roots in 'live coding' of audiovisual media art, it is suitable for any task
+domain where dynamic run-time modifiability and good numerical performance are
+required.  Extempore also has strong timing and concurrency semantics, which
+are helpful when working in problem spaces where timing is important (such as
+audio and video).")
+    (license license:bsd-2)))
+
 (define-public klick
   (package
     (name "klick")
-- 
2.10.0

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

* Re: [PATCH 2/7] gnu: Add assimp.
  2016-09-14  9:38 ` [PATCH 2/7] gnu: Add assimp Ricardo Wurmus
@ 2016-09-14 14:15   ` Thompson, David
  0 siblings, 0 replies; 21+ messages in thread
From: Thompson, David @ 2016-09-14 14:15 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

On Wed, Sep 14, 2016 at 5:38 AM, Ricardo Wurmus <rekado@elephly.net> wrote:
> * gnu/packages/graphics.scm (assimp): New variable.

Awesome!  Now someone can package guile-assimp. :)

LGTM.

- Dave

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

* Re: [PATCH 3/7] gnu: Add stb-image-for-extempore.
  2016-09-14  9:38 ` [PATCH 3/7] gnu: Add stb-image-for-extempore Ricardo Wurmus
@ 2016-09-14 14:16   ` Thompson, David
  0 siblings, 0 replies; 21+ messages in thread
From: Thompson, David @ 2016-09-14 14:16 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

On Wed, Sep 14, 2016 at 5:38 AM, Ricardo Wurmus <rekado@elephly.net> wrote:
> * gnu/packages/image.scm (stb-image-for-extempore): New variable.

LGTM.

- Dave

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

* Re: [PATCH 5/7] gnu: Add kiss-fft-for-extempore.
  2016-09-14  9:38 ` [PATCH 5/7] gnu: Add kiss-fft-for-extempore Ricardo Wurmus
@ 2016-09-14 14:17   ` Thompson, David
  0 siblings, 0 replies; 21+ messages in thread
From: Thompson, David @ 2016-09-14 14:17 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

On Wed, Sep 14, 2016 at 5:38 AM, Ricardo Wurmus <rekado@elephly.net> wrote:
> * gnu/packages/algebra.scm (kiss-fft-for-extempore): New variable.

LGTM.

- Dave

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

* Re: [PATCH 1/7] gnu: Add nanovg-for-extempore.
  2016-09-14  9:38 ` [PATCH 1/7] gnu: Add nanovg-for-extempore Ricardo Wurmus
@ 2016-09-14 14:23   ` Thompson, David
  0 siblings, 0 replies; 21+ messages in thread
From: Thompson, David @ 2016-09-14 14:23 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

On Wed, Sep 14, 2016 at 5:38 AM, Ricardo Wurmus <rekado@elephly.net> wrote:
> * gnu/packages/gl.scm (nanovg-for-extempore): New variable.

LGTM.

- Dave

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

* Re: [PATCH 4/7] gnu: Add llvm-for-extempore.
  2016-09-14  9:38 ` [PATCH 4/7] gnu: Add llvm-for-extempore Ricardo Wurmus
@ 2016-09-14 14:24   ` Thompson, David
  2016-09-16 13:47     ` Ricardo Wurmus
  2016-09-14 14:32   ` Danny Milosavljevic
  1 sibling, 1 reply; 21+ messages in thread
From: Thompson, David @ 2016-09-14 14:24 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

On Wed, Sep 14, 2016 at 5:38 AM, Ricardo Wurmus <rekado@elephly.net> wrote:
> * gnu/packages/llvm.scm (llvm-for-extempore): New variable.
> ---
>  gnu/packages/llvm.scm | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
> index a9eba79..b55a200 100644
> --- a/gnu/packages/llvm.scm
> +++ b/gnu/packages/llvm.scm
> @@ -3,6 +3,7 @@
>  ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
>  ;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org>
>  ;;; Copyright © 2016 Dennis Mungai <dmngaie@gmail.com>
> +;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -267,3 +268,10 @@ code analysis tools.")
>  (define-public clang-3.5
>    (clang-from-llvm llvm-3.5 clang-runtime-3.5
>                     "0846h8vn3zlc00jkmvrmy88gc6ql6014c02l4jv78fpvfigmgssg"))
> +
> +(define-public llvm-for-extempore
> +  (package (inherit llvm-3.7)
> +    (source
> +     (origin
> +       (inherit (package-source llvm-3.7))
> +       (patches (list (search-patch "llvm-for-extempore.patch")))))))

This could use a comment explaining the rationale.  Also, you forgot
to include the patch file in this commit.

- Dave

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

* Re: [PATCH 6/7] gnu: Add portmidi-for-extempore.
  2016-09-14  9:38 ` [PATCH 6/7] gnu: Add portmidi-for-extempore Ricardo Wurmus
@ 2016-09-14 14:25   ` Thompson, David
  2016-09-14 19:25     ` Ricardo Wurmus
  0 siblings, 1 reply; 21+ messages in thread
From: Thompson, David @ 2016-09-14 14:25 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

On Wed, Sep 14, 2016 at 5:38 AM, Ricardo Wurmus <rekado@elephly.net> wrote:
> * gnu/packages/music.scm (portmidi-for-extempore): New variable.
> ---
>  gnu/packages/music.scm | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
>
> diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
> index f294564..c62dbbc 100644
> --- a/gnu/packages/music.scm
> +++ b/gnu/packages/music.scm
> @@ -1081,6 +1081,23 @@ projects.")
>  using a system-independent interface.")
>      (license license:expat)))
>
> +(define-public portmidi-for-extempore
> +  (package (inherit portmidi)
> +    (name "portmidi-for-extempore")
> +    (version "217")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append "https://github.com/extemporelang/portmidi/"
> +                                  "archive/" version ".tar.gz"))
> +              (file-name (string-append name "-" version ".tar.gz"))
> +              (sha256
> +               (base32
> +                "0gjikwciyr8kk4y3qiv1pcq58xpgw38ql1m2gs6g0qc1s8sx4235"))))
> +    (build-system cmake-build-system)
> +    (arguments `(#:tests? #f)) ; no tests
> +    (native-inputs '())

Remove this line. ^

> +    (home-page "https://github.com/extemporelang/portmidi/")))
> +
>  (define-public python-pyportmidi
>    (package
>      (name "python-pyportmidi")
> --
> 2.10.0

LGTM otherwise.

- Dave

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

* Re: [PATCH 4/7] gnu: Add llvm-for-extempore.
  2016-09-14  9:38 ` [PATCH 4/7] gnu: Add llvm-for-extempore Ricardo Wurmus
  2016-09-14 14:24   ` Thompson, David
@ 2016-09-14 14:32   ` Danny Milosavljevic
  1 sibling, 0 replies; 21+ messages in thread
From: Danny Milosavljevic @ 2016-09-14 14:32 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

> +       (patches (list (search-patch "llvm-for-extempore.patch")))))))

Hmm... is this patch file somewhere?

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

* Re: [PATCH 6/7] gnu: Add portmidi-for-extempore.
  2016-09-14 14:25   ` Thompson, David
@ 2016-09-14 19:25     ` Ricardo Wurmus
  0 siblings, 0 replies; 21+ messages in thread
From: Ricardo Wurmus @ 2016-09-14 19:25 UTC (permalink / raw)
  To: Thompson, David; +Cc: guix-devel


Thompson, David <dthompson2@worcester.edu> writes:

> On Wed, Sep 14, 2016 at 5:38 AM, Ricardo Wurmus <rekado@elephly.net> wrote:
>> * gnu/packages/music.scm (portmidi-for-extempore): New variable.
>> ---
>>  gnu/packages/music.scm | 17 +++++++++++++++++
>>  1 file changed, 17 insertions(+)
>>
>> diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
>> index f294564..c62dbbc 100644
>> --- a/gnu/packages/music.scm
>> +++ b/gnu/packages/music.scm
>> @@ -1081,6 +1081,23 @@ projects.")
>>  using a system-independent interface.")
>>      (license license:expat)))
>>
>> +(define-public portmidi-for-extempore
>> +  (package (inherit portmidi)
>> +    (name "portmidi-for-extempore")
>> +    (version "217")
>> +    (source (origin
>> +              (method url-fetch)
>> +              (uri (string-append "https://github.com/extemporelang/portmidi/"
>> +                                  "archive/" version ".tar.gz"))
>> +              (file-name (string-append name "-" version ".tar.gz"))
>> +              (sha256
>> +               (base32
>> +                "0gjikwciyr8kk4y3qiv1pcq58xpgw38ql1m2gs6g0qc1s8sx4235"))))
>> +    (build-system cmake-build-system)
>> +    (arguments `(#:tests? #f)) ; no tests
>> +    (native-inputs '())
>
> Remove this line. ^

This inherits from “portmidi” where “native-inputs” is set to contain
“unzip”.  I’m overriding this with the empty list to drop “unzip” from
the inputs.

~~ Ricardo

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

* Re: [PATCH 4/7] gnu: Add llvm-for-extempore.
  2016-09-14 14:24   ` Thompson, David
@ 2016-09-16 13:47     ` Ricardo Wurmus
  0 siblings, 0 replies; 21+ messages in thread
From: Ricardo Wurmus @ 2016-09-16 13:47 UTC (permalink / raw)
  To: Thompson, David; +Cc: guix-devel


Thompson, David <dthompson2@worcester.edu> writes:

> On Wed, Sep 14, 2016 at 5:38 AM, Ricardo Wurmus <rekado@elephly.net> wrote:
>> * gnu/packages/llvm.scm (llvm-for-extempore): New variable.
>> ---
>>  gnu/packages/llvm.scm | 8 ++++++++
>>  1 file changed, 8 insertions(+)
>>
>> diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
>> index a9eba79..b55a200 100644
>> --- a/gnu/packages/llvm.scm
>> +++ b/gnu/packages/llvm.scm
>> @@ -3,6 +3,7 @@
>>  ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
>>  ;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org>
>>  ;;; Copyright © 2016 Dennis Mungai <dmngaie@gmail.com>
>> +;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
>>  ;;;
>>  ;;; This file is part of GNU Guix.
>>  ;;;
>> @@ -267,3 +268,10 @@ code analysis tools.")
>>  (define-public clang-3.5
>>    (clang-from-llvm llvm-3.5 clang-runtime-3.5
>>                     "0846h8vn3zlc00jkmvrmy88gc6ql6014c02l4jv78fpvfigmgssg"))
>> +
>> +(define-public llvm-for-extempore
>> +  (package (inherit llvm-3.7)
>> +    (source
>> +     (origin
>> +       (inherit (package-source llvm-3.7))
>> +       (patches (list (search-patch "llvm-for-extempore.patch")))))))
>
> This could use a comment explaining the rationale.  Also, you forgot
> to include the patch file in this commit.

Oh, I did indeed forget it.  I’ve added it and put a long comment to the
top, which I’ll quote here:

~~~~~~~~~~~~~~
This patch to LLVM is required by the developers of the Extempore language.
The following explanation was posted to the extemporelang@googlegroups.com
mailing list:

"There is an assumption in the parser that all definitions occur within the
same compilation unit - i.e. the parser has local state about what has been
parsed in this unit of work.  Extempore obviously does lots of little units
rather than one big unit and this causes problems for named types that were
defined in another unit - which they always are.  The patch simply checks the
current module to see if the type has been previously defined, and intervenes
appropriately if it has."

Message-ID: <CAOjrPOqoreXuZo4ZpDBvHE7M_tgAR_V8Txq5JFjh1HnGRn2EsA@mail.gmail.com>
~~~~~~~~~~~~~~

Thanks for the review!

~~ Ricardo

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

* Re: [PATCH 0/7] Add Extempore.
  2016-09-14  9:38 [PATCH 0/7] Add Extempore Ricardo Wurmus
                   ` (6 preceding siblings ...)
  2016-09-14  9:38 ` [PATCH 7/7] gnu: Add Extempore Ricardo Wurmus
@ 2016-09-16 15:33 ` Ricardo Wurmus
  2016-09-18  7:38 ` Andreas Enge
  8 siblings, 0 replies; 21+ messages in thread
From: Ricardo Wurmus @ 2016-09-16 15:33 UTC (permalink / raw)
  To: guix-devel


Ricardo Wurmus <rekado@elephly.net> writes:

> This patch set adds Extempore, a Scheme-like language for live coding of audio
> and graphics.  Extempore comes with an Emacs mode to facilitate live coding
> from within Emacs (much like using Geiser for Guile).

Thanks to the reviewers I fixed the missing patch and pushed this series
to master (915956244105e0c81454378a0136b97e48db6358).

~~ Ricardo

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

* Re: [PATCH 0/7] Add Extempore.
  2016-09-14  9:38 [PATCH 0/7] Add Extempore Ricardo Wurmus
                   ` (7 preceding siblings ...)
  2016-09-16 15:33 ` [PATCH 0/7] " Ricardo Wurmus
@ 2016-09-18  7:38 ` Andreas Enge
  2016-09-21 19:44   ` Ricardo Wurmus
  8 siblings, 1 reply; 21+ messages in thread
From: Andreas Enge @ 2016-09-18  7:38 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

Hello,

extempore only compiles on x86_64; elsewhere it fails with the message
   CMake Error at CMakeLists.txt:82 (message):
   Extempore currently only runs on 64-bit platforms.
(which is not the full truth...):
   http://hydra.gnu.org:3000/build/1473446

Could you disable the other architectures?

Maybe this should also be done for the *-for-extempore packages, since
there is no need to waste hydra cycles on otherwise unused packages.
I would also hide them using "define" instead of "define-public", which
would require to put them into the same module as extempore itself.
What do you think?

Andreas

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

* Re: [PATCH 0/7] Add Extempore.
  2016-09-18  7:38 ` Andreas Enge
@ 2016-09-21 19:44   ` Ricardo Wurmus
  2016-09-21 20:08     ` Efraim Flashner
  0 siblings, 1 reply; 21+ messages in thread
From: Ricardo Wurmus @ 2016-09-21 19:44 UTC (permalink / raw)
  To: Andreas Enge; +Cc: guix-devel


Andreas Enge <andreas@enge.fr> writes:

> extempore only compiles on x86_64; elsewhere it fails with the message
>    CMake Error at CMakeLists.txt:82 (message):
>    Extempore currently only runs on 64-bit platforms.
> (which is not the full truth...):
>    http://hydra.gnu.org:3000/build/1473446
>
> Could you disable the other architectures?

Yes, will do.  Thanks for the note.

> Maybe this should also be done for the *-for-extempore packages, since
> there is no need to waste hydra cycles on otherwise unused packages.
> I would also hide them using "define" instead of "define-public", which
> would require to put them into the same module as extempore itself.
> What do you think?

I don’t know about hiding the packages and moving them to the same
module.  In the past we’ve kept package variants always with the
original package it was derived from,
e.g. “armadillo-for-rcpparmadillo”, which is only used for
“r-rcpparmadillo” in the “statistics” module, but which inherits from
“armadillo” in the “maths” module.

Back then I also thought that moving them together would be better, but
if I remember correctly I was asked to keep the variant with the
parent package.

I’ll disable the extempore packages for non-x86_64, but I’d like to see
some more opinions about whether to move the variants.

~~ Ricardo

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

* Re: [PATCH 0/7] Add Extempore.
  2016-09-21 19:44   ` Ricardo Wurmus
@ 2016-09-21 20:08     ` Efraim Flashner
  0 siblings, 0 replies; 21+ messages in thread
From: Efraim Flashner @ 2016-09-21 20:08 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1658 bytes --]

On Wed, Sep 21, 2016 at 09:44:02PM +0200, Ricardo Wurmus wrote:
> 
> I don’t know about hiding the packages and moving them to the same
> module.  In the past we’ve kept package variants always with the
> original package it was derived from,
> e.g. “armadillo-for-rcpparmadillo”, which is only used for
> “r-rcpparmadillo” in the “statistics” module, but which inherits from
> “armadillo” in the “maths” module.
> 
> Back then I also thought that moving them together would be better, but
> if I remember correctly I was asked to keep the variant with the
> parent package.
> 
> I’ll disable the extempore packages for non-x86_64, but I’d like to see
> some more opinions about whether to move the variants.
> 
> ~~ Ricardo
> 

Isn't this how we had the problem with nss and nss-certs, between
certs.scm and gnuzilla.scm? certs.scm imported gnuzilla.scm so nss-certs
could inherit from nss, so that meant we couldn't import certs into
gnuzilla without causing a stack overflow and a rift in the time-space
continuum.

If its just an older version I think it should stay in the original
module. If its an unbundled fork then we should think twice before
inheriting.

We do always have the (very verbose) option of
("armadillo" ,(@@ (gnu packages maths) armadillo-for-rcpparmadillo)) for
packages that have their own special tweaks that we want to keep
private, in a different module.

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2016-09-21 20:08 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-14  9:38 [PATCH 0/7] Add Extempore Ricardo Wurmus
2016-09-14  9:38 ` [PATCH 1/7] gnu: Add nanovg-for-extempore Ricardo Wurmus
2016-09-14 14:23   ` Thompson, David
2016-09-14  9:38 ` [PATCH 2/7] gnu: Add assimp Ricardo Wurmus
2016-09-14 14:15   ` Thompson, David
2016-09-14  9:38 ` [PATCH 3/7] gnu: Add stb-image-for-extempore Ricardo Wurmus
2016-09-14 14:16   ` Thompson, David
2016-09-14  9:38 ` [PATCH 4/7] gnu: Add llvm-for-extempore Ricardo Wurmus
2016-09-14 14:24   ` Thompson, David
2016-09-16 13:47     ` Ricardo Wurmus
2016-09-14 14:32   ` Danny Milosavljevic
2016-09-14  9:38 ` [PATCH 5/7] gnu: Add kiss-fft-for-extempore Ricardo Wurmus
2016-09-14 14:17   ` Thompson, David
2016-09-14  9:38 ` [PATCH 6/7] gnu: Add portmidi-for-extempore Ricardo Wurmus
2016-09-14 14:25   ` Thompson, David
2016-09-14 19:25     ` Ricardo Wurmus
2016-09-14  9:38 ` [PATCH 7/7] gnu: Add Extempore Ricardo Wurmus
2016-09-16 15:33 ` [PATCH 0/7] " Ricardo Wurmus
2016-09-18  7:38 ` Andreas Enge
2016-09-21 19:44   ` Ricardo Wurmus
2016-09-21 20:08     ` Efraim Flashner

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