all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Nikita Karetnikov <nikita@karetnikov.org>
Cc: bug-guix@gnu.org
Subject: Re: Grue Hunter: Can't create directories in the store
Date: Wed, 15 May 2013 14:11:34 +0200	[thread overview]
Message-ID: <8761ykl9xl.fsf@gnu.org> (raw)
In-Reply-To: <878v3hgxql.fsf@karetnikov.org> (Nikita Karetnikov's message of "Tue, 14 May 2013 23:36:18 +0400")

Hello!

Nikita Karetnikov <nikita@karetnikov.org> skribis:

> The game is just a single Perl file.

I think this is a good use case for ‘trivial-build-system’.

Basically, with ‘trivial-build-system’, you just pass a Scheme
expression that produces the result.  In your case that would be along
the lines of:

  (begin
    (use-modules (guix build utils))

    (let* ((gh   (assoc-ref %build-inputs "source"))
           (perl (assoc-ref %build-inputs "perl"))
           (out  (assoc-ref %outputs "out"))
           (bin  (string-append out "/bin)))
      (mkdir-p bin)
      (copy-file gh (string-append bin "/gh"))
      (patch-shebang (string-append bin "/gh")
                     (list (string-append perl "/bin")))
      ;; ...
      ))

> What directories should be created in the store?

$out/bin for the program, and $out/share/doc/grue-hunter for the license file.

> And how can I create such directories?

With the ‘mkdir’ and ‘mkdir-p’ procedures.

> I've tried several things:
>
> 1. (zero? (system (format #f "cp -r . ~a" out)))

Avoid calling out to Coreutils.  Guile and the (guix build utils)
provide us with everything we need to do that.

HTH!

Ludo’.

  parent reply	other threads:[~2013-05-15 12:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-14 19:36 Grue Hunter: Can't create directories in the store Nikita Karetnikov
2013-05-15  0:59 ` Cyril Roelandt
2013-05-15 12:11 ` Ludovic Courtès [this message]
2013-05-16  2:35   ` Nikita Karetnikov
2013-05-16 16:33     ` Ludovic Courtès
2013-05-24  9:24       ` Nikita Karetnikov
2013-05-24 12:51         ` Ludovic Courtès
2013-05-24 14:34           ` Nikita Karetnikov
2013-05-24 15:32             ` Ludovic Courtès
2013-05-30  3:40               ` [PATCH] gnu: Add Grue Hunter Nikita Karetnikov
2013-05-30 11:53                 ` Ludovic Courtès
2013-06-03  3:18                   ` Nikita Karetnikov
2013-06-03 10:14                     ` Ludovic Courtès

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

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

  git send-email \
    --in-reply-to=8761ykl9xl.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=bug-guix@gnu.org \
    --cc=nikita@karetnikov.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.