mdedwards / slippery-chicken

slippery chicken: algorithmic composition software in common lisp and clos
http://michael-edwards.org/sc
72 stars 3 forks source link

slippery-chicken package for GNU Guix #57

Closed jgarte closed 8 months ago

jgarte commented 2 years ago

I started packaging slippery-chicken in a branch of a Guix channel called Guix 'R Us:

https://git.sr.ht/~whereiseveryone/guixrus/tree/slippery-chicken/item/guixrus/packages/slippery-chicken.scm#L36

A Guix package is scheme code written in GNU Guile.

In order for a slippery-chicken Guix package to be practical we will need to resolve a few things that are dependent on #44

One is, we need an ASD file for slippery-chicken.

  1. In order to write a ASD file for slippery-chicken we need to know the exact order in which the slippery chicken files are loaded.

It looks like all.lsp might have the correct load order.

The ASD example below uses the order in all.lsp.

  1. Then we need to reflect that in the ASD file, with the :serial t option which will load those files in the correct sequence.

From the ASDF manual:

The :serial t says that each sub-component of mod depends on the previous components, so that cooker.lisp depends-on reader.lisp, which depends-on utils.lisp. Also data.raw depends on all of them, but that doesn’t matter since it’s a static file; on the other hand, if it appeared first, then all the Lisp files would be recompiled when the data is modified, which is probably not what is desired in this case.

Here's a starter ASD file assuming that the system will be called sc:

