From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pierre Neidhardt Subject: bug#32770: Packaging SLIME/SWANK as Common Lisp library Date: Wed, 03 Oct 2018 20:34:24 +0200 Message-ID: <8736tmj2vj.fsf@ambrevar.xyz> References: <87museeyy5.fsf@ambrevar.xyz> <20180929151630.00cf6396@mailservices.uwaterloo.ca> <87lg7iwu9i.fsf@ambrevar.xyz> <87k1n2wten.fsf@ambrevar.xyz> <20181002045531.78223c72@mailservices.uwaterloo.ca> <878t3gwsrm.fsf@ambrevar.xyz> <20181003012224.5baff3ac@mailservices.uwaterloo.ca> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g7m0j-0006Zm-UY for bug-guix@gnu.org; Wed, 03 Oct 2018 14:36:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g7lzE-0003Of-Ev for bug-guix@gnu.org; Wed, 03 Oct 2018 14:35:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:59929) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g7lzE-0003Nv-5H for bug-guix@gnu.org; Wed, 03 Oct 2018 14:35:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g7lzC-000143-Mc for bug-guix@gnu.org; Wed, 03 Oct 2018 14:35:04 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-reply-to: <20181003012224.5baff3ac@mailservices.uwaterloo.ca> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Andy Patterson Cc: 32770@debbugs.gnu.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Last (hopefully?) step before getting Next up and running: add support for CFFI. I've re-used your CFFI package and they seem to work. Now if I want to package cl-sqlite, it fails because sqlite.so cannot be found. Indeed, the patch to /gnu/store/...-sqlite.../lib must be added to the cffi:*foreign-library-directories* global variable before compiling. If I do that from quicklisp, it works. Now I guess we need to tweak asdf-build-system so that packages can specify which paths to add to that global variable. Makes sense? I've given it a quick shot (patch attached) but then every ASDF build fails with --8<---------------cut here---------------start------------->8--- ice-9/boot-9.scm:222:17: In procedure map1: Syntax error: unknown location: unexpected syntax in form () --8<---------------cut here---------------end--------------->8--- I'm still lacking good knowledge of the asdf build system. I'll give it a closer look tomorrow. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-cffi-support.patch Content-Transfer-Encoding: quoted-printable From=201c4b9b915086b0fdfb4229f5bbfa5aecff784f42 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Wed, 3 Oct 2018 20:27:00 +0200 Subject: [PATCH] cffi support =2D-- guix/build-system/asdf.scm | 2 ++ guix/build/asdf-build-system.scm | 4 ++-- guix/build/lisp-utils.scm | 5 ++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/guix/build-system/asdf.scm b/guix/build-system/asdf.scm index 57e294d74..37c219460 100644 =2D-- a/guix/build-system/asdf.scm +++ b/guix/build-system/asdf.scm @@ -266,6 +266,7 @@ set up using CL source package conventions." (tests? #t) (asd-file #f) (asd-system-name #f) + (cffi-foreign-library-directories '()) (test-asd-file #f) (phases '(@ (guix build asdf-build-system) %standard-phases)) @@ -298,6 +299,7 @@ set up using CL source package conventions." #:asd-file ,(or asd-file (string-append system-name= ".asd")) #:asd-system-name ,system-name #:test-asd-file ,test-asd-file + #:cffi-foreign-library-directories ,cffi-foreign-li= brary-directories #:system ,system #:tests? ,tests? #:phases ,phases diff --git a/guix/build/asdf-build-system.scm b/guix/build/asdf-build-syste= m.scm index dd6373b33..7d879ddb9 100644 =2D-- a/guix/build/asdf-build-system.scm +++ b/guix/build/asdf-build-system.scm @@ -106,7 +106,7 @@ valid." (delete-file-recursively "systems"))) #t) =20 =2D(define* (build #:key outputs inputs asd-file asd-system-name +(define* (build #:key outputs inputs asd-file asd-system-name cffi-foreign= -library-directories #:allow-other-keys) "Compile the system." (let* ((out (library-output outputs)) @@ -121,7 +121,7 @@ valid." =20 (setenv "HOME" out) ; ecl's asdf sometimes wants to create $HOME/.cache =20 =2D (compile-system asd-system-name asd-file) + (compile-system asd-system-name asd-file cffi-foreign-library-director= ies) =20 ;; As above, ecl will sometimes create this even though it doesn't use= it =20 diff --git a/guix/build/lisp-utils.scm b/guix/build/lisp-utils.scm index 5dea30486..5d7b5afd0 100644 =2D-- a/guix/build/lisp-utils.scm +++ b/guix/build/lisp-utils.scm @@ -149,13 +149,16 @@ with PROGRAM." `(asdf:load-system ,system)) systems)) =20 =2D(define (compile-system system asd-file) +(define* (compile-system system asd-file #:optional cffi-foreign-library-d= irectories) "Use a lisp implementation to compile SYSTEM using asdf. Load ASD-FILE first." (lisp-eval-program `((require :asdf) (let ((*package* (find-package :asdf))) (load ,asd-file)) + ,(unless (null? cffi-foreign-library-directories) + `(progn (require :cffi) + (setq cffi:*foreign-library-directories* ,cffi-foreign-lib= rary-directories))) (asdf:operate 'asdf:compile-bundle-op ,system)))) =20 (define (system-dependencies system asd-file) =2D-=20 2.19.0 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable =2D-=20 Pierre Neidhardt https://ambrevar.xyz/ --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAlu1C7AACgkQm9z0l6S7 zH+rdQgAqGOcpUwQKt0GJVA26/THe51d38nBy18+9ehbNcNGBd1TFJXjb8lAjCco nfEYJBXGuvPVx11SU2F0nq0SObTwJ/4OsOIlQXDCykJjdmibsyyVJ/xcoiotEAVN PWJjRwhFg+IAlOOGhrungHQLSzo8hHu6mu3AspF2R78vFqHG62vnUzZC/TqAbGw9 g0zgFydeQc4ykU+I9gwr+zTXJmePXyLDzhQPVbevJsOvVkA1jJEt4yfWqDgZidCy SvchELN8hmrIxPsAwnCC/mG5h++kz1RHuaooCTVp6ZZ+hwdiEfCVZCALTVf0kYTs AC+HEXYlO8V5f/B4OU1qVNyJ/qjfDA== =oa6d -----END PGP SIGNATURE----- --==-=-=--