From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] Add scheme-bytestructures Date: Mon, 10 Oct 2016 22:46:36 +0200 Message-ID: <8760p0gcer.fsf@gnu.org> References: <87fuo4hz3c.fsf@openmailbox.org> 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]:36636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bthT9-0000Av-Tm for guix-devel@gnu.org; Mon, 10 Oct 2016 16:46:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bthT5-0001A6-O3 for guix-devel@gnu.org; Mon, 10 Oct 2016 16:46:42 -0400 In-Reply-To: <87fuo4hz3c.fsf@openmailbox.org> (Kei Kebreau's message of "Mon, 10 Oct 2016 13:51:19 -0400") 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" To: Kei Kebreau Cc: guix-devel Hi Amirouche, Some comments to complement Kei=E2=80=99s. Kei Kebreau skribis: > Amirouche Boubekki writes: > >> Warning: scheme-bytestructures works on various implementation of Scheme= but this patch adds >> it only for guile-2.0. >> >> This is a pure scheme package there is no autotools that's why I use the= trivial-build-system. >> >> This doesn't run the test suite, yet. >> >> From fb2eb7ffd88ec4fba09411195a54b59d67d9c137 Mon Sep 17 00:00:00 2001 >> From: Amirouche >> Date: Sun, 9 Oct 2016 12:31:20 +0200 >> Subject: [PATCH] gnu: Add scheme-bytestructures >> >> * gnu/packages/guile.scm (scheme-bytestructures): New variable. >> >> diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm >> index 0890f19..383990e 100644 >> --- a/gnu/packages/guile.scm >> +++ b/gnu/packages/guile.scm >> @@ -1265,4 +1265,105 @@ is no support for parsing block and inline level= HTML.") >> (define-public guile2.2-commonmark >> (package-for-guile-2.2 guile-commonmark)) >>=20=20 >> +(define-public scheme-bytestructures >> + (package >> + (name "scheme-bytestructures") I would suggest calling it =E2=80=9Cguile-scheme-bytestructures=E2=80=9D (or =E2=80=9Cguile-bytestructures=E2=80=9D?) to distinguish this package from t= he same one built for another implementation. >> + (scm-files (string-split "bytestructures/guile/explicit-endianness.scm >> +bytestructures/guile/numeric-metadata.scm >> +bytestructures/guile/ffi.scm >> +bytestructures/guile/vector.scm >> +bytestructures/guile/union.scm >> +bytestructures/guile/numeric-all.scm >> +bytestructures/guile/utils.scm >> +bytestructures/guile/pointer.scm >> +bytestructures/guile/base.scm >> +bytestructures/guile/numeric.scm >> +bytestructures/guile/struct.scm >> +bytestructures/guile/bitfields.scm >> +bytestructures/r6/bytevectors.scm >> +bytestructures/body/base.syntactic.scm >> +bytestructures/body/explicit-endianness.scm >> +bytestructures/body/vector.scm >> +bytestructures/body/union.scm >> +bytestructures/body/utils.scm >> +bytestructures/body/base.scm >> +bytestructures/body/numeric.scm >> +bytestructures/body/struct.scm >> +bytestructures/body/bitfields.scm >> +bytestructures/guile.scm" Please let=E2=80=99s not list all the files. :-) Could it instead use something like (find-files "bytestructures" "\\.scm$")? >> + ;; Compile .scm files and install. >> + (chdir source) >> + (setenv "GUILE_AUTO_COMPILE" "0") >> + (for-each (lambda (file) >> + (let* ((dest-file (string-append module-dir "/" >> + file)) >> + (go-file (string-append module-dir "/" >> + (substring file 0 >> + (string-rindex file #\.)) >> + ".go"))) >> + ;; Install source module. >> + (copy-file file dest-file) >> + ;; Install compiled module. >> + (unless (zero? (system* guild "compile" >> + "-L" source >> + "-o" go-file >> + file)) >> + (error (format #f "Failed to compile ~s to ~s!" >> + file go-file))))) >> + scm-files) At some point we should factorize this in a new (guix build guile) module or something. Any takers? :-) >> + (license gpl3))) Probably =E2=80=98gpl3+=E2=80=99; could you check? > I'm getting messages from "./pre-inst-env guix build --check --rounds=3D2 > scheme-bytestructures" that the package derivation may not be > deterministic. However, other packages in guile.scm seem to have the > same issue, so perhaps someone more experienced with this file can > determine whether this is a cause for concern. Yeah, this is due to a Guile issue: . Thanks Ludo=E2=80=99.