(asdf:defsystem #:sc
  :description "algorithmic composition software in common lisp and clos"
  :author "Michael Edwards"
  :license  "GPL-3"
  :version "1.0.12"
  :serial t
  :pathname "src"
  :depends-on (#:cmn
                        #:cm)
   ;;  Is this the correct load order for these files?
  :components      ((:file "package")
(:file "cmn") ; cmn
(:file "cmn-glyphs") ; cmn
(:file "cm") ; cm
(:file "cm-cm") ; cm
(:file "samp5") ; clm
(:file "sine") ; clm
(:file "autoc") ; clm
(:file "cm-load" t)
(:file "utilities")
(:file "named-object")
(:file "music-xml")
(:file "linked-named-object")
(:file "sclist")
(:file "circular-sclist")
(:file "assoc-list")
(:file "recursive-assoc-list")
(:file "activity-levels")
(:file "activity-levels-env")
(:file "palette")
(:file "pitch-seq-palette")
(:file "globals")
(:file "sc-map")
(:file "set-map")
(:file "tempo")
(:file "rhythm")
(:file "pitch")
(:file "chord")
(:file "event")
(:file "instrument")
;; (:file "globals")
(:file "time-sig")
(:file "rthm-seq-bar")
(:file "change-data")
(:file "change-map")
(:file "instrument-change-map")
(:file "simple-change-map")
(:file "tempo-map")
(:file "sc-set")
(:file "tl-set")
(:file "complete-set")
(:file "set-palette")
(:file "pitch-seq")
(:file "sndfile")
(:file "sndfile-ext")
(:file "sndfile-palette")
(:file "sndfilenet")
(:file "rthm-seq")
(:file "rthm-seq-palette")
(:file "rthm-seq-map")
(:file "instrument-palette")
(:file "instruments")
(:file "player")
(:file "bar-holder")
(:file "sequenz")
(:file "ensemble")
(:file "l-for-lookup")
(:file "player-section")
(:file "section")
(:file "slippery-chicken")
(:file "piece")
(:file "slippery-chicken-edit")
(:file "clm") ; clm
(:file "permutations")
(:file "rthm-chain")
(:file "rthm-chain-slow")
(:file "cycle-repeats")
(:file "recurring-event")
(:file "intervals-mapper")
(:file "lilypond")
(:file "popcorn")
(:file "osc")
(:file "osc-sc")
(:file "osc-sc-bsd")
(:file "get-spectrum") ; clm
(:file "spectra")
(:file "control-wave") ; clm 
(:file "control-wave-ins") ; clm
(:file "wolfram" t)
(:file "afu")
(:file "reaper"))) ; Can we ignore this file since we'll be packaging for Guix which doesn't package reaper?

Excuse the spacing above. GitHub's formatting is a little buggy.

mdedwards commented 2 years ago

Hi, the order should be exactly that as found in sc’s all.lsp

with asd you’ll probably run into the problem of sc’s version of common music, which comes with its own asd file, and which is incorporated into sc. THat’s the one essential pre-existing package, as I’ve mentioned elsewhere. CLM and CMN are not essential.

Best, Michael

On 10. Apr 2022, at 23:43, jgart @.***> wrote:

I started packaging slippery-chicken in a branch of a Guix channel called Guix 'R Us.

For a Guix package for slippery-chicken to be possible we will need to resolve a few things that are dependent on #44

One is, we need a .asd file for slippery-chicken.

• In order to write a .asd file for slippery-chicken we need to know the exact order in which the slippery chicken files are loaded.

• Then we need to reflect that in the ASD file, with the :serial t option.

Here's a starter ASD file assuming that the system will be called sc:

(asdf:defsystem #:sc

:description "algorithmic composition software in common lisp and clos"

:author "Michael Edwards"

:license
"GPL-3"

:version "1.0.12"

:serial t

:pathname "src"

:depends-on (

:cmn

:cm

) :components ((:file "activity-levels-env.lsp"

"activity-levels.lsp"

"afu.lsp"

"akoustik-piano-spectra.lsp"

"all.lsp"

"assoc-list.lsp"

"autoc.lsp"

"bar-holder.lsp"

"change-data.lsp"

"change-map.lsp"

"chord.lsp" "circular-sclist.lsp" "clm-piano-spectra.lsp" "clm.lsp" "cm-2.6.0" "cm-cm.lsp" "cm-load.lsp" "cm.lsp" "cmn-glyphs.lsp" "cmn.lsp" "complete-set.lsp" "control-wave-ins.lsp" "control-wave.lsp" "cycle-repeats.lsp" "ensemble.lsp" "event.lsp" "get-spectrum.lsp" "globals.lsp" "import-audio.lsp" "instrument-change-map.lsp" "instrument-palette.lsp" "instrument.lsp" "instruments.lsp" "intervals-mapper.lsp" "l-for-lookup.lsp" "lilypond.lsp" "lilypond.ly" "linked-named-object.lsp" "music-xml.lsp" "named-object.lsp" "osc-sc-bsd.lsp" "osc-sc.lsp" "osc.lsp" "package.lsp" "palette.lsp" "permutations.lsp" "piece.lsp" "pitch-seq-palette.lsp" "pitch-seq.lsp" "pitch.lsp" "player-section.lsp" "player.lsp" "popcorn.lsp" "reaper-header.txt" "reaper-item.txt" "reaper-track.txt" "reaper.lsp" "recurring-event.lsp" "recursive-assoc-list.lsp" "rhythm.lsp" "rthm-chain-slow.lsp" "rthm-chain.lsp" "rthm-seq-bar.lsp" "rthm-seq-map.lsp" "rthm-seq-palette.lsp" "rthm-seq.lsp" "samp5.lsp" "sc-ascii-logo.txt" "sc-map.lsp" "sc-set.lsp" "sclist.lsp" "section.lsp" "sequenz.lsp" "set-map.lsp" "set-palette.lsp" "simple-change-map.lsp" "sine.lsp" "slippery-chicken-edit.fasl" "slippery-chicken-edit.lsp" "slippery-chicken.lsp" "sndfile-ext.lsp" "sndfile-palette.lsp" "sndfile.lsp" "sndfilenet.lsp" "spectra.lsp" "tempo-map.lsp" "tempo.lsp" "time-sig.lsp" "tl-set.lsp" "utilities.lsp" "violin-ensemble-spectra.lsp" "wolfram.lsp")) — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.

jgarte commented 2 years ago

THat’s the one essential pre-existing package, as I’ve mentioned elsewhere. CLM and CMN are not essential.

@mdedwards

Oh, sorry, I see you answered my question regarding cm here. Thank you!

My strategy now will be to package cm (common music) for Guix and then use what Guix calls a snippet to delete the vendored cm library after cloning the repository from GitHub and install slippery-chicken with the Guix-managed cm package.

The snippet would look something like this in the slippery-chicken Guix package:

         (modules '((guix build utils))) ; Import delete-file-recursively function.
         (snippet
          '(begin
             (delete-file-recursively "src/cm-2.6.0") ; Removes a vendored Common Music.
             (delete-file-recursively "src/app-skeleton"))) ; Removes OS X stuff.

This snippet modifies the source code before it is copied, built, and installed to the users's machine.

mdedwards commented 8 months ago

Hello there, we've finally made slippery chicken asdf-friendly. If you haven't completely given up you might want to integrate into Guix now. Best, Michael

jgarte commented 3 months ago

@mdedwards Thanks for the update. I'm planning to work on the Guix package still. I'll keep you posted on when I try again.