unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "\( via Guix-patches" via <guix-patches@gnu.org>
To: Ekaitz Zarraga <ekaitz@elenq.tech>
Cc: 64891@debbugs.gnu.org
Subject: [bug#64891] [PATCH] gnu: Add hare
Date: Fri, 28 Jul 2023 14:14:46 +0100	[thread overview]
Message-ID: <87ila4t8tq.fsf@disroot.org> (raw)
In-Reply-To: <GvOYop3WTKkSSyf8Bw443CZlf6uRVc-AO7IYjEaQVZ6QrPCFHOhs6L0Rh0Z-d_1QqO65DnG6TLCmiowhj1qssn4Wo-qA12jZMjLcFpYLEhw=@elenq.tech>

Hi!

Ekaitz Zarraga <ekaitz@elenq.tech> writes:
> * gnu/packages/hare.scm (hare, harec): New variable.
> * gnu/local.mk: Add hare.scm

:)

> +          (sha256
> +            (base32 "1xdf9pdwy5dvxhgvw6hqkpnjl8z76xc413vsnbbqfvwmfing53yn"))))
              ^
Odd spacing here.

> +      (build-system gnu-build-system)
> +      (arguments
> +        `(#:phases

Please use gexps and LIST for any new packages.

> +          (modify-phases %standard-phases
> +            (add-before 'configure 'setenv
> +              (lambda _
> +                (setenv "CC" ,(cc-for-target))))

Hmm.  In my version of the package[1], I also have:

  (setenv "AR" #$(ar-for-target))
  (setenv "LD" #$(ld-for-target))

Not sure why I added those, though.  Maybe try cross-compiling both
packages?  Perhaps these lines are needed for that...

> +            (add-after 'configure 'configure-better
> +              (lambda* (#:key outputs #:allow-other-keys)
> +                (invoke "./configure"
> +                        (string-append "--prefix=" (assoc-ref outputs "out")))))
> +            (delete 'configure))))

You could just (replace 'configure ...) instead :)

> +simple, stable, and robust.  Hare uses a static type system, manual memory

s/Hare/It/ in this line, maybe?

> +(define-public hare

Each package should have its own commit, remember.

> +  (let ((revision "1")
> +        (commit  "112b75eb56d98c442094966fe59cbf3cd5feb909"))
                   ^
Rouge space.

> +          (sha256
> +            (base32 "0ilnz56757k4v0ggdc2v4xsjw0c944y8r289nfmqhw4hwzsrvb4j"))))
              ^
Another.

> +      (inputs (list scdoc))

scdoc should be a native-input.

> +      (propagated-inputs (list qbe harec))

Might be an idea to make QBE and harec regular inputs, using substitute*
to replace any invocations of their binaries within the code with the
full /gnu/store/.../bin/blah path.  Propagated inputs should be avoided
where possible, even if it makes the package definition a little more
complex.

> +      (arguments
> +        `(#:make-flags `("HARECACHE=./cache"
> +                         ,(string-append "PREFIX=" (assoc-ref %outputs "out")))

Again, please use gexps within LIST, and replace
``(assoc-ref %outputs "out")'' with ``#$output''.

> +          #:phases
> +          (modify-phases %standard-phases
> +            (add-before 'configure 'configure-make
> +              (lambda _
> +                ;; NOTE: We are not really using this because overwriting it via
> +                ;; `make-flags` is way easier with our tooling.
> +                ;; Maybe we should?

No, I think what you do here is fine.

> +                (copy-file "config.example.mk" "config.mk")))

You can use RENAME-FILE rather than COPY-FILE here.

> +            (delete 'configure))))

Again, please just use REPLACE; it's simpler.

> +      (synopsis "Hare build driver")

Maybe "Build driver for the Hare language"?  "Hare build driver" is
almost a bit *too* short, IMO.

> +      (description "Hare is a systems programming language designed to be
> +simple, stable, and robust.  Hare uses a static type system, manual memory
> +management, and a minimal runtime.  It is well-suited to writing operating
> +systems, system tools, compilers, networking software, and other low-level,
> +high performance tasks.")

Perhaps trim the language description down a bit and add a sentence or
two about what *this specific tool* does.

  -- (




  reply	other threads:[~2023-07-28 14:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-27  8:35 [bug#64891] [PATCH] gnu: Add hare Ekaitz Zarraga
2023-07-28 13:14 ` ( via Guix-patches via [this message]
2023-07-28 15:08 ` ( via Guix-patches via
2023-08-08 10:09   ` Ekaitz Zarraga
2023-08-08 10:43     ` ( via Guix-patches via
2023-08-08 10:51       ` Ekaitz Zarraga

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ila4t8tq.fsf@disroot.org \
    --to=guix-patches@gnu.org \
    --cc=64891@debbugs.gnu.org \
    --cc=ekaitz@elenq.tech \
    --cc=paren@disroot.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).