| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 |
|
| 19 | (define-module (gnu packages mruby-xyz)
|
| 20 | #:use-module (guix gexp)
|
| 21 | #:use-module (guix packages)
|
| 22 | #:use-module (guix git-download)
|
| 23 | #:use-module ((guix licenses) #:prefix license:)
|
| 24 | #:use-module (guix build-system gnu)
|
| 25 | #:use-module (guix utils)
|
| 26 | #:use-module (gnu packages)
|
| 27 | #:use-module (gnu packages audio)
|
| 28 | #:use-module (gnu packages fonts)
|
| 29 | #:use-module (gnu packages gl)
|
| 30 | #:use-module (gnu packages libevent)
|
| 31 | #:use-module (gnu packages pkg-config)
|
| 32 | #:use-module (gnu packages ruby)
|
| 33 | #:use-module (gnu packages xorg)
|
| 34 | #:use-module (ice-9 match))
|
| 35 |
|
| 36 | (define-public mruby-zest
|
| 37 | (package
|
| 38 | (name "mruby-zest")
|
| 39 | (version "3.0.6")
|
| 40 | (source (origin
|
| 41 | (method git-fetch)
|
| 42 | (uri (git-reference
|
| 43 | (url "https://github.com/mruby-zest/mruby-zest-build")
|
| 44 | (commit version)
|
| 45 | |
| 46 | |
| 47 | |
| 48 | (recursive? #t)))
|
| 49 | (file-name (git-file-name name version))
|
| 50 | (sha256
|
| 51 | (base32
|
| 52 | "0dz4zv1km9805lji2q2qqdd8s8hgfd723dxdzcivbhm612szm1mc"))
|
| 53 | (modules '((guix build utils)))
|
| 54 | (snippet
|
| 55 | '(begin
|
| 56 | |
| 57 | |
| 58 | |
| 59 | (with-directory-excursion "deps"
|
| 60 | (for-each delete-file-recursively
|
| 61 | (list "libuv" "nanovg" "rtosc")))
|
| 62 | |
| 63 | |
| 64 | (substitute* "Makefile"
|
| 65 | (("cd deps/nanovg") "#cd deps/nanovg")
|
| 66 | (("\\$\\(AR\\) rc deps/libnanovg\\.a")
|
| 67 | "#$(AR) rc deps/libnanovg.a")
|
| 68 | (("\\./deps/libnanovg\\.a")
|
| 69 | "-lnanovg")
|
| 70 | (("cd deps/libuv") "#cd deps/libuv")
|
| 71 | (("\\./deps/libuv/\\.libs/libuv\\.a")
|
| 72 | "-luv")
|
| 73 | (("\\./deps/libuv/\\.libs/libuv-win\\.a")
|
| 74 | "-luv-win"))
|
| 75 | |
| 76 | |
| 77 | (substitute* "build_config.rb"
|
| 78 | (("cc\\.include_paths.*\\./deps/nanovg/.*$" all)
|
| 79 | (string-append "#" all))
|
| 80 | (("cc\\.include_paths.*\\./deps/libuv/.*$" all)
|
| 81 | (string-append "#" all))
|
| 82 | (("#\\{`pwd`\\.strip\\}/\\.\\./deps/libnanovg\\.a")
|
| 83 | "-lnanovg")
|
| 84 | (("#\\{`pwd`\\.strip\\}/\\.\\./deps/libuv\\.a")
|
| 85 | "-luv"))
|
| 86 | |
| 87 | (substitute* (find-files "deps/mruby-nanovg" "\\.(c|h)")
|
| 88 | (("nanovg\\.h") "nanovg/nanovg.h")
|
| 89 | (("nanovg_gl\\.h") "nanovg/nanovg_gl.h")
|
| 90 | (("\"\\.\\./\\.\\./nanovg/.*/stb_image_write\\.h\"")
|
| 91 | "<nanovg/stb_image_write.h>"))
|
| 92 | |
| 93 | (substitute* "src/mruby-widget-lib/src/gem.c"
|
| 94 | (("\"\\.\\./\\.\\./\\.\\./deps/.*/rtosc\\.h\"")
|
| 95 | "<rtosc/rtosc.h>"))))))
|
| 96 | (build-system gnu-build-system)
|
| 97 | (arguments
|
| 98 | (list #:tests? #f |
| 99 | #:make-flags
|
| 100 | #~(list (string-append "CC=" #$(cc-for-target))
|
| 101 | "CONFIG_SHELL=bash")
|
| 102 | #:modules
|
| 103 | `(,@%default-gnu-modules
|
| 104 | (srfi srfi-26))
|
| 105 | #:phases
|
| 106 | #~(modify-phases %standard-phases
|
| 107 | (delete 'configure) |
| 108 | (add-after 'unpack 'patch-paths
|
| 109 | (lambda* (#:key inputs #:allow-other-keys)
|
| 110 | |
| 111 | (substitute*
|
| 112 | "src/mruby-widget-lib/mrblib/script.rb"
|
| 113 | (("sans = \\[")
|
| 114 | (string-append
|
| 115 | "sans = [\""
|
| 116 | (search-input-file inputs
|
| 117 | "/share/fonts/truetype/Roboto-Regular.ttf")
|
| 118 | "\", "))
|
| 119 | (("bold = \\[")
|
| 120 | (string-append
|
| 121 | "bold = [\""
|
| 122 | (search-input-file inputs
|
| 123 | "/share/fonts/truetype/Roboto-Bold.ttf")
|
| 124 | "\", ")))
|
| 125 | |
| 126 | (substitute* "src/osc-bridge/src/bridge.c"
|
| 127 | (("fopen\\(\\\"schema/")
|
| 128 | (string-append
|
| 129 | "fopen(\"" #$output "/share/zyn-fusion/schema/")))
|
| 130 | (substitute* "test-libversion.c"
|
| 131 | (("./libzest.so")
|
| 132 | (string-append #$output "/lib/libzest.so")))
|
| 133 | (substitute* "src/mruby-widget-lib/src/api.c"
|
| 134 | ((", \\\"\\./qml/") ", \"../share/zyn-fusion/qml/")
|
| 135 | (("\\./qml/")
|
| 136 | (string-append #$output "/share/zyn-fusion/qml")))))
|
| 137 | |
| 138 | (replace 'install
|
| 139 | (lambda _
|
| 140 | (let* ((bin (string-append #$output "/bin"))
|
| 141 | (lib (string-append #$output "/lib"))
|
| 142 | (share (string-append #$output "/share"))
|
| 143 | (qml (string-append share "/zyn-fusion/qml"))
|
| 144 | (schema (string-append share "/zyn-fusion/schema"))
|
| 145 | (completions
|
| 146 | (string-append share
|
| 147 | "/bash-completion/completions")))
|
| 148 | |
| 149 | (rename-file "zest" "zyn-fusion")
|
| 150 | (install-file "zyn-fusion" bin)
|
| 151 | (install-file "libzest.so" lib)
|
| 152 | (for-each (cut install-file <> qml)
|
| 153 | (append (find-files "src/mruby-zest/qml"
|
| 154 | "\\.qml$")
|
| 155 | (find-files "src/mruby-zest/example"
|
| 156 | "\\.qml$")))
|
| 157 | (install-file "src/osc-bridge/schema/test.json" schema)
|
| 158 | (install-file "completions/zyn-fusion" completions)))))))
|
| 159 | (native-inputs
|
| 160 | (list pkg-config ruby))
|
| 161 | (inputs
|
| 162 | (list font-google-roboto
|
| 163 | libuv
|
| 164 | libx11
|
| 165 | mesa
|
| 166 | nanovg
|
| 167 | rtosc))
|
| 168 | (home-page "https://github.com/mruby-zest/mruby-zest-build")
|
| 169 | (synopsis "Zyn-Fusion user interface")
|
| 170 | (description
|
| 171 | "This package provides Zyn-Fusion user interface for
|
| 172 | @command{zynaddsubfx}.")
|
| 173 | (license
|
| 174 | (list license:lgpl2.1))))
|