From: ludo@gnu.org (Ludovic Courtès)
To: Federico Beffa <beffa@ieee.org>
Cc: guix-devel@gnu.org
Subject: Re: guix packages
Date: Mon, 25 Aug 2014 20:46:29 +0200 [thread overview]
Message-ID: <87fvgkjtkq.fsf@gnu.org> (raw)
In-Reply-To: <CAKrPhPNBF3oXVuV1hcfchBzm=6tztraegS9S1EFmEZAcTvWU5A@mail.gmail.com> (Federico Beffa's message of "Sun, 24 Aug 2014 10:02:30 +0200")
Hello,
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
details:
--8<---------------cut here---------------start------------->8---
$ guix import ~/src/nixpkgs guile
;;; SSAX warning: Skipping PI: xml
trace: lib.zip 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 /home/ludo/src/nixpkgs/pkgs/development/interpreters/guile/default.nix:10
(package
(name "guile")
(version "2.0.9")
(source
(origin
(method url-fetch)
(uri (string-append
"mirror://gnu/guile/guile-"
version
".tar.xz"))
(sha256
(base32
"0nw9y8vjyz4r61v06p9msks5lm58pd91irmzg4k487vmv743h2pp"))))
(build-system gnu-build-system)
(inputs
`(("libffi" ,libffi)
("libunistring" ,libunistring)
("libtool" ,libtool)
("readline" ,readline)
("pkg-config" ,pkg-config)
("gawk" ,gawk)
("hook" ,hook)))
(propagated-inputs
`(("libunistring" ,libunistring)
("libtool" ,libtool)
("boehm-gc" ,boehm-gc)
("gmp" ,gmp)))
(home-page "http://www.gnu.org/software/guile/")
(synopsis
"GNU Guile 2.0, an embeddable Scheme implementation")
(description
"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
processing.
")
(license
(attribute-set
((attribute
#<<location> file: "/home/ludo/src/nixpkgs/lib/licenses.nix" line: "197" column: "5">
"fullName"
"GNU Lesser General Public License version 3 or later")
(attribute
#<<location> file: "/home/ludo/src/nixpkgs/lib/licenses.nix" line: "196" column: "5">
"shortName"
"LGPLv3+")
(attribute
#<<location> file: "/home/ludo/src/nixpkgs/lib/licenses.nix" line: "198" column: "5">
"url"
"http://www.fsf.org/licensing/licenses/lgpl.html")))))
--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 "libgcc_s.so.1" on darwin
LDFLAGS = stdenv.lib.optionalString (!stdenv.isDarwin) "-lgcc_s";
postInstall = ''
wrapProgram $out/bin/guile-snarf --prefix PATH : "${gawk}/bin"
# XXX: See http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903 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
‘eval’.
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
variables.
Long story short: ‘guix import’ gives you the skeleton of a package
definition, but doesn’t convert the more difficult part.
Thanks,
Ludo’.
prev parent reply other threads:[~2014-08-25 18:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-24 8:02 guix packages Federico Beffa
2014-08-24 14:10 ` Andreas Enge
2014-08-25 18:46 ` Ludovic Courtès [this message]
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=87fvgkjtkq.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=beffa@ieee.org \
--cc=guix-devel@gnu.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.