[Top][All Lists]

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

Re: guix packages

From: Ludovic Courtès
Subject: Re: guix packages
Date: Mon, 25 Aug 2014 20:46:29 +0200
User-agent: Gnus/5.130011 (Ma Gnus v0.11) Emacs/24.3 (gnu/linux)


Just to complete Andreas’s response: there actually is a tool to import
package definitions from Nixpkgs, but it’s only stealthily mentioned in
the manual.  However, it only imports the skeleton and not all the

--8<---------------cut here---------------start------------->8---
$ guix import ~/src/nixpkgs guile
;;; SSAX warning: Skipping PI: xml

trace: is deprecated, use lib.zipAttrsWith instead
trace: `mkStrict' is obsolete; use `mkOverride 0' instead.
trace: `types.list' is deprecated; use `types.listOf' instead
;; converted from 

  (name "guile")
  (version "2.0.9")
      (method url-fetch)
      (uri (string-append
  (build-system gnu-build-system)
    `(("libffi" ,libffi)
      ("libunistring" ,libunistring)
      ("libtool" ,libtool)
      ("readline" ,readline)
      ("pkg-config" ,pkg-config)
      ("gawk" ,gawk)
      ("hook" ,hook)))
    `(("libunistring" ,libunistring)
      ("libtool" ,libtool)
      ("boehm-gc" ,boehm-gc)
      ("gmp" ,gmp)))
  (home-page "";)
    "GNU Guile 2.0, an embeddable Scheme implementation")
    "GNU Guile is an implementation of the Scheme programming language, with
support for many SRFIs, packaged for use in a wide variety of
environments.  In addition to implementing the R5RS Scheme standard
and a large subset of R6RS, Guile includes a module system, full access
to POSIX system calls, networking support, multiple threads, dynamic
linking, a foreign function call interface, and powerful string
         #<<location> file: "/home/ludo/src/nixpkgs/lib/licenses.nix" line: 
"197" column: "5">
         "GNU Lesser General Public License version 3 or later")
         #<<location> file: "/home/ludo/src/nixpkgs/lib/licenses.nix" line: 
"196" column: "5">
         #<<location> file: "/home/ludo/src/nixpkgs/lib/licenses.nix" line: 
"198" column: "5">
--8<---------------cut here---------------end--------------->8---

Apart from the license SNAFU, it actually works.  ;-)  (It works by
invoking ‘nix-instantiate’, so Nix must be installed.)

But if you look at the original definition in guile/default.nix, you’ll
notice that it contains things like this:

--8<---------------cut here---------------start------------->8---
  # don't have "" on darwin
  LDFLAGS = stdenv.lib.optionalString (!stdenv.isDarwin) "-lgcc_s";

  postInstall = ''
    wrapProgram $out/bin/guile-snarf --prefix PATH : "${gawk}/bin"

    # XXX: See for
    # why `--with-libunistring-prefix' and similar options coming from
    # `AC_LIB_LINKFLAGS_BODY' don't work on NixOS/x86_64.
    sed -i "$out/lib/pkgconfig/guile-2.0.pc"    \
        -e 's|-lunistring|-L${libunistring}/lib -lunistring|g ;
            s|^Cflags:\(.*\)$|Cflags: -I${libunistring}/include \1|g ;
            s|-lltdl|-L${libtool}/lib -lltdl|g'
--8<---------------cut here---------------end--------------->8---

The ‘LDFLAGS’ setting defines ‘LDFLAGS’ as an environment variable in
the build process, and the ‘postInstall’ thing defines a ‘postInstall’
environment variable, which Nixpkgs’s build tool, written in Bash, will

This differs from Guix where the build-side code is written in Scheme,
not Bash, and where there’s no direct way to define environment

Long story short: ‘guix import’ gives you the skeleton of a package
definition, but doesn’t convert the more difficult part.


reply via email to

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