From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: guix packages Date: Mon, 25 Aug 2014 20:46:29 +0200 Message-ID: <87fvgkjtkq.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42054) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XLzHo-0007zG-MZ for guix-devel@gnu.org; Mon, 25 Aug 2014 14:46:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XLzHk-0004pH-0C for guix-devel@gnu.org; Mon, 25 Aug 2014 14:46:36 -0400 Received: from hera.aquilenet.fr ([2a01:474::1]:45679) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XLzHj-0004pC-LH for guix-devel@gnu.org; Mon, 25 Aug 2014 14:46:31 -0400 In-Reply-To: (Federico Beffa's message of "Sun, 24 Aug 2014 10:02:30 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Federico Beffa Cc: guix-devel@gnu.org Hello, Just to complete Andreas=E2=80=99s response: there actually is a tool to im= port package definitions from Nixpkgs, but it=E2=80=99s only stealthily mentione= d 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/guil= e/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 #< file: "/home/ludo/src/nixpkgs/lib/licenses.nix" line:= "197" column: "5"> "fullName" "GNU Lesser General Public License version 3 or later") (attribute #< file: "/home/ludo/src/nixpkgs/lib/licenses.nix" line:= "196" column: "5"> "shortName" "LGPLv3+") (attribute #< 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 =E2=80=98nix-instantiate=E2=80=99, so Nix must be installed.) But if you look at the original definition in guile/default.nix, you=E2=80= =99ll notice that it contains things like this: --8<---------------cut here---------------start------------->8--- # don't have "libgcc_s.so.1" on darwin LDFLAGS =3D stdenv.lib.optionalString (!stdenv.isDarwin) "-lgcc_s"; postInstall =3D '' 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 =E2=80=98LDFLAGS=E2=80=99 setting defines =E2=80=98LDFLAGS=E2=80=99 as = an environment variable in the build process, and the =E2=80=98postInstall=E2=80=99 thing defines a = =E2=80=98postInstall=E2=80=99 environment variable, which Nixpkgs=E2=80=99s build tool, written in Bash, = will =E2=80=98eval=E2=80=99. This differs from Guix where the build-side code is written in Scheme, not Bash, and where there=E2=80=99s no direct way to define environment variables. Long story short: =E2=80=98guix import=E2=80=99 gives you the skeleton of a= package definition, but doesn=E2=80=99t convert the more difficult part. Thanks, Ludo=E2=80=99.