From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id wBYMO0Q/Vl8jCQAA0tVLHw (envelope-from ) for ; Mon, 07 Sep 2020 14:10:12 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id yCEbN0Q/Vl9bVQAA1q6Kng (envelope-from ) for ; Mon, 07 Sep 2020 14:10:12 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 3E5029400C7 for ; Mon, 7 Sep 2020 14:10:12 +0000 (UTC) Received: from localhost ([::1]:54142 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kFHqT-0004f7-Su for larch@yhetil.org; Mon, 07 Sep 2020 10:10:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43296) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kFHqM-0004ep-Km for guix-patches@gnu.org; Mon, 07 Sep 2020 10:10:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:38775) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kFHqM-0004i8-Be for guix-patches@gnu.org; Mon, 07 Sep 2020 10:10:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kFHqM-0001N0-6U for guix-patches@gnu.org; Mon, 07 Sep 2020 10:10:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#42338] [PATCH 03/34] guix: Add composer-build-system. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 07 Sep 2020 14:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Julien Lepiller Cc: 42338@debbugs.gnu.org Received: via spool by 42338-submit@debbugs.gnu.org id=B42338.15994877545183 (code B ref 42338); Mon, 07 Sep 2020 14:10:02 +0000 Received: (at 42338) by debbugs.gnu.org; 7 Sep 2020 14:09:14 +0000 Received: from localhost ([127.0.0.1]:50314 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kFHpZ-0001LX-QH for submit@debbugs.gnu.org; Mon, 07 Sep 2020 10:09:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:32980) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kFHpY-0001LM-Qf for 42338@debbugs.gnu.org; Mon, 07 Sep 2020 10:09:13 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:42551) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kFHpT-0004c0-El; Mon, 07 Sep 2020 10:09:07 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=44454 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kFHpS-0001LH-Dr; Mon, 07 Sep 2020 10:09:07 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20200713002055.1553f136@tachikoma.lepiller.eu> <20200712222538.18092-1-julien@lepiller.eu> <20200712222538.18092-3-julien@lepiller.eu> Date: Mon, 07 Sep 2020 16:09:01 +0200 In-Reply-To: <20200712222538.18092-3-julien@lepiller.eu> (Julien Lepiller's message of "Mon, 13 Jul 2020 00:25:07 +0200") Message-ID: <87imcphe6a.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: -1.01 X-TUID: oOuvaZIUVVic Julien Lepiller skribis: > * guix/build-system/composer.scm: New file. > * guix/build/composer-build-system.scm: New file. > * guix/build-system/findclass.php: New file. > * Makefile.am: Add them. > * doc/guix.texi (Build Systems): Document it. [...] > +++ b/guix/build-system/findclass.php > @@ -0,0 +1,102 @@ > + +/** > + * Extract the classes in the given file > + * > + * @param string $path The file to check > + * @throws \RuntimeException > + * @return array The found classes > + */ This should rather be under gnu/packages/aux-files IMO. Also, could you add a copyright header and possibly info as to where it originates? > +(define* (create-autoload vendor composer-file inputs #:key dev-dependen= cies?) > + (with-output-to-file (string-append vendor "/autoload.php") > + (lambda _ > + (format #t " + (format #t "// autoload.php @generated by Guix~%") > + (format #t "$map =3D $psr4map =3D $classmap =3D array();~%") > + (format #t "require_once '~a/autoload_conf.php';~%" vendor) > + (format #t "require_once '~a/share/web/composer/ClassLoader.php';~= %" > + (assoc-ref inputs "composer-classloader")) > + (format #t "$loader =3D new \\Composer\\Autoload\\ClassLoader();~%= ") > + (format #t "foreach ($map as $namespace =3D> $path) {~%") > + (format #t " $loader->set($namespace, $path);~%") > + (format #t "}~%") > + (format #t "foreach ($psr4map as $namespace =3D> $path) {~%") > + (format #t " $loader->setPsr4($namespace, $path);~%") > + (format #t "}~%") > + (format #t "$loader->addClassMap($classmap);~%") > + (format #t "$loader->register();~%"))) I think it=E2=80=99d be clearer as a single string: (display "\