1
Fork 0
mirror of https://https.git.savannah.gnu.org/git/guix.git/ synced 2025-07-12 18:10:47 +02:00

gnu: ksoloti-runtime: Update to 1.1.0-0.b7ae4753b.

* gnu/packages/axoloti.scm (ksoloti-runtime): Update to 1.1.0-0.b7ae4753b.
[arguments]: Adjust.
(ksoloti-patcher)[arguments]: Set axoloti_platform and axoloti_firmware in
launcher.

Change-Id: I214267ece9240e651118c90a36c5b0b01a252566
This commit is contained in:
Ricardo Wurmus 2025-04-27 18:53:49 +02:00
parent eb7f104338
commit 4e79ec48af
No known key found for this signature in database
GPG key ID: 197A5888235FACAC

View file

@ -350,132 +350,136 @@ powerful microcontroller board: Axoloti Core. This package provides the
patcher application."))) patcher application.")))
(define-public ksoloti-runtime (define-public ksoloti-runtime
(package (let ((revision "0")
(name "ksoloti-runtime") (commit "b7ae4753b33532597db232285f4f3c1808f516b4"))
(version "1.1.0") (package
(source (name "ksoloti-runtime")
(origin (version (git-version "1.1.0" revision commit))
(method git-fetch) (source
(uri (git-reference (origin
(url "https://github.com/ksoloti/ksoloti") (method git-fetch)
(commit version))) (uri (git-reference
(file-name (git-file-name name version)) (url "https://github.com/ksoloti/ksoloti")
(sha256 (commit commit)))
(base32 "0lf4jqd1jwqmapp597zj33zgq7576i1fkww8aqckrpbknnmydrw5")) (file-name (git-file-name name version))
(modules '((guix build utils))) (sha256
;; Remove pre-built Java binaries. (base32 "0pf8zpzfx6nibwqrxbagpp3qpypfabshs7mign84dwsl9qdal1cv"))
(snippet (modules '((guix build utils)))
'(delete-file-recursively "lib/")))) ;; Remove pre-built Java binaries.
(build-system gnu-build-system) (snippet
(arguments '(delete-file-recursively "lib/"))))
(list (build-system gnu-build-system)
#:tests? #f ; no check target (arguments
#:modules '((guix build gnu-build-system) (list
(guix build utils) #:tests? #f ; no check target
(srfi srfi-1) #:modules '((guix build gnu-build-system)
(srfi srfi-26) (guix build utils)
(ice-9 match) (srfi srfi-1)
(ice-9 regex)) (srfi srfi-26)
#:phases (ice-9 match)
#~(modify-phases %standard-phases (ice-9 regex))
(add-after 'unpack 'patch-paths #:phases
(lambda* (#:key inputs #:allow-other-keys) #~(modify-phases %standard-phases
;; Remove source of non-determinism in ChibiOS (add-after 'unpack 'patch-paths
(substitute* "chibios/os/various/shell.c" (lambda* (#:key inputs #:allow-other-keys)
(("#ifdef __DATE__") "#if 0")) ;; Remove source of non-determinism in ChibiOS
(substitute* "chibios/os/various/shell.c"
(("#ifdef __DATE__") "#if 0"))
(substitute* "firmware/compile_firmware_linux.sh" (substitute* "firmware/compile_firmware.sh"
(("make -j16") (("make -j8")
"make USE_VERBOSE_COMPILE=yes")) (string-append "make USE_VERBOSE_COMPILE=yes -j"
(number->string (parallel-job-count)))))
;; Patch shell paths ;; Patch shell paths
(substitute* '("src/main/java/qcmds/QCmdCompileFirmware.java" (substitute* '("src/main/java/qcmds/QCmdCompileFirmware.java"
"src/main/java/qcmds/QCmdCompilePatch.java" "src/main/java/qcmds/QCmdCompilePatch.java"
"src/main/java/qcmds/QCmdFlashDFU.java") "src/main/java/qcmds/QCmdFlashDFU.java")
(("/bin/sh") (which "sh"))) (("/bin/sh") (which "sh")))
;; Override cross compiler base name ;; Override cross compiler base name
(substitute* '"firmware/Makefile.patch.mk" (substitute* "firmware/Makefile.patch.mk"
(("arm-none-eabi-(gcc|g\\+\\+|objcopy|objdump|size)" tool) (("arm-none-eabi-(gcc|g\\+\\+|objcopy|objdump|size)" tool)
(which tool))) (which tool)))
;; XXX: for some reason the whitespace substitution does not ;; XXX: for some reason the whitespace substitution does not
;; work, so we disable it. ;; work, so we disable it.
(substitute* "firmware/Makefile.patch.mk" (substitute* "firmware/Makefile.patch.mk"
(("^BUILDDIR=.*") "BUILDDIR=${axoloti_libraries}/build\n")) (("^CHIBIOS +=.*") "CHIBIOS=${axoloti_firmware}/../chibios\n")
(("^BUILDDIR=.*") "BUILDDIR=${axoloti_libraries}/build\n"))
;; Hardcode full path to compiler tools ;; Hardcode full path to compiler tools
(substitute* '("firmware/Makefile" (substitute* '("firmware/Makefile"
"firmware/flasher/Makefile" "firmware/flasher/Makefile"
"firmware/mounter/Makefile") "firmware/mounter/Makefile")
(("TRGT =.*") (("TRGT =.*")
(string-append "TRGT = " (string-append "TRGT = "
(assoc-ref inputs "cross-toolchain") (assoc-ref inputs "cross-toolchain")
"/bin/arm-none-eabi-\n"))) "/bin/arm-none-eabi-\n")))
;; Hardcode path to "make" ;; Hardcode path to "make"
(substitute* '("firmware/compile_firmware_linux.sh" (substitute* '("firmware/compile_firmware.sh"
"firmware/compile_patch_linux.sh") "firmware/compile_patch.sh")
(("make") (which "make"))) (("make") (which "make")))
;; Hardcode path to "dfu-util" ;; Hardcode path to "dfu-util"
(substitute* "platform_linux/upload_fw_dfu.sh" (substitute* "firmware/upload_fw_dfu.sh"
(("-f \"\\$\\{platformdir\\}/bin/dfu-util\"") "-z \"\"") (("-f \"\\$\\{platformdir\\}/bin/dfu-util\"") "-z \"\"")
(("\\./dfu-util") (which "dfu-util"))))) (("\\./dfu-util") (which "dfu-util")))))
(delete 'configure) (delete 'configure)
(replace 'build (replace 'build
;; Build Axoloti firmware with cross-compiler ;; Build Axoloti firmware with cross-compiler
(lambda _ (lambda _
(with-directory-excursion "platform_linux" (with-directory-excursion "firmware"
(substitute* "compile_firmware.sh" (substitute* "compile_firmware.sh"
(("^\"\\$\\{axoloti.*_firmware\\}/compile_firmware_linux.sh" m) (("`uname`") (string-append "`" (which "uname") "`")))
(string-append (which "bash") " " m))) (invoke "sh" "compile_firmware.sh" "BOARD_KSOLOTI_CORE")
(invoke "sh" "compile_firmware.sh" "BOARD_KSOLOTI_CORE") (invoke "sh" "compile_firmware.sh" "BOARD_AXOLOTI_CORE"))))
(invoke "sh" "compile_firmware.sh" "BOARD_AXOLOTI_CORE")))) (replace 'install
(replace 'install (lambda* (#:key inputs #:allow-other-keys)
(lambda* (#:key inputs #:allow-other-keys) (let* ((share (string-append #$output "/share/ksoloti/"))
(let* ((share (string-append #$output "/share/ksoloti/")) (doc (string-append share "doc"))
(doc (string-append share "doc")) (dir (getcwd))
(dir (getcwd)) (pats '("/doc/[^/]+$"
(pats '("/doc/[^/]+$" "/patches/[^/]+/[^/]+$"
"/patches/[^/]+/[^/]+$" "/objects/[^/]+/[^/]+$"
"/objects/[^/]+/[^/]+$" "/firmware/.+"
"/firmware/.+" "/platform_linux/.+"
"/chibios/[^/]+$" "/chibios/[^/]+$"
"/chibios/boards/ST_STM32F4_DISCOVERY/[^/]+$" "/chibios/boards/ST_STM32F4_DISCOVERY/[^/]+$"
"/chibios/(ext|os|docs)/.+" "/chibios/(ext|os|docs)/.+"
"/CMSIS/[^/]+/[^/]+$" "/CMSIS/[^/]+/[^/]+$"
"/patch/[^/]+/[^/]+$" "/patch/[^/]+/[^/]+$"
"/[^/]+\\.txt$")) "/[^/]+\\.txt$"))
(pattern (string-append (pattern (string-append
"(" (string-join "(" (string-join
(map (cut string-append dir <>) (map (cut string-append dir <>)
pats) pats)
"|") ")")) "|") ")"))
(files (find-files dir (files (find-files dir
(lambda (file stat) (lambda (file stat)
(and (eq? 'regular (stat:type stat)) (and (eq? 'regular (stat:type stat))
(string-match pattern file)))))) (string-match pattern file))))))
(for-each (lambda (file) (for-each (lambda (file)
(install-file file (install-file file
(string-append (string-append
share share
(regexp-substitute (regexp-substitute
#f #f
(string-match dir (dirname file)) (string-match dir (dirname file))
'pre 'post)))) 'pre 'post))))
files))))))) files)))))))
(inputs (inputs
`(;; for compiling patches `( ;; for compiling patches
("make" ,gnu-make) ("make" ,gnu-make)
;; for compiling firmware ;; for compiling firmware
("cross-toolchain" ,(make-arm-none-eabi-nano-toolchain-9-2020-q2-update)) ("cross-toolchain" ,(make-arm-none-eabi-nano-toolchain-9-2020-q2-update))
;; for uploading compiled patches and firmware ;; for uploading compiled patches and firmware
("dfu-util" ,dfu-util))) ("dfu-util" ,dfu-util)))
(home-page "https://ksoloti.github.io/") (home-page "https://ksoloti.github.io/")
(synopsis "Audio development environment for the Ksoloti board") (synopsis "Audio development environment for the Ksoloti board")
(description (description
"Ksoloti is an environment for generating and processing digital audio. "Ksoloti is an environment for generating and processing digital audio.
It can be a programmable virtual modular synthesizer, polysynth, drone box, It can be a programmable virtual modular synthesizer, polysynth, drone box,
sequencer, chord generator, multi effect, sample player, looper, granular sequencer, chord generator, multi effect, sample player, looper, granular
sampler, MIDI generator/processor, CV or trigger generator, anything in sampler, MIDI generator/processor, CV or trigger generator, anything in
@ -486,7 +490,7 @@ short, Ksoloti aims for maximum compatibility with the original Axoloti, but
with some layout changes and added features. with some layout changes and added features.
This package provides the runtime.") This package provides the runtime.")
(license license:gpl3+))) (license license:gpl3+))))
(define-public ksoloti-patcher (define-public ksoloti-patcher
(package (package
@ -615,8 +619,8 @@ This package provides the runtime.")
" -Dsun.java2d.renderer=org.marlin.pisces.MarlinRenderingEngine" " -Dsun.java2d.renderer=org.marlin.pisces.MarlinRenderingEngine"
" -Dsun.java2d.d3d=false" " -Dsun.java2d.d3d=false"
" -Dsun.java2d.dpiaware=true" " -Dsun.java2d.dpiaware=true"
" -Daxoloti_release=" runtime " -Daxoloti_platform=" runtime "/platform_linux"
" -Daxoloti_runtime=" runtime " -Daxoloti_firmware=" runtime "/firmware"
" -jar " dir "/Ksoloti.jar"))))) " -jar " dir "/Ksoloti.jar")))))
(chmod target #o555))))) (chmod target #o555)))))
(add-after 'install 'strip-jar-timestamps (add-after 'install 'strip-jar-timestamps