| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 |
|
| 20 | (define-module (gnu packages axoloti)
|
| 21 | #:use-module (guix gexp)
|
| 22 | #:use-module (guix utils)
|
| 23 | #:use-module (guix packages)
|
| 24 | #:use-module (guix download)
|
| 25 | #:use-module (guix git-download)
|
| 26 | #:use-module ((guix licenses) #:prefix license:)
|
| 27 | #:use-module (guix build-system gnu)
|
| 28 | #:use-module (guix build-system ant)
|
| 29 | #:use-module (gnu packages)
|
| 30 | #:use-module (gnu packages base)
|
| 31 | #:use-module (gnu packages compression)
|
| 32 | #:use-module (gnu packages cross-base)
|
| 33 | #:use-module (gnu packages embedded)
|
| 34 | #:use-module (gnu packages flashing-tools)
|
| 35 | #:use-module (gnu packages java)
|
| 36 | #:use-module (gnu packages java-graphics)
|
| 37 | #:use-module (gnu packages java-xml)
|
| 38 | #:use-module (gnu packages libusb)
|
| 39 | #:use-module (gnu packages pkg-config)
|
| 40 | #:use-module (gnu packages textutils)
|
| 41 | #:use-module (gnu packages version-control))
|
| 42 |
|
| 43 | |
| 44 | |
| 45 | (define libusb-for-axoloti
|
| 46 | (package
|
| 47 | (inherit libusb)
|
| 48 | (version "1.0.23")
|
| 49 | (source
|
| 50 | (origin
|
| 51 | (method url-fetch)
|
| 52 | (uri (string-append "https://github.com/libusb/libusb/"
|
| 53 | "releases/download/v" version
|
| 54 | "/libusb-" version ".tar.bz2"))
|
| 55 | (sha256
|
| 56 | (base32 "13dd2a9x290d1q8nb1lqiaf36grcvns5ripk5k2xm0lajmpc04fv"))
|
| 57 | (patches (list (search-patch "libusb-for-axoloti.patch")))))))
|
| 58 |
|
| 59 | (define dfu-util-for-axoloti
|
| 60 | (package (inherit dfu-util)
|
| 61 | (name "axoloti-dfu-util")
|
| 62 | (version "0.8")
|
| 63 | (source
|
| 64 | (origin
|
| 65 | (method url-fetch)
|
| 66 | (uri (string-append "http://dfu-util.sourceforge.net/releases/"
|
| 67 | "dfu-util-" version ".tar.gz"))
|
| 68 | (sha256
|
| 69 | (base32
|
| 70 | "0n7h08avlzin04j93m6hkq9id6hxjiiix7ff9gc2n89aw6dxxjsm"))))
|
| 71 | (inputs
|
| 72 | `(("libusb" ,libusb-for-axoloti)))))
|
| 73 |
|
| 74 | (define-public axoloti-runtime
|
| 75 | (package
|
| 76 | (name "axoloti-runtime")
|
| 77 | (version "1.0.12-2")
|
| 78 | (source
|
| 79 | (origin
|
| 80 | (method git-fetch)
|
| 81 | (uri (git-reference
|
| 82 | (url "https://github.com/axoloti/axoloti")
|
| 83 | (commit version)))
|
| 84 | (file-name (git-file-name name version))
|
| 85 | (sha256
|
| 86 | (base32 "1qffis277wshldr3i939b0r2x3a2mlr53samxqmr2nk1sfm2b4w9"))
|
| 87 | (modules '((guix build utils)))
|
| 88 | |
| 89 | (snippet
|
| 90 | '(delete-file-recursively "lib/"))))
|
| 91 | (build-system gnu-build-system)
|
| 92 | (arguments
|
| 93 | (list
|
| 94 | #:tests? #f |
| 95 | #:modules '((guix build gnu-build-system)
|
| 96 | (guix build utils)
|
| 97 | (srfi srfi-1)
|
| 98 | (srfi srfi-26)
|
| 99 | (ice-9 match)
|
| 100 | (ice-9 regex))
|
| 101 | #:phases
|
| 102 | #~(modify-phases %standard-phases
|
| 103 | (add-after 'unpack 'patch-paths
|
| 104 | (lambda* (#:key inputs #:allow-other-keys)
|
| 105 | |
| 106 | (invoke "unzip" "-o" (assoc-ref inputs "chibios"))
|
| 107 | (invoke "mv" "ChibiOS_2.6.9" "chibios")
|
| 108 | (with-directory-excursion "chibios/ext"
|
| 109 | (invoke "unzip" "-o" "fatfs-0.9-patched.zip"))
|
| 110 |
|
| 111 | |
| 112 | (substitute* "chibios/os/various/shell.c"
|
| 113 | (("#ifdef __DATE__") "#if 0"))
|
| 114 |
|
| 115 | |
| 116 | (substitute* '("src/main/java/qcmds/QCmdCompileFirmware.java"
|
| 117 | "src/main/java/qcmds/QCmdCompilePatch.java"
|
| 118 | "src/main/java/qcmds/QCmdFlashDFU.java")
|
| 119 | (("/bin/sh") (which "sh")))
|
| 120 |
|
| 121 | |
| 122 | (substitute* "firmware/Makefile.patch"
|
| 123 | (("arm-none-eabi-(gcc|g\\+\\+|objcopy|objdump)" tool)
|
| 124 | (which tool)))
|
| 125 |
|
| 126 | |
| 127 | |
| 128 | (substitute* "firmware/Makefile.patch"
|
| 129 | (("^BDIR=.*") "BDIR=${axoloti_home}/build\n"))
|
| 130 |
|
| 131 | |
| 132 | (substitute* '("firmware/Makefile"
|
| 133 | "firmware/flasher/Makefile"
|
| 134 | "firmware/mounter/Makefile")
|
| 135 | (("TRGT =.*")
|
| 136 | (string-append "TRGT = "
|
| 137 | (assoc-ref inputs "cross-toolchain")
|
| 138 | "/bin/arm-none-eabi-\n")))
|
| 139 |
|
| 140 | |
| 141 | (substitute* '("firmware/compile_firmware_linux.sh"
|
| 142 | "firmware/compile_patch_linux.sh")
|
| 143 | (("make") (which "make")))
|
| 144 |
|
| 145 | |
| 146 | (substitute* "platform_linux/upload_fw_dfu.sh"
|
| 147 | (("-f \"\\$\\{platformdir\\}/bin/dfu-util\"") "-z \"\"")
|
| 148 | (("\\./dfu-util") (which "dfu-util")))))
|
| 149 | (delete 'configure)
|
| 150 | (replace 'build
|
| 151 | |
| 152 | (lambda _
|
| 153 | (with-directory-excursion "platform_linux"
|
| 154 | (invoke "sh" "compile_firmware.sh"))))
|
| 155 | (replace 'install
|
| 156 | (lambda* (#:key inputs outputs #:allow-other-keys)
|
| 157 | (let* ((share (string-append #$output "/share/axoloti/"))
|
| 158 | (doc (string-append share "doc"))
|
| 159 | (dir (getcwd))
|
| 160 | (pats '("/doc/[^/]+$"
|
| 161 | "/patches/[^/]+/[^/]+$"
|
| 162 | "/objects/[^/]+/[^/]+$"
|
| 163 | "/firmware/.+"
|
| 164 | "/chibios/[^/]+$"
|
| 165 | "/chibios/boards/ST_STM32F4_DISCOVERY/[^/]+$"
|
| 166 | "/chibios/(ext|os|docs)/.+"
|
| 167 | "/CMSIS/[^/]+/[^/]+$"
|
| 168 | "/patch/[^/]+/[^/]+$"
|
| 169 | "/[^/]+\\.txt$"))
|
| 170 | (pattern (string-append
|
| 171 | "(" (string-join
|
| 172 | (map (cut string-append dir <>)
|
| 173 | pats)
|
| 174 | "|") ")"))
|
| 175 | (files (find-files dir
|
| 176 | (lambda (file stat)
|
| 177 | (and (eq? 'regular (stat:type stat))
|
| 178 | (string-match pattern file))))))
|
| 179 | (for-each (lambda (file)
|
| 180 | (install-file file
|
| 181 | (string-append
|
| 182 | share
|
| 183 | (regexp-substitute
|
| 184 | #f
|
| 185 | (string-match dir (dirname file))
|
| 186 | 'pre 'post))))
|
| 187 | files)))))))
|
| 188 | (inputs
|
| 189 | `(("chibios"
|
| 190 | ,(origin
|
| 191 | (method url-fetch)
|
| 192 | (uri "mirror://sourceforge/chibios/ChibiOS%20GPL3/Version%202.6.9/ChibiOS_2.6.9.zip")
|
| 193 | (sha256
|
| 194 | (base32
|
| 195 | "0lb5s8pkj80mqhsy47mmq0lqk34s2a2m3xagzihalvabwd0frhlj"))))
|
| 196 | |
| 197 | ("make" ,gnu-make)
|
| 198 | |
| 199 | ("cross-toolchain" ,(make-arm-none-eabi-nano-toolchain-4.9))
|
| 200 | |
| 201 | ("dfu-util" ,dfu-util-for-axoloti)))
|
| 202 | (native-inputs
|
| 203 | (list unzip))
|
| 204 | (home-page "http://www.axoloti.com/")
|
| 205 | (synopsis "Audio development environment for the Axoloti core board")
|
| 206 | (description
|
| 207 | "The Axoloti patcher offers a “patcher” environment similar to Pure Data
|
| 208 | for sketching digital audio algorithms. The patches run on a standalone
|
| 209 | powerful microcontroller board: Axoloti Core. This package provides the
|
| 210 | runtime.")
|
| 211 | (license license:gpl3+)))
|
| 212 |
|
| 213 | (define-public axoloti-patcher
|
| 214 | (package (inherit axoloti-runtime)
|
| 215 | (name "axoloti-patcher")
|
| 216 | (version (package-version axoloti-runtime))
|
| 217 | (arguments
|
| 218 | (list
|
| 219 | #:tests? #f |
| 220 | #:modules '((guix build gnu-build-system)
|
| 221 | ((guix build ant-build-system) #:prefix ant:)
|
| 222 | (guix build utils)
|
| 223 | (srfi srfi-1)
|
| 224 | (srfi srfi-26)
|
| 225 | (ice-9 match)
|
| 226 | (ice-9 regex)
|
| 227 | (sxml simple)
|
| 228 | (sxml xpath)
|
| 229 | (sxml transform))
|
| 230 | #:imported-modules `((guix build ant-build-system)
|
| 231 | ,@%default-gnu-imported-modules)
|
| 232 | #:phases
|
| 233 | #~(modify-phases %standard-phases
|
| 234 | (delete 'configure)
|
| 235 | (replace 'build
|
| 236 | (lambda* (#:key inputs #:allow-other-keys)
|
| 237 | (setenv "JAVA_HOME" (assoc-ref inputs "icedtea"))
|
| 238 | |
| 239 | |
| 240 | |
| 241 | (let* ((build.xml (with-input-from-file "build.xml"
|
| 242 | (lambda _
|
| 243 | (xml->sxml #:trim-whitespace? #t))))
|
| 244 | (jars (append-map (match-lambda
|
| 245 | (((? (cut string-prefix? "java-" <>)
|
| 246 | label) . directory)
|
| 247 | (find-files directory "\\.jar$"))
|
| 248 | (_ '()))
|
| 249 | inputs))
|
| 250 | (classpath (string-join jars ":"))
|
| 251 | (fileset (map (lambda (jar)
|
| 252 | `(zipfileset (@ (excludes "META-INF/*.SF")
|
| 253 | (src ,jar))))
|
| 254 | jars)))
|
| 255 | (call-with-output-file "build.xml"
|
| 256 | (lambda (port)
|
| 257 | (sxml->xml
|
| 258 | (pre-post-order
|
| 259 | build.xml
|
| 260 | `( |
| 261 | |
| 262 | (jar . ,(lambda (tag . kids)
|
| 263 | `(jar ,@(append-map
|
| 264 | (filter (lambda (e)
|
| 265 | (not (eq? 'zipfileset (car e)))))
|
| 266 | kids)
|
| 267 | ,@fileset)))
|
| 268 | |
| 269 | |
| 270 | |
| 271 | (target . ,(lambda (tag . kids)
|
| 272 | (let ((name ((sxpath '(name *text*))
|
| 273 | (car kids))))
|
| 274 | (if (or (member "bundle" name)
|
| 275 | (member "-post-jar" name))
|
| 276 | '() |
| 277 | `(,tag ,@kids)))))
|
| 278 | (*default* . ,(lambda (tag . kids) `(,tag ,@kids)))
|
| 279 | (*text* . ,(lambda (_ txt)
|
| 280 | (match txt
|
| 281 | |
| 282 | ("${TODAY}" "(unknown)")
|
| 283 | (_ txt))))))
|
| 284 | port)))
|
| 285 |
|
| 286 | |
| 287 | (invoke "ant"
|
| 288 | (string-append "-Djavac.classpath=" classpath)
|
| 289 | "-Dbuild.runtime=true"
|
| 290 | "-Dbuild.time=01/01/1970 00:00:00"
|
| 291 | "-Djavac.source=1.7"
|
| 292 | "-Djavac.target=1.7"
|
| 293 | (string-append "-Dtag.short.version="
|
| 294 | #$version)))))
|
| 295 | (replace 'install
|
| 296 | (lambda* (#:key inputs #:allow-other-keys)
|
| 297 | (let ((share (string-append #$output "/share/axoloti/")))
|
| 298 | (install-file "dist/Axoloti.jar" share)
|
| 299 |
|
| 300 | |
| 301 | |
| 302 | (install-file "build.xml" share)
|
| 303 |
|
| 304 | |
| 305 | (mkdir (string-append #$output "/bin"))
|
| 306 | (let ((target (string-append #$output "/bin/Axoloti")))
|
| 307 | (with-output-to-file target
|
| 308 | (lambda ()
|
| 309 | (let* ((dir (string-append #$output "/share/axoloti"))
|
| 310 | (runtime (search-input-directory inputs
|
| 311 | "share/axoloti"))
|
| 312 | (toolchain (assoc-ref inputs "cross-toolchain"))
|
| 313 | (includes (string-append
|
| 314 | toolchain
|
| 315 | "/arm-none-eabi/include/:"
|
| 316 | toolchain
|
| 317 | "/arm-none-eabi/include/c++:"
|
| 318 | toolchain
|
| 319 | "/arm-none-eabi/include/c++/arm-none-eabi/armv7e-m")))
|
| 320 | (display
|
| 321 | (string-append "#!" (which "sh") "\n"
|
| 322 | "export CROSS_CPATH=" includes "\n"
|
| 323 | "export CROSS_CPLUS_INCLUDE_PATH=" includes "\n"
|
| 324 | "export CROSS_LIBRARY_PATH="
|
| 325 | toolchain "/arm-none-eabi/lib" "\n"
|
| 326 | (which "java")
|
| 327 | " -Daxoloti_release=" runtime
|
| 328 | " -Daxoloti_runtime=" runtime
|
| 329 | " -jar " dir "/Axoloti.jar")))))
|
| 330 | (chmod target #o555)))))
|
| 331 | (add-after 'install 'strip-jar-timestamps
|
| 332 | (assoc-ref ant:%standard-phases 'strip-jar-timestamps)))))
|
| 333 | (inputs
|
| 334 | `(("icedtea" ,icedtea "jdk")
|
| 335 | ("cross-toolchain" ,(make-arm-none-eabi-nano-toolchain-4.9))
|
| 336 | ("java-simple-xml" ,java-simple-xml)
|
| 337 | ("java-rsyntaxtextarea" ,java-rsyntaxtextarea)
|
| 338 | ("java-usb4java" ,java-usb4java)
|
| 339 | ("java-jsch" ,java-jsch)
|
| 340 | ("java-slf4j-api" ,java-slf4j-api)
|
| 341 | ("java-jgit" ,java-jgit-4.2)
|
| 342 | ("axoloti-runtime" ,axoloti-runtime)))
|
| 343 | (native-inputs
|
| 344 | (list ant zip |
| 345 | unzip))
|
| 346 | (description
|
| 347 | "The Axoloti patcher offers a “patcher” environment similar to Pure Data
|
| 348 | for sketching digital audio algorithms. The patches run on a standalone
|
| 349 | powerful microcontroller board: Axoloti Core. This package provides the
|
| 350 | patcher application.")))
|
| 351 |
|
| 352 | (define-public ksoloti-runtime
|
| 353 | (let ((revision "0")
|
| 354 | (commit "b7ae4753b33532597db232285f4f3c1808f516b4"))
|
| 355 | (package
|
| 356 | (name "ksoloti-runtime")
|
| 357 | (version (git-version "1.1.0" revision commit))
|
| 358 | (source
|
| 359 | (origin
|
| 360 | (method git-fetch)
|
| 361 | (uri (git-reference
|
| 362 | (url "https://github.com/ksoloti/ksoloti")
|
| 363 | (commit commit)))
|
| 364 | (file-name (git-file-name name version))
|
| 365 | (sha256
|
| 366 | (base32 "0pf8zpzfx6nibwqrxbagpp3qpypfabshs7mign84dwsl9qdal1cv"))
|
| 367 | (modules '((guix build utils)))
|
| 368 | |
| 369 | (snippet
|
| 370 | '(delete-file-recursively "lib/"))))
|
| 371 | (build-system gnu-build-system)
|
| 372 | (arguments
|
| 373 | (list
|
| 374 | #:tests? #f |
| 375 | #:modules '((guix build gnu-build-system)
|
| 376 | (guix build utils)
|
| 377 | (srfi srfi-1)
|
| 378 | (srfi srfi-26)
|
| 379 | (ice-9 match)
|
| 380 | (ice-9 regex))
|
| 381 | #:phases
|
| 382 | #~(modify-phases %standard-phases
|
| 383 | (add-after 'unpack 'patch-paths
|
| 384 | (lambda* (#:key inputs #:allow-other-keys)
|
| 385 | |
| 386 | (substitute* "chibios/os/various/shell.c"
|
| 387 | (("#ifdef __DATE__") "#if 0"))
|
| 388 |
|
| 389 | (substitute* "firmware/compile_firmware.sh"
|
| 390 | (("make -j8")
|
| 391 | (string-append "make USE_VERBOSE_COMPILE=yes -j"
|
| 392 | (number->string (parallel-job-count)))))
|
| 393 |
|
| 394 | |
| 395 | (substitute* '("src/main/java/qcmds/QCmdCompileFirmware.java"
|
| 396 | "src/main/java/qcmds/QCmdCompilePatch.java"
|
| 397 | "src/main/java/qcmds/QCmdFlashDFU.java")
|
| 398 | (("/bin/sh") (which "sh")))
|
| 399 |
|
| 400 | |
| 401 | (substitute* "firmware/Makefile.patch.mk"
|
| 402 | (("arm-none-eabi-(gcc|g\\+\\+|objcopy|objdump|size)" tool)
|
| 403 | (which tool)))
|
| 404 |
|
| 405 | |
| 406 | |
| 407 | (substitute* "firmware/Makefile.patch.mk"
|
| 408 | (("^CHIBIOS +=.*") "CHIBIOS=${axoloti_firmware}/../chibios\n")
|
| 409 | (("^BUILDDIR=.*") "BUILDDIR=${axoloti_libraries}/build\n"))
|
| 410 |
|
| 411 | |
| 412 | (substitute* '("firmware/Makefile"
|
| 413 | "firmware/flasher/Makefile"
|
| 414 | "firmware/mounter/Makefile")
|
| 415 | (("TRGT =.*")
|
| 416 | (string-append "TRGT = "
|
| 417 | (assoc-ref inputs "cross-toolchain")
|
| 418 | "/bin/arm-none-eabi-\n")))
|
| 419 |
|
| 420 | |
| 421 | (substitute* '("firmware/compile_firmware.sh"
|
| 422 | "firmware/compile_patch.sh")
|
| 423 | (("make") (which "make")))
|
| 424 |
|
| 425 | |
| 426 | (substitute* "firmware/upload_fw_dfu.sh"
|
| 427 | (("-f \"\\$\\{platformdir\\}/bin/dfu-util\"") "-z \"\"")
|
| 428 | (("\\./dfu-util") (which "dfu-util")))))
|
| 429 | (delete 'configure)
|
| 430 | (replace 'build
|
| 431 | |
| 432 | (lambda _
|
| 433 | (with-directory-excursion "firmware"
|
| 434 | (substitute* "compile_firmware.sh"
|
| 435 | (("`uname`") (string-append "`" (which "uname") "`")))
|
| 436 | (invoke "sh" "compile_firmware.sh" "BOARD_KSOLOTI_CORE")
|
| 437 | (invoke "sh" "compile_firmware.sh" "BOARD_AXOLOTI_CORE"))))
|
| 438 | (replace 'install
|
| 439 | (lambda* (#:key inputs #:allow-other-keys)
|
| 440 | (let* ((share (string-append #$output "/share/ksoloti/"))
|
| 441 | (doc (string-append share "doc"))
|
| 442 | (dir (getcwd))
|
| 443 | (pats '("/doc/[^/]+$"
|
| 444 | "/patches/[^/]+/[^/]+$"
|
| 445 | "/objects/[^/]+/[^/]+$"
|
| 446 | "/firmware/.+"
|
| 447 | "/platform_linux/.+"
|
| 448 | "/chibios/[^/]+$"
|
| 449 | "/chibios/boards/ST_STM32F4_DISCOVERY/[^/]+$"
|
| 450 | "/chibios/(ext|os|docs)/.+"
|
| 451 | "/CMSIS/[^/]+/[^/]+$"
|
| 452 | "/patch/[^/]+/[^/]+$"
|
| 453 | "/[^/]+\\.txt$"))
|
| 454 | (pattern (string-append
|
| 455 | "(" (string-join
|
| 456 | (map (cut string-append dir <>)
|
| 457 | pats)
|
| 458 | "|") ")"))
|
| 459 | (files (find-files dir
|
| 460 | (lambda (file stat)
|
| 461 | (and (eq? 'regular (stat:type stat))
|
| 462 | (string-match pattern file))))))
|
| 463 | (for-each (lambda (file)
|
| 464 | (install-file file
|
| 465 | (string-append
|
| 466 | share
|
| 467 | (regexp-substitute
|
| 468 | #f
|
| 469 | (string-match dir (dirname file))
|
| 470 | 'pre 'post))))
|
| 471 | files)))))))
|
| 472 | (inputs
|
| 473 | `( |
| 474 | ("make" ,gnu-make)
|
| 475 | |
| 476 | ("cross-toolchain" ,(make-arm-none-eabi-nano-toolchain-9-2020-q2-update))
|
| 477 | |
| 478 | ("dfu-util" ,dfu-util)))
|
| 479 | (home-page "https://ksoloti.github.io/")
|
| 480 | (synopsis "Audio development environment for the Ksoloti board")
|
| 481 | (description
|
| 482 | "Ksoloti is an environment for generating and processing digital audio.
|
| 483 | It can be a programmable virtual modular synthesizer, polysynth, drone box,
|
| 484 | sequencer, chord generator, multi effect, sample player, looper, granular
|
| 485 | sampler, MIDI generator/processor, CV or trigger generator, anything in
|
| 486 | between, and more.
|
| 487 |
|
| 488 | The Ksoloti Core is a rework of the discontinued Axoloti Core board. In
|
| 489 | short, Ksoloti aims for maximum compatibility with the original Axoloti, but
|
| 490 | with some layout changes and added features.
|
| 491 |
|
| 492 | This package provides the runtime.")
|
| 493 | (license license:gpl3+))))
|
| 494 |
|
| 495 | (define-public ksoloti-patcher
|
| 496 | (package
|
| 497 | (inherit ksoloti-runtime)
|
| 498 | (name "ksoloti-patcher")
|
| 499 | (version (package-version ksoloti-runtime))
|
| 500 | (arguments
|
| 501 | (list
|
| 502 | #:tests? #f |
| 503 | #:modules '((guix build gnu-build-system)
|
| 504 | ((guix build ant-build-system) #:prefix ant:)
|
| 505 | (guix build utils)
|
| 506 | (srfi srfi-1)
|
| 507 | (srfi srfi-26)
|
| 508 | (ice-9 match)
|
| 509 | (ice-9 regex)
|
| 510 | (sxml simple)
|
| 511 | (sxml xpath)
|
| 512 | (sxml transform))
|
| 513 | #:imported-modules `((guix build ant-build-system)
|
| 514 | ,@%default-gnu-imported-modules)
|
| 515 | #:phases
|
| 516 | #~(modify-phases %standard-phases
|
| 517 | (delete 'configure)
|
| 518 | (add-after 'unpack 'patch-for-tiling-window-managers
|
| 519 | (lambda _
|
| 520 | |
| 521 | |
| 522 | |
| 523 | (substitute* "src/main/java/axoloti/ObjectSearchFrame.java"
|
| 524 | (("formWindowLostFocus\\(evt\\)") "return"))))
|
| 525 | (replace 'build
|
| 526 | (lambda* (#:key inputs #:allow-other-keys)
|
| 527 | (setenv "JAVA_HOME"
|
| 528 | (dirname
|
| 529 | (dirname (search-input-file inputs "/bin/javac"))))
|
| 530 | |
| 531 | |
| 532 | |
| 533 | (let* ((build.xml (with-input-from-file "build.xml"
|
| 534 | (lambda _
|
| 535 | (xml->sxml #:trim-whitespace? #t))))
|
| 536 | (jars (append-map (match-lambda
|
| 537 | (((? (cut string-prefix? "java-" <>)
|
| 538 | label) . directory)
|
| 539 | (find-files directory "\\.jar$"))
|
| 540 | (_ '()))
|
| 541 | inputs))
|
| 542 | (all-jars (append jars (find-files "lib" "\\.jar$")))
|
| 543 | (classpath (string-join all-jars ":"))
|
| 544 | (fileset (map (lambda (jar)
|
| 545 | `(zipfileset (@ (excludes "META-INF/*.SF")
|
| 546 | (src ,jar))))
|
| 547 | all-jars)))
|
| 548 | (call-with-output-file "build.xml"
|
| 549 | (lambda (port)
|
| 550 | (sxml->xml
|
| 551 | (pre-post-order
|
| 552 | build.xml
|
| 553 | `( |
| 554 | |
| 555 | (jar . ,(lambda (tag . kids)
|
| 556 | `(jar ,@(append-map
|
| 557 | (filter (lambda (e)
|
| 558 | (not (eq? 'zipfileset (car e)))))
|
| 559 | kids)
|
| 560 | ,@fileset)))
|
| 561 | |
| 562 | |
| 563 | |
| 564 | (target . ,(lambda (tag . kids)
|
| 565 | (let ((name ((sxpath '(name *text*))
|
| 566 | (car kids))))
|
| 567 | (if (or (member "bundle" name)
|
| 568 | (member "-post-jar" name))
|
| 569 | '() |
| 570 | `(,tag ,@kids)))))
|
| 571 | (*default* . ,(lambda (tag . kids) `(,tag ,@kids)))
|
| 572 | (*text* . ,(lambda (_ txt)
|
| 573 | (match txt
|
| 574 | |
| 575 | ("${TODAY}" "(unknown)")
|
| 576 | (_ txt))))))
|
| 577 | port)))
|
| 578 |
|
| 579 | |
| 580 | (invoke "ant"
|
| 581 | (string-append "-Djavac.classpath=" classpath)
|
| 582 | "-Dbuild.runtime=true"
|
| 583 | "-Dbuild.time=01/01/1970 00:00:00"
|
| 584 | "-Djavac.source=1.8"
|
| 585 | "-Djavac.target=1.8"
|
| 586 | (string-append "-Dtag.short.version="
|
| 587 | #$version)))))
|
| 588 | (replace 'install
|
| 589 | (lambda* (#:key inputs #:allow-other-keys)
|
| 590 | (let ((share (string-append #$output "/share/ksoloti/")))
|
| 591 | (install-file "dist/Ksoloti.jar" share)
|
| 592 |
|
| 593 | |
| 594 | |
| 595 | (install-file "build.xml" share)
|
| 596 |
|
| 597 | |
| 598 | (mkdir (string-append #$output "/bin"))
|
| 599 | (let ((target (string-append #$output "/bin/Ksoloti")))
|
| 600 | (with-output-to-file target
|
| 601 | (lambda ()
|
| 602 | (let* ((dir (string-append #$output "/share/ksoloti"))
|
| 603 | (runtime (search-input-directory inputs
|
| 604 | "share/ksoloti"))
|
| 605 | (toolchain (assoc-ref inputs "cross-toolchain"))
|
| 606 | (libstdc++ (assoc-ref inputs "libstdc++"))
|
| 607 | (includes (string-append
|
| 608 | toolchain
|
| 609 | "/arm-none-eabi/include/c++:"
|
| 610 | libstdc++
|
| 611 | "/arm-none-eabi/include/c++/arm-none-eabi/thumb/v7-m/nofp:"
|
| 612 | toolchain
|
| 613 | "/arm-none-eabi/include/"))
|
| 614 | (marlin.jar
|
| 615 | (search-input-file inputs "/share/java/marlin.jar")))
|
| 616 | (display
|
| 617 | (string-append "#!" (which "sh") "\n"
|
| 618 | "export PATH=" toolchain "/bin:$PATH\n"
|
| 619 | "export CROSS_CPLUS_INCLUDE_PATH=" includes "\n"
|
| 620 | "export CROSS_LIBRARY_PATH="
|
| 621 | toolchain "/arm-none-eabi/lib" "\n"
|
| 622 | (which "java")
|
| 623 | " -Xbootclasspath/a:" marlin.jar
|
| 624 | " --add-exports=java.desktop/sun.java2d.pipe=ALL-UNNAMED"
|
| 625 | " --add-exports=java.base/sun.security.action=ALL-UNNAMED"
|
| 626 | " -Dsun.java2d.renderer=org.marlin.pisces.MarlinRenderingEngine"
|
| 627 | " -Dsun.java2d.d3d=false"
|
| 628 | " -Dsun.java2d.dpiaware=true"
|
| 629 | " -Daxoloti_platform=" runtime "/platform_linux"
|
| 630 | " -Daxoloti_firmware=" runtime "/firmware"
|
| 631 | " -jar " dir "/Ksoloti.jar")))))
|
| 632 | (chmod target #o555)))))
|
| 633 | (add-after 'install 'strip-jar-timestamps
|
| 634 | (assoc-ref ant:%standard-phases 'strip-jar-timestamps)))))
|
| 635 | (inputs
|
| 636 | `(("openjdk" ,openjdk17 "jdk")
|
| 637 | ("cross-toolchain" ,(make-arm-none-eabi-nano-toolchain-9-2020-q2-update))
|
| 638 | ("java-autocomplete" ,java-autocomplete)
|
| 639 | ("java-flatlaf" ,java-flatlaf)
|
| 640 | ("java-flatlaf-intellij-themes" ,java-flatlaf-intellij-themes)
|
| 641 | ("java-jgit" ,java-jgit-4.2)
|
| 642 | ("java-jsch" ,java-jsch)
|
| 643 | ("java-marlin-renderer" ,java-marlin-renderer)
|
| 644 | ("java-rsyntaxtextarea" ,java-rsyntaxtextarea)
|
| 645 | ("java-simple-xml" ,java-simple-xml)
|
| 646 | ("java-usb4java" ,java-usb4java)
|
| 647 | ("java-slf4j-api" ,java-slf4j-api)
|
| 648 | ("ksoloti-runtime" ,ksoloti-runtime)))
|
| 649 | (native-inputs
|
| 650 | (list ant zip |
| 651 | unzip))
|
| 652 | (description
|
| 653 | "Ksoloti is an environment for generating and processing digital audio.
|
| 654 | It can be a programmable virtual modular synthesizer, polysynth, drone box,
|
| 655 | sequencer, chord generator, multi effect, sample player, looper, granular
|
| 656 | sampler, MIDI generator/processor, CV or trigger generator, anything in
|
| 657 | between, and more.
|
| 658 |
|
| 659 | The Ksoloti Core is a rework of the discontinued Axoloti Core board. In
|
| 660 | short, Ksoloti aims for maximum compatibility with the original Axoloti, but
|
| 661 | with some layout changes and added features.
|
| 662 |
|
| 663 | This package provides the patcher application.")))
|