Subject: Re: [PATCH] gnu: chez-scheme: simplify packaging

From: Leo Prikler <[email-masked]>
Date: Mon, 15 Mar 2021 11:32:33 +0100

Hi,

I'm not an expert on Chez Scheme, so take this with a grain of salt,
but I do have some questions/remarks.

Am Montag, den 15.03.2021, 04:42 -0400 schrieb Philip McGrath:
> * gnu/packages/chez.scm (nanopass): Rename it to ...
> (nanopass-framework-scheme): ... this variable. Change it from an
> origin
> to a package. Update to 1.9.2.
What advantages do we get from making this a package?  Can it be
upgraded to 1.9.2 without this change at the same time?
> (stex): Rename it to ...
> (chez-stex): ... this variable. Change it from an origin to a hidden
> package. Update to commit 5405149, which helps us install it.
Same here, also does this need to be done at the same time as the
nanopass upgrade?  
> (chez-scheme)[source](patches): Use it.
Use what?
> [source](snippet): Remove bundled libraries here, not during
> 'configure'
> phase. Also remove irrelevant bootfiles.
This seems okay.
 
> +      (build-system gnu-build-system)
> +      (arguments
> +       `(#:phases
> +         (modify-phases %standard-phases
> +           (delete 'bootstrap)
> +           (delete 'patch-usr-bin-file)
> +           (delete 'configure)
> +           (delete 'patch-generated-file-shebangs)
> +           (delete 'build)
> +           (delete 'check)
> +           (replace 'install
> +             (lambda* (#:key outputs #:allow-other-keys)
> +               (copy-recursively "." (assoc-ref outputs "out"))
> +               #t))
> +           (delete 'patch-shebangs)
> +           (delete 'strip)
> +           (delete 'validate-runpath)
> +           (delete 'validate-documentation-location)
> +           (delete 'delete-info-dir-file)
> +           (delete 'patch-dot-desktop-files)
> +           (delete 'install-license-files)
> +           (delete 'reset-gzip-timestamps)
> +           (delete 'compress-documentation)))))))
copy-build-system exists.  And again, what is the point of making this
a package if it contains the exact same files as the corresponding
origin?

> +(define chez-stex
> +  ;; Hidden because of a circular dependency issue:
> +  ;; stex needs chez-scheme to be used, but chez-scheme uses
> +  ;; stex to build its documentation.
> +  ;; The chez-scheme package has an stex output that exposes
> +  ;; the useful version of this---or maybe there's a more elegant
> solution?
> +  (hidden-package
> +   (let ((version "1.2.2")
> +         ;; This commit includes a fix for which we would
> +         ;; otherwise want to use a snippet.
> +         ;; When there's a new tagged release,
> +         ;; go back to using (string-append "v" version)
> +         (commit "54051494434a197772bf6ca5b4e6cf6be55f39a5")
> +         (revision "1"))          ;Guix package revision
> +     (package
> +       (inherit nanopass-framework-scheme)
> +       (name "chez-stex")
> +       (version (git-version version revision commit))
> +       (source
> +        (origin
> +          (method git-fetch)
> +          (uri (git-reference
> +                (url "https://github.com/dybvig/stex")
> +                (commit commit)))
> +          (sha256
> "01jnvw8qw33gnpzwrakwhsr05h6b609lm180jnspcrb7lds2p23d")
> +          (file-name (git-file-name "stex" version))))
> +       (home-page "https://github.com/dybvig/stex")
> +       (synopsis
> +        "Tools for including Scheme in LaTeX and converting to
> HTML")
> +       (description
> +        "The @dfn{stex} package consists of two main programs and
> some
> +supporting items, such as make files, make-file templates, class
> files,
> +and style files.  The two main programs are @command{scheme-prep}
> and
> +@command{html-prep}.  @command{scheme-prep} performs a conversion
> from
> +stex-formatted files into LaTeX-formatted files, while
> @command{html-prep}
> +converts (some) LaTeX-formatted files into html-formatted files.
> +
> +An stex file is really just a LaTeX file extended with a handful of
> commands
> +for including Scheme code (or pretty much any other kind of code, as
> long as
> +you don't plan to use the Scheme-specific transcript support) in a
> document,
> +plus a couple of additional features rather arbitrarily thrown in.")
> +       (license (list expat))))))
>  
> -(define stex
> -  (let ((version "1.2.2"))
> -    (origin
> -      (method git-fetch)
> -      (uri (git-reference
> -            (url "https://github.com/dybvig/stex")
> -            (commit (string-append "v" version))))
> -      (sha256 (base32
> "1q5i8pf4cdfjsj6r2k1rih7ljbfggyxdng2p2fvsgarzihpsin2i"))
> -      (file-name (git-file-name "stex" version)))))
Again, where is the benefit in having this as a hidden-package?

Regards,
Leo