guix-devel
[Top][All Lists]
Advanced

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

‘snippet’ in <origin>


From: Ludovic Courtès
Subject: ‘snippet’ in <origin>
Date: Thu, 07 Nov 2013 23:43:24 +0100
User-agent: Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3 (gnu/linux)

address@hidden (Ludovic Courtès) skribis:

> +                 ;; See 
> <http://icl.cs.utk.edu/lapack-forum/archives/lapack/msg01383.html>.
> +                 'configure 'remove-non-free-files
>
> It’s a case where ‘guix build -S’ will return the source including the
> non-free files, which is clearly not what we want (though I gather that
> the next upstream version of LAPACK will be fixed, right?).
>
> Two things we could do: (1) add a ‘snippet’ field in ‘origin’, which is
> where the ‘remove-file’ calls would appear, (2) host a freed version
> under alpha.gnu.org/gnu/guix/mirror.

Commit f9cc897 in master adds a ‘snippet’ field in <origin>, which in
this particular case is used like this (commit 6a99575):

     (origin
      (method url-fetch)
      (uri (string-append "http://www.netlib.org/lapack/lapack-";
                          version ".tgz"))
      (sha256
       (base32
        "1w7sf8888m7fi2kyx1fzgbm22193l8c2d53m8q1ibhvfy6m5v9k0"))
      (snippet
       ;; Remove non-free files.
       ;; See 
<http://icl.cs.utk.edu/lapack-forum/archives/lapack/msg01383.html>.
       '(for-each (lambda (file)
                    (format #t "removing '~a'~%" file)
                    (delete-file file))
                  '("lapacke/example/example_DGESV_rowmajor.c"
                    "lapacke/example/example_ZGESV_rowmajor.c"
                    "DOCS/psfig.tex"))))

Problem solved.  :-)

This change breaks the ABI; make sure to run ‘make clean-go && make’!

Note that things occur in this order:

  1. The upstream source is unpacked.

  2. We chdir to the first directory created by that step (normally
     there is exactly one.)

  3. Patches are applied.

  4. The snippet is run.

  5. The directory is repacked.

Of course we get less flexibility by having things hardcoded this way,
but the goal is to keep it much simpler than what is done for <package>.

Mark: how well would this scheme apply to the mit-krb5 case?

Comments welcome!

Ludo’.



reply via email to

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