bug-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Grue Hunter: Can't create directories in the store


From: Ludovic Courtès
Subject: Re: Grue Hunter: Can't create directories in the store
Date: Wed, 15 May 2013 14:11:34 +0200
User-agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.3 (gnu/linux)

Hello!

Nikita Karetnikov <address@hidden> 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’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]