X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH] Add composer build system (PHP) Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 12 Jul 2020 22:22:02 +0000 Resent-Message-ID: <handler.42338.B.159459247513400 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: report 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org X-Debbugs-Original-To: guix-patches@HIDDEN Received: via spool by submit <at> debbugs.gnu.org id=B.159459247513400 (code B ref -1); Sun, 12 Jul 2020 22:22:02 +0000 Received: (at submit) by debbugs.gnu.org; 12 Jul 2020 22:21:15 +0000 Received: from localhost ([127.0.0.1]:46958 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jukLT-0003U3-JL for submit <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:21:15 -0400 Received: from lists.gnu.org ([209.51.188.17]:52128) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1jukLP-0003Tu-HP for submit <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:21:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54704) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <julien@HIDDEN>) id 1jukLP-0004NS-1k for guix-patches@HIDDEN; Sun, 12 Jul 2020 18:21:11 -0400 Received: from lepiller.eu ([2a00:5884:8208::1]:59462) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <julien@HIDDEN>) id 1jukLM-0004s1-Io for guix-patches@HIDDEN; Sun, 12 Jul 2020 18:21:10 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 111c09e8 for <guix-patches@HIDDEN>; Sun, 12 Jul 2020 22:21:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:subject:message-id:mime-version:content-type :content-transfer-encoding; s=dkim; bh=qxvHX9iPqqOh9m/l0C72CAnvw 1W+H/YLf520LuZKJoE=; b=WF02z1EsfnhCwWIU72eKO2gaRjU/BAMm3NKYr3juC d64U0EoAYHJkcov2xKZRT7f+UnKwHusXaDU6kWg6LpqOI8BHi/QCg4tfqIFbjBbZ qvSpqaTcaQgh/CEnQWZHI/JzYvl2oyCiJSfUP6NXV3K6mzfk6cDy3IJXo2j54rje WzXQIycMD+dYFDYd99MXJD1lGIxOobP86t3OnXlVczoVA0pg/6z/KepGwr9ZXclj 5jd5li8CCm2JDBE4FhPNnoK9U9fgVAzQeChm1Dh/JFYqgdDTlMZtr91+NtNeCkHr dZLSx09mwF2f0BumwmALMpQIDGqv71i/A/FJPBRdJswqg== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id a54c00ee (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <guix-patches@HIDDEN>; Sun, 12 Jul 2020 22:21:03 +0000 (UTC) Date: Mon, 13 Jul 2020 00:20:55 +0200 From: Julien Lepiller <julien@HIDDEN> Message-ID: <20200713002055.1553f136@HIDDEN> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Received-SPF: none client-ip=2a00:5884:8208::1; envelope-from=julien@HIDDEN; helo=lepiller.eu X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Hi Guix! This patch series adds the composer-build-system, along with an importer and an updater (first 3 patches). The patch series also adds some php packages for phpunit and its dependencies. The patches are available in my composer branch at https://framagit.org/tyreunom/guix/-/tree/composer
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) Content-Type: text/plain; charset=utf-8 X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Julien Lepiller <julien@HIDDEN> Subject: bug#42338: Acknowledgement ([PATCH] Add composer build system (PHP)) Message-ID: <handler.42338.B.159459247513400.ack <at> debbugs.gnu.org> References: <20200713002055.1553f136@HIDDEN> X-Gnu-PR-Message: ack 42338 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 42338 <at> debbugs.gnu.org Date: Sun, 12 Jul 2020 22:22:02 +0000 Thank you for filing a new bug report with debbugs.gnu.org. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): guix-patches@HIDDEN If you wish to submit further information on this problem, please send it to 42338 <at> debbugs.gnu.org. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 42338: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D42338 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 01/34] guix: import: Add composer importer. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 12 Jul 2020 22:26:02 +0000 Resent-Message-ID: <handler.42338.B42338.159459275113818 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.159459275113818 (code B ref 42338); Sun, 12 Jul 2020 22:26:02 +0000 Received: (at 42338) by debbugs.gnu.org; 12 Jul 2020 22:25:51 +0000 Received: from localhost ([127.0.0.1]:46964 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jukPv-0003ao-6h for submit <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:25:51 -0400 Received: from lepiller.eu ([89.234.186.109]:42900) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1jukPs-0003ad-35 for 42338 <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:25:49 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 09c2b194 for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=dkim; bh=TT5nxDDzLybC MT2oCWBXFISW25wTpl9AKS1jwYe3GMs=; b=N8WuMVsNyPdX993VlBSER6SBRNnI ap/lf6UuxFjDgwqmeX5HRdC5u4ZdPXqVZMBvVZ6yCthn9fNggclUY8q7tTxD/x4M X8rikR99lVJgT8kxF0Lq+Ecgo5CCbXX+xfjGrv3K80cwqTNu4c7VHCGxkxPXwfaf mI2eJ7H0nJSp65RxkUlyIqykTbyOuhnlH+VE80MIPRn4B+mt6dY3L6PvUNv3RxXm f0qWVH324zsI0lpYyKt8NrA1U15UCkOXW4KYZ3Uuego5wCoZ5C5aIOkVXoWhL5A2 EkbfzlyrpTmQumEl1xk9vf3lyvObhAW2NsU6vY8k53rP7UNE0lifDFgB4g== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 4b55fd0b (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:45 +0000 (UTC) From: Julien Lepiller <julien@HIDDEN> Date: Mon, 13 Jul 2020 00:25:05 +0200 Message-Id: <20200712222538.18092-1-julien@HIDDEN> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200713002055.1553f136@HIDDEN> References: <20200713002055.1553f136@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * guix/import/composer.scm: New file. * guix/scripts/import/composer.scm: New file. * Makefile.am: Add them. * guix/scripts/import.scm: Add composer importer. --- Makefile.am | 2 + guix/import/composer.scm | 252 +++++++++++++++++++++++++++++++ guix/scripts/import.scm | 2 +- guix/scripts/import/composer.scm | 107 +++++++++++++ 4 files changed, 362 insertions(+), 1 deletion(-) create mode 100644 guix/import/composer.scm create mode 100644 guix/scripts/import/composer.scm diff --git a/Makefile.am b/Makefile.am index 20d43cd130..623ddf32b2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -219,6 +219,7 @@ MODULES = \ guix/search-paths.scm \ guix/packages.scm \ guix/import/cabal.scm \ + guix/import/composer.scm \ guix/import/cpan.scm \ guix/import/cran.scm \ guix/import/crate.scm \ @@ -265,6 +266,7 @@ MODULES = \ guix/scripts/system/reconfigure.scm \ guix/scripts/lint.scm \ guix/scripts/challenge.scm \ + guix/scripts/import/composer.scm \ guix/scripts/import/crate.scm \ guix/scripts/import/cran.scm \ guix/scripts/import/elpa.scm \ diff --git a/guix/import/composer.scm b/guix/import/composer.scm new file mode 100644 index 0000000000..0e17eb0487 --- /dev/null +++ b/guix/import/composer.scm @@ -0,0 +1,252 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2019 Julien Lepiller <julien@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (guix import composer) + #:use-module (ice-9 match) + #:use-module (json) + #:use-module (gcrypt hash) + #:use-module (guix base32) + #:use-module (guix build git) + #:use-module (guix build utils) + #:use-module (guix build-system) + #:use-module (guix import json) + #:use-module (guix import utils) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (guix serialization) + #:use-module (guix upstream) + #:use-module (guix utils) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-11) + #:export (composer->guix-package + %composer-updater + composer-recursive-import)) + +;; XXX adapted from (guix scripts hash) +(define (file-hash file select? recursive?) + ;; Compute the hash of FILE. + (if recursive? + (let-values (((port get-hash) (open-sha256-port))) + (write-file file port #:select? select?) + (force-output port) + (get-hash)) + (call-with-input-file file port-sha256))) + +;; XXX taken from (guix scripts hash) +(define (vcs-file? file stat) + (case (stat:type stat) + ((directory) + (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) + ((regular) + ;; Git sub-modules have a '.git' file that is a regular text file. + (string=? (basename file) ".git")) + (else + #f))) + +(define (latest-version versions) + (fold (lambda (a b) (if (version>? a b) a b)) (car versions) versions)) + +(define (fix-version version) + "Return a fixed version from a version string. For instance, v10.1 -> 10.1" + (cond + ((string-prefix? "version" version) + (if (char-set-contains? char-set:digit (string-ref version 7)) + (substring version 7) + (substring version 8))) + ((string-prefix? "v" version) + (substring version 1)) + (else version))) + +(define* (composer-fetch name #:optional version) + "Return an alist representation of the Composer metadata for the package NAME, +or #f on failure." + (let ((package (json-fetch + (string-append "https://repo.packagist.org/p/" name ".json")))) + (if package + (let* ((packages (assoc-ref package "packages")) + (package (assoc-ref packages name)) + (versions (filter + (lambda (version) + (and (not (string-contains version "dev")) + (not (string-contains version "beta")))) + (map car package))) + (versions (map + (lambda (version) + (cons (fix-version version) version)) + versions)) + (version (or (if (null? version) #f version) + (latest-version (map car versions))))) + (assoc-ref package (assoc-ref versions version))) + #f))) + +(define (php-package-name name) + "Given the NAME of a package on Packagist, return a Guix-compliant name for +the package." + (let ((name (string-join (string-split name #\/) "-"))) + (if (string-prefix? "php-" name) + (snake-case name) + (string-append "php-" (snake-case name))))) + +(define (make-php-sexp name version home-page description dependencies + dev-dependencies licenses source) + "Return the `package' s-expression for a PHP package with the given NAME, +VERSION, HOME-PAGE, DESCRIPTION, DEPENDENCIES, LICENSES and SOURCE." + (let ((git? (equal? (assoc-ref source "type") "git"))) + ((if git? call-with-temporary-directory call-with-temporary-output-file) + (lambda* (temp #:optional port) + (and (if git? + (begin + (mkdir-p temp) + (git-fetch (assoc-ref source "url") + (assoc-ref source "reference") + temp)) + (url-fetch (assoc-ref source "url") temp)) + `(package + (name ,(php-package-name name)) + (version ,version) + (source (origin + ,@(if git? + `((method git-fetch) + (uri (git-reference + (url ,(assoc-ref source "url")) + (commit ,(assoc-ref source "reference")))) + (file-name (git-file-name name version)) + (sha256 + (base32 + ,(bytevector->nix-base32-string + (file-hash temp (negate vcs-file?) #t))))) + `((method url-fetch) + (uri ,(assoc-ref source "url")) + (sha256 (base32 ,(guix-hash-url temp))))))) + (build-system composer-build-system) + ,@(if (null? dependencies) + '() + `((inputs + (,'quasiquote + ,(map (lambda (name) + `(,name + (,'unquote + ,(string->symbol name)))) + dependencies))))) + ,@(if (null? dev-dependencies) + '() + `((native-inputs + (,'quasiquote + ,(map (lambda (name) + `(,name + (,'unquote + ,(string->symbol name)))) + dev-dependencies))))) + (synopsis "") + (description ,description) + (home-page ,home-page) + (license ,(match licenses + (() #f) + ((license) (license->symbol license)) + (_ `(list ,@(map license->symbol licenses))))))))))) + +(define* (composer->guix-package package-name #:optional version) + "Fetch the metadata for PACKAGE-NAME from packagist.org, and return the +`package' s-expression corresponding to that package, or #f on failure." + (let ((package (composer-fetch package-name version))) + (and package + (let* ((name (assoc-ref package "name")) + (version (fix-version (assoc-ref package "version"))) + (description (beautify-description + (assoc-ref package "description"))) + (home-page (assoc-ref package "homepage")) + (dependencies-names (filter + (lambda (dep) + (string-contains dep "/")) + (map car (assoc-ref package "require")))) + (dependencies (map php-package-name dependencies-names)) + (require-dev (assoc-ref package "require-dev")) + (dev-dependencies-names + (if require-dev + (filter + (lambda (dep) + (string-contains dep "/")) + (map car require-dev)) + '())) + (dev-dependencies (map php-package-name dev-dependencies-names)) + (licenses (map string->license + (vector->list + (assoc-ref package "license"))))) + (values (make-php-sexp name version home-page description dependencies + dev-dependencies licenses (assoc-ref package "source")) + (append dependencies-names dev-dependencies-names)))))) + +(define (guix-name->composer-name name) + "Given a guix package name, return the name of the package in Packagist." + (if (string-prefix? "php-" name) + (let ((components (string-split (substring name 4) #\-))) + (match components + ((namespace name ...) + (string-append namespace "/" (string-join name "-"))))) + name)) + +(define (guix-package->composer-name package) + "Given a Composer PACKAGE built from Packagist, return the name of the +package in Packagist." + (let ((upstream-name (assoc-ref + (package-properties package) + 'upstream-name)) + (name (package-name package))) + (if upstream-name + upstream-name + (guix-name->composer-name name)))) + +(define (string->license str) + "Convert the string STR into a license object." + (match str + ("GNU LGPL" license:lgpl2.0) + ("GPL" license:gpl3) + ((or "BSD" "BSD License" "BSD-3-Clause") license:bsd-3) + ((or "MIT" "MIT license" "Expat license") license:expat) + ("Public domain" license:public-domain) + ((or "Apache License, Version 2.0" "Apache 2.0") license:asl2.0) + (_ #f))) + +(define (php-package? package) + "Return true if PACKAGE is a PHP package from Packagist." + (and + (eq? (build-system-name (package-build-system package)) 'composer) + (string-prefix? "php-" (package-name package)))) + +(define (latest-release package) + "Return an <upstream-source> for the latest release of PACKAGE." + (let* ((php-name (guix-package->composer-name package)) + (metadata (composer-fetch php-name)) + (version (fix-version (assoc-ref metadata "version"))) + (url (assoc-ref (assoc-ref metadata "source") "url"))) + (upstream-source + (package (package-name package)) + (version version) + (urls (list url))))) + +(define %composer-updater + (upstream-updater + (name 'composer) + (description "Updater for Composer packages") + (pred php-package?) + (latest latest-release))) + +(define* (composer-recursive-import package-name #:optional version) + (recursive-import package-name '() + #:repo->guix-package composer->guix-package + #:guix-name php-package-name)) diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm index c6cc93fad8..4c91627283 100644 --- a/guix/scripts/import.scm +++ b/guix/scripts/import.scm @@ -76,7 +76,7 @@ rather than \\n." ;;; (define importers '("gnu" "nix" "pypi" "cpan" "hackage" "stackage" "elpa" "gem" - "cran" "crate" "texlive" "json" "opam")) + "cran" "crate" "texlive" "json" "opam" "composer")) (define (resolve-importer name) (let ((module (resolve-interface diff --git a/guix/scripts/import/composer.scm b/guix/scripts/import/composer.scm new file mode 100644 index 0000000000..412bae6318 --- /dev/null +++ b/guix/scripts/import/composer.scm @@ -0,0 +1,107 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2015 David Thompson <davet@HIDDEN> +;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (guix scripts import composer) + #:use-module (guix ui) + #:use-module (guix utils) + #:use-module (guix scripts) + #:use-module (guix import composer) + #:use-module (guix scripts import) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-11) + #:use-module (srfi srfi-37) + #:use-module (srfi srfi-41) + #:use-module (ice-9 match) + #:use-module (ice-9 format) + #:export (guix-import-composer)) + + +;;; +;;; Command-line options. +;;; + +(define %default-options + '()) + +(define (show-help) + (display (G_ "Usage: guix import composer PACKAGE-NAME +Import and convert the Composer package for PACKAGE-NAME.\n")) + (display (G_ " + -h, --help display this help and exit")) + (display (G_ " + -V, --version display version information and exit")) + (display (G_ " + -r, --recursive generate package expressions for all Composer packages\ + that are not yet in Guix")) + (newline) + (show-bug-report-information)) + +(define %options + ;; Specification of the command-line options. + (cons* (option '(#\h "help") #f #f + (lambda args + (show-help) + (exit 0))) + (option '(#\V "version") #f #f + (lambda args + (show-version-and-exit "guix import composer"))) + (option '(#\r "recursive") #f #f + (lambda (opt name arg result) + (alist-cons 'recursive #t result))) + %standard-import-options)) + + +;;; +;;; Entry point. +;;; + +(define (guix-import-composer . args) + (define (parse-options) + ;; Return the alist of option values. + (args-fold* args %options + (lambda (opt name arg result) + (leave (G_ "~A: unrecognized option~%") name)) + (lambda (arg result) + (alist-cons 'argument arg result)) + %default-options)) + + (let* ((opts (parse-options)) + (args (filter-map (match-lambda + (('argument . value) + value) + (_ #f)) + (reverse opts)))) + (match args + ((package-name) + (if (assoc-ref opts 'recursive) + (map (match-lambda + ((and ('package ('name name) . rest) pkg) + `(define-public ,(string->symbol name) + ,pkg)) + (_ #f)) + (composer-recursive-import package-name)) + (let ((sexp (composer->guix-package package-name))) + (unless sexp + (leave (G_ "failed to download meta-data for package '~a'~%") + package-name)) + sexp))) + (() + (leave (G_ "too few arguments~%"))) + ((many ...) + (leave (G_ "too many arguments~%")))))) -- 2.27.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 02/34] gnu: Add composer-classloader. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 12 Jul 2020 22:26:03 +0000 Resent-Message-ID: <handler.42338.B42338.159459275913917 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.159459275913917 (code B ref 42338); Sun, 12 Jul 2020 22:26:03 +0000 Received: (at 42338) by debbugs.gnu.org; 12 Jul 2020 22:25:59 +0000 Received: from localhost ([127.0.0.1]:46969 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jukPy-0003bK-Sb for submit <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:25:58 -0400 Received: from lepiller.eu ([89.234.186.109]:42900) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1jukPt-0003ad-I1 for 42338 <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:25:53 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 3b9a3814 for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=dkim; bh=9T1JFawuPbva F8Q+AxWLysKCCKNkrq+wsbxAWancyhs=; b=Z+GMDCPNcohjKERigAJk+hB8SRuE QQcSI8joJMlgqcqQKxzfz+ZeUtxjS7WS45yZ8sSFTRWrSoH3zSEWPgwZddbKI1Y5 pVkNaW3t/RrQ+LucJ8B6GCECFPlxjfaRFPu/wtHm6yq554J0V0lQK0P5bzOqc6kK RnLqolFbzMM+cKWcFivIwZ8u5sTiPYoN2TdZZAYliEdZ+LOc/sCNHYbDVPdi9q/I YOHmsaN4OX+6X/62b2XKtn4oLjOPn6MbyZM9qEavXcu5/cJzCg8ZIyelvmdg2+P3 1OfKD6Qce95iD4i6fMjCDAtCFS7w+vRG4WX0Y3eAPl4o6aRGpOQkg3qEVQ== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 0adddc50 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:46 +0000 (UTC) From: Julien Lepiller <julien@HIDDEN> Date: Mon, 13 Jul 2020 00:25:06 +0200 Message-Id: <20200712222538.18092-2-julien@HIDDEN> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200712222538.18092-1-julien@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * gnu/packages/php-xyz.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. --- gnu/local.mk | 1 + gnu/packages/php-xyz.scm | 61 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 gnu/packages/php-xyz.scm diff --git a/gnu/local.mk b/gnu/local.mk index 3046a840c9..90d1b1302b 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -424,6 +424,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/photo.scm \ %D%/packages/phabricator.scm \ %D%/packages/php.scm \ + %D%/packages/php-xyz.scm \ %D%/packages/pkg-config.scm \ %D%/packages/plotutils.scm \ %D%/packages/poedit.scm \ diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm new file mode 100644 index 0000000000..dab660f84f --- /dev/null +++ b/gnu/packages/php-xyz.scm @@ -0,0 +1,61 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2019 Julien Lepiller <julien@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (gnu packages php-xyz) + #:use-module (gnu packages) + #:use-module (gnu packages php) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix git-download) + #:use-module (guix build-system composer) + #:use-module (guix build-system gnu) + #:use-module (guix utils) + #:use-module ((guix licenses) #:prefix license:)) + +(define-public composer-classloader + (package + (name "composer-classloader") + (version "1.9.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/composer/composer.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0127zmmg3yx84ljngfs86q7kjhyypybkf4d1ihfrfnzgynzxfxdf")))) + (build-system gnu-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (delete 'configure) + (delete 'build) + (delete 'check) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (install (string-append out "/share/web/composer/ClassLoader.php"))) + (mkdir-p (dirname install)) + (copy-file "src/Composer/Autoload/ClassLoader.php" install))))))) + (home-page "https://getcomposer.org") + (synopsis "PHP class loader extracted from the composer package") + (description "This package contains the class loader class used by Composer to +build its autoloading feature. This package is used by the composer-build-system +to build its own store-aware autoloading feature.") + (license license:expat))) -- 2.27.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 03/34] guix: Add composer-build-system. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 12 Jul 2020 22:26:04 +0000 Resent-Message-ID: <handler.42338.B42338.159459276113962 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.159459276113962 (code B ref 42338); Sun, 12 Jul 2020 22:26:04 +0000 Received: (at 42338) by debbugs.gnu.org; 12 Jul 2020 22:26:01 +0000 Received: from localhost ([127.0.0.1]:46983 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jukQ2-0003cM-RG for submit <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:26:01 -0400 Received: from lepiller.eu ([89.234.186.109]:42902) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1jukPw-0003aw-HR for 42338 <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:25:53 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 2891cdb7 for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=dkim; bh=l56iDKkIW/PU 57U9GbIxtL0WZwDZzlpkKmybhnKZj8Q=; b=W3bUYDZZ1+YrzkdPSts/lZ3x0fg7 sEwmK1tacEkGE44WLBdgFX95/VqE8/4V8dGEN8YJ+OympRrf1XAs10sVzcNbo6C0 MIrYDZCMtwsZ8DySSL3+21yD4as5gSjV6bbKXpe9IbBRYL30OzMlE8q+Ibg4UvEZ BiNqDUFWNHcUV3+XJyWhf1o3t9cuaaq/ScZNBl9YgWtL1eTfBdfpd3kF7nr7qJf4 SVpwiPkZQcx8aCVBDqyCX2HdDTu2YwoWuUEGRvm5rxolvilGcHER7tIrbBvXzkG9 hixYy3PBrTKcAWjZWLr9gTtn2x2SqZieeqitxnAkWmlcdJB9o51RoM+9gQ== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 93c9228c (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:46 +0000 (UTC) From: Julien Lepiller <julien@HIDDEN> Date: Mon, 13 Jul 2020 00:25:07 +0200 Message-Id: <20200712222538.18092-3-julien@HIDDEN> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200712222538.18092-1-julien@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * 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. --- Makefile.am | 2 + doc/guix.texi | 14 ++ guix/build-system/composer.scm | 169 ++++++++++++++++++++ guix/build-system/findclass.php | 102 ++++++++++++ guix/build/composer-build-system.scm | 224 +++++++++++++++++++++++++++ 5 files changed, 511 insertions(+) create mode 100644 guix/build-system/composer.scm create mode 100644 guix/build-system/findclass.php create mode 100644 guix/build/composer-build-system.scm diff --git a/Makefile.am b/Makefile.am index 623ddf32b2..363af872fa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -117,6 +117,7 @@ MODULES = \ guix/build-system/cargo.scm \ guix/build-system/clojure.scm \ guix/build-system/cmake.scm \ + guix/build-system/composer.scm \ guix/build-system/dub.scm \ guix/build-system/dune.scm \ guix/build-system/emacs.scm \ @@ -164,6 +165,7 @@ MODULES = \ guix/build/cargo-build-system.scm \ guix/build/cargo-utils.scm \ guix/build/cmake-build-system.scm \ + guix/build/composer-build-system.scm \ guix/build/dub-build-system.scm \ guix/build/dune-build-system.scm \ guix/build/emacs-build-system.scm \ diff --git a/doc/guix.texi b/doc/guix.texi index 17338ed764..0613f669a0 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -6687,6 +6687,20 @@ debugging information''), which roughly means that code is compiled with @code{-O2 -g}, as is the case for Autoconf-based packages by default. @end defvr +@defvr {Scheme Variable} composer-build-system +This variable is exported by @code{(guix build-system composer)}. It +implements the build procedure for packages using +@url{https://getcomposer.org/, Composer}, the PHP package manager. + +It automatically adds the @code{php} package to the set of inputs. Which +package is used can be specified with the @code{#:php} parameter. + +The @code{#:test-target} parameter is used to control which script is run +for the tests. By default, the @code{test} script is run if it exists. If +the script does not exist, the build system will run @code{phpunit} from the +source directory, assuming there is a @file{phpunit.xml} file. +@end defvr + @defvr {Scheme Variable} dune-build-system This variable is exported by @code{(guix build-system dune)}. It supports builds of packages using @uref{https://dune.build/, Dune}, a build diff --git a/guix/build-system/composer.scm b/guix/build-system/composer.scm new file mode 100644 index 0000000000..19455b1920 --- /dev/null +++ b/guix/build-system/composer.scm @@ -0,0 +1,169 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2019 Julien Lepiller <julien@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. +(define-module (guix build-system composer) + #:use-module (guix store) + #:use-module (guix utils) + #:use-module (guix derivations) + #:use-module (guix search-paths) + #:use-module (guix build-system) + #:use-module (guix build-system gnu) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (ice-9 match) + #:use-module (srfi srfi-1) + #:export (%composer-build-system-modules + lower + composer-build + composer-build-system)) + +;; Commentary: +;; +;; Standard build procedure for PHP packages using Composer. This is implemented +;; as an extension of `gnu-build-system'. +;; +;; Code: + +(define (default-php) + "Return the default PHP package." + + ;; Do not use `@' to avoid introducing circular dependencies. + (let ((module (resolve-interface '(gnu packages php)))) + (module-ref module 'php))) + +(define (default-findclass) + "Return the default findclass script." + (local-file (string-append (current-source-directory) "/findclass.php"))) + +(define (default-composer-classloader) + "Return the default composer-classloader package." + + ;; Do not use `@' to avoid introducing circular dependencies. + (let ((module (resolve-interface '(gnu packages php-xyz)))) + (module-ref module 'composer-classloader))) + +(define %composer-build-system-modules + ;; Build-side modules imported by default. + `((guix build composer-build-system) + (guix build json) + (guix build union) + ,@%gnu-build-system-modules)) + +(define* (lower name + #:key source inputs native-inputs outputs system target + (php (default-php)) + (composer-classloader (default-composer-classloader)) + (findclass (default-findclass)) + #:allow-other-keys + #:rest arguments) + "Return a bag for NAME." + (define private-keywords + '(#:source #:target #:php #:composer-classloader #:findclass #:inputs #:native-inputs)) + + (and (not target) ;XXX: no cross-compilation + (bag + (name name) + (system system) + (host-inputs `(,@(if source + `(("source" ,source)) + '()) + ,@inputs + + ;; Keep the standard inputs of 'gnu-build-system'. + ,@(standard-packages))) + (build-inputs `(("php" ,php) + ("findclass.php" ,findclass) + ("composer-classloader" ,composer-classloader) + ,@native-inputs)) + (outputs outputs) + (build composer-build) + (arguments (strip-keyword-arguments private-keywords arguments))))) + +(define* (composer-build store name inputs + #:key (guile #f) + (outputs '("out")) (configure-flags ''()) + (search-paths '()) + (out-of-source? #t) + (composer-file "composer.json") + (tests? #t) + (test-target "test") + (install-target "install") + (validate-runpath? #t) + (patch-shebangs? #t) + (strip-binaries? #t) + (strip-flags ''("--strip-debug")) + (strip-directories ''("lib" "lib64" "libexec" + "bin" "sbin")) + (phases '(@ (guix build composer-build-system) + %standard-phases)) + (system (%current-system)) + (imported-modules %composer-build-system-modules) + (modules '((guix build composer-build-system) + (guix build json) + (guix build utils)))) + "Build SOURCE using PHP, and with INPUTS. This assumes that SOURCE provides +a 'composer.json' file as its build system." + (define builder + `(begin + (use-modules ,@modules) + (composer-build #:source ,(match (assoc-ref inputs "source") + (((? derivation? source)) + (derivation->output-path source)) + ((source) + source) + (source + source)) + #:system ,system + #:outputs %outputs + #:inputs %build-inputs + #:search-paths ',(map search-path-specification->sexp + search-paths) + #:phases ,phases + #:out-of-source? ,out-of-source? + #:composer-file ,composer-file + #:tests? ,tests? + #:test-target ,test-target + #:install-target ,install-target + #:validate-runpath? ,validate-runpath? + #:patch-shebangs? ,patch-shebangs? + #:strip-binaries? ,strip-binaries? + #:strip-flags ,strip-flags + #:strip-directories ,strip-directories))) + + (define guile-for-build + (match guile + ((? package?) + (package-derivation store guile system #:graft? #f)) + (#f ; the default + (let* ((distro (resolve-interface '(gnu packages commencement))) + (guile (module-ref distro 'guile-final))) + (package-derivation store guile system #:graft? #f))))) + + (build-expression->derivation store name builder + #:system system + #:inputs inputs + #:modules imported-modules + #:outputs outputs + #:guile-for-build guile-for-build)) + +(define composer-build-system + (build-system + (name 'composer) + (description "The standard Composer build system") + (lower lower))) + +;;; composer.scm ends here diff --git a/guix/build-system/findclass.php b/guix/build-system/findclass.php new file mode 100644 index 0000000000..a9704f809c --- /dev/null +++ b/guix/build-system/findclass.php @@ -0,0 +1,102 @@ +<?php +/** + * Extract the classes in the given file + * + * @param string $path The file to check + * @throws \RuntimeException + * @return array The found classes + */ +function findClasses($path) +{ + $extraTypes = PHP_VERSION_ID < 50400 ? '' : '|trait'; + if (defined('HHVM_VERSION') && version_compare(HHVM_VERSION, '3.3', '>=')) { + $extraTypes .= '|enum'; + } + // Use @ here instead of Silencer to actively suppress 'unhelpful' output + // @link https://github.com/composer/composer/pull/4886 + $contents = @php_strip_whitespace($path); + if (!$contents) { + if (!file_exists($path)) { + $message = 'File at "%s" does not exist, check your classmap definitions'; + } elseif (!is_readable($path)) { + $message = 'File at "%s" is not readable, check its permissions'; + } elseif ('' === trim(file_get_contents($path))) { + // The input file was really empty and thus contains no classes + return array(); + } else { + $message = 'File at "%s" could not be parsed as PHP, it may be binary or corrupted'; + } + $error = error_get_last(); + if (isset($error['message'])) { + $message .= PHP_EOL . 'The following message may be helpful:' . PHP_EOL . $error['message']; + } + throw new \RuntimeException(sprintf($message, $path)); + } + // return early if there is no chance of matching anything in this file + if (!preg_match('{\b(?:class|interface'.$extraTypes.')\s}i', $contents)) { + return array(); + } + // strip heredocs/nowdocs + $contents = preg_replace('{<<<[ \t]*([\'"]?)(\w+)\\1(?:\r\n|\n|\r)(?:.*?)(?:\r\n|\n|\r)(?:\s*)\\2(?=\s+|[;,.)])}s', 'null', $contents); + // strip strings + $contents = preg_replace('{"[^"\\\\]*+(\\\\.[^"\\\\]*+)*+"|\'[^\'\\\\]*+(\\\\.[^\'\\\\]*+)*+\'}s', 'null', $contents); + // strip leading non-php code if needed + if (substr($contents, 0, 2) !== '<?') { + $contents = preg_replace('{^.+?<\?}s', '<?', $contents, 1, $replacements); + if ($replacements === 0) { + return array(); + } + } + // strip non-php blocks in the file + $contents = preg_replace('{\?>(?:[^<]++|<(?!\?))*+<\?}s', '?><?', $contents); + // strip trailing non-php code if needed + $pos = strrpos($contents, '?>'); + if (false !== $pos && false === strpos(substr($contents, $pos), '<?')) { + $contents = substr($contents, 0, $pos); + } + // strip comments if short open tags are in the file + if (preg_match('{(<\?)(?!(php|hh))}i', $contents)) { + $contents = preg_replace('{//.* | /\*(?:[^*]++|\*(?!/))*\*/}x', '', $contents); + } + preg_match_all('{ + (?: + \b(?<![\$:>])(?P<type>class|interface'.$extraTypes.') \s++ (?P<name>[a-zA-Z_\x7f-\xff:][a-zA-Z0-9_\x7f-\xff:\-]*+) + | \b(?<![\$:>])(?P<ns>namespace) (?P<nsname>\s++[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+(?:\s*+\\\\\s*+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+)*+)? \s*+ [\{;] + ) + }ix', $contents, $matches); + $classes = array(); + $namespace = ''; + for ($i = 0, $len = count($matches['type']); $i < $len; $i++) { + if (!empty($matches['ns'][$i])) { + $namespace = str_replace(array(' ', "\t", "\r", "\n"), '', $matches['nsname'][$i]) . '\\'; + } else { + $name = $matches['name'][$i]; + // skip anon classes extending/implementing + if ($name === 'extends' || $name === 'implements') { + continue; + } + if ($name[0] === ':') { + // This is an XHP class, https://github.com/facebook/xhp + $name = 'xhp'.substr(str_replace(array('-', ':'), array('_', '__'), $name), 1); + } elseif ($matches['type'][$i] === 'enum') { + // In Hack, something like: + // enum Foo: int { HERP = '123'; } + // The regex above captures the colon, which isn't part of + // the class name. + $name = rtrim($name, ':'); + } + $classes[] = ltrim($namespace . $name, '\\'); + } + } + return $classes; +} + +$options = getopt('i:f:', []); +$file = $options["f"]; +$input = $options["i"]; + +$classes = findClasses($file); +foreach($classes as $class) { + echo '$classmap[\''.$class.'\'] = \''.$input.'/'.$file.'\';'; + echo "\n"; +} diff --git a/guix/build/composer-build-system.scm b/guix/build/composer-build-system.scm new file mode 100644 index 0000000000..3578b91954 --- /dev/null +++ b/guix/build/composer-build-system.scm @@ -0,0 +1,224 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2019 Julien Lepiller <julien@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (guix build composer-build-system) + #:use-module ((guix build gnu-build-system) #:prefix gnu:) + #:use-module (guix build json) + #:use-module (guix build utils) + #:use-module (ice-9 match) + #:export (%standard-phases + composer-build)) + +;; Commentary: +;; +;; Builder-side code of the standard composer build procedure. +;; +;; Code: + +(define* (read-package-data #:key (filename "composer.json")) + (call-with-input-file filename + (lambda (port) + (read-json port)))) + +(define* (check #:key composer-file inputs outputs tests? test-target #:allow-other-keys) + "Install the given package." + (when tests? + (mkdir-p "vendor") + (create-autoload (string-append (getcwd) "/vendor") composer-file + (append inputs outputs) #:dev-dependencies? #t) + (let* ((package-data (read-package-data #:filename composer-file)) + (scripts (match (assoc-ref package-data "scripts") + (('@ script ...) script) + (#f '()))) + (test-script + (assoc-ref scripts test-target)) + (dependencies (filter (lambda (dep) (string-contains dep "/")) + (map car + (match (assoc-ref package-data "require") + (('@ dependency ...) dependency) + (#f '()))))) + (dependencies-dev + (filter (lambda (dep) (string-contains dep "/")) + (map car + (match (assoc-ref package-data "require-dev") + (('@ dependency ...) dependency) + (#f '()))))) + (name (assoc-ref package-data "name"))) + (for-each + (lambda (input) + (let ((bin (find-php-bin (cdr input)))) + (when bin + (copy-recursively bin "vendor/bin")))) + inputs) + (match test-script + ((? string? command) + (unless (equal? (system command) 0) + (throw 'failed-command command))) + (('@ (? string? command) ...) + (for-each + (lambda (c) + (unless (equal? (system c) 0) + (throw 'failed-command c))) + command)) + (#f (invoke "vendor/bin/phpunit"))))) + #t) + +(define (find-php-bin input) + (let* ((web-dir (string-append input "/share/web")) + (vendors (if (file-exists? web-dir) + (find-files web-dir "^vendor$" #:directories? #t) + #f))) + (match vendors + ((vendor) + (let ((bin (string-append vendor "/bin"))) + (and (file-exists? bin) bin))) + (_ #f)))) + +(define (find-php-dep inputs dependency) + (let loop ((inputs (map cdr inputs))) + (if (null? inputs) + (throw 'unsatisfied-dependency "Unsatisfied dependency: required " dependency) + (let ((autoload (string-append (car inputs) "/share/web/" dependency "/vendor/autoload_conf.php"))) + (if (file-exists? autoload) + autoload + (loop (cdr inputs))))))) + +(define* (create-autoload vendor composer-file inputs #:key dev-dependencies?) + (with-output-to-file (string-append vendor "/autoload.php") + (lambda _ + (format #t "<?php~%") + (format #t "// autoload.php @generated by Guix~%") + (format #t "$map = $psr4map = $classmap = 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 = new \\Composer\\Autoload\\ClassLoader();~%") + (format #t "foreach ($map as $namespace => $path) {~%") + (format #t " $loader->set($namespace, $path);~%") + (format #t "}~%") + (format #t "foreach ($psr4map as $namespace => $path) {~%") + (format #t " $loader->setPsr4($namespace, $path);~%") + (format #t "}~%") + (format #t "$loader->addClassMap($classmap);~%") + (format #t "$loader->register();~%"))) + (let* ((package-data (read-package-data #:filename composer-file)) + (autoload + (match (assoc-ref package-data "autoload") + (('@ autoload ...) autoload) + (#f '()))) + (autoload-dev + (match (assoc-ref package-data "autoload-dev") + (('@ autoload-dev ...) autoload-dev) + (#f '()))) + (dependencies (filter (lambda (dep) (string-contains dep "/")) + (map car + (match (assoc-ref package-data "require") + (('@ dependency ...) dependency) + (#f '()))))) + (dependencies-dev + (filter (lambda (dep) (string-contains dep "/")) + (map car + (match (assoc-ref package-data "require-dev") + (('@ dependency ...) dependency) + (#f '())))))) + (with-output-to-file (string-append vendor "/autoload_conf.php") + (lambda _ + (format #t "<?php~%") + (format #t "// autoload_conf.php @generated by Guix~%") + (force-output) + (for-each + (lambda (psr4) + (match psr4 + ((key . value) + (format #t "$psr4map['~a'] = '~a/../~a';~%" + (string-join (string-split key #\\) "\\\\") + vendor value)))) + (append + (match (assoc-ref autoload "psr-4") + (('@ psr4 ...) psr4) + (#f '())) + (if dev-dependencies? + (match (assoc-ref autoload-dev "psr-4") + (('@ psr4 ...) psr4) + (#f '())) + '()))) + (for-each + (lambda (classmap) + (for-each + (lambda (file) + (invoke "php" (assoc-ref inputs "findclass.php") + "-i" (string-append vendor "/..") "-f" file)) + (find-files classmap ".(php|hh|inc)$"))) + (append + (or (assoc-ref autoload "classmap") '()) + (if dev-dependencies? + (or (assoc-ref autoload-dev "classmap") '()) + '()))) + (for-each + (lambda (dep) + (format #t "require_once '~a';~%" (find-php-dep inputs dep))) + (append + dependencies + (if dev-dependencies? + dependencies-dev + '()))))))) + +(define* (install #:key inputs outputs composer-file #:allow-other-keys) + "Install the given package." + (let* ((out (assoc-ref outputs "out")) + (package-data (read-package-data #:filename composer-file)) + (name (assoc-ref package-data "name")) + (php-dir (string-append out "/share/web/" name)) + (bin-dir (string-append php-dir "/vendor/bin")) + (bin (string-append out "/bin")) + (binaries (assoc-ref package-data "bin"))) + (mkdir-p php-dir) + (copy-recursively "." php-dir) + (mkdir-p (string-append php-dir "/vendor")) + (when binaries + (mkdir-p bin-dir) + (mkdir-p bin) + (for-each + (lambda (file) + (let ((installed-file (string-append bin-dir "/" (basename file))) + (bin-file (string-append bin "/" (basename file))) + (original-file (string-append php-dir "/" file))) + (symlink original-file installed-file) + (symlink original-file bin-file))) + binaries)) + (create-autoload (string-append php-dir "/vendor") + composer-file inputs)) + #t) + +(define %standard-phases + ;; Everything is as with the GNU Build System except for the `configure' + ;; , `build', `check' and `install' phases. + (modify-phases gnu:%standard-phases + (delete 'bootstrap) + (delete 'configure) + (delete 'build) + (delete 'check) + (replace 'install install) + (add-after 'install 'check check))) + +(define* (composer-build #:key inputs (phases %standard-phases) + #:allow-other-keys #:rest args) + "Build the given package, applying all of PHASES in order." + (apply gnu:gnu-build #:inputs inputs #:phases phases args)) + +;;; composer-build-system.scm ends here -- 2.27.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 04/34] gnu: Add php-doctrine-instantiator. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 12 Jul 2020 22:26:05 +0000 Resent-Message-ID: <handler.42338.B42338.159459276213978 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.159459276213978 (code B ref 42338); Sun, 12 Jul 2020 22:26:05 +0000 Received: (at 42338) by debbugs.gnu.org; 12 Jul 2020 22:26:02 +0000 Received: from localhost ([127.0.0.1]:46994 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jukQ5-0003d9-6P for submit <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:26:01 -0400 Received: from lepiller.eu ([89.234.186.109]:42900) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1jukPx-0003ad-TQ for 42338 <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:25:54 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 38c0c9b7 for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=1/rQdUXDKhldFCGF+1lyhoAzV QWS2UbYaLHdmhQU9cw=; b=OO/OeI6Sf9TPYBkrp9KFw2bM1LBT0nKDfg00fmt5U Efulw/2vyf1eK5bIbu9rr4AD4nm3NfvrzFVuGBn69rA2+C7fQP/SV5nee50P1Cwj s+D6BSFfRaL+Uc1gkWlJSfQ0l/IEmyjZP9dvdzKzsMnPhvOyiNmly3kMQlOs2FPm EwCWC4eJvoqDtJJZPIvu5t5vBcg0K6lle+/gcp5sM2HO8uJZN/+JKMWyHFCvT4e0 sjcQjsPPEBJ3+wr1TNO3eER5pKj2f7w7Xw1Py/NbxcKTnmMaeeHWg07IB7yv50ud WKQ6Wzx9zh9K0eRhq9dC/f1XjBcwCWwkRz39eARxJszBw== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id a35baf7d (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:47 +0000 (UTC) From: Julien Lepiller <julien@HIDDEN> Date: Mon, 13 Jul 2020 00:25:08 +0200 Message-Id: <20200712222538.18092-4-julien@HIDDEN> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200712222538.18092-1-julien@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * gnu/packages/php-xyz.scm (php-doctrine-instantiator): New variable. --- gnu/packages/php-xyz.scm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm index dab660f84f..28d8909dad 100644 --- a/gnu/packages/php-xyz.scm +++ b/gnu/packages/php-xyz.scm @@ -59,3 +59,26 @@ build its autoloading feature. This package is used by the composer-build-system to build its own store-aware autoloading feature.") (license license:expat))) + +(define-public php-doctrine-instantiator + (package + (name "php-doctrine-instantiator") + (version "1.3.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/doctrine/instantiator.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "17c72j29p77gdgh06b9qc0nivmav0k5yc22z4ryygj7dhr1h65nq")))) + (build-system composer-build-system) + (arguments + ;; We do not have phpunit yet + `(#:tests? #f)) + (synopsis "Utility for instantiating PHP objects") + (description "This package provides a small, lightweight utility to +instantiate objects in PHP without invoking their constructors") + (home-page "https://www.doctrine-project.org/projects/instantiator.html") + (license license:expat))) -- 2.27.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 05/34] gnu: Add php-sebastian-recursion-context. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 12 Jul 2020 22:26:05 +0000 Resent-Message-ID: <handler.42338.B42338.159459276213989 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.159459276213989 (code B ref 42338); Sun, 12 Jul 2020 22:26:05 +0000 Received: (at 42338) by debbugs.gnu.org; 12 Jul 2020 22:26:02 +0000 Received: from localhost ([127.0.0.1]:46998 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jukQ5-0003dP-Lt for submit <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:26:02 -0400 Received: from lepiller.eu ([89.234.186.109]:42902) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1jukPx-0003aw-VU for 42338 <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:25:54 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id abdcce0b for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=Mv0wFoDUATXnkFJHHgEXEH0hg /u7FpWTZl8lac2uegI=; b=ThZKNKmz0JXQRzMeeUQ3Vliz60EHPAU8KgMzpNQfI EN9xXaSlrNugnRWcPS0xi4FZ09UcgoQHzqTqjtOBJEkNRx27JggaGV98b/6GIFcJ xU7706JK9KyiPmHBD5Q4Vl6kUz3YgL5dGO8q08A2zQ/Q2WAaTCepg392CgQIbne0 xJJYsscii6BYLUN30IJ6a8i5XIrEW4qS3TbzTGx5blpygg+U3Gl8JZrn16jsdhJC Q2nkmBUhEULQIp9XO34b+IdADLobjSIHhr+EEAger+OoSN2t1DFiSwQr3tKj9sOJ ozhgmJw69zbpWJGis9PfqnG3C4xhLVvEx8x9vRR98wptg== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id c7026b00 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:47 +0000 (UTC) From: Julien Lepiller <julien@HIDDEN> Date: Mon, 13 Jul 2020 00:25:09 +0200 Message-Id: <20200712222538.18092-5-julien@HIDDEN> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200712222538.18092-1-julien@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * gnu/packages/php-xyz.scm (php-sebastian-recursion-context): New variable. --- gnu/packages/php-xyz.scm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm index 28d8909dad..b04b8e0859 100644 --- a/gnu/packages/php-xyz.scm +++ b/gnu/packages/php-xyz.scm @@ -82,3 +82,26 @@ to build its own store-aware autoloading feature.") instantiate objects in PHP without invoking their constructors") (home-page "https://www.doctrine-project.org/projects/instantiator.html") (license license:expat))) + +(define-public php-sebastian-recursion-context + (package + (name "php-sebastian-recursion-context") + (version "4.0.2") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/sebastianbergmann/recursion-context.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0glpydmvr95f9xbmh76vgid2nz7rf6lxwfz1j7ksvgmf4m1dniyz")))) + (build-system composer-build-system) + (arguments + ;; We do not have phpunit yet + `(#:tests? #f)) + (synopsis "Process PHP variables recursively") + (description "This package provides functionality to recursively process +PHP variables") + (home-page "http://www.github.com/sebastianbergmann/recursion-context") + (license license:bsd-3))) -- 2.27.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 06/34] gnu: Add php-sebastian-exporter. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 12 Jul 2020 22:26:05 +0000 Resent-Message-ID: <handler.42338.B42338.159459276213997 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.159459276213997 (code B ref 42338); Sun, 12 Jul 2020 22:26:05 +0000 Received: (at 42338) by debbugs.gnu.org; 12 Jul 2020 22:26:02 +0000 Received: from localhost ([127.0.0.1]:47000 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jukQ6-0003da-7R for submit <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:26:02 -0400 Received: from lepiller.eu ([89.234.186.109]:42900) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1jukPy-0003ad-Ne for 42338 <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:25:55 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 56b02dcd for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=+YHtspz68HbKgS386ApmA15tF VQnqCPAxrKZCeEtZC4=; b=i6IFmAW9VS67b7oxXJ5lL42FVs2wrPadUiINKvwg/ DFbQTcv7+OySB/XW+NkflJpStlJI7JxX9DU+sgJ18MDAvilo5FEZkT0no8LgZUmi 0jkvQdptiD0p8Kn7YAG/C8cQKmAImLqGO3yQVZoZ8tehR9T81U2LUgGm+Y/vi4xS yU0DzGgRCUTHnj32CWM9UL2m7koXM27JPaAbmG1Y6dNj5p4oj0O6eYb4nytMGnqb QBukphI7JliSeY45wHVfmhu8Gg6+BsnCngjDBN0KojY/dRmJtDlsgAmJxoI/jQRk b8eW2ixABpu8/ZnZSxR3txQVQWviaakePPCeD8RUb97vg== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 9448a9f4 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:48 +0000 (UTC) From: Julien Lepiller <julien@HIDDEN> Date: Mon, 13 Jul 2020 00:25:10 +0200 Message-Id: <20200712222538.18092-6-julien@HIDDEN> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200712222538.18092-1-julien@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * gnu/packages/php-xyz.scm (php-sebastian-exporter): New variable. --- gnu/packages/php-xyz.scm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm index b04b8e0859..ae7d7ff6b2 100644 --- a/gnu/packages/php-xyz.scm +++ b/gnu/packages/php-xyz.scm @@ -105,3 +105,28 @@ instantiate objects in PHP without invoking their constructors") PHP variables") (home-page "http://www.github.com/sebastianbergmann/recursion-context") (license license:bsd-3))) + +(define-public php-sebastian-exporter + (package + (name "php-sebastian-exporter") + (version "4.0.2") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/sebastianbergmann/exporter.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "03xj9gbi8ifnbj5n72gfpwyg65l71gg1r8yvzpbg6d3yxbqaa8f6")))) + (build-system composer-build-system) + (arguments + ;; We do not have phpunit yet + `(#:tests? #f)) + (inputs + `(("php-sebastian-recursion-context" ,php-sebastian-recursion-context))) + (synopsis "Visualize PHP variables") + (description "This package provides the functionality to export PHP +variables for visualization") + (home-page "http://www.github.com/sebastianbergmann/exporter") + (license license:bsd-3))) -- 2.27.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 07/34] gnu: Add php-myclabs-deep-copy. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 12 Jul 2020 22:26:06 +0000 Resent-Message-ID: <handler.42338.B42338.159459276314012 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.159459276314012 (code B ref 42338); Sun, 12 Jul 2020 22:26:06 +0000 Received: (at 42338) by debbugs.gnu.org; 12 Jul 2020 22:26:03 +0000 Received: from localhost ([127.0.0.1]:47004 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jukQ6-0003di-M1 for submit <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:26:03 -0400 Received: from lepiller.eu ([89.234.186.109]:42902) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1jukPy-0003aw-Py for 42338 <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:25:55 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 9050a1be for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=ZS6Q5zoeuCxbQNh9YGOIG5BI+ pvpdyA9N3v+P0fdAMw=; b=RPevbg/0LOHFIQOvhEWbHEBvh3ZDwKcAVy6rbwOQF InqmInYIyyzMCEdOnQ7/dAOVAruBNxWMyVzWN7Cv7eghyk0OFRgMSfsqGtuOYMVM 9eHbKzfcy5pdh86KY2/T/E7OYD6TZrQbvCbw5GM35BwJKDtjWX3749XPqVJWeDF1 hh36sqZjJlK0NL5eVyxAJUjf82oV4AbQzJNWigC3OU5j2ych1I1UFVHSa75Q2Ija 1E2ufEfq9e/KnLBIwmA7j/5BUlB0B1JOs6UzwpkDaNDS6T59HhdWTjaVvyXDt3VD anE4JfxEdkKwM3FX+gUAAZU4xGw5PocOIgWTZRLvjfuIg== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 3a3fd905 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:48 +0000 (UTC) From: Julien Lepiller <julien@HIDDEN> Date: Mon, 13 Jul 2020 00:25:11 +0200 Message-Id: <20200712222538.18092-7-julien@HIDDEN> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200712222538.18092-1-julien@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * gnu/packages/php-xyz.scm (php-myclabs-deep-copy): New variable. --- gnu/packages/php-xyz.scm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm index ae7d7ff6b2..a45726a484 100644 --- a/gnu/packages/php-xyz.scm +++ b/gnu/packages/php-xyz.scm @@ -130,3 +130,28 @@ PHP variables") variables for visualization") (home-page "http://www.github.com/sebastianbergmann/exporter") (license license:bsd-3))) + +(define-public php-myclabs-deep-copy + (package + (name "php-myclabs-deep-copy") + (version "1.10.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/myclabs/DeepCopy.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1ms4qhx5cf19ggdicnd7qjrigwam206py6mj6nw8bz71mafq9nbi")))) + (build-system composer-build-system) + (arguments + ;; We do not have phpunit yet + `(#:tests? #f)) + (synopsis "Create copies of PHP objects") + (description "This package contains a facility to create deep copies (clones) +of PHP objects. This package not only creates a new copy of an object, it +recursively create new copies of any object referenced by the object. It is +designed to work even in the presence of cycles in the association graph.") + (home-page "https://github.com/myclabs/DeepCopy.git") + (license license:expat))) -- 2.27.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 08/34] gnu: Add php-phar-io-version. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 12 Jul 2020 22:26:06 +0000 Resent-Message-ID: <handler.42338.B42338.159459276314020 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.159459276314020 (code B ref 42338); Sun, 12 Jul 2020 22:26:06 +0000 Received: (at 42338) by debbugs.gnu.org; 12 Jul 2020 22:26:03 +0000 Received: from localhost ([127.0.0.1]:47007 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jukQ7-0003dw-3R for submit <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:26:03 -0400 Received: from lepiller.eu ([89.234.186.109]:42900) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1jukPz-0003ad-Bz for 42338 <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:25:55 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id a9112a6c for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=ew6dTcFWEUNz/DSp78Fm7H1GZ Mu5TpkIu9ZLBe8In/M=; b=XsS2al8M8mXBLD2HhJtHkUjBWmP/eFgupqoh/4Esc uw6khWz8MiMuNMIL1ZrEEui2kNUPzPObAscm6ijAU7yxPS4rsuY2XMjit++Zdbwf h4jiw/0okWmZkaiDuhIP+jMj3V35IaF6YDwMGLD1oPfz49PLboICIQjCFJpz98eF X4tJXb0dXwxChMUDYXKXxzR4mY6BmgDG6KMYHSri7nCQN5JhGbh1XvvjTC4DKs8h Q0OJqbtSoleKvkf26ZLLyYbo+tD2pdyNuC6GAfrnYaltO+eS/xLOYsGY4/ObQ21y UAMKWO/L3SbxO4uZNaA78mbgBe8USCfvVXGPJc395028g== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 09a91e5a (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:49 +0000 (UTC) From: Julien Lepiller <julien@HIDDEN> Date: Mon, 13 Jul 2020 00:25:12 +0200 Message-Id: <20200712222538.18092-8-julien@HIDDEN> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200712222538.18092-1-julien@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * gnu/packages/php-xyz.scm (php-phar-io-version): New variable. --- gnu/packages/php-xyz.scm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm index a45726a484..0b64efe6ca 100644 --- a/gnu/packages/php-xyz.scm +++ b/gnu/packages/php-xyz.scm @@ -155,3 +155,28 @@ recursively create new copies of any object referenced by the object. It is designed to work even in the presence of cycles in the association graph.") (home-page "https://github.com/myclabs/DeepCopy.git") (license license:expat))) + +(define-public php-phar-io-version + (package + (name "php-phar-io-version") + (version "3.0.2") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/phar-io/version.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0r9470p0azw7l0x2wbn7kh0zhpswvjnm32vc8vml5v5nskmnqz4c")))) + (build-system composer-build-system) + (arguments + ;; We do not have phpunit yet + `(#:tests? #f)) + (properties + `((upstream-name . "phar-io/version"))) + (synopsis "Library for handling version information and constraints") + (description "This package contains a library for handling version information +and constraints.") + (home-page "https://phar.io") + (license license:bsd-3))) -- 2.27.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 09/34] gnu: Add php-phar-io-manifest. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 12 Jul 2020 22:26:07 +0000 Resent-Message-ID: <handler.42338.B42338.159459276414033 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.159459276414033 (code B ref 42338); Sun, 12 Jul 2020 22:26:07 +0000 Received: (at 42338) by debbugs.gnu.org; 12 Jul 2020 22:26:04 +0000 Received: from localhost ([127.0.0.1]:47009 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jukQ7-0003e5-Eo for submit <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:26:03 -0400 Received: from lepiller.eu ([89.234.186.109]:42902) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1jukPz-0003aw-Lj for 42338 <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:25:56 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id c8bb9bd5 for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=FwDKhNXemO3Jc4fLZvhWwG2YE heKNEOf2e4xFq41DhU=; b=OE/bj5XBxIV/AsYSYqesTvEjV4x0/hQ0GfzlnlHn7 GYmTa3q+3CYnB/YEeAGZed9PbFDYyBNFVtTj7r45n8N8sOJxGBG/QVBACFDlz9vL ZrOB/l+LYkXhUkbkKpewhkr+oijhF8UfE/0NhVlNIoFkrAwCPK/5AOLZvQCo4Bv9 kXcohgM4NakR+XFSzylrAs769aGflhnhHJWi4WPbN0YX4MP1mxUSkmfR7zZyJCQe JdGTybDazpQH7m53UWFFuXpWXVvW/K6UhSOIhRqBOpmcXZJ7gtuxKUJVtcon6P+9 /0J+ROCwK9v0mHlcOf5umdSdagCSpIJ/ggtsa0CsW5huw== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 975ccc30 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:49 +0000 (UTC) From: Julien Lepiller <julien@HIDDEN> Date: Mon, 13 Jul 2020 00:25:13 +0200 Message-Id: <20200712222538.18092-9-julien@HIDDEN> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200712222538.18092-1-julien@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * qnu/packages/php-xyz.scm (php-phar-io-manifest): New variable. --- gnu/packages/php-xyz.scm | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm index 0b64efe6ca..f0f4fe650a 100644 --- a/gnu/packages/php-xyz.scm +++ b/gnu/packages/php-xyz.scm @@ -180,3 +180,30 @@ designed to work even in the presence of cycles in the association graph.") and constraints.") (home-page "https://phar.io") (license license:bsd-3))) + +(define-public php-phar-io-manifest + (package + (name "php-phar-io-manifest") + (version "2.0.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/phar-io/manifest.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0r2s1qdkhn7782g1y6skxvp5w397vmwb496fymsnik2818w0q469")))) + (build-system composer-build-system) + (arguments + ;; We do not have phpunit yet + `(#:tests? #f)) + (inputs + `(("php-phar-io-version" ,php-phar-io-version))) + (properties + `((upstream-name . "phar-io/manifest"))) + (synopsis "PHP Archive information reader") + (description "This package contains a component for reading phar.io manifest +information from a PHP Archive (PHAR)") + (home-page "https://phar.io") + (license license:bsd-3))) -- 2.27.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 10/34] gnu: Add php-symfony-polyfill-ctype. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 12 Jul 2020 22:26:07 +0000 Resent-Message-ID: <handler.42338.B42338.159459276414042 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.159459276414042 (code B ref 42338); Sun, 12 Jul 2020 22:26:07 +0000 Received: (at 42338) by debbugs.gnu.org; 12 Jul 2020 22:26:04 +0000 Received: from localhost ([127.0.0.1]:47013 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jukQ7-0003eI-Tt for submit <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:26:04 -0400 Received: from lepiller.eu ([89.234.186.109]:42900) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1jukQ0-0003ad-7E for 42338 <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:25:56 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id cb2e4179 for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=hWHvPbRvzpUR705oPqHJ8cYsH wtQvN5dfthRUkZFT/s=; b=AsR2UZKC65N8Af64qBOlmZHgmsbkkOKTO05kWrKqe ZwoP82w6Aw1RuGAmmJy/sRHcaf+6AcNTN8y6Bbb9X66K6Z8GrITXN8fisdogBdOi jKMsN7ppGu1lht0KnbWL7fkFaifgV5H/ISW4OvXFxBYwaIVYI7oySjNEraZkbUHs fLABEeuolX+RaTo+QrDTNOsL4rv/O4/VS3+w5J3Rjy/HRblBGCgptzvrpx5BmR9V R2gFDLug3TLgCkA9GbQz0TJdwDt/qQsc2bK0MIZLmPivnOCc0w1OR+jtBBDvCmtQ XDr/Qzezzig93ySoY7fCTh2LKPeZ9bsNdOpt6lryJLe1g== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 8878a5d9 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:50 +0000 (UTC) From: Julien Lepiller <julien@HIDDEN> Date: Mon, 13 Jul 2020 00:25:14 +0200 Message-Id: <20200712222538.18092-10-julien@HIDDEN> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200712222538.18092-1-julien@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * gnu/packages/php.scm (php-symfony-polyfill-ctype): New variable. --- gnu/packages/php-xyz.scm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm index f0f4fe650a..51e51ac51b 100644 --- a/gnu/packages/php-xyz.scm +++ b/gnu/packages/php-xyz.scm @@ -207,3 +207,26 @@ and constraints.") information from a PHP Archive (PHAR)") (home-page "https://phar.io") (license license:bsd-3))) + +(define-public php-symfony-polyfill-ctype + (package + (name "php-symfony-polyfill-ctype") + (version "1.17.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/symfony/polyfill-ctype.git") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0bh22vwq2idy7fi8ajm6aggjdvds64s98y9854b5gl9s84dk9pz8")))) + (build-system composer-build-system) + (arguments + ;; We do not have phpunit yet + `(#:tests? #f)) + (synopsis "Ctype functions for older PHP versions") + (description "This component provides @code{ctype_*} functions to users +who run php versions without the ctype extension.") + (home-page "https://symfony.com") + (license license:expat))) -- 2.27.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 11/34] gnu: Add php-webmozart-assert. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 12 Jul 2020 22:26:07 +0000 Resent-Message-ID: <handler.42338.B42338.159459276414054 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.159459276414054 (code B ref 42338); Sun, 12 Jul 2020 22:26:07 +0000 Received: (at 42338) by debbugs.gnu.org; 12 Jul 2020 22:26:04 +0000 Received: from localhost ([127.0.0.1]:47015 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jukQ8-0003eQ-8D for submit <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:26:04 -0400 Received: from lepiller.eu ([89.234.186.109]:42902) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1jukQ0-0003aw-GX for 42338 <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:25:57 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 36620d57 for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=uz1sNx9UFoysgOqUDb7m5ignU YMo77G0AjoPQNV1b1Y=; b=UDKShAZiYYNKTyhzPdBg/GeRsPB4uUQ5SOit5S9a1 qJp01ReiVzBd9aO7TyNmxwUKamjtwRV9z1r6qjMilS2HzXP0VuPu+gPW6ocX7Pmw 3OhI7BmrpKcx7ovZ5rTTXVaX9ca+LoJLrkeQWXhAFrPYKVQwsukAS6z9yZ2Wfswn 0qnzoSw0QwKElBtJe3WNiiREaynyEftUhvNrzhUbxyEbKPUC9ZgjVpa1pT24plOC uubMa3V0I1Ecqh1N+YI3ZTGeIl76n80hRJoKgmmBtHSuBUnWqeG1YYbd1ckuM8ce A2Yb5UJyimSWOLhKT4H51iFlEi7HU9xdNUEV6Vq3Td98g== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 00fa5e19 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:51 +0000 (UTC) From: Julien Lepiller <julien@HIDDEN> Date: Mon, 13 Jul 2020 00:25:15 +0200 Message-Id: <20200712222538.18092-11-julien@HIDDEN> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200712222538.18092-1-julien@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * gnu/packages/php-xyz.scm (php-webmozart-assert): New variable. --- gnu/packages/php-xyz.scm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm index 51e51ac51b..ffc2eb7b11 100644 --- a/gnu/packages/php-xyz.scm +++ b/gnu/packages/php-xyz.scm @@ -230,3 +230,28 @@ information from a PHP Archive (PHAR)") who run php versions without the ctype extension.") (home-page "https://symfony.com") (license license:expat))) + +(define-public php-webmozart-assert + (package + (name "php-webmozart-assert") + (version "1.9.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/webmozart/assert.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1q9bp4sp11r8ghdzr0qswdf1k5bf9b5s525im3kspar6y8019sh9")))) + (build-system composer-build-system) + (arguments + ;; We do not have phpunit yet + `(#:tests? #f)) + (inputs + `(("php-symfony-polyfill-ctype" ,php-symfony-polyfill-ctype))) + (synopsis "Assertions to validate method input/output with nice error messages.") + (description "This library contains efficient assertions to test the input +and output of PHP methods.") + (home-page "https://github.com/webmozart/assert") + (license license:expat))) -- 2.27.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 13/34] gnu: Add php-phpdocumentor-type-resolver. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 12 Jul 2020 22:27:02 +0000 Resent-Message-ID: <handler.42338.B42338.159459277014134 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.159459277014134 (code B ref 42338); Sun, 12 Jul 2020 22:27:02 +0000 Received: (at 42338) by debbugs.gnu.org; 12 Jul 2020 22:26:10 +0000 Received: from localhost ([127.0.0.1]:47029 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jukQD-0003fs-LP for submit <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:26:09 -0400 Received: from lepiller.eu ([89.234.186.109]:42902) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1jukQ1-0003aw-9y for 42338 <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:25:57 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 0b0f58bb for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=6ZA693+Ka/gFJ9eLmg5rKs1j0 3eWnHFaIFcrDliPTYQ=; b=M3aEIJvmDV45CKfQkr+zc9rzRiGootcKt6nve8Mas SCuGgREvOBpsELG9Rtw1xgHfASj5dbbsNttPzfvl2FoCvLhSZmCQtTw5n1Bv1wsd BbUjKkjb7djC0MTTM40FqKiA7wkQntyrk/o2/NZ/upJeEHk+WRoAp9mXuTTdlJMv fFARs4uL5TwAP3zzkdT4oKMg3GldWp7j8gcIwx3101vypZuQ15kLR5M4EVHHQIal xuAclfBicUOULV/VmhU+EFv5pJ5trTN79WC2ciXojGtUZk61pZidfK4Ma+zdrY51 o9grDWiVud6NdKydKdA7L95xHtmjy+eHGJzi4WZTqMyDg== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 797c362f (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:52 +0000 (UTC) From: Julien Lepiller <julien@HIDDEN> Date: Mon, 13 Jul 2020 00:25:17 +0200 Message-Id: <20200712222538.18092-13-julien@HIDDEN> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200712222538.18092-1-julien@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * gnu/packages/php-xyz.scm (php-phpdocumentor-type-resolver): New variable. --- gnu/packages/php-xyz.scm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm index 9b604c46f0..93d8649bee 100644 --- a/gnu/packages/php-xyz.scm +++ b/gnu/packages/php-xyz.scm @@ -279,3 +279,28 @@ the code structure") to analyze the code structure.") (home-page "http://www.phpdoc.org") (license license:expat))) + +(define-public php-phpdocumentor-type-resolver + (package + (name "php-phpdocumentor-type-resolver") + (version "1.3.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/phpDocumentor/TypeResolver.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0wshv49z4hxraygg2vhzn0s9ih2y9ymzpcnyjfk14vcfq5yx53l9")))) + (build-system composer-build-system) + (arguments + ;; We do not have phpunit yet + `(#:tests? #f)) + (inputs + `(("php-phpdocumentor-reflection-common" ,php-phpdocumentor-reflection-common))) + (synopsis "Resolver of class names, types and structural element names") + (description "This package provides a PSR-5 based resolver of class names, +types and structural element names.") + (home-page "http://www.phpdoc.org") + (license license:expat))) -- 2.27.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 12/34] gnu: Add php-phpdocumentor-reflection-common. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 12 Jul 2020 22:27:02 +0000 Resent-Message-ID: <handler.42338.B42338.159459277014141 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.159459277014141 (code B ref 42338); Sun, 12 Jul 2020 22:27:02 +0000 Received: (at 42338) by debbugs.gnu.org; 12 Jul 2020 22:26:10 +0000 Received: from localhost ([127.0.0.1]:47031 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jukQD-0003fv-Ui for submit <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:26:10 -0400 Received: from lepiller.eu ([89.234.186.109]:42900) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1jukQ1-0003ad-3q for 42338 <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:25:57 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id d24ed555 for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=V4ZamGc/HDdD54Y2DnrMIoork eCwBMq2p7TPFt6E9tc=; b=dcRCI/Rvx5q8PAyXf6B/KjCgDnmVfYyExJfdseUax YuS84XUKGsV4lahd7aXg54/3QMi0KKd2TUduUqwp18HnjwFvsWIZzDgLhRXV1Efx +m9AG2gFLrPk4Lhd8v7CSUrIztccPPm/jh96WHLIHzeziGwdOQtgIDJEv/O5Uq/L bNLg+7JBscpzqakkTFCUU+YN5DzBOpMy3UbpBRc0/6l8WGzJMTvGArT0CNEBOgwq XWcNyT+JJBDOUDezwuA9MybjeJ14aD8sHFbD4EuQX6jxbWu+Q9t2HBJxIg7jpaik NNaaJggSDU9ydXtkFmpY92RubDrGelfigTe5n+FSoue/g== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 8dae4503 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:51 +0000 (UTC) From: Julien Lepiller <julien@HIDDEN> Date: Mon, 13 Jul 2020 00:25:16 +0200 Message-Id: <20200712222538.18092-12-julien@HIDDEN> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200712222538.18092-1-julien@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * gnu/packages/php-xyz.scm (php-phpdocumentor-reflection-common): New variable. --- gnu/packages/php-xyz.scm | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm index ffc2eb7b11..9b604c46f0 100644 --- a/gnu/packages/php-xyz.scm +++ b/gnu/packages/php-xyz.scm @@ -255,3 +255,27 @@ who run php versions without the ctype extension.") and output of PHP methods.") (home-page "https://github.com/webmozart/assert") (license license:expat))) + +(define-public php-phpdocumentor-reflection-common + (package + (name "php-phpdocumentor-reflection-common") + (version "2.2.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/phpDocumentor/ReflectionCommon.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1q685cpwbfxqy42iz61xxv6zbcc1qskn07nkipflj6c5s935l8jy")))) + (build-system composer-build-system) + (arguments + ;; We do not have phpunit yet + `(#:tests? #f)) + (synopsis "Common reflection classes used by phpdocumentor to reflect +the code structure") + (description "This package contains common classes used by phpdocumentor +to analyze the code structure.") + (home-page "http://www.phpdoc.org") + (license license:expat))) -- 2.27.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 14/34] gnu: Add php-phpdocumentor-reflection-docblock. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 12 Jul 2020 22:27:02 +0000 Resent-Message-ID: <handler.42338.B42338.159459277014148 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.159459277014148 (code B ref 42338); Sun, 12 Jul 2020 22:27:02 +0000 Received: (at 42338) by debbugs.gnu.org; 12 Jul 2020 22:26:10 +0000 Received: from localhost ([127.0.0.1]:47033 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jukQE-0003g2-7k for submit <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:26:10 -0400 Received: from lepiller.eu ([89.234.186.109]:42904) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1jukQ1-0003bs-I0 for 42338 <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:25:57 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 563921ca for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=GTIyCO5taEhWcVbMdN6redc1p eOp/8eHl6Qni64kLIU=; b=Nyx/no5Lw+Nu1RebhSwWRvYM1RSDMUtURutnsbIkW YsGUh48WVTf0A+x3tOWI9MepbQ0SGwtCcQDMZ9n9OQkHOiS3chx/RiJm9dA4aCYa hbaAbegafhIOWLhGsZ/DRBjKgQwOrAv9YIbF/P/0eyc6RYJ0bmF3iA0urTHsJ+uD eQbg4yAMid67CGvaZsKrGFQPu77jjPiZHhgJkTHGk/URZ+9YXfxu+J7KVIITcy0i j0mAL2OuLzeRGAbRzMGxkou8jP8yPVVf+G1A3fueUrWgqKJ/XOc9L5rk5UQ//GJa tZ/zZk7vL5z1reWU1+oUolueuiq4/5MkRu8jHfEqQT9cA== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id d349199f (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:52 +0000 (UTC) From: Julien Lepiller <julien@HIDDEN> Date: Mon, 13 Jul 2020 00:25:18 +0200 Message-Id: <20200712222538.18092-14-julien@HIDDEN> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200712222538.18092-1-julien@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * gnu/packages/php-xyz.scm (php-phpdocumentor-reflection-docblock): New variable. --- gnu/packages/php-xyz.scm | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm index 93d8649bee..df9c490bbf 100644 --- a/gnu/packages/php-xyz.scm +++ b/gnu/packages/php-xyz.scm @@ -304,3 +304,31 @@ to analyze the code structure.") types and structural element names.") (home-page "http://www.phpdoc.org") (license license:expat))) + +(define-public php-phpdocumentor-reflection-docblock + (package + (name "php-phpdocumentor-reflection-docblock") + (version "5.1.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/phpDocumentor/ReflectionDocBlock.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1bsqwcq5ix7f5p56kc92pl1nqpjdpfc92pjvwyshp1syrrspa3rr")))) + (build-system composer-build-system) + (arguments + ;; We do not have phpunit yet + `(#:tests? #f)) + (inputs + `(("php-webmozart-assert" ,php-webmozart-assert) + ("php-phpdocumentor-reflection-common" ,php-phpdocumentor-reflection-common) + ("php-phpdocumentor-type-resolver" ,php-phpdocumentor-type-resolver))) + (synopsis "Library for retrieving documentation in code fro the code") + (description "With this component, a library can provide support for +annotations via DocBlocks or otherwise retrieve information that is embedded +in a DocBlock.") + (home-page "https://github.com/phpDocumentor/ReflectionDocBlock") + (license license:expat))) -- 2.27.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 15/34] gnu: Add php-theseer-tokenizer. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 12 Jul 2020 22:27:03 +0000 Resent-Message-ID: <handler.42338.B42338.159459277014155 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.159459277014155 (code B ref 42338); Sun, 12 Jul 2020 22:27:03 +0000 Received: (at 42338) by debbugs.gnu.org; 12 Jul 2020 22:26:10 +0000 Received: from localhost ([127.0.0.1]:47035 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jukQE-0003g9-Ho for submit <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:26:10 -0400 Received: from lepiller.eu ([89.234.186.109]:42902) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1jukQ1-0003aw-Vl for 42338 <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:25:58 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 70125a8d for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=Yk+713NZzUPlkeHadCSGzMIqn 98ZpP8iRlnNRBG2gls=; b=iO7fgCqqS9gpEBI6BqdcEknjkWSZ/JlkdB9QraVJ9 sq1eIXeP2Y7+hfD+4tzZgQZOINbZvsF4mbh+ptlBEdCRXe4NVhrsYXNMNP4RjjYl BgeSFGObij9DXaaQZmdmaaPtTKJ+ra6CcCpnHDyFFzcUyJfsLpyT0veAYgX1iBSe P1KXcTltS6uwwTtwuNxqQURDR+HL6jneTJaZ/+xXrLqb7SiNo+2i6Z658gSVwHfR UpqfGufnJa2VQmSPSZ/VHW/YWBTZa134WM+c5/PoRFRmQ1bnSbteI1otV7K1Ea1v yly4RdCpkiYBLy9pEWVv1eDOZO+AtB96U5iec6aNuzkKw== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 9fa0080d (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:53 +0000 (UTC) From: Julien Lepiller <julien@HIDDEN> Date: Mon, 13 Jul 2020 00:25:19 +0200 Message-Id: <20200712222538.18092-15-julien@HIDDEN> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200712222538.18092-1-julien@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * gnu/packages/php-xyz.scm (php-theseer-tokenizer): New variable. --- gnu/packages/php-xyz.scm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm index df9c490bbf..f54b875d92 100644 --- a/gnu/packages/php-xyz.scm +++ b/gnu/packages/php-xyz.scm @@ -332,3 +332,26 @@ annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.") (home-page "https://github.com/phpDocumentor/ReflectionDocBlock") (license license:expat))) + +(define-public php-theseer-tokenizer + (package + (name "php-theseer-tokenizer") + (version "1.1.3") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/theseer/tokenizer.git") + (commit "11336f6f84e16a720dae9d8e6ed5019efa85a0f9"))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0j436a3jpynnlqrvd7la7a7smj78aklkragwa9l8p91973xra18l")))) + (build-system composer-build-system) + (arguments + ;; We do not have phpunit yet + `(#:tests? #f)) + (synopsis "Convert PHP to XML") + (description "This package provides a small library for converting tokenized +PHP source code into XML and potentially other formats.") + (home-page "https://github.com/theseer/tokenizer") + (license license:bsd-3))) -- 2.27.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 16/34] gnu: Add php-sebastian-code-unit-reverse-lookup. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 12 Jul 2020 22:27:03 +0000 Resent-Message-ID: <handler.42338.B42338.159459277114163 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.159459277114163 (code B ref 42338); Sun, 12 Jul 2020 22:27:03 +0000 Received: (at 42338) by debbugs.gnu.org; 12 Jul 2020 22:26:11 +0000 Received: from localhost ([127.0.0.1]:47037 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jukQE-0003gG-PZ for submit <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:26:11 -0400 Received: from lepiller.eu ([89.234.186.109]:42900) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1jukQ2-0003ad-3h for 42338 <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:25:58 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 058eb13c for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=WlCw+XsIXhjy3Yz/r3dm7ewNB Qr6vheTqK4bOHyhYYE=; b=e9+PPzQNZQl1ZoakJx4qKRrcto+udou9ldn3Hys2O nVuHRXTkdMRuHgoR/mt0gjdnMabm+WrgOumq1xbl8AyPRZy7y46t9mZoqCjfXPgr MJtTJDp2mRfTDNqIzLmssNeD2Yg4YWrQP6NlN5ARLrF+QDCL3VDGTKVzzG/7gG1S gqYXr/Gb5s/TnmBC0K40AInwLAszw6RBYGbQ3nv4u46yANnnYzDbHh081bDHR5Th PCmgJ+iwIFlDCy5VHBMltVmYxvxCxAPlXTYoje/KPkWTz9v8TspGmQGn0QO5E+/Y aOxQapXMdVRdXt1QoY0J4AgkapMQsrLKL4g5p8m+uDPvQ== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 020fd3cf (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:53 +0000 (UTC) From: Julien Lepiller <julien@HIDDEN> Date: Mon, 13 Jul 2020 00:25:20 +0200 Message-Id: <20200712222538.18092-16-julien@HIDDEN> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200712222538.18092-1-julien@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * gnu/packages/php-xyz.scm (php-sebastian-code-unit-reverse-lookup): New variable. --- gnu/packages/php-xyz.scm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm index f54b875d92..13584273f9 100644 --- a/gnu/packages/php-xyz.scm +++ b/gnu/packages/php-xyz.scm @@ -355,3 +355,26 @@ in a DocBlock.") PHP source code into XML and potentially other formats.") (home-page "https://github.com/theseer/tokenizer") (license license:bsd-3))) + +(define-public php-sebastian-code-unit-reverse-lookup + (package + (name "php-sebastian-code-unit-reverse-lookup") + (version "2.0.2") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0lppni3qcd6gx50jf16y3n71ldj12xjd06kl9ml78zd5p2s6z4qc")))) + (build-system composer-build-system) + (arguments + ;; We do not have phpunit yet + `(#:tests? #f)) + (synopsis "Look up function name from location") + (description "This package provides a facility to look up which function or +method a line of code belongs to.") + (home-page "https://github.com/sebastianbergmann/code-unit-reverse-lookup/") + (license license:bsd-3))) -- 2.27.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 17/34] gnu: Add php-phpunit-php-token-stream. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 12 Jul 2020 22:27:04 +0000 Resent-Message-ID: <handler.42338.B42338.159459277114170 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.159459277114170 (code B ref 42338); Sun, 12 Jul 2020 22:27:04 +0000 Received: (at 42338) by debbugs.gnu.org; 12 Jul 2020 22:26:11 +0000 Received: from localhost ([127.0.0.1]:47039 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jukQF-0003gO-1d for submit <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:26:11 -0400 Received: from lepiller.eu ([89.234.186.109]:42904) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1jukQ2-0003bs-7u for 42338 <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:25:58 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 5b66db5c for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=Wb5frlZXN2TP+d7ZBGnP/ti9t 0Skzmaitz/44sKue0I=; b=KU9A3lFOEQ6Gmpe+24vHxN4RPNC5bRs3MgRhF9w4r PZMT7CF4cqPHwkwJ8NtEnBnmnn+kh+j0mHJZev54X7E1jze76cwKbxV50rjR/LF+ Akls7Rog2h9IZ08NfpSf+fvjjKvoltj2SACgSpwmVBHvekxZCKJPvGj68yu0eLUh HZksEd6hxEeU15EjCtifDrYIDfujR4D0Ie86rKFTbc0vxPa5O+luj03tJ6Hgh7pt kx1LHh90MLE4v+iOOfwpqYz811UfdGvNHPwupkhMJTApO/8gFl1wBIeyNY6NvrDJ GiTuyuu25M7t1J9nGD9fWM/54TRLYlI3y2W4M9h+ZzvLw== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 09be9181 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:54 +0000 (UTC) From: Julien Lepiller <julien@HIDDEN> Date: Mon, 13 Jul 2020 00:25:21 +0200 Message-Id: <20200712222538.18092-17-julien@HIDDEN> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200712222538.18092-1-julien@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * gnu/packages/php-xyz.scm (php-phpunit-php-token-stream): New variable. --- gnu/packages/php-xyz.scm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm index 13584273f9..344c413d2c 100644 --- a/gnu/packages/php-xyz.scm +++ b/gnu/packages/php-xyz.scm @@ -378,3 +378,26 @@ PHP source code into XML and potentially other formats.") method a line of code belongs to.") (home-page "https://github.com/sebastianbergmann/code-unit-reverse-lookup/") (license license:bsd-3))) + +(define-public php-phpunit-php-token-stream + (package + (name "php-phpunit-php-token-stream") + (version "4.0.3") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/sebastianbergmann/php-token-stream.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0iv8ssvyjhgxa1qpp5s8i0j409w49s2kc9qwv1c27qgdhv7yhf7h")))) + (build-system composer-build-system) + (arguments + ;; We do not have phpunit yet + `(#:tests? #f)) + (synopsis "Wrapper around PHP's tokenizer extension") + (description "This library provides a wrapper around PHP's tokenizer +extension.") + (home-page "https://github.com/sebastianbergmann/php-token-stream/") + (license license:bsd-3))) -- 2.27.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 18/34] gnu: Add php-sebastian-version. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 12 Jul 2020 22:27:04 +0000 Resent-Message-ID: <handler.42338.B42338.159459277114177 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.159459277114177 (code B ref 42338); Sun, 12 Jul 2020 22:27:04 +0000 Received: (at 42338) by debbugs.gnu.org; 12 Jul 2020 22:26:11 +0000 Received: from localhost ([127.0.0.1]:47041 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jukQF-0003gV-9d for submit <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:26:11 -0400 Received: from lepiller.eu ([89.234.186.109]:42902) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1jukQ2-0003aw-Jn for 42338 <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:25:59 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id e018e868 for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=tOa92GiXxdqHHACSMuP7r2lwH 8wTmdRENLgOS3HWhIc=; b=f4COZPRZD+Qkvomwt6RUuIdKLrSbBLNf2ISKtwLXF Z8bq9n6tU3F+RDtIb+JZ0w/Bstuv2x7Dk4n5Rk1D7DtoClgbsIg/+nQT1IXdBn46 Cv2R1517eSsvxFlv7plRrlApEmN7Z+Mb8aVDU4jORtMAQwYauU/ebC60cO2eutsv ClEAaYbgCvEOpQGmQ9v+V/EBc1wCH3kDTuIpazjNP1zx1X+jeUrIXj51mYmkyOUr vnnTLodpqC5wz6/+OuuAfGVhYGm8mkUZmjkyTMv3ItHGLFOOo6b7e0iBKWvFQakV tAtbX5a0O8QkccXjymkAsYO4FJkPg6WGcQpPQciXImDUg== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id dc675e69 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:54 +0000 (UTC) From: Julien Lepiller <julien@HIDDEN> Date: Mon, 13 Jul 2020 00:25:22 +0200 Message-Id: <20200712222538.18092-18-julien@HIDDEN> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200712222538.18092-1-julien@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * gnu/packages/php-xyz.scm (php-sebastian-version): New variable. --- gnu/packages/php-xyz.scm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm index 344c413d2c..906a88d49e 100644 --- a/gnu/packages/php-xyz.scm +++ b/gnu/packages/php-xyz.scm @@ -401,3 +401,26 @@ method a line of code belongs to.") extension.") (home-page "https://github.com/sebastianbergmann/php-token-stream/") (license license:bsd-3))) + +(define-public php-sebastian-version + (package + (name "php-sebastian-version") + (version "3.0.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/sebastianbergmann/version.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1kr2i6s7y4k18bz09cqj4pc4bqzph9n6ncgpqq4p4fg790h5i5ym")))) + (build-system composer-build-system) + (arguments + ;; We do not have phpunit yet + `(#:tests? #f)) + (synopsis "PHP versionning library") + (description "This package is a library that helps with managing the version +number of Git-hosted PHP projects.") + (home-page "https://github.com/sebastianbergmann/version") + (license license:bsd-3))) -- 2.27.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 19/34] gnu: Add php-phpunit-php-file-iterator. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 12 Jul 2020 22:27:04 +0000 Resent-Message-ID: <handler.42338.B42338.159459277114184 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.159459277114184 (code B ref 42338); Sun, 12 Jul 2020 22:27:04 +0000 Received: (at 42338) by debbugs.gnu.org; 12 Jul 2020 22:26:11 +0000 Received: from localhost ([127.0.0.1]:47043 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jukQF-0003gc-IG for submit <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:26:11 -0400 Received: from lepiller.eu ([89.234.186.109]:42900) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1jukQ2-0003ad-SN for 42338 <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:25:59 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 8e9eb377 for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=5ortme/8PwEwzx5TzOlY8dWDM 1R6Ev5lZKNZUpzGsGk=; b=mk9KpL6GwHyRhvUXW2XRlWZFsw+8q4qIU3obGWGAj 6SD5ucECQ2cGDNl+3Al0cTXO6VPcVaQ9J0+4QGfi16giHnE50Hsg4XdAIKy2a/4U Grnqld05E9t9iFMm2HAif+cfkiPu385lNj6B/7LVWVxn3oGAd/FU+lCXImiUXwUX P4WyWktUS4v3ERiW2NB+ZniIdgmIWOTuO9Qsa6/68nmQlWxozhwiGSQs/7Aoc87b 3ACUpYLRvbSLrF1KzjUwSE7Y8vNj5etV2m/WXbyatWFk+ze0588UN9awaoRU73AU vteqmeDkK0FyEIbCbZkY6MqgE6pQiwiNYJieDC+vBFYSg== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 865d82b8 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:55 +0000 (UTC) From: Julien Lepiller <julien@HIDDEN> Date: Mon, 13 Jul 2020 00:25:23 +0200 Message-Id: <20200712222538.18092-19-julien@HIDDEN> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200712222538.18092-1-julien@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * gnu/packages/php-xyz.scm (php-phpunit-php-file-iterator): New variable. --- gnu/packages/php-xyz.scm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm index 906a88d49e..5d06bea0cb 100644 --- a/gnu/packages/php-xyz.scm +++ b/gnu/packages/php-xyz.scm @@ -424,3 +424,26 @@ extension.") number of Git-hosted PHP projects.") (home-page "https://github.com/sebastianbergmann/version") (license license:bsd-3))) + +(define-public php-phpunit-php-file-iterator + (package + (name "php-phpunit-php-file-iterator") + (version "3.0.4") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/sebastianbergmann/php-file-iterator.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1pglbp8m4iv5w16gshlp49k4ngpsx28mhwip761kyvvd5w27ysr2")))) + (build-system composer-build-system) + (arguments + ;; We do not have phpunit yet + `(#:tests? #f)) + (synopsis "Filter file by extension") + (description "This package contains a @code{FilterIterator} implementation +that filters files based on a list of suffixes.") + (home-page "https://github.com/sebastianbergmann/php-file-iterator/") + (license license:bsd-3))) -- 2.27.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 20/34] gnu: Add php-phpunit-php-text-template. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 12 Jul 2020 22:27:05 +0000 Resent-Message-ID: <handler.42338.B42338.159459277214192 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.159459277214192 (code B ref 42338); Sun, 12 Jul 2020 22:27:05 +0000 Received: (at 42338) by debbugs.gnu.org; 12 Jul 2020 22:26:12 +0000 Received: from localhost ([127.0.0.1]:47045 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jukQF-0003gj-Qv for submit <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:26:12 -0400 Received: from lepiller.eu ([89.234.186.109]:42904) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1jukQ3-0003bs-1T for 42338 <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:25:59 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id e764dc85 for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=1ngwT8cVQz+D/F83QwNOvt1r7 eSvIwdzz/dG8IMLmDg=; b=iq3cVnsp92lrZwMMUaTMkOde5po+iekmUZlUIlXRz lfUnONCeMyKPtYl5ruiWq+sya922batXgP09Wk+3hW23M6UWUSVbaa7cLuPgAmbj v9NePvoPm0nwfVKEnRJuiTTxmJcsbLE8s2cy/fOvUus1/UyqD49b+f2oFu8BOSIW dina4rn5mWILmziuN6nvdqpXZD/yEunHKcH9b6rm3lSnZW9hrFEx4odeE+y5Vqle grtTTvuGKH7Jl05QTldPseIqEh8uR3KYeXTLO6jkL7GOb2ToPATz3lMFYkNLx0Lm 3W7xujRNQBYP7zkPYq2kFQw2H8yHAWV+9jbNXjQww5Dqg== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id b733766a (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:55 +0000 (UTC) From: Julien Lepiller <julien@HIDDEN> Date: Mon, 13 Jul 2020 00:25:24 +0200 Message-Id: <20200712222538.18092-20-julien@HIDDEN> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200712222538.18092-1-julien@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * gnu/packages/php-xyz.scm (php-phpunit-php-text-template): New variable. --- gnu/packages/php-xyz.scm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm index 5d06bea0cb..b5abcaae36 100644 --- a/gnu/packages/php-xyz.scm +++ b/gnu/packages/php-xyz.scm @@ -447,3 +447,25 @@ number of Git-hosted PHP projects.") that filters files based on a list of suffixes.") (home-page "https://github.com/sebastianbergmann/php-file-iterator/") (license license:bsd-3))) + +(define-public php-phpunit-php-text-template + (package + (name "php-phpunit-php-text-template") + (version "2.0.2") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/sebastianbergmann/php-text-template.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0x38kj1xlnysg9xgad560k361l93vh32mvkyfn7rss3p2r319jhx")))) + (build-system composer-build-system) + (arguments + ;; We do not have phpunit yet + `(#:tests? #f)) + (synopsis "Simple template engine") + (description "This package contains a library for a simple templating engine.") + (home-page "https://github.com/sebastianbergmann/php-text-template/") + (license license:bsd-3))) -- 2.27.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 21/34] gnu: Add php-sebastian-diff. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 12 Jul 2020 22:27:05 +0000 Resent-Message-ID: <handler.42338.B42338.159459277214199 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.159459277214199 (code B ref 42338); Sun, 12 Jul 2020 22:27:05 +0000 Received: (at 42338) by debbugs.gnu.org; 12 Jul 2020 22:26:12 +0000 Received: from localhost ([127.0.0.1]:47047 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jukQG-0003gr-3J for submit <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:26:12 -0400 Received: from lepiller.eu ([89.234.186.109]:42902) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1jukQ3-0003aw-GZ for 42338 <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:25:59 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 4db10f77 for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=v/JWPGPMKieJ4H9c4euXY9JAo AXKmTjqnBwFXCRD370=; b=JH3AZxLOTt6DK1ZBFYtZxeChleGsDY0LrokpZXrG3 w50j/Srl1oS4fD3sFOnnklTE12yjBgCt7N/F7bfcezjmjjr3HtNWaZKRxdlldvEC 6SaOGqbU4K5vEA7NE24hkQBprCzhbMB+1WoEu05Bc0Kp9XYglQdPKRpudohxPVoU 4bufgkFW+aqnF7/fTHKpR8924OZAynNyHsk11AbkX58nScCgpLqLka1Nt1/FzeP4 V/3Ra5iZIEL5VMnMRm7lSUIMFXFiyvye0iCROFLO/8QH6zhgXZgGV2yAtUx7OqI3 lXBGAIzccQFYiP86IsDu//cyf5cDG2s//z5iYwUfa2ngQ== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id d49bf957 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:56 +0000 (UTC) From: Julien Lepiller <julien@HIDDEN> Date: Mon, 13 Jul 2020 00:25:25 +0200 Message-Id: <20200712222538.18092-21-julien@HIDDEN> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200712222538.18092-1-julien@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * gnu/packages/php-xyz.scm (php-sebastian-diff): New variable. --- gnu/packages/php-xyz.scm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm index b5abcaae36..ccc613baaf 100644 --- a/gnu/packages/php-xyz.scm +++ b/gnu/packages/php-xyz.scm @@ -469,3 +469,25 @@ that filters files based on a list of suffixes.") (description "This package contains a library for a simple templating engine.") (home-page "https://github.com/sebastianbergmann/php-text-template/") (license license:bsd-3))) + +(define-public php-sebastian-diff + (package + (name "php-sebastian-diff") + (version "4.0.2") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/sebastianbergmann/diff.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0fr5vrmz3d1wwpf59y16fin5lgi55sjd7dqfkx0zqmsqadbjrjxq")))) + (build-system composer-build-system) + (arguments + ;; We do not have phpunit yet + `(#:tests? #f)) + (synopsis "Diff implementation") + (description "This package contains a PHP implementation of a diff function.") + (home-page "https://github.com/sebastianbergmann/diff") + (license license:bsd-3))) -- 2.27.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 22/34] gnu: Add php-sebastian-comparator. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 12 Jul 2020 22:27:06 +0000 Resent-Message-ID: <handler.42338.B42338.159459277214206 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.159459277214206 (code B ref 42338); Sun, 12 Jul 2020 22:27:06 +0000 Received: (at 42338) by debbugs.gnu.org; 12 Jul 2020 22:26:12 +0000 Received: from localhost ([127.0.0.1]:47049 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jukQG-0003gy-BM for submit <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:26:12 -0400 Received: from lepiller.eu ([89.234.186.109]:42900) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1jukQ3-0003ad-Oc for 42338 <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:26:00 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id b6176355 for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=KO2Ilrm8dXS85dF4zW4WfG4m3 Hz0HjUkJm1V7cHbjDA=; b=h2gDj/KTfYx5xB6qafHELqh57r/g83lIGMA3TnQrI bpczYS8oiCfqbgxwfutZRLWsb+GaAwjzks3s2qRkD16tLtDEWbpeCEd3Hg49jMqo MEQLLAwtdndPJv3RcUpIBFTp7BdZ3QJarhYh/Ex4t5FIl3zBfzyVce9JBzo56OhM UDd2kUZkifUrhCOolMEkR16DMIANArCthfEFM+cIUnEaCANZ+cAwG7C/Y56gLr+a gJO3HiQnXpo8d/oR3+dVZoPGU3MtRMqmqikHvdsAXU0q8ro4eWYVKpv9FYtnk5/t j7n5rRXgsQygW53SooFYd0yMZNqaUzYgNwRSlaBa5AphQ== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id b001dbe6 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:56 +0000 (UTC) From: Julien Lepiller <julien@HIDDEN> Date: Mon, 13 Jul 2020 00:25:26 +0200 Message-Id: <20200712222538.18092-22-julien@HIDDEN> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200712222538.18092-1-julien@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * gnu/packages/php-xyz.scm (php-sebastian-comparator): New variable. --- gnu/packages/php-xyz.scm | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm index ccc613baaf..aff2ed79a7 100644 --- a/gnu/packages/php-xyz.scm +++ b/gnu/packages/php-xyz.scm @@ -491,3 +491,29 @@ that filters files based on a list of suffixes.") (description "This package contains a PHP implementation of a diff function.") (home-page "https://github.com/sebastianbergmann/diff") (license license:bsd-3))) + +(define-public php-sebastian-comparator + (package + (name "php-sebastian-comparator") + (version "4.0.3") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/sebastianbergmann/comparator.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1scw7vm26layqh5mzvdhjiil520fj6ipixkjnmwm036xr925iww0")))) + (build-system composer-build-system) + (arguments + ;; We do not have phpunit yet + `(#:tests? #f)) + (inputs + `(("php-sebastian-exporter" ,php-sebastian-exporter) + ("php-sebastian-diff" ,php-sebastian-diff))) + (synopsis "PHP value comparison") + (description "This package provides the functionality to compare PHP values +for equality.") + (home-page "https://github.com/sebastianbergmann/comparator") + (license license:bsd-3))) -- 2.27.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 23/34] gnu: Add php-sebastian-environment. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 12 Jul 2020 22:27:06 +0000 Resent-Message-ID: <handler.42338.B42338.159459277214213 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.159459277214213 (code B ref 42338); Sun, 12 Jul 2020 22:27:06 +0000 Received: (at 42338) by debbugs.gnu.org; 12 Jul 2020 22:26:12 +0000 Received: from localhost ([127.0.0.1]:47051 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jukQG-0003h5-JV for submit <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:26:12 -0400 Received: from lepiller.eu ([89.234.186.109]:42904) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1jukQ4-0003bs-2f for 42338 <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:26:00 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 09995805 for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=tPl65p3+upIny5KhV19aucdox TFk6hVKH0EQJlvkHMQ=; b=hKjxjy5ODJucs79MSOBTrahvaNMyYTeuVUkdpLyMn mHJtBkWtyGvn3jqSuGmj2ahs8ZGBfqpRuJ8CI5RP0px/UqKwgB64tjGUXi5CDPjO rvnbsS3xAeuv6LXUDzkxEtTGzFgsyiCuMOa3Q1BpFMC1EgettRrGtJPzSIctLC1S LxJEaDvgckE97z7BbTPWc+KqvdbbbltyXVODp+mxN083bRusb8kUFA4IpzSmjXzV X0hDmkgaIaOB0j8GPI6BdIpOWfq3WYsAPhTq6ZzlwSYAWGn946x72+QUhd7i9DMY 0+2x7O3MY1WkBM3JdkUGT+/VweB7EQk+yI2HqIYg8jk6g== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 6b95a1ea (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:57 +0000 (UTC) From: Julien Lepiller <julien@HIDDEN> Date: Mon, 13 Jul 2020 00:25:27 +0200 Message-Id: <20200712222538.18092-23-julien@HIDDEN> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200712222538.18092-1-julien@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * gnu/packages/php-xyz.scm (php-sebastian-environment): New variable. --- gnu/packages/php-xyz.scm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm index aff2ed79a7..9ee823bcda 100644 --- a/gnu/packages/php-xyz.scm +++ b/gnu/packages/php-xyz.scm @@ -517,3 +517,25 @@ that filters files based on a list of suffixes.") for equality.") (home-page "https://github.com/sebastianbergmann/comparator") (license license:bsd-3))) + +(define-public php-sebastian-environment + (package + (name "php-sebastian-environment") + (version "5.1.2") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/sebastianbergmann/environment.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0lhaiwk6dbwii9kmjaq3gjl2x5s1rikmxkvmy4mjvjcbi7imp38s")))) + (build-system composer-build-system) + (arguments + ;; We do not have phpunit yet + `(#:tests? #f)) + (synopsis "Handle HHVM and PHP environments") + (description "This package provides functionality to handle HHVM/PHP environments") + (home-page "http://www.github.com/sebastianbergmann/environment") + (license license:bsd-3))) -- 2.27.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 24/34] gnu: Add php-phpspec-prophecy. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 12 Jul 2020 22:27:06 +0000 Resent-Message-ID: <handler.42338.B42338.159459277314221 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.159459277314221 (code B ref 42338); Sun, 12 Jul 2020 22:27:06 +0000 Received: (at 42338) by debbugs.gnu.org; 12 Jul 2020 22:26:13 +0000 Received: from localhost ([127.0.0.1]:47053 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jukQG-0003hC-Ro for submit <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:26:13 -0400 Received: from lepiller.eu ([89.234.186.109]:42902) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1jukQ4-0003aw-9Q for 42338 <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:26:00 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id ae1fe683 for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=RMH8u9Jh4tWYtY6BEA/FscYKB JvL+v/ph7M1WoFM+ts=; b=OWn7UPZ+P3kMj04L0je/jRl/q16BR349zyGOfDzkb R7Ej9OrZcHXk3QjGoiespdGa+bN9Sd5vsbfaVdyzC2HHNObYXs+pyJjXT9pX6EqA hFwUUg4/DemDid904FjEkD8MRdBHpF3U5RsCykkvSZWg6QFNynXTOwMqQwwD10GH AhQ9QY4kuvy05cfM7Z13FikQDqmfAfnKJ5Oe2rHMj14AsfvCnOeHmZtREhVejeN6 SVn8ccqSd2av0aoxzD+0YY7XRQq1W5xRJAhVcbms/wCBmFIMKuMEmjGgBR7j+grA 2kzFkkfsR1fDEwTprkfj+rwXaPOYlJnTcoDgINSmV1s4w== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 13bcaa83 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:57 +0000 (UTC) From: Julien Lepiller <julien@HIDDEN> Date: Mon, 13 Jul 2020 00:25:28 +0200 Message-Id: <20200712222538.18092-24-julien@HIDDEN> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200712222538.18092-1-julien@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * gnu/packages/php-xyz.scm (php-phpspec-prophecy): New variable. --- gnu/packages/php-xyz.scm | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm index 9ee823bcda..8c96d9aabc 100644 --- a/gnu/packages/php-xyz.scm +++ b/gnu/packages/php-xyz.scm @@ -539,3 +539,32 @@ for equality.") (description "This package provides functionality to handle HHVM/PHP environments") (home-page "http://www.github.com/sebastianbergmann/environment") (license license:bsd-3))) + +(define-public php-phpspec-prophecy + (package + (name "php-phpspec-prophecy") + (version "1.11.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/phpspec/prophecy.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1pd6iz6pbfpaz5rqa36q01l569zgiqpjgqmzw3rra2qdh1jrwdy1")))) + (build-system composer-build-system) + (arguments + ;; We do not have phpunit yet + `(#:tests? #f)) + (inputs + `(("php-sebastian-recursion-context" ,php-sebastian-recursion-context) + ("php-doctrine-instantiator" ,php-doctrine-instantiator) + ("php-sebastian-comparator" ,php-sebastian-comparator) + ("php-phpdocumentor-reflection-docblock" + ,php-phpdocumentor-reflection-docblock))) + (synopsis "Mocking framework for PHP 5.3+") + (description "This package contains a mocking framework for testing PHP +5.3+ projects.") + (home-page "https://github.com/phpspec/prophecy") + (license license:expat))) -- 2.27.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 26/34] gnu: Add php-sebastian-global-state. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 12 Jul 2020 22:27:07 +0000 Resent-Message-ID: <handler.42338.B42338.159459277314227 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.159459277314227 (code B ref 42338); Sun, 12 Jul 2020 22:27:07 +0000 Received: (at 42338) by debbugs.gnu.org; 12 Jul 2020 22:26:13 +0000 Received: from localhost ([127.0.0.1]:47055 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jukQH-0003hJ-3E for submit <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:26:13 -0400 Received: from lepiller.eu ([89.234.186.109]:42904) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1jukQ4-0003bs-Ty for 42338 <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:26:01 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 7738412d for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=029Ek/R5BYmvPDQl2IF3KxsXB xji7EIFCw896eNwLzk=; b=Akl7BYFopLVOa+viQKPder0+F0suocGDJBncO6j97 YjbxxkImS0fte2xROpo8nTen37UbVAqOipD6Y1WZupLuH2DvB52zB41NKLMhRfEp D2LNzeX3Kf796/Ruwm9pxFusPIXWdVbu4TmxKxKjsfUSU2Ob6Qcf0TG9LQVUc+va YpqumZtp3qvSSGEbdBT6+lYm3zLvVLP3ADWHzHlvaZDbVjoX5PEfumfD8PcU0yav tx3xX54q5GgRrGRRC7v2c+iXD8C36sFpIyozOv7xvq2d44Nyk2pRncLFFiJLGhI7 /gIOX+zfHFQUEVWkfHa+ArNtqHbsoGmmXMFWzaxg2Rj9A== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 667d0b86 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:58 +0000 (UTC) From: Julien Lepiller <julien@HIDDEN> Date: Mon, 13 Jul 2020 00:25:30 +0200 Message-Id: <20200712222538.18092-26-julien@HIDDEN> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200712222538.18092-1-julien@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * gnu/packages/php-xyz.scm (php-sebastian-global-state): New variable. --- gnu/packages/php-xyz.scm | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm index 899f6a3f69..4872523b31 100644 --- a/gnu/packages/php-xyz.scm +++ b/gnu/packages/php-xyz.scm @@ -591,3 +591,30 @@ for equality.") inherited and non-public ones.") (home-page "https://github.com/sebastianbergmann/object-reflector/") (license license:bsd-3))) + +(define-public php-sebastian-global-state + (package + (name "php-sebastian-global-state") + (version "4.0.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/sebastianbergmann/global-state.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0x6sfw353px5y7azipn2mb15w7w7zxbbpbv3dbhhkryrhad8w064")))) + (build-system composer-build-system) + (arguments + ;; We do not have phpunit yet + `(#:tests? #f)) + (inputs + `(("php-sebastian-recursion-context" ,php-sebastian-recursion-context) + ("php-sebastian-object-reflector" ,php-sebastian-object-reflector))) + (synopsis "Snapshotting of global state") + (description "This package contains a stand-alone component originally part +of PHPUnit. It provides support for creating a snapshot of the global state +of a PHP program.") + (home-page "http://www.github.com/sebastianbergmann/global-state") + (license license:bsd-3))) -- 2.27.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 28/34] gnu: Add php-sebastian-resource-operations. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 12 Jul 2020 22:36:01 +0000 Resent-Message-ID: <handler.42338.B42338.159459335215224 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.159459335215224 (code B ref 42338); Sun, 12 Jul 2020 22:36:01 +0000 Received: (at 42338) by debbugs.gnu.org; 12 Jul 2020 22:35:52 +0000 Received: from localhost ([127.0.0.1]:47072 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jukZc-0003xP-3J for submit <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:35:52 -0400 Received: from lepiller.eu ([89.234.186.109]:42900) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1jukQ5-0003ad-DB for 42338 <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:26:02 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 58905ec1 for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:26:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=tNrWM7CxSOP9v4S0ymA6FxK0l qIVBvVOc3Y8oK2nP4M=; b=ieZ3RHdpASmk4/aKsrcwXHT4OVUHgx+5ipnMDBH9/ ++J05/0BR2PGxBrGuDhK2sBtyQ2bY1T3+YQLTKu9WDMXHrEp/ZnSoAlz/6ML0XPK jTyLdbVOCRzGHzsXdhFRv57U9rL377wZfNmOQJl3niu+Nr64g8YDnpFoyiHOHRHA hX3gB+PHvtXsEWDOaiTLROuMWCPz++C67VIP7/1SUR5KtK7FRdx6IFIVJVcjKje1 GEhTYa/cYs+RaF57V6TiRZVrVvU32Aa1xbxNyZWwGQDKexYSRxWVbbdKvRxe/MCW WmnNsoNiW1Xu2Acnd+JWZQxviRCAqc3onHVBeO8Ehqsfw== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 57a74380 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:26:00 +0000 (UTC) From: Julien Lepiller <julien@HIDDEN> Date: Mon, 13 Jul 2020 00:25:32 +0200 Message-Id: <20200712222538.18092-28-julien@HIDDEN> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200712222538.18092-1-julien@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * gnu/packages/php-xyz.scm (php-sebastian-resource-operations): New variable. --- gnu/packages/php-xyz.scm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm index 8cf5668030..aee08c0878 100644 --- a/gnu/packages/php-xyz.scm +++ b/gnu/packages/php-xyz.scm @@ -644,3 +644,26 @@ of a PHP program.") and object graphs to enumerate all referenced objects.") (home-page "https://github.com/sebastianbergmann/object-enumerator/") (license license:bsd-3))) + +(define-public php-sebastian-resource-operations + (package + (name "php-sebastian-resource-operations") + (version "3.0.2") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/sebastianbergmann/resource-operations.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "09s2gsmx6fg8sx64yyz2dszy22dcsspazlhskv3d9mflpmrk0d9y")))) + (build-system composer-build-system) + (arguments + ;; We do not have phpunit yet + `(#:tests? #f)) + (synopsis "List built-in PHP functions") + (description "This package provides a list of PHP built-in functions that +operate on resources.") + (home-page "https://www.github.com/sebastianbergmann/resource-operations") + (license license:bsd-3))) -- 2.27.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 25/34] gnu: Add php-sebastian-object-reflector. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 12 Jul 2020 22:36:02 +0000 Resent-Message-ID: <handler.42338.B42338.159459335215231 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.159459335215231 (code B ref 42338); Sun, 12 Jul 2020 22:36:02 +0000 Received: (at 42338) by debbugs.gnu.org; 12 Jul 2020 22:35:52 +0000 Received: from localhost ([127.0.0.1]:47074 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jukZc-0003xV-E9 for submit <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:35:52 -0400 Received: from lepiller.eu ([89.234.186.109]:42900) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1jukQ4-0003ad-KJ for 42338 <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:26:01 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 00c04cd6 for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=VS9Eulv2aLaA/xOjdkIWxjJr8 +JtffK9yZak+HeY/5A=; b=Mw9c5daO4WRZZO17stkn4lhBU5RNtP03ZPFSjAsgD lk6qU2snpNIK/vem6foAFlwLm8dQIWdNkwAQp9QnXXqZ1V6ls79QEqA1UfQNP6q5 +m/8Tl5LHmKVlQJ8hyInBnrySNbXawBYoBufcWsrJD0LRz/OzcEZBU4QUCPH5vnQ AGKmGV23F0G9NP127FkN+DY5O0QjDWZHG703DyZalM84EOpYOW0uRPbjWoFXI3P0 QxLmZG3PyXrCdishfjxIZiZxH/gP/J5BdmxugzQZPA2n5Gu+0EaE5AZ05zTrT/Pt 5VPVmEH5Z9gLT46JMEg3wnDrsB+7o9D0BKLO2lpt7ZkXA== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 77c34ee2 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:58 +0000 (UTC) From: Julien Lepiller <julien@HIDDEN> Date: Mon, 13 Jul 2020 00:25:29 +0200 Message-Id: <20200712222538.18092-25-julien@HIDDEN> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200712222538.18092-1-julien@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * gnu/packages/php-xyz.scm (php-sebastian-object-reflector): New variable. --- gnu/packages/php-xyz.scm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm index 8c96d9aabc..899f6a3f69 100644 --- a/gnu/packages/php-xyz.scm +++ b/gnu/packages/php-xyz.scm @@ -568,3 +568,26 @@ for equality.") 5.3+ projects.") (home-page "https://github.com/phpspec/prophecy") (license license:expat))) + +(define-public php-sebastian-object-reflector + (package + (name "php-sebastian-object-reflector") + (version "2.0.2") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/sebastianbergmann/object-reflector.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1qkvp2s932h53f161l30qlnxicw4fklirmnds173wgmavms1b5yb")))) + (build-system composer-build-system) + (arguments + ;; We do not have phpunit yet + `(#:tests? #f)) + (synopsis "PHP reflexion library") + (description "This package allows reflection of object attributes, including +inherited and non-public ones.") + (home-page "https://github.com/sebastianbergmann/object-reflector/") + (license license:bsd-3))) -- 2.27.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 32/34] gnu: Add php-phpunit-php-invoker. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 12 Jul 2020 22:36:02 +0000 Resent-Message-ID: <handler.42338.B42338.159459335315238 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.159459335315238 (code B ref 42338); Sun, 12 Jul 2020 22:36:02 +0000 Received: (at 42338) by debbugs.gnu.org; 12 Jul 2020 22:35:53 +0000 Received: from localhost ([127.0.0.1]:47076 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jukZc-0003xc-KQ for submit <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:35:52 -0400 Received: from lepiller.eu ([89.234.186.109]:42900) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1jukQ8-0003ad-47 for 42338 <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:26:04 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 3b5f4b2e for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:26:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=OWSnpMvuCC87j/8TEEDei2pmP AMWtrDXZVYs4SyuRKE=; b=ZISX1DtWNEn30rGBufJaZE/RX2vqdQrTIDG3lwZMl shScoAQZXiwEok/G55BoYibPpC6HEGZ5fsDMduztr+vuziTB2iqIZrmMw1GIts+O YpLvIvXa3Wztb5Uvxj1o9y0QVmoFPPomuVPE7+iDSIbqSXIp2/E0Z7lX9Lc9GgBv 39SEitWAju8+7sJBo/+i6MNOW3PqEn3Kf60DggV2y7T8+sYQwTbv3lHi6scmZC1f CKbl4qZe7UW+m/iOucdZFr5lIJ1lKKL1vyogwgwk2CCaXn+x8if+hYiHJFoiujmB hzTFzP6xT/2AcigMhXO1db86ngJ5aBcbOJs2zjcGVtnKg== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id b658fdcc (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:26:02 +0000 (UTC) From: Julien Lepiller <julien@HIDDEN> Date: Mon, 13 Jul 2020 00:25:36 +0200 Message-Id: <20200712222538.18092-32-julien@HIDDEN> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200712222538.18092-1-julien@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * gnu/packages/php-xyz.scm (php-phpunit-php-invoker): New variable. --- gnu/packages/php-xyz.scm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm index 1b6669abcc..484fb17790 100644 --- a/gnu/packages/php-xyz.scm +++ b/gnu/packages/php-xyz.scm @@ -745,3 +745,26 @@ processing, and rendering functionality for PHP code coverage information.") of PHPUnit. It provides a utility class for timing.") (home-page "https://github.com/sebastianbergmann/php-timer/") (license license:bsd-3))) + +(define-public php-phpunit-php-invoker + (package + (name "php-phpunit-php-invoker") + (version "3.0.2") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/sebastianbergmann/php-invoker.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1xs7m0wiminnhkd400glmixyhrx1ir710j6fds9i03dhicfcj7db")))) + (build-system composer-build-system) + (arguments + ;; We do not have phpunit yet + `(#:tests? #f)) + (synopsis "PHP library for invoking functions") + (description "This package contains a library to invoke callables with a +timeout.") + (home-page "https://github.com/sebastianbergmann/php-invoker/") + (license license:bsd-3))) -- 2.27.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 30/34] gnu: Add php-phpunit-php-code-coverage. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 12 Jul 2020 22:36:02 +0000 Resent-Message-ID: <handler.42338.B42338.159459335315246 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.159459335315246 (code B ref 42338); Sun, 12 Jul 2020 22:36:02 +0000 Received: (at 42338) by debbugs.gnu.org; 12 Jul 2020 22:35:53 +0000 Received: from localhost ([127.0.0.1]:47078 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jukZc-0003xj-Tt for submit <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:35:53 -0400 Received: from lepiller.eu ([89.234.186.109]:42900) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1jukQ6-0003ad-Bo for 42338 <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:26:03 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id d4daa355 for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:26:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=dwXnSI5EhNLTIj0NKHyqqLx76 6HZilyFKKlX/S7M+aQ=; b=EK79fZhiveB/bGhIIlw51VlmwIaeZU6AIy8/EH2k4 vLjnOZarDxd2ZiFXiPPfMrE2R9TGRFFOpkGtXZ9J31G3LlOIpvoht7wch+SO6OWk UCHvhrk3ofowurN3f+qAT6Z9qQ9YFOoMTRz1Yb0JmvA/dhtw7h19QFqYZ0AIaazS t3LQZ0Ig1WwONkUquBZVrtmavTXQqjVyIqncp7OYJ11c8cDWlPXhAsKYwqYdyfKA nMgE1n9D9eGb/F6dEXPOt2pPqEYYt5vbDH0039ZWwIFHbqdf5JOkS7/j3ESCSNkj PQIHapZRxz+2yOxSwB/0fMa4lbJO1c58k2DyK/Kdhmb1w== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 63350582 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:26:01 +0000 (UTC) From: Julien Lepiller <julien@HIDDEN> Date: Mon, 13 Jul 2020 00:25:34 +0200 Message-Id: <20200712222538.18092-30-julien@HIDDEN> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200712222538.18092-1-julien@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * gnu/packages/php-xyz.scm (php-phpunit-php-code-coverage): New variable. --- gnu/packages/php-xyz.scm | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm index 9a50c431b7..2d186c5190 100644 --- a/gnu/packages/php-xyz.scm +++ b/gnu/packages/php-xyz.scm @@ -690,3 +690,35 @@ operate on resources.") the types of the PHP type system.") (home-page "https://github.com/sebastianbergmann/type") (license license:bsd-3))) + +(define-public php-phpunit-php-code-coverage + (package + (name "php-phpunit-php-code-coverage") + (version "8.0.2") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/sebastianbergmann/php-code-coverage.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1qr7x9y8636bvv0fk8hl0kl9d2y8fy6qw65kpi4yb1yyqhfddkgh")))) + (build-system composer-build-system) + (arguments + ;; We do not have phpunit yet + `(#:tests? #f)) + (inputs + `(("php-theseer-tokenizer" ,php-theseer-tokenizer) + ("php-sebastian-version" ,php-sebastian-version) + ("php-sebastian-environment" ,php-sebastian-environment) + ("php-sebastian-code-unit-reverse-lookup" + ,php-sebastian-code-unit-reverse-lookup) + ("php-phpunit-php-text-template" ,php-phpunit-php-text-template) + ("php-phpunit-php-token-stream" ,php-phpunit-php-token-stream) + ("php-phpunit-php-file-iterator" ,php-phpunit-php-file-iterator))) + (synopsis "Code coverage information library") + (description "This package is a library that provides collection, +processing, and rendering functionality for PHP code coverage information.") + (home-page "https://github.com/sebastianbergmann/php-code-coverage") + (license license:bsd-3))) -- 2.27.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 31/34] gnu: Add php-phpunit-php-timer. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 12 Jul 2020 22:36:03 +0000 Resent-Message-ID: <handler.42338.B42338.159459335315253 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.159459335315253 (code B ref 42338); Sun, 12 Jul 2020 22:36:03 +0000 Received: (at 42338) by debbugs.gnu.org; 12 Jul 2020 22:35:53 +0000 Received: from localhost ([127.0.0.1]:47080 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jukZd-0003xq-57 for submit <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:35:53 -0400 Received: from lepiller.eu ([89.234.186.109]:42900) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1jukQ7-0003ad-Bj for 42338 <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:26:03 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 2037a007 for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:26:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=lz+mBMYGaLKQZQs7bLjATFy9x nAb/57/jZRsFi1l/bY=; b=bamk86Mp9aLLGISvJhdzuXT444FDak/NMVmbMIhsx 9SWZKPjXf8vCK4/VJwafe4+kJSLdvXm3Ko+utiH2WVeXepGIRxdqL2OTbeyoglOm XAhVx14RCKA84baW5YljSVSTobzDOoA5Rv0kmWCUMItnaJ60bio7MlHQ46bKbSbp 4yENKbM6V8xZHd8EW8qIM4EKB3t8Tslp84gM7e+zBi2mHZz5UB5yt2YrJ7wQ92y5 hPk24JBFVq9fpwEyMh7R1wV+GuOOUsy1EiIcJrDc1aFhS8Lm4AO8jueXblFxDr5V w+Q6CyBDZm+xQsF3c+W04mYK6qccHQYp2h18kw50nrohQ== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id f80f817e (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:26:01 +0000 (UTC) From: Julien Lepiller <julien@HIDDEN> Date: Mon, 13 Jul 2020 00:25:35 +0200 Message-Id: <20200712222538.18092-31-julien@HIDDEN> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200712222538.18092-1-julien@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * gnu/packages/php-xyz.scm (php-phpunit-php-timer): New variable. --- gnu/packages/php-xyz.scm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm index 2d186c5190..1b6669abcc 100644 --- a/gnu/packages/php-xyz.scm +++ b/gnu/packages/php-xyz.scm @@ -722,3 +722,26 @@ the types of the PHP type system.") processing, and rendering functionality for PHP code coverage information.") (home-page "https://github.com/sebastianbergmann/php-code-coverage") (license license:bsd-3))) + +(define-public php-phpunit-php-timer + (package + (name "php-phpunit-php-timer") + (version "5.0.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/sebastianbergmann/php-timer.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0hyy5c8b22zki6836a7fhzr3s6dpvga33r2rzfrsbv1arh19ay60")))) + (build-system composer-build-system) + (arguments + ;; We do not have phpunit yet + `(#:tests? #f)) + (synopsis "Utility class for timing") + (description "This package contains a stand-alone component originally part +of PHPUnit. It provides a utility class for timing.") + (home-page "https://github.com/sebastianbergmann/php-timer/") + (license license:bsd-3))) -- 2.27.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 33/34] gnu: Add php-sebastian-code-unit. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 12 Jul 2020 22:36:03 +0000 Resent-Message-ID: <handler.42338.B42338.159459335315260 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.159459335315260 (code B ref 42338); Sun, 12 Jul 2020 22:36:03 +0000 Received: (at 42338) by debbugs.gnu.org; 12 Jul 2020 22:35:53 +0000 Received: from localhost ([127.0.0.1]:47082 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jukZd-0003xy-Az for submit <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:35:53 -0400 Received: from lepiller.eu ([89.234.186.109]:42900) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1jukQ8-0003ad-UC for 42338 <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:26:05 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id bbcbc978 for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:26:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=L9xJ4HcR0J7jmXsft45Sp1C3W dAo28fxpc3Xcm7ckqQ=; b=JES/3q2nGBE2kO340L58eaJL1FGC0htX7B+F1ZZED m0VnEm3WIbiuq2WepwT4kDZd2/u5stp/GVikFYAt/4gV508zyEc4ckokdfbtdsGu rLqilFIIvUUWMjrpgGhtESYUsQWD+moTOA1f1gUZ/FlzdVRk9FX6oSQfJiC3i1jT N3QTvVDps682AxnjzxCYLnHBunC3vfe10AjyoR1zZnfS/uZ9/9GWslapQRorGIyN L7wQVULZfGRZlsp0zbwJFUUK58Og9Q9OlvmT2kr9Vhi4o9zT3azSRQgRwLQN2REB fTKJ3kU76D7SlaOUCS7BeE0SlA8pNnngtfzJMANTp6gHA== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 81d9ce70 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:26:02 +0000 (UTC) From: Julien Lepiller <julien@HIDDEN> Date: Mon, 13 Jul 2020 00:25:37 +0200 Message-Id: <20200712222538.18092-33-julien@HIDDEN> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200712222538.18092-1-julien@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * gnu/packages/php-xyz.scm (php-sebastian-code-unit): New variable. --- gnu/packages/php-xyz.scm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm index 484fb17790..0ae92c4600 100644 --- a/gnu/packages/php-xyz.scm +++ b/gnu/packages/php-xyz.scm @@ -768,3 +768,26 @@ of PHPUnit. It provides a utility class for timing.") timeout.") (home-page "https://github.com/sebastianbergmann/php-invoker/") (license license:bsd-3))) + +(define-public php-sebastian-code-unit + (package + (name "php-sebastian-code-unit") + (version "1.0.5") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/sebastianbergmann/code-unit.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "058ykqcmzm900c513j2qvi189bgn0scxsrhbrik5xycrr620krxc")))) + (build-system composer-build-system) + (arguments + ;; We do not have phpunit yet + `(#:tests? #f)) + (synopsis "PHP collection of value objects for code units") + (description "This package contains a collection of value objects that +represent the PHP code units.") + (home-page "https://github.com/sebastianbergmann/code-unit") + (license license:bsd-3))) -- 2.27.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 29/34] gnu: Add php-sebastian-type. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 12 Jul 2020 22:36:04 +0000 Resent-Message-ID: <handler.42338.B42338.159459335315267 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.159459335315267 (code B ref 42338); Sun, 12 Jul 2020 22:36:04 +0000 Received: (at 42338) by debbugs.gnu.org; 12 Jul 2020 22:35:53 +0000 Received: from localhost ([127.0.0.1]:47084 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jukZd-0003y5-HV for submit <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:35:53 -0400 Received: from lepiller.eu ([89.234.186.109]:42902) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1jukQ6-0003aw-2z for 42338 <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:26:02 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 610e85ee for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:26:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=eHL0kSmunxMjst4KfVmNZc71R toTR2VqQqzZ8m4PA1I=; b=Ix4dpOAaDv4tqa5m3vp1mMwFci5QuMiIifUz9XePG FBTr5+/ejKa3moPc9UzwI/G1q2LN3MgrpdI/e1kDysVgcAxMs+BGrWJJp7ZeIvqO G7Cm502Dlv0caThscLxsxVY9TmWw7ajsKrn6rcmqHUjBeFkEX8GOT639UFyqR4y4 0S6he/bXiZCeet79uGqT7090wYCC0dsGjX1OpB3KQ5uVedZofgIqqmFkgIw5cVVy Nddl3icc5lZ4fO4pF0zIwUJ8Zpyuu6E+DyFETW0H39JPXC4IhGhJiw/YGAmFaoiy 1dvdNJexXM/Nlz9bOUz2CYqfM9bFqaRTV0T2i119alVZw== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 0b09d2d7 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:26:00 +0000 (UTC) From: Julien Lepiller <julien@HIDDEN> Date: Mon, 13 Jul 2020 00:25:33 +0200 Message-Id: <20200712222538.18092-29-julien@HIDDEN> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200712222538.18092-1-julien@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * gnu/packages/php-xyz.scm (php-sebastian-type): New variable. --- gnu/packages/php-xyz.scm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm index aee08c0878..9a50c431b7 100644 --- a/gnu/packages/php-xyz.scm +++ b/gnu/packages/php-xyz.scm @@ -667,3 +667,26 @@ and object graphs to enumerate all referenced objects.") operate on resources.") (home-page "https://www.github.com/sebastianbergmann/resource-operations") (license license:bsd-3))) + +(define-public php-sebastian-type + (package + (name "php-sebastian-type") + (version "2.2.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/sebastianbergmann/type.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0gvdb9188a4903q0dnhhdcm9qd67is5pns8jbccxr7hxv8w7d7h3")))) + (build-system composer-build-system) + (arguments + ;; We do not have phpunit yet + `(#:tests? #f)) + (synopsis "PHP type system representation") + (description "This package is a collection of value objects that represent +the types of the PHP type system.") + (home-page "https://github.com/sebastianbergmann/type") + (license license:bsd-3))) -- 2.27.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 27/34] gnu: Add php-sebastian-object-enumerator. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 12 Jul 2020 22:36:04 +0000 Resent-Message-ID: <handler.42338.B42338.159459335415274 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.159459335415274 (code B ref 42338); Sun, 12 Jul 2020 22:36:04 +0000 Received: (at 42338) by debbugs.gnu.org; 12 Jul 2020 22:35:54 +0000 Received: from localhost ([127.0.0.1]:47086 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jukZd-0003yC-S7 for submit <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:35:54 -0400 Received: from lepiller.eu ([89.234.186.109]:42902) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1jukQ5-0003aw-2d for 42338 <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:26:01 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id ab54cefd for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:26:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=ClE/cqGnerN7eJUHMLdcf/FMV extlp4n9142NxUmods=; b=cC4a/85X9TOW+uhhnBAFgKlN8fuyS3ojVyobPDVUY EV2llM81WLw882wofZH2nF0U70mkKPPlj+PoLhaKwzTYmtt58S1ZGn3MHporkEii nIJ5b2F8Nt0ZhED/GdnIekWk4qUCzmGbPlpeVwvkHC385obnvfOBLTboGPUQcI9j vbQKKipEBTj/pO+zIuPwGeGHAYENXK6JLcJf97j4XnoXYe/9COpZAi4C5kBre4lR lm6tkJyXFtFt/I2vmCZXeBjqE6+dPbvNH0j91Gv4Mok5Ptj1lzHAGLWbgUEYpQ6U Fng9hm6+wocW9XTy6lK+6MVzyu3HvGty9yl7cVTEuG4UA== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 3a149bc4 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:25:59 +0000 (UTC) From: Julien Lepiller <julien@HIDDEN> Date: Mon, 13 Jul 2020 00:25:31 +0200 Message-Id: <20200712222538.18092-27-julien@HIDDEN> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200712222538.18092-1-julien@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * gnu/packages/php-xyz.scm (php-sebastian-object-enumerator): New variable. --- gnu/packages/php-xyz.scm | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm index 4872523b31..8cf5668030 100644 --- a/gnu/packages/php-xyz.scm +++ b/gnu/packages/php-xyz.scm @@ -618,3 +618,29 @@ of PHPUnit. It provides support for creating a snapshot of the global state of a PHP program.") (home-page "http://www.github.com/sebastianbergmann/global-state") (license license:bsd-3))) + +(define-public php-sebastian-object-enumerator + (package + (name "php-sebastian-object-enumerator") + (version "4.0.2") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/sebastianbergmann/object-enumerator.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1qx28r0ncbh0x9i0jplyg870paxxsy7g1ibgbdqq11176101aj6q")))) + (build-system composer-build-system) + (arguments + ;; We do not have phpunit yet + `(#:tests? #f)) + (inputs + `(("php-sebastian-recursion-context" ,php-sebastian-recursion-context) + ("php-sebastian-object-reflector" ,php-sebastian-object-reflector))) + (synopsis "Enumerate PHP objects") + (description "This package allows PHP programs to traverse array structures +and object graphs to enumerate all referenced objects.") + (home-page "https://github.com/sebastianbergmann/object-enumerator/") + (license license:bsd-3))) -- 2.27.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 34/34] gnu: Add phpunit. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 12 Jul 2020 22:36:04 +0000 Resent-Message-ID: <handler.42338.B42338.159459335415281 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.159459335415281 (code B ref 42338); Sun, 12 Jul 2020 22:36:04 +0000 Received: (at 42338) by debbugs.gnu.org; 12 Jul 2020 22:35:54 +0000 Received: from localhost ([127.0.0.1]:47088 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jukZe-0003yJ-2u for submit <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:35:54 -0400 Received: from lepiller.eu ([89.234.186.109]:42900) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1jukQ9-0003ad-ML for 42338 <at> debbugs.gnu.org; Sun, 12 Jul 2020 18:26:06 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 7f0639ec for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:26:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=s8ceYJ2fUGQUNnwEIyVAP3M5k cIbLCI4fmiN6V4oBkY=; b=DDuA4HTM8Ncr6MXCIvixesAm7OgRJwt6AUwclNwKE IO9UCFuIn4woQ7/HuPAo10ycCrn+shktc/WTnf/4fcETV/ae1vwZ5eOi0fGEZ6bJ oV8RKC/c0iPZrRaNfgiDQDF70JvjqmNf98JWN/yW0oDCZPXV/4yq/dRFR//iGI+h nsoWFZ7ycOkEyD6Z4ro35IeoAvWwFqFHfSaOWkxXrrb0mSaysBnpwu4nfGp+zypJ YFuAulYu7d4soWh/bRS3FAXJ6a8leREAT6+UIW8Wqz/dClCWE9hIUfkUqc2tYxFp Z8XNOG7tBWh+UNLpnylkXIbUzM64nKB5IJSlADnwUUNTw== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 4170c07a (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <42338 <at> debbugs.gnu.org>; Sun, 12 Jul 2020 22:26:03 +0000 (UTC) From: Julien Lepiller <julien@HIDDEN> Date: Mon, 13 Jul 2020 00:25:38 +0200 Message-Id: <20200712222538.18092-34-julien@HIDDEN> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200712222538.18092-1-julien@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * gnu/packages/php-xyz.scm (php-phpunit-phpunit): New variable. --- gnu/packages/php-xyz.scm | 45 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm index 0ae92c4600..eebf64c1a3 100644 --- a/gnu/packages/php-xyz.scm +++ b/gnu/packages/php-xyz.scm @@ -791,3 +791,48 @@ timeout.") represent the PHP code units.") (home-page "https://github.com/sebastianbergmann/code-unit") (license license:bsd-3))) + +(define-public php-phpunit-phpunit + (package + (name "phpunit") + (version "9.2.5") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/sebastianbergmann/phpunit.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1ck41faxkqr6painsqirklzsl08k8biadi2ksnpsmpjf3dp5p5gl")))) + (build-system composer-build-system) + (arguments + ;; Requires phpspec/prophecy-phpunit, which in turns requires phpunit. + `(#:tests? #f)) + (inputs + `(("php-sebastian-version" ,php-sebastian-version) + ("php-sebastian-type" ,php-sebastian-type) + ("php-sebastian-resource-operations" ,php-sebastian-resource-operations) + ("php-sebastian-object-enumerator" ,php-sebastian-object-enumerator) + ("php-sebastian-global-state" ,php-sebastian-global-state) + ("php-sebastian-exporter" ,php-sebastian-exporter) + ("php-sebastian-environment" ,php-sebastian-environment) + ("php-sebastian-diff" ,php-sebastian-diff) + ("php-sebastian-comparator" ,php-sebastian-comparator) + ("php-sebastian-code-unit" ,php-sebastian-code-unit) + ("php-phpunit-php-timer" ,php-phpunit-php-timer) + ("php-phpunit-php-text-template" ,php-phpunit-php-text-template) + ("php-phpunit-php-invoker" ,php-phpunit-php-invoker) + ("php-phpunit-php-file-iterator" ,php-phpunit-php-file-iterator) + ("php-phpunit-php-code-coverage" ,php-phpunit-php-code-coverage) + ("php-phpspec-prophecy" ,php-phpspec-prophecy) + ("php-phar-io-version" ,php-phar-io-version) + ("php-phar-io-manifest" ,php-phar-io-manifest) + ("php-myclabs-deep-copy" ,php-myclabs-deep-copy) + ("php-doctrine-instantiator" ,php-doctrine-instantiator))) + (properties `((upstream-name . "phpunit/phpunit"))) + (synopsis "PHP Unit Testing framework") + (description "PHPUnit is a testing framework for PHP. It is an instance of +the xUnit architecture for unit testing frameworks.") + (home-page "https://phpunit.de/") + (license license:bsd-3))) -- 2.27.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 01/34] guix: import: Add composer importer. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Mon, 07 Sep 2020 14:07:01 +0000 Resent-Message-ID: <handler.42338.B42338.15994875894946 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Julien Lepiller <julien@HIDDEN> Cc: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.15994875894946 (code B ref 42338); Mon, 07 Sep 2020 14:07:01 +0000 Received: (at 42338) by debbugs.gnu.org; 7 Sep 2020 14:06:29 +0000 Received: from localhost ([127.0.0.1]:50310 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1kFHmv-0001Hh-AF for submit <at> debbugs.gnu.org; Mon, 07 Sep 2020 10:06:29 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60810) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1kFHmt-0001HW-VZ for 42338 <at> debbugs.gnu.org; Mon, 07 Sep 2020 10:06:28 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:42538) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1kFHmn-0004Qc-IX; Mon, 07 Sep 2020 10:06:21 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=44452 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from <ludo@HIDDEN>) id 1kFHml-0001Cc-Ht; Mon, 07 Sep 2020 10:06:20 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> Date: Mon, 07 Sep 2020 16:06:13 +0200 In-Reply-To: <20200712222538.18092-1-julien@HIDDEN> (Julien Lepiller's message of "Mon, 13 Jul 2020 00:25:05 +0200") Message-ID: <87mu21heay.fsf@HIDDEN> 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 <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Hi Julien, There=E2=80=99s a lot of interesting work in here! I=E2=80=99m not familia= r with PHP; I=E2=80=99ll just make a bird=E2=80=99s eye review. Julien Lepiller <julien@HIDDEN> skribis: > * guix/import/composer.scm: New file. > * guix/scripts/import/composer.scm: New file. > * Makefile.am: Add them. > * guix/scripts/import.scm: Add composer importer. Please add tests and a mention in =E2=80=9CInvoking guix import=E2=80=9D in= the manual. For tests, a strategy that I think works well is that used in tests/cpan.scm, where we spawn an HTTP server to mock the real one. > +(define* (composer-fetch name #:optional version) > + "Return an alist representation of the Composer metadata for the packa= ge NAME, > +or #f on failure." > + (let ((package (json-fetch > + (string-append "https://repo.packagist.org/p/" name "= .json")))) > + (if package > + (let* ((packages (assoc-ref package "packages")) > + (package (assoc-ref packages name)) > + (versions (filter > + (lambda (version) > + (and (not (string-contains version "dev")) > + (not (string-contains version "beta"))= )) > + (map car package))) > + (versions (map > + (lambda (version) > + (cons (fix-version version) version)) > + versions)) > + (version (or (if (null? version) #f version) > + (latest-version (map car versions))))) > + (assoc-ref package (assoc-ref versions version))) > + #f))) I recommend using =E2=80=98define-json-mapping=E2=80=99 instead of browsing= alists: it=E2=80=99s less error-prone, hides the JSON details away, and leads to more readable code. The pypi, crates, cpan importers use it. Thanks! Ludo=E2=80=99.
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 03/34] guix: Add composer-build-system. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Mon, 07 Sep 2020 14:10:02 +0000 Resent-Message-ID: <handler.42338.B42338.15994877545183 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Julien Lepiller <julien@HIDDEN> Cc: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> 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 <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1kFHpZ-0001LX-QH for submit <at> 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 <ludo@HIDDEN>) id 1kFHpY-0001LM-Qf for 42338 <at> 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 <ludo@HIDDEN>) 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 <ludo@HIDDEN>) id 1kFHpS-0001LH-Dr; Mon, 07 Sep 2020 10:09:07 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> <20200712222538.18092-3-julien@HIDDEN> Date: Mon, 07 Sep 2020 16:09:01 +0200 In-Reply-To: <20200712222538.18092-3-julien@HIDDEN> (Julien Lepiller's message of "Mon, 13 Jul 2020 00:25:07 +0200") Message-ID: <87imcphe6a.fsf@HIDDEN> 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 <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Julien Lepiller <julien@HIDDEN> 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 @@ > +<?php > +/** > + * 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 "<?php~%") > + (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 "\ <?php // autoload.php =E2=80=A6") Ludo=E2=80=99.
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 01/34] guix: import: Add composer importer. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Thu, 17 Sep 2020 22:44:02 +0000 Resent-Message-ID: <handler.42338.B42338.160038263410832 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN> Cc: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.160038263410832 (code B ref 42338); Thu, 17 Sep 2020 22:44:02 +0000 Received: (at 42338) by debbugs.gnu.org; 17 Sep 2020 22:43:54 +0000 Received: from localhost ([127.0.0.1]:39972 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1kJ2d3-0002oa-6B for submit <at> debbugs.gnu.org; Thu, 17 Sep 2020 18:43:54 -0400 Received: from lepiller.eu ([89.234.186.109]:60156) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1kJ2d0-0002oQ-Sy for 42338 <at> debbugs.gnu.org; Thu, 17 Sep 2020 18:43:48 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 3fb8f51c; Thu, 17 Sep 2020 22:43:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type; s=dkim; bh=wNZQ0+XdWWGsaMA+RR2MlZ8/1Eyqs1IH5r7qqU g8Tjc=; b=ghNrXtkCyHBi+b7eAobLTKJtqOQ+VS7Ejz66Et+eg+P+G74HO/oVzV hGjbZhDtv29nwf6cPLiNv3J6RTCjC1bkJrcrgdho/xlp+dPzBdN+8ZagoXBm8Xx8 dxVMWbVAFDp6wInInmqtlQqtfD8Nwki1GcuXqzP9sBwE/mFppMkio56DCbwa5T2C wvk/k1DEY1occWDzqnvrGdrtyQEafTaemPc4uNIjswYmTN4MATypQaaJFRxJ+7Up /hCGmhnhZqjXVoBkcUsUHWbaxQkNqmkLKcuMwP+ulEBMUhgJLCDHwz1IGW//tbCj zJeTQULxwXotTj01CyPyGuuYR84WbdKQ== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 8e35d7f8 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Thu, 17 Sep 2020 22:43:44 +0000 (UTC) Date: Fri, 18 Sep 2020 00:43:33 +0200 From: Julien Lepiller <julien@HIDDEN> Message-ID: <20200918004333.127aa5da@HIDDEN> In-Reply-To: <87mu21heay.fsf@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> <87mu21heay.fsf@HIDDEN> X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/Nb0qTNLZeDOi6GOcim.fLs2" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) --MP_/Nb0qTNLZeDOi6GOcim.fLs2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Le Mon, 07 Sep 2020 16:06:13 +0200, Ludovic Court=C3=A8s <ludo@HIDDEN> a =C3=A9crit : > Hi Julien, >=20 > There=E2=80=99s a lot of interesting work in here! I=E2=80=99m not famil= iar with PHP; > I=E2=80=99ll just make a bird=E2=80=99s eye review. >=20 > Julien Lepiller <julien@HIDDEN> skribis: >=20 > > * guix/import/composer.scm: New file. > > * guix/scripts/import/composer.scm: New file. > > * Makefile.am: Add them. > > * guix/scripts/import.scm: Add composer importer. =20 >=20 > Please add tests and a mention in =E2=80=9CInvoking guix import=E2=80=9D = in the > manual. >=20 > For tests, a strategy that I think works well is that used in > tests/cpan.scm, where we spawn an HTTP server to mock the real one. >=20 > > +(define* (composer-fetch name #:optional version) > > + "Return an alist representation of the Composer metadata for the > > package NAME, +or #f on failure." > > + (let ((package (json-fetch > > + (string-append "https://repo.packagist.org/p/" > > name ".json")))) > > + (if package > > + (let* ((packages (assoc-ref package "packages")) > > + (package (assoc-ref packages name)) > > + (versions (filter > > + (lambda (version) > > + (and (not (string-contains version > > "dev")) > > + (not (string-contains version > > "beta")))) > > + (map car package))) > > + (versions (map > > + (lambda (version) > > + (cons (fix-version version) version)) > > + versions)) > > + (version (or (if (null? version) #f version) > > + (latest-version (map car versions))))) > > + (assoc-ref package (assoc-ref versions version))) > > + #f))) =20 >=20 > I recommend using =E2=80=98define-json-mapping=E2=80=99 instead of browsi= ng alists: > it=E2=80=99s less error-prone, hides the JSON details away, and leads to = more > readable code. The pypi, crates, cpan importers use it. >=20 > Thanks! >=20 > Ludo=E2=80=99. Thanks, here's a new version --MP_/Nb0qTNLZeDOi6GOcim.fLs2 Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0001-guix-import-Add-composer-importer.patch =46rom 6d521ca9f066f82488abefd5d3630e38305c0fd1 Mon Sep 17 00:00:00 2001 From: Julien Lepiller <julien@HIDDEN> Date: Tue, 29 Oct 2019 08:07:38 +0100 Subject: [PATCH 01/34] guix: import: Add composer importer. * guix/import/composer.scm: New file. * guix/scripts/import/composer.scm: New file. * guix/tests/composer.scm: New file. * Makefile.am: Add them. * guix/scripts/import.scm: Add composer importer. * doc/guix.texi (Invoking guix import): Mention it. --- Makefile.am | 3 + doc/guix.texi | 6 + guix/import/composer.scm | 257 +++++++++++++++++++++++++++++++ guix/scripts/import.scm | 2 +- guix/scripts/import/composer.scm | 107 +++++++++++++ tests/composer.scm | 92 +++++++++++ 6 files changed, 466 insertions(+), 1 deletion(-) create mode 100644 guix/import/composer.scm create mode 100644 guix/scripts/import/composer.scm create mode 100644 tests/composer.scm diff --git a/Makefile.am b/Makefile.am index 8e91e1e558..6ce1430ea6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -223,6 +223,7 @@ MODULES =3D \ guix/search-paths.scm \ guix/packages.scm \ guix/import/cabal.scm \ + guix/import/composer.scm \ guix/import/cpan.scm \ guix/import/cran.scm \ guix/import/crate.scm \ @@ -269,6 +270,7 @@ MODULES =3D \ guix/scripts/system/reconfigure.scm \ guix/scripts/lint.scm \ guix/scripts/challenge.scm \ + guix/scripts/import/composer.scm \ guix/scripts/import/crate.scm \ guix/scripts/import/cran.scm \ guix/scripts/import/elpa.scm \ @@ -402,6 +404,7 @@ SCM_TESTS =3D \ tests/challenge.scm \ tests/channels.scm \ tests/combinators.scm \ + tests/composer.scm \ tests/containers.scm \ tests/cpan.scm \ tests/cpio.scm \ diff --git a/doc/guix.texi b/doc/guix.texi index 88128a4b3a..ca4eb347c7 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -10164,6 +10164,12 @@ in Guix. @cindex OCaml Import metadata from the @uref{https://opam.ocaml.org/, OPAM} package repository used by the OCaml community. + +@item composer +@cindex COMPOSER +@cindex PHP +Import metadat from the @uref{https://getcomposer.org/, Composer} package +archive used by the PHP community. @end table =20 The structure of the @command{guix import} code is modular. It would be diff --git a/guix/import/composer.scm b/guix/import/composer.scm new file mode 100644 index 0000000000..db8075edb2 --- /dev/null +++ b/guix/import/composer.scm @@ -0,0 +1,257 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2019 Julien Lepiller <julien@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (guix import composer) + #:use-module (ice-9 match) + #:use-module (json) + #:use-module (gcrypt hash) + #:use-module (guix base32) + #:use-module (guix build git) + #:use-module (guix build utils) + #:use-module (guix build-system) + #:use-module (guix import json) + #:use-module (guix import utils) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (guix serialization) + #:use-module (guix upstream) + #:use-module (guix utils) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-11) + #:export (composer->guix-package + %composer-updater + composer-recursive-import + + %composer-base-url)) + +(define %composer-base-url + (make-parameter "https://repo.packagist.org")) + +;; XXX adapted from (guix scripts hash) +(define (file-hash file select? recursive?) + ;; Compute the hash of FILE. + (if recursive? + (let-values (((port get-hash) (open-sha256-port))) + (write-file file port #:select? select?) + (force-output port) + (get-hash)) + (call-with-input-file file port-sha256))) + +;; XXX taken from (guix scripts hash) +(define (vcs-file? file stat) + (case (stat:type stat) + ((directory) + (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) + ((regular) + ;; Git sub-modules have a '.git' file that is a regular text file. + (string=3D? (basename file) ".git")) + (else + #f))) + +(define (latest-version versions) + (fold (lambda (a b) (if (version>? a b) a b)) (car versions) versions)) + +(define (fix-version version) + "Return a fixed version from a version string. For instance, v10.1 -> 1= 0.1" + (cond + ((string-prefix? "version" version) + (if (char-set-contains? char-set:digit (string-ref version 7)) + (substring version 7) + (substring version 8))) + ((string-prefix? "v" version) + (substring version 1)) + (else version))) + +(define* (composer-fetch name #:optional version) + "Return an alist representation of the Composer metadata for the package= NAME, +or #f on failure." + (let ((package (json-fetch + (string-append (%composer-base-url) "/p/" name ".json")= ))) + (if package + (let* ((packages (assoc-ref package "packages")) + (package (assoc-ref packages name)) + (versions (filter + (lambda (version) + (and (not (string-contains version "dev")) + (not (string-contains version "beta")))) + (map car package))) + (versions (map + (lambda (version) + (cons (fix-version version) version)) + versions)) + (version (or (if (null? version) #f version) + (latest-version (map car versions))))) + (assoc-ref package (assoc-ref versions version))) + #f))) + +(define (php-package-name name) + "Given the NAME of a package on Packagist, return a Guix-compliant name = for +the package." + (let ((name (string-join (string-split name #\/) "-"))) + (if (string-prefix? "php-" name) + (snake-case name) + (string-append "php-" (snake-case name))))) + +(define (make-php-sexp name version home-page description dependencies + dev-dependencies licenses source) + "Return the `package' s-expression for a PHP package with the given NAME, +VERSION, HOME-PAGE, DESCRIPTION, DEPENDENCIES, LICENSES and SOURCE." + (let ((git? (equal? (assoc-ref source "type") "git"))) + ((if git? call-with-temporary-directory call-with-temporary-output-fil= e) + (lambda* (temp #:optional port) + (and (if git? + (begin + (mkdir-p temp) + (git-fetch (assoc-ref source "url") + (assoc-ref source "reference") + temp)) + (url-fetch (assoc-ref source "url") temp)) + `(package + (name ,(php-package-name name)) + (version ,version) + (source (origin + ,@(if git? + `((method git-fetch) + (uri (git-reference + (url ,(assoc-ref source "url")) + (commit ,(assoc-ref source "refere= nce")))) + (file-name (git-file-name name version)) + (sha256 + (base32 + ,(bytevector->nix-base32-string + (file-hash temp (negate vcs-file?) = #t))))) + `((method url-fetch) + (uri ,(assoc-ref source "url")) + (sha256 (base32 ,(guix-hash-url temp)))))= )) + (build-system composer-build-system) + ,@(if (null? dependencies) + '() + `((inputs + (,'quasiquote + ,(map (lambda (name) + `(,name + (,'unquote + ,(string->symbol name)))) + dependencies))))) + ,@(if (null? dev-dependencies) + '() + `((native-inputs + (,'quasiquote + ,(map (lambda (name) + `(,name + (,'unquote + ,(string->symbol name)))) + dev-dependencies))))) + (synopsis "") + (description ,description) + (home-page ,home-page) + (license ,(match licenses + (() #f) + ((license) (license->symbol license)) + (_ `(list ,@(map license->symbol licenses))))))= ))))) + +(define* (composer->guix-package package-name #:optional version) + "Fetch the metadata for PACKAGE-NAME from packagist.org, and return the +`package' s-expression corresponding to that package, or #f on failure." + (let ((package (composer-fetch package-name version))) + (and package + (let* ((name (assoc-ref package "name")) + (version (fix-version (assoc-ref package "version"))) + (description (beautify-description + (assoc-ref package "description"))) + (home-page (assoc-ref package "homepage")) + (dependencies-names (filter + (lambda (dep) + (string-contains dep "/")) + (map car (assoc-ref package "require= ")))) + (dependencies (map php-package-name dependencies-names)) + (require-dev (assoc-ref package "require-dev")) + (dev-dependencies-names + (if require-dev + (filter + (lambda (dep) + (string-contains dep "/")) + (map car require-dev)) + '())) + (dev-dependencies (map php-package-name dev-dependencies-n= ames)) + (licenses (map string->license + (vector->list + (assoc-ref package "license"))))) + (values (make-php-sexp name version home-page description depen= dencies + dev-dependencies licenses (assoc-ref pac= kage "source")) + (append dependencies-names dev-dependencies-names)))))) + +(define (guix-name->composer-name name) + "Given a guix package name, return the name of the package in Packagist." + (if (string-prefix? "php-" name) + (let ((components (string-split (substring name 4) #\-))) + (match components + ((namespace name ...) + (string-append namespace "/" (string-join name "-"))))) + name)) + +(define (guix-package->composer-name package) + "Given a Composer PACKAGE built from Packagist, return the name of the +package in Packagist." + (let ((upstream-name (assoc-ref + (package-properties package) + 'upstream-name)) + (name (package-name package))) + (if upstream-name + upstream-name + (guix-name->composer-name name)))) + +(define (string->license str) + "Convert the string STR into a license object." + (match str + ("GNU LGPL" license:lgpl2.0) + ("GPL" license:gpl3) + ((or "BSD" "BSD License" "BSD-3-Clause") license:bsd-3) + ((or "MIT" "MIT license" "Expat license") license:expat) + ("Public domain" license:public-domain) + ((or "Apache License, Version 2.0" "Apache 2.0") license:asl2.0) + (_ #f))) + +(define (php-package? package) + "Return true if PACKAGE is a PHP package from Packagist." + (and + (eq? (build-system-name (package-build-system package)) 'composer) + (string-prefix? "php-" (package-name package)))) + +(define (latest-release package) + "Return an <upstream-source> for the latest release of PACKAGE." + (let* ((php-name (guix-package->composer-name package)) + (metadata (composer-fetch php-name)) + (version (fix-version (assoc-ref metadata "version"))) + (url (assoc-ref (assoc-ref metadata "source") "url"))) + (upstream-source + (package (package-name package)) + (version version) + (urls (list url))))) + +(define %composer-updater + (upstream-updater + (name 'composer) + (description "Updater for Composer packages") + (pred php-package?) + (latest latest-release))) + +(define* (composer-recursive-import package-name #:optional version) + (recursive-import package-name '() + #:repo->guix-package composer->guix-package + #:guix-name php-package-name)) diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm index 0a3863f965..23da295e48 100644 --- a/guix/scripts/import.scm +++ b/guix/scripts/import.scm @@ -77,7 +77,7 @@ rather than \\n." ;;; =20 (define importers '("gnu" "nix" "pypi" "cpan" "hackage" "stackage" "elpa" = "gem" - "cran" "crate" "texlive" "json" "opam")) + "cran" "crate" "texlive" "json" "opam" "composer")) =20 (define (resolve-importer name) (let ((module (resolve-interface diff --git a/guix/scripts/import/composer.scm b/guix/scripts/import/compose= r.scm new file mode 100644 index 0000000000..412bae6318 --- /dev/null +++ b/guix/scripts/import/composer.scm @@ -0,0 +1,107 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2015 David Thompson <davet@HIDDEN> +;;; Copyright =C2=A9 2018 Oleg Pykhalov <go.wigust@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (guix scripts import composer) + #:use-module (guix ui) + #:use-module (guix utils) + #:use-module (guix scripts) + #:use-module (guix import composer) + #:use-module (guix scripts import) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-11) + #:use-module (srfi srfi-37) + #:use-module (srfi srfi-41) + #:use-module (ice-9 match) + #:use-module (ice-9 format) + #:export (guix-import-composer)) + +=0C +;;; +;;; Command-line options. +;;; + +(define %default-options + '()) + +(define (show-help) + (display (G_ "Usage: guix import composer PACKAGE-NAME +Import and convert the Composer package for PACKAGE-NAME.\n")) + (display (G_ " + -h, --help display this help and exit")) + (display (G_ " + -V, --version display version information and exit")) + (display (G_ " + -r, --recursive generate package expressions for all Composer pac= kages\ + that are not yet in Guix")) + (newline) + (show-bug-report-information)) + +(define %options + ;; Specification of the command-line options. + (cons* (option '(#\h "help") #f #f + (lambda args + (show-help) + (exit 0))) + (option '(#\V "version") #f #f + (lambda args + (show-version-and-exit "guix import composer"))) + (option '(#\r "recursive") #f #f + (lambda (opt name arg result) + (alist-cons 'recursive #t result))) + %standard-import-options)) + +=0C +;;; +;;; Entry point. +;;; + +(define (guix-import-composer . args) + (define (parse-options) + ;; Return the alist of option values. + (args-fold* args %options + (lambda (opt name arg result) + (leave (G_ "~A: unrecognized option~%") name)) + (lambda (arg result) + (alist-cons 'argument arg result)) + %default-options)) + + (let* ((opts (parse-options)) + (args (filter-map (match-lambda + (('argument . value) + value) + (_ #f)) + (reverse opts)))) + (match args + ((package-name) + (if (assoc-ref opts 'recursive) + (map (match-lambda + ((and ('package ('name name) . rest) pkg) + `(define-public ,(string->symbol name) + ,pkg)) + (_ #f)) + (composer-recursive-import package-name)) + (let ((sexp (composer->guix-package package-name))) + (unless sexp + (leave (G_ "failed to download meta-data for package '~a'~%= ") + package-name)) + sexp))) + (() + (leave (G_ "too few arguments~%"))) + ((many ...) + (leave (G_ "too many arguments~%")))))) diff --git a/tests/composer.scm b/tests/composer.scm new file mode 100644 index 0000000000..cefaf9f434 --- /dev/null +++ b/tests/composer.scm @@ -0,0 +1,92 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2020 Julien Lepiller <julien@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (test-composer) + #:use-module (guix import composer) + #:use-module (guix base32) + #:use-module (gcrypt hash) + #:use-module (guix tests http) + #:use-module (guix grafts) + #:use-module (srfi srfi-64) + #:use-module (web client) + #:use-module (ice-9 match)) + +;; Globally disable grafts because they can trigger early builds. +(%graft? #f) + +(define test-json + "{ + \"packages\": { + \"foo/bar\": { + \"0.1\": { + \"name\": \"foo/bar\", + \"description\": \"description\", + \"keywords\": [\"testing\"], + \"homepage\": \"http://example.com\", + \"version\": \"0.1\", + \"license\": [\"BSD-3-Clause\"], + \"source\": { + \"type\": \"url\", + \"url\": \"http://example.com/Bar-0.1.tar.gz\" + }, + \"require\": {}, + \"require-dev\": {\"phpunit/phpunit\": \"1.0.0\"} + } + } + } +}") + +(define test-source + "foobar") + +;; Avoid collisions with other tests. +(%http-server-port 10450) + +(test-begin "composer") + +(test-assert "composer->guix-package" + ;; Replace network resources with sample data. + (with-http-server `((200 ,test-json) + (200 ,test-source)) + (parameterize ((%composer-base-url (%local-url)) + (current-http-proxy (%local-url))) + (match (composer->guix-package "foo/bar") + (('package + ('name "php-foo-bar") + ('version "0.1") + ('source ('origin + ('method 'url-fetch) + ('uri "http://example.com/Bar-0.1.tar.gz") + ('sha256 + ('base32 + (? string? hash))))) + ('build-system 'composer-build-system) + ('native-inputs + ('quasiquote + (("php-phpunit-phpunit" ('unquote 'php-phpunit-phpunit))))) + ('synopsis "") + ('description "description") + ('home-page "http://example.com") + ('license 'license:bsd-3)) + (string=3D? (bytevector->nix-base32-string + (call-with-input-string test-source port-sha256)) + hash)) + (x + (pk 'fail x #f)))))) + +(test-end "composer") --=20 2.28.0 --MP_/Nb0qTNLZeDOi6GOcim.fLs2--
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 03/34] guix: Add composer-build-system. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Thu, 17 Sep 2020 22:45:01 +0000 Resent-Message-ID: <handler.42338.B42338.160038266410907 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN> Cc: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.160038266410907 (code B ref 42338); Thu, 17 Sep 2020 22:45:01 +0000 Received: (at 42338) by debbugs.gnu.org; 17 Sep 2020 22:44:24 +0000 Received: from localhost ([127.0.0.1]:39976 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1kJ2dV-0002pj-3Y for submit <at> debbugs.gnu.org; Thu, 17 Sep 2020 18:44:24 -0400 Received: from lepiller.eu ([89.234.186.109]:60166) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1kJ2dR-0002pZ-Lr for 42338 <at> debbugs.gnu.org; Thu, 17 Sep 2020 18:44:15 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 8e4696b9; Thu, 17 Sep 2020 22:44:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type; s=dkim; bh=WiTscoOT/QVLK9no5oR9UOTk4hAom/ba6v+351 hBkzc=; b=DoSWN4Y08gdy7jh7OvZ4prf1oISWCdxC/fWDCroDnD14bDsVDiLOJ/ yvHsUcS5F+RE5L73MuEowsht/uJmpAcXHmqhM4epOuShLt1r7pqNyKPYqpDWCl+I Uc1VlnUpILLf99SU2Qf3eQJ3VjBqY6LhUExJ5ov+FsYpKQPsBybY98OjSNasEYbE QNk0Zm+igRJQLXN+vPV10vELFHZwSiw6tgcnJMl7T7lRgGPFzPn+6wSsClO5usjQ Ie34577OIHfZEV1qEko5Y3dhVUdEqUP6pTSAZMVDOzJmOO6AZhDK9yqMId7RMyOy 46A9pH7QmbKCRwEUXBf0TitwLya+3Jag== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id e796f823 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Thu, 17 Sep 2020 22:44:12 +0000 (UTC) Date: Fri, 18 Sep 2020 00:44:03 +0200 From: Julien Lepiller <julien@HIDDEN> Message-ID: <20200918004403.0d755d60@HIDDEN> In-Reply-To: <87imcphe6a.fsf@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> <20200712222538.18092-3-julien@HIDDEN> <87imcphe6a.fsf@HIDDEN> X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/g/9OkOXYbSbP0ceAuztCluC" X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) --MP_/g/9OkOXYbSbP0ceAuztCluC Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Le Mon, 07 Sep 2020 16:09:01 +0200, Ludovic Court=C3=A8s <ludo@HIDDEN> a =C3=A9crit : > Julien Lepiller <julien@HIDDEN> skribis: >=20 > > * 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. =20 >=20 > [...] >=20 > > +++ b/guix/build-system/findclass.php > > @@ -0,0 +1,102 @@ > > +<?php > > +/** > > + * Extract the classes in the given file > > + * > > + * @param string $path The file to check > > + * @throws \RuntimeException > > + * @return array The found classes > > + */ =20 >=20 > 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? >=20 > > +(define* (create-autoload vendor composer-file inputs #:key > > dev-dependencies?) > > + (with-output-to-file (string-append vendor "/autoload.php") > > + (lambda _ > > + (format #t "<?php~%") > > + (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();~%"))) =20 >=20 > I think it=E2=80=99d be clearer as a single string: >=20 > (display "\ > <?php > // autoload.php =E2=80=A6") >=20 > Ludo=E2=80=99. Thanks, here's a new version --MP_/g/9OkOXYbSbP0ceAuztCluC Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0003-guix-Add-composer-build-system.patch =46rom bb5d102b6ea5e6b5c06bbf90a58927c6180e23bc Mon Sep 17 00:00:00 2001 From: Julien Lepiller <julien@HIDDEN> Date: Tue, 29 Oct 2019 20:58:51 +0100 Subject: [PATCH 03/34] guix: Add composer-build-system. * guix/build-system/composer.scm: New file. * guix/build/composer-build-system.scm: New file. * gnu/packages/aux-files/findclass.php: New file. * Makefile.am: Add them. * doc/guix.texi (Build Systems): Document it. --- Makefile.am | 5 +- doc/guix.texi | 14 ++ gnu/packages/aux-files/findclass.php | 125 +++++++++++++++ guix/build-system/composer.scm | 170 ++++++++++++++++++++ guix/build/composer-build-system.scm | 226 +++++++++++++++++++++++++++ 5 files changed, 539 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/aux-files/findclass.php create mode 100644 guix/build-system/composer.scm create mode 100644 guix/build/composer-build-system.scm diff --git a/Makefile.am b/Makefile.am index 6ce1430ea6..5af964b0e9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -115,6 +115,7 @@ MODULES =3D \ guix/build-system/cargo.scm \ guix/build-system/clojure.scm \ guix/build-system/cmake.scm \ + guix/build-system/composer.scm \ guix/build-system/dub.scm \ guix/build-system/dune.scm \ guix/build-system/emacs.scm \ @@ -163,6 +164,7 @@ MODULES =3D \ guix/build/cargo-build-system.scm \ guix/build/cargo-utils.scm \ guix/build/cmake-build-system.scm \ + guix/build/composer-build-system.scm \ guix/build/dub-build-system.scm \ guix/build/dune-build-system.scm \ guix/build/emacs-build-system.scm \ @@ -354,7 +356,8 @@ AUX_FILES =3D \ gnu/packages/aux-files/linux-libre/4.4-i686.conf \ gnu/packages/aux-files/linux-libre/4.4-x86_64.conf \ gnu/packages/aux-files/pack-audit.c \ - gnu/packages/aux-files/run-in-namespace.c + gnu/packages/aux-files/run-in-namespace.c \ + gnu/packages/aux-files/findclass.php =20 # Templates, examples. EXAMPLES =3D \ diff --git a/doc/guix.texi b/doc/guix.texi index ca4eb347c7..6ee4d7e5f0 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -6941,6 +6941,20 @@ debugging information''), which roughly means that c= ode is compiled with @code{-O2 -g}, as is the case for Autoconf-based packages by default. @end defvr =20 +@defvr {Scheme Variable} composer-build-system +This variable is exported by @code{(guix build-system composer)}. It +implements the build procedure for packages using +@url{https://getcomposer.org/, Composer}, the PHP package manager. + +It automatically adds the @code{php} package to the set of inputs. Which +package is used can be specified with the @code{#:php} parameter. + +The @code{#:test-target} parameter is used to control which script is run +for the tests. By default, the @code{test} script is run if it exists. If +the script does not exist, the build system will run @code{phpunit} from t= he +source directory, assuming there is a @file{phpunit.xml} file. +@end defvr + @defvr {Scheme Variable} dune-build-system This variable is exported by @code{(guix build-system dune)}. It supports builds of packages using @uref{https://dune.build/, Dune}, a build diff --git a/gnu/packages/aux-files/findclass.php b/gnu/packages/aux-files/= findclass.php new file mode 100644 index 0000000000..d0b250c8e1 --- /dev/null +++ b/gnu/packages/aux-files/findclass.php @@ -0,0 +1,125 @@ +<?php +/** + * The content of this file is copied from composer's src/Composer/Autoloa= d/ClassMapGenerator.php + * the findClasses method was extracted, to prevent using any dependency. + * + * Composer (and thus this file) is distributed under the expat license, a= nd + * ClassMapGenerator.php also contains this notice: + * + * This file is part of Composer. + * + * (c) Nils Adermann <naderman@HIDDEN> + * Jordi Boggiano <j.boggiano@HIDDEN> + * + * For the full copyright and license information, please view the LICEN= SE + * file that was distributed with this source code. + * + * This file is copied from the Symfony package. + * + * (c) Fabien Potencier <fabien@HIDDEN> + *=20 + * To the extent to wich it makes sense, as the author of the extract: + * Copyright =C2=A9 2020 Julien Lepiller <julien@HIDDEN> + */ + +/** + * Extract the classes in the given file + * + * @param string $path The file to check + * @throws \RuntimeException + * @return array The found classes + */ +function findClasses($path) +{ + $extraTypes =3D PHP_VERSION_ID < 50400 ? '' : '|trait'; + if (defined('HHVM_VERSION') && version_compare(HHVM_VERSION, '3.3', '>= =3D')) { + $extraTypes .=3D '|enum'; + } + // Use @ here instead of Silencer to actively suppress 'unhelpful' out= put + // @link https://github.com/composer/composer/pull/4886 + $contents =3D @php_strip_whitespace($path); + if (!$contents) { + if (!file_exists($path)) { + $message =3D 'File at "%s" does not exist, check your classmap= definitions'; + } elseif (!is_readable($path)) { + $message =3D 'File at "%s" is not readable, check its permissi= ons'; + } elseif ('' =3D=3D=3D trim(file_get_contents($path))) { + // The input file was really empty and thus contains no classes + return array(); + } else { + $message =3D 'File at "%s" could not be parsed as PHP, it may = be binary or corrupted'; + } + $error =3D error_get_last(); + if (isset($error['message'])) { + $message .=3D PHP_EOL . 'The following message may be helpful:= ' . PHP_EOL . $error['message']; + } + throw new \RuntimeException(sprintf($message, $path)); + } + // return early if there is no chance of matching anything in this file + if (!preg_match('{\b(?:class|interface'.$extraTypes.')\s}i', $contents= )) { + return array(); + } + // strip heredocs/nowdocs + $contents =3D preg_replace('{<<<[ \t]*([\'"]?)(\w+)\\1(?:\r\n|\n|\r)(?= :.*?)(?:\r\n|\n|\r)(?:\s*)\\2(?=3D\s+|[;,.)])}s', 'null', $contents); + // strip strings + $contents =3D preg_replace('{"[^"\\\\]*+(\\\\.[^"\\\\]*+)*+"|\'[^\'\\\= \]*+(\\\\.[^\'\\\\]*+)*+\'}s', 'null', $contents); + // strip leading non-php code if needed + if (substr($contents, 0, 2) !=3D=3D '<?') { + $contents =3D preg_replace('{^.+?<\?}s', '<?', $contents, 1, $repl= acements); + if ($replacements =3D=3D=3D 0) { + return array(); + } + } + // strip non-php blocks in the file + $contents =3D preg_replace('{\?>(?:[^<]++|<(?!\?))*+<\?}s', '?><?', $c= ontents); + // strip trailing non-php code if needed + $pos =3D strrpos($contents, '?>'); + if (false !=3D=3D $pos && false =3D=3D=3D strpos(substr($contents, $po= s), '<?')) { + $contents =3D substr($contents, 0, $pos); + } + // strip comments if short open tags are in the file + if (preg_match('{(<\?)(?!(php|hh))}i', $contents)) { + $contents =3D preg_replace('{//.* | /\*(?:[^*]++|\*(?!/))*\*/}x', = '', $contents); + } + preg_match_all('{ + (?: + \b(?<![\$:>])(?P<type>class|interface'.$extraTypes.') \s++ (?= P<name>[a-zA-Z_\x7f-\xff:][a-zA-Z0-9_\x7f-\xff:\-]*+) + | \b(?<![\$:>])(?P<ns>namespace) (?P<nsname>\s++[a-zA-Z_\x7f-\x= ff][a-zA-Z0-9_\x7f-\xff]*+(?:\s*+\\\\\s*+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-= \xff]*+)*+)? \s*+ [\{;] + ) + }ix', $contents, $matches); + $classes =3D array(); + $namespace =3D ''; + for ($i =3D 0, $len =3D count($matches['type']); $i < $len; $i++) { + if (!empty($matches['ns'][$i])) { + $namespace =3D str_replace(array(' ', "\t", "\r", "\n"), '', $= matches['nsname'][$i]) . '\\'; + } else { + $name =3D $matches['name'][$i]; + // skip anon classes extending/implementing + if ($name =3D=3D=3D 'extends' || $name =3D=3D=3D 'implements')= { + continue; + } + if ($name[0] =3D=3D=3D ':') { + // This is an XHP class, https://github.com/facebook/xhp + $name =3D 'xhp'.substr(str_replace(array('-', ':'), array(= '_', '__'), $name), 1); + } elseif ($matches['type'][$i] =3D=3D=3D 'enum') { + // In Hack, something like: + // enum Foo: int { HERP =3D '123'; } + // The regex above captures the colon, which isn't part of + // the class name. + $name =3D rtrim($name, ':'); + } + $classes[] =3D ltrim($namespace . $name, '\\'); + } + } + return $classes; +} + +$options =3D getopt('i:f:', []); +$file =3D $options["f"]; +$input =3D $options["i"]; + +$classes =3D findClasses($file); +foreach($classes as $class) { + echo '$classmap[\''.$class.'\'] =3D \''.$input.'/'.$file.'\';'; + echo "\n"; +} diff --git a/guix/build-system/composer.scm b/guix/build-system/composer.scm new file mode 100644 index 0000000000..ebc472c717 --- /dev/null +++ b/guix/build-system/composer.scm @@ -0,0 +1,170 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2019 Julien Lepiller <julien@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. +(define-module (guix build-system composer) + #:use-module (guix store) + #:use-module (guix utils) + #:use-module (guix derivations) + #:use-module (guix search-paths) + #:use-module (guix build-system) + #:use-module (guix build-system gnu) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (gnu packages) + #:use-module (ice-9 match) + #:use-module (srfi srfi-1) + #:export (%composer-build-system-modules + lower + composer-build + composer-build-system)) + +;; Commentary: +;; +;; Standard build procedure for PHP packages using Composer. This is imple= mented +;; as an extension of `gnu-build-system'. +;; +;; Code: + +(define (default-php) + "Return the default PHP package." + + ;; Do not use `@' to avoid introducing circular dependencies. + (let ((module (resolve-interface '(gnu packages php)))) + (module-ref module 'php))) + +(define (default-findclass) + "Return the default findclass script." + (search-auxiliary-file "findclass.php")) + +(define (default-composer-classloader) + "Return the default composer-classloader package." + + ;; Do not use `@' to avoid introducing circular dependencies. + (let ((module (resolve-interface '(gnu packages php-xyz)))) + (module-ref module 'composer-classloader))) + +(define %composer-build-system-modules + ;; Build-side modules imported by default. + `((guix build composer-build-system) + (guix build json) + (guix build union) + ,@%gnu-build-system-modules)) + +(define* (lower name + #:key source inputs native-inputs outputs system target + (php (default-php)) + (composer-classloader (default-composer-classloader)) + (findclass (default-findclass)) + #:allow-other-keys + #:rest arguments) + "Return a bag for NAME." + (define private-keywords + '(#:source #:target #:php #:composer-classloader #:findclass #:inputs = #:native-inputs)) + + (and (not target) ;XXX: no cross-compilati= on + (bag + (name name) + (system system) + (host-inputs `(,@(if source + `(("source" ,source)) + '()) + ,@inputs + + ;; Keep the standard inputs of 'gnu-build-system'. + ,@(standard-packages))) + (build-inputs `(("php" ,php) + ("findclass.php" ,findclass) + ("composer-classloader" ,composer-classloader) + ,@native-inputs)) + (outputs outputs) + (build composer-build) + (arguments (strip-keyword-arguments private-keywords arguments)))= )) + +(define* (composer-build store name inputs + #:key (guile #f) + (outputs '("out")) (configure-flags ''()) + (search-paths '()) + (out-of-source? #t) + (composer-file "composer.json") + (tests? #t) + (test-target "test") + (install-target "install") + (validate-runpath? #t) + (patch-shebangs? #t) + (strip-binaries? #t) + (strip-flags ''("--strip-debug")) + (strip-directories ''("lib" "lib64" "libexec" + "bin" "sbin")) + (phases '(@ (guix build composer-build-system) + %standard-phases)) + (system (%current-system)) + (imported-modules %composer-build-system-modules) + (modules '((guix build composer-build-system) + (guix build json) + (guix build utils)))) + "Build SOURCE using PHP, and with INPUTS. This assumes that SOURCE provi= des +a 'composer.json' file as its build system." + (define builder + `(begin + (use-modules ,@modules) + (composer-build #:source ,(match (assoc-ref inputs "source") + (((? derivation? source)) + (derivation->output-path source)) + ((source) + source) + (source + source)) + #:system ,system + #:outputs %outputs + #:inputs %build-inputs + #:search-paths ',(map search-path-specification->se= xp + search-paths) + #:phases ,phases + #:out-of-source? ,out-of-source? + #:composer-file ,composer-file + #:tests? ,tests? + #:test-target ,test-target + #:install-target ,install-target + #:validate-runpath? ,validate-runpath? + #:patch-shebangs? ,patch-shebangs? + #:strip-binaries? ,strip-binaries? + #:strip-flags ,strip-flags + #:strip-directories ,strip-directories))) + + (define guile-for-build + (match guile + ((? package?) + (package-derivation store guile system #:graft? #f)) + (#f ; the default + (let* ((distro (resolve-interface '(gnu packages commencement))) + (guile (module-ref distro 'guile-final))) + (package-derivation store guile system #:graft? #f))))) + + (build-expression->derivation store name builder + #:system system + #:inputs inputs + #:modules imported-modules + #:outputs outputs + #:guile-for-build guile-for-build)) + +(define composer-build-system + (build-system + (name 'composer) + (description "The standard Composer build system") + (lower lower))) + +;;; composer.scm ends here diff --git a/guix/build/composer-build-system.scm b/guix/build/composer-bui= ld-system.scm new file mode 100644 index 0000000000..f73684f8d5 --- /dev/null +++ b/guix/build/composer-build-system.scm @@ -0,0 +1,226 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2019 Julien Lepiller <julien@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (guix build composer-build-system) + #:use-module ((guix build gnu-build-system) #:prefix gnu:) + #:use-module (guix build json) + #:use-module (guix build utils) + #:use-module (ice-9 match) + #:export (%standard-phases + composer-build)) + +;; Commentary: +;; +;; Builder-side code of the standard composer build procedure. +;; +;; Code: + +(define* (read-package-data #:key (filename "composer.json")) + (call-with-input-file filename + (lambda (port) + (read-json port)))) + +(define* (check #:key composer-file inputs outputs tests? test-target #:al= low-other-keys) + "Install the given package." + (when tests? + (mkdir-p "vendor") + (create-autoload (string-append (getcwd) "/vendor") composer-file + (append inputs outputs) #:dev-dependencies? #t) + (let* ((package-data (read-package-data #:filename composer-file)) + (scripts (match (assoc-ref package-data "scripts") + (('@ script ...) script) + (#f '()))) + (test-script + (assoc-ref scripts test-target)) + (dependencies (filter (lambda (dep) (string-contains dep "/")) + (map car + (match (assoc-ref package-data "requ= ire") + (('@ dependency ...) dependency) + (#f '()))))) + (dependencies-dev + (filter (lambda (dep) (string-contains dep "/")) + (map car + (match (assoc-ref package-data "require-dev") + (('@ dependency ...) dependency) + (#f '()))))) + (name (assoc-ref package-data "name"))) + (for-each + (lambda (input) + (let ((bin (find-php-bin (cdr input)))) + (when bin + (copy-recursively bin "vendor/bin")))) + inputs) + (match test-script + ((? string? command) + (unless (equal? (system command) 0) + (throw 'failed-command command))) + (('@ (? string? command) ...) + (for-each + (lambda (c) + (unless (equal? (system c) 0) + (throw 'failed-command c))) + command)) + (#f (invoke "vendor/bin/phpunit"))))) + #t) + +(define (find-php-bin input) + (let* ((web-dir (string-append input "/share/web")) + (vendors (if (file-exists? web-dir) + (find-files web-dir "^vendor$" #:directories? #t) + #f))) + (match vendors + ((vendor) + (let ((bin (string-append vendor "/bin"))) + (and (file-exists? bin) bin))) + (_ #f)))) + +(define (find-php-dep inputs dependency) + (let loop ((inputs (map cdr inputs))) + (if (null? inputs) + (throw 'unsatisfied-dependency "Unsatisfied dependency: required "= dependency) + (let ((autoload (string-append (car inputs) "/share/web/" dependen= cy "/vendor/autoload_conf.php"))) + (if (file-exists? autoload) + autoload + (loop (cdr inputs))))))) + +(define* (create-autoload vendor composer-file inputs #:key dev-dependenci= es?) + (with-output-to-file (string-append vendor "/autoload.php") + (lambda _ + (display "<?php +// autoload.php @generated by Guix +$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")) + (display "$loader =3D new \\Composer\\Autoload\\ClassLoader(); +foreach ($map as $namespace =3D> $path) { + $loader->set($namespace, $path); +} +foreach ($psr4map as $namespace =3D> $path) { + $loader->setPsr4($namespace, $path); +} +$loader->addClassMap($classmap); +$loader->register(); +"))) + (let* ((package-data (read-package-data #:filename composer-file)) + (autoload + (match (assoc-ref package-data "autoload") + (('@ autoload ...) autoload) + (#f '()))) + (autoload-dev + (match (assoc-ref package-data "autoload-dev") + (('@ autoload-dev ...) autoload-dev) + (#f '()))) + (dependencies (filter (lambda (dep) (string-contains dep "/")) + (map car + (match (assoc-ref package-data "requir= e") + (('@ dependency ...) dependency) + (#f '()))))) + (dependencies-dev + (filter (lambda (dep) (string-contains dep "/")) + (map car + (match (assoc-ref package-data "require-dev") + (('@ dependency ...) dependency) + (#f '())))))) + (with-output-to-file (string-append vendor "/autoload_conf.php") + (lambda _ + (format #t "<?php~%") + (format #t "// autoload_conf.php @generated by Guix~%") + (force-output) + (for-each + (lambda (psr4) + (match psr4 + ((key . value) + (format #t "$psr4map['~a'] =3D '~a/../~a';~%" + (string-join (string-split key #\\) "\\\\") + vendor value)))) + (append + (match (assoc-ref autoload "psr-4") + (('@ psr4 ...) psr4) + (#f '())) + (if dev-dependencies? + (match (assoc-ref autoload-dev "psr-4") + (('@ psr4 ...) psr4) + (#f '())) + '()))) + (for-each + (lambda (classmap) + (for-each + (lambda (file) + (invoke "php" (assoc-ref inputs "findclass.php") + "-i" (string-append vendor "/..") "-f" file)) + (find-files classmap ".(php|hh|inc)$"))) + (append + (or (assoc-ref autoload "classmap") '()) + (if dev-dependencies? + (or (assoc-ref autoload-dev "classmap") '()) + '()))) + (for-each + (lambda (dep) + (format #t "require_once '~a';~%" (find-php-dep inputs dep))) + (append + dependencies + (if dev-dependencies? + dependencies-dev + '()))))))) + +(define* (install #:key inputs outputs composer-file #:allow-other-keys) + "Install the given package." + (let* ((out (assoc-ref outputs "out")) + (package-data (read-package-data #:filename composer-file)) + (name (assoc-ref package-data "name")) + (php-dir (string-append out "/share/web/" name)) + (bin-dir (string-append php-dir "/vendor/bin")) + (bin (string-append out "/bin")) + (binaries (assoc-ref package-data "bin"))) + (mkdir-p php-dir) + (copy-recursively "." php-dir) + (mkdir-p (string-append php-dir "/vendor")) + (when binaries + (mkdir-p bin-dir) + (mkdir-p bin) + (for-each + (lambda (file) + (let ((installed-file (string-append bin-dir "/" (basename fil= e))) + (bin-file (string-append bin "/" (basename file))) + (original-file (string-append php-dir "/" file))) + (symlink original-file installed-file) + (symlink original-file bin-file))) + binaries)) + (create-autoload (string-append php-dir "/vendor") + composer-file inputs)) + #t) + +(define %standard-phases + ;; Everything is as with the GNU Build System except for the `configure' + ;; , `build', `check' and `install' phases. + (modify-phases gnu:%standard-phases + (delete 'bootstrap) + (delete 'configure) + (delete 'build) + (delete 'check) + (replace 'install install) + (add-after 'install 'check check))) + +(define* (composer-build #:key inputs (phases %standard-phases) + #:allow-other-keys #:rest args) + "Build the given package, applying all of PHASES in order." + (apply gnu:gnu-build #:inputs inputs #:phases phases args)) + +;;; composer-build-system.scm ends here --=20 2.28.0 --MP_/g/9OkOXYbSbP0ceAuztCluC--
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 01/34] guix: import: Add composer importer. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Fri, 18 Sep 2020 08:32:02 +0000 Resent-Message-ID: <handler.42338.B42338.16004179102592 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Julien Lepiller <julien@HIDDEN> Cc: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.16004179102592 (code B ref 42338); Fri, 18 Sep 2020 08:32:02 +0000 Received: (at 42338) by debbugs.gnu.org; 18 Sep 2020 08:31:50 +0000 Received: from localhost ([127.0.0.1]:40775 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1kJBo6-0000fV-5d for submit <at> debbugs.gnu.org; Fri, 18 Sep 2020 04:31:50 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55328) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1kJBo3-0000Z2-Mh for 42338 <at> debbugs.gnu.org; Fri, 18 Sep 2020 04:31:48 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58699) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1kJBnx-0006Az-CC; Fri, 18 Sep 2020 04:31:41 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=41992 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from <ludo@HIDDEN>) id 1kJBnw-00060I-OT; Fri, 18 Sep 2020 04:31:41 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> <87mu21heay.fsf@HIDDEN> <20200918004333.127aa5da@HIDDEN> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Jour du Travail de =?UTF-8?Q?l'Ann=C3=A9e?= 228 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Fri, 18 Sep 2020 10:31:39 +0200 In-Reply-To: <20200918004333.127aa5da@HIDDEN> (Julien Lepiller's message of "Fri, 18 Sep 2020 00:43:33 +0200") Message-ID: <87sgbf1o5w.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (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 <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Hi! Julien Lepiller <julien@HIDDEN> skribis: > From 6d521ca9f066f82488abefd5d3630e38305c0fd1 Mon Sep 17 00:00:00 2001 > From: Julien Lepiller <julien@HIDDEN> > Date: Tue, 29 Oct 2019 08:07:38 +0100 > Subject: [PATCH 01/34] guix: import: Add composer importer. > > * guix/import/composer.scm: New file. > * guix/scripts/import/composer.scm: New file. > * guix/tests/composer.scm: New file. > * Makefile.am: Add them. > * guix/scripts/import.scm: Add composer importer. > * doc/guix.texi (Invoking guix import): Mention it. [...] > +@item composer > +@cindex COMPOSER s/COMPOSER/Composer/ ? > +Import metadat from the @uref{https://getcomposer.org/, Composer} package ^ metadata > +archive used by the PHP community. Could you add an example command line like we have for some of the other importers? (It=E2=80=99s also useful for us as a test against the actual s= ervers=E2=80=A6) > + (let ((package (json-fetch > + (string-append (%composer-base-url) "/p/" name ".json= ")))) > + (if package > + (let* ((packages (assoc-ref package "packages")) > + (package (assoc-ref packages name)) > + (versions (filter > + (lambda (version) > + (and (not (string-contains version "dev")) > + (not (string-contains version "beta"))= )) > + (map car package))) Like I wrote before, I recommend =E2=80=98define-json-mapping=E2=80=99. If= you prefer you can make that change later on once you=E2=80=99ve pushed this first ver= sion, but I really think it=E2=80=99ll help maintainability. This should also help avoid (map car =E2=80=A6), which is frowned upon in G= uix. :-) > + (versions (map > + (lambda (version) Rather indent as: (map (lambda (version) Otherwise LGTM!=20=20 Ludo=E2=80=99.
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 03/34] guix: Add composer-build-system. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Fri, 18 Sep 2020 08:47:01 +0000 Resent-Message-ID: <handler.42338.B42338.16004187756538 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Julien Lepiller <julien@HIDDEN> Cc: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.16004187756538 (code B ref 42338); Fri, 18 Sep 2020 08:47:01 +0000 Received: (at 42338) by debbugs.gnu.org; 18 Sep 2020 08:46:15 +0000 Received: from localhost ([127.0.0.1]:40833 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1kJC22-0001hN-PR for submit <at> debbugs.gnu.org; Fri, 18 Sep 2020 04:46:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59352) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1kJC20-0001hA-LP for 42338 <at> debbugs.gnu.org; Fri, 18 Sep 2020 04:46:12 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58880) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1kJC1o-0008RW-WE; Fri, 18 Sep 2020 04:46:01 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42002 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from <ludo@HIDDEN>) id 1kJC1e-0000ae-8W; Fri, 18 Sep 2020 04:45:51 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> <20200712222538.18092-3-julien@HIDDEN> <87imcphe6a.fsf@HIDDEN> <20200918004403.0d755d60@HIDDEN> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Jour du Travail de =?UTF-8?Q?l'Ann=C3=A9e?= 228 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Fri, 18 Sep 2020 10:45:48 +0200 In-Reply-To: <20200918004403.0d755d60@HIDDEN> (Julien Lepiller's message of "Fri, 18 Sep 2020 00:44:03 +0200") Message-ID: <87eemz1nib.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (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 <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Hi, Julien Lepiller <julien@HIDDEN> skribis: > From bb5d102b6ea5e6b5c06bbf90a58927c6180e23bc Mon Sep 17 00:00:00 2001 > From: Julien Lepiller <julien@HIDDEN> > Date: Tue, 29 Oct 2019 20:58:51 +0100 > Subject: [PATCH 03/34] guix: Add composer-build-system. > > * guix/build-system/composer.scm: New file. > * guix/build/composer-build-system.scm: New file. > * gnu/packages/aux-files/findclass.php: New file. > * Makefile.am: Add them. > * doc/guix.texi (Build Systems): Document it. [...] > --- /dev/null > +++ b/gnu/packages/aux-files/findclass.php I can=E2=80=99t believe we=E2=80=99ll have PHP in our code base. :-) > +;;; You should have received a copy of the GNU General Public License > +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. > +(define-module (guix build-system composer) Missing newline. > + (let* ((package-data (read-package-data #:filename composer-file)) > + (scripts (match (assoc-ref package-data "scripts") > + (('@ script ...) script) > + (#f '()))) > + (test-script > + (assoc-ref scripts test-target)) > + (dependencies (filter (lambda (dep) (string-contains dep "/")) > + (map car > + (match (assoc-ref package-data "re= quire") > + (('@ dependency ...) dependency) > + (#f '()))))) > + (dependencies-dev > + (filter (lambda (dep) (string-contains dep "/")) > + (map car > + (match (assoc-ref package-data "require-dev") > + (('@ dependency ...) dependency) > + (#f '()))))) > + (name (assoc-ref package-data "name"))) This is also a case for =E2=80=98define-json-mapping=E2=80=99. I suppose w= e could use Guile-JSON instead of (guix build json), no? I think this code and similar occurrences would be less intimidating if we used =E2=80=98define-json-mapping=E2=80=99; it would make the data struc= tures clearer, unlike here where one has to keep in mind what the list/tree looks like so they can map car/cdr around. > + (for-each > + (lambda (input) Like for =E2=80=98map=E2=80=99, please indent on the same line: (for-each (lambda (input) > + (match test-script > + ((? string? command) > + (unless (equal? (system command) 0) > + (throw 'failed-command command))) > + (('@ (? string? command) ...) > + (for-each > + (lambda (c) > + (unless (equal? (system c) 0) > + (throw 'failed-command c))) > + command)) Use (zero? x) instead of (equal? 0 x). Also, why not use =E2=80=98invoke=E2=80=99? I this because these commands = are really shell commands and expect things like glob patterns and tilde expansion? If these are not shell commands, I recommend =E2=80=98invoke=E2=80=99, whic= h will report failures more nicely. > +(define (find-php-dep inputs dependency) > + (let loop ((inputs (map cdr inputs))) > + (if (null? inputs) > + (throw 'unsatisfied-dependency "Unsatisfied dependency: required= " dependency) > + (let ((autoload (string-append (car inputs) "/share/web/" depend= ency "/vendor/autoload_conf.php"))) > + (if (file-exists? autoload) > + autoload > + (loop (cdr inputs))))))) Please use =E2=80=98match=E2=80=99 instead of car/cdr. > +(define* (create-autoload vendor composer-file inputs #:key dev-dependen= cies?) > + (with-output-to-file (string-append vendor "/autoload.php") > + (lambda _ > + (display "<?php > +// autoload.php @generated by Guix > +$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")) > + (display "$loader =3D new \\Composer\\Autoload\\ClassLoader(); > +foreach ($map as $namespace =3D> $path) { > + $loader->set($namespace, $path); > +} > +foreach ($psr4map as $namespace =3D> $path) { > + $loader->setPsr4($namespace, $path); > +} > +$loader->addClassMap($classmap); > +$loader->register(); > +"))) Please add a docstring explaining what=E2=80=99s happening here. Also, per= haps use =E2=80=98string-append=E2=80=99 instead of =E2=80=98format=E2=80=99 so = we don=E2=80=99t end up generating things like: require_once '#f/autoload_conf.php' :-) In short, I think we must pay attention to the style to facilitate maintainability. Could you send an updated patch? Thanks! Ludo=E2=80=99.
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 01/34] guix: import: Add composer importer. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Fri, 18 Sep 2020 23:22:01 +0000 Resent-Message-ID: <handler.42338.B42338.16004712767358 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN> Cc: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.16004712767358 (code B ref 42338); Fri, 18 Sep 2020 23:22:01 +0000 Received: (at 42338) by debbugs.gnu.org; 18 Sep 2020 23:21:16 +0000 Received: from localhost ([127.0.0.1]:45335 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1kJPgl-0001uY-FJ for submit <at> debbugs.gnu.org; Fri, 18 Sep 2020 19:21:16 -0400 Received: from lepiller.eu ([89.234.186.109]:45360) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1kJPgh-0001uM-LZ for 42338 <at> debbugs.gnu.org; Fri, 18 Sep 2020 19:21:10 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 1599ee07; Fri, 18 Sep 2020 23:21:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type; s=dkim; bh=d9OJKWHtNuimwvGYuacxUtDtYOKA0IAbcKDbJe a7BWg=; b=VFiFaxPagrAZ3xp6/X4Xkl4FnrW8G76tlBxoMqPQG9g+YTkxi99/eC g6p1+dJb6SH/8wWSv8dq/NgBu9ayGoMOj1V8OtNa9emt55CYu/rhLBbj2xFy2QAE wPmmCYCKHdSWU/iv/lJeezVdgjzoH+5d7Fth+/uDPLs9oPz+g0Afq0SGksjq5WrN qs/AUj0AGuy9fqJmZNvtbnm1x3ReSR0oXGpolrvTonV4cYd4pisR0+/JaXf33g51 eh6RmsTKyBRycPWtDgEziybyk5ZI1LxTkOrgHIaEQgQtPIO383DGZdpTB6MtTElE MlubApr1EaH/ssPN05hQeM5KjKjFATvw== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id ab9ff704 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Fri, 18 Sep 2020 23:21:04 +0000 (UTC) Date: Sat, 19 Sep 2020 01:20:55 +0200 From: Julien Lepiller <julien@HIDDEN> Message-ID: <20200919012055.1b2e686f@HIDDEN> In-Reply-To: <87sgbf1o5w.fsf@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> <87mu21heay.fsf@HIDDEN> <20200918004333.127aa5da@HIDDEN> <87sgbf1o5w.fsf@HIDDEN> X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/0LhbN0ey7AXzR3WziH.SLMv" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) --MP_/0LhbN0ey7AXzR3WziH.SLMv Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Le Fri, 18 Sep 2020 10:31:39 +0200, Ludovic Court=C3=A8s <ludo@HIDDEN> a =C3=A9crit : > Hi! >=20 > Julien Lepiller <julien@HIDDEN> skribis: >=20 > > From 6d521ca9f066f82488abefd5d3630e38305c0fd1 Mon Sep 17 00:00:00 > > 2001 From: Julien Lepiller <julien@HIDDEN> > > Date: Tue, 29 Oct 2019 08:07:38 +0100 > > Subject: [PATCH 01/34] guix: import: Add composer importer. > > > > * guix/import/composer.scm: New file. > > * guix/scripts/import/composer.scm: New file. > > * guix/tests/composer.scm: New file. > > * Makefile.am: Add them. > > * guix/scripts/import.scm: Add composer importer. > > * doc/guix.texi (Invoking guix import): Mention it. =20 >=20 > [...] >=20 > > +@item composer > > +@cindex COMPOSER =20 >=20 > s/COMPOSER/Composer/ ? >=20 > > +Import metadat from the @uref{https://getcomposer.org/, Composer} > > package =20 > ^ > metadata >=20 > > +archive used by the PHP community. =20 >=20 > Could you add an example command line like we have for some of the > other importers? (It=E2=80=99s also useful for us as a test against the > actual servers=E2=80=A6) >=20 > > + (let ((package (json-fetch > > + (string-append (%composer-base-url) "/p/" name > > ".json")))) > > + (if package > > + (let* ((packages (assoc-ref package "packages")) > > + (package (assoc-ref packages name)) > > + (versions (filter > > + (lambda (version) > > + (and (not (string-contains version > > "dev")) > > + (not (string-contains version > > "beta")))) > > + (map car package))) =20 >=20 > Like I wrote before, I recommend =E2=80=98define-json-mapping=E2=80=99. = If you prefer > you can make that change later on once you=E2=80=99ve pushed this first > version, but I really think it=E2=80=99ll help maintainability. >=20 > This should also help avoid (map car =E2=80=A6), which is frowned upon in > Guix. :-) >=20 > > + (versions (map > > + (lambda (version) =20 >=20 > Rather indent as: (map (lambda (version) >=20 > Otherwise LGTM! =20 >=20 > Ludo=E2=80=99. Thanks, here's a new version --MP_/0LhbN0ey7AXzR3WziH.SLMv Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0001-guix-import-Add-composer-importer.patch =46rom 70b9cb2bb389f3e5f9dcc75a44d7d60c28f997bc Mon Sep 17 00:00:00 2001 From: Julien Lepiller <julien@HIDDEN> Date: Tue, 29 Oct 2019 08:07:38 +0100 Subject: [PATCH 01/34] guix: import: Add composer importer. * guix/import/composer.scm: New file. * guix/scripts/import/composer.scm: New file. * guix/tests/composer.scm: New file. * Makefile.am: Add them. * guix/scripts/import.scm: Add composer importer. * doc/guix.texi (Invoking guix import): Mention it. --- Makefile.am | 3 + doc/guix.texi | 11 ++ guix/import/composer.scm | 270 +++++++++++++++++++++++++++++++ guix/scripts/import.scm | 2 +- guix/scripts/import/composer.scm | 107 ++++++++++++ tests/composer.scm | 92 +++++++++++ 6 files changed, 484 insertions(+), 1 deletion(-) create mode 100644 guix/import/composer.scm create mode 100644 guix/scripts/import/composer.scm create mode 100644 tests/composer.scm diff --git a/Makefile.am b/Makefile.am index 8e91e1e558..6ce1430ea6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -223,6 +223,7 @@ MODULES =3D \ guix/search-paths.scm \ guix/packages.scm \ guix/import/cabal.scm \ + guix/import/composer.scm \ guix/import/cpan.scm \ guix/import/cran.scm \ guix/import/crate.scm \ @@ -269,6 +270,7 @@ MODULES =3D \ guix/scripts/system/reconfigure.scm \ guix/scripts/lint.scm \ guix/scripts/challenge.scm \ + guix/scripts/import/composer.scm \ guix/scripts/import/crate.scm \ guix/scripts/import/cran.scm \ guix/scripts/import/elpa.scm \ @@ -402,6 +404,7 @@ SCM_TESTS =3D \ tests/challenge.scm \ tests/channels.scm \ tests/combinators.scm \ + tests/composer.scm \ tests/containers.scm \ tests/cpan.scm \ tests/cpio.scm \ diff --git a/doc/guix.texi b/doc/guix.texi index 88128a4b3a..5d29567153 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -10164,6 +10164,17 @@ in Guix. @cindex OCaml Import metadata from the @uref{https://opam.ocaml.org/, OPAM} package repository used by the OCaml community. + +@item composer +@cindex Composer +@cindex PHP +Import metadat from the @uref{https://getcomposer.org/, Composer} package +archive used by the PHP community, as in this example: + +@example +guix import composer phpunit/phpunit +@end example + @end table =20 The structure of the @command{guix import} code is modular. It would be diff --git a/guix/import/composer.scm b/guix/import/composer.scm new file mode 100644 index 0000000000..9b284d0dd2 --- /dev/null +++ b/guix/import/composer.scm @@ -0,0 +1,270 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2019 Julien Lepiller <julien@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (guix import composer) + #:use-module (ice-9 match) + #:use-module (json) + #:use-module (gcrypt hash) + #:use-module (guix base32) + #:use-module (guix build git) + #:use-module (guix build utils) + #:use-module (guix build-system) + #:use-module (guix import json) + #:use-module (guix import utils) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (guix serialization) + #:use-module (guix upstream) + #:use-module (guix utils) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-11) + #:use-module (srfi srfi-26) + #:export (composer->guix-package + %composer-updater + composer-recursive-import + + %composer-base-url)) + +(define %composer-base-url + (make-parameter "https://repo.packagist.org")) + +;; XXX adapted from (guix scripts hash) +(define (file-hash file select? recursive?) + ;; Compute the hash of FILE. + (if recursive? + (let-values (((port get-hash) (open-sha256-port))) + (write-file file port #:select? select?) + (force-output port) + (get-hash)) + (call-with-input-file file port-sha256))) + +;; XXX taken from (guix scripts hash) +(define (vcs-file? file stat) + (case (stat:type stat) + ((directory) + (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) + ((regular) + ;; Git sub-modules have a '.git' file that is a regular text file. + (string=3D? (basename file) ".git")) + (else + #f))) + +(define (fix-version version) + "Return a fixed version from a version string. For instance, v10.1 -> 1= 0.1" + (cond + ((string-prefix? "version" version) + (if (char-set-contains? char-set:digit (string-ref version 7)) + (substring version 7) + (substring version 8))) + ((string-prefix? "v" version) + (substring version 1)) + (else version))) + +(define (latest-version versions) + (fold (lambda (a b) (if (version>? (fix-version a) (fix-version b)) a b)) + (car versions) versions)) + +(define (json->require dict) + (if dict + (let loop ((result '()) (require dict)) + (match require + (() result) + ((((? (cut string-contains <> "/") name) . _) + require ...) + (loop (cons name result) require)) + ((_ require ...) (loop result require)))) + '())) + +(define-json-mapping <composer-source> make-composer-source composer-sourc= e? + json->composer-source + (type composer-source-type) + (url composer-source-url) + (reference composer-source-reference)) + +(define-json-mapping <composer-package> make-composer-package composer-pac= kage? + json->composer-package + (description composer-package-description) + (homepage composer-package-homepage) + (source composer-package-source "source" json->composer-source) + (name composer-package-name "name" php-package-name) + (version composer-package-version "version" fix-version) + (require composer-package-require "require" json->require) + (dev-require composer-package-dev-require "require-dev" json->require) + (license composer-package-license "license" + (lambda (vector) + (map string->license (vector->list vector))))) + +(define* (composer-fetch name #:optional version) + "Return an alist representation of the Composer metadata for the package= NAME, +or #f on failure." + (let ((package (json-fetch + (string-append (%composer-base-url) "/p/" name ".json")= ))) + (if package + (let* ((packages (assoc-ref package "packages")) + (package (or (assoc-ref packages name) package)) + (versions (filter + (lambda (version) + (and (not (string-contains version "dev")) + (not (string-contains version "beta")))) + (map car package))) + (version (or (if (null? version) #f version) + (latest-version versions)))) + (assoc-ref package version)) + #f))) + +(define (php-package-name name) + "Given the NAME of a package on Packagist, return a Guix-compliant name = for +the package." + (let ((name (string-join (string-split name #\/) "-"))) + (if (string-prefix? "php-" name) + (snake-case name) + (string-append "php-" (snake-case name))))) + +(define (make-php-sexp composer-package) + "Return the `package' s-expression for a PHP package for the given +COMPOSER-PACKAGE." + (let* ((source (composer-package-source composer-package)) + (dependencies (map php-package-name + (composer-package-require composer-package))) + (dev-dependencies (map php-package-name + (composer-package-dev-require composer-pac= kage))) + (git? (equal? (composer-source-type source) "git"))) + ((if git? call-with-temporary-directory call-with-temporary-output-fil= e) + (lambda* (temp #:optional port) + (and (if git? + (begin + (mkdir-p temp) + (git-fetch (composer-source-url source) + (composer-source-reference source) + temp)) + (url-fetch (composer-source-url source) temp)) + `(package + (name ,(composer-package-name composer-package)) + (version ,(composer-package-version composer-package)) + (source (origin + ,@(if git? + `((method git-fetch) + (uri (git-reference + (url ,(composer-source-url source)) + (commit ,(composer-source-referenc= e source)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + ,(bytevector->nix-base32-string + (file-hash temp (negate vcs-file?) = #t))))) + `((method url-fetch) + (uri ,(composer-source-url source)) + (sha256 (base32 ,(guix-hash-url temp)))))= )) + (build-system composer-build-system) + ,@(if (null? dependencies) + '() + `((inputs + (,'quasiquote + ,(map (lambda (name) + `(,name + (,'unquote + ,(string->symbol name)))) + dependencies))))) + ,@(if (null? dev-dependencies) + '() + `((native-inputs + (,'quasiquote + ,(map (lambda (name) + `(,name + (,'unquote + ,(string->symbol name)))) + dev-dependencies))))) + (synopsis "") + (description ,(composer-package-description composer-packag= e)) + (home-page ,(composer-package-homepage composer-package)) + (license ,(match (composer-package-license composer-package) + (() #f) + ((license) license) + (_ license))))))))) + +(define* (composer->guix-package package-name #:optional version) + "Fetch the metadata for PACKAGE-NAME from packagist.org, and return the +`package' s-expression corresponding to that package, or #f on failure." + (let ((package (composer-fetch package-name version))) + (and package + (let* ((package (json->composer-package package)) + (dependencies-names (composer-package-require package)) + (dev-dependencies-names (composer-package-dev-require pack= age))) + (values (make-php-sexp package) + (append dependencies-names dev-dependencies-names)))))) + +(define (guix-name->composer-name name) + "Given a guix package name, return the name of the package in Packagist." + (if (string-prefix? "php-" name) + (let ((components (string-split (substring name 4) #\-))) + (match components + ((namespace name ...) + (string-append namespace "/" (string-join name "-"))))) + name)) + +(define (guix-package->composer-name package) + "Given a Composer PACKAGE built from Packagist, return the name of the +package in Packagist." + (let ((upstream-name (assoc-ref + (package-properties package) + 'upstream-name)) + (name (package-name package))) + (if upstream-name + upstream-name + (guix-name->composer-name name)))) + +(define (string->license str) + "Convert the string STR into a license object." + (match str + ("GNU LGPL" 'license:lgpl2.0) + ("GPL" 'license:gpl3) + ((or "BSD" "BSD License" "BSD-3-Clause") 'license:bsd-3) + ((or "MIT" "MIT license" "Expat license") 'license:expat) + ("Public domain" 'license:public-domain) + ((or "Apache License, Version 2.0" "Apache 2.0") 'license:asl2.0) + (_ #f))) + +(define (php-package? package) + "Return true if PACKAGE is a PHP package from Packagist." + (and + (eq? (build-system-name (package-build-system package)) 'composer) + (string-prefix? "php-" (package-name package)))) + +(define (latest-release package) + "Return an <upstream-source> for the latest release of PACKAGE." + (let* ((php-name (guix-package->composer-name package)) + (metadata (composer-fetch php-name)) + (package (json->composer-package metadata)) + (version (composer-package-version package)) + (url (composer-source-url (composer-package-source package)))) + (upstream-source + (package (package-name package)) + (version version) + (urls (list url))))) + +(define %composer-updater + (upstream-updater + (name 'composer) + (description "Updater for Composer packages") + (pred php-package?) + (latest latest-release))) + +(define* (composer-recursive-import package-name #:optional version) + (recursive-import package-name '() + #:repo->guix-package composer->guix-package + #:guix-name php-package-name)) diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm index 0a3863f965..23da295e48 100644 --- a/guix/scripts/import.scm +++ b/guix/scripts/import.scm @@ -77,7 +77,7 @@ rather than \\n." ;;; =20 (define importers '("gnu" "nix" "pypi" "cpan" "hackage" "stackage" "elpa" = "gem" - "cran" "crate" "texlive" "json" "opam")) + "cran" "crate" "texlive" "json" "opam" "composer")) =20 (define (resolve-importer name) (let ((module (resolve-interface diff --git a/guix/scripts/import/composer.scm b/guix/scripts/import/compose= r.scm new file mode 100644 index 0000000000..412bae6318 --- /dev/null +++ b/guix/scripts/import/composer.scm @@ -0,0 +1,107 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2015 David Thompson <davet@HIDDEN> +;;; Copyright =C2=A9 2018 Oleg Pykhalov <go.wigust@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (guix scripts import composer) + #:use-module (guix ui) + #:use-module (guix utils) + #:use-module (guix scripts) + #:use-module (guix import composer) + #:use-module (guix scripts import) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-11) + #:use-module (srfi srfi-37) + #:use-module (srfi srfi-41) + #:use-module (ice-9 match) + #:use-module (ice-9 format) + #:export (guix-import-composer)) + +=0C +;;; +;;; Command-line options. +;;; + +(define %default-options + '()) + +(define (show-help) + (display (G_ "Usage: guix import composer PACKAGE-NAME +Import and convert the Composer package for PACKAGE-NAME.\n")) + (display (G_ " + -h, --help display this help and exit")) + (display (G_ " + -V, --version display version information and exit")) + (display (G_ " + -r, --recursive generate package expressions for all Composer pac= kages\ + that are not yet in Guix")) + (newline) + (show-bug-report-information)) + +(define %options + ;; Specification of the command-line options. + (cons* (option '(#\h "help") #f #f + (lambda args + (show-help) + (exit 0))) + (option '(#\V "version") #f #f + (lambda args + (show-version-and-exit "guix import composer"))) + (option '(#\r "recursive") #f #f + (lambda (opt name arg result) + (alist-cons 'recursive #t result))) + %standard-import-options)) + +=0C +;;; +;;; Entry point. +;;; + +(define (guix-import-composer . args) + (define (parse-options) + ;; Return the alist of option values. + (args-fold* args %options + (lambda (opt name arg result) + (leave (G_ "~A: unrecognized option~%") name)) + (lambda (arg result) + (alist-cons 'argument arg result)) + %default-options)) + + (let* ((opts (parse-options)) + (args (filter-map (match-lambda + (('argument . value) + value) + (_ #f)) + (reverse opts)))) + (match args + ((package-name) + (if (assoc-ref opts 'recursive) + (map (match-lambda + ((and ('package ('name name) . rest) pkg) + `(define-public ,(string->symbol name) + ,pkg)) + (_ #f)) + (composer-recursive-import package-name)) + (let ((sexp (composer->guix-package package-name))) + (unless sexp + (leave (G_ "failed to download meta-data for package '~a'~%= ") + package-name)) + sexp))) + (() + (leave (G_ "too few arguments~%"))) + ((many ...) + (leave (G_ "too many arguments~%")))))) diff --git a/tests/composer.scm b/tests/composer.scm new file mode 100644 index 0000000000..cefaf9f434 --- /dev/null +++ b/tests/composer.scm @@ -0,0 +1,92 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2020 Julien Lepiller <julien@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (test-composer) + #:use-module (guix import composer) + #:use-module (guix base32) + #:use-module (gcrypt hash) + #:use-module (guix tests http) + #:use-module (guix grafts) + #:use-module (srfi srfi-64) + #:use-module (web client) + #:use-module (ice-9 match)) + +;; Globally disable grafts because they can trigger early builds. +(%graft? #f) + +(define test-json + "{ + \"packages\": { + \"foo/bar\": { + \"0.1\": { + \"name\": \"foo/bar\", + \"description\": \"description\", + \"keywords\": [\"testing\"], + \"homepage\": \"http://example.com\", + \"version\": \"0.1\", + \"license\": [\"BSD-3-Clause\"], + \"source\": { + \"type\": \"url\", + \"url\": \"http://example.com/Bar-0.1.tar.gz\" + }, + \"require\": {}, + \"require-dev\": {\"phpunit/phpunit\": \"1.0.0\"} + } + } + } +}") + +(define test-source + "foobar") + +;; Avoid collisions with other tests. +(%http-server-port 10450) + +(test-begin "composer") + +(test-assert "composer->guix-package" + ;; Replace network resources with sample data. + (with-http-server `((200 ,test-json) + (200 ,test-source)) + (parameterize ((%composer-base-url (%local-url)) + (current-http-proxy (%local-url))) + (match (composer->guix-package "foo/bar") + (('package + ('name "php-foo-bar") + ('version "0.1") + ('source ('origin + ('method 'url-fetch) + ('uri "http://example.com/Bar-0.1.tar.gz") + ('sha256 + ('base32 + (? string? hash))))) + ('build-system 'composer-build-system) + ('native-inputs + ('quasiquote + (("php-phpunit-phpunit" ('unquote 'php-phpunit-phpunit))))) + ('synopsis "") + ('description "description") + ('home-page "http://example.com") + ('license 'license:bsd-3)) + (string=3D? (bytevector->nix-base32-string + (call-with-input-string test-source port-sha256)) + hash)) + (x + (pk 'fail x #f)))))) + +(test-end "composer") --=20 2.28.0 --MP_/0LhbN0ey7AXzR3WziH.SLMv--
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 03/34] guix: Add composer-build-system. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Fri, 18 Sep 2020 23:25:02 +0000 Resent-Message-ID: <handler.42338.B42338.16004714737671 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN> Cc: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.16004714737671 (code B ref 42338); Fri, 18 Sep 2020 23:25:02 +0000 Received: (at 42338) by debbugs.gnu.org; 18 Sep 2020 23:24:33 +0000 Received: from localhost ([127.0.0.1]:45343 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1kJPk0-0001zf-VJ for submit <at> debbugs.gnu.org; Fri, 18 Sep 2020 19:24:33 -0400 Received: from lepiller.eu ([89.234.186.109]:45370) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1kJPjz-0001zX-9b for 42338 <at> debbugs.gnu.org; Fri, 18 Sep 2020 19:24:31 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 3ca00baf; Fri, 18 Sep 2020 23:24:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=dkim; bh=2vm6zjelqGCW EGpKnTmnH/4eFtLtrchGKJuLJZAxaqA=; b=ZHtswwonl9gcevuPz3TzA/8iHeVo bkjLiJUXjpIaTohjGVNL0+V8VGzvI+NWQzIwLir15lIxBOszFoXUSW74CwfkzVUA FeuB5aFaljEotlyEPinvRa8xtl1ht522xh4RtV/Otvqxb9k7ksSJsyqx9F2ogVo5 mBvxEjAg+3vpRuJaMJ7F+wcWMx8lY0jqijpQHYHBwH5WVzBQjRzw2/NIm13hK90/ tAt/RLJCF1C00IT/ckWDehxWihl5tP1Qnoxj9DciSfV8OggHVhUZWBQgsGhVFzn7 bRC4AOuyAYiqZVgrBC+LsnnYXLnKWhTrxBWlD3VwySJbA/OnVTuayYuCIw== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id cd75d289 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Fri, 18 Sep 2020 23:24:29 +0000 (UTC) Date: Sat, 19 Sep 2020 01:24:20 +0200 From: Julien Lepiller <julien@HIDDEN> Message-ID: <20200919012420.301201e8@HIDDEN> In-Reply-To: <87eemz1nib.fsf@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> <20200712222538.18092-3-julien@HIDDEN> <87imcphe6a.fsf@HIDDEN> <20200918004403.0d755d60@HIDDEN> <87eemz1nib.fsf@HIDDEN> X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Le Fri, 18 Sep 2020 10:45:48 +0200, Ludovic Court=C3=A8s <ludo@HIDDEN> a =C3=A9crit : > Hi, >=20 > Julien Lepiller <julien@HIDDEN> skribis: >=20 > > + (let* ((package-data (read-package-data #:filename > > composer-file)) > > + (scripts (match (assoc-ref package-data "scripts") > > + (('@ script ...) script) > > + (#f '()))) > > + (test-script > > + (assoc-ref scripts test-target)) > > + (dependencies (filter (lambda (dep) (string-contains > > dep "/")) > > + (map car > > + (match (assoc-ref > > package-data "require") > > + (('@ dependency ...) > > dependency) > > + (#f '()))))) > > + (dependencies-dev > > + (filter (lambda (dep) (string-contains dep "/")) > > + (map car > > + (match (assoc-ref package-data > > "require-dev") > > + (('@ dependency ...) dependency) > > + (#f '()))))) > > + (name (assoc-ref package-data "name"))) =20 >=20 > This is also a case for =E2=80=98define-json-mapping=E2=80=99. I suppose= we could use > Guile-JSON instead of (guix build json), no? >=20 > I think this code and similar occurrences would be less intimidating > if we used =E2=80=98define-json-mapping=E2=80=99; it would make the data = structures > clearer, unlike here where one has to keep in mind what the list/tree > looks like so they can map car/cdr around. I think we already tried that with the node build system, but we had to revert, because we were importing guile-json from the host side. I don't remember the details though, so if you think it's OK now, I'll gladly make the code look nicer :) >=20 > > + (for-each > > + (lambda (input) =20 >=20 > Like for =E2=80=98map=E2=80=99, please indent on the same line: >=20 > (for-each (lambda (input) >=20 > > + (match test-script > > + ((? string? command) > > + (unless (equal? (system command) 0) > > + (throw 'failed-command command))) > > + (('@ (? string? command) ...) > > + (for-each > > + (lambda (c) > > + (unless (equal? (system c) 0) > > + (throw 'failed-command c))) > > + command)) =20 >=20 > Use (zero? x) instead of (equal? 0 x). >=20 > Also, why not use =E2=80=98invoke=E2=80=99? I this because these command= s are really > shell commands and expect things like glob patterns and tilde > expansion? If these are not shell commands, I recommend =E2=80=98invoke= =E2=80=99, > which will report failures more nicely. Here I have a single string that contains shell commands, so I don't think I can use invoke.
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 01/34] guix: import: Add composer importer. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Fri, 25 Sep 2020 10:28:02 +0000 Resent-Message-ID: <handler.42338.B42338.160102963615944 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Julien Lepiller <julien@HIDDEN> Cc: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.160102963615944 (code B ref 42338); Fri, 25 Sep 2020 10:28:02 +0000 Received: (at 42338) by debbugs.gnu.org; 25 Sep 2020 10:27:16 +0000 Received: from localhost ([127.0.0.1]:42776 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1kLkwe-000495-0s for submit <at> debbugs.gnu.org; Fri, 25 Sep 2020 06:27:16 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38218) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1kLkwd-00048u-0t for 42338 <at> debbugs.gnu.org; Fri, 25 Sep 2020 06:27:15 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55944) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1kLkwW-0000HE-KO; Fri, 25 Sep 2020 06:27:08 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=60850 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from <ludo@HIDDEN>) id 1kLkwR-0007bR-4B; Fri, 25 Sep 2020 06:27:05 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> <87mu21heay.fsf@HIDDEN> <20200918004333.127aa5da@HIDDEN> <87sgbf1o5w.fsf@HIDDEN> <20200919012055.1b2e686f@HIDDEN> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 4 =?UTF-8?Q?Vend=C3=A9miaire?= an 229 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Fri, 25 Sep 2020 12:27:01 +0200 In-Reply-To: <20200919012055.1b2e686f@HIDDEN> (Julien Lepiller's message of "Sat, 19 Sep 2020 01:20:55 +0200") Message-ID: <87lfgy179m.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (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 <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Hi Julien, Julien Lepiller <julien@HIDDEN> skribis: > From 70b9cb2bb389f3e5f9dcc75a44d7d60c28f997bc Mon Sep 17 00:00:00 2001 > From: Julien Lepiller <julien@HIDDEN> > Date: Tue, 29 Oct 2019 08:07:38 +0100 > Subject: [PATCH 01/34] guix: import: Add composer importer. > > * guix/import/composer.scm: New file. > * guix/scripts/import/composer.scm: New file. > * guix/tests/composer.scm: New file. > * Makefile.am: Add them. > * guix/scripts/import.scm: Add composer importer. > * doc/guix.texi (Invoking guix import): Mention it. [...] > +@cindex PHP > +Import metadat from the @uref{https://getcomposer.org/, Composer} package ^ Typo. > +(define* (composer-fetch name #:optional version) > + "Return an alist representation of the Composer metadata for the packa= ge NAME, > +or #f on failure." > + (let ((package (json-fetch > + (string-append (%composer-base-url) "/p/" name ".json= ")))) > + (if package > + (let* ((packages (assoc-ref package "packages")) > + (package (or (assoc-ref packages name) package)) > + (versions (filter > + (lambda (version) > + (and (not (string-contains version "dev")) > + (not (string-contains version "beta"))= )) > + (map car package))) > + (version (or (if (null? version) #f version) > + (latest-version versions)))) > + (assoc-ref package version)) > + #f))) I think this should directly return a <composer-package> since the all the callers pass the alist through =E2=80=98json->composer-package=E2=80=99= . The idea is that alists should be converted to records as soon as they enter the process. Also it=E2=80=99s weird that =E2=80=98package=E2=80=99 above has a =E2=80= =9Cpackages=E2=80=9D (plural) entry. Perhaps we=E2=80=99re missing another JSON mapping? [...] > +++ b/guix/scripts/import/composer.scm > @@ -0,0 +1,107 @@ > +;;; GNU Guix --- Functional package management for GNU > +;;; Copyright =C2=A9 2015 David Thompson <davet@HIDDEN> > +;;; Copyright =C2=A9 2018 Oleg Pykhalov <go.wigust@HIDDEN> You can preserve these two lines if you think it=E2=80=99s relevant, but I= =E2=80=99d suggest adding one for yourself. OK to push with changes along these lines. Thanks for taking the time to convert to =E2=80=98define-json-mapping=E2=80= =99 and all! Ludo=E2=80=99.
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 03/34] guix: Add composer-build-system. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Fri, 25 Sep 2020 10:35:02 +0000 Resent-Message-ID: <handler.42338.B42338.160103005324827 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Julien Lepiller <julien@HIDDEN> Cc: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.160103005324827 (code B ref 42338); Fri, 25 Sep 2020 10:35:02 +0000 Received: (at 42338) by debbugs.gnu.org; 25 Sep 2020 10:34:13 +0000 Received: from localhost ([127.0.0.1]:42784 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1kLl3N-0006SN-2a for submit <at> debbugs.gnu.org; Fri, 25 Sep 2020 06:34:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39702) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1kLl3L-0006SA-K9 for 42338 <at> debbugs.gnu.org; Fri, 25 Sep 2020 06:34:12 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:56389) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1kLl3G-00012x-3v; Fri, 25 Sep 2020 06:34:06 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=60868 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from <ludo@HIDDEN>) id 1kLl37-0000S9-Tj; Fri, 25 Sep 2020 06:34:04 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> <20200712222538.18092-3-julien@HIDDEN> <87imcphe6a.fsf@HIDDEN> <20200918004403.0d755d60@HIDDEN> <87eemz1nib.fsf@HIDDEN> <20200919012420.301201e8@HIDDEN> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 4 =?UTF-8?Q?Vend=C3=A9miaire?= an 229 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Fri, 25 Sep 2020 12:33:56 +0200 In-Reply-To: <20200919012420.301201e8@HIDDEN> (Julien Lepiller's message of "Sat, 19 Sep 2020 01:24:20 +0200") Message-ID: <87eemq16y3.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (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 <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Hi, Julien Lepiller <julien@HIDDEN> skribis: > Le Fri, 18 Sep 2020 10:45:48 +0200, > Ludovic Court=C3=A8s <ludo@HIDDEN> a =C3=A9crit : > >> Hi, >>=20 >> Julien Lepiller <julien@HIDDEN> skribis: >>=20 >> > + (let* ((package-data (read-package-data #:filename >> > composer-file)) >> > + (scripts (match (assoc-ref package-data "scripts") >> > + (('@ script ...) script) >> > + (#f '()))) >> > + (test-script >> > + (assoc-ref scripts test-target)) >> > + (dependencies (filter (lambda (dep) (string-contains >> > dep "/")) >> > + (map car >> > + (match (assoc-ref >> > package-data "require") >> > + (('@ dependency ...) >> > dependency) >> > + (#f '()))))) >> > + (dependencies-dev >> > + (filter (lambda (dep) (string-contains dep "/")) >> > + (map car >> > + (match (assoc-ref package-data >> > "require-dev") >> > + (('@ dependency ...) dependency) >> > + (#f '()))))) >> > + (name (assoc-ref package-data "name")))=20=20 >>=20 >> This is also a case for =E2=80=98define-json-mapping=E2=80=99. I suppos= e we could use >> Guile-JSON instead of (guix build json), no? >>=20 >> I think this code and similar occurrences would be less intimidating >> if we used =E2=80=98define-json-mapping=E2=80=99; it would make the data= structures >> clearer, unlike here where one has to keep in mind what the list/tree >> looks like so they can map car/cdr around. > > I think we already tried that with the node build system, but we had to > revert, because we were importing guile-json from the host side. I > don't remember the details though, so if you think it's OK now, I'll > gladly make the code look nicer :) Yes please. :-) I think code full of alists/dictionaries would be hard to read and to maintain since mistakes could end up being silently ignored or lead to a wrong-type-#f error far down the road. Also please remember to avoid car/cdr: https://guix.gnu.org/manual/en/html_node/Data-Types-and-Pattern-Matching.= html As for Guile-JSON: perhaps you can post a draft that we can play with to see if there=E2=80=99s anything wrong, but off the top of my head I don=E2= =80=99t see why it wouldn=E2=80=99t work. >> > + (match test-script >> > + ((? string? command) >> > + (unless (equal? (system command) 0) >> > + (throw 'failed-command command))) >> > + (('@ (? string? command) ...) >> > + (for-each >> > + (lambda (c) >> > + (unless (equal? (system c) 0) >> > + (throw 'failed-command c))) >> > + command))=20=20 >>=20 >> Use (zero? x) instead of (equal? 0 x). >>=20 >> Also, why not use =E2=80=98invoke=E2=80=99? I this because these comman= ds are really >> shell commands and expect things like glob patterns and tilde >> expansion? If these are not shell commands, I recommend =E2=80=98invoke= =E2=80=99, >> which will report failures more nicely. > > Here I have a single string that contains shell commands, so I don't > think I can use invoke. =E2=80=98system=E2=80=99 passes the string to =E2=80=9Csh -c=E2=80=9D, whic= h means the string is subject to shelly things: glob expansion, semicolon interpretation, string quotation, etc. If those strings are meant to be shell-interpreted, then passing them to =E2=80=98system=E2=80=99 is the right thing. Otherwise, it should be avoid= ed IMO. Thanks, Ludo=E2=80=99.
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 03/34] guix: Add composer-build-system. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Tue, 29 Sep 2020 14:50:01 +0000 Resent-Message-ID: <handler.42338.B42338.160139099131293 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN> Cc: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.160139099131293 (code B ref 42338); Tue, 29 Sep 2020 14:50:01 +0000 Received: (at 42338) by debbugs.gnu.org; 29 Sep 2020 14:49:51 +0000 Received: from localhost ([127.0.0.1]:56881 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1kNGwq-00088X-DV for submit <at> debbugs.gnu.org; Tue, 29 Sep 2020 10:49:51 -0400 Received: from lepiller.eu ([89.234.186.109]:50914) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1kNGwl-00088H-3K for 42338 <at> debbugs.gnu.org; Tue, 29 Sep 2020 10:49:43 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 404a0e97; Tue, 29 Sep 2020 14:49:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type; s=dkim; bh=wcgz7dM5pytS2F368frIn8dmtK8Z2cfDrcDtOl QnJBI=; b=bIlnXpDp3q4J1FY0ixsQvM2pYKwjwwBslVDCljyrfn0hRifhqwEFkF 4aTtgdv5l3CGOMEEjPof77PH5uVZPszZ3fF/J5WhNeFE59WAjJgruRMJAZBqfVga /mZaWtuBkOjCko4z3LjDktiK0DNk0aL94TR56OPLGPddhLp4ljvserPBKlLTaF4H 6SfxAO7pZrjwDaKB58cC2jkuDBwSGpUuI+q4nMxZndgSkAE/PnP7L8BwWIxoO6io hdKMXL8KAFgDfGGAEmt2Hoz6VVOvqKfabGMlmcX5WyGr1AGvG1+M/Pax68hpTYlW 2HZ8se017GEM7zThNwG9zBhfxN2N+IhA== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 3bf0a08d (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Tue, 29 Sep 2020 14:49:36 +0000 (UTC) Date: Tue, 29 Sep 2020 16:49:20 +0200 From: Julien Lepiller <julien@HIDDEN> Message-ID: <20200929164920.0684be42@HIDDEN> In-Reply-To: <87eemq16y3.fsf@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> <20200712222538.18092-3-julien@HIDDEN> <87imcphe6a.fsf@HIDDEN> <20200918004403.0d755d60@HIDDEN> <87eemz1nib.fsf@HIDDEN> <20200919012420.301201e8@HIDDEN> <87eemq16y3.fsf@HIDDEN> X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/wX.Yq./3HOZ_fNNuuCidCBh" X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) --MP_/wX.Yq./3HOZ_fNNuuCidCBh Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Le Fri, 25 Sep 2020 12:33:56 +0200, Ludovic Court=C3=A8s <ludo@HIDDEN> a =C3=A9crit : > Hi, >=20 > As for Guile-JSON: perhaps you can post a draft that we can play with > to see if there=E2=80=99s anything wrong, but off the top of my head I do= n=E2=80=99t > see why it wouldn=E2=80=99t work. >=20 > Thanks, > Ludo=E2=80=99. Here's a new version, hopefully this addresses all your remarks. I'm still not sure how (json) is pulled in to the build side though... How does guix know it needs to use guile-json-3 instead of guile-json-1 for instance? How does it work with inferiors? --MP_/wX.Yq./3HOZ_fNNuuCidCBh Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0003-guix-Add-composer-build-system.patch =46rom 432f57aeeb3b2e48591288e6491d66ab299661f0 Mon Sep 17 00:00:00 2001 From: Julien Lepiller <julien@HIDDEN> Date: Tue, 29 Oct 2019 20:58:51 +0100 Subject: [PATCH 03/34] guix: Add composer-build-system. * guix/build-system/composer.scm: New file. * guix/build/composer-build-system.scm: New file. * gnu/packages/aux-files/findclass.php: New file. * Makefile.am: Add them. * doc/guix.texi (Build Systems): Document it. --- Makefile.am | 5 +- doc/guix.texi | 14 ++ gnu/packages/aux-files/findclass.php | 125 ++++++++++++++ guix/build-system/composer.scm | 173 +++++++++++++++++++ guix/build/composer-build-system.scm | 241 +++++++++++++++++++++++++++ 5 files changed, 557 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/aux-files/findclass.php create mode 100644 guix/build-system/composer.scm create mode 100644 guix/build/composer-build-system.scm diff --git a/Makefile.am b/Makefile.am index 6ce1430ea6..5af964b0e9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -115,6 +115,7 @@ MODULES =3D \ guix/build-system/cargo.scm \ guix/build-system/clojure.scm \ guix/build-system/cmake.scm \ + guix/build-system/composer.scm \ guix/build-system/dub.scm \ guix/build-system/dune.scm \ guix/build-system/emacs.scm \ @@ -163,6 +164,7 @@ MODULES =3D \ guix/build/cargo-build-system.scm \ guix/build/cargo-utils.scm \ guix/build/cmake-build-system.scm \ + guix/build/composer-build-system.scm \ guix/build/dub-build-system.scm \ guix/build/dune-build-system.scm \ guix/build/emacs-build-system.scm \ @@ -354,7 +356,8 @@ AUX_FILES =3D \ gnu/packages/aux-files/linux-libre/4.4-i686.conf \ gnu/packages/aux-files/linux-libre/4.4-x86_64.conf \ gnu/packages/aux-files/pack-audit.c \ - gnu/packages/aux-files/run-in-namespace.c + gnu/packages/aux-files/run-in-namespace.c \ + gnu/packages/aux-files/findclass.php =20 # Templates, examples. EXAMPLES =3D \ diff --git a/doc/guix.texi b/doc/guix.texi index 626915fd39..6870163c23 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -6941,6 +6941,20 @@ debugging information''), which roughly means that c= ode is compiled with @code{-O2 -g}, as is the case for Autoconf-based packages by default. @end defvr =20 +@defvr {Scheme Variable} composer-build-system +This variable is exported by @code{(guix build-system composer)}. It +implements the build procedure for packages using +@url{https://getcomposer.org/, Composer}, the PHP package manager. + +It automatically adds the @code{php} package to the set of inputs. Which +package is used can be specified with the @code{#:php} parameter. + +The @code{#:test-target} parameter is used to control which script is run +for the tests. By default, the @code{test} script is run if it exists. If +the script does not exist, the build system will run @code{phpunit} from t= he +source directory, assuming there is a @file{phpunit.xml} file. +@end defvr + @defvr {Scheme Variable} dune-build-system This variable is exported by @code{(guix build-system dune)}. It supports builds of packages using @uref{https://dune.build/, Dune}, a build diff --git a/gnu/packages/aux-files/findclass.php b/gnu/packages/aux-files/= findclass.php new file mode 100644 index 0000000000..d0b250c8e1 --- /dev/null +++ b/gnu/packages/aux-files/findclass.php @@ -0,0 +1,125 @@ +<?php +/** + * The content of this file is copied from composer's src/Composer/Autoloa= d/ClassMapGenerator.php + * the findClasses method was extracted, to prevent using any dependency. + * + * Composer (and thus this file) is distributed under the expat license, a= nd + * ClassMapGenerator.php also contains this notice: + * + * This file is part of Composer. + * + * (c) Nils Adermann <naderman@HIDDEN> + * Jordi Boggiano <j.boggiano@HIDDEN> + * + * For the full copyright and license information, please view the LICEN= SE + * file that was distributed with this source code. + * + * This file is copied from the Symfony package. + * + * (c) Fabien Potencier <fabien@HIDDEN> + *=20 + * To the extent to wich it makes sense, as the author of the extract: + * Copyright =C2=A9 2020 Julien Lepiller <julien@HIDDEN> + */ + +/** + * Extract the classes in the given file + * + * @param string $path The file to check + * @throws \RuntimeException + * @return array The found classes + */ +function findClasses($path) +{ + $extraTypes =3D PHP_VERSION_ID < 50400 ? '' : '|trait'; + if (defined('HHVM_VERSION') && version_compare(HHVM_VERSION, '3.3', '>= =3D')) { + $extraTypes .=3D '|enum'; + } + // Use @ here instead of Silencer to actively suppress 'unhelpful' out= put + // @link https://github.com/composer/composer/pull/4886 + $contents =3D @php_strip_whitespace($path); + if (!$contents) { + if (!file_exists($path)) { + $message =3D 'File at "%s" does not exist, check your classmap= definitions'; + } elseif (!is_readable($path)) { + $message =3D 'File at "%s" is not readable, check its permissi= ons'; + } elseif ('' =3D=3D=3D trim(file_get_contents($path))) { + // The input file was really empty and thus contains no classes + return array(); + } else { + $message =3D 'File at "%s" could not be parsed as PHP, it may = be binary or corrupted'; + } + $error =3D error_get_last(); + if (isset($error['message'])) { + $message .=3D PHP_EOL . 'The following message may be helpful:= ' . PHP_EOL . $error['message']; + } + throw new \RuntimeException(sprintf($message, $path)); + } + // return early if there is no chance of matching anything in this file + if (!preg_match('{\b(?:class|interface'.$extraTypes.')\s}i', $contents= )) { + return array(); + } + // strip heredocs/nowdocs + $contents =3D preg_replace('{<<<[ \t]*([\'"]?)(\w+)\\1(?:\r\n|\n|\r)(?= :.*?)(?:\r\n|\n|\r)(?:\s*)\\2(?=3D\s+|[;,.)])}s', 'null', $contents); + // strip strings + $contents =3D preg_replace('{"[^"\\\\]*+(\\\\.[^"\\\\]*+)*+"|\'[^\'\\\= \]*+(\\\\.[^\'\\\\]*+)*+\'}s', 'null', $contents); + // strip leading non-php code if needed + if (substr($contents, 0, 2) !=3D=3D '<?') { + $contents =3D preg_replace('{^.+?<\?}s', '<?', $contents, 1, $repl= acements); + if ($replacements =3D=3D=3D 0) { + return array(); + } + } + // strip non-php blocks in the file + $contents =3D preg_replace('{\?>(?:[^<]++|<(?!\?))*+<\?}s', '?><?', $c= ontents); + // strip trailing non-php code if needed + $pos =3D strrpos($contents, '?>'); + if (false !=3D=3D $pos && false =3D=3D=3D strpos(substr($contents, $po= s), '<?')) { + $contents =3D substr($contents, 0, $pos); + } + // strip comments if short open tags are in the file + if (preg_match('{(<\?)(?!(php|hh))}i', $contents)) { + $contents =3D preg_replace('{//.* | /\*(?:[^*]++|\*(?!/))*\*/}x', = '', $contents); + } + preg_match_all('{ + (?: + \b(?<![\$:>])(?P<type>class|interface'.$extraTypes.') \s++ (?= P<name>[a-zA-Z_\x7f-\xff:][a-zA-Z0-9_\x7f-\xff:\-]*+) + | \b(?<![\$:>])(?P<ns>namespace) (?P<nsname>\s++[a-zA-Z_\x7f-\x= ff][a-zA-Z0-9_\x7f-\xff]*+(?:\s*+\\\\\s*+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-= \xff]*+)*+)? \s*+ [\{;] + ) + }ix', $contents, $matches); + $classes =3D array(); + $namespace =3D ''; + for ($i =3D 0, $len =3D count($matches['type']); $i < $len; $i++) { + if (!empty($matches['ns'][$i])) { + $namespace =3D str_replace(array(' ', "\t", "\r", "\n"), '', $= matches['nsname'][$i]) . '\\'; + } else { + $name =3D $matches['name'][$i]; + // skip anon classes extending/implementing + if ($name =3D=3D=3D 'extends' || $name =3D=3D=3D 'implements')= { + continue; + } + if ($name[0] =3D=3D=3D ':') { + // This is an XHP class, https://github.com/facebook/xhp + $name =3D 'xhp'.substr(str_replace(array('-', ':'), array(= '_', '__'), $name), 1); + } elseif ($matches['type'][$i] =3D=3D=3D 'enum') { + // In Hack, something like: + // enum Foo: int { HERP =3D '123'; } + // The regex above captures the colon, which isn't part of + // the class name. + $name =3D rtrim($name, ':'); + } + $classes[] =3D ltrim($namespace . $name, '\\'); + } + } + return $classes; +} + +$options =3D getopt('i:f:', []); +$file =3D $options["f"]; +$input =3D $options["i"]; + +$classes =3D findClasses($file); +foreach($classes as $class) { + echo '$classmap[\''.$class.'\'] =3D \''.$input.'/'.$file.'\';'; + echo "\n"; +} diff --git a/guix/build-system/composer.scm b/guix/build-system/composer.scm new file mode 100644 index 0000000000..0299f11906 --- /dev/null +++ b/guix/build-system/composer.scm @@ -0,0 +1,173 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2019 Julien Lepiller <julien@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. +(define-module (guix build-system composer) + #:use-module (guix store) + #:use-module (guix utils) + #:use-module (guix derivations) + #:use-module (guix search-paths) + #:use-module (guix build-system) + #:use-module (guix build-system gnu) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (gnu packages) + #:use-module (ice-9 match) + #:use-module (srfi srfi-1) + #:export (%composer-build-system-modules + lower + composer-build + composer-build-system)) + +;; Commentary: +;; +;; Standard build procedure for PHP packages using Composer. This is imple= mented +;; as an extension of `gnu-build-system'. +;; +;; Code: + +(define (default-php) + "Return the default PHP package." + + ;; Do not use `@' to avoid introducing circular dependencies. + (let ((module (resolve-interface '(gnu packages php)))) + (module-ref module 'php))) + +(define (default-findclass) + "Return the default findclass script." + (search-auxiliary-file "findclass.php")) + +(define (default-composer-classloader) + "Return the default composer-classloader package." + + ;; Do not use `@' to avoid introducing circular dependencies. + (let ((module (resolve-interface '(gnu packages php-xyz)))) + (module-ref module 'composer-classloader))) + +(define %composer-build-system-modules + ;; Build-side modules imported by default. + `((guix build composer-build-system) + (guix build union) + (json) + (json builder) + (json parser) + (json record) + ,@%gnu-build-system-modules)) + +(define* (lower name + #:key source inputs native-inputs outputs system target + (php (default-php)) + (composer-classloader (default-composer-classloader)) + (findclass (default-findclass)) + #:allow-other-keys + #:rest arguments) + "Return a bag for NAME." + (define private-keywords + '(#:source #:target #:php #:composer-classloader #:findclass #:inputs = #:native-inputs)) + + (and (not target) ;XXX: no cross-compilati= on + (bag + (name name) + (system system) + (host-inputs `(,@(if source + `(("source" ,source)) + '()) + ,@inputs + + ;; Keep the standard inputs of 'gnu-build-system'. + ,@(standard-packages))) + (build-inputs `(("php" ,php) + ("findclass.php" ,findclass) + ("composer-classloader" ,composer-classloader) + ,@native-inputs)) + (outputs outputs) + (build composer-build) + (arguments (strip-keyword-arguments private-keywords arguments)))= )) + +(define* (composer-build store name inputs + #:key (guile #f) + (outputs '("out")) (configure-flags ''()) + (search-paths '()) + (out-of-source? #t) + (composer-file "composer.json") + (tests? #t) + (test-target "test") + (install-target "install") + (validate-runpath? #t) + (patch-shebangs? #t) + (strip-binaries? #t) + (strip-flags ''("--strip-debug")) + (strip-directories ''("lib" "lib64" "libexec" + "bin" "sbin")) + (phases '(@ (guix build composer-build-system) + %standard-phases)) + (system (%current-system)) + (imported-modules %composer-build-system-modules) + (modules '((guix build composer-build-system) + (guix build utils) + (json)))) + "Build SOURCE using PHP, and with INPUTS. This assumes that SOURCE provi= des +a 'composer.json' file as its build system." + (define builder + `(begin + (use-modules ,@modules) + (composer-build #:source ,(match (assoc-ref inputs "source") + (((? derivation? source)) + (derivation->output-path source)) + ((source) + source) + (source + source)) + #:system ,system + #:outputs %outputs + #:inputs %build-inputs + #:search-paths ',(map search-path-specification->se= xp + search-paths) + #:phases ,phases + #:out-of-source? ,out-of-source? + #:composer-file ,composer-file + #:tests? ,tests? + #:test-target ,test-target + #:install-target ,install-target + #:validate-runpath? ,validate-runpath? + #:patch-shebangs? ,patch-shebangs? + #:strip-binaries? ,strip-binaries? + #:strip-flags ,strip-flags + #:strip-directories ,strip-directories))) + + (define guile-for-build + (match guile + ((? package?) + (package-derivation store guile system #:graft? #f)) + (#f ; the default + (let* ((distro (resolve-interface '(gnu packages commencement))) + (guile (module-ref distro 'guile-final))) + (package-derivation store guile system #:graft? #f))))) + + (build-expression->derivation store name builder + #:system system + #:inputs inputs + #:modules imported-modules + #:outputs outputs + #:guile-for-build guile-for-build)) + +(define composer-build-system + (build-system + (name 'composer) + (description "The standard Composer build system") + (lower lower))) + +;;; composer.scm ends here diff --git a/guix/build/composer-build-system.scm b/guix/build/composer-bui= ld-system.scm new file mode 100644 index 0000000000..1af5e59b81 --- /dev/null +++ b/guix/build/composer-build-system.scm @@ -0,0 +1,241 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2019 Julien Lepiller <julien@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (guix build composer-build-system) + #:use-module ((guix build gnu-build-system) #:prefix gnu:) + #:use-module (guix build utils) + #:use-module (ice-9 match) + #:use-module (json) + #:use-module (srfi srfi-26) + #:export (%standard-phases + composer-build)) + +;; Commentary: +;; +;; Builder-side code of the standard composer build procedure. +;; +;; Code: + +(define (json->require dict) + (if dict + (let loop ((result '()) (require dict)) + (match require + (() result) + ((((? (cut string-contains <> "/") name) . _) + require ...) + (loop (cons name result) require)) + ((_ require ...) (loop result require)))) + '())) + +(define-json-mapping <composer-autoload> make-composer-autoload composer-a= utoload? + json->composer-autoload + (psr-4 composer-autoload-psr-4 "psr-4" + (match-lambda + (#f '()) + (psr-4 psr-4))) + (classmap composer-autoload-classmap "classmap" + (match-lambda + (#f '()) + (#(lst ...) lst)))) + +(define-json-mapping <composer-package> make-composer-package composer-pac= kage? + json->composer-package + (name composer-package-name) + (autoload composer-package-autoload "autoload" json->composer-autolo= ad) + (autoload-dev composer-package-autoload-dev "autoload-dev" json->compose= r-autoload) + (require composer-package-require "require" json->require) + (dev-require composer-package-dev-require "require-dev" json->require) + (scripts composer-package-scripts "scripts" + (match-lambda + (#f '()) + ((scripts ...) scripts))) + (binaries composer-package-binaries "bin" + (match-lambda + (#f '()) + (#(lst ...) lst)))) + +(define* (read-package-data #:key (filename "composer.json")) + (call-with-input-file filename + (lambda (port) + (json->composer-package (json->scm port))))) + +(define* (check #:key composer-file inputs outputs tests? test-target #:al= low-other-keys) + "Install the given package." + (when tests? + (mkdir-p "vendor") + (create-autoload (string-append (getcwd) "/vendor") composer-file + (append inputs outputs) #:dev-dependencies? #t) + (let* ((package-data (read-package-data #:filename composer-file)) + (scripts (composer-package-scripts package-data)) + (test-script (assoc-ref scripts test-target)) + (dependencies (composer-package-require package-data)) + (dependencies-dev (composer-package-dev-require package-data)) + (name (composer-package-name package-data))) + (for-each + (match-lambda + ((_ . input) + (let ((bin (find-php-bin input))) + (when bin + (copy-recursively bin "vendor/bin"))))) + inputs) + (match test-script + ((? string? command) + (unless (zero? (system command)) + (throw 'failed-command command))) + (('@ (? string? command) ...) + (for-each + (lambda (c) + (unless (zero? (system c)) + (throw 'failed-command c))) + command)) + (#f (invoke "vendor/bin/phpunit"))))) + #t) + +(define (find-php-bin input) + (let* ((web-dir (string-append input "/share/web")) + (vendors (if (file-exists? web-dir) + (find-files web-dir "^vendor$" #:directories? #t) + #f))) + (match vendors + ((vendor) + (let ((bin (string-append vendor "/bin"))) + (and (file-exists? bin) bin))) + (_ #f)))) + +(define (find-php-dep inputs dependency) + (let loop ((inputs inputs)) + (match inputs + (() (throw 'unsatisfied-dependency "Unsatisfied dependency: required= " + dependency)) + (((_ . input) inputs ...) + (let ((autoload (string-append input "/share/web/" dependency + "/vendor/autoload_conf.php"))) + (if (file-exists? autoload) + autoload + (loop inputs))))))) + +(define* (create-autoload vendor composer-file inputs #:key dev-dependenci= es?) + "creates an autoload.php file that sets up the class locations for this = package, +so it can be autoloaded by PHP when the package classes are required." + (with-output-to-file (string-append vendor "/autoload.php") + (lambda _ + (display (string-append + "<?php +// autoload.php @generated by Guix +$map =3D $psr4map =3D $classmap =3D array(); +require_once '" vendor "/autoload_conf.php' +require_once '" (assoc-ref inputs "composer-classloader") "/share/web/comp= oser/ClassLoader.php' +$loader =3D new \\Composer\\Autoload\\ClassLoader(); +foreach ($map as $namespace =3D> $path) { + $loader->set($namespace, $path); +} +foreach ($psr4map as $namespace =3D> $path) { + $loader->setPsr4($namespace, $path); +} +$loader->addClassMap($classmap); +$loader->register(); +")))) + ;; Now, create autoload_conf.php that contains the actual data, as a set + ;; of arrays + (let* ((package-data (read-package-data #:filename composer-file)) + (autoload (composer-package-autoload package-data)) + (autoload-dev (composer-package-autoload-dev package-data)) + (dependencies (composer-package-require package-data)) + (dependencies-dev (composer-package-dev-require package-data))) + (with-output-to-file (string-append vendor "/autoload_conf.php") + (lambda _ + (format #t "<?php~%") + (format #t "// autoload_conf.php @generated by Guix~%") + (force-output) + (for-each + (lambda (psr4) + (match psr4 + ((key . value) + (format #t "$psr4map['~a'] =3D '~a/../~a';~%" + (string-join (string-split key #\\) "\\\\") + vendor value)))) + (append + (composer-autoload-psr-4 autoload) + (if dev-dependencies? + (composer-autoload-psr-4 autoload-dev) + '()))) + (for-each + (lambda (classmap) + (for-each + (lambda (file) + (invoke "php" (assoc-ref inputs "findclass.php") + "-i" (string-append vendor "/..") "-f" file)) + (find-files classmap ".(php|hh|inc)$"))) + (append + (composer-autoload-classmap autoload) + (if dev-dependencies? + (composer-autoload-classmap autoload-dev) + '()))) + (for-each + (lambda (dep) + (format #t "require_once '~a';~%" (find-php-dep inputs dep))) + (append + dependencies + (if dev-dependencies? + dependencies-dev + '()))))))) + +(define* (install #:key inputs outputs composer-file #:allow-other-keys) + "Install the given package." + (let* ((out (assoc-ref outputs "out")) + (package-data (read-package-data #:filename composer-file)) + (name (composer-package-name package-data)) + (php-dir (string-append out "/share/web/" name)) + (bin-dir (string-append php-dir "/vendor/bin")) + (bin (string-append out "/bin")) + (binaries (composer-package-binaries package-data))) + (mkdir-p php-dir) + (copy-recursively "." php-dir) + (mkdir-p (string-append php-dir "/vendor")) + (when binaries + (mkdir-p bin-dir) + (mkdir-p bin) + (for-each + (lambda (file) + (let ((installed-file (string-append bin-dir "/" (basename fil= e))) + (bin-file (string-append bin "/" (basename file))) + (original-file (string-append php-dir "/" file))) + (symlink original-file installed-file) + (symlink original-file bin-file))) + binaries)) + (create-autoload (string-append php-dir "/vendor") + composer-file inputs)) + #t) + +(define %standard-phases + ;; Everything is as with the GNU Build System except for the `configure' + ;; , `build', `check' and `install' phases. + (modify-phases gnu:%standard-phases + (delete 'bootstrap) + (delete 'configure) + (delete 'build) + (delete 'check) + (replace 'install install) + (add-after 'install 'check check))) + +(define* (composer-build #:key inputs (phases %standard-phases) + #:allow-other-keys #:rest args) + "Build the given package, applying all of PHASES in order." + (apply gnu:gnu-build #:inputs inputs #:phases phases args)) + +;;; composer-build-system.scm ends here --=20 2.28.0 --MP_/wX.Yq./3HOZ_fNNuuCidCBh--
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 03/34] guix: Add composer-build-system. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Wed, 30 Sep 2020 09:25:01 +0000 Resent-Message-ID: <handler.42338.B42338.160145785823937 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Julien Lepiller <julien@HIDDEN> Cc: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.160145785823937 (code B ref 42338); Wed, 30 Sep 2020 09:25:01 +0000 Received: (at 42338) by debbugs.gnu.org; 30 Sep 2020 09:24:18 +0000 Received: from localhost ([127.0.0.1]:58204 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1kNYLR-0006E1-SA for submit <at> debbugs.gnu.org; Wed, 30 Sep 2020 05:24:18 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54308) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1kNYLP-0006Dn-Jx for 42338 <at> debbugs.gnu.org; Wed, 30 Sep 2020 05:24:16 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58657) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1kNYLK-0002HX-6I; Wed, 30 Sep 2020 05:24:10 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=58752 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from <ludo@HIDDEN>) id 1kNYLJ-0003Zj-Np; Wed, 30 Sep 2020 05:24:09 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> <20200712222538.18092-3-julien@HIDDEN> <87imcphe6a.fsf@HIDDEN> <20200918004403.0d755d60@HIDDEN> <87eemz1nib.fsf@HIDDEN> <20200919012420.301201e8@HIDDEN> <87eemq16y3.fsf@HIDDEN> <20200929164920.0684be42@HIDDEN> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 9 =?UTF-8?Q?Vend=C3=A9miaire?= an 229 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Wed, 30 Sep 2020 11:24:08 +0200 In-Reply-To: <20200929164920.0684be42@HIDDEN> (Julien Lepiller's message of "Tue, 29 Sep 2020 16:49:20 +0200") Message-ID: <87blhn39dz.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (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 <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Hi, Julien Lepiller <julien@HIDDEN> skribis: > Here's a new version, hopefully this addresses all your remarks. I'm > still not sure how (json) is pulled in to the build side though... How > does guix know it needs to use guile-json-3 instead of guile-json-1 for > instance? Ah, see below. > How does it work with inferiors? I think inferiors have nothing to do with it. > From 432f57aeeb3b2e48591288e6491d66ab299661f0 Mon Sep 17 00:00:00 2001 > From: Julien Lepiller <julien@HIDDEN> > Date: Tue, 29 Oct 2019 20:58:51 +0100 > Subject: [PATCH 03/34] guix: Add composer-build-system. > > * guix/build-system/composer.scm: New file. > * guix/build/composer-build-system.scm: New file. > * gnu/packages/aux-files/findclass.php: New file. > * Makefile.am: Add them. > * doc/guix.texi (Build Systems): Document it. [...] > +(define %composer-build-system-modules > + ;; Build-side modules imported by default. > + `((guix build composer-build-system) > + (guix build union) > + (json) > + (json builder) > + (json parser) > + (json record) Here, as the comment says, you=E2=80=99re importing (json =E2=80=A6) from t= he host side to the build side. That=E2=80=99s why it works. The problem is that it=E2=80=99s just picking whatever (json =E2=80=A6) mod= ules are on your load path on the host side: if you have Guile-JSON 3.x, it=E2=80=99ll = use that, if you have 4.x, that=E2=80=99ll be 4.x, and if you have nothing, it= =E2=80=99ll fail to build. So the fix is to remove those modules from this list. You should only ever import Guix modules. Now you need to bring Guile-JSON into the environment. When using gexp, we do that with =E2=80=98with-extensions=E2=80=99, but here it=E2=80=99s a = bit clunky=E2=80=A6 > + (modules '((guix build composer-build-system) > + (guix build utils) > + (json)))) I think you don=E2=80=99t need (json) here. (This is the list of modules in scope.) > + (define builder > + `(begin > + (use-modules ,@modules) > + (composer-build #:source ,(match (assoc-ref inputs "source") > + (((? derivation? source)) > + (derivation->output-path source)) > + ((source) > + source) > + (source > + source)) > + #:system ,system > + #:outputs %outputs > + #:inputs %build-inputs > + #:search-paths ',(map search-path-specification->= sexp > + search-paths) > + #:phases ,phases > + #:out-of-source? ,out-of-source? > + #:composer-file ,composer-file > + #:tests? ,tests? > + #:test-target ,test-target > + #:install-target ,install-target > + #:validate-runpath? ,validate-runpath? > + #:patch-shebangs? ,patch-shebangs? > + #:strip-binaries? ,strip-binaries? > + #:strip-flags ,strip-flags > + #:strip-directories ,strip-directories))) To bring in Guile-JSON, you need to do something similar to what =E2=80=98gexp->file=E2=80=99 does with =E2=80=98load-path-expression=E2=80= =99, along these lines (untested): (define guile-json-drv (package-derivation store (module-ref (resolve-interface '(gnu packages guile= )) 'guile-json) system)) (define builder `(begin (add-to-load-path (string-append ,(derivation->output-path guile-jso= n-drv) "/share/guile/site/" (effective-version))) (use-modules ,@modules) =E2=80=A6)) ;; =E2=80=A6 (build-expression->derivation store name builder ;; =E2=80=A6 #:inputs (append inputs `(("guile-json" ,guile-js= on-drv)))) I guess clunkiness is the reason why we didn=E2=80=99t do it last time=E2= =80=A6 HTH! Ludo=E2=80=99.
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 03/34] guix: Add composer-build-system. Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Fri, 18 Dec 2020 23:44:01 +0000 Resent-Message-ID: <handler.42338.B42338.160833501017873 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN> Cc: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.160833501017873 (code B ref 42338); Fri, 18 Dec 2020 23:44:01 +0000 Received: (at 42338) by debbugs.gnu.org; 18 Dec 2020 23:43:30 +0000 Received: from localhost ([127.0.0.1]:40502 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1kqPPG-0004eD-8k for submit <at> debbugs.gnu.org; Fri, 18 Dec 2020 18:43:30 -0500 Received: from lepiller.eu ([89.234.186.109]:57722) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1kqPPD-0004e3-Td for 42338 <at> debbugs.gnu.org; Fri, 18 Dec 2020 18:43:28 -0500 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id b0d3dc51; Fri, 18 Dec 2020 23:43:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=dkim; bh=gtadFR5dm4Ky Oz25cU5hrjEkb1yBJ99ji6FE1fsStnc=; b=Q+USl78HUv1oUSu5WZC/HVAKAQaS 65jal/pbYFv13vvga09FpYxMy42xf//vGqCWuw3ZAZBX3buLTKKuguf2sPKkKmWS 9wYt6YnVvq26khfAOt8XxWJzLf8uQcVQfcR/h/JaxnrQZPaydz3T24vmytfA+Yz+ S4FtKC1A9vHB/KZdw+10vnN7KMATD/Hq94ny/WHDCzXhA4K6QrCdfX1wK4sQQEEP Dsqj+TSQUjMD51kbbjzwcAxRfikCGDQwERPfSMHZR/oEX5ESvd6mPgsOhrLqcj9f 6mFSAPzoX3BtOvo/4EuFazk2lU4A6JKPatCHzP/etWZj+6vjDrJss2plmQ== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id cfacdb7c (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Fri, 18 Dec 2020 23:43:24 +0000 (UTC) Date: Sat, 19 Dec 2020 00:43:18 +0100 From: Julien Lepiller <julien@HIDDEN> Message-ID: <20201219004318.2c94830d@HIDDEN> In-Reply-To: <87blhn39dz.fsf@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> <20200712222538.18092-3-julien@HIDDEN> <87imcphe6a.fsf@HIDDEN> <20200918004403.0d755d60@HIDDEN> <87eemz1nib.fsf@HIDDEN> <20200919012420.301201e8@HIDDEN> <87eemq16y3.fsf@HIDDEN> <20200929164920.0684be42@HIDDEN> <87blhn39dz.fsf@HIDDEN> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Le Wed, 30 Sep 2020 11:24:08 +0200, Ludovic Court=C3=A8s <ludo@HIDDEN> a =C3=A9crit : >=20 > To bring in Guile-JSON, you need to do something similar to what > =E2=80=98gexp->file=E2=80=99 does with =E2=80=98load-path-expression=E2= =80=99, along these lines > (untested): >=20 > (define guile-json-drv > (package-derivation store > (module-ref (resolve-interface '(gnu packages > guile)) 'guile-json) > system)) >=20 > (define builder > `(begin > (add-to-load-path (string-append ,(derivation->output-path > guile-json-drv) "/share/guile/site/" > (effective-version))) > (use-modules ,@modules) > =E2=80=A6)) >=20 > ;; =E2=80=A6 >=20 > (build-expression->derivation store name builder > ;; =E2=80=A6 > #:inputs (append inputs > `(("guile-json" > ,guile-json-drv)))) >=20 > I guess clunkiness is the reason why we didn=E2=80=99t do it last time=E2= =80=A6 >=20 > HTH! >=20 > Ludo=E2=80=99. Hi Ludo, sorry for the delay! I tried that (replacing 'guile-json with 'guile-json-4), but it doesn't work: when building the package, guix first builds a modules-compiled that fails because it can't find (json). It seems to be related to the compilation of (guix build composer-build-system) which uses the (json) module: when removing the import, it's modules-compiled works (with a lot of warnings), but obviously guix can't build the php package.
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 03/34] guix: Add composer-build-system. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Mon, 21 Dec 2020 14:53:02 +0000 Resent-Message-ID: <handler.42338.B42338.160856233010029 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Julien Lepiller <julien@HIDDEN> Cc: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.160856233010029 (code B ref 42338); Mon, 21 Dec 2020 14:53:02 +0000 Received: (at 42338) by debbugs.gnu.org; 21 Dec 2020 14:52:10 +0000 Received: from localhost ([127.0.0.1]:46642 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1krMXh-0002bh-Ud for submit <at> debbugs.gnu.org; Mon, 21 Dec 2020 09:52:10 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50918) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1krMXg-0002bD-Gk for 42338 <at> debbugs.gnu.org; Mon, 21 Dec 2020 09:52:08 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:38681) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1krMXa-0001mr-68; Mon, 21 Dec 2020 09:52:02 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36950 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from <ludo@HIDDEN>) id 1krMXZ-000783-2B; Mon, 21 Dec 2020 09:52:01 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> <20200712222538.18092-3-julien@HIDDEN> <87imcphe6a.fsf@HIDDEN> <20200918004403.0d755d60@HIDDEN> <87eemz1nib.fsf@HIDDEN> <20200919012420.301201e8@HIDDEN> <87eemq16y3.fsf@HIDDEN> <20200929164920.0684be42@HIDDEN> <87blhn39dz.fsf@HIDDEN> <20201219004318.2c94830d@HIDDEN> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 1 =?UTF-8?Q?Niv=C3=B4se?= an 229 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 21 Dec 2020 15:51:59 +0100 In-Reply-To: <20201219004318.2c94830d@HIDDEN> (Julien Lepiller's message of "Sat, 19 Dec 2020 00:43:18 +0100") Message-ID: <877dpb6wkw.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (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 <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Hi, Julien Lepiller <julien@HIDDEN> skribis: > I tried that (replacing 'guile-json with 'guile-json-4), but it doesn't > work: when building the package, guix first builds a modules-compiled > that fails because it can't find (json). It seems to be related to the > compilation of (guix build composer-build-system) which uses the (json) > module: when removing the import, it's modules-compiled works (with a > lot of warnings), but obviously guix can't build the php package. Ah OK. Well, maybe you can sidestep the issue and use a custom JSON module instead. Sorry for the broken piece of advice! Ludo=E2=80=99.
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] References: <20200713002055.1553f136@HIDDEN> In-Reply-To: <20200713002055.1553f136@HIDDEN> Resent-From: <db@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Mon, 23 Aug 2021 15:04:02 +0000 Resent-Message-ID: <handler.42338.B42338.16297310361018 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: <42338 <at> debbugs.gnu.org> Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.16297310361018 (code B ref 42338); Mon, 23 Aug 2021 15:04:02 +0000 Received: (at 42338) by debbugs.gnu.org; 23 Aug 2021 15:03:56 +0000 Received: from localhost ([127.0.0.1]:42338 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1mIBUR-0000GL-Id for submit <at> debbugs.gnu.org; Mon, 23 Aug 2021 11:03:56 -0400 Received: from mout-p-103.mailbox.org ([80.241.56.161]:49676) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <db@HIDDEN>) id 1mI6Xg-0006Wi-AT for 42338 <at> debbugs.gnu.org; Mon, 23 Aug 2021 05:46:56 -0400 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-103.mailbox.org (Postfix) with ESMTPS id 4GtS7Y74y6zQkDy for <42338 <at> debbugs.gnu.org>; Mon, 23 Aug 2021 11:46:49 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=minikn.xyz; s=MBO0001; t=1629712008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=0oxWSM4egfLljKHHT1kF03r6plwJjvskoDCLGxG1YqU=; b=IYt8QMNVy0jIqpDyDFoCTmEWNO9BjFr735UW7fhAGM17741hoXKzp0TJOMbugdtM+GtWHo ztQ77QgPSf25138MEP0IAjtLGEzQZaLVW5C3kManzU9u3kPKywPYKqIC/6qo4Fc3PQnXy5 sUAycClpabduDgb9M30qtrLCLxLQK9h7iZ2TqKICGIIN2FRyS/7Qfl859vSWgGd+6Id6fB F5JsD0qwuA4FLYX2yC7tGlkJhUE4qAobnTKjtK/5iIBueoDXl06J5A2WnsGskod32QSRhK G/l+cTKuyuucZ9jd0VoKZUG1ykGQSoHh9As2iEqnbcv5c8kHHV05DYogJT0+wg== Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id 9N0DlrEV621y for <42338 <at> debbugs.gnu.org>; Mon, 23 Aug 2021 11:46:46 +0200 (CEST) From: <db@HIDDEN> Date: Mon, 23 Aug 2021 11:46:49 +0200 Message-ID: <000a01d79803$cbd95220$638bf660$@minikn.xyz> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_000B_01D79814.8F622220" Thread-Index: AdeYA8trxgTP5XssSWOrgikG2z4hmA== Content-Language: de X-Rspamd-Queue-Id: CCF9318B4 X-Rspamd-UID: cfc76e X-Spam-Score: 4.3 (++++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hello. Is this feature still being worked on? I'd love to make use of it! Cheers, Demis. Content analysis details: (4.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_NONE SPF: sender does not publish an SPF Record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: minikn.xyz (xyz)] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 HTML_MESSAGE BODY: HTML included in message -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [80.241.56.161 listed in wl.mailspike.net] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [80.241.56.161 listed in list.dnswl.org] 2.0 BLANK_SUBJECT Subject is present but empty 0.5 FROM_SUSPICIOUS_NTLD_FP From abused NTLD 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD X-Mailman-Approved-At: Mon, 23 Aug 2021 11:03:54 -0400 X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: 2.8 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hello. Is this feature still being worked on? I'd love to make use of it! Cheers, Demis. Content analysis details: (2.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_NONE SPF: sender does not publish an SPF Record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: minikn.xyz (xyz)] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 HTML_MESSAGE BODY: HTML included in message -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [80.241.56.161 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [80.241.56.161 listed in wl.mailspike.net] 2.0 BLANK_SUBJECT Subject is present but empty 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager This is a multipart message in MIME format. ------=_NextPart_000_000B_01D79814.8F622220 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hello. Is this feature still being worked on? I'd love to make use of it! Cheers, Demis. ------=_NextPart_000_000B_01D79814.8F622220 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable <html xmlns:v=3D"urn:schemas-microsoft-com:vml" = xmlns:o=3D"urn:schemas-microsoft-com:office:office" = xmlns:w=3D"urn:schemas-microsoft-com:office:word" = xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" = xmlns=3D"http://www.w3.org/TR/REC-html40"><head><META = HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; = charset=3Dus-ascii"><meta name=3DGenerator content=3D"Microsoft Word 15 = (filtered medium)"><style><!-- /* Font Definitions */ @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4;} @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0cm; font-size:11.0pt; font-family:"Calibri",sans-serif; mso-fareast-language:EN-US;} span.E-MailFormatvorlage17 {mso-style-type:personal-compose; font-family:"Calibri",sans-serif; color:windowtext;} .MsoChpDefault {mso-style-type:export-only; font-family:"Calibri",sans-serif; mso-fareast-language:EN-US;} @page WordSection1 {size:612.0pt 792.0pt; margin:70.85pt 70.85pt 2.0cm 70.85pt;} div.WordSection1 {page:WordSection1;} --></style><!--[if gte mso 9]><xml> <o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" /> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext=3D"edit"> <o:idmap v:ext=3D"edit" data=3D"1" /> </o:shapelayout></xml><![endif]--></head><body lang=3DDE = link=3D"#0563C1" vlink=3D"#954F72" style=3D'word-wrap:break-word'><div = class=3DWordSection1><p class=3DMsoNormal><span lang=3DEN-US>Hello. Is = this feature still being worked on? I’d love to make use of = it!<br><br>Cheers,<br><br>Demis.<o:p></o:p></span></p></div></body></html= > ------=_NextPart_000_000B_01D79814.8F622220--
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH] Add composer build system (PHP) Resent-From: Maxim Cournoyer <maxim.cournoyer@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sat, 16 Oct 2021 04:16:02 +0000 Resent-Message-ID: <handler.42338.B42338.163435772329628 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN> Cc: Julien Lepiller <julien@HIDDEN>, 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.163435772329628 (code B ref 42338); Sat, 16 Oct 2021 04:16:02 +0000 Received: (at 42338) by debbugs.gnu.org; 16 Oct 2021 04:15:23 +0000 Received: from localhost ([127.0.0.1]:40735 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1mbb6Q-0007ho-Fb for submit <at> debbugs.gnu.org; Sat, 16 Oct 2021 00:15:22 -0400 Received: from mail-qk1-f172.google.com ([209.85.222.172]:35421) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <maxim.cournoyer@HIDDEN>) id 1mbb6I-0007hQ-Lz for 42338 <at> debbugs.gnu.org; Sat, 16 Oct 2021 00:15:21 -0400 Received: by mail-qk1-f172.google.com with SMTP id bj31so7651876qkb.2 for <42338 <at> debbugs.gnu.org>; Fri, 15 Oct 2021 21:15:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=eM8VFJ5qe9H68IA252j4Axt08bs4NuuYHisw9ELph/M=; b=QVpQ2gwp24CLcPkSt3U9B4JvCVOYEh9VFGN+0Kxn2SJv09Cwr7jx4fhXtlC73Z3ucW NqpUhhWMvEMAmoeVgMEu0Hrt00Rutg75/6IZ8NmpFslJIv9+j2j6ArTCfM5i2j4eyHq/ TB0qsVEws1YkOUtxM/xzNHhpZ31SXjQKRxVopDRSB6KyPYgqAg0yA/Lqn4/cZ43iEH/u 1n8r5dPWBjl656kCaD4bFoX0gdCQy2cQVPg47W4O+Q0xeI1pcOa9ok97GIk3vgeNbRrG 400aYnX2GJBklTbovc4DwHqJfYaEwyVbQGJEtQZZ/lyvSyfkg11xnO7nJEMg6NGXheYV ksNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=eM8VFJ5qe9H68IA252j4Axt08bs4NuuYHisw9ELph/M=; b=AL3y9SgFMgCr4wqkJmhOazMgTgyIED9lT/+IYcIboPR59/YrShBuBV1cLWJnfoFcXT ep5s3IVXAwkGa+9D7T1hRdMtcLBxLgwMXhrbFEsIgzyZnODPgNvNsMFb5iH1AcKCgL8E BQVj3/pavbbww10w9FjlbxXKjcYcHJ7TdqTeNXH6ohyRZNbHkqhR0hwW0vQlE1l5wvcL 4VohToVOhP22Bmgtn6E5aEoG0GAsXzaoddcHAat79GScsxirjtTpQiiRgaQZoBVr9EKj rlCej88+Abd4IdBZXXek9dbIvD4aXfm5JLqmLI2awlQKq38sfno3eK5x70xxsZcus60Q qP0A== X-Gm-Message-State: AOAM532ilkKH+vHPLCyqpgGrx7PrKQhT6mObODu+JsLZD443x1VdNucs uZw+TjkFeIY7MgJJ1v+UIrhL7FKSxKBmkw== X-Google-Smtp-Source: ABdhPJyzk+/QotSmJrUhCaM75wQSj2ELGVQpJ/qY13QfRUqcfxX59vXKIVeN5XfpTNBSE5K/Ckd1yw== X-Received: by 2002:a37:684a:: with SMTP id d71mr12987466qkc.382.1634357708994; Fri, 15 Oct 2021 21:15:08 -0700 (PDT) Received: from hurd (dsl-10-146-97.b2b2c.ca. [72.10.146.97]) by smtp.gmail.com with ESMTPSA id 6sm3947450qtz.13.2021.10.15.21.15.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Oct 2021 21:15:08 -0700 (PDT) From: Maxim Cournoyer <maxim.cournoyer@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20200712222538.18092-1-julien@HIDDEN> <87mu21heay.fsf@HIDDEN> <20200918004333.127aa5da@HIDDEN> <87sgbf1o5w.fsf@HIDDEN> <20200919012055.1b2e686f@HIDDEN> <87lfgy179m.fsf@HIDDEN> Date: Sat, 16 Oct 2021 00:15:07 -0400 In-Reply-To: <87lfgy179m.fsf@HIDDEN> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Fri, 25 Sep 2020 12:27:01 +0200") Message-ID: <87zgr9k3lg.fsf_-_@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hey Julien, That's a pretty interesting series you have there. Ludovic Court=C3=A8s <ludo@HIDDEN> writes: > Hi Julien, > > Julien Lepiller <julien@HIDDEN> skribis: > >> From 70b9cb2bb389f3e5f9dcc75a44d7d60c28f997bc Mon Sep 17 00:00:00 2001 >> From: Julien Lepiller <julien@HIDDEN> >> Date: Tue, 29 Oct 2019 08:07:38 +0100 >> Subject: [PATCH 01/34] guix: import: Add composer importer. >> >> * guix/import/composer.scm: New file. >> * guix/scripts/import/composer.scm: New file. >> * guix/tests/composer.scm: New file. >> * Makefile.am: Add them. >> * guix/scripts/import.scm: Add composer importer. >> * doc/guix.texi (Invoking guix import): Mention it. > > [...] > >> +@cindex PHP >> +Import metadat from the @uref{https://getcomposer.org/, Composer} packa= ge > ^ > Typo. > >> +(define* (composer-fetch name #:optional version) >> + "Return an alist representation of the Composer metadata for the pack= age NAME, >> +or #f on failure." >> + (let ((package (json-fetch >> + (string-append (%composer-base-url) "/p/" name ".jso= n")))) >> + (if package >> + (let* ((packages (assoc-ref package "packages")) >> + (package (or (assoc-ref packages name) package)) >> + (versions (filter >> + (lambda (version) >> + (and (not (string-contains version "dev")) >> + (not (string-contains version "beta")= ))) >> + (map car package))) >> + (version (or (if (null? version) #f version) >> + (latest-version versions)))) >> + (assoc-ref package version)) >> + #f))) > > I think this should directly return a <composer-package> since the all > the callers pass the alist through =E2=80=98json->composer-package=E2=80= =99. The idea > is that alists should be converted to records as soon as they enter the > process. > > Also it=E2=80=99s weird that =E2=80=98package=E2=80=99 above has a =E2=80= =9Cpackages=E2=80=9D (plural) entry. > Perhaps we=E2=80=99re missing another JSON mapping? > > [...] > >> +++ b/guix/scripts/import/composer.scm >> @@ -0,0 +1,107 @@ >> +;;; GNU Guix --- Functional package management for GNU >> +;;; Copyright =C2=A9 2015 David Thompson <davet@HIDDEN> >> +;;; Copyright =C2=A9 2018 Oleg Pykhalov <go.wigust@HIDDEN> > > You can preserve these two lines if you think it=E2=80=99s relevant, but = I=E2=80=99d > suggest adding one for yourself. > > OK to push with changes along these lines. Seems you were almost ready to roll. Consider this a very gentle ping :-). Maxim
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] Ping about php composer Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sat, 13 Aug 2022 20:39:02 +0000 Resent-Message-ID: <handler.42338.B42338.166042309021307 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: =?UTF-8?Q?M=C3=A1ja_?= =?UTF-8?Q?Tom=C3=A1=C5=A1ek?= <maya.tomasek@HIDDEN>, 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.166042309021307 (code B ref 42338); Sat, 13 Aug 2022 20:39:02 +0000 Received: (at 42338) by debbugs.gnu.org; 13 Aug 2022 20:38:10 +0000 Received: from localhost ([127.0.0.1]:35232 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oMxta-0005Xb-8E for submit <at> debbugs.gnu.org; Sat, 13 Aug 2022 16:38:10 -0400 Received: from lepiller.eu ([89.234.186.109]:47510) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1oMxtX-0005XM-0x for 42338 <at> debbugs.gnu.org; Sat, 13 Aug 2022 16:38:09 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 139ecd2d; Sat, 13 Aug 2022 20:38:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:subject:in-reply-to:references:message-id:mime-version :content-type:content-transfer-encoding; s=dkim; bh=uXiqDph2Tyv2 FqHhGzv7Yv5tCxvzFJaxP6ht/kA18+c=; b=PlMDuUbArMVaOx3WidzHS9uDigIk 9Ag7Ps+w4MCfHE+mf+jX5vZP02Bp4vopHE+0EnF3WN6Ujo6I2T1XOGFsOhnsL9Fv xhUX+rKIVyTAzMzCriqHeo5ThpgQTh+m6He3iRN9okOQiqA2bgPoGI8xsFCJyRpJ hy62s2ELjdbS4myDaqKmsQ/NPbTBw6ifrIjsf9mnCFZ5XoBbY1IlU2/+Km9dFRm7 7mDD4GQCKGvfBC9hI8iNlvUwkzov6gX5YFGi6F/TyLRmdP772YAgGEweh4oEnfV0 CPH9T7hvio8KJ7NawRfQIpZ0jySAsrAZjIM3r84GhcKMaZTUIP1CpnP9FQ== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id bb978372 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Sat, 13 Aug 2022 20:38:02 +0000 (UTC) Date: Sat, 13 Aug 2022 22:38:00 +0200 From: Julien Lepiller <julien@HIDDEN> User-Agent: K-9 Mail for Android In-Reply-To: <87r11jevig.fsf@HIDDEN> References: <87r11jevig.fsf@HIDDEN> Message-ID: <A9377C37-B79F-4498-B737-AF94B05DBFD3@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=----3DDSW0GSYF3S77VW9W5UKE75FL6YTK Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) ------3DDSW0GSYF3S77VW9W5UKE75FL6YTK Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi M=C3=A1ja You're more than welcome to take the patch series to the finish line! I do= n't think I'm able to work on it, but I can answer questions if you have an= y=2E Le 13 ao=C3=BBt 2022 22:30:47 GMT+02:00, "M=C3=A1ja Tom=C3=A1=C5=A1ek" <ma= ya=2Etomasek@disroot=2Eorg> a =C3=A9crit=C2=A0: >Hi, > >I wanted to ask, would you be interested in finishing your php composer >patch to get it pushed? Or if not, can I take you code to the finish >line appyling those last few requests? > >Regards, > >Maya ------3DDSW0GSYF3S77VW9W5UKE75FL6YTK Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable <html><head></head><body>Hi M=C3=A1ja<br><br>You're more than welcome to ta= ke the patch series to the finish line! I don't think I'm able to work on i= t, but I can answer questions if you have any=2E<br><br><div class=3D"gmail= _quote">Le 13 ao=C3=BBt 2022 22:30:47 GMT+02:00, "M=C3=A1ja Tom=C3=A1=C5=A1= ek" <maya=2Etomasek@disroot=2Eorg> a =C3=A9crit=C2=A0:<blockquote cla= ss=3D"gmail_quote" style=3D"margin: 0pt 0pt 0pt 0=2E8ex; border-left: 1px s= olid rgb(204, 204, 204); padding-left: 1ex;"> <pre dir=3D"auto" class=3D"k9mail">Hi,<br><br>I wanted to ask, would you b= e interested in finishing your php composer<br>patch to get it pushed? Or i= f not, can I take you code to the finish<br>line appyling those last few re= quests?<br><br>Regards,<br><br>Maya<br></pre></blockquote></div></body></ht= ml> ------3DDSW0GSYF3S77VW9W5UKE75FL6YTK--
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] Ping about php composer References: <20200713002055.1553f136@HIDDEN> In-Reply-To: <20200713002055.1553f136@HIDDEN> Resent-From: =?UTF-8?Q?M=C3=A1ja_?= =?UTF-8?Q?Tom=C3=A1=C5=A1ek?= <maya.tomasek@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sat, 13 Aug 2022 21:44:02 +0000 Resent-Message-ID: <handler.42338.B42338.166042700827403 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org, julien@HIDDEN Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.166042700827403 (code B ref 42338); Sat, 13 Aug 2022 21:44:02 +0000 Received: (at 42338) by debbugs.gnu.org; 13 Aug 2022 21:43:28 +0000 Received: from localhost ([127.0.0.1]:35281 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oMyui-00077q-SH for submit <at> debbugs.gnu.org; Sat, 13 Aug 2022 17:43:28 -0400 Received: from knopi.disroot.org ([178.21.23.139]:41210) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <maya.tomasek@HIDDEN>) id 1oMxmX-0005Mz-5P for 42338 <at> debbugs.gnu.org; Sat, 13 Aug 2022 16:30:55 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id AD8AD42083; Sat, 13 Aug 2022 22:30:51 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VycjEXMKhbZm; Sat, 13 Aug 2022 22:30:50 +0200 (CEST) From: =?UTF-8?Q?M=C3=A1ja_?= =?UTF-8?Q?Tom=C3=A1=C5=A1ek?= <maya.tomasek@HIDDEN> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1660422650; bh=JKq55v1gSuhnijiDfUbkDigo2WHvS/B2qaKlKKGgrHk=; h=From:To:Subject:Date; b=bzhwMKWW5n+r8Tr59jued5XuWucmwEdI/P6oEUJEAqwGniAce0AGEPZ5u5Zx9aTx0 bhD89twe7A5elHyw9KkhX5wbjN/wClr+TKGjPVIoUMi/5Ls3SqQ59NAyiDWAyJ4zQ7 HHKuv/xCFG26d26MKQ8MrnN4RzdtACG1Xhwrk99Fhj5ASfccgZf3lut+YXO5t00SfJ E8Is+1zEJevnzp3f8/+pdJkQyMLwb8iXNfPZbqP4UPaULGJ3dF6j9ht8aWxeEA66VW YHa1fD7h5eQlidGiSKHVuisvoJ5wRFb6dCI2Fz6/1uzFhz92YzfSGJXQJZCUmIWUD/ UKA8yBcrINjHQ== Date: Sat, 13 Aug 2022 22:30:47 +0200 Message-ID: <87r11jevig.fsf@HIDDEN> Mime-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Mailman-Approved-At: Sat, 13 Aug 2022 17:43:23 -0400 X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hi, I wanted to ask, would you be interested in finishing your php composer patch to get it pushed? Or if not, can I take you code to the finish line appyling those last few requests? Regards, Maya
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH] Add composer build system (PHP) References: <20200713002055.1553f136@HIDDEN> In-Reply-To: <20200713002055.1553f136@HIDDEN> Resent-From: Maxime Devos <maximedevos@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Thu, 06 Oct 2022 16:28:01 +0000 Resent-Message-ID: <handler.42338.B42338.16650736658623 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org, =?UTF-8?Q?M=C3=A1ja_?= =?UTF-8?Q?Tom=C3=A1=C5=A1ek?= <maya.tomasek@HIDDEN> Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.16650736658623 (code B ref 42338); Thu, 06 Oct 2022 16:28:01 +0000 Received: (at 42338) by debbugs.gnu.org; 6 Oct 2022 16:27:45 +0000 Received: from localhost ([127.0.0.1]:33354 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ogTir-0002F1-6e for submit <at> debbugs.gnu.org; Thu, 06 Oct 2022 12:27:45 -0400 Received: from andre.telenet-ops.be ([195.130.132.53]:42756) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <maximedevos@HIDDEN>) id 1ogTio-0002Er-EL for 42338 <at> debbugs.gnu.org; Thu, 06 Oct 2022 12:27:43 -0400 Received: from [192.168.221.79] ([188.188.26.214]) by andre.telenet-ops.be with bizsmtp id UgTc2800E4d9z1G01gTea2; Thu, 06 Oct 2022 18:27:40 +0200 Message-ID: <898f609e-c396-5015-ce7f-93ef284c383d@HIDDEN> Date: Thu, 6 Oct 2022 18:27:36 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Content-Language: en-US From: Maxime Devos <maximedevos@HIDDEN> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------i2HfNy0FyHQ4HlP7EDDDfhQT" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1665073660; bh=uz3O32kB1hBgD2vlBCCcTb+NbS0v5bED8eAgKVpDpSU=; h=Date:To:From:Subject; b=NmZTWgSE3lM+mJe5iVLVFqqqbcdlmSc3OoNa8MAoBL6qW7QruxI7vYlYJJKw5+Txd Ii3ZOf89uJDtRjwh4tBVjCs0UmhCY5l4mLGcCf9Iyvcw8GGOpq2nnUQBb4pGY/aAKZ ylqNjPG4LC9N7RUfwhENojpeDNTC/chnaOBQwLFOFNYDVrnRWFlJ+qyshVBMYUFHGD gE9qWjyJbmXBqlD9+eJR1NhZong7eA5/kSpgZxhb/pSagnmfbvd7b5uyo8YtZAbpvG JCsh4jidS4gaRBV8CDsfgSBT5hWOCacTHbU1Eg/4Dfno9RmjCcksm+l0j1VuNtwBLn wLaA/L2xmXT+g== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------i2HfNy0FyHQ4HlP7EDDDfhQT Content-Type: multipart/mixed; boundary="------------s5mS1c9XXfVgwZrkY9lNdeb9"; protected-headers="v1" From: Maxime Devos <maximedevos@HIDDEN> To: 42338 <at> debbugs.gnu.org, =?UTF-8?B?TcOhamEgVG9tw6HFoWVr?= <maya.tomasek@HIDDEN> Message-ID: <898f609e-c396-5015-ce7f-93ef284c383d@HIDDEN> Subject: Re: [PATCH] Add composer build system (PHP) --------------s5mS1c9XXfVgwZrkY9lNdeb9 Content-Type: multipart/mixed; boundary="------------TxQWKTkT6ZBKH1FjEFIr3PVV" --------------TxQWKTkT6ZBKH1FjEFIr3PVV Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 SGksDQoNCkkgdGhpbmsgSSdsbCBoYXZlIHNvbWUgdGltZSB0byBmaW5pc2ggdGhpcywgYnV0 IGZpcnN0IEknZCBsaWtlIHRvIGFzayBpZiANCnNvbWVvbmUgZWxzZSBoYWQgdGFrZW4gLyBp cyB0YWtpbmcgIGEgc3RhYiBhdCB0aGlzLg0KDQpHcmVldGluZ3MsDQpNYXhpbWUuDQo= --------------TxQWKTkT6ZBKH1FjEFIr3PVV Content-Type: application/pgp-keys; name="OpenPGP_0x49E3EE22191725EE.asc" Content-Disposition: attachment; filename="OpenPGP_0x49E3EE22191725EE.asc" Content-Description: OpenPGP public key Content-Transfer-Encoding: quoted-printable -----BEGIN PGP PUBLIC KEY BLOCK----- xjMEX4ch6BYJKwYBBAHaRw8BAQdANPb/d6MrGnGi5HyvODCkBUJPRjiFQcRU5V+m xvMaAa/NL01heGltZSBEZXZvcyA8bWF4aW1lLmRldm9zQHN0dWRlbnQua3VsZXV2 ZW4uYmU+wpAEExYIADgWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCX4ch6AIbAwUL CQgHAwUVCgkICwUWAgMBAAIeAQIXgAAKCRBJ4+4iGRcl7japAQC3opZ2KGWzWmRc /gIWSu0AAcfMwyinFEEPa/QhUt2CogD/e2RdF4CYAgaRHJJmZ9WU7piKbLZ7llB4 LzgezVDHggzNJU1heGltZSBEZXZvcyA8bWF4aW1lZGV2b3NAdGVsZW5ldC5iZT7C kAQTFggAOBYhBMHzPuIMUo/bfdcBH0nj7iIZFyXuBQJf56ycAhsDBQsJCAcDBRUK CQgLBRYCAwEAAh4BAheAAAoJEEnj7iIZFyXujpQBAKV1SwDDl4f24rXciDlB9L8W ycZt30CgbewMSRQk4mvbAP9dFMbVVixYBd6C8cfhR+NsOBGiOJnQABlUmgNuqGFJ Dc44BF+HIegSCisGAQQBl1UBBQEBB0BOlzIWiJzgobMF6/cqwLaLk7jIcFSZ++c0 k9cCNT6YXwMBCAfCeAQYFggAIBYhBMHzPuIMUo/bfdcBH0nj7iIZFyXuBQJfhyHo AhsMAAoJEEnj7iIZFyXuMr0BAJc8cl5PGvVmVuSQVKjleNl4DK1/XAaPAYPe34AE fZJPAP9IqLCQhH/FeJanHqBP8gNdGNI2qn8RnnLVfRJgUjZ1BA=3D=3D =3DOVqp -----END PGP PUBLIC KEY BLOCK----- --------------TxQWKTkT6ZBKH1FjEFIr3PVV-- --------------s5mS1c9XXfVgwZrkY9lNdeb9-- --------------i2HfNy0FyHQ4HlP7EDDDfhQT Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wnsEABYIACMWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYz8B+AUDAAAAAAAKCRBJ4+4iGRcl7rzU AQDFPOAKIiB/QugMcw1NDSGIG8wm4uz589U1i8ya2cswNAD/WI98MJjZGZiSUC0jSfNxrzbmX0tj pmS2nqJa1orgvws= =egZT -----END PGP SIGNATURE----- --------------i2HfNy0FyHQ4HlP7EDDDfhQT--
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH] Add composer build system (PHP) Resent-From: =?UTF-8?Q?M=C3=A1ja_?= =?UTF-8?Q?Tom=C3=A1=C5=A1ek?= <maya.tomasek@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Tue, 11 Oct 2022 18:11:02 +0000 Resent-Message-ID: <handler.42338.B42338.166551181516806 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos <maximedevos@HIDDEN>, 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.166551181516806 (code B ref 42338); Tue, 11 Oct 2022 18:11:02 +0000 Received: (at 42338) by debbugs.gnu.org; 11 Oct 2022 18:10:15 +0000 Received: from localhost ([127.0.0.1]:54776 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oiJhn-0004N0-57 for submit <at> debbugs.gnu.org; Tue, 11 Oct 2022 14:10:15 -0400 Received: from knopi.disroot.org ([178.21.23.139]:53758) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <maya.tomasek@HIDDEN>) id 1oiJhi-0004Mn-LJ for 42338 <at> debbugs.gnu.org; Tue, 11 Oct 2022 14:10:13 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 0751F4D42C; Tue, 11 Oct 2022 20:10:10 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with UTF8SMTP id TLg6-_NSAmo5; Tue, 11 Oct 2022 20:10:09 +0200 (CEST) From: =?UTF-8?Q?M=C3=A1ja_?= =?UTF-8?Q?Tom=C3=A1=C5=A1ek?= <maya.tomasek@HIDDEN> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1665511661; bh=NPhnBDA+8PZnrATONz/46JPsLFdpgsPTEJ58UO17sD0=; h=From:To:Subject:In-Reply-To:References:Date; b=dwzW74EuEIHC9A+rOR3EJM6P1uAGAiCICbgac+Em+5NYKoYJ9V2shbgVN3qR7f78a jq3Pq2MT6RvohUjGVehUinA7BuXh2rhCdwG7axSauJau25jCJ8rUEUMyqt4NnZktga VfI7y8wVI8qFrAvjbqRkoJLF1S0EIIN1S2JCztKefY7xVYHPVbnK5VT8VuGY/E0RsO dU9HnKHxPKZwC/xheuxLH0A3aF6J7m0Tg/blgpVozQRMcm1ZyXZN28h/61U6tcIjsl K2tIVUV3g70RQLRdrZjXPPF6WRqo3VytCPK2S169iGzLg5jndfOqkfX8siT7RcFqRR q8swXnAflVq7Q== In-Reply-To: <898f609e-c396-5015-ce7f-93ef284c383d@HIDDEN> References: <898f609e-c396-5015-ce7f-93ef284c383d@HIDDEN> Date: Tue, 11 Oct 2022 20:07:40 +0200 Message-ID: <878rlmgro3.fsf@HIDDEN> Mime-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Maxime Devos <maximedevos@HIDDEN> writes: > Hi, > > I think I'll have some time to finish this, but first I'd like to ask if > someone else had taken / is taking a stab at this. > > Greetings, > Maxime. Hi, I have not managed to rebase these patches and sadly I don't have the time for this right now. :/ Maya
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH] Add composer build system (PHP) References: <20200713002055.1553f136@HIDDEN> In-Reply-To: <20200713002055.1553f136@HIDDEN> Resent-From: Adam Faiz <adam.faiz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Fri, 21 Apr 2023 00:25:01 +0000 Resent-Message-ID: <handler.42338.B42338.168203665515348 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Cc: julien@HIDDEN, maximedevos@HIDDEN, maya.tomasek@HIDDEN Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.168203665515348 (code B ref 42338); Fri, 21 Apr 2023 00:25:01 +0000 Received: (at 42338) by debbugs.gnu.org; 21 Apr 2023 00:24:15 +0000 Received: from localhost ([127.0.0.1]:38926 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ppeZQ-0003zR-EY for submit <at> debbugs.gnu.org; Thu, 20 Apr 2023 20:24:14 -0400 Received: from knopi.disroot.org ([178.21.23.139]:53348) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <adam.faiz@HIDDEN>) id 1ppeZM-0003zE-Mb for 42338 <at> debbugs.gnu.org; Thu, 20 Apr 2023 20:24:11 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 0E7224024D; Fri, 21 Apr 2023 02:24:07 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Jc9COhwZBIoB; Fri, 21 Apr 2023 02:24:03 +0200 (CEST) Content-Type: multipart/mixed; boundary="------------8QyPfQMLrvK9wysJ9iPduH1e" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1682036643; bh=29XRtLntyImZ+00BZ0SHS7XxbrqfkhCaWJjWADuLhO4=; h=Date:To:Subject:Cc:From; b=WGdPhfuEcIJAKTdkENYYn91jbCp5+bPbToGu0EIOVbZC4DbYWCvEiryYPe+HN2cy+ RuvU+CIf/v9V1LIwd/1Q4BuCyrls5xVPJOqXdiGFkk1Zu7apLED0QuRoxCFGm3u/Wp a7WIKlLKBANKRTla4/e+i107RTp5UTGBjgO7R3yUypvH7LxvbdeX+YJq/J0mMY9mrR Ymq8LfPIdrwsNBh2xVRcUNGYhjt1vNF+g5Ry76s4U5zM30otlG6BLVz2Tksxxvy67d XO4DyvgTVw/3KOQ4/Dbw79vUMmeso1Z7wKTF6mT6dS6qZBDqMzCZzO/WTatcQKkkZR RcR6hvZxINq5Q== Message-ID: <099bcd2b-ed5b-6d5d-b7cf-c5aeef255c6d@HIDDEN> Date: Fri, 21 Apr 2023 00:23:58 +0000 MIME-Version: 1.0 Content-Language: en-US From: Adam Faiz <adam.faiz@HIDDEN> X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) This is a multi-part message in MIME format. --------------8QyPfQMLrvK9wysJ9iPduH1e Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi, I'm interested in this composer build system so that I can start packaging the NextCloud server and its dependencies. I've rebased the patches and modified them a bit: 1. The composer importer now uses the new inputs style for importing 2. The composer build system uses gexps However, there are a few bugs that I don't know how to fix. The --recursive option of the importer doesn't work: === In guix/scripts/import.scm: 89:11 4 (guix-import . _) In guix/scripts/import/composer.scm:ice-9/boot-9.scm:1685:16: In procedure raise-exception: Throw to key `match-error' with args `("match" "no matching pattern" #<unspecified>)'. 98:17 3 (guix-import-composer . _) In guix/import/utils.scm: 638:27 2 (recursive-import "psr/http-client" # _ #:guix-name _ . #) 630:33 1 (lookup-node "psr/http-client" #f) In ice-9/eval.scm: 423:17 0 (_ . _) ice-9/eval.scm:423:17: In procedure eval: Wrong number of arguments === I think there's something wrong with (define-json-mapping <composer-autoload>: === error: in phase 'install': uncaught exception: match-error "match" "no matching pattern" #<unspecified> In guix/build/gnu-build-system.scm: 927:23 6 (_) In guix/build/composer-build-system.scm: 200:23 5 (install #:inputs _ #:outputs _ #:composer-file _) In ice-9/ports.scm: 433:17 4 (call-with-input-file _ _ #:binary _ #:encoding _ # _) In guix/build/composer-build-system.scm: 56:0 3 (json->composer-package (("config" ("allow-plug…" …)) …)) 52:12 2 (json->composer-autoload (("psr-4" ("Doctrine\\…" . #)))) In ice-9/boot-9.scm: 1685:16 1 (raise-exception _ #:continuable? _) 1685:16 0 (raise-exception _ #:continuable? _) ice-9/boot-9.scm:1685:16: In procedure raise-exception: Throw to key `match-error' with args `("match" "no matching pattern" #<unspecified>)'. === --------------8QyPfQMLrvK9wysJ9iPduH1e Content-Type: text/x-patch; charset=UTF-8; name="0001-guix-import-Add-composer-importer.patch" Content-Disposition: attachment; filename="0001-guix-import-Add-composer-importer.patch" Content-Transfer-Encoding: base64 RnJvbSAwZDQ0ZjhmMWU2NmM0MTQxZDBjOTdhYTJiNjMzMDkxYTBiYjc1M2U1IE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpNZXNzYWdlLUlkOiA8MGQ0NGY4ZjFlNjZjNDE0MWQwYzk3YWEy YjYzMzA5MWEwYmI3NTNlNS4xNjgyMDM0MzQwLmdpdC5hZGFtLmZhaXpAZGlzcm9vdC5vcmc+ CkZyb206IEp1bGllbiBMZXBpbGxlciA8anVsaWVuQGxlcGlsbGVyLmV1PgpEYXRlOiBUaHUs IDIwIEFwciAyMDIzIDA3OjE4OjE4ICswODAwClN1YmplY3Q6IFtQQVRDSCAxLzNdIGd1aXg6 IGltcG9ydDogQWRkIGNvbXBvc2VyIGltcG9ydGVyLgoKKiBndWl4L2ltcG9ydC9jb21wb3Nl ci5zY206IE5ldyBmaWxlLgoqIGd1aXgvc2NyaXB0cy9pbXBvcnQvY29tcG9zZXIuc2NtOiBO ZXcgZmlsZS4KKiBndWl4L3Rlc3RzL2NvbXBvc2VyLnNjbTogTmV3IGZpbGUuCiogTWFrZWZp bGUuYW06IEFkZCB0aGVtLgoqIGd1aXgvc2NyaXB0cy9pbXBvcnQuc2NtOiBBZGQgY29tcG9z ZXIgaW1wb3J0ZXIuCiogZG9jL2d1aXgudGV4aSAoSW52b2tpbmcgZ3VpeCBpbXBvcnQpOiBN ZW50aW9uIGl0LgotLS0KIE1ha2VmaWxlLmFtICAgICAgICAgICAgICAgICAgICAgIHwgICAz ICsKIGRvYy9ndWl4LnRleGkgICAgICAgICAgICAgICAgICAgIHwgIDEyICsrCiBndWl4L2lt cG9ydC9jb21wb3Nlci5zY20gICAgICAgICB8IDI0OCArKysrKysrKysrKysrKysrKysrKysr KysrKysrKysrCiBndWl4L3NjcmlwdHMvaW1wb3J0LnNjbSAgICAgICAgICB8ICAgMiArLQog Z3VpeC9zY3JpcHRzL2ltcG9ydC9jb21wb3Nlci5zY20gfCAxMDcgKysrKysrKysrKysrKwog dGVzdHMvY29tcG9zZXIuc2NtICAgICAgICAgICAgICAgfCAgOTIgKysrKysrKysrKysrCiA2 IGZpbGVzIGNoYW5nZWQsIDQ2MyBpbnNlcnRpb25zKCspLCAxIGRlbGV0aW9uKC0pCiBjcmVh dGUgbW9kZSAxMDA2NDQgZ3VpeC9pbXBvcnQvY29tcG9zZXIuc2NtCiBjcmVhdGUgbW9kZSAx MDA2NDQgZ3VpeC9zY3JpcHRzL2ltcG9ydC9jb21wb3Nlci5zY20KIGNyZWF0ZSBtb2RlIDEw MDY0NCB0ZXN0cy9jb21wb3Nlci5zY20KCmRpZmYgLS1naXQgYS9NYWtlZmlsZS5hbSBiL01h a2VmaWxlLmFtCmluZGV4IDIzYjkzOWI2NzQuLmY5ZGU0YTk2N2EgMTAwNjQ0Ci0tLSBhL01h a2VmaWxlLmFtCisrKyBiL01ha2VmaWxlLmFtCkBAIC0yNzAsNiArMjcwLDcgQEAgTU9EVUxF UyA9CQkJCQlcCiAgIGd1aXgvc2VhcmNoLXBhdGhzLnNjbQkJCQlcCiAgIGd1aXgvcGFja2Fn ZXMuc2NtCQkJCVwKICAgZ3VpeC9pbXBvcnQvY2FiYWwuc2NtCQkJCVwKKyAgZ3VpeC9pbXBv cnQvY29tcG9zZXIuc2NtCQkJXAogICBndWl4L2ltcG9ydC9jcGFuLnNjbQkJCQlcCiAgIGd1 aXgvaW1wb3J0L2NyYW4uc2NtCQkJCVwKICAgZ3VpeC9pbXBvcnQvY3JhdGUuc2NtCQkJCVwK QEAgLTMyNyw2ICszMjgsNyBAQCBNT0RVTEVTID0JCQkJCVwKICAgZ3VpeC9zY3JpcHRzL2hv bWUvaW1wb3J0LnNjbQkJCVwKICAgZ3VpeC9zY3JpcHRzL2xpbnQuc2NtCQkJCVwKICAgZ3Vp eC9zY3JpcHRzL2NoYWxsZW5nZS5zY20JCQlcCisgIGd1aXgvc2NyaXB0cy9pbXBvcnQvY29t cG9zZXIuc2NtCQlcCiAgIGd1aXgvc2NyaXB0cy9pbXBvcnQvY3JhdGUuc2NtCQkJXAogICBn dWl4L3NjcmlwdHMvaW1wb3J0L2NyYW4uc2NtCQkJXAogICBndWl4L3NjcmlwdHMvaW1wb3J0 L2VnZy5zY20gICAJCVwKQEAgLTQ5Miw2ICs0OTQsNyBAQCBTQ01fVEVTVFMgPQkJCQkJXAog ICB0ZXN0cy9jaGFsbGVuZ2Uuc2NtCQkJCVwKICAgdGVzdHMvY2hhbm5lbHMuc2NtCQkJCVwK ICAgdGVzdHMvY29tYmluYXRvcnMuc2NtCQkJXAorICB0ZXN0cy9jb21wb3Nlci5zY20JCQkJ XAogICB0ZXN0cy9jb250YWluZXJzLnNjbQkJCQlcCiAgIHRlc3RzL2NwYW4uc2NtCQkJCVwK ICAgdGVzdHMvY3Bpby5zY20JCQkJXApkaWZmIC0tZ2l0IGEvZG9jL2d1aXgudGV4aSBiL2Rv Yy9ndWl4LnRleGkKaW5kZXggYWRiMTk3NTkzNS4uOWM5ZTU2NzEyMCAxMDA2NDQKLS0tIGEv ZG9jL2d1aXgudGV4aQorKysgYi9kb2MvZ3VpeC50ZXhpCkBAIC0xNDAwOSw2ICsxNDAwOSwx OCBAQCBJbnZva2luZyBndWl4IGltcG9ydAogCiBAZW5kIHRhYmxlCiAKK0BpdGVtIGNvbXBv c2VyCitAY2luZGV4IENvbXBvc2VyCitAY2luZGV4IFBIUAorSW1wb3J0IG1ldGFkYXRhIGZy b20gdGhlIEB1cmVme2h0dHBzOi8vZ2V0Y29tcG9zZXIub3JnLywgQ29tcG9zZXJ9IHBhY2th Z2UKK2FyY2hpdmUgdXNlZCBieSB0aGUgUEhQIGNvbW11bml0eSwgYXMgaW4gdGhpcyBleGFt cGxlOgorCitAZXhhbXBsZQorZ3VpeCBpbXBvcnQgY29tcG9zZXIgcGhwdW5pdC9waHB1bml0 CitAZW5kIGV4YW1wbGUKKworQGVuZCB0YWJsZQorCiBAaXRlbSBnbwogQGNpbmRleCBnbwog SW1wb3J0IG1ldGFkYXRhIGZvciBhIEdvIG1vZHVsZSB1c2luZwpkaWZmIC0tZ2l0IGEvZ3Vp eC9pbXBvcnQvY29tcG9zZXIuc2NtIGIvZ3VpeC9pbXBvcnQvY29tcG9zZXIuc2NtCm5ldyBm aWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAwMDAuLjc1Yzc5MjA5ZWUKLS0tIC9kZXYv bnVsbAorKysgYi9ndWl4L2ltcG9ydC9jb21wb3Nlci5zY20KQEAgLTAsMCArMSwyNDggQEAK Kzs7OyBHTlUgR3VpeCAtLS0gRnVuY3Rpb25hbCBwYWNrYWdlIG1hbmFnZW1lbnQgZm9yIEdO VQorOzs7IENvcHlyaWdodCDCqSAyMDE5IEp1bGllbiBMZXBpbGxlciA8anVsaWVuQGxlcGls bGVyLmV1PgorOzs7Cis7OzsgVGhpcyBmaWxlIGlzIHBhcnQgb2YgR05VIEd1aXguCis7OzsK Kzs7OyBHTlUgR3VpeCBpcyBmcmVlIHNvZnR3YXJlOyB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBp dCBhbmQvb3IgbW9kaWZ5IGl0Cis7OzsgdW5kZXIgdGhlIHRlcm1zIG9mIHRoZSBHTlUgR2Vu ZXJhbCBQdWJsaWMgTGljZW5zZSBhcyBwdWJsaXNoZWQgYnkKKzs7OyB0aGUgRnJlZSBTb2Z0 d2FyZSBGb3VuZGF0aW9uOyBlaXRoZXIgdmVyc2lvbiAzIG9mIHRoZSBMaWNlbnNlLCBvciAo YXQKKzs7OyB5b3VyIG9wdGlvbikgYW55IGxhdGVyIHZlcnNpb24uCis7OzsKKzs7OyBHTlUg R3VpeCBpcyBkaXN0cmlidXRlZCBpbiB0aGUgaG9wZSB0aGF0IGl0IHdpbGwgYmUgdXNlZnVs LCBidXQKKzs7OyBXSVRIT1VUIEFOWSBXQVJSQU5UWTsgd2l0aG91dCBldmVuIHRoZSBpbXBs aWVkIHdhcnJhbnR5IG9mCis7OzsgTUVSQ0hBTlRBQklMSVRZIG9yIEZJVE5FU1MgRk9SIEEg UEFSVElDVUxBUiBQVVJQT1NFLiAgU2VlIHRoZQorOzs7IEdOVSBHZW5lcmFsIFB1YmxpYyBM aWNlbnNlIGZvciBtb3JlIGRldGFpbHMuCis7OzsKKzs7OyBZb3Ugc2hvdWxkIGhhdmUgcmVj ZWl2ZWQgYSBjb3B5IG9mIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZQorOzs7IGFs b25nIHdpdGggR05VIEd1aXguICBJZiBub3QsIHNlZSA8aHR0cDovL3d3dy5nbnUub3JnL2xp Y2Vuc2VzLz4uCisKKyhkZWZpbmUtbW9kdWxlIChndWl4IGltcG9ydCBjb21wb3NlcikKKyAg Izp1c2UtbW9kdWxlIChpY2UtOSBtYXRjaCkKKyAgIzp1c2UtbW9kdWxlIChqc29uKQorICAj OnVzZS1tb2R1bGUgKGdjcnlwdCBoYXNoKQorICAjOnVzZS1tb2R1bGUgKGd1aXggYmFzZTMy KQorICAjOnVzZS1tb2R1bGUgKGd1aXggYnVpbGQgZ2l0KQorICAjOnVzZS1tb2R1bGUgKGd1 aXggYnVpbGQgdXRpbHMpCisgICM6dXNlLW1vZHVsZSAoZ3VpeCBidWlsZC1zeXN0ZW0pCisg ICM6dXNlLW1vZHVsZSAoZ3VpeCBpbXBvcnQganNvbikKKyAgIzp1c2UtbW9kdWxlIChndWl4 IGltcG9ydCB1dGlscykKKyAgIzp1c2UtbW9kdWxlICgoZ3VpeCBsaWNlbnNlcykgIzpwcmVm aXggbGljZW5zZTopCisgICM6dXNlLW1vZHVsZSAoZ3VpeCBwYWNrYWdlcykKKyAgIzp1c2Ut bW9kdWxlIChndWl4IHNlcmlhbGl6YXRpb24pCisgICM6dXNlLW1vZHVsZSAoZ3VpeCB1cHN0 cmVhbSkKKyAgIzp1c2UtbW9kdWxlIChndWl4IHV0aWxzKQorICAjOnVzZS1tb2R1bGUgKHNy Zmkgc3JmaS0xKQorICAjOnVzZS1tb2R1bGUgKHNyZmkgc3JmaS0xMSkKKyAgIzpleHBvcnQg KGNvbXBvc2VyLT5ndWl4LXBhY2thZ2UKKyAgICAgICAgICAgICVjb21wb3Nlci11cGRhdGVy CisgICAgICAgICAgICBjb21wb3Nlci1yZWN1cnNpdmUtaW1wb3J0KSkKKworOzsgWFhYIGFk YXB0ZWQgZnJvbSAoZ3VpeCBzY3JpcHRzIGhhc2gpCisoZGVmaW5lIChmaWxlLWhhc2ggZmls ZSBzZWxlY3Q/IHJlY3Vyc2l2ZT8pCisgIDs7IENvbXB1dGUgdGhlIGhhc2ggb2YgRklMRS4K KyAgKGlmIHJlY3Vyc2l2ZT8KKyAgICAgIChsZXQtdmFsdWVzICgoKHBvcnQgZ2V0LWhhc2gp IChvcGVuLXNoYTI1Ni1wb3J0KSkpCisgICAgICAgICh3cml0ZS1maWxlIGZpbGUgcG9ydCAj OnNlbGVjdD8gc2VsZWN0PykKKyAgICAgICAgKGZvcmNlLW91dHB1dCBwb3J0KQorICAgICAg ICAoZ2V0LWhhc2gpKQorICAgICAgKGNhbGwtd2l0aC1pbnB1dC1maWxlIGZpbGUgcG9ydC1z aGEyNTYpKSkKKworOzsgWFhYIHRha2VuIGZyb20gKGd1aXggc2NyaXB0cyBoYXNoKQorKGRl ZmluZSAodmNzLWZpbGU/IGZpbGUgc3RhdCkKKyAgKGNhc2UgKHN0YXQ6dHlwZSBzdGF0KQor ICAgICgoZGlyZWN0b3J5KQorICAgICAobWVtYmVyIChiYXNlbmFtZSBmaWxlKSAnKCIuYnpy IiAiLmdpdCIgIi5oZyIgIi5zdm4iICJDVlMiKSkpCisgICAgKChyZWd1bGFyKQorICAgICA7 OyBHaXQgc3ViLW1vZHVsZXMgaGF2ZSBhICcuZ2l0JyBmaWxlIHRoYXQgaXMgYSByZWd1bGFy IHRleHQgZmlsZS4KKyAgICAgKHN0cmluZz0/IChiYXNlbmFtZSBmaWxlKSAiLmdpdCIpKQor ICAgIChlbHNlCisgICAgICNmKSkpCisKKyhkZWZpbmUgKGxhdGVzdC12ZXJzaW9uIHZlcnNp b25zKQorICAoZm9sZCAobGFtYmRhIChhIGIpIChpZiAodmVyc2lvbj4/IGEgYikgYSBiKSkg KGNhciB2ZXJzaW9ucykgdmVyc2lvbnMpKQorCisoZGVmaW5lIChmaXgtdmVyc2lvbiB2ZXJz aW9uKQorICAiUmV0dXJuIGEgZml4ZWQgdmVyc2lvbiBmcm9tIGEgdmVyc2lvbiBzdHJpbmcu ICBGb3IgaW5zdGFuY2UsIHYxMC4xIC0+IDEwLjEiCisgIChjb25kCisgICAgKChzdHJpbmct cHJlZml4PyAidmVyc2lvbiIgdmVyc2lvbikKKyAgICAgKGlmIChjaGFyLXNldC1jb250YWlu cz8gY2hhci1zZXQ6ZGlnaXQgKHN0cmluZy1yZWYgdmVyc2lvbiA3KSkKKyAgICAgICAgIChz dWJzdHJpbmcgdmVyc2lvbiA3KQorICAgICAgICAgKHN1YnN0cmluZyB2ZXJzaW9uIDgpKSkK KyAgICAoKHN0cmluZy1wcmVmaXg/ICJ2IiB2ZXJzaW9uKQorICAgICAoc3Vic3RyaW5nIHZl cnNpb24gMSkpCisgICAgKGVsc2UgdmVyc2lvbikpKQorCisoZGVmaW5lKiAoY29tcG9zZXIt ZmV0Y2ggbmFtZSAjOm9wdGlvbmFsIHZlcnNpb24pCisgICJSZXR1cm4gYW4gYWxpc3QgcmVw cmVzZW50YXRpb24gb2YgdGhlIENvbXBvc2VyIG1ldGFkYXRhIGZvciB0aGUgcGFja2FnZSBO QU1FLAorb3IgI2Ygb24gZmFpbHVyZS4iCisgIChsZXQgKChwYWNrYWdlIChqc29uLWZldGNo CisgICAgICAgICAgICAgICAgICAgKHN0cmluZy1hcHBlbmQgImh0dHBzOi8vcmVwby5wYWNr YWdpc3Qub3JnL3AvIiBuYW1lICIuanNvbiIpKSkpCisgICAgKGlmIHBhY2thZ2UKKyAgICAg ICAgKGxldCogKChwYWNrYWdlcyAoYXNzb2MtcmVmIHBhY2thZ2UgInBhY2thZ2VzIikpCisg ICAgICAgICAgICAgICAocGFja2FnZSAoYXNzb2MtcmVmIHBhY2thZ2VzIG5hbWUpKQorICAg ICAgICAgICAgICAgKHZlcnNpb25zIChmaWx0ZXIKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgIChsYW1iZGEgKHZlcnNpb24pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChh bmQgKG5vdCAoc3RyaW5nLWNvbnRhaW5zIHZlcnNpb24gImRldiIpKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIChub3QgKHN0cmluZy1jb250YWlucyB2ZXJzaW9uICJi ZXRhIikpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIChtYXAgY2FyIHBhY2thZ2Up KSkKKyAgICAgICAgICAgICAgICh2ZXJzaW9ucyAobWFwCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAobGFtYmRhICh2ZXJzaW9uKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAoY29ucyAoZml4LXZlcnNpb24gdmVyc2lvbikgdmVyc2lvbikpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICB2ZXJzaW9ucykpCisgICAgICAgICAgICAgICAodmVyc2lvbiAob3Ig KGlmIChudWxsPyB2ZXJzaW9uKSAjZiB2ZXJzaW9uKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgIChsYXRlc3QtdmVyc2lvbiAobWFwIGNhciB2ZXJzaW9ucykpKSkpCisgICAgICAg ICAgKGFzc29jLXJlZiBwYWNrYWdlIChhc3NvYy1yZWYgdmVyc2lvbnMgdmVyc2lvbikpKQor ICAgICAgICAjZikpKQorCisoZGVmaW5lIChwaHAtcGFja2FnZS1uYW1lIG5hbWUpCisgICJH aXZlbiB0aGUgTkFNRSBvZiBhIHBhY2thZ2Ugb24gUGFja2FnaXN0LCByZXR1cm4gYSBHdWl4 LWNvbXBsaWFudCBuYW1lIGZvcgordGhlIHBhY2thZ2UuIgorICAobGV0ICgobmFtZSAoc3Ry aW5nLWpvaW4gKHN0cmluZy1zcGxpdCBuYW1lICNcLykgIi0iKSkpCisgICAgKGlmIChzdHJp bmctcHJlZml4PyAicGhwLSIgbmFtZSkKKyAgICAgICAgKHNuYWtlLWNhc2UgbmFtZSkKKyAg ICAgICAgKHN0cmluZy1hcHBlbmQgInBocC0iIChzbmFrZS1jYXNlIG5hbWUpKSkpKQorCiso ZGVmaW5lIChtYWtlLXBocC1zZXhwIG5hbWUgdmVyc2lvbiBob21lLXBhZ2UgZGVzY3JpcHRp b24gZGVwZW5kZW5jaWVzCisgICAgICAgICAgICAgICAgICAgICAgIGRldi1kZXBlbmRlbmNp ZXMgbGljZW5zZXMgc291cmNlKQorICAiUmV0dXJuIHRoZSBgcGFja2FnZScgcy1leHByZXNz aW9uIGZvciBhIFBIUCBwYWNrYWdlIHdpdGggdGhlIGdpdmVuIE5BTUUsCitWRVJTSU9OLCBI T01FLVBBR0UsIERFU0NSSVBUSU9OLCBERVBFTkRFTkNJRVMsIExJQ0VOU0VTIGFuZCBTT1VS Q0UuIgorICAobGV0ICgoZ2l0PyAoZXF1YWw/IChhc3NvYy1yZWYgc291cmNlICJ0eXBlIikg ImdpdCIpKSkKKyAgICAoKGlmIGdpdD8gY2FsbC13aXRoLXRlbXBvcmFyeS1kaXJlY3Rvcnkg Y2FsbC13aXRoLXRlbXBvcmFyeS1vdXRwdXQtZmlsZSkKKyAgICAgKGxhbWJkYSogKHRlbXAg IzpvcHRpb25hbCBwb3J0KQorICAgICAgIChhbmQgKGlmIGdpdD8KKyAgICAgICAgICAgICAg ICAoYmVnaW4KKyAgICAgICAgICAgICAgICAgIChta2Rpci1wIHRlbXApCisgICAgICAgICAg ICAgICAgICAoZ2l0LWZldGNoIChhc3NvYy1yZWYgc291cmNlICJ1cmwiKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAoYXNzb2MtcmVmIHNvdXJjZSAicmVmZXJlbmNlIikKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcCkpCisgICAgICAgICAgICAgICAgKHVy bC1mZXRjaCAoYXNzb2MtcmVmIHNvdXJjZSAidXJsIikgdGVtcCkpCisgICAgICAgICAgICBg KHBhY2thZ2UKKyAgICAgICAgICAgICAgIChuYW1lICwocGhwLXBhY2thZ2UtbmFtZSBuYW1l KSkKKyAgICAgICAgICAgICAgICh2ZXJzaW9uICx2ZXJzaW9uKQorICAgICAgICAgICAgICAg KHNvdXJjZSAob3JpZ2luCisgICAgICAgICAgICAgICAgICAgICAgICAgLEAoaWYgZ2l0Pwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGAoKG1ldGhvZCBnaXQtZmV0Y2gpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodXJpIChnaXQtcmVmZXJlbmNlCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHVybCAsKGFzc29jLXJl ZiBzb3VyY2UgInVybCIpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIChjb21taXQgLChhc3NvYy1yZWYgc291cmNlICJyZWZlcmVuY2UiKSkpKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKGZpbGUtbmFtZSAoZ2l0LWZpbGUtbmFtZSBu YW1lIHZlcnNpb24pKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHNoYTI1 NgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYmFzZTMyCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLChieXRldmVjdG9yLT5uaXgtYmFzZTMy LXN0cmluZworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGZpbGUt aGFzaCB0ZW1wIChuZWdhdGUgdmNzLWZpbGU/KSAjdCkpKSkpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgYCgobWV0aG9kIHVybC1mZXRjaCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICh1cmkgLChhc3NvYy1yZWYgc291cmNlICJ1cmwiKSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIChzaGEyNTYgKGJhc2UzMiAsKGd1aXgtaGFz aC11cmwgdGVtcCkpKSkpKSkKKyAgICAgICAgICAgICAgIChidWlsZC1zeXN0ZW0gY29tcG9z ZXItYnVpbGQtc3lzdGVtKQorICAgICAgICAgICAgICAgLEAoaWYgKG51bGw/IGRlcGVuZGVu Y2llcykKKyAgICAgICAgICAgICAgICAgICAgICcoKQorICAgICAgICAgICAgICAgICAgICAg YCgoaW5wdXRzCisgICAgICAgICAgICAgICAgICAgICAgICAoLCdsaXN0CisgICAgICAgICAg ICAgICAgICAgICAgICAgLEAobWFwIChsYW1iZGEgKG5hbWUpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBgLChzdHJpbmctPnN5bWJvbCBuYW1lKSkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBkZXBlbmRlbmNpZXMpKSkpKQorICAgICAgICAgICAgICAg LEAoaWYgKG51bGw/IGRldi1kZXBlbmRlbmNpZXMpCisgICAgICAgICAgICAgICAgICAgICAn KCkKKyAgICAgICAgICAgICAgICAgICAgIGAoKG5hdGl2ZS1pbnB1dHMKKyAgICAgICAgICAg ICAgICAgICAgICAgICgsJ2xpc3QKKyAgICAgICAgICAgICAgICAgICAgICAgICAsQChtYXAg KGxhbWJkYSAobmFtZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGAsKHN0 cmluZy0+c3ltYm9sIG5hbWUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRl di1kZXBlbmRlbmNpZXMpKSkpKQorICAgICAgICAgICAgICAgKHN5bm9wc2lzICIiKQorICAg ICAgICAgICAgICAgKGRlc2NyaXB0aW9uICxkZXNjcmlwdGlvbikKKyAgICAgICAgICAgICAg IChob21lLXBhZ2UgLGhvbWUtcGFnZSkKKyAgICAgICAgICAgICAgIChsaWNlbnNlICwobWF0 Y2ggbGljZW5zZXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKSAjZikKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICgobGljZW5zZSkgKGxpY2Vuc2UtPnN5bWJvbCBsaWNl bnNlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIChfIGAobGlzdCAsQChtYXAgbGlj ZW5zZS0+c3ltYm9sIGxpY2Vuc2VzKSkpKSkpKSkpKSkKKworKGRlZmluZSogKGNvbXBvc2Vy LT5ndWl4LXBhY2thZ2UgcGFja2FnZS1uYW1lICM6b3B0aW9uYWwgdmVyc2lvbikKKyAgIkZl dGNoIHRoZSBtZXRhZGF0YSBmb3IgUEFDS0FHRS1OQU1FIGZyb20gcGFja2FnaXN0Lm9yZywg YW5kIHJldHVybiB0aGUKK2BwYWNrYWdlJyBzLWV4cHJlc3Npb24gY29ycmVzcG9uZGluZyB0 byB0aGF0IHBhY2thZ2UsIG9yICNmIG9uIGZhaWx1cmUuIgorICAobGV0ICgocGFja2FnZSAo Y29tcG9zZXItZmV0Y2ggcGFja2FnZS1uYW1lIHZlcnNpb24pKSkKKyAgICAoYW5kIHBhY2th Z2UKKyAgICAgICAgIChsZXQqICgobmFtZSAgICAgICAgIChhc3NvYy1yZWYgcGFja2FnZSAi bmFtZSIpKQorICAgICAgICAgICAgICAgICh2ZXJzaW9uICAgICAgKGZpeC12ZXJzaW9uIChh c3NvYy1yZWYgcGFja2FnZSAidmVyc2lvbiIpKSkKKyAgICAgICAgICAgICAgICAoZGVzY3Jp cHRpb24gIChiZWF1dGlmeS1kZXNjcmlwdGlvbgorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIChhc3NvYy1yZWYgcGFja2FnZSAiZGVzY3JpcHRpb24iKSkpCisgICAgICAgICAg ICAgICAgKGhvbWUtcGFnZSAgICAoYXNzb2MtcmVmIHBhY2thZ2UgImhvbWVwYWdlIikpCisg ICAgICAgICAgICAgICAgKGRlcGVuZGVuY2llcy1uYW1lcyAoZmlsdGVyCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIChsYW1iZGEgKGRlcCkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoc3RyaW5nLWNvbnRhaW5zIGRlcCAiLyIp KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWFwIGNhciAoYXNz b2MtcmVmIHBhY2thZ2UgInJlcXVpcmUiKSkpKQorICAgICAgICAgICAgICAgIChkZXBlbmRl bmNpZXMgKG1hcCBwaHAtcGFja2FnZS1uYW1lIGRlcGVuZGVuY2llcy1uYW1lcykpCisgICAg ICAgICAgICAgICAgKHJlcXVpcmUtZGV2IChhc3NvYy1yZWYgcGFja2FnZSAicmVxdWlyZS1k ZXYiKSkKKyAgICAgICAgICAgICAgICAoZGV2LWRlcGVuZGVuY2llcy1uYW1lcworICAgICAg ICAgICAgICAgICAgKGlmIHJlcXVpcmUtZGV2CisgICAgICAgICAgICAgICAgICAgICAgKGZp bHRlcgorICAgICAgICAgICAgICAgICAgICAgICAgKGxhbWJkYSAoZGVwKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAoc3RyaW5nLWNvbnRhaW5zIGRlcCAiLyIpKQorICAgICAgICAg ICAgICAgICAgICAgICAgKG1hcCBjYXIgcmVxdWlyZS1kZXYpKQorICAgICAgICAgICAgICAg ICAgICAgICcoKSkpCisgICAgICAgICAgICAgICAgKGRldi1kZXBlbmRlbmNpZXMgKG1hcCBw aHAtcGFja2FnZS1uYW1lIGRldi1kZXBlbmRlbmNpZXMtbmFtZXMpKQorICAgICAgICAgICAg ICAgIChsaWNlbnNlcyAgICAgKG1hcCBzdHJpbmctPmxpY2Vuc2UKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgKHZlY3Rvci0+bGlzdAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgKGFzc29jLXJlZiBwYWNrYWdlICJsaWNlbnNlIikpKSkpCisg ICAgICAgICAgICh2YWx1ZXMgKG1ha2UtcGhwLXNleHAgbmFtZSB2ZXJzaW9uIGhvbWUtcGFn ZSBkZXNjcmlwdGlvbiBkZXBlbmRlbmNpZXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBkZXYtZGVwZW5kZW5jaWVzIGxpY2Vuc2VzIChhc3NvYy1yZWYgcGFja2FnZSAi c291cmNlIikpCisgICAgICAgICAgICAgICAgICAgKGFwcGVuZCBkZXBlbmRlbmNpZXMtbmFt ZXMgZGV2LWRlcGVuZGVuY2llcy1uYW1lcykpKSkpKQorCisoZGVmaW5lIChndWl4LW5hbWUt PmNvbXBvc2VyLW5hbWUgbmFtZSkKKyAgIkdpdmVuIGEgZ3VpeCBwYWNrYWdlIG5hbWUsIHJl dHVybiB0aGUgbmFtZSBvZiB0aGUgcGFja2FnZSBpbiBQYWNrYWdpc3QuIgorICAoaWYgKHN0 cmluZy1wcmVmaXg/ICJwaHAtIiBuYW1lKQorICAgICAgKGxldCAoKGNvbXBvbmVudHMgKHN0 cmluZy1zcGxpdCAoc3Vic3RyaW5nIG5hbWUgNCkgI1wtKSkpCisgICAgICAgIChtYXRjaCBj b21wb25lbnRzCisgICAgICAgICAgKChuYW1lc3BhY2UgbmFtZSAuLi4pCisgICAgICAgICAg IChzdHJpbmctYXBwZW5kIG5hbWVzcGFjZSAiLyIgKHN0cmluZy1qb2luIG5hbWUgIi0iKSkp KSkKKyAgICAgIG5hbWUpKQorCisoZGVmaW5lIChndWl4LXBhY2thZ2UtPmNvbXBvc2VyLW5h bWUgcGFja2FnZSkKKyAgIkdpdmVuIGEgQ29tcG9zZXIgUEFDS0FHRSBidWlsdCBmcm9tIFBh Y2thZ2lzdCwgcmV0dXJuIHRoZSBuYW1lIG9mIHRoZQorcGFja2FnZSBpbiBQYWNrYWdpc3Qu IgorICAobGV0ICgodXBzdHJlYW0tbmFtZSAoYXNzb2MtcmVmCisgICAgICAgICAgICAgICAg ICAgICAgICAgKHBhY2thZ2UtcHJvcGVydGllcyBwYWNrYWdlKQorICAgICAgICAgICAgICAg ICAgICAgICAgICd1cHN0cmVhbS1uYW1lKSkKKyAgICAgICAgKG5hbWUgKHBhY2thZ2UtbmFt ZSBwYWNrYWdlKSkpCisgICAgKGlmIHVwc3RyZWFtLW5hbWUKKyAgICAgIHVwc3RyZWFtLW5h bWUKKyAgICAgIChndWl4LW5hbWUtPmNvbXBvc2VyLW5hbWUgbmFtZSkpKSkKKworKGRlZmlu ZSAoc3RyaW5nLT5saWNlbnNlIHN0cikKKyAgIkNvbnZlcnQgdGhlIHN0cmluZyBTVFIgaW50 byBhIGxpY2Vuc2Ugb2JqZWN0LiIKKyAgKG1hdGNoIHN0cgorICAgICgiR05VIExHUEwiIGxp Y2Vuc2U6bGdwbDIuMCkKKyAgICAoIkdQTCIgbGljZW5zZTpncGwzKQorICAgICgob3IgIkJT RCIgIkJTRCBMaWNlbnNlIiAiQlNELTMtQ2xhdXNlIikgbGljZW5zZTpic2QtMykKKyAgICAo KG9yICJNSVQiICJNSVQgbGljZW5zZSIgIkV4cGF0IGxpY2Vuc2UiKSBsaWNlbnNlOmV4cGF0 KQorICAgICgiUHVibGljIGRvbWFpbiIgbGljZW5zZTpwdWJsaWMtZG9tYWluKQorICAgICgo b3IgIkFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCIgIkFwYWNoZSAyLjAiKSBsaWNlbnNl OmFzbDIuMCkKKyAgICAoXyAjZikpKQorCisoZGVmaW5lIChwaHAtcGFja2FnZT8gcGFja2Fn ZSkKKyAgIlJldHVybiB0cnVlIGlmIFBBQ0tBR0UgaXMgYSBQSFAgcGFja2FnZSBmcm9tIFBh Y2thZ2lzdC4iCisgIChhbmQKKyAgICAoZXE/IChidWlsZC1zeXN0ZW0tbmFtZSAocGFja2Fn ZS1idWlsZC1zeXN0ZW0gcGFja2FnZSkpICdjb21wb3NlcikKKyAgICAoc3RyaW5nLXByZWZp eD8gInBocC0iIChwYWNrYWdlLW5hbWUgcGFja2FnZSkpKSkKKworKGRlZmluZSAobGF0ZXN0 LXJlbGVhc2UgcGFja2FnZSkKKyAgIlJldHVybiBhbiA8dXBzdHJlYW0tc291cmNlPiBmb3Ig dGhlIGxhdGVzdCByZWxlYXNlIG9mIFBBQ0tBR0UuIgorICAobGV0KiAoKHBocC1uYW1lIChn dWl4LXBhY2thZ2UtPmNvbXBvc2VyLW5hbWUgcGFja2FnZSkpCisgICAgICAgICAobWV0YWRh dGEgKGNvbXBvc2VyLWZldGNoIHBocC1uYW1lKSkKKyAgICAgICAgICh2ZXJzaW9uIChmaXgt dmVyc2lvbiAoYXNzb2MtcmVmIG1ldGFkYXRhICJ2ZXJzaW9uIikpKQorICAgICAgICAgKHVy bCAoYXNzb2MtcmVmIChhc3NvYy1yZWYgbWV0YWRhdGEgInNvdXJjZSIpICJ1cmwiKSkpCisg ICAgKHVwc3RyZWFtLXNvdXJjZQorICAgICAocGFja2FnZSAocGFja2FnZS1uYW1lIHBhY2th Z2UpKQorICAgICAodmVyc2lvbiB2ZXJzaW9uKQorICAgICAodXJscyAobGlzdCB1cmwpKSkp KQorCisoZGVmaW5lICVjb21wb3Nlci11cGRhdGVyCisgICh1cHN0cmVhbS11cGRhdGVyCisg ICAobmFtZSAnY29tcG9zZXIpCisgICAoZGVzY3JpcHRpb24gIlVwZGF0ZXIgZm9yIENvbXBv c2VyIHBhY2thZ2VzIikKKyAgIChwcmVkIHBocC1wYWNrYWdlPykKKyAgIChpbXBvcnQgbGF0 ZXN0LXJlbGVhc2UpKSkKKworKGRlZmluZSogKGNvbXBvc2VyLXJlY3Vyc2l2ZS1pbXBvcnQg cGFja2FnZS1uYW1lICM6b3B0aW9uYWwgdmVyc2lvbikKKyAgKHJlY3Vyc2l2ZS1pbXBvcnQg cGFja2FnZS1uYW1lICcoKQorICAgICAgICAgICAgICAgICAgICAjOnJlcG8tPmd1aXgtcGFj a2FnZSBjb21wb3Nlci0+Z3VpeC1wYWNrYWdlCisgICAgICAgICAgICAgICAgICAgICM6Z3Vp eC1uYW1lIHBocC1wYWNrYWdlLW5hbWUpKQpkaWZmIC0tZ2l0IGEvZ3VpeC9zY3JpcHRzL2lt cG9ydC5zY20gYi9ndWl4L3NjcmlwdHMvaW1wb3J0LnNjbQppbmRleCBmODRhOTY0YTUzLi5m YTFmOTZkZjljIDEwMDY0NAotLS0gYS9ndWl4L3NjcmlwdHMvaW1wb3J0LnNjbQorKysgYi9n dWl4L3NjcmlwdHMvaW1wb3J0LnNjbQpAQCAtNDcsNyArNDcsNyBAQCAoZGVmaW5lICVzdGFu ZGFyZC1pbXBvcnQtb3B0aW9ucyAnKCkpCiAKIChkZWZpbmUgaW1wb3J0ZXJzICcoImdudSIg InB5cGkiICJjcGFuIiAiaGFja2FnZSIgInN0YWNrYWdlIiAiZWdnIiAiZWxwYSIKICAgICAg ICAgICAgICAgICAgICAgImdlbSIgImdvIiAiY3JhbiIgImNyYXRlIiAidGV4bGl2ZSIgImpz b24iICJvcGFtIgotICAgICAgICAgICAgICAgICAgICAibWluZXRlc3QiICJlbG0iICJoZXhw bSIpKQorICAgICAgICAgICAgICAgICAgICAibWluZXRlc3QiICJlbG0iICJoZXhwbSIgImNv bXBvc2VyIikpCiAKIChkZWZpbmUgKHJlc29sdmUtaW1wb3J0ZXIgbmFtZSkKICAgKGxldCAo KG1vZHVsZSAocmVzb2x2ZS1pbnRlcmZhY2UKZGlmZiAtLWdpdCBhL2d1aXgvc2NyaXB0cy9p bXBvcnQvY29tcG9zZXIuc2NtIGIvZ3VpeC9zY3JpcHRzL2ltcG9ydC9jb21wb3Nlci5zY20K bmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMDAwMC4uNDEyYmFlNjMxOAotLS0g L2Rldi9udWxsCisrKyBiL2d1aXgvc2NyaXB0cy9pbXBvcnQvY29tcG9zZXIuc2NtCkBAIC0w LDAgKzEsMTA3IEBACis7OzsgR05VIEd1aXggLS0tIEZ1bmN0aW9uYWwgcGFja2FnZSBtYW5h Z2VtZW50IGZvciBHTlUKKzs7OyBDb3B5cmlnaHQgwqkgMjAxNSBEYXZpZCBUaG9tcHNvbiA8 ZGF2ZXRAZ251Lm9yZz4KKzs7OyBDb3B5cmlnaHQgwqkgMjAxOCBPbGVnIFB5a2hhbG92IDxn by53aWd1c3RAZ21haWwuY29tPgorOzs7Cis7OzsgVGhpcyBmaWxlIGlzIHBhcnQgb2YgR05V IEd1aXguCis7OzsKKzs7OyBHTlUgR3VpeCBpcyBmcmVlIHNvZnR3YXJlOyB5b3UgY2FuIHJl ZGlzdHJpYnV0ZSBpdCBhbmQvb3IgbW9kaWZ5IGl0Cis7OzsgdW5kZXIgdGhlIHRlcm1zIG9m IHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBhcyBwdWJsaXNoZWQgYnkKKzs7OyB0 aGUgRnJlZSBTb2Z0d2FyZSBGb3VuZGF0aW9uOyBlaXRoZXIgdmVyc2lvbiAzIG9mIHRoZSBM aWNlbnNlLCBvciAoYXQKKzs7OyB5b3VyIG9wdGlvbikgYW55IGxhdGVyIHZlcnNpb24uCis7 OzsKKzs7OyBHTlUgR3VpeCBpcyBkaXN0cmlidXRlZCBpbiB0aGUgaG9wZSB0aGF0IGl0IHdp bGwgYmUgdXNlZnVsLCBidXQKKzs7OyBXSVRIT1VUIEFOWSBXQVJSQU5UWTsgd2l0aG91dCBl dmVuIHRoZSBpbXBsaWVkIHdhcnJhbnR5IG9mCis7OzsgTUVSQ0hBTlRBQklMSVRZIG9yIEZJ VE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFLiAgU2VlIHRoZQorOzs7IEdOVSBHZW5l cmFsIFB1YmxpYyBMaWNlbnNlIGZvciBtb3JlIGRldGFpbHMuCis7OzsKKzs7OyBZb3Ugc2hv dWxkIGhhdmUgcmVjZWl2ZWQgYSBjb3B5IG9mIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGlj ZW5zZQorOzs7IGFsb25nIHdpdGggR05VIEd1aXguICBJZiBub3QsIHNlZSA8aHR0cDovL3d3 dy5nbnUub3JnL2xpY2Vuc2VzLz4uCisKKyhkZWZpbmUtbW9kdWxlIChndWl4IHNjcmlwdHMg aW1wb3J0IGNvbXBvc2VyKQorICAjOnVzZS1tb2R1bGUgKGd1aXggdWkpCisgICM6dXNlLW1v ZHVsZSAoZ3VpeCB1dGlscykKKyAgIzp1c2UtbW9kdWxlIChndWl4IHNjcmlwdHMpCisgICM6 dXNlLW1vZHVsZSAoZ3VpeCBpbXBvcnQgY29tcG9zZXIpCisgICM6dXNlLW1vZHVsZSAoZ3Vp eCBzY3JpcHRzIGltcG9ydCkKKyAgIzp1c2UtbW9kdWxlIChzcmZpIHNyZmktMSkKKyAgIzp1 c2UtbW9kdWxlIChzcmZpIHNyZmktMTEpCisgICM6dXNlLW1vZHVsZSAoc3JmaSBzcmZpLTM3 KQorICAjOnVzZS1tb2R1bGUgKHNyZmkgc3JmaS00MSkKKyAgIzp1c2UtbW9kdWxlIChpY2Ut OSBtYXRjaCkKKyAgIzp1c2UtbW9kdWxlIChpY2UtOSBmb3JtYXQpCisgICM6ZXhwb3J0IChn dWl4LWltcG9ydC1jb21wb3NlcikpCisKKwwKKzs7OworOzs7IENvbW1hbmQtbGluZSBvcHRp b25zLgorOzs7CisKKyhkZWZpbmUgJWRlZmF1bHQtb3B0aW9ucworICAnKCkpCisKKyhkZWZp bmUgKHNob3ctaGVscCkKKyAgKGRpc3BsYXkgKEdfICJVc2FnZTogZ3VpeCBpbXBvcnQgY29t cG9zZXIgUEFDS0FHRS1OQU1FCitJbXBvcnQgYW5kIGNvbnZlcnQgdGhlIENvbXBvc2VyIHBh Y2thZ2UgZm9yIFBBQ0tBR0UtTkFNRS5cbiIpKQorICAoZGlzcGxheSAoR18gIgorICAtaCwg LS1oZWxwICAgICAgICAgICAgIGRpc3BsYXkgdGhpcyBoZWxwIGFuZCBleGl0IikpCisgIChk aXNwbGF5IChHXyAiCisgIC1WLCAtLXZlcnNpb24gICAgICAgICAgZGlzcGxheSB2ZXJzaW9u IGluZm9ybWF0aW9uIGFuZCBleGl0IikpCisgIChkaXNwbGF5IChHXyAiCisgIC1yLCAtLXJl Y3Vyc2l2ZSAgICAgICAgZ2VuZXJhdGUgcGFja2FnZSBleHByZXNzaW9ucyBmb3IgYWxsIENv bXBvc2VyIHBhY2thZ2VzXAorIHRoYXQgYXJlIG5vdCB5ZXQgaW4gR3VpeCIpKQorICAobmV3 bGluZSkKKyAgKHNob3ctYnVnLXJlcG9ydC1pbmZvcm1hdGlvbikpCisKKyhkZWZpbmUgJW9w dGlvbnMKKyAgOzsgU3BlY2lmaWNhdGlvbiBvZiB0aGUgY29tbWFuZC1saW5lIG9wdGlvbnMu CisgIChjb25zKiAob3B0aW9uICcoI1xoICJoZWxwIikgI2YgI2YKKyAgICAgICAgICAgICAg ICAgKGxhbWJkYSBhcmdzCisgICAgICAgICAgICAgICAgICAgKHNob3ctaGVscCkKKyAgICAg ICAgICAgICAgICAgICAoZXhpdCAwKSkpCisgICAgICAgICAob3B0aW9uICcoI1xWICJ2ZXJz aW9uIikgI2YgI2YKKyAgICAgICAgICAgICAgICAgKGxhbWJkYSBhcmdzCisgICAgICAgICAg ICAgICAgICAgKHNob3ctdmVyc2lvbi1hbmQtZXhpdCAiZ3VpeCBpbXBvcnQgY29tcG9zZXIi KSkpCisgICAgICAgICAob3B0aW9uICcoI1xyICJyZWN1cnNpdmUiKSAjZiAjZgorICAgICAg ICAgICAgICAgICAobGFtYmRhIChvcHQgbmFtZSBhcmcgcmVzdWx0KQorICAgICAgICAgICAg ICAgICAgIChhbGlzdC1jb25zICdyZWN1cnNpdmUgI3QgcmVzdWx0KSkpCisgICAgICAgICAl c3RhbmRhcmQtaW1wb3J0LW9wdGlvbnMpKQorCisMCis7OzsKKzs7OyBFbnRyeSBwb2ludC4K Kzs7OworCisoZGVmaW5lIChndWl4LWltcG9ydC1jb21wb3NlciAuIGFyZ3MpCisgIChkZWZp bmUgKHBhcnNlLW9wdGlvbnMpCisgICAgOzsgUmV0dXJuIHRoZSBhbGlzdCBvZiBvcHRpb24g dmFsdWVzLgorICAgIChhcmdzLWZvbGQqIGFyZ3MgJW9wdGlvbnMKKyAgICAgICAgICAgICAg ICAobGFtYmRhIChvcHQgbmFtZSBhcmcgcmVzdWx0KQorICAgICAgICAgICAgICAgICAgKGxl YXZlIChHXyAifkE6IHVucmVjb2duaXplZCBvcHRpb25+JSIpIG5hbWUpKQorICAgICAgICAg ICAgICAgIChsYW1iZGEgKGFyZyByZXN1bHQpCisgICAgICAgICAgICAgICAgICAoYWxpc3Qt Y29ucyAnYXJndW1lbnQgYXJnIHJlc3VsdCkpCisgICAgICAgICAgICAgICAgJWRlZmF1bHQt b3B0aW9ucykpCisKKyAgKGxldCogKChvcHRzIChwYXJzZS1vcHRpb25zKSkKKyAgICAgICAg IChhcmdzIChmaWx0ZXItbWFwIChtYXRjaC1sYW1iZGEKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAoKCdhcmd1bWVudCAuIHZhbHVlKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICB2YWx1ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAoXyAjZikpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAocmV2ZXJzZSBvcHRzKSkpKQorICAgIChtYXRjaCBh cmdzCisgICAgICAoKHBhY2thZ2UtbmFtZSkKKyAgICAgICAoaWYgKGFzc29jLXJlZiBvcHRz ICdyZWN1cnNpdmUpCisgICAgICAgICAgIChtYXAgKG1hdGNoLWxhbWJkYQorICAgICAgICAg ICAgICAgICAgKChhbmQgKCdwYWNrYWdlICgnbmFtZSBuYW1lKSAuIHJlc3QpIHBrZykKKyAg ICAgICAgICAgICAgICAgICBgKGRlZmluZS1wdWJsaWMgLChzdHJpbmctPnN5bWJvbCBuYW1l KQorICAgICAgICAgICAgICAgICAgICAgICxwa2cpKQorICAgICAgICAgICAgICAgICAgKF8g I2YpKQorICAgICAgICAgICAgICAgIChjb21wb3Nlci1yZWN1cnNpdmUtaW1wb3J0IHBhY2th Z2UtbmFtZSkpCisgICAgICAgICAgIChsZXQgKChzZXhwIChjb21wb3Nlci0+Z3VpeC1wYWNr YWdlIHBhY2thZ2UtbmFtZSkpKQorICAgICAgICAgICAgICh1bmxlc3Mgc2V4cAorICAgICAg ICAgICAgICAgKGxlYXZlIChHXyAiZmFpbGVkIHRvIGRvd25sb2FkIG1ldGEtZGF0YSBmb3Ig cGFja2FnZSAnfmEnfiUiKQorICAgICAgICAgICAgICAgICAgICAgIHBhY2thZ2UtbmFtZSkp CisgICAgICAgICAgICAgc2V4cCkpKQorICAgICAgKCgpCisgICAgICAgKGxlYXZlIChHXyAi dG9vIGZldyBhcmd1bWVudHN+JSIpKSkKKyAgICAgICgobWFueSAuLi4pCisgICAgICAgKGxl YXZlIChHXyAidG9vIG1hbnkgYXJndW1lbnRzfiUiKSkpKSkpCmRpZmYgLS1naXQgYS90ZXN0 cy9jb21wb3Nlci5zY20gYi90ZXN0cy9jb21wb3Nlci5zY20KbmV3IGZpbGUgbW9kZSAxMDA2 NDQKaW5kZXggMDAwMDAwMDAwMC4uY2VmYWY5ZjQzNAotLS0gL2Rldi9udWxsCisrKyBiL3Rl c3RzL2NvbXBvc2VyLnNjbQpAQCAtMCwwICsxLDkyIEBACis7OzsgR05VIEd1aXggLS0tIEZ1 bmN0aW9uYWwgcGFja2FnZSBtYW5hZ2VtZW50IGZvciBHTlUKKzs7OyBDb3B5cmlnaHQgwqkg MjAyMCBKdWxpZW4gTGVwaWxsZXIgPGp1bGllbkBsZXBpbGxlci5ldT4KKzs7OworOzs7IFRo aXMgZmlsZSBpcyBwYXJ0IG9mIEdOVSBHdWl4LgorOzs7Cis7OzsgR05VIEd1aXggaXMgZnJl ZSBzb2Z0d2FyZTsgeW91IGNhbiByZWRpc3RyaWJ1dGUgaXQgYW5kL29yIG1vZGlmeSBpdAor Ozs7IHVuZGVyIHRoZSB0ZXJtcyBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2Ug YXMgcHVibGlzaGVkIGJ5Cis7OzsgdGhlIEZyZWUgU29mdHdhcmUgRm91bmRhdGlvbjsgZWl0 aGVyIHZlcnNpb24gMyBvZiB0aGUgTGljZW5zZSwgb3IgKGF0Cis7OzsgeW91ciBvcHRpb24p IGFueSBsYXRlciB2ZXJzaW9uLgorOzs7Cis7OzsgR05VIEd1aXggaXMgZGlzdHJpYnV0ZWQg aW4gdGhlIGhvcGUgdGhhdCBpdCB3aWxsIGJlIHVzZWZ1bCwgYnV0Cis7OzsgV0lUSE9VVCBB TlkgV0FSUkFOVFk7IHdpdGhvdXQgZXZlbiB0aGUgaW1wbGllZCB3YXJyYW50eSBvZgorOzs7 IE1FUkNIQU5UQUJJTElUWSBvciBGSVRORVNTIEZPUiBBIFBBUlRJQ1VMQVIgUFVSUE9TRS4g IFNlZSB0aGUKKzs7OyBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBmb3IgbW9yZSBkZXRh aWxzLgorOzs7Cis7OzsgWW91IHNob3VsZCBoYXZlIHJlY2VpdmVkIGEgY29weSBvZiB0aGUg R05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UKKzs7OyBhbG9uZyB3aXRoIEdOVSBHdWl4LiAg SWYgbm90LCBzZWUgPGh0dHA6Ly93d3cuZ251Lm9yZy9saWNlbnNlcy8+LgorCisoZGVmaW5l LW1vZHVsZSAodGVzdC1jb21wb3NlcikKKyAgIzp1c2UtbW9kdWxlIChndWl4IGltcG9ydCBj b21wb3NlcikKKyAgIzp1c2UtbW9kdWxlIChndWl4IGJhc2UzMikKKyAgIzp1c2UtbW9kdWxl IChnY3J5cHQgaGFzaCkKKyAgIzp1c2UtbW9kdWxlIChndWl4IHRlc3RzIGh0dHApCisgICM6 dXNlLW1vZHVsZSAoZ3VpeCBncmFmdHMpCisgICM6dXNlLW1vZHVsZSAoc3JmaSBzcmZpLTY0 KQorICAjOnVzZS1tb2R1bGUgKHdlYiBjbGllbnQpCisgICM6dXNlLW1vZHVsZSAoaWNlLTkg bWF0Y2gpKQorCis7OyBHbG9iYWxseSBkaXNhYmxlIGdyYWZ0cyBiZWNhdXNlIHRoZXkgY2Fu IHRyaWdnZXIgZWFybHkgYnVpbGRzLgorKCVncmFmdD8gI2YpCisKKyhkZWZpbmUgdGVzdC1q c29uCisgICJ7CisgIFwicGFja2FnZXNcIjogeworICAgIFwiZm9vL2JhclwiOiB7CisgICAg ICBcIjAuMVwiOiB7CisgICAgICAgIFwibmFtZVwiOiBcImZvby9iYXJcIiwKKyAgICAgICAg XCJkZXNjcmlwdGlvblwiOiBcImRlc2NyaXB0aW9uXCIsCisgICAgICAgIFwia2V5d29yZHNc IjogW1widGVzdGluZ1wiXSwKKyAgICAgICAgXCJob21lcGFnZVwiOiBcImh0dHA6Ly9leGFt cGxlLmNvbVwiLAorICAgICAgICBcInZlcnNpb25cIjogXCIwLjFcIiwKKyAgICAgICAgXCJs aWNlbnNlXCI6IFtcIkJTRC0zLUNsYXVzZVwiXSwKKyAgICAgICAgXCJzb3VyY2VcIjogewor ICAgICAgICAgIFwidHlwZVwiOiBcInVybFwiLAorICAgICAgICAgIFwidXJsXCI6IFwiaHR0 cDovL2V4YW1wbGUuY29tL0Jhci0wLjEudGFyLmd6XCIKKyAgICAgICAgfSwKKyAgICAgICAg XCJyZXF1aXJlXCI6IHt9LAorICAgICAgICBcInJlcXVpcmUtZGV2XCI6IHtcInBocHVuaXQv cGhwdW5pdFwiOiBcIjEuMC4wXCJ9CisgICAgICB9CisgICAgfQorICB9Cit9IikKKworKGRl ZmluZSB0ZXN0LXNvdXJjZQorICAiZm9vYmFyIikKKworOzsgQXZvaWQgY29sbGlzaW9ucyB3 aXRoIG90aGVyIHRlc3RzLgorKCVodHRwLXNlcnZlci1wb3J0IDEwNDUwKQorCisodGVzdC1i ZWdpbiAiY29tcG9zZXIiKQorCisodGVzdC1hc3NlcnQgImNvbXBvc2VyLT5ndWl4LXBhY2th Z2UiCisgIDs7IFJlcGxhY2UgbmV0d29yayByZXNvdXJjZXMgd2l0aCBzYW1wbGUgZGF0YS4K KyAgKHdpdGgtaHR0cC1zZXJ2ZXIgYCgoMjAwICx0ZXN0LWpzb24pCisgICAgICAgICAgICAg ICAgICAgICAgKDIwMCAsdGVzdC1zb3VyY2UpKQorICAgIChwYXJhbWV0ZXJpemUgKCglY29t cG9zZXItYmFzZS11cmwgKCVsb2NhbC11cmwpKQorICAgICAgICAgICAgICAgICAgIChjdXJy ZW50LWh0dHAtcHJveHkgKCVsb2NhbC11cmwpKSkKKyAgICAgIChtYXRjaCAoY29tcG9zZXIt Pmd1aXgtcGFja2FnZSAiZm9vL2JhciIpCisgICAgICAgICgoJ3BhY2thZ2UKKyAgICAgICAg ICAgKCduYW1lICJwaHAtZm9vLWJhciIpCisgICAgICAgICAgICgndmVyc2lvbiAiMC4xIikK KyAgICAgICAgICAgKCdzb3VyY2UgKCdvcmlnaW4KKyAgICAgICAgICAgICAgICAgICAgICAo J21ldGhvZCAndXJsLWZldGNoKQorICAgICAgICAgICAgICAgICAgICAgICgndXJpICJodHRw Oi8vZXhhbXBsZS5jb20vQmFyLTAuMS50YXIuZ3oiKQorICAgICAgICAgICAgICAgICAgICAg ICgnc2hhMjU2CisgICAgICAgICAgICAgICAgICAgICAgICgnYmFzZTMyCisgICAgICAgICAg ICAgICAgICAgICAgICAoPyBzdHJpbmc/IGhhc2gpKSkpKQorICAgICAgICAgICAoJ2J1aWxk LXN5c3RlbSAnY29tcG9zZXItYnVpbGQtc3lzdGVtKQorICAgICAgICAgICAoJ25hdGl2ZS1p bnB1dHMKKyAgICAgICAgICAgICgncXVhc2lxdW90ZQorICAgICAgICAgICAgICgoInBocC1w aHB1bml0LXBocHVuaXQiICgndW5xdW90ZSAncGhwLXBocHVuaXQtcGhwdW5pdCkpKSkpCisg ICAgICAgICAgICgnc3lub3BzaXMgIiIpCisgICAgICAgICAgICgnZGVzY3JpcHRpb24gImRl c2NyaXB0aW9uIikKKyAgICAgICAgICAgKCdob21lLXBhZ2UgImh0dHA6Ly9leGFtcGxlLmNv bSIpCisgICAgICAgICAgICgnbGljZW5zZSAnbGljZW5zZTpic2QtMykpCisgICAgICAgICAo c3RyaW5nPT8gKGJ5dGV2ZWN0b3ItPm5peC1iYXNlMzItc3RyaW5nCisgICAgICAgICAgICAg ICAgICAgIChjYWxsLXdpdGgtaW5wdXQtc3RyaW5nIHRlc3Qtc291cmNlIHBvcnQtc2hhMjU2 KSkKKyAgICAgICAgICAgICAgICAgICBoYXNoKSkKKyAgICAgICAgKHgKKyAgICAgICAgIChw ayAnZmFpbCB4ICNmKSkpKSkpCisKKyh0ZXN0LWVuZCAiY29tcG9zZXIiKQoKYmFzZS1jb21t aXQ6IGE5ZjRiNmVjZDAwMTEyYWU0ZmIwNGRmYmUwZjljYzg2YjA0MmRiYzUKLS0gCjIuMzku MgoK --------------8QyPfQMLrvK9wysJ9iPduH1e Content-Type: text/x-patch; charset=UTF-8; name="0002-gnu-Add-composer-classloader.patch" Content-Disposition: attachment; filename="0002-gnu-Add-composer-classloader.patch" Content-Transfer-Encoding: base64 RnJvbSBkODgxNGNjODAzZjI2YzYzYzFjMWFjNTVjNDUxMzIzMjRiMTQ0NmE0IE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpNZXNzYWdlLUlkOiA8ZDg4MTRjYzgwM2YyNmM2M2MxYzFhYzU1 YzQ1MTMyMzI0YjE0NDZhNC4xNjgyMDM0MzQxLmdpdC5hZGFtLmZhaXpAZGlzcm9vdC5vcmc+ CkluLVJlcGx5LVRvOiA8MGQ0NGY4ZjFlNjZjNDE0MWQwYzk3YWEyYjYzMzA5MWEwYmI3NTNl NS4xNjgyMDM0MzQwLmdpdC5hZGFtLmZhaXpAZGlzcm9vdC5vcmc+ClJlZmVyZW5jZXM6IDww ZDQ0ZjhmMWU2NmM0MTQxZDBjOTdhYTJiNjMzMDkxYTBiYjc1M2U1LjE2ODIwMzQzNDAuZ2l0 LmFkYW0uZmFpekBkaXNyb290Lm9yZz4KRnJvbTogSnVsaWVuIExlcGlsbGVyIDxqdWxpZW5A bGVwaWxsZXIuZXU+CkRhdGU6IFRodSwgMjAgQXByIDIwMjMgMDc6MjI6MzcgKzA4MDAKU3Vi amVjdDogW1BBVENIIDIvM10gZ251OiBBZGQgY29tcG9zZXItY2xhc3Nsb2FkZXIuCgoqIGdu dS9wYWNrYWdlcy9waHAteHl6LnNjbTogTmV3IGZpbGUuCiogZ251L2xvY2FsLm1rIChHTlVf U1lTVEVNX01PRFVMRVMpOiBBZGQgaXQuCi0tLQogZ251L2xvY2FsLm1rICAgICAgICAgICAg IHwgIDEgKwogZ251L3BhY2thZ2VzL3BocC14eXouc2NtIHwgNjEgKysrKysrKysrKysrKysr KysrKysrKysrKysrKysrKysrKysrKysrKwogMiBmaWxlcyBjaGFuZ2VkLCA2MiBpbnNlcnRp b25zKCspCiBjcmVhdGUgbW9kZSAxMDA2NDQgZ251L3BhY2thZ2VzL3BocC14eXouc2NtCgpk aWZmIC0tZ2l0IGEvZ251L2xvY2FsLm1rIGIvZ251L2xvY2FsLm1rCmluZGV4IDdmNmVhMDhi OTMuLjAyNWZkNWUwOWIgMTAwNjQ0Ci0tLSBhL2dudS9sb2NhbC5taworKysgYi9nbnUvbG9j YWwubWsKQEAgLTQ5NSw2ICs0OTUsNyBAQCBHTlVfU1lTVEVNX01PRFVMRVMgPQkJCQlcCiAg ICVEJS9wYWNrYWdlcy9waG90by5zY20JCQlcCiAgICVEJS9wYWNrYWdlcy9waGFicmljYXRv ci5zY20gCQkJXAogICAlRCUvcGFja2FnZXMvcGhwLnNjbQkJCQlcCisgICVEJS9wYWNrYWdl cy9waHAteHl6LnNjbQkJCVwKICAgJUQlL3BhY2thZ2VzL3BpZXQuc2NtCQkJXAogICAlRCUv cGFja2FnZXMvcGlrY2hyLnNjbQkJCVwKICAgJUQlL3BhY2thZ2VzL3BrZy1jb25maWcuc2Nt CQkJXApkaWZmIC0tZ2l0IGEvZ251L3BhY2thZ2VzL3BocC14eXouc2NtIGIvZ251L3BhY2th Z2VzL3BocC14eXouc2NtCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAwMDAu LmRhYjY2MGY4NGYKLS0tIC9kZXYvbnVsbAorKysgYi9nbnUvcGFja2FnZXMvcGhwLXh5ei5z Y20KQEAgLTAsMCArMSw2MSBAQAorOzs7IEdOVSBHdWl4IC0tLSBGdW5jdGlvbmFsIHBhY2th Z2UgbWFuYWdlbWVudCBmb3IgR05VCis7OzsgQ29weXJpZ2h0IMKpIDIwMTkgSnVsaWVuIExl cGlsbGVyIDxqdWxpZW5AbGVwaWxsZXIuZXU+Cis7OzsKKzs7OyBUaGlzIGZpbGUgaXMgcGFy dCBvZiBHTlUgR3VpeC4KKzs7OworOzs7IEdOVSBHdWl4IGlzIGZyZWUgc29mdHdhcmU7IHlv dSBjYW4gcmVkaXN0cmlidXRlIGl0IGFuZC9vciBtb2RpZnkgaXQKKzs7OyB1bmRlciB0aGUg dGVybXMgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGFzIHB1Ymxpc2hlZCBi eQorOzs7IHRoZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb247IGVpdGhlciB2ZXJzaW9uIDMg b2YgdGhlIExpY2Vuc2UsIG9yIChhdAorOzs7IHlvdXIgb3B0aW9uKSBhbnkgbGF0ZXIgdmVy c2lvbi4KKzs7OworOzs7IEdOVSBHdWl4IGlzIGRpc3RyaWJ1dGVkIGluIHRoZSBob3BlIHRo YXQgaXQgd2lsbCBiZSB1c2VmdWwsIGJ1dAorOzs7IFdJVEhPVVQgQU5ZIFdBUlJBTlRZOyB3 aXRob3V0IGV2ZW4gdGhlIGltcGxpZWQgd2FycmFudHkgb2YKKzs7OyBNRVJDSEFOVEFCSUxJ VFkgb3IgRklUTkVTUyBGT1IgQSBQQVJUSUNVTEFSIFBVUlBPU0UuICBTZWUgdGhlCis7Ozsg R05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgZm9yIG1vcmUgZGV0YWlscy4KKzs7OworOzs7 IFlvdSBzaG91bGQgaGF2ZSByZWNlaXZlZCBhIGNvcHkgb2YgdGhlIEdOVSBHZW5lcmFsIFB1 YmxpYyBMaWNlbnNlCis7OzsgYWxvbmcgd2l0aCBHTlUgR3VpeC4gIElmIG5vdCwgc2VlIDxo dHRwOi8vd3d3LmdudS5vcmcvbGljZW5zZXMvPi4KKworKGRlZmluZS1tb2R1bGUgKGdudSBw YWNrYWdlcyBwaHAteHl6KQorICAjOnVzZS1tb2R1bGUgKGdudSBwYWNrYWdlcykKKyAgIzp1 c2UtbW9kdWxlIChnbnUgcGFja2FnZXMgcGhwKQorICAjOnVzZS1tb2R1bGUgKGd1aXggcGFj a2FnZXMpCisgICM6dXNlLW1vZHVsZSAoZ3VpeCBkb3dubG9hZCkKKyAgIzp1c2UtbW9kdWxl IChndWl4IGdpdC1kb3dubG9hZCkKKyAgIzp1c2UtbW9kdWxlIChndWl4IGJ1aWxkLXN5c3Rl bSBjb21wb3NlcikKKyAgIzp1c2UtbW9kdWxlIChndWl4IGJ1aWxkLXN5c3RlbSBnbnUpCisg ICM6dXNlLW1vZHVsZSAoZ3VpeCB1dGlscykKKyAgIzp1c2UtbW9kdWxlICgoZ3VpeCBsaWNl bnNlcykgIzpwcmVmaXggbGljZW5zZTopKQorCisoZGVmaW5lLXB1YmxpYyBjb21wb3Nlci1j bGFzc2xvYWRlcgorICAocGFja2FnZQorICAgIChuYW1lICJjb21wb3Nlci1jbGFzc2xvYWRl ciIpCisgICAgKHZlcnNpb24gIjEuOS4wIikKKyAgICAoc291cmNlIChvcmlnaW4KKyAgICAg ICAgICAgICAgKG1ldGhvZCBnaXQtZmV0Y2gpCisgICAgICAgICAgICAgICh1cmkgKGdpdC1y ZWZlcmVuY2UKKyAgICAgICAgICAgICAgICAgICAgICh1cmwgImh0dHBzOi8vZ2l0aHViLmNv bS9jb21wb3Nlci9jb21wb3Nlci5naXQiKQorICAgICAgICAgICAgICAgICAgICAgKGNvbW1p dCB2ZXJzaW9uKSkpCisgICAgICAgICAgICAgIChmaWxlLW5hbWUgKGdpdC1maWxlLW5hbWUg bmFtZSB2ZXJzaW9uKSkKKyAgICAgICAgICAgICAgKHNoYTI1NgorICAgICAgICAgICAgICAg KGJhc2UzMgorICAgICAgICAgICAgICAgICIwMTI3em1tZzN5eDg0bGpuZ2ZzODZxN2tqaHl5 cHlia2Y0ZDFpaGZyZm56Z3luenhmeGRmIikpKSkKKyAgICAoYnVpbGQtc3lzdGVtIGdudS1i dWlsZC1zeXN0ZW0pCisgICAgKGFyZ3VtZW50cworICAgICBgKCM6cGhhc2VzCisgICAgICAg KG1vZGlmeS1waGFzZXMgJXN0YW5kYXJkLXBoYXNlcworICAgICAgICAgKGRlbGV0ZSAnY29u ZmlndXJlKQorICAgICAgICAgKGRlbGV0ZSAnYnVpbGQpCisgICAgICAgICAoZGVsZXRlICdj aGVjaykKKyAgICAgICAgIChyZXBsYWNlICdpbnN0YWxsCisgICAgICAgICAgIChsYW1iZGEq ICgjOmtleSBvdXRwdXRzICM6YWxsb3ctb3RoZXIta2V5cykKKyAgICAgICAgICAgICAobGV0 KiAoKG91dCAoYXNzb2MtcmVmIG91dHB1dHMgIm91dCIpKQorICAgICAgICAgICAgICAgICAg ICAoaW5zdGFsbCAoc3RyaW5nLWFwcGVuZCBvdXQgIi9zaGFyZS93ZWIvY29tcG9zZXIvQ2xh c3NMb2FkZXIucGhwIikpKQorICAgICAgICAgICAgICAgKG1rZGlyLXAgKGRpcm5hbWUgaW5z dGFsbCkpCisgICAgICAgICAgICAgICAoY29weS1maWxlICJzcmMvQ29tcG9zZXIvQXV0b2xv YWQvQ2xhc3NMb2FkZXIucGhwIiBpbnN0YWxsKSkpKSkpKQorICAgIChob21lLXBhZ2UgImh0 dHBzOi8vZ2V0Y29tcG9zZXIub3JnIikKKyAgICAoc3lub3BzaXMgIlBIUCBjbGFzcyBsb2Fk ZXIgZXh0cmFjdGVkIGZyb20gdGhlIGNvbXBvc2VyIHBhY2thZ2UiKQorICAgIChkZXNjcmlw dGlvbiAiVGhpcyBwYWNrYWdlIGNvbnRhaW5zIHRoZSBjbGFzcyBsb2FkZXIgY2xhc3MgdXNl ZCBieSBDb21wb3NlciB0bworYnVpbGQgaXRzIGF1dG9sb2FkaW5nIGZlYXR1cmUuICBUaGlz IHBhY2thZ2UgaXMgdXNlZCBieSB0aGUgY29tcG9zZXItYnVpbGQtc3lzdGVtCit0byBidWls ZCBpdHMgb3duIHN0b3JlLWF3YXJlIGF1dG9sb2FkaW5nIGZlYXR1cmUuIikKKyAgICAobGlj ZW5zZSBsaWNlbnNlOmV4cGF0KSkpCi0tIAoyLjM5LjIKCg== --------------8QyPfQMLrvK9wysJ9iPduH1e Content-Type: text/x-patch; charset=UTF-8; name="0003-guix-Add-composer-build-system.patch" Content-Disposition: attachment; filename="0003-guix-Add-composer-build-system.patch" Content-Transfer-Encoding: base64 RnJvbSA1NzU5NjdlNWEzNGIzOTc0OTVlOGUxOGZlZThiYTMyMmNiNjIzMjFhIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpNZXNzYWdlLUlkOiA8NTc1OTY3ZTVhMzRiMzk3NDk1ZThlMThm ZWU4YmEzMjJjYjYyMzIxYS4xNjgyMDM0MzQxLmdpdC5hZGFtLmZhaXpAZGlzcm9vdC5vcmc+ CkluLVJlcGx5LVRvOiA8MGQ0NGY4ZjFlNjZjNDE0MWQwYzk3YWEyYjYzMzA5MWEwYmI3NTNl NS4xNjgyMDM0MzQwLmdpdC5hZGFtLmZhaXpAZGlzcm9vdC5vcmc+ClJlZmVyZW5jZXM6IDww ZDQ0ZjhmMWU2NmM0MTQxZDBjOTdhYTJiNjMzMDkxYTBiYjc1M2U1LjE2ODIwMzQzNDAuZ2l0 LmFkYW0uZmFpekBkaXNyb290Lm9yZz4KRnJvbTogSnVsaWVuIExlcGlsbGVyIDxqdWxpZW5A bGVwaWxsZXIuZXU+CkRhdGU6IFRodSwgMjAgQXByIDIwMjMgMDc6MzI6NDggKzA4MDAKU3Vi amVjdDogW1BBVENIIDMvM10gZ3VpeDogQWRkIGNvbXBvc2VyLWJ1aWxkLXN5c3RlbS4KCiog Z3VpeC9idWlsZC1zeXN0ZW0vY29tcG9zZXIuc2NtOiBOZXcgZmlsZS4KKiBndWl4L2J1aWxk L2NvbXBvc2VyLWJ1aWxkLXN5c3RlbS5zY206IE5ldyBmaWxlLgoqIGdudS9wYWNrYWdlcy9h dXgtZmlsZXMvZmluZGNsYXNzLnBocDogTmV3IGZpbGUuCiogTWFrZWZpbGUuYW06IEFkZCB0 aGVtLgoqIGRvYy9ndWl4LnRleGkgKEJ1aWxkIFN5c3RlbXMpOiBEb2N1bWVudCBpdC4KLS0t CiBNYWtlZmlsZS5hbSAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgIDYgKy0KIGRvYy9n dWl4LnRleGkgICAgICAgICAgICAgICAgICAgICAgICB8ICAxNCArKwogZ251L3BhY2thZ2Vz L2F1eC1maWxlcy9maW5kY2xhc3MucGhwIHwgMTI1ICsrKysrKysrKysrKysrCiBndWl4L2J1 aWxkLXN5c3RlbS9jb21wb3Nlci5zY20gICAgICAgfCAxNjIgKysrKysrKysrKysrKysrKysr CiBndWl4L2J1aWxkL2NvbXBvc2VyLWJ1aWxkLXN5c3RlbS5zY20gfCAyMzkgKysrKysrKysr KysrKysrKysrKysrKysrKysrCiA1IGZpbGVzIGNoYW5nZWQsIDU0NSBpbnNlcnRpb25zKCsp LCAxIGRlbGV0aW9uKC0pCiBjcmVhdGUgbW9kZSAxMDA2NDQgZ251L3BhY2thZ2VzL2F1eC1m aWxlcy9maW5kY2xhc3MucGhwCiBjcmVhdGUgbW9kZSAxMDA2NDQgZ3VpeC9idWlsZC1zeXN0 ZW0vY29tcG9zZXIuc2NtCiBjcmVhdGUgbW9kZSAxMDA2NDQgZ3VpeC9idWlsZC9jb21wb3Nl ci1idWlsZC1zeXN0ZW0uc2NtCgpkaWZmIC0tZ2l0IGEvTWFrZWZpbGUuYW0gYi9NYWtlZmls ZS5hbQppbmRleCBmOWRlNGE5NjdhLi5kYmYyMzM2MDI1IDEwMDY0NAotLS0gYS9NYWtlZmls ZS5hbQorKysgYi9NYWtlZmlsZS5hbQpAQCAtMTQ3LDYgKzE0Nyw3IEBAIE1PRFVMRVMgPQkJ CQkJXAogICBndWl4L2J1aWxkLXN5c3RlbS9jaGlja2VuLnNjbQkJCVwKICAgZ3VpeC9idWls ZC1zeXN0ZW0vY2xvanVyZS5zY20JCQlcCiAgIGd1aXgvYnVpbGQtc3lzdGVtL2NtYWtlLnNj bQkJCVwKKyAgZ3VpeC9idWlsZC1zeXN0ZW0vY29tcG9zZXIuc2NtCQlcCiAgIGd1aXgvYnVp bGQtc3lzdGVtL2R1Yi5zY20JCQlcCiAgIGd1aXgvYnVpbGQtc3lzdGVtL2R1bmUuc2NtCQkJ XAogICBndWl4L2J1aWxkLXN5c3RlbS9lbG0uc2NtCQkJXApAQCAtMjAyLDYgKzIwMyw3IEBA IE1PRFVMRVMgPQkJCQkJXAogICBndWl4L2J1aWxkL2NhcmdvLXV0aWxzLnNjbQkJCVwKICAg Z3VpeC9idWlsZC9jaGlja2VuLWJ1aWxkLXN5c3RlbS5zY20JCVwKICAgZ3VpeC9idWlsZC9j bWFrZS1idWlsZC1zeXN0ZW0uc2NtCQlcCisgIGd1aXgvYnVpbGQvY29tcG9zZXItYnVpbGQt c3lzdGVtLnNjbQkJXAogICBndWl4L2J1aWxkL2R1Yi1idWlsZC1zeXN0ZW0uc2NtCQlcCiAg IGd1aXgvYnVpbGQvZHVuZS1idWlsZC1zeXN0ZW0uc2NtCQlcCiAgIGd1aXgvYnVpbGQvZWxt LWJ1aWxkLXN5c3RlbS5zY20JCVwKQEAgLTQzOCw3ICs0NDAsOSBAQCBBVVhfRklMRVMgPQkJ CQkJCVwKICAgZ251L3BhY2thZ2VzL2F1eC1maWxlcy9weXRob24vc2FuaXR5LWNoZWNrLW5l eHQucHkJXAogICBnbnUvcGFja2FnZXMvYXV4LWZpbGVzL3B5dGhvbi9zaXRlY3VzdG9taXpl LnB5CVwKICAgZ251L3BhY2thZ2VzL2F1eC1maWxlcy9yZW5weS9yZW5weS5pbglcCi0gIGdu dS9wYWNrYWdlcy9hdXgtZmlsZXMvcnVuLWluLW5hbWVzcGFjZS5jCisgIGdudS9wYWNrYWdl cy9hdXgtZmlsZXMvcnVuLWluLW5hbWVzcGFjZS5jCVwKKyAgZ251L3BhY2thZ2VzL2F1eC1m aWxlcy9maW5kY2xhc3MucGhwCisKIAogIyBUZW1wbGF0ZXMsIGV4YW1wbGVzLgogRVhBTVBM RVMgPQkJCQkJXApkaWZmIC0tZ2l0IGEvZG9jL2d1aXgudGV4aSBiL2RvYy9ndWl4LnRleGkK aW5kZXggOWM5ZTU2NzEyMC4uMTNmNGY3NDAxYyAxMDA2NDQKLS0tIGEvZG9jL2d1aXgudGV4 aQorKysgYi9kb2MvZ3VpeC50ZXhpCkBAIC05MTczLDYgKzkxNzMsMjAgQEAgQnVpbGQgU3lz dGVtcwogQGNvZGV7LU8yIC1nfSwgYXMgaXMgdGhlIGNhc2UgZm9yIEF1dG9jb25mLWJhc2Vk IHBhY2thZ2VzIGJ5IGRlZmF1bHQuCiBAZW5kIGRlZnZhcgogCitAZGVmdmFyIHtTY2hlbWUg VmFyaWFibGV9IGNvbXBvc2VyLWJ1aWxkLXN5c3RlbQorVGhpcyB2YXJpYWJsZSBpcyBleHBv cnRlZCBieSBAY29kZXsoZ3VpeCBidWlsZC1zeXN0ZW0gY29tcG9zZXIpfS4gIEl0CitpbXBs ZW1lbnRzIHRoZSBidWlsZCBwcm9jZWR1cmUgZm9yIHBhY2thZ2VzIHVzaW5nCitAdXJse2h0 dHBzOi8vZ2V0Y29tcG9zZXIub3JnLywgQ29tcG9zZXJ9LCB0aGUgUEhQIHBhY2thZ2UgbWFu YWdlci4KKworSXQgYXV0b21hdGljYWxseSBhZGRzIHRoZSBAY29kZXtwaHB9IHBhY2thZ2Ug dG8gdGhlIHNldCBvZiBpbnB1dHMuICBXaGljaAorcGFja2FnZSBpcyB1c2VkIGNhbiBiZSBz cGVjaWZpZWQgd2l0aCB0aGUgQGNvZGV7IzpwaHB9IHBhcmFtZXRlci4KKworVGhlIEBjb2Rl eyM6dGVzdC10YXJnZXR9IHBhcmFtZXRlciBpcyB1c2VkIHRvIGNvbnRyb2wgd2hpY2ggc2Ny aXB0IGlzIHJ1bgorZm9yIHRoZSB0ZXN0cy4gIEJ5IGRlZmF1bHQsIHRoZSBAY29kZXt0ZXN0 fSBzY3JpcHQgaXMgcnVuIGlmIGl0IGV4aXN0cy4gIElmCit0aGUgc2NyaXB0IGRvZXMgbm90 IGV4aXN0LCB0aGUgYnVpbGQgc3lzdGVtIHdpbGwgcnVuIEBjb2Rle3BocHVuaXR9IGZyb20g dGhlCitzb3VyY2UgZGlyZWN0b3J5LCBhc3N1bWluZyB0aGVyZSBpcyBhIEBmaWxle3BocHVu aXQueG1sfSBmaWxlLgorQGVuZCBkZWZ2YXIKKwogQGRlZnZhciBkdW5lLWJ1aWxkLXN5c3Rl bQogVGhpcyB2YXJpYWJsZSBpcyBleHBvcnRlZCBieSBAY29kZXsoZ3VpeCBidWlsZC1zeXN0 ZW0gZHVuZSl9LiAgSXQKIHN1cHBvcnRzIGJ1aWxkcyBvZiBwYWNrYWdlcyB1c2luZyBAdXJl ZntodHRwczovL2R1bmUuYnVpbGQvLCBEdW5lfSwgYSBidWlsZApkaWZmIC0tZ2l0IGEvZ251 L3BhY2thZ2VzL2F1eC1maWxlcy9maW5kY2xhc3MucGhwIGIvZ251L3BhY2thZ2VzL2F1eC1m aWxlcy9maW5kY2xhc3MucGhwCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAw MDAuLmQwYjI1MGM4ZTEKLS0tIC9kZXYvbnVsbAorKysgYi9nbnUvcGFja2FnZXMvYXV4LWZp bGVzL2ZpbmRjbGFzcy5waHAKQEAgLTAsMCArMSwxMjUgQEAKKzw/cGhwCisvKioKKyAqIFRo ZSBjb250ZW50IG9mIHRoaXMgZmlsZSBpcyBjb3BpZWQgZnJvbSBjb21wb3NlcidzIHNyYy9D b21wb3Nlci9BdXRvbG9hZC9DbGFzc01hcEdlbmVyYXRvci5waHAKKyAqIHRoZSBmaW5kQ2xh c3NlcyBtZXRob2Qgd2FzIGV4dHJhY3RlZCwgdG8gcHJldmVudCB1c2luZyBhbnkgZGVwZW5k ZW5jeS4KKyAqCisgKiBDb21wb3NlciAoYW5kIHRodXMgdGhpcyBmaWxlKSBpcyBkaXN0cmli dXRlZCB1bmRlciB0aGUgZXhwYXQgbGljZW5zZSwgYW5kCisgKiBDbGFzc01hcEdlbmVyYXRv ci5waHAgYWxzbyBjb250YWlucyB0aGlzIG5vdGljZToKKyAqCisgKiAgIFRoaXMgZmlsZSBp cyBwYXJ0IG9mIENvbXBvc2VyLgorICoKKyAqICAgKGMpIE5pbHMgQWRlcm1hbm4gPG5hZGVy bWFuQG5hZGVybWFuLmRlPgorICogICAgICAgSm9yZGkgQm9nZ2lhbm8gPGouYm9nZ2lhbm9A c2VsZC5iZT4KKyAqCisgKiAgIEZvciB0aGUgZnVsbCBjb3B5cmlnaHQgYW5kIGxpY2Vuc2Ug aW5mb3JtYXRpb24sIHBsZWFzZSB2aWV3IHRoZSBMSUNFTlNFCisgKiAgIGZpbGUgdGhhdCB3 YXMgZGlzdHJpYnV0ZWQgd2l0aCB0aGlzIHNvdXJjZSBjb2RlLgorICoKKyAqICAgVGhpcyBm aWxlIGlzIGNvcGllZCBmcm9tIHRoZSBTeW1mb255IHBhY2thZ2UuCisgKgorICogICAoYykg RmFiaWVuIFBvdGVuY2llciA8ZmFiaWVuQHN5bWZvbnkuY29tPgorICogCisgKiBUbyB0aGUg ZXh0ZW50IHRvIHdpY2ggaXQgbWFrZXMgc2Vuc2UsIGFzIHRoZSBhdXRob3Igb2YgdGhlIGV4 dHJhY3Q6CisgKiBDb3B5cmlnaHQgwqkgMjAyMCBKdWxpZW4gTGVwaWxsZXIgPGp1bGllbkBs ZXBpbGxlci5ldT4KKyAqLworCisvKioKKyAqIEV4dHJhY3QgdGhlIGNsYXNzZXMgaW4gdGhl IGdpdmVuIGZpbGUKKyAqCisgKiBAcGFyYW0gIHN0cmluZyAgICAgICAgICAgICRwYXRoIFRo ZSBmaWxlIHRvIGNoZWNrCisgKiBAdGhyb3dzIFxSdW50aW1lRXhjZXB0aW9uCisgKiBAcmV0 dXJuIGFycmF5ICAgICAgICAgICAgIFRoZSBmb3VuZCBjbGFzc2VzCisgKi8KK2Z1bmN0aW9u IGZpbmRDbGFzc2VzKCRwYXRoKQoreworICAgICRleHRyYVR5cGVzID0gUEhQX1ZFUlNJT05f SUQgPCA1MDQwMCA/ICcnIDogJ3x0cmFpdCc7CisgICAgaWYgKGRlZmluZWQoJ0hIVk1fVkVS U0lPTicpICYmIHZlcnNpb25fY29tcGFyZShISFZNX1ZFUlNJT04sICczLjMnLCAnPj0nKSkg eworICAgICAgICAkZXh0cmFUeXBlcyAuPSAnfGVudW0nOworICAgIH0KKyAgICAvLyBVc2Ug QCBoZXJlIGluc3RlYWQgb2YgU2lsZW5jZXIgdG8gYWN0aXZlbHkgc3VwcHJlc3MgJ3VuaGVs cGZ1bCcgb3V0cHV0CisgICAgLy8gQGxpbmsgaHR0cHM6Ly9naXRodWIuY29tL2NvbXBvc2Vy L2NvbXBvc2VyL3B1bGwvNDg4NgorICAgICRjb250ZW50cyA9IEBwaHBfc3RyaXBfd2hpdGVz cGFjZSgkcGF0aCk7CisgICAgaWYgKCEkY29udGVudHMpIHsKKyAgICAgICAgaWYgKCFmaWxl X2V4aXN0cygkcGF0aCkpIHsKKyAgICAgICAgICAgICRtZXNzYWdlID0gJ0ZpbGUgYXQgIiVz IiBkb2VzIG5vdCBleGlzdCwgY2hlY2sgeW91ciBjbGFzc21hcCBkZWZpbml0aW9ucyc7Cisg ICAgICAgIH0gZWxzZWlmICghaXNfcmVhZGFibGUoJHBhdGgpKSB7CisgICAgICAgICAgICAk bWVzc2FnZSA9ICdGaWxlIGF0ICIlcyIgaXMgbm90IHJlYWRhYmxlLCBjaGVjayBpdHMgcGVy bWlzc2lvbnMnOworICAgICAgICB9IGVsc2VpZiAoJycgPT09IHRyaW0oZmlsZV9nZXRfY29u dGVudHMoJHBhdGgpKSkgeworICAgICAgICAgICAgLy8gVGhlIGlucHV0IGZpbGUgd2FzIHJl YWxseSBlbXB0eSBhbmQgdGh1cyBjb250YWlucyBubyBjbGFzc2VzCisgICAgICAgICAgICBy ZXR1cm4gYXJyYXkoKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICRtZXNzYWdl ID0gJ0ZpbGUgYXQgIiVzIiBjb3VsZCBub3QgYmUgcGFyc2VkIGFzIFBIUCwgaXQgbWF5IGJl IGJpbmFyeSBvciBjb3JydXB0ZWQnOworICAgICAgICB9CisgICAgICAgICRlcnJvciA9IGVy cm9yX2dldF9sYXN0KCk7CisgICAgICAgIGlmIChpc3NldCgkZXJyb3JbJ21lc3NhZ2UnXSkp IHsKKyAgICAgICAgICAgICRtZXNzYWdlIC49IFBIUF9FT0wgLiAnVGhlIGZvbGxvd2luZyBt ZXNzYWdlIG1heSBiZSBoZWxwZnVsOicgLiBQSFBfRU9MIC4gJGVycm9yWydtZXNzYWdlJ107 CisgICAgICAgIH0KKyAgICAgICAgdGhyb3cgbmV3IFxSdW50aW1lRXhjZXB0aW9uKHNwcmlu dGYoJG1lc3NhZ2UsICRwYXRoKSk7CisgICAgfQorICAgIC8vIHJldHVybiBlYXJseSBpZiB0 aGVyZSBpcyBubyBjaGFuY2Ugb2YgbWF0Y2hpbmcgYW55dGhpbmcgaW4gdGhpcyBmaWxlCisg ICAgaWYgKCFwcmVnX21hdGNoKCd7XGIoPzpjbGFzc3xpbnRlcmZhY2UnLiRleHRyYVR5cGVz LicpXHN9aScsICRjb250ZW50cykpIHsKKyAgICAgICAgcmV0dXJuIGFycmF5KCk7CisgICAg fQorICAgIC8vIHN0cmlwIGhlcmVkb2NzL25vd2RvY3MKKyAgICAkY29udGVudHMgPSBwcmVn X3JlcGxhY2UoJ3s8PDxbIFx0XSooW1wnIl0/KShcdyspXFwxKD86XHJcbnxcbnxccikoPzou Kj8pKD86XHJcbnxcbnxccikoPzpccyopXFwyKD89XHMrfFs7LC4pXSl9cycsICdudWxsJywg JGNvbnRlbnRzKTsKKyAgICAvLyBzdHJpcCBzdHJpbmdzCisgICAgJGNvbnRlbnRzID0gcHJl Z19yZXBsYWNlKCd7IlteIlxcXFxdKisoXFxcXC5bXiJcXFxcXSorKSorInxcJ1teXCdcXFxc XSorKFxcXFwuW15cJ1xcXFxdKispKitcJ31zJywgJ251bGwnLCAkY29udGVudHMpOworICAg IC8vIHN0cmlwIGxlYWRpbmcgbm9uLXBocCBjb2RlIGlmIG5lZWRlZAorICAgIGlmIChzdWJz dHIoJGNvbnRlbnRzLCAwLCAyKSAhPT0gJzw/JykgeworICAgICAgICAkY29udGVudHMgPSBw cmVnX3JlcGxhY2UoJ3teLis/PFw/fXMnLCAnPD8nLCAkY29udGVudHMsIDEsICRyZXBsYWNl bWVudHMpOworICAgICAgICBpZiAoJHJlcGxhY2VtZW50cyA9PT0gMCkgeworICAgICAgICAg ICAgcmV0dXJuIGFycmF5KCk7CisgICAgICAgIH0KKyAgICB9CisgICAgLy8gc3RyaXAgbm9u LXBocCBibG9ja3MgaW4gdGhlIGZpbGUKKyAgICAkY29udGVudHMgPSBwcmVnX3JlcGxhY2Uo J3tcPz4oPzpbXjxdKyt8PCg/IVw/KSkqKzxcP31zJywgJz8+PD8nLCAkY29udGVudHMpOwor ICAgIC8vIHN0cmlwIHRyYWlsaW5nIG5vbi1waHAgY29kZSBpZiBuZWVkZWQKKyAgICAkcG9z ID0gc3RycnBvcygkY29udGVudHMsICc/PicpOworICAgIGlmIChmYWxzZSAhPT0gJHBvcyAm JiBmYWxzZSA9PT0gc3RycG9zKHN1YnN0cigkY29udGVudHMsICRwb3MpLCAnPD8nKSkgewor ICAgICAgICAkY29udGVudHMgPSBzdWJzdHIoJGNvbnRlbnRzLCAwLCAkcG9zKTsKKyAgICB9 CisgICAgLy8gc3RyaXAgY29tbWVudHMgaWYgc2hvcnQgb3BlbiB0YWdzIGFyZSBpbiB0aGUg ZmlsZQorICAgIGlmIChwcmVnX21hdGNoKCd7KDxcPykoPyEocGhwfGhoKSl9aScsICRjb250 ZW50cykpIHsKKyAgICAgICAgJGNvbnRlbnRzID0gcHJlZ19yZXBsYWNlKCd7Ly8uKiB8IC9c Kig/OlteKl0rK3xcKig/IS8pKSpcKi99eCcsICcnLCAkY29udGVudHMpOworICAgIH0KKyAg ICBwcmVnX21hdGNoX2FsbCgneworICAgICAgICAoPzoKKyAgICAgICAgICAgICBcYig/PCFb XCQ6Pl0pKD9QPHR5cGU+Y2xhc3N8aW50ZXJmYWNlJy4kZXh0cmFUeXBlcy4nKSBccysrICg/ UDxuYW1lPlthLXpBLVpfXHg3Zi1ceGZmOl1bYS16QS1aMC05X1x4N2YtXHhmZjpcLV0qKykK KyAgICAgICAgICAgfCBcYig/PCFbXCQ6Pl0pKD9QPG5zPm5hbWVzcGFjZSkgKD9QPG5zbmFt ZT5ccysrW2EtekEtWl9ceDdmLVx4ZmZdW2EtekEtWjAtOV9ceDdmLVx4ZmZdKisoPzpccyor XFxcXFxzKitbYS16QS1aX1x4N2YtXHhmZl1bYS16QS1aMC05X1x4N2YtXHhmZl0qKykqKyk/ IFxzKisgW1x7O10KKyAgICAgICAgKQorICAgIH1peCcsICRjb250ZW50cywgJG1hdGNoZXMp OworICAgICRjbGFzc2VzID0gYXJyYXkoKTsKKyAgICAkbmFtZXNwYWNlID0gJyc7CisgICAg Zm9yICgkaSA9IDAsICRsZW4gPSBjb3VudCgkbWF0Y2hlc1sndHlwZSddKTsgJGkgPCAkbGVu OyAkaSsrKSB7CisgICAgICAgIGlmICghZW1wdHkoJG1hdGNoZXNbJ25zJ11bJGldKSkgewor ICAgICAgICAgICAgJG5hbWVzcGFjZSA9IHN0cl9yZXBsYWNlKGFycmF5KCcgJywgIlx0Iiwg IlxyIiwgIlxuIiksICcnLCAkbWF0Y2hlc1snbnNuYW1lJ11bJGldKSAuICdcXCc7CisgICAg ICAgIH0gZWxzZSB7CisgICAgICAgICAgICAkbmFtZSA9ICRtYXRjaGVzWyduYW1lJ11bJGld OworICAgICAgICAgICAgLy8gc2tpcCBhbm9uIGNsYXNzZXMgZXh0ZW5kaW5nL2ltcGxlbWVu dGluZworICAgICAgICAgICAgaWYgKCRuYW1lID09PSAnZXh0ZW5kcycgfHwgJG5hbWUgPT09 ICdpbXBsZW1lbnRzJykgeworICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAg ICAgfQorICAgICAgICAgICAgaWYgKCRuYW1lWzBdID09PSAnOicpIHsKKyAgICAgICAgICAg ICAgICAvLyBUaGlzIGlzIGFuIFhIUCBjbGFzcywgaHR0cHM6Ly9naXRodWIuY29tL2ZhY2Vi b29rL3hocAorICAgICAgICAgICAgICAgICRuYW1lID0gJ3hocCcuc3Vic3RyKHN0cl9yZXBs YWNlKGFycmF5KCctJywgJzonKSwgYXJyYXkoJ18nLCAnX18nKSwgJG5hbWUpLCAxKTsKKyAg ICAgICAgICAgIH0gZWxzZWlmICgkbWF0Y2hlc1sndHlwZSddWyRpXSA9PT0gJ2VudW0nKSB7 CisgICAgICAgICAgICAgICAgLy8gSW4gSGFjaywgc29tZXRoaW5nIGxpa2U6CisgICAgICAg ICAgICAgICAgLy8gICBlbnVtIEZvbzogaW50IHsgSEVSUCA9ICcxMjMnOyB9CisgICAgICAg ICAgICAgICAgLy8gVGhlIHJlZ2V4IGFib3ZlIGNhcHR1cmVzIHRoZSBjb2xvbiwgd2hpY2gg aXNuJ3QgcGFydCBvZgorICAgICAgICAgICAgICAgIC8vIHRoZSBjbGFzcyBuYW1lLgorICAg ICAgICAgICAgICAgICRuYW1lID0gcnRyaW0oJG5hbWUsICc6Jyk7CisgICAgICAgICAgICB9 CisgICAgICAgICAgICAkY2xhc3Nlc1tdID0gbHRyaW0oJG5hbWVzcGFjZSAuICRuYW1lLCAn XFwnKTsKKyAgICAgICAgfQorICAgIH0KKyAgICByZXR1cm4gJGNsYXNzZXM7Cit9CisKKyRv cHRpb25zID0gZ2V0b3B0KCdpOmY6JywgW10pOworJGZpbGUgPSAkb3B0aW9uc1siZiJdOwor JGlucHV0ID0gJG9wdGlvbnNbImkiXTsKKworJGNsYXNzZXMgPSBmaW5kQ2xhc3NlcygkZmls ZSk7Citmb3JlYWNoKCRjbGFzc2VzIGFzICRjbGFzcykgeworICBlY2hvICckY2xhc3NtYXBb XCcnLiRjbGFzcy4nXCddID0gXCcnLiRpbnB1dC4nLycuJGZpbGUuJ1wnOyc7CisgIGVjaG8g IlxuIjsKK30KZGlmZiAtLWdpdCBhL2d1aXgvYnVpbGQtc3lzdGVtL2NvbXBvc2VyLnNjbSBi L2d1aXgvYnVpbGQtc3lzdGVtL2NvbXBvc2VyLnNjbQpuZXcgZmlsZSBtb2RlIDEwMDY0NApp bmRleCAwMDAwMDAwMDAwLi44YmY5OWZmOWM1Ci0tLSAvZGV2L251bGwKKysrIGIvZ3VpeC9i dWlsZC1zeXN0ZW0vY29tcG9zZXIuc2NtCkBAIC0wLDAgKzEsMTYyIEBACis7OzsgR05VIEd1 aXggLS0tIEZ1bmN0aW9uYWwgcGFja2FnZSBtYW5hZ2VtZW50IGZvciBHTlUKKzs7OyBDb3B5 cmlnaHQgwqkgMjAxOSBKdWxpZW4gTGVwaWxsZXIgPGp1bGllbkBsZXBpbGxlci5ldT4KKzs7 OworOzs7IFRoaXMgZmlsZSBpcyBwYXJ0IG9mIEdOVSBHdWl4LgorOzs7Cis7OzsgR05VIEd1 aXggaXMgZnJlZSBzb2Z0d2FyZTsgeW91IGNhbiByZWRpc3RyaWJ1dGUgaXQgYW5kL29yIG1v ZGlmeSBpdAorOzs7IHVuZGVyIHRoZSB0ZXJtcyBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGlj IExpY2Vuc2UgYXMgcHVibGlzaGVkIGJ5Cis7OzsgdGhlIEZyZWUgU29mdHdhcmUgRm91bmRh dGlvbjsgZWl0aGVyIHZlcnNpb24gMyBvZiB0aGUgTGljZW5zZSwgb3IgKGF0Cis7OzsgeW91 ciBvcHRpb24pIGFueSBsYXRlciB2ZXJzaW9uLgorOzs7Cis7OzsgR05VIEd1aXggaXMgZGlz dHJpYnV0ZWQgaW4gdGhlIGhvcGUgdGhhdCBpdCB3aWxsIGJlIHVzZWZ1bCwgYnV0Cis7Ozsg V0lUSE9VVCBBTlkgV0FSUkFOVFk7IHdpdGhvdXQgZXZlbiB0aGUgaW1wbGllZCB3YXJyYW50 eSBvZgorOzs7IE1FUkNIQU5UQUJJTElUWSBvciBGSVRORVNTIEZPUiBBIFBBUlRJQ1VMQVIg UFVSUE9TRS4gIFNlZSB0aGUKKzs7OyBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBmb3Ig bW9yZSBkZXRhaWxzLgorOzs7Cis7OzsgWW91IHNob3VsZCBoYXZlIHJlY2VpdmVkIGEgY29w eSBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UKKzs7OyBhbG9uZyB3aXRoIEdO VSBHdWl4LiAgSWYgbm90LCBzZWUgPGh0dHA6Ly93d3cuZ251Lm9yZy9saWNlbnNlcy8+Lgor KGRlZmluZS1tb2R1bGUgKGd1aXggYnVpbGQtc3lzdGVtIGNvbXBvc2VyKQorICAjOnVzZS1t b2R1bGUgKGd1aXggc3RvcmUpCisgICM6dXNlLW1vZHVsZSAoZ3VpeCB1dGlscykKKyAgIzp1 c2UtbW9kdWxlIChndWl4IGRlcml2YXRpb25zKQorICAjOnVzZS1tb2R1bGUgKGd1aXggc2Vh cmNoLXBhdGhzKQorICAjOnVzZS1tb2R1bGUgKGd1aXggYnVpbGQtc3lzdGVtKQorICAjOnVz ZS1tb2R1bGUgKGd1aXggYnVpbGQtc3lzdGVtIGdudSkKKyAgIzp1c2UtbW9kdWxlIChndWl4 IGdleHApCisgICM6dXNlLW1vZHVsZSAoZ3VpeCBwYWNrYWdlcykKKyAgIzp1c2UtbW9kdWxl IChnbnUgcGFja2FnZXMpCisgICM6dXNlLW1vZHVsZSAoaWNlLTkgbWF0Y2gpCisgICM6dXNl LW1vZHVsZSAoc3JmaSBzcmZpLTEpCisgICM6ZXhwb3J0ICglY29tcG9zZXItYnVpbGQtc3lz dGVtLW1vZHVsZXMKKyAgICAgICAgICAgIGxvd2VyCisgICAgICAgICAgICBjb21wb3Nlci1i dWlsZAorICAgICAgICAgICAgY29tcG9zZXItYnVpbGQtc3lzdGVtKSkKKworOzsgQ29tbWVu dGFyeToKKzs7Cis7OyBTdGFuZGFyZCBidWlsZCBwcm9jZWR1cmUgZm9yIFBIUCBwYWNrYWdl cyB1c2luZyBDb21wb3Nlci4gVGhpcyBpcyBpbXBsZW1lbnRlZAorOzsgYXMgYW4gZXh0ZW5z aW9uIG9mIGBnbnUtYnVpbGQtc3lzdGVtJy4KKzs7Cis7OyBDb2RlOgorCisoZGVmaW5lIChk ZWZhdWx0LXBocCkKKyAgIlJldHVybiB0aGUgZGVmYXVsdCBQSFAgcGFja2FnZS4iCisKKyAg OzsgRG8gbm90IHVzZSBgQCcgdG8gYXZvaWQgaW50cm9kdWNpbmcgY2lyY3VsYXIgZGVwZW5k ZW5jaWVzLgorICAobGV0ICgobW9kdWxlIChyZXNvbHZlLWludGVyZmFjZSAnKGdudSBwYWNr YWdlcyBwaHApKSkpCisgICAgKG1vZHVsZS1yZWYgbW9kdWxlICdwaHApKSkKKworKGRlZmlu ZSAoZGVmYXVsdC1maW5kY2xhc3MpCisgICJSZXR1cm4gdGhlIGRlZmF1bHQgZmluZGNsYXNz IHNjcmlwdC4iCisgIChzZWFyY2gtYXV4aWxpYXJ5LWZpbGUgImZpbmRjbGFzcy5waHAiKSkK KworKGRlZmluZSAoZGVmYXVsdC1jb21wb3Nlci1jbGFzc2xvYWRlcikKKyAgIlJldHVybiB0 aGUgZGVmYXVsdCBjb21wb3Nlci1jbGFzc2xvYWRlciBwYWNrYWdlLiIKKworICA7OyBEbyBu b3QgdXNlIGBAJyB0byBhdm9pZCBpbnRyb2R1Y2luZyBjaXJjdWxhciBkZXBlbmRlbmNpZXMu CisgIChsZXQgKChtb2R1bGUgKHJlc29sdmUtaW50ZXJmYWNlICcoZ251IHBhY2thZ2VzIHBo cC14eXopKSkpCisgICAgKG1vZHVsZS1yZWYgbW9kdWxlICdjb21wb3Nlci1jbGFzc2xvYWRl cikpKQorCisoZGVmaW5lICVjb21wb3Nlci1idWlsZC1zeXN0ZW0tbW9kdWxlcworICA7OyBC dWlsZC1zaWRlIG1vZHVsZXMgaW1wb3J0ZWQgYnkgZGVmYXVsdC4KKyAgYCgoZ3VpeCBidWls ZCBjb21wb3Nlci1idWlsZC1zeXN0ZW0pCisgICAgKGd1aXggYnVpbGQgdW5pb24pCisgICAg KGpzb24pCisgICAgKGpzb24gYnVpbGRlcikKKyAgICAoanNvbiBwYXJzZXIpCisgICAgKGpz b24gcmVjb3JkKQorICAgICxAJWdudS1idWlsZC1zeXN0ZW0tbW9kdWxlcykpCisKKyhkZWZp bmUqIChsb3dlciBuYW1lCisgICAgICAgICAgICAgICAgIzprZXkgc291cmNlIGlucHV0cyBu YXRpdmUtaW5wdXRzIG91dHB1dHMgc3lzdGVtIHRhcmdldAorICAgICAgICAgICAgICAgIChw aHAgKGRlZmF1bHQtcGhwKSkKKyAgICAgICAgICAgICAgICAoY29tcG9zZXItY2xhc3Nsb2Fk ZXIgKGRlZmF1bHQtY29tcG9zZXItY2xhc3Nsb2FkZXIpKQorICAgICAgICAgICAgICAgIChm aW5kY2xhc3MgKGRlZmF1bHQtZmluZGNsYXNzKSkKKyAgICAgICAgICAgICAgICAjOmFsbG93 LW90aGVyLWtleXMKKyAgICAgICAgICAgICAgICAjOnJlc3QgYXJndW1lbnRzKQorICAiUmV0 dXJuIGEgYmFnIGZvciBOQU1FLiIKKyAgKGRlZmluZSBwcml2YXRlLWtleXdvcmRzCisgICAg JygjOnRhcmdldCAjOnBocCAjOmNvbXBvc2VyLWNsYXNzbG9hZGVyICM6ZmluZGNsYXNzICM6 aW5wdXRzICM6bmF0aXZlLWlucHV0cykpCisKKyAgKGFuZCAobm90IHRhcmdldCkgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgO1hYWDogbm8gY3Jvc3MtY29tcGlsYXRpb24KKyAg ICAgICAoYmFnCisgICAgICAgICAobmFtZSBuYW1lKQorICAgICAgICAgKHN5c3RlbSBzeXN0 ZW0pCisgICAgICAgICAoaG9zdC1pbnB1dHMgYCgsQChpZiBzb3VyY2UKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGAoKCJzb3VyY2UiICxzb3VyY2UpKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJygpKQorICAgICAgICAgICAgICAgICAgICAgICAgLEBpbnB1 dHMKKworICAgICAgICAgICAgICAgICAgICAgICAgOzsgS2VlcCB0aGUgc3RhbmRhcmQgaW5w dXRzIG9mICdnbnUtYnVpbGQtc3lzdGVtJy4KKyAgICAgICAgICAgICAgICAgICAgICAgICxA KHN0YW5kYXJkLXBhY2thZ2VzKSkpCisgICAgICAgICAoYnVpbGQtaW5wdXRzIGAoKCJwaHAi ICxwaHApCisgICAgICAgICAgICAgICAgICAgICAgICAgKCJmaW5kY2xhc3MucGhwIiAsZmlu ZGNsYXNzKQorCQkJICgiY29tcG9zZXItY2xhc3Nsb2FkZXIiICxjb21wb3Nlci1jbGFzc2xv YWRlcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAsQG5hdGl2ZS1pbnB1dHMpKQorICAg ICAgICAgKG91dHB1dHMgb3V0cHV0cykKKyAgICAgICAgIChidWlsZCBjb21wb3Nlci1idWls ZCkKKyAgICAgICAgIChhcmd1bWVudHMgKHN0cmlwLWtleXdvcmQtYXJndW1lbnRzIHByaXZh dGUta2V5d29yZHMgYXJndW1lbnRzKSkpKSkKKworKGRlZmluZSogKGNvbXBvc2VyLWJ1aWxk IG5hbWUgaW5wdXRzCisgICAgICAgICAgICAgICAgICAgICAgICAgIzprZXkKKyAgICAgICAg ICAgICAgICAgICAgICAgICBndWlsZSBzb3VyY2UKKyAgICAgICAgICAgICAgICAgICAgICAg ICAob3V0cHV0cyAnKCJvdXQiKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAoY29uZmln dXJlLWZsYWdzICcnKCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgKHNlYXJjaC1wYXRo cyAnKCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgKG91dC1vZi1zb3VyY2U/ICN0KQor ICAgICAgICAgICAgICAgICAgICAgICAgIChjb21wb3Nlci1maWxlICJjb21wb3Nlci5qc29u IikKKyAgICAgICAgICAgICAgICAgICAgICAgICAodGVzdHM/ICN0KQorICAgICAgICAgICAg ICAgICAgICAgICAgICh0ZXN0LXRhcmdldCAidGVzdCIpCisgICAgICAgICAgICAgICAgICAg ICAgICAgKGluc3RhbGwtdGFyZ2V0ICJpbnN0YWxsIikKKyAgICAgICAgICAgICAgICAgICAg ICAgICAodmFsaWRhdGUtcnVucGF0aD8gI3QpCisgICAgICAgICAgICAgICAgICAgICAgICAg KHBhdGNoLXNoZWJhbmdzPyAjdCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAoc3RyaXAt YmluYXJpZXM/ICN0KQorICAgICAgICAgICAgICAgICAgICAgICAgIChzdHJpcC1mbGFncyAj ficoIi0tc3RyaXAtZGVidWciKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAoc3RyaXAt ZGlyZWN0b3JpZXMgI34nKCJsaWIiICJsaWI2NCIgImxpYmV4ZWMiCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJiaW4iICJzYmluIikpCisgICAg ICAgICAgICAgICAgICAgICAgICAgKHBoYXNlcyAnKEAgKGd1aXggYnVpbGQgY29tcG9zZXIt YnVpbGQtc3lzdGVtKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICVz dGFuZGFyZC1waGFzZXMpKQorICAgICAgICAgICAgICAgICAgICAgICAgIChzeXN0ZW0gKCVj dXJyZW50LXN5c3RlbSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgKGltcG9ydGVkLW1v ZHVsZXMgJWNvbXBvc2VyLWJ1aWxkLXN5c3RlbS1tb2R1bGVzKQorICAgICAgICAgICAgICAg ICAgICAgICAgIChtb2R1bGVzICcoKGd1aXggYnVpbGQgY29tcG9zZXItYnVpbGQtc3lzdGVt KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGd1aXggYnVpbGQgdXRp bHMpKSkpCisgICJCdWlsZCBTT1VSQ0UgdXNpbmcgUEhQLCBhbmQgd2l0aCBJTlBVVFMuIFRo aXMgYXNzdW1lcyB0aGF0IFNPVVJDRSBwcm92aWRlcworYSAnY29tcG9zZXIuanNvbicgZmls ZSBhcyBpdHMgYnVpbGQgc3lzdGVtLiIKKyAgKGRlZmluZSBidWlsZGVyCisgICAgKHdpdGgt aW1wb3J0ZWQtbW9kdWxlcyBpbXBvcnRlZC1tb2R1bGVzCisgICAgICAjfihiZWdpbgorICAg ICAgICAgICh1c2UtbW9kdWxlcyAjJEAoc2V4cC0+Z2V4cCBtb2R1bGVzKSkKKworICAgICAg ICAgICMkKHdpdGgtYnVpbGQtdmFyaWFibGVzIGlucHV0cyBvdXRwdXRzCisgICAgICAgICAg ICAgICN+KGNvbXBvc2VyLWJ1aWxkCisgICAgICAgICAgICAgICAgICM6c291cmNlICMkc291 cmNlCisgICAgICAgICAgICAgICAgICM6c3lzdGVtICMkc3lzdGVtCisgICAgICAgICAgICAg ICAgICM6b3V0cHV0cyAlb3V0cHV0cworICAgICAgICAgICAgICAgICAjOmlucHV0cyAlYnVp bGQtaW5wdXRzCisgICAgICAgICAgICAgICAgICM6c2VhcmNoLXBhdGhzICcjJChtYXAgc2Vh cmNoLXBhdGgtc3BlY2lmaWNhdGlvbi0+c2V4cAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHNlYXJjaC1wYXRocykKKyAgICAgICAgICAgICAgICAgIzpwaGFz ZXMgIyRwaGFzZXMKKyAgICAgICAgICAgICAgICAgIzpvdXQtb2Ytc291cmNlPyAjJG91dC1v Zi1zb3VyY2U/CisgICAgICAgICAgICAgICAgICM6Y29tcG9zZXItZmlsZSAjJGNvbXBvc2Vy LWZpbGUKKyAgICAgICAgICAgICAgICAgIzp0ZXN0cz8gIyR0ZXN0cz8KKyAgICAgICAgICAg ICAgICAgIzp0ZXN0LXRhcmdldCAjJHRlc3QtdGFyZ2V0CisgICAgICAgICAgICAgICAgICM6 aW5zdGFsbC10YXJnZXQgIyRpbnN0YWxsLXRhcmdldAorICAgICAgICAgICAgICAgICAjOnZh bGlkYXRlLXJ1bnBhdGg/ICMkdmFsaWRhdGUtcnVucGF0aD8KKyAgICAgICAgICAgICAgICAg IzpwYXRjaC1zaGViYW5ncz8gIyRwYXRjaC1zaGViYW5ncz8KKyAgICAgICAgICAgICAgICAg IzpzdHJpcC1iaW5hcmllcz8gIyRzdHJpcC1iaW5hcmllcz8KKyAgICAgICAgICAgICAgICAg IzpzdHJpcC1mbGFncyAjJHN0cmlwLWZsYWdzCisgICAgICAgICAgICAgICAgICM6c3RyaXAt ZGlyZWN0b3JpZXMgIyRzdHJpcC1kaXJlY3RvcmllcykpKSkpCisKKyAgKGdleHAtPmRlcml2 YXRpb24gbmFtZSBidWlsZGVyCisgICAgICAgICAgICAgICAgICAgICM6c3lzdGVtIHN5c3Rl bQorICAgICAgICAgICAgICAgICAgICAjOnRhcmdldCAjZgorICAgICAgICAgICAgICAgICAg ICAjOmdyYWZ0PyAjZgorICAgICAgICAgICAgICAgICAgICAjOmd1aWxlLWZvci1idWlsZCBn dWlsZSkpCisKKyhkZWZpbmUgY29tcG9zZXItYnVpbGQtc3lzdGVtCisgIChidWlsZC1zeXN0 ZW0KKyAgICAobmFtZSAnY29tcG9zZXIpCisgICAgKGRlc2NyaXB0aW9uICJUaGUgc3RhbmRh cmQgQ29tcG9zZXIgYnVpbGQgc3lzdGVtIikKKyAgICAobG93ZXIgbG93ZXIpKSkKKworOzs7 IGNvbXBvc2VyLnNjbSBlbmRzIGhlcmUKZGlmZiAtLWdpdCBhL2d1aXgvYnVpbGQvY29tcG9z ZXItYnVpbGQtc3lzdGVtLnNjbSBiL2d1aXgvYnVpbGQvY29tcG9zZXItYnVpbGQtc3lzdGVt LnNjbQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwMDAwLi43ZGYyYjdjNDAw Ci0tLSAvZGV2L251bGwKKysrIGIvZ3VpeC9idWlsZC9jb21wb3Nlci1idWlsZC1zeXN0ZW0u c2NtCkBAIC0wLDAgKzEsMjM5IEBACis7OzsgR05VIEd1aXggLS0tIEZ1bmN0aW9uYWwgcGFj a2FnZSBtYW5hZ2VtZW50IGZvciBHTlUKKzs7OyBDb3B5cmlnaHQgwqkgMjAxOSBKdWxpZW4g TGVwaWxsZXIgPGp1bGllbkBsZXBpbGxlci5ldT4KKzs7OworOzs7IFRoaXMgZmlsZSBpcyBw YXJ0IG9mIEdOVSBHdWl4LgorOzs7Cis7OzsgR05VIEd1aXggaXMgZnJlZSBzb2Z0d2FyZTsg eW91IGNhbiByZWRpc3RyaWJ1dGUgaXQgYW5kL29yIG1vZGlmeSBpdAorOzs7IHVuZGVyIHRo ZSB0ZXJtcyBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgYXMgcHVibGlzaGVk IGJ5Cis7OzsgdGhlIEZyZWUgU29mdHdhcmUgRm91bmRhdGlvbjsgZWl0aGVyIHZlcnNpb24g MyBvZiB0aGUgTGljZW5zZSwgb3IgKGF0Cis7OzsgeW91ciBvcHRpb24pIGFueSBsYXRlciB2 ZXJzaW9uLgorOzs7Cis7OzsgR05VIEd1aXggaXMgZGlzdHJpYnV0ZWQgaW4gdGhlIGhvcGUg dGhhdCBpdCB3aWxsIGJlIHVzZWZ1bCwgYnV0Cis7OzsgV0lUSE9VVCBBTlkgV0FSUkFOVFk7 IHdpdGhvdXQgZXZlbiB0aGUgaW1wbGllZCB3YXJyYW50eSBvZgorOzs7IE1FUkNIQU5UQUJJ TElUWSBvciBGSVRORVNTIEZPUiBBIFBBUlRJQ1VMQVIgUFVSUE9TRS4gIFNlZSB0aGUKKzs7 OyBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBmb3IgbW9yZSBkZXRhaWxzLgorOzs7Cis7 OzsgWW91IHNob3VsZCBoYXZlIHJlY2VpdmVkIGEgY29weSBvZiB0aGUgR05VIEdlbmVyYWwg UHVibGljIExpY2Vuc2UKKzs7OyBhbG9uZyB3aXRoIEdOVSBHdWl4LiAgSWYgbm90LCBzZWUg PGh0dHA6Ly93d3cuZ251Lm9yZy9saWNlbnNlcy8+LgorCisoZGVmaW5lLW1vZHVsZSAoZ3Vp eCBidWlsZCBjb21wb3Nlci1idWlsZC1zeXN0ZW0pCisgICM6dXNlLW1vZHVsZSAoKGd1aXgg YnVpbGQgZ251LWJ1aWxkLXN5c3RlbSkgIzpwcmVmaXggZ251OikKKyAgIzp1c2UtbW9kdWxl IChndWl4IGJ1aWxkIHV0aWxzKQorICAjOnVzZS1tb2R1bGUgKGljZS05IG1hdGNoKQorICAj OnVzZS1tb2R1bGUgKGpzb24pCisgICM6dXNlLW1vZHVsZSAoc3JmaSBzcmZpLTI2KQorICAj OmV4cG9ydCAoJXN0YW5kYXJkLXBoYXNlcworICAgICAgICAgICAgY29tcG9zZXItYnVpbGQp KQorCis7OyBDb21tZW50YXJ5OgorOzsKKzs7IEJ1aWxkZXItc2lkZSBjb2RlIG9mIHRoZSBz dGFuZGFyZCBjb21wb3NlciBidWlsZCBwcm9jZWR1cmUuCis7OworOzsgQ29kZToKKworKGRl ZmluZSAoanNvbi0+cmVxdWlyZSBkaWN0KQorICAoaWYgZGljdAorICAgICAgKGxldCBsb29w ICgocmVzdWx0ICcoKSkgKHJlcXVpcmUgZGljdCkpCisgICAgICAgIChtYXRjaCByZXF1aXJl CisgICAgICAgICAgKCgpIHJlc3VsdCkKKyAgICAgICAgICAoKCgoPyAoY3V0IHN0cmluZy1j b250YWlucyA8PiAiLyIpIG5hbWUpIC4gXykKKyAgICAgICAgICAgICByZXF1aXJlIC4uLikK KyAgICAgICAgICAgKGxvb3AgKGNvbnMgbmFtZSByZXN1bHQpIHJlcXVpcmUpKQorICAgICAg ICAgICgoXyByZXF1aXJlIC4uLikgKGxvb3AgcmVzdWx0IHJlcXVpcmUpKSkpCisgICAgICAn KCkpKQorCisoZGVmaW5lLWpzb24tbWFwcGluZyA8Y29tcG9zZXItYXV0b2xvYWQ+IG1ha2Ut Y29tcG9zZXItYXV0b2xvYWQgY29tcG9zZXItYXV0b2xvYWQ/CisgIGpzb24tPmNvbXBvc2Vy LWF1dG9sb2FkCisgIChwc3ItNCBjb21wb3Nlci1hdXRvbG9hZC1wc3ItNCAicHNyLTQiCisg ICAgICAgICAgICAgICAgKG1hdGNoLWxhbWJkYQorICAgICAgICAgICAgICAgICAgKCNmICco KSkKKyAgICAgICAgICAgICAgICAgIChwc3ItNCBwc3ItNCkpKQorICAoY2xhc3NtYXAgY29t cG9zZXItYXV0b2xvYWQtY2xhc3NtYXAgImNsYXNzbWFwIgorICAgICAgICAgICAgKG1hdGNo LWxhbWJkYQorICAgICAgICAgICAgICAoI2YgJygpKQorICAgICAgICAgICAgICAoIyhsc3Qg Li4uKSBsc3QpKSkpCisKKyhkZWZpbmUtanNvbi1tYXBwaW5nIDxjb21wb3Nlci1wYWNrYWdl PiBtYWtlLWNvbXBvc2VyLXBhY2thZ2UgY29tcG9zZXItcGFja2FnZT8KKyAganNvbi0+Y29t cG9zZXItcGFja2FnZQorICAobmFtZSAgICAgICAgIGNvbXBvc2VyLXBhY2thZ2UtbmFtZSkK KyAgKGF1dG9sb2FkICAgICBjb21wb3Nlci1wYWNrYWdlLWF1dG9sb2FkICJhdXRvbG9hZCIg anNvbi0+Y29tcG9zZXItYXV0b2xvYWQpCisgIChhdXRvbG9hZC1kZXYgY29tcG9zZXItcGFj a2FnZS1hdXRvbG9hZC1kZXYgImF1dG9sb2FkLWRldiIganNvbi0+Y29tcG9zZXItYXV0b2xv YWQpCisgIChyZXF1aXJlICAgICAgY29tcG9zZXItcGFja2FnZS1yZXF1aXJlICJyZXF1aXJl IiBqc29uLT5yZXF1aXJlKQorICAoZGV2LXJlcXVpcmUgIGNvbXBvc2VyLXBhY2thZ2UtZGV2 LXJlcXVpcmUgInJlcXVpcmUtZGV2IiBqc29uLT5yZXF1aXJlKQorICAoc2NyaXB0cyAgICAg IGNvbXBvc2VyLXBhY2thZ2Utc2NyaXB0cyAic2NyaXB0cyIKKyAgICAgICAgICAgICAgICAo bWF0Y2gtbGFtYmRhCisgICAgICAgICAgICAgICAgICAoI2YgJygpKQorICAgICAgICAgICAg ICAgICAgKChzY3JpcHRzIC4uLikgc2NyaXB0cykpKQorICAoYmluYXJpZXMgICAgIGNvbXBv c2VyLXBhY2thZ2UtYmluYXJpZXMgImJpbiIKKyAgICAgICAgICAgICAgICAobWF0Y2gtbGFt YmRhCisgICAgICAgICAgICAgICAgICAoI2YgJygpKQorICAgICAgICAgICAgICAgICAgKCMo bHN0IC4uLikgbHN0KSkpKQorCisoZGVmaW5lKiAocmVhZC1wYWNrYWdlLWRhdGEgIzprZXkg KGZpbGVuYW1lICJjb21wb3Nlci5qc29uIikpCisgIChjYWxsLXdpdGgtaW5wdXQtZmlsZSBm aWxlbmFtZQorICAgIChsYW1iZGEgKHBvcnQpCisgICAgICAoanNvbi0+Y29tcG9zZXItcGFj a2FnZSAoanNvbi0+c2NtIHBvcnQpKSkpKQorCisoZGVmaW5lKiAoY2hlY2sgIzprZXkgY29t cG9zZXItZmlsZSBpbnB1dHMgb3V0cHV0cyB0ZXN0cz8gdGVzdC10YXJnZXQgIzphbGxvdy1v dGhlci1rZXlzKQorICAiVGVzdCB0aGUgZ2l2ZW4gcGFja2FnZS4iCisgICh3aGVuIHRlc3Rz PworICAgIChta2Rpci1wICJ2ZW5kb3IiKQorICAgIChjcmVhdGUtYXV0b2xvYWQgKHN0cmlu Zy1hcHBlbmQgKGdldGN3ZCkgIi92ZW5kb3IiKSBjb21wb3Nlci1maWxlCisgICAgICAgICAg ICAgICAgICAgICAoYXBwZW5kIGlucHV0cyBvdXRwdXRzKSAjOmRldi1kZXBlbmRlbmNpZXM/ ICN0KQorICAgIChsZXQqICgocGFja2FnZS1kYXRhIChyZWFkLXBhY2thZ2UtZGF0YSAjOmZp bGVuYW1lIGNvbXBvc2VyLWZpbGUpKQorICAgICAgICAgICAoc2NyaXB0cyAoY29tcG9zZXIt cGFja2FnZS1zY3JpcHRzIHBhY2thZ2UtZGF0YSkpCisgICAgICAgICAgICh0ZXN0LXNjcmlw dCAoYXNzb2MtcmVmIHNjcmlwdHMgdGVzdC10YXJnZXQpKQorICAgICAgICAgICAoZGVwZW5k ZW5jaWVzIChjb21wb3Nlci1wYWNrYWdlLXJlcXVpcmUgcGFja2FnZS1kYXRhKSkKKyAgICAg ICAgICAgKGRlcGVuZGVuY2llcy1kZXYgKGNvbXBvc2VyLXBhY2thZ2UtZGV2LXJlcXVpcmUg cGFja2FnZS1kYXRhKSkKKyAgICAgICAgICAgKG5hbWUgKGNvbXBvc2VyLXBhY2thZ2UtbmFt ZSBwYWNrYWdlLWRhdGEpKSkKKyAgICAgIChmb3ItZWFjaAorICAgICAgICAobWF0Y2gtbGFt YmRhCisgICAgICAgICAgKChfIC4gaW5wdXQpCisgICAgICAgICAgIChsZXQgKChiaW4gKGZp bmQtcGhwLWJpbiBpbnB1dCkpKQorICAgICAgICAgICAgICh3aGVuIGJpbgorICAgICAgICAg ICAgICAgKGNvcHktcmVjdXJzaXZlbHkgYmluICJ2ZW5kb3IvYmluIikpKSkpCisgICAgICAg IGlucHV0cykKKyAgICAgIChtYXRjaCB0ZXN0LXNjcmlwdAorICAgICAgICAoKD8gc3RyaW5n PyBjb21tYW5kKQorICAgICAgICAgKHVubGVzcyAoemVybz8gKHN5c3RlbSBjb21tYW5kKSkK KyAgICAgICAgICAgKHRocm93ICdmYWlsZWQtY29tbWFuZCBjb21tYW5kKSkpCisgICAgICAg ICgoJ0AgKD8gc3RyaW5nPyBjb21tYW5kKSAuLi4pCisgICAgICAgICAoZm9yLWVhY2gKKyAg ICAgICAgICAgKGxhbWJkYSAoYykKKyAgICAgICAgICAgICAodW5sZXNzICh6ZXJvPyAoc3lz dGVtIGMpKQorICAgICAgICAgICAgICAgKHRocm93ICdmYWlsZWQtY29tbWFuZCBjKSkpCisg ICAgICAgICAgIGNvbW1hbmQpKQorICAgICAgICAoI2YgKGludm9rZSAidmVuZG9yL2Jpbi9w aHB1bml0IikpKSkpKQorCisoZGVmaW5lIChmaW5kLXBocC1iaW4gaW5wdXQpCisgIChsZXQq ICgod2ViLWRpciAoc3RyaW5nLWFwcGVuZCBpbnB1dCAiL3NoYXJlL3dlYiIpKQorICAgICAg ICAgKHZlbmRvcnMgKGlmIChmaWxlLWV4aXN0cz8gd2ViLWRpcikKKyAgICAgICAgICAgICAg ICAgICAgICAoZmluZC1maWxlcyB3ZWItZGlyICJedmVuZG9yJCIgIzpkaXJlY3Rvcmllcz8g I3QpCisgICAgICAgICAgICAgICAgICAgICAgI2YpKSkKKyAgICAobWF0Y2ggdmVuZG9ycwor ICAgICAgKCh2ZW5kb3IpCisgICAgICAgKGxldCAoKGJpbiAoc3RyaW5nLWFwcGVuZCB2ZW5k b3IgIi9iaW4iKSkpCisgICAgICAgICAoYW5kIChmaWxlLWV4aXN0cz8gYmluKSBiaW4pKSkK KyAgICAgIChfICNmKSkpKQorCisoZGVmaW5lIChmaW5kLXBocC1kZXAgaW5wdXRzIGRlcGVu ZGVuY3kpCisgIChsZXQgbG9vcCAoKGlucHV0cyBpbnB1dHMpKQorICAgIChtYXRjaCBpbnB1 dHMKKyAgICAgICgoKSAodGhyb3cgJ3Vuc2F0aXNmaWVkLWRlcGVuZGVuY3kgIlVuc2F0aXNm aWVkIGRlcGVuZGVuY3k6IHJlcXVpcmVkICIKKyAgICAgICAgICAgICAgICAgZGVwZW5kZW5j eSkpCisgICAgICAoKChfIC4gaW5wdXQpIGlucHV0cyAuLi4pCisgICAgICAgKGxldCAoKGF1 dG9sb2FkIChzdHJpbmctYXBwZW5kIGlucHV0ICIvc2hhcmUvd2ViLyIgZGVwZW5kZW5jeQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiL3ZlbmRvci9hdXRvbG9h ZF9jb25mLnBocCIpKSkKKyAgICAgICAgICAoaWYgKGZpbGUtZXhpc3RzPyBhdXRvbG9hZCkK KyAgICAgICAgICAgICAgYXV0b2xvYWQKKyAgICAgICAgICAgICAgKGxvb3AgaW5wdXRzKSkp KSkpKQorCisoZGVmaW5lKiAoY3JlYXRlLWF1dG9sb2FkIHZlbmRvciBjb21wb3Nlci1maWxl IGlucHV0cyAjOmtleSBkZXYtZGVwZW5kZW5jaWVzPykKKyAgImNyZWF0ZXMgYW4gYXV0b2xv YWQucGhwIGZpbGUgdGhhdCBzZXRzIHVwIHRoZSBjbGFzcyBsb2NhdGlvbnMgZm9yIHRoaXMg cGFja2FnZSwKK3NvIGl0IGNhbiBiZSBhdXRvbG9hZGVkIGJ5IFBIUCB3aGVuIHRoZSBwYWNr YWdlIGNsYXNzZXMgYXJlIHJlcXVpcmVkLiIKKyAgKHdpdGgtb3V0cHV0LXRvLWZpbGUgKHN0 cmluZy1hcHBlbmQgdmVuZG9yICIvYXV0b2xvYWQucGhwIikKKyAgICAobGFtYmRhIF8KKyAg ICAgIChkaXNwbGF5IChzdHJpbmctYXBwZW5kCisgICAgICAgICAgICAgICAgICI8P3BocAor Ly8gYXV0b2xvYWQucGhwIEBnZW5lcmF0ZWQgYnkgR3VpeAorJG1hcCA9ICRwc3I0bWFwID0g JGNsYXNzbWFwID0gYXJyYXkoKTsKK3JlcXVpcmVfb25jZSAnIiB2ZW5kb3IgIi9hdXRvbG9h ZF9jb25mLnBocCcKK3JlcXVpcmVfb25jZSAnIiAoYXNzb2MtcmVmIGlucHV0cyAiY29tcG9z ZXItY2xhc3Nsb2FkZXIiKSAiL3NoYXJlL3dlYi9jb21wb3Nlci9DbGFzc0xvYWRlci5waHAn CiskbG9hZGVyID0gbmV3IFxcQ29tcG9zZXJcXEF1dG9sb2FkXFxDbGFzc0xvYWRlcigpOwor Zm9yZWFjaCAoJG1hcCBhcyAkbmFtZXNwYWNlID0+ICRwYXRoKSB7CisgICRsb2FkZXItPnNl dCgkbmFtZXNwYWNlLCAkcGF0aCk7Cit9Citmb3JlYWNoICgkcHNyNG1hcCBhcyAkbmFtZXNw YWNlID0+ICRwYXRoKSB7CisgICRsb2FkZXItPnNldFBzcjQoJG5hbWVzcGFjZSwgJHBhdGgp OworfQorJGxvYWRlci0+YWRkQ2xhc3NNYXAoJGNsYXNzbWFwKTsKKyRsb2FkZXItPnJlZ2lz dGVyKCk7CisiKSkpKQorICA7OyBOb3csIGNyZWF0ZSBhdXRvbG9hZF9jb25mLnBocCB0aGF0 IGNvbnRhaW5zIHRoZSBhY3R1YWwgZGF0YSwgYXMgYSBzZXQKKyAgOzsgb2YgYXJyYXlzCisg IChsZXQqICgocGFja2FnZS1kYXRhIChyZWFkLXBhY2thZ2UtZGF0YSAjOmZpbGVuYW1lIGNv bXBvc2VyLWZpbGUpKQorICAgICAgICAgKGF1dG9sb2FkIChjb21wb3Nlci1wYWNrYWdlLWF1 dG9sb2FkIHBhY2thZ2UtZGF0YSkpCisgICAgICAgICAoYXV0b2xvYWQtZGV2IChjb21wb3Nl ci1wYWNrYWdlLWF1dG9sb2FkLWRldiBwYWNrYWdlLWRhdGEpKQorICAgICAgICAgKGRlcGVu ZGVuY2llcyAoY29tcG9zZXItcGFja2FnZS1yZXF1aXJlIHBhY2thZ2UtZGF0YSkpCisgICAg ICAgICAoZGVwZW5kZW5jaWVzLWRldiAoY29tcG9zZXItcGFja2FnZS1kZXYtcmVxdWlyZSBw YWNrYWdlLWRhdGEpKSkKKyAgICAod2l0aC1vdXRwdXQtdG8tZmlsZSAoc3RyaW5nLWFwcGVu ZCB2ZW5kb3IgIi9hdXRvbG9hZF9jb25mLnBocCIpCisgICAgICAobGFtYmRhIF8KKyAgICAg ICAgKGZvcm1hdCAjdCAiPD9waHB+JSIpCisgICAgICAgIChmb3JtYXQgI3QgIi8vIGF1dG9s b2FkX2NvbmYucGhwIEBnZW5lcmF0ZWQgYnkgR3VpeH4lIikKKyAgICAgICAgKGZvcmNlLW91 dHB1dCkKKyAgICAgICAgKGZvci1lYWNoCisgICAgICAgICAgKGxhbWJkYSAocHNyNCkKKyAg ICAgICAgICAgIChtYXRjaCBwc3I0CisgICAgICAgICAgICAgICgoa2V5IC4gdmFsdWUpCisg ICAgICAgICAgICAgICAoZm9ybWF0ICN0ICIkcHNyNG1hcFsnfmEnXSA9ICd+YS8uLi9+YSc7 fiUiCisgICAgICAgICAgICAgICAgICAgICAgIChzdHJpbmctam9pbiAoc3RyaW5nLXNwbGl0 IGtleSAjXFwpICJcXFxcIikKKyAgICAgICAgICAgICAgICAgICAgICAgdmVuZG9yIHZhbHVl KSkpKQorICAgICAgICAgIChhcHBlbmQKKyAgICAgICAgICAgIChjb21wb3Nlci1hdXRvbG9h ZC1wc3ItNCBhdXRvbG9hZCkKKyAgICAgICAgICAgIChpZiBkZXYtZGVwZW5kZW5jaWVzPwor ICAgICAgICAgICAgICAgIChjb21wb3Nlci1hdXRvbG9hZC1wc3ItNCBhdXRvbG9hZC1kZXYp CisgICAgICAgICAgICAgICAgJygpKSkpCisgICAgICAgIChmb3ItZWFjaAorICAgICAgICAg IChsYW1iZGEgKGNsYXNzbWFwKQorICAgICAgICAgICAgKGZvci1lYWNoCisgICAgICAgICAg ICAgIChsYW1iZGEgKGZpbGUpCisgICAgICAgICAgICAgICAgKGludm9rZSAicGhwIiAoYXNz b2MtcmVmIGlucHV0cyAiZmluZGNsYXNzLnBocCIpCisgICAgICAgICAgICAgICAgICAgICAg ICAiLWkiIChzdHJpbmctYXBwZW5kIHZlbmRvciAiLy4uIikgIi1mIiBmaWxlKSkKKyAgICAg ICAgICAgICAgKGZpbmQtZmlsZXMgY2xhc3NtYXAgIi4ocGhwfGhofGluYykkIikpKQorICAg ICAgICAgIChhcHBlbmQKKyAgICAgICAgICAgIChjb21wb3Nlci1hdXRvbG9hZC1jbGFzc21h cCBhdXRvbG9hZCkKKyAgICAgICAgICAgIChpZiBkZXYtZGVwZW5kZW5jaWVzPworICAgICAg ICAgICAgICAgIChjb21wb3Nlci1hdXRvbG9hZC1jbGFzc21hcCBhdXRvbG9hZC1kZXYpCisg ICAgICAgICAgICAgICAgJygpKSkpCisgICAgICAgIChmb3ItZWFjaAorICAgICAgICAgIChs YW1iZGEgKGRlcCkKKyAgICAgICAgICAgIChmb3JtYXQgI3QgInJlcXVpcmVfb25jZSAnfmEn O34lIiAoZmluZC1waHAtZGVwIGlucHV0cyBkZXApKSkKKyAgICAgICAgICAoYXBwZW5kCisg ICAgICAgICAgICBkZXBlbmRlbmNpZXMKKyAgICAgICAgICAgIChpZiBkZXYtZGVwZW5kZW5j aWVzPworICAgICAgICAgICAgICAgIGRlcGVuZGVuY2llcy1kZXYKKyAgICAgICAgICAgICAg ICAnKCkpKSkpKSkpCisKKyhkZWZpbmUqIChpbnN0YWxsICM6a2V5IGlucHV0cyBvdXRwdXRz IGNvbXBvc2VyLWZpbGUgIzphbGxvdy1vdGhlci1rZXlzKQorICAiSW5zdGFsbCB0aGUgZ2l2 ZW4gcGFja2FnZS4iCisgIChsZXQqICgob3V0IChhc3NvYy1yZWYgb3V0cHV0cyAib3V0Iikp CisgICAgICAgICAocGFja2FnZS1kYXRhIChyZWFkLXBhY2thZ2UtZGF0YSAjOmZpbGVuYW1l IGNvbXBvc2VyLWZpbGUpKQorICAgICAgICAgKG5hbWUgKGNvbXBvc2VyLXBhY2thZ2UtbmFt ZSBwYWNrYWdlLWRhdGEpKQorICAgICAgICAgKHBocC1kaXIgKHN0cmluZy1hcHBlbmQgb3V0 ICIvc2hhcmUvd2ViLyIgbmFtZSkpCisgICAgICAgICAoYmluLWRpciAoc3RyaW5nLWFwcGVu ZCBwaHAtZGlyICIvdmVuZG9yL2JpbiIpKQorICAgICAgICAgKGJpbiAoc3RyaW5nLWFwcGVu ZCBvdXQgIi9iaW4iKSkKKyAgICAgICAgIChiaW5hcmllcyAoY29tcG9zZXItcGFja2FnZS1i aW5hcmllcyBwYWNrYWdlLWRhdGEpKSkKKyAgICAgIChta2Rpci1wIHBocC1kaXIpCisgICAg ICAoY29weS1yZWN1cnNpdmVseSAiLiIgcGhwLWRpcikKKyAgICAgIChta2Rpci1wIChzdHJp bmctYXBwZW5kIHBocC1kaXIgIi92ZW5kb3IiKSkKKyAgICAgICh3aGVuIGJpbmFyaWVzCisg ICAgICAgIChta2Rpci1wIGJpbi1kaXIpCisgICAgICAgIChta2Rpci1wIGJpbikKKyAgICAg ICAgKGZvci1lYWNoCisgICAgICAgICAgKGxhbWJkYSAoZmlsZSkKKyAgICAgICAgICAgIChs ZXQgKChpbnN0YWxsZWQtZmlsZSAoc3RyaW5nLWFwcGVuZCBiaW4tZGlyICIvIiAoYmFzZW5h bWUgZmlsZSkpKQorICAgICAgICAgICAgICAgICAgKGJpbi1maWxlIChzdHJpbmctYXBwZW5k IGJpbiAiLyIgKGJhc2VuYW1lIGZpbGUpKSkKKyAgICAgICAgICAgICAgICAgIChvcmlnaW5h bC1maWxlIChzdHJpbmctYXBwZW5kIHBocC1kaXIgIi8iIGZpbGUpKSkKKyAgICAgICAgICAg ICAgKHN5bWxpbmsgb3JpZ2luYWwtZmlsZSBpbnN0YWxsZWQtZmlsZSkKKyAgICAgICAgICAg ICAgKHN5bWxpbmsgb3JpZ2luYWwtZmlsZSBiaW4tZmlsZSkpKQorICAgICAgICAgIGJpbmFy aWVzKSkKKyAgICAgIChjcmVhdGUtYXV0b2xvYWQgKHN0cmluZy1hcHBlbmQgcGhwLWRpciAi L3ZlbmRvciIpCisgICAgICAgICAgICAgICAgICAgICAgIGNvbXBvc2VyLWZpbGUgaW5wdXRz KSkpCisKKyhkZWZpbmUgJXN0YW5kYXJkLXBoYXNlcworICA7OyBFdmVyeXRoaW5nIGlzIGFz IHdpdGggdGhlIEdOVSBCdWlsZCBTeXN0ZW0gZXhjZXB0IGZvciB0aGUgYGNvbmZpZ3VyZScK KyAgOzsgLCBgYnVpbGQnLCBgY2hlY2snIGFuZCBgaW5zdGFsbCcgcGhhc2VzLgorICAobW9k aWZ5LXBoYXNlcyBnbnU6JXN0YW5kYXJkLXBoYXNlcworICAgIChkZWxldGUgJ2Jvb3RzdHJh cCkKKyAgICAoZGVsZXRlICdjb25maWd1cmUpCisgICAgKGRlbGV0ZSAnYnVpbGQpCisgICAg KGRlbGV0ZSAnY2hlY2spCisgICAgKHJlcGxhY2UgJ2luc3RhbGwgaW5zdGFsbCkKKyAgICAo YWRkLWFmdGVyICdpbnN0YWxsICdjaGVjayBjaGVjaykpKQorCisoZGVmaW5lKiAoY29tcG9z ZXItYnVpbGQgIzprZXkgaW5wdXRzIChwaGFzZXMgJXN0YW5kYXJkLXBoYXNlcykKKyAgICAg ICAgICAgICAgICAgICAgICAgICAjOmFsbG93LW90aGVyLWtleXMgIzpyZXN0IGFyZ3MpCisg ICJCdWlsZCB0aGUgZ2l2ZW4gcGFja2FnZSwgYXBwbHlpbmcgYWxsIG9mIFBIQVNFUyBpbiBv cmRlci4iCisgIChhcHBseSBnbnU6Z251LWJ1aWxkICM6aW5wdXRzIGlucHV0cyAjOnBoYXNl cyBwaGFzZXMgYXJncykpCisKKzs7OyBjb21wb3Nlci1idWlsZC1zeXN0ZW0uc2NtIGVuZHMg aGVyZQotLSAKMi4zOS4yCgo= --------------8QyPfQMLrvK9wysJ9iPduH1e--
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH v3 2/7] gnu: Add composer-classloader. Resent-From: Nicolas Graves <ngraves@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Tue, 26 Sep 2023 10:33:02 +0000 Resent-Message-ID: <handler.42338.B42338.169572433632745 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Cc: ngraves@HIDDEN Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.169572433632745 (code B ref 42338); Tue, 26 Sep 2023 10:33:02 +0000 Received: (at 42338) by debbugs.gnu.org; 26 Sep 2023 10:32:16 +0000 Received: from localhost ([127.0.0.1]:47344 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ql5MW-0008W3-Ap for submit <at> debbugs.gnu.org; Tue, 26 Sep 2023 06:32:16 -0400 Received: from 5.mo560.mail-out.ovh.net ([87.98.181.248]:35309) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1ql5MT-0008Vc-Ik for 42338 <at> debbugs.gnu.org; Tue, 26 Sep 2023 06:32:14 -0400 Received: from director9.ghost.mail-out.ovh.net (unknown [10.108.1.121]) by mo560.mail-out.ovh.net (Postfix) with ESMTP id E9EA021054 for <42338 <at> debbugs.gnu.org>; Tue, 26 Sep 2023 10:31:58 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-5v5xb (unknown [10.110.115.179]) by director9.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 8A6D31FD33; Tue, 26 Sep 2023 10:31:58 +0000 (UTC) Received: from ngraves.fr ([37.59.142.110]) by ghost-submission-6684bf9d7b-5v5xb with ESMTPSA id diliHR6zEmWEngAAQBzOeg (envelope-from <ngraves@HIDDEN>); Tue, 26 Sep 2023 10:31:58 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-110S0049ed488f1-1dda-4fc1-9c01-dbda15f6c9bf, 673A0E1412D75BE9E6E9083740E1979C5D801E24) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 81.67.140.142 From: Nicolas Graves <ngraves@HIDDEN> Date: Tue, 26 Sep 2023 12:31:39 +0200 Message-ID: <a2045c10b011d77cb507b0d965cb1ab3c8ad2383.1695724304.git.ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 In-Reply-To: <6abfbb4d4d57642fea6bae5835ff0d365de7e24a.1695724304.git.ngraves@HIDDEN> References: <6abfbb4d4d57642fea6bae5835ff0d365de7e24a.1695724304.git.ngraves@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 12906753585164575458 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvjedrtddtgddtudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecunecujfgurhephffvvefufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepueegueekleehheetueeuieelffevtefggffhffeufffhjeevvdegleelteeuudehnecuffhomhgrihhnpehgnhhurdhorhhgpdhgihhthhhusgdrtghomhdpghgvthgtohhmphhoshgvrhdrohhrghenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegtddrudegvddpfeejrdehledrudegvddruddutdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepgedvfeefkeesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheeitddpmhhouggvpehsmhhtphhouhht X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * gnu/packages/php-xyz.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. --- gnu/local.mk | 1 + gnu/packages/php-xyz.scm | 61 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 gnu/packages/php-xyz.scm diff --git a/gnu/local.mk b/gnu/local.mk index bfa816d717..8cd0e0537b 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -501,6 +501,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/photo.scm \ %D%/packages/phabricator.scm \ %D%/packages/php.scm \ + %D%/packages/php-xyz.scm \ %D%/packages/piet.scm \ %D%/packages/pikchr.scm \ %D%/packages/pkg-config.scm \ diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm new file mode 100644 index 0000000000..dab660f84f --- /dev/null +++ b/gnu/packages/php-xyz.scm @@ -0,0 +1,61 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2019 Julien Lepiller <julien@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (gnu packages php-xyz) + #:use-module (gnu packages) + #:use-module (gnu packages php) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix git-download) + #:use-module (guix build-system composer) + #:use-module (guix build-system gnu) + #:use-module (guix utils) + #:use-module ((guix licenses) #:prefix license:)) + +(define-public composer-classloader + (package + (name "composer-classloader") + (version "1.9.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/composer/composer.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0127zmmg3yx84ljngfs86q7kjhyypybkf4d1ihfrfnzgynzxfxdf")))) + (build-system gnu-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (delete 'configure) + (delete 'build) + (delete 'check) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (install (string-append out "/share/web/composer/ClassLoader.php"))) + (mkdir-p (dirname install)) + (copy-file "src/Composer/Autoload/ClassLoader.php" install))))))) + (home-page "https://getcomposer.org") + (synopsis "PHP class loader extracted from the composer package") + (description "This package contains the class loader class used by Composer to +build its autoloading feature. This package is used by the composer-build-system +to build its own store-aware autoloading feature.") + (license license:expat))) -- 2.41.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH v3 1/7] guix: import: Add composer importer. References: <20200713002055.1553f136@HIDDEN> In-Reply-To: <20200713002055.1553f136@HIDDEN> Resent-From: Nicolas Graves <ngraves@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN Resent-Date: Tue, 26 Sep 2023 10:33:02 +0000 Resent-Message-ID: <handler.42338.B42338.169572433932753 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Cc: ngraves@HIDDEN, Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN> X-Debbugs-Original-Xcc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN> Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.169572433932753 (code B ref 42338); Tue, 26 Sep 2023 10:33:02 +0000 Received: (at 42338) by debbugs.gnu.org; 26 Sep 2023 10:32:19 +0000 Received: from localhost ([127.0.0.1]:47346 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ql5MW-0008W6-Ou for submit <at> debbugs.gnu.org; Tue, 26 Sep 2023 06:32:18 -0400 Received: from 4.mo575.mail-out.ovh.net ([46.105.59.63]:45703) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1ql5MS-0008Va-93 for 42338 <at> debbugs.gnu.org; Tue, 26 Sep 2023 06:32:15 -0400 Received: from director10.ghost.mail-out.ovh.net (unknown [10.109.146.53]) by mo575.mail-out.ovh.net (Postfix) with ESMTP id BAE1128516 for <42338 <at> debbugs.gnu.org>; Tue, 26 Sep 2023 10:31:57 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-fsfwf (unknown [10.110.171.191]) by director10.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 6FE591FE95; Tue, 26 Sep 2023 10:31:57 +0000 (UTC) Received: from ngraves.fr ([37.59.142.101]) by ghost-submission-6684bf9d7b-fsfwf with ESMTPSA id 6MzQFx2zEmW3hwAA62LSYA (envelope-from <ngraves@HIDDEN>); Tue, 26 Sep 2023 10:31:57 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-101G004d1f23cb3-c27a-414f-a013-6b11d05450a9, 673A0E1412D75BE9E6E9083740E1979C5D801E24) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 81.67.140.142 From: Nicolas Graves <ngraves@HIDDEN> Date: Tue, 26 Sep 2023 12:31:38 +0200 Message-ID: <6abfbb4d4d57642fea6bae5835ff0d365de7e24a.1695724304.git.ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 12906472107369685730 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvjedrtddtgddtudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecunecujfgurhephffvvefufffkofggtgfgsehtkeertdertdejnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepueegjeejvefhuefffeffleefjeekieevveeuvdejtdfgffekleehiefgvdelieejnecuffhomhgrihhnpehgvghttghomhhpohhsvghrrdhorhhgpdhgnhhurdhorhhgpdhprggtkhgrghhishhtrdhorhhgpdgvgigrmhhplhgvrdgtohhmnecukfhppeduvdejrddtrddtrddupdekuddrieejrddugedtrddugedvpdefjedrheelrddugedvrddutddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeegvdeffeekseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehjeehpdhmohguvgepshhmthhpohhuth X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * guix/import/composer.scm: New file. * guix/scripts/import/composer.scm: New file. * guix/tests/composer.scm: New file. * Makefile.am: Add them. * guix/scripts/import.scm: Add composer importer. * doc/guix.texi (Invoking guix import): Mention it. --- Makefile.am | 3 + doc/guix.texi | 20 +++ guix/import/composer.scm | 270 +++++++++++++++++++++++++++++++ guix/scripts/import.scm | 2 +- guix/scripts/import/composer.scm | 107 ++++++++++++ tests/composer.scm | 92 +++++++++++ 6 files changed, 493 insertions(+), 1 deletion(-) create mode 100644 guix/import/composer.scm create mode 100644 guix/scripts/import/composer.scm create mode 100644 tests/composer.scm diff --git a/Makefile.am b/Makefile.am index 8924974e8a..3ce7ee832e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -274,6 +274,7 @@ MODULES = \ guix/search-paths.scm \ guix/packages.scm \ guix/import/cabal.scm \ + guix/import/composer.scm \ guix/import/cpan.scm \ guix/import/cran.scm \ guix/import/crate.scm \ @@ -332,6 +333,7 @@ MODULES = \ guix/scripts/home/import.scm \ guix/scripts/lint.scm \ guix/scripts/challenge.scm \ + guix/scripts/import/composer.scm \ guix/scripts/import/crate.scm \ guix/scripts/import/cpan.scm \ guix/scripts/import/cran.scm \ @@ -500,6 +502,7 @@ SCM_TESTS = \ tests/challenge.scm \ tests/channels.scm \ tests/combinators.scm \ + tests/composer.scm \ tests/containers.scm \ tests/cpan.scm \ tests/cpio.scm \ diff --git a/doc/guix.texi b/doc/guix.texi index 46591b2f64..4d2fc11cd7 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -14530,6 +14530,26 @@ Invoking guix import Additional options include: +@table @code +@item --recursive +@itemx -r +Traverse the dependency graph of the given upstream package recursively +and generate package expressions for all those packages that are not yet +in Guix. +@end table + +@item composer +@cindex Composer +@cindex PHP +Import metadat from the @uref{https://getcomposer.org/, Composer} package +archive used by the PHP community, as in this example: + +@example +guix import composer phpunit/phpunit +@end example + +Additional options include: + @table @code @item --recursive @itemx -r diff --git a/guix/import/composer.scm b/guix/import/composer.scm new file mode 100644 index 0000000000..c152f402bb --- /dev/null +++ b/guix/import/composer.scm @@ -0,0 +1,270 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2019 Julien Lepiller <julien@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (guix import composer) + #:use-module (ice-9 match) + #:use-module (json) + #:use-module (gcrypt hash) + #:use-module (guix base32) + #:use-module (guix build git) + #:use-module (guix build utils) + #:use-module (guix build-system) + #:use-module (guix import json) + #:use-module (guix import utils) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (guix serialization) + #:use-module (guix upstream) + #:use-module (guix utils) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-11) + #:use-module (srfi srfi-26) + #:export (composer->guix-package + %composer-updater + composer-recursive-import + + %composer-base-url)) + +(define %composer-base-url + (make-parameter "https://repo.packagist.org")) + +;; XXX adapted from (guix scripts hash) +(define (file-hash file select? recursive?) + ;; Compute the hash of FILE. + (if recursive? + (let-values (((port get-hash) (open-sha256-port))) + (write-file file port #:select? select?) + (force-output port) + (get-hash)) + (call-with-input-file file port-sha256))) + +;; XXX taken from (guix scripts hash) +(define (vcs-file? file stat) + (case (stat:type stat) + ((directory) + (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) + ((regular) + ;; Git sub-modules have a '.git' file that is a regular text file. + (string=? (basename file) ".git")) + (else + #f))) + +(define (fix-version version) + "Return a fixed version from a version string. For instance, v10.1 -> 10.1" + (cond + ((string-prefix? "version" version) + (if (char-set-contains? char-set:digit (string-ref version 7)) + (substring version 7) + (substring version 8))) + ((string-prefix? "v" version) + (substring version 1)) + (else version))) + +(define (latest-version versions) + (fold (lambda (a b) (if (version>? (fix-version a) (fix-version b)) a b)) + (car versions) versions)) + +(define (json->require dict) + (if dict + (let loop ((result '()) (require dict)) + (match require + (() result) + ((((? (cut string-contains <> "/") name) . _) + require ...) + (loop (cons name result) require)) + ((_ require ...) (loop result require)))) + '())) + +(define-json-mapping <composer-source> make-composer-source composer-source? + json->composer-source + (type composer-source-type) + (url composer-source-url) + (reference composer-source-reference)) + +(define-json-mapping <composer-package> make-composer-package composer-package? + json->composer-package + (description composer-package-description) + (homepage composer-package-homepage) + (source composer-package-source "source" json->composer-source) + (name composer-package-name "name" php-package-name) + (version composer-package-version "version" fix-version) + (require composer-package-require "require" json->require) + (dev-require composer-package-dev-require "require-dev" json->require) + (license composer-package-license "license" + (lambda (vector) + (map string->license (vector->list vector))))) + +(define* (composer-fetch name #:optional version) + "Return an alist representation of the Composer metadata for the package NAME, +or #f on failure." + (let ((package (json-fetch + (string-append (%composer-base-url) "/p/" name ".json")))) + (if package + (let* ((packages (assoc-ref package "packages")) + (package (or (assoc-ref packages name) package)) + (versions (filter + (lambda (version) + (and (not (string-contains version "dev")) + (not (string-contains version "beta")))) + (map car package))) + (version (or (if (null? version) #f version) + (latest-version versions)))) + (assoc-ref package version)) + #f))) + +(define (php-package-name name) + "Given the NAME of a package on Packagist, return a Guix-compliant name for +the package." + (let ((name (string-join (string-split name #\/) "-"))) + (if (string-prefix? "php-" name) + (snake-case name) + (string-append "php-" (snake-case name))))) + +(define (make-php-sexp composer-package) + "Return the `package' s-expression for a PHP package for the given +COMPOSER-PACKAGE." + (let* ((source (composer-package-source composer-package)) + (dependencies (map php-package-name + (composer-package-require composer-package))) + (dev-dependencies (map php-package-name + (composer-package-dev-require composer-package))) + (git? (equal? (composer-source-type source) "git"))) + ((if git? call-with-temporary-directory call-with-temporary-output-file) + (lambda* (temp #:optional port) + (and (if git? + (begin + (mkdir-p temp) + (git-fetch (composer-source-url source) + (composer-source-reference source) + temp)) + (url-fetch (composer-source-url source) temp)) + `(package + (name ,(composer-package-name composer-package)) + (version ,(composer-package-version composer-package)) + (source (origin + ,@(if git? + `((method git-fetch) + (uri (git-reference + (url ,(composer-source-url source)) + (commit ,(composer-source-reference source)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + ,(bytevector->nix-base32-string + (file-hash temp (negate vcs-file?) #t))))) + `((method url-fetch) + (uri ,(composer-source-url source)) + (sha256 (base32 ,(guix-hash-url temp))))))) + (build-system composer-build-system) + ,@(if (null? dependencies) + '() + `((inputs + (,'quasiquote + ,(map (lambda (name) + `(,name + (,'unquote + ,(string->symbol name)))) + dependencies))))) + ,@(if (null? dev-dependencies) + '() + `((native-inputs + (,'quasiquote + ,(map (lambda (name) + `(,name + (,'unquote + ,(string->symbol name)))) + dev-dependencies))))) + (synopsis "") + (description ,(composer-package-description composer-package)) + (home-page ,(composer-package-homepage composer-package)) + (license ,(match (composer-package-license composer-package) + (() #f) + ((license) license) + (_ license))))))))) + +(define* (composer->guix-package package-name #:optional version) + "Fetch the metadata for PACKAGE-NAME from packagist.org, and return the +`package' s-expression corresponding to that package, or #f on failure." + (let ((package (composer-fetch package-name version))) + (and package + (let* ((package (json->composer-package package)) + (dependencies-names (composer-package-require package)) + (dev-dependencies-names (composer-package-dev-require package))) + (values (make-php-sexp package) + (append dependencies-names dev-dependencies-names)))))) + +(define (guix-name->composer-name name) + "Given a guix package name, return the name of the package in Packagist." + (if (string-prefix? "php-" name) + (let ((components (string-split (substring name 4) #\-))) + (match components + ((namespace name ...) + (string-append namespace "/" (string-join name "-"))))) + name)) + +(define (guix-package->composer-name package) + "Given a Composer PACKAGE built from Packagist, return the name of the +package in Packagist." + (let ((upstream-name (assoc-ref + (package-properties package) + 'upstream-name)) + (name (package-name package))) + (if upstream-name + upstream-name + (guix-name->composer-name name)))) + +(define (string->license str) + "Convert the string STR into a license object." + (match str + ("GNU LGPL" 'license:lgpl2.0) + ("GPL" 'license:gpl3) + ((or "BSD" "BSD License" "BSD-3-Clause") 'license:bsd-3) + ((or "MIT" "MIT license" "Expat license") 'license:expat) + ("Public domain" 'license:public-domain) + ((or "Apache License, Version 2.0" "Apache 2.0") 'license:asl2.0) + (_ #f))) + +(define (php-package? package) + "Return true if PACKAGE is a PHP package from Packagist." + (and + (eq? (build-system-name (package-build-system package)) 'composer) + (string-prefix? "php-" (package-name package)))) + +(define (latest-release package) + "Return an <upstream-source> for the latest release of PACKAGE." + (let* ((php-name (guix-package->composer-name package)) + (metadata (composer-fetch php-name)) + (package (json->composer-package metadata)) + (version (composer-package-version package)) + (url (composer-source-url (composer-package-source package)))) + (upstream-source + (package (package-name package)) + (version version) + (urls (list url))))) + +(define %composer-updater + (upstream-updater + (name 'composer) + (description "Updater for Composer packages") + (pred php-package?) + (import latest-release))) + +(define* (composer-recursive-import package-name #:optional version) + (recursive-import package-name '() + #:repo->guix-package composer->guix-package + #:guix-name php-package-name)) diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm index 4ddd8d46a1..8c58dd35e2 100644 --- a/guix/scripts/import.scm +++ b/guix/scripts/import.scm @@ -47,7 +47,7 @@ (define %standard-import-options '()) (define importers '("gnu" "pypi" "cpan" "hackage" "stackage" "egg" "elpa" "gem" "go" "cran" "crate" "texlive" "json" "opam" - "minetest" "elm" "hexpm")) + "minetest" "elm" "hexpm" "composer")) (define (resolve-importer name) (let ((module (resolve-interface diff --git a/guix/scripts/import/composer.scm b/guix/scripts/import/composer.scm new file mode 100644 index 0000000000..412bae6318 --- /dev/null +++ b/guix/scripts/import/composer.scm @@ -0,0 +1,107 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2015 David Thompson <davet@HIDDEN> +;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (guix scripts import composer) + #:use-module (guix ui) + #:use-module (guix utils) + #:use-module (guix scripts) + #:use-module (guix import composer) + #:use-module (guix scripts import) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-11) + #:use-module (srfi srfi-37) + #:use-module (srfi srfi-41) + #:use-module (ice-9 match) + #:use-module (ice-9 format) + #:export (guix-import-composer)) + + +;;; +;;; Command-line options. +;;; + +(define %default-options + '()) + +(define (show-help) + (display (G_ "Usage: guix import composer PACKAGE-NAME +Import and convert the Composer package for PACKAGE-NAME.\n")) + (display (G_ " + -h, --help display this help and exit")) + (display (G_ " + -V, --version display version information and exit")) + (display (G_ " + -r, --recursive generate package expressions for all Composer packages\ + that are not yet in Guix")) + (newline) + (show-bug-report-information)) + +(define %options + ;; Specification of the command-line options. + (cons* (option '(#\h "help") #f #f + (lambda args + (show-help) + (exit 0))) + (option '(#\V "version") #f #f + (lambda args + (show-version-and-exit "guix import composer"))) + (option '(#\r "recursive") #f #f + (lambda (opt name arg result) + (alist-cons 'recursive #t result))) + %standard-import-options)) + + +;;; +;;; Entry point. +;;; + +(define (guix-import-composer . args) + (define (parse-options) + ;; Return the alist of option values. + (args-fold* args %options + (lambda (opt name arg result) + (leave (G_ "~A: unrecognized option~%") name)) + (lambda (arg result) + (alist-cons 'argument arg result)) + %default-options)) + + (let* ((opts (parse-options)) + (args (filter-map (match-lambda + (('argument . value) + value) + (_ #f)) + (reverse opts)))) + (match args + ((package-name) + (if (assoc-ref opts 'recursive) + (map (match-lambda + ((and ('package ('name name) . rest) pkg) + `(define-public ,(string->symbol name) + ,pkg)) + (_ #f)) + (composer-recursive-import package-name)) + (let ((sexp (composer->guix-package package-name))) + (unless sexp + (leave (G_ "failed to download meta-data for package '~a'~%") + package-name)) + sexp))) + (() + (leave (G_ "too few arguments~%"))) + ((many ...) + (leave (G_ "too many arguments~%")))))) diff --git a/tests/composer.scm b/tests/composer.scm new file mode 100644 index 0000000000..cefaf9f434 --- /dev/null +++ b/tests/composer.scm @@ -0,0 +1,92 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2020 Julien Lepiller <julien@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (test-composer) + #:use-module (guix import composer) + #:use-module (guix base32) + #:use-module (gcrypt hash) + #:use-module (guix tests http) + #:use-module (guix grafts) + #:use-module (srfi srfi-64) + #:use-module (web client) + #:use-module (ice-9 match)) + +;; Globally disable grafts because they can trigger early builds. +(%graft? #f) + +(define test-json + "{ + \"packages\": { + \"foo/bar\": { + \"0.1\": { + \"name\": \"foo/bar\", + \"description\": \"description\", + \"keywords\": [\"testing\"], + \"homepage\": \"http://example.com\", + \"version\": \"0.1\", + \"license\": [\"BSD-3-Clause\"], + \"source\": { + \"type\": \"url\", + \"url\": \"http://example.com/Bar-0.1.tar.gz\" + }, + \"require\": {}, + \"require-dev\": {\"phpunit/phpunit\": \"1.0.0\"} + } + } + } +}") + +(define test-source + "foobar") + +;; Avoid collisions with other tests. +(%http-server-port 10450) + +(test-begin "composer") + +(test-assert "composer->guix-package" + ;; Replace network resources with sample data. + (with-http-server `((200 ,test-json) + (200 ,test-source)) + (parameterize ((%composer-base-url (%local-url)) + (current-http-proxy (%local-url))) + (match (composer->guix-package "foo/bar") + (('package + ('name "php-foo-bar") + ('version "0.1") + ('source ('origin + ('method 'url-fetch) + ('uri "http://example.com/Bar-0.1.tar.gz") + ('sha256 + ('base32 + (? string? hash))))) + ('build-system 'composer-build-system) + ('native-inputs + ('quasiquote + (("php-phpunit-phpunit" ('unquote 'php-phpunit-phpunit))))) + ('synopsis "") + ('description "description") + ('home-page "http://example.com") + ('license 'license:bsd-3)) + (string=? (bytevector->nix-base32-string + (call-with-input-string test-source port-sha256)) + hash)) + (x + (pk 'fail x #f)))))) + +(test-end "composer") base-commit: fafd3caef0d51811a5da81d6061789e2908b0dac prerequisite-patch-id: eb618ab7b10483d917c308a38792af98baa517e2 prerequisite-patch-id: c12968d02d99c253f858586a86b16fa32d41f1c1 prerequisite-patch-id: 09d995d48139f8e61183d5634cda13a01cdb50f7 prerequisite-patch-id: 86baa45ec2aad977c8c8135f7613aa391155de6d prerequisite-patch-id: 3425fbbff6a603d60b4e143ea2141aabf4ddc92c prerequisite-patch-id: c373c01aab5dcba3503a97d51c62a595147a041c prerequisite-patch-id: cda857c790b88c681c4e713c5f71e40291970daf prerequisite-patch-id: 8e234d0f4d93d2aad499eec8842be3d28da98707 prerequisite-patch-id: 5f664cb2fd995a53765c5ffc19a708ac795cc0c4 prerequisite-patch-id: ed447cba9cf9b7e1a1b47aa27acb14f8f2da0a8e prerequisite-patch-id: 9f80c5bbbfb8cd3347951c4d57634e93ffa79924 prerequisite-patch-id: 1aaa9f0d466e2d6837f75844df48a98beb70ff24 prerequisite-patch-id: 34502820d8c0355b3ed2638c457084edeaba029d prerequisite-patch-id: a96258da9e78cfb9ac9893cdcdeb38b69b75f134 prerequisite-patch-id: 4a2da4ee89dbbdb2244845149ce6da967ddd5268 prerequisite-patch-id: 9f9c4205781d1f0e2bb7af2d21875de08ee3ecd5 prerequisite-patch-id: 9697db9b50cab8f7974c32383e0a9a786ecbd8f9 prerequisite-patch-id: ebbd089a3313232347273c723d3deb1bf8c9bf81 prerequisite-patch-id: e93360d66936b9efd70a6ffd41f6ecda177ad7b8 prerequisite-patch-id: 19d76f45db1c59bd9ccd2e4e1125ffd698e9d6ce prerequisite-patch-id: 929b39ded7ad095e9f768f7d484bbd3b7a486a3c prerequisite-patch-id: 5e1262f77d55c91eadca113223faa84935bffd60 prerequisite-patch-id: ad370d41983418fa704215aa3458f97c75d5d128 prerequisite-patch-id: f179c922613390d249a365625c2ee545a908029d prerequisite-patch-id: 03b0aaa382ddda0819ddb62479cd1885c930ddea prerequisite-patch-id: 83b8b3a072520705dcba4b67712a29553bea1548 prerequisite-patch-id: 9308fa06526d9bacdbcdd347cc225f6f3f87811a prerequisite-patch-id: a017243a1a4b406caed9cec048d194cdc33d1a25 prerequisite-patch-id: e8d5b2e787904b0dd1a650d7a0012b91a430cb03 prerequisite-patch-id: 1cc872245864ace22db43cf2d268a87190b333b6 prerequisite-patch-id: c277dcca77f3acde51bdffe932b9250e454086ad prerequisite-patch-id: ea926073e68d5af7f6c76a6333520cc5f42c9789 prerequisite-patch-id: 10008b9b34ccc8f87f2fcd8391075fe57244ac72 prerequisite-patch-id: 443d7e3eb85f36848c2120979f9f1d3a78f8bf38 prerequisite-patch-id: 6414c2d65c1806942d7f834e9300a8ecf8fd743f prerequisite-patch-id: 8c6dec06b716c39ca7fada0f2872078612917779 prerequisite-patch-id: 62e28252e9b7ab11edb03609b68369feb499f883 prerequisite-patch-id: 84c9361c4c6d7662cfb3235cc4a6640a53e00622 prerequisite-patch-id: 0f27045bc50089a9a88da7818448a50cd28dd295 prerequisite-patch-id: 500413da3a81e75c5fbca62a21d9457d7b1ad8a8 prerequisite-patch-id: 6f48169f4d69da277bcdecb8f40d2f608941d9f9 prerequisite-patch-id: fc8b43573cc6b90033769de63ca235b16159190d prerequisite-patch-id: ae749fc3fa0ab1768841ffb4633847b5b2233881 prerequisite-patch-id: 46b8490d2b338229a2f3c5e39427275cf46982ba prerequisite-patch-id: b1bb7dfb35069a2b30f5b2714bc19a249be3e1b5 prerequisite-patch-id: 94848222eb08beb53530ba6ce626e9d8bcffecd4 prerequisite-patch-id: f8181365677e68d8628013c7636e9ff56214ac9e prerequisite-patch-id: aebc0f8156c409599cc7aced4b708bb5ea08a2b2 prerequisite-patch-id: 4ce416249f6d3176a51d7e4cbbd2c6bf2982bab6 prerequisite-patch-id: 5e14463dcc090e497bb1d29c1b4c822b43d5fdca prerequisite-patch-id: 89306b41386cb29db7c147e8c4468a3b4d8d292d prerequisite-patch-id: 29e414b1ede9108047ff224e1e24a3adb2c44c52 prerequisite-patch-id: 7e15edfd04cd291f54284d13dcdbebcfb456b752 prerequisite-patch-id: b8c18091929e58b49847ab510d3d75a8a934cad0 prerequisite-patch-id: 7a607a1659b22afb0c21dec3d8eb1e2ed51e47a9 prerequisite-patch-id: 89fbd04f11e5bef5703ba7ea4c2064d5ba63c4d4 prerequisite-patch-id: b421048677352ea536dd93a61d6de987fb95d60b prerequisite-patch-id: 25a03298bdfd6a691bb8cf68690009f8e46447e0 prerequisite-patch-id: 3924163576eafdac47ac06de311ac317730e6631 prerequisite-patch-id: 69b1d81677b507242f556c3e2fcf5290aeca445c prerequisite-patch-id: a378fa79002001da51ae91eb026769eddb8a593b prerequisite-patch-id: 86bb35c89ec3cc1b6ec47f238c84a154d5e9a1aa prerequisite-patch-id: f8d0709d94ed99b1530bad1908ca27b1b56ea84e prerequisite-patch-id: dcb65983aa914b8f1d1a8fbdfba34714ddb7f6fa prerequisite-patch-id: 89752146a063d0706885819e244b4179196538b8 prerequisite-patch-id: 1f9e7627d0b23302159cdab3d939fcec52f7ca70 prerequisite-patch-id: f706bfa95ba0e5e72c206537ed207feb95daa888 prerequisite-patch-id: 9b60c519b0df65eeacd5779808e0d75b011ebf7f prerequisite-patch-id: cd6cd74eca502ebce581c223cd0d2ac4278912e8 prerequisite-patch-id: b86e08404ef83877dfa3b76a80a12b02c61b1326 prerequisite-patch-id: 9417f8d92995cf417bb3c4afa0786b05a756d48a prerequisite-patch-id: 59dda13243375b013396981a4f9e17abd694d734 prerequisite-patch-id: 89be058d0605cb8278d5d3384bb44911b188dd90 prerequisite-patch-id: 70c26fde2fde34c031a95ef74a3321710dc4961e prerequisite-patch-id: 38a27cdf8cbe03fdf5f9bafa5ba53f3ba644a5ad prerequisite-patch-id: 40a6d2e51dff2531c40a38087a8aea1be7108792 prerequisite-patch-id: 024d1bba9bcd449d2b8196b2f1a64a197cafaed8 prerequisite-patch-id: e83d54aa767ebab267530fca74d60366160a5253 prerequisite-patch-id: c34734661161c27224316dc519609db5c6d87a1e prerequisite-patch-id: a58d739146fe46f6c7f203e5d2e0f114bd3f7834 prerequisite-patch-id: 1ff8499f5ec69b737d77053e6809ec3a0b599ebc prerequisite-patch-id: 498e5608bca9b5ebcb3592a556e75f5dcc2b7076 prerequisite-patch-id: df6dfdea7c3d9db4649d857ce55fbeb99d4febca prerequisite-patch-id: 453b66b1faaaebaa1666954185de327298aa0578 prerequisite-patch-id: f98da1de781c203a53cae73c5bb707240d21cb0a prerequisite-patch-id: 14b1718dbc4fb9cd94e1094a4d44ebfcfe6ad869 prerequisite-patch-id: 3b68944fa8fb2fab0c21d6ff73f649f53dd6f551 prerequisite-patch-id: 82d1e6bcd221f982b6ab1ed0e9a90d46a39562c4 prerequisite-patch-id: c9cce20b146f955b715d15c0c384c9acc6176493 prerequisite-patch-id: c204491c1db4f5056711768265f101e881e4e415 prerequisite-patch-id: e66e13fbde027e99552fc6d80ff8d48c110a18f2 prerequisite-patch-id: 3c313f0a20730c653c8f5ec4f318e2485a8ef60f prerequisite-patch-id: 925c466172c01c4b5976ac019961cbe240f0cddd prerequisite-patch-id: e81e0aded80adf18c861f67624a179a15ef68906 prerequisite-patch-id: 001675f7da57d25731c7c71f6f2dcaa7409e5664 prerequisite-patch-id: d65bf6ef5f51da0acba72d332d60167b34e193e1 prerequisite-patch-id: fc7c9a5024037363319b58520480a6c4a8a5dcff prerequisite-patch-id: 5aae8c77d028459d944021f4943558411deb0662 prerequisite-patch-id: 71fa80813ad36528e8a737249424d90827933c16 prerequisite-patch-id: 65dc75b8e1ddb45542480a8867ecd7a63ab3112e prerequisite-patch-id: 8619aa1dec17409d9b5ecb6ed0a2cc7d1563c174 prerequisite-patch-id: 6473142746dc5b448ec9698d577f47b4da6cd1d5 prerequisite-patch-id: eb6689695d5d1b6c650de0c86a805a45b80ab88d prerequisite-patch-id: 7d50679dad38c9f859ec231da2db78919818b40e prerequisite-patch-id: faeb97c5f9c07754bd0bf0be59254091470978c2 prerequisite-patch-id: 56e31c3ab9ed9ff19aca25d5ffb9655c6515b692 prerequisite-patch-id: 8d7418e017eec3c6e56b55f9ff6181cc3dcc1a17 prerequisite-patch-id: 84f58e5a274c980ae6905e764d479e1c960149ca prerequisite-patch-id: ada6a2d9427bff9dd7fd115a91300a1f7379995c prerequisite-patch-id: 108161d5500b39b3ac55d202b5b9af817d829724 prerequisite-patch-id: c89b0fc7dadc53facc45ccf9991503430b7e7799 prerequisite-patch-id: d62e2be8f9fd6a1d9ac8dfa2cdc4db6d4a4327ac prerequisite-patch-id: f8f4375b2b16ffae596d416607c00b374f485299 prerequisite-patch-id: 36b1a9c3e0e9f91b7172e1211231759a6cb81473 prerequisite-patch-id: 8cb6ac6a5188c817bb3a6a86920001de75bb7225 prerequisite-patch-id: 17ef87336a8c664e0109a7466c9f7d37f5901167 -- 2.41.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH v3 4/7] guix: import: composer: Use memoization. Resent-From: Nicolas Graves <ngraves@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Tue, 26 Sep 2023 10:33:02 +0000 Resent-Message-ID: <handler.42338.B42338.1695724346335 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Cc: ngraves@HIDDEN Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.1695724346335 (code B ref 42338); Tue, 26 Sep 2023 10:33:02 +0000 Received: (at 42338) by debbugs.gnu.org; 26 Sep 2023 10:32:26 +0000 Received: from localhost ([127.0.0.1]:47353 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ql5Mf-00005I-Va for submit <at> debbugs.gnu.org; Tue, 26 Sep 2023 06:32:26 -0400 Received: from 4.mo576.mail-out.ovh.net ([46.105.42.102]:39685) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1ql5MX-0008W4-J6 for 42338 <at> debbugs.gnu.org; Tue, 26 Sep 2023 06:32:19 -0400 Received: from director9.ghost.mail-out.ovh.net (unknown [10.108.1.239]) by mo576.mail-out.ovh.net (Postfix) with ESMTP id 6496F29B90 for <42338 <at> debbugs.gnu.org>; Tue, 26 Sep 2023 10:32:03 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-kn9l4 (unknown [10.108.16.250]) by director9.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 147301FEB9; Tue, 26 Sep 2023 10:32:02 +0000 (UTC) Received: from ngraves.fr ([37.59.142.101]) by ghost-submission-6684bf9d7b-kn9l4 with ESMTPSA id l3fBOSKzEmXEmQAAc8hNeQ (envelope-from <ngraves@HIDDEN>); Tue, 26 Sep 2023 10:32:02 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-101G004299ee593-ab13-4c2f-bf67-bdd233d952a8, 673A0E1412D75BE9E6E9083740E1979C5D801E24) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 81.67.140.142 From: Nicolas Graves <ngraves@HIDDEN> Date: Tue, 26 Sep 2023 12:31:41 +0200 Message-ID: <7fa9b1098369b75b162944d5db9a6d646af115ad.1695724304.git.ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 In-Reply-To: <6abfbb4d4d57642fea6bae5835ff0d365de7e24a.1695724304.git.ngraves@HIDDEN> References: <6abfbb4d4d57642fea6bae5835ff0d365de7e24a.1695724304.git.ngraves@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 12908160960454255330 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvjedrtddtgddtudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecunecujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpefggfefvefhgeeuteegkedtieeujeeileetffduuefgfeffleffgeevfeeftefftdenucffohhmrghinhepphgrtghkrghgihhsthdrohhrghenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegtddrudegvddpfeejrdehledrudegvddruddtudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepgedvfeefkeesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheejiedpmhhouggvpehsmhhtphhouhht X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) --- guix/import/composer.scm | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/guix/import/composer.scm b/guix/import/composer.scm index c152f402bb..177dc63092 100644 --- a/guix/import/composer.scm +++ b/guix/import/composer.scm @@ -27,6 +27,7 @@ (define-module (guix import composer) #:use-module (guix import json) #:use-module (guix import utils) #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix memoization) #:use-module (guix packages) #:use-module (guix serialization) #:use-module (guix upstream) @@ -197,16 +198,18 @@ (define (make-php-sexp composer-package) ((license) license) (_ license))))))))) -(define* (composer->guix-package package-name #:optional version) - "Fetch the metadata for PACKAGE-NAME from packagist.org, and return the +(define composer->guix-package + (memoize + (lambda* (package-name #:key version #:allow-other-keys) + "Fetch the metadata for PACKAGE-NAME from packagist.org, and return the `package' s-expression corresponding to that package, or #f on failure." - (let ((package (composer-fetch package-name version))) - (and package - (let* ((package (json->composer-package package)) - (dependencies-names (composer-package-require package)) - (dev-dependencies-names (composer-package-dev-require package))) - (values (make-php-sexp package) - (append dependencies-names dev-dependencies-names)))))) + (let ((package (composer-fetch package-name version))) + (and package + (let* ((package (json->composer-package package)) + (dependencies-names (composer-package-require package)) + (dev-dependencies-names (composer-package-dev-require package))) + (values (make-php-sexp package) + (append dependencies-names dev-dependencies-names)))))))) (define (guix-name->composer-name name) "Given a guix package name, return the name of the package in Packagist." @@ -265,6 +268,7 @@ (define %composer-updater (import latest-release))) (define* (composer-recursive-import package-name #:optional version) - (recursive-import package-name '() + (recursive-import package-name + #:version version #:repo->guix-package composer->guix-package #:guix-name php-package-name)) -- 2.41.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH v3 3/7] guix: Add composer-build-system. Resent-From: Nicolas Graves <ngraves@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Tue, 26 Sep 2023 10:33:03 +0000 Resent-Message-ID: <handler.42338.B42338.1695724348350 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Cc: ngraves@HIDDEN Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.1695724348350 (code B ref 42338); Tue, 26 Sep 2023 10:33:03 +0000 Received: (at 42338) by debbugs.gnu.org; 26 Sep 2023 10:32:28 +0000 Received: from localhost ([127.0.0.1]:47355 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ql5Mg-00005L-Ls for submit <at> debbugs.gnu.org; Tue, 26 Sep 2023 06:32:28 -0400 Received: from 10.mo584.mail-out.ovh.net ([188.165.33.109]:38059) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1ql5MX-0008W1-6o for 42338 <at> debbugs.gnu.org; Tue, 26 Sep 2023 06:32:20 -0400 Received: from director9.ghost.mail-out.ovh.net (unknown [10.108.16.60]) by mo584.mail-out.ovh.net (Postfix) with ESMTP id 534492817C for <42338 <at> debbugs.gnu.org>; Tue, 26 Sep 2023 10:32:02 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-pzmx6 (unknown [10.110.171.34]) by director9.ghost.mail-out.ovh.net (Postfix) with ESMTPS id CAF991FEDA; Tue, 26 Sep 2023 10:32:01 +0000 (UTC) Received: from ngraves.fr ([37.59.142.107]) by ghost-submission-6684bf9d7b-pzmx6 with ESMTPSA id ZtTALiGzEmUThwAA5xzM7g (envelope-from <ngraves@HIDDEN>); Tue, 26 Sep 2023 10:32:01 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-107S00169624b8c-b53f-4115-8dda-6dd328dde75c, 673A0E1412D75BE9E6E9083740E1979C5D801E24) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 81.67.140.142 From: Nicolas Graves <ngraves@HIDDEN> Date: Tue, 26 Sep 2023 12:31:40 +0200 Message-ID: <1b5d97a0fdbc7ee0fb031e7488f4ca6ab8c28544.1695724304.git.ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 In-Reply-To: <6abfbb4d4d57642fea6bae5835ff0d365de7e24a.1695724304.git.ngraves@HIDDEN> References: <6abfbb4d4d57642fea6bae5835ff0d365de7e24a.1695724304.git.ngraves@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 12907879482410984162 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvjedrtddtgddtudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecunecujfgurhephffvvefufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepvdfftdevheeugfeggfefjeekkeeghfduueetudduleeiffffudelgeetvdelfeeinecuffhomhgrihhnpehgvghttghomhhpohhsvghrrdhorhhgpdguuhhnvgdrsghuihhlugdpghhithhhuhgsrdgtohhmpdhgnhhurdhorhhgnecukfhppeduvdejrddtrddtrddupdekuddrieejrddugedtrddugedvpdefjedrheelrddugedvrddutdejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeegvdeffeekseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehkeegpdhmohguvgepshhmthhpohhuth X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * guix/build-system/composer.scm: New file. * guix/build/composer-build-system.scm: New file. * gnu/packages/aux-files/findclass.php: New file. * Makefile.am: Add them. * doc/guix.texi (Build Systems): Document it. --- Makefile.am | 3 + doc/guix.texi | 14 ++ gnu/packages/aux-files/findclass.php | 125 ++++++++++++++ guix/build-system/composer.scm | 162 ++++++++++++++++++ guix/build/composer-build-system.scm | 239 +++++++++++++++++++++++++++ 5 files changed, 543 insertions(+) create mode 100644 gnu/packages/aux-files/findclass.php create mode 100644 guix/build-system/composer.scm create mode 100644 guix/build/composer-build-system.scm diff --git a/Makefile.am b/Makefile.am index 3ce7ee832e..903fc42afa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -149,6 +149,7 @@ MODULES = \ guix/build-system/chicken.scm \ guix/build-system/clojure.scm \ guix/build-system/cmake.scm \ + guix/build-system/composer.scm \ guix/build-system/dub.scm \ guix/build-system/dune.scm \ guix/build-system/elm.scm \ @@ -206,6 +207,7 @@ MODULES = \ guix/build/cargo-utils.scm \ guix/build/chicken-build-system.scm \ guix/build/cmake-build-system.scm \ + guix/build/composer-build-system.scm \ guix/build/dub-build-system.scm \ guix/build/dune-build-system.scm \ guix/build/elm-build-system.scm \ @@ -411,6 +413,7 @@ dist_noinst_DATA = \ AUX_FILES = \ gnu/packages/aux-files/chromium/master-preferences.json \ gnu/packages/aux-files/emacs/guix-emacs.el \ + gnu/packages/aux-files/findclass.php \ gnu/packages/aux-files/guix.vim \ gnu/packages/aux-files/linux-libre/6.4-arm.conf \ gnu/packages/aux-files/linux-libre/6.4-arm64.conf \ diff --git a/doc/guix.texi b/doc/guix.texi index 4d2fc11cd7..d133e43773 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -9545,6 +9545,20 @@ Build Systems @code{-O2 -g}, as is the case for Autoconf-based packages by default. @end defvar +@defvar {Scheme Variable} composer-build-system +This variable is exported by @code{(guix build-system composer)}. It +implements the build procedure for packages using +@url{https://getcomposer.org/, Composer}, the PHP package manager. + +It automatically adds the @code{php} package to the set of inputs. Which +package is used can be specified with the @code{#:php} parameter. + +The @code{#:test-target} parameter is used to control which script is run +for the tests. By default, the @code{test} script is run if it exists. If +the script does not exist, the build system will run @code{phpunit} from the +source directory, assuming there is a @file{phpunit.xml} file. +@end defvar + @defvar dune-build-system This variable is exported by @code{(guix build-system dune)}. It supports builds of packages using @uref{https://dune.build/, Dune}, a build diff --git a/gnu/packages/aux-files/findclass.php b/gnu/packages/aux-files/findclass.php new file mode 100644 index 0000000000..d0b250c8e1 --- /dev/null +++ b/gnu/packages/aux-files/findclass.php @@ -0,0 +1,125 @@ +<?php +/** + * The content of this file is copied from composer's src/Composer/Autoload/ClassMapGenerator.php + * the findClasses method was extracted, to prevent using any dependency. + * + * Composer (and thus this file) is distributed under the expat license, and + * ClassMapGenerator.php also contains this notice: + * + * This file is part of Composer. + * + * (c) Nils Adermann <naderman@HIDDEN> + * Jordi Boggiano <j.boggiano@HIDDEN> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * This file is copied from the Symfony package. + * + * (c) Fabien Potencier <fabien@HIDDEN> + * + * To the extent to wich it makes sense, as the author of the extract: + * Copyright © 2020 Julien Lepiller <julien@HIDDEN> + */ + +/** + * Extract the classes in the given file + * + * @param string $path The file to check + * @throws \RuntimeException + * @return array The found classes + */ +function findClasses($path) +{ + $extraTypes = PHP_VERSION_ID < 50400 ? '' : '|trait'; + if (defined('HHVM_VERSION') && version_compare(HHVM_VERSION, '3.3', '>=')) { + $extraTypes .= '|enum'; + } + // Use @ here instead of Silencer to actively suppress 'unhelpful' output + // @link https://github.com/composer/composer/pull/4886 + $contents = @php_strip_whitespace($path); + if (!$contents) { + if (!file_exists($path)) { + $message = 'File at "%s" does not exist, check your classmap definitions'; + } elseif (!is_readable($path)) { + $message = 'File at "%s" is not readable, check its permissions'; + } elseif ('' === trim(file_get_contents($path))) { + // The input file was really empty and thus contains no classes + return array(); + } else { + $message = 'File at "%s" could not be parsed as PHP, it may be binary or corrupted'; + } + $error = error_get_last(); + if (isset($error['message'])) { + $message .= PHP_EOL . 'The following message may be helpful:' . PHP_EOL . $error['message']; + } + throw new \RuntimeException(sprintf($message, $path)); + } + // return early if there is no chance of matching anything in this file + if (!preg_match('{\b(?:class|interface'.$extraTypes.')\s}i', $contents)) { + return array(); + } + // strip heredocs/nowdocs + $contents = preg_replace('{<<<[ \t]*([\'"]?)(\w+)\\1(?:\r\n|\n|\r)(?:.*?)(?:\r\n|\n|\r)(?:\s*)\\2(?=\s+|[;,.)])}s', 'null', $contents); + // strip strings + $contents = preg_replace('{"[^"\\\\]*+(\\\\.[^"\\\\]*+)*+"|\'[^\'\\\\]*+(\\\\.[^\'\\\\]*+)*+\'}s', 'null', $contents); + // strip leading non-php code if needed + if (substr($contents, 0, 2) !== '<?') { + $contents = preg_replace('{^.+?<\?}s', '<?', $contents, 1, $replacements); + if ($replacements === 0) { + return array(); + } + } + // strip non-php blocks in the file + $contents = preg_replace('{\?>(?:[^<]++|<(?!\?))*+<\?}s', '?><?', $contents); + // strip trailing non-php code if needed + $pos = strrpos($contents, '?>'); + if (false !== $pos && false === strpos(substr($contents, $pos), '<?')) { + $contents = substr($contents, 0, $pos); + } + // strip comments if short open tags are in the file + if (preg_match('{(<\?)(?!(php|hh))}i', $contents)) { + $contents = preg_replace('{//.* | /\*(?:[^*]++|\*(?!/))*\*/}x', '', $contents); + } + preg_match_all('{ + (?: + \b(?<![\$:>])(?P<type>class|interface'.$extraTypes.') \s++ (?P<name>[a-zA-Z_\x7f-\xff:][a-zA-Z0-9_\x7f-\xff:\-]*+) + | \b(?<![\$:>])(?P<ns>namespace) (?P<nsname>\s++[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+(?:\s*+\\\\\s*+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+)*+)? \s*+ [\{;] + ) + }ix', $contents, $matches); + $classes = array(); + $namespace = ''; + for ($i = 0, $len = count($matches['type']); $i < $len; $i++) { + if (!empty($matches['ns'][$i])) { + $namespace = str_replace(array(' ', "\t", "\r", "\n"), '', $matches['nsname'][$i]) . '\\'; + } else { + $name = $matches['name'][$i]; + // skip anon classes extending/implementing + if ($name === 'extends' || $name === 'implements') { + continue; + } + if ($name[0] === ':') { + // This is an XHP class, https://github.com/facebook/xhp + $name = 'xhp'.substr(str_replace(array('-', ':'), array('_', '__'), $name), 1); + } elseif ($matches['type'][$i] === 'enum') { + // In Hack, something like: + // enum Foo: int { HERP = '123'; } + // The regex above captures the colon, which isn't part of + // the class name. + $name = rtrim($name, ':'); + } + $classes[] = ltrim($namespace . $name, '\\'); + } + } + return $classes; +} + +$options = getopt('i:f:', []); +$file = $options["f"]; +$input = $options["i"]; + +$classes = findClasses($file); +foreach($classes as $class) { + echo '$classmap[\''.$class.'\'] = \''.$input.'/'.$file.'\';'; + echo "\n"; +} diff --git a/guix/build-system/composer.scm b/guix/build-system/composer.scm new file mode 100644 index 0000000000..8bf99ff9c5 --- /dev/null +++ b/guix/build-system/composer.scm @@ -0,0 +1,162 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2019 Julien Lepiller <julien@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. +(define-module (guix build-system composer) + #:use-module (guix store) + #:use-module (guix utils) + #:use-module (guix derivations) + #:use-module (guix search-paths) + #:use-module (guix build-system) + #:use-module (guix build-system gnu) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (gnu packages) + #:use-module (ice-9 match) + #:use-module (srfi srfi-1) + #:export (%composer-build-system-modules + lower + composer-build + composer-build-system)) + +;; Commentary: +;; +;; Standard build procedure for PHP packages using Composer. This is implemented +;; as an extension of `gnu-build-system'. +;; +;; Code: + +(define (default-php) + "Return the default PHP package." + + ;; Do not use `@' to avoid introducing circular dependencies. + (let ((module (resolve-interface '(gnu packages php)))) + (module-ref module 'php))) + +(define (default-findclass) + "Return the default findclass script." + (search-auxiliary-file "findclass.php")) + +(define (default-composer-classloader) + "Return the default composer-classloader package." + + ;; Do not use `@' to avoid introducing circular dependencies. + (let ((module (resolve-interface '(gnu packages php-xyz)))) + (module-ref module 'composer-classloader))) + +(define %composer-build-system-modules + ;; Build-side modules imported by default. + `((guix build composer-build-system) + (guix build union) + (json) + (json builder) + (json parser) + (json record) + ,@%gnu-build-system-modules)) + +(define* (lower name + #:key source inputs native-inputs outputs system target + (php (default-php)) + (composer-classloader (default-composer-classloader)) + (findclass (default-findclass)) + #:allow-other-keys + #:rest arguments) + "Return a bag for NAME." + (define private-keywords + '(#:target #:php #:composer-classloader #:findclass #:inputs #:native-inputs)) + + (and (not target) ;XXX: no cross-compilation + (bag + (name name) + (system system) + (host-inputs `(,@(if source + `(("source" ,source)) + '()) + ,@inputs + + ;; Keep the standard inputs of 'gnu-build-system'. + ,@(standard-packages))) + (build-inputs `(("php" ,php) + ("findclass.php" ,findclass) + ("composer-classloader" ,composer-classloader) + ,@native-inputs)) + (outputs outputs) + (build composer-build) + (arguments (strip-keyword-arguments private-keywords arguments))))) + +(define* (composer-build name inputs + #:key + guile source + (outputs '("out")) + (configure-flags ''()) + (search-paths '()) + (out-of-source? #t) + (composer-file "composer.json") + (tests? #t) + (test-target "test") + (install-target "install") + (validate-runpath? #t) + (patch-shebangs? #t) + (strip-binaries? #t) + (strip-flags #~'("--strip-debug")) + (strip-directories #~'("lib" "lib64" "libexec" + "bin" "sbin")) + (phases '(@ (guix build composer-build-system) + %standard-phases)) + (system (%current-system)) + (imported-modules %composer-build-system-modules) + (modules '((guix build composer-build-system) + (guix build utils)))) + "Build SOURCE using PHP, and with INPUTS. This assumes that SOURCE provides +a 'composer.json' file as its build system." + (define builder + (with-imported-modules imported-modules + #~(begin + (use-modules #$@(sexp->gexp modules)) + + #$(with-build-variables inputs outputs + #~(composer-build + #:source #$source + #:system #$system + #:outputs %outputs + #:inputs %build-inputs + #:search-paths '#$(map search-path-specification->sexp + search-paths) + #:phases #$phases + #:out-of-source? #$out-of-source? + #:composer-file #$composer-file + #:tests? #$tests? + #:test-target #$test-target + #:install-target #$install-target + #:validate-runpath? #$validate-runpath? + #:patch-shebangs? #$patch-shebangs? + #:strip-binaries? #$strip-binaries? + #:strip-flags #$strip-flags + #:strip-directories #$strip-directories))))) + + (gexp->derivation name builder + #:system system + #:target #f + #:graft? #f + #:guile-for-build guile)) + +(define composer-build-system + (build-system + (name 'composer) + (description "The standard Composer build system") + (lower lower))) + +;;; composer.scm ends here diff --git a/guix/build/composer-build-system.scm b/guix/build/composer-build-system.scm new file mode 100644 index 0000000000..7df2b7c400 --- /dev/null +++ b/guix/build/composer-build-system.scm @@ -0,0 +1,239 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2019 Julien Lepiller <julien@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (guix build composer-build-system) + #:use-module ((guix build gnu-build-system) #:prefix gnu:) + #:use-module (guix build utils) + #:use-module (ice-9 match) + #:use-module (json) + #:use-module (srfi srfi-26) + #:export (%standard-phases + composer-build)) + +;; Commentary: +;; +;; Builder-side code of the standard composer build procedure. +;; +;; Code: + +(define (json->require dict) + (if dict + (let loop ((result '()) (require dict)) + (match require + (() result) + ((((? (cut string-contains <> "/") name) . _) + require ...) + (loop (cons name result) require)) + ((_ require ...) (loop result require)))) + '())) + +(define-json-mapping <composer-autoload> make-composer-autoload composer-autoload? + json->composer-autoload + (psr-4 composer-autoload-psr-4 "psr-4" + (match-lambda + (#f '()) + (psr-4 psr-4))) + (classmap composer-autoload-classmap "classmap" + (match-lambda + (#f '()) + (#(lst ...) lst)))) + +(define-json-mapping <composer-package> make-composer-package composer-package? + json->composer-package + (name composer-package-name) + (autoload composer-package-autoload "autoload" json->composer-autoload) + (autoload-dev composer-package-autoload-dev "autoload-dev" json->composer-autoload) + (require composer-package-require "require" json->require) + (dev-require composer-package-dev-require "require-dev" json->require) + (scripts composer-package-scripts "scripts" + (match-lambda + (#f '()) + ((scripts ...) scripts))) + (binaries composer-package-binaries "bin" + (match-lambda + (#f '()) + (#(lst ...) lst)))) + +(define* (read-package-data #:key (filename "composer.json")) + (call-with-input-file filename + (lambda (port) + (json->composer-package (json->scm port))))) + +(define* (check #:key composer-file inputs outputs tests? test-target #:allow-other-keys) + "Test the given package." + (when tests? + (mkdir-p "vendor") + (create-autoload (string-append (getcwd) "/vendor") composer-file + (append inputs outputs) #:dev-dependencies? #t) + (let* ((package-data (read-package-data #:filename composer-file)) + (scripts (composer-package-scripts package-data)) + (test-script (assoc-ref scripts test-target)) + (dependencies (composer-package-require package-data)) + (dependencies-dev (composer-package-dev-require package-data)) + (name (composer-package-name package-data))) + (for-each + (match-lambda + ((_ . input) + (let ((bin (find-php-bin input))) + (when bin + (copy-recursively bin "vendor/bin"))))) + inputs) + (match test-script + ((? string? command) + (unless (zero? (system command)) + (throw 'failed-command command))) + (('@ (? string? command) ...) + (for-each + (lambda (c) + (unless (zero? (system c)) + (throw 'failed-command c))) + command)) + (#f (invoke "vendor/bin/phpunit")))))) + +(define (find-php-bin input) + (let* ((web-dir (string-append input "/share/web")) + (vendors (if (file-exists? web-dir) + (find-files web-dir "^vendor$" #:directories? #t) + #f))) + (match vendors + ((vendor) + (let ((bin (string-append vendor "/bin"))) + (and (file-exists? bin) bin))) + (_ #f)))) + +(define (find-php-dep inputs dependency) + (let loop ((inputs inputs)) + (match inputs + (() (throw 'unsatisfied-dependency "Unsatisfied dependency: required " + dependency)) + (((_ . input) inputs ...) + (let ((autoload (string-append input "/share/web/" dependency + "/vendor/autoload_conf.php"))) + (if (file-exists? autoload) + autoload + (loop inputs))))))) + +(define* (create-autoload vendor composer-file inputs #:key dev-dependencies?) + "creates an autoload.php file that sets up the class locations for this package, +so it can be autoloaded by PHP when the package classes are required." + (with-output-to-file (string-append vendor "/autoload.php") + (lambda _ + (display (string-append + "<?php +// autoload.php @generated by Guix +$map = $psr4map = $classmap = array(); +require_once '" vendor "/autoload_conf.php' +require_once '" (assoc-ref inputs "composer-classloader") "/share/web/composer/ClassLoader.php' +$loader = new \\Composer\\Autoload\\ClassLoader(); +foreach ($map as $namespace => $path) { + $loader->set($namespace, $path); +} +foreach ($psr4map as $namespace => $path) { + $loader->setPsr4($namespace, $path); +} +$loader->addClassMap($classmap); +$loader->register(); +")))) + ;; Now, create autoload_conf.php that contains the actual data, as a set + ;; of arrays + (let* ((package-data (read-package-data #:filename composer-file)) + (autoload (composer-package-autoload package-data)) + (autoload-dev (composer-package-autoload-dev package-data)) + (dependencies (composer-package-require package-data)) + (dependencies-dev (composer-package-dev-require package-data))) + (with-output-to-file (string-append vendor "/autoload_conf.php") + (lambda _ + (format #t "<?php~%") + (format #t "// autoload_conf.php @generated by Guix~%") + (force-output) + (for-each + (lambda (psr4) + (match psr4 + ((key . value) + (format #t "$psr4map['~a'] = '~a/../~a';~%" + (string-join (string-split key #\\) "\\\\") + vendor value)))) + (append + (composer-autoload-psr-4 autoload) + (if dev-dependencies? + (composer-autoload-psr-4 autoload-dev) + '()))) + (for-each + (lambda (classmap) + (for-each + (lambda (file) + (invoke "php" (assoc-ref inputs "findclass.php") + "-i" (string-append vendor "/..") "-f" file)) + (find-files classmap ".(php|hh|inc)$"))) + (append + (composer-autoload-classmap autoload) + (if dev-dependencies? + (composer-autoload-classmap autoload-dev) + '()))) + (for-each + (lambda (dep) + (format #t "require_once '~a';~%" (find-php-dep inputs dep))) + (append + dependencies + (if dev-dependencies? + dependencies-dev + '()))))))) + +(define* (install #:key inputs outputs composer-file #:allow-other-keys) + "Install the given package." + (let* ((out (assoc-ref outputs "out")) + (package-data (read-package-data #:filename composer-file)) + (name (composer-package-name package-data)) + (php-dir (string-append out "/share/web/" name)) + (bin-dir (string-append php-dir "/vendor/bin")) + (bin (string-append out "/bin")) + (binaries (composer-package-binaries package-data))) + (mkdir-p php-dir) + (copy-recursively "." php-dir) + (mkdir-p (string-append php-dir "/vendor")) + (when binaries + (mkdir-p bin-dir) + (mkdir-p bin) + (for-each + (lambda (file) + (let ((installed-file (string-append bin-dir "/" (basename file))) + (bin-file (string-append bin "/" (basename file))) + (original-file (string-append php-dir "/" file))) + (symlink original-file installed-file) + (symlink original-file bin-file))) + binaries)) + (create-autoload (string-append php-dir "/vendor") + composer-file inputs))) + +(define %standard-phases + ;; Everything is as with the GNU Build System except for the `configure' + ;; , `build', `check' and `install' phases. + (modify-phases gnu:%standard-phases + (delete 'bootstrap) + (delete 'configure) + (delete 'build) + (delete 'check) + (replace 'install install) + (add-after 'install 'check check))) + +(define* (composer-build #:key inputs (phases %standard-phases) + #:allow-other-keys #:rest args) + "Build the given package, applying all of PHASES in order." + (apply gnu:gnu-build #:inputs inputs #:phases phases args)) + +;;; composer-build-system.scm ends here -- 2.41.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH v3 5/7] guix: import: composer: Fix json->require. Resent-From: Nicolas Graves <ngraves@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Tue, 26 Sep 2023 10:33:03 +0000 Resent-Message-ID: <handler.42338.B42338.1695724348361 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Cc: ngraves@HIDDEN Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.1695724348361 (code B ref 42338); Tue, 26 Sep 2023 10:33:03 +0000 Received: (at 42338) by debbugs.gnu.org; 26 Sep 2023 10:32:28 +0000 Received: from localhost ([127.0.0.1]:47357 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ql5Mi-00005X-6m for submit <at> debbugs.gnu.org; Tue, 26 Sep 2023 06:32:28 -0400 Received: from 4.mo550.mail-out.ovh.net ([46.105.76.26]:40375) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1ql5Ma-0008WN-VL for 42338 <at> debbugs.gnu.org; Tue, 26 Sep 2023 06:32:21 -0400 Received: from director3.ghost.mail-out.ovh.net (unknown [10.108.20.107]) by mo550.mail-out.ovh.net (Postfix) with ESMTP id AEBFE28B73 for <42338 <at> debbugs.gnu.org>; Tue, 26 Sep 2023 10:32:06 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-t95hk (unknown [10.110.103.232]) by director3.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 555931FEDF; Tue, 26 Sep 2023 10:32:06 +0000 (UTC) Received: from ngraves.fr ([37.59.142.110]) by ghost-submission-6684bf9d7b-t95hk with ESMTPSA id daO4DyazEmXnCw4AeioZ3w (envelope-from <ngraves@HIDDEN>); Tue, 26 Sep 2023 10:32:06 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-110S004a5be8d66-0766-4999-8689-73ea4ca22628, 673A0E1412D75BE9E6E9083740E1979C5D801E24) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 81.67.140.142 From: Nicolas Graves <ngraves@HIDDEN> Date: Tue, 26 Sep 2023 12:31:42 +0200 Message-ID: <5e275b0faafb6897f995d2c37d39984fca5eb9e1.1695724304.git.ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 In-Reply-To: <6abfbb4d4d57642fea6bae5835ff0d365de7e24a.1695724304.git.ngraves@HIDDEN> References: <6abfbb4d4d57642fea6bae5835ff0d365de7e24a.1695724304.git.ngraves@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 12909005384570561250 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvjedrtddtgddtudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecunecujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeelffejteeutefhfeekfffffedvudekjeekgfeludeitdfhkeevhfeivdfhffeggeenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegtddrudegvddpfeejrdehledrudegvddruddutdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepgedvfeefkeesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheehtddpmhhouggvpehsmhhtphhouhht X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) --- guix/import/composer.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/guix/import/composer.scm b/guix/import/composer.scm index 177dc63092..3acbbecf82 100644 --- a/guix/import/composer.scm +++ b/guix/import/composer.scm @@ -88,7 +88,8 @@ (define (json->require dict) ((((? (cut string-contains <> "/") name) . _) require ...) (loop (cons name result) require)) - ((_ require ...) (loop result require)))) + ((_ require ...) (loop result require)) + (_ result))) '())) (define-json-mapping <composer-source> make-composer-source composer-source? -- 2.41.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH v3 6/7] guix: import: composer: More robust string->license. Resent-From: Nicolas Graves <ngraves@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Tue, 26 Sep 2023 10:33:04 +0000 Resent-Message-ID: <handler.42338.B42338.1695724348372 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Cc: ngraves@HIDDEN Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.1695724348372 (code B ref 42338); Tue, 26 Sep 2023 10:33:04 +0000 Received: (at 42338) by debbugs.gnu.org; 26 Sep 2023 10:32:28 +0000 Received: from localhost ([127.0.0.1]:47359 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ql5Mi-00005j-Fe for submit <at> debbugs.gnu.org; Tue, 26 Sep 2023 06:32:28 -0400 Received: from 9.mo581.mail-out.ovh.net ([46.105.60.248]:39603) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1ql5Mb-00004s-W3 for 42338 <at> debbugs.gnu.org; Tue, 26 Sep 2023 06:32:22 -0400 Received: from director7.ghost.mail-out.ovh.net (unknown [10.109.146.1]) by mo581.mail-out.ovh.net (Postfix) with ESMTP id B3394284AC for <42338 <at> debbugs.gnu.org>; Tue, 26 Sep 2023 10:32:07 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-tbpgm (unknown [10.110.115.108]) by director7.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 41AA01FEF9; Tue, 26 Sep 2023 10:32:07 +0000 (UTC) Received: from ngraves.fr ([37.59.142.110]) by ghost-submission-6684bf9d7b-tbpgm with ESMTPSA id mEMgEyezEmXamwAAkgoTgg (envelope-from <ngraves@HIDDEN>); Tue, 26 Sep 2023 10:32:07 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-110S004e3410f9d-18f5-4170-80aa-e9501dc166e0, 673A0E1412D75BE9E6E9083740E1979C5D801E24) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 81.67.140.142 From: Nicolas Graves <ngraves@HIDDEN> Date: Tue, 26 Sep 2023 12:31:43 +0200 Message-ID: <ea519115fce9bd5788fb476d59bf4a2f42b66334.1695724304.git.ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 In-Reply-To: <6abfbb4d4d57642fea6bae5835ff0d365de7e24a.1695724304.git.ngraves@HIDDEN> References: <6abfbb4d4d57642fea6bae5835ff0d365de7e24a.1695724304.git.ngraves@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 12909286858710311650 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvjedrtddtgddtudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecunecujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeelffejteeutefhfeekfffffedvudekjeekgfeludeitdfhkeevhfeivdfhffeggeenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegtddrudegvddpfeejrdehledrudegvddruddutdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepgedvfeefkeesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheekuddpmhhouggvpehsmhhtphhouhht X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * guix/import/composer.scm (string->license): Use spdx-string->license. Fall back to unknown-license!. --- guix/import/composer.scm | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/guix/import/composer.scm b/guix/import/composer.scm index 3acbbecf82..2ce7206ef9 100644 --- a/guix/import/composer.scm +++ b/guix/import/composer.scm @@ -194,10 +194,8 @@ (define (make-php-sexp composer-package) (synopsis "") (description ,(composer-package-description composer-package)) (home-page ,(composer-package-homepage composer-package)) - (license ,(match (composer-package-license composer-package) - (() #f) - ((license) license) - (_ license))))))))) + (license ,(or (composer-package-license composer-package) + 'unknown-license!)))))))) (define composer->guix-package (memoize @@ -234,14 +232,15 @@ (define (guix-package->composer-name package) (define (string->license str) "Convert the string STR into a license object." - (match str - ("GNU LGPL" 'license:lgpl2.0) - ("GPL" 'license:gpl3) - ((or "BSD" "BSD License" "BSD-3-Clause") 'license:bsd-3) - ((or "MIT" "MIT license" "Expat license") 'license:expat) - ("Public domain" 'license:public-domain) - ((or "Apache License, Version 2.0" "Apache 2.0") 'license:asl2.0) - (_ #f))) + (or (spdx-string->license str) + (match str + ("GNU LGPL" 'license:lgpl2.0) + ("GPL" 'license:gpl3) + ((or "BSD" "BSD License") 'license:bsd-3) + ((or "MIT" "MIT license" "Expat license") 'license:expat) + ("Public domain" 'license:public-domain) + ((or "Apache License, Version 2.0" "Apache 2.0") 'license:asl2.0) + (_ 'unknown-license!)))) (define (php-package? package) "Return true if PACKAGE is a PHP package from Packagist." -- 2.41.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH v3 7/7] guix: import: composer: Modern inputs formatting. Resent-From: Nicolas Graves <ngraves@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Tue, 26 Sep 2023 10:33:04 +0000 Resent-Message-ID: <handler.42338.B42338.1695724349378 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Cc: ngraves@HIDDEN Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.1695724349378 (code B ref 42338); Tue, 26 Sep 2023 10:33:04 +0000 Received: (at 42338) by debbugs.gnu.org; 26 Sep 2023 10:32:29 +0000 Received: from localhost ([127.0.0.1]:47361 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ql5Mi-00005x-Qj for submit <at> debbugs.gnu.org; Tue, 26 Sep 2023 06:32:29 -0400 Received: from 8.mo560.mail-out.ovh.net ([188.165.52.147]:32893) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1ql5Mc-00004w-Is for 42338 <at> debbugs.gnu.org; Tue, 26 Sep 2023 06:32:23 -0400 Received: from director10.ghost.mail-out.ovh.net (unknown [10.109.138.183]) by mo560.mail-out.ovh.net (Postfix) with ESMTP id 87E3A25D9C for <42338 <at> debbugs.gnu.org>; Tue, 26 Sep 2023 10:32:08 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-m8lqn (unknown [10.110.103.49]) by director10.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 50AA31FE9E; Tue, 26 Sep 2023 10:32:08 +0000 (UTC) Received: from ngraves.fr ([37.59.142.105]) by ghost-submission-6684bf9d7b-m8lqn with ESMTPSA id vF1/EiizEmVdkAAAQTdqxw (envelope-from <ngraves@HIDDEN>); Tue, 26 Sep 2023 10:32:08 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-105G006aa15aec8-ac7e-4f60-a816-01592729e44a, 673A0E1412D75BE9E6E9083740E1979C5D801E24) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 81.67.140.142 From: Nicolas Graves <ngraves@HIDDEN> Date: Tue, 26 Sep 2023 12:31:44 +0200 Message-ID: <810bc98dafaceec34fb584732fc19b7f836ae110.1695724304.git.ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 In-Reply-To: <6abfbb4d4d57642fea6bae5835ff0d365de7e24a.1695724304.git.ngraves@HIDDEN> References: <6abfbb4d4d57642fea6bae5835ff0d365de7e24a.1695724304.git.ngraves@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 12909568332823323362 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvjedrtddtgddtudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecunecujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeelffejteeutefhfeekfffffedvudekjeekgfeludeitdfhkeevhfeivdfhffeggeenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegtddrudegvddpfeejrdehledrudegvddruddtheenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepgedvfeefkeesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheeitddpmhhouggvpehsmhhtphhouhht X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * guix/import/composer.scm (make-php-sexp): Update inputs formatting. --- guix/import/composer.scm | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/guix/import/composer.scm b/guix/import/composer.scm index 2ce7206ef9..b4710c6fb9 100644 --- a/guix/import/composer.scm +++ b/guix/import/composer.scm @@ -176,21 +176,11 @@ (define (make-php-sexp composer-package) ,@(if (null? dependencies) '() `((inputs - (,'quasiquote - ,(map (lambda (name) - `(,name - (,'unquote - ,(string->symbol name)))) - dependencies))))) + (list ,(map string->symbol dependencies))))) ,@(if (null? dev-dependencies) '() `((native-inputs - (,'quasiquote - ,(map (lambda (name) - `(,name - (,'unquote - ,(string->symbol name)))) - dev-dependencies))))) + (list ,(map string->symbol dev-dependencies))))) (synopsis "") (description ,(composer-package-description composer-package)) (home-page ,(composer-package-homepage composer-package)) -- 2.41.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH v3 1/7] guix: import: Add composer importer. Resent-From: Nicolas Graves <ngraves@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Tue, 26 Sep 2023 10:44:02 +0000 Resent-Message-ID: <handler.42338.B42338.16957250411560 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Cc: adam.faiz5990@HIDDEN, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, julien@HIDDEN Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.16957250411560 (code B ref 42338); Tue, 26 Sep 2023 10:44:02 +0000 Received: (at 42338) by debbugs.gnu.org; 26 Sep 2023 10:44:01 +0000 Received: from localhost ([127.0.0.1]:47400 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ql5Xs-0000P1-7X for submit <at> debbugs.gnu.org; Tue, 26 Sep 2023 06:44:01 -0400 Received: from 8.mo560.mail-out.ovh.net ([188.165.52.147]:45309) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1ql5Xp-0000Om-3q for 42338 <at> debbugs.gnu.org; Tue, 26 Sep 2023 06:43:59 -0400 Received: from director9.ghost.mail-out.ovh.net (unknown [10.109.143.146]) by mo560.mail-out.ovh.net (Postfix) with ESMTP id BA54726AC4 for <42338 <at> debbugs.gnu.org>; Tue, 26 Sep 2023 10:43:42 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-bhdbb (unknown [10.111.172.213]) by director9.ghost.mail-out.ovh.net (Postfix) with ESMTPS id EDE091FECB; Tue, 26 Sep 2023 10:43:41 +0000 (UTC) Received: from ngraves.fr ([37.59.142.110]) by ghost-submission-6684bf9d7b-bhdbb with ESMTPSA id NJF+MN21EmXVfQAACTvTwQ (envelope-from <ngraves@HIDDEN>); Tue, 26 Sep 2023 10:43:41 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-110S0043179cc16-698f-4a59-8e84-22e22b30d7a9, 673A0E1412D75BE9E6E9083740E1979C5D801E24) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 81.67.140.142 From: Nicolas Graves <ngraves@HIDDEN> In-Reply-To: <6abfbb4d4d57642fea6bae5835ff0d365de7e24a.1695724304.git.ngraves@HIDDEN> References: <6abfbb4d4d57642fea6bae5835ff0d365de7e24a.1695724304.git.ngraves@HIDDEN> Date: Tue, 26 Sep 2023 12:43:39 +0200 Message-ID: <87jzsdtdt0.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Ovh-Tracer-Id: 13104911969067590219 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvjedrtddtgddtfecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufgjfhffkfggtgfgsehtqhertddttdejnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepjeekgedvvedvffduieeiudejfedujeejgfejteeuuddttdelteefveefvdffgfeinecuffhomhgrihhnpehgvghttghomhhpohhsvghrrdhorhhgpdhgnhhurdhorhhgpdhprggtkhgrghhishhtrdhorhhgpdgvgigrmhhplhgvrdgtohhmnecukfhppeduvdejrddtrddtrddupdekuddrieejrddugedtrddugedvpdefjedrheelrddugedvrdduuddtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeegvdeffeekseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehiedtpdhmohguvgepshhmthhpohhuth X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) I've just added some modernizations and fixes ontop of the : - first patch which is the latest provided in the discussion between Ludo' and Julien, with minimal fixes. - second and third patch which are the versions from Adam Faiz. The recursive import should work with these patches but often fails, probably because it loops and we eventually get a gnu-tls error probably from when github refuses to serve, because it doesn't stop on a specific package. This probably will stop looping so much one phpunit is added, with the later patches from Julien adding phpunit. In any case, it's definitely a more robust recursive import, and the error Adam experienced has been solved in the fifth patch. The sixth patch also avoids some licensing-related failures. On 2023-09-26 12:31, Nicolas Graves wrote: > * guix/import/composer.scm: New file. > * guix/scripts/import/composer.scm: New file. > * guix/tests/composer.scm: New file. > * Makefile.am: Add them. > * guix/scripts/import.scm: Add composer importer. > * doc/guix.texi (Invoking guix import): Mention it. > --- > Makefile.am | 3 + > doc/guix.texi | 20 +++ > guix/import/composer.scm | 270 +++++++++++++++++++++++++++++++ > guix/scripts/import.scm | 2 +- > guix/scripts/import/composer.scm | 107 ++++++++++++ > tests/composer.scm | 92 +++++++++++ > 6 files changed, 493 insertions(+), 1 deletion(-) > create mode 100644 guix/import/composer.scm > create mode 100644 guix/scripts/import/composer.scm > create mode 100644 tests/composer.scm > > diff --git a/Makefile.am b/Makefile.am > index 8924974e8a..3ce7ee832e 100644 > --- a/Makefile.am > +++ b/Makefile.am > @@ -274,6 +274,7 @@ MODULES =3D \ > guix/search-paths.scm \ > guix/packages.scm \ > guix/import/cabal.scm \ > + guix/import/composer.scm \ > guix/import/cpan.scm \ > guix/import/cran.scm \ > guix/import/crate.scm \ > @@ -332,6 +333,7 @@ MODULES =3D \ > guix/scripts/home/import.scm \ > guix/scripts/lint.scm \ > guix/scripts/challenge.scm \ > + guix/scripts/import/composer.scm \ > guix/scripts/import/crate.scm \ > guix/scripts/import/cpan.scm \ > guix/scripts/import/cran.scm \ > @@ -500,6 +502,7 @@ SCM_TESTS =3D \ > tests/challenge.scm \ > tests/channels.scm \ > tests/combinators.scm \ > + tests/composer.scm \ > tests/containers.scm \ > tests/cpan.scm \ > tests/cpio.scm \ > diff --git a/doc/guix.texi b/doc/guix.texi > index 46591b2f64..4d2fc11cd7 100644 > --- a/doc/guix.texi > +++ b/doc/guix.texi > @@ -14530,6 +14530,26 @@ Invoking guix import > > Additional options include: > > +@table @code > +@item --recursive > +@itemx -r > +Traverse the dependency graph of the given upstream package recursively > +and generate package expressions for all those packages that are not yet > +in Guix. > +@end table > + > +@item composer > +@cindex Composer > +@cindex PHP > +Import metadat from the @uref{https://getcomposer.org/, Composer} package > +archive used by the PHP community, as in this example: > + > +@example > +guix import composer phpunit/phpunit > +@end example > + > +Additional options include: > + > @table @code > @item --recursive > @itemx -r > diff --git a/guix/import/composer.scm b/guix/import/composer.scm > new file mode 100644 > index 0000000000..c152f402bb > --- /dev/null > +++ b/guix/import/composer.scm > @@ -0,0 +1,270 @@ > +;;; GNU Guix --- Functional package management for GNU > +;;; Copyright =C2=A9 2019 Julien Lepiller <julien@HIDDEN> > +;;; > +;;; This file is part of GNU Guix. > +;;; > +;;; GNU Guix is free software; you can redistribute it and/or modify it > +;;; under the terms of the GNU General Public License as published by > +;;; the Free Software Foundation; either version 3 of the License, or (at > +;;; your option) any later version. > +;;; > +;;; GNU Guix is distributed in the hope that it will be useful, but > +;;; WITHOUT ANY WARRANTY; without even the implied warranty of > +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +;;; GNU General Public License for more details. > +;;; > +;;; You should have received a copy of the GNU General Public License > +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. > + > +(define-module (guix import composer) > + #:use-module (ice-9 match) > + #:use-module (json) > + #:use-module (gcrypt hash) > + #:use-module (guix base32) > + #:use-module (guix build git) > + #:use-module (guix build utils) > + #:use-module (guix build-system) > + #:use-module (guix import json) > + #:use-module (guix import utils) > + #:use-module ((guix licenses) #:prefix license:) > + #:use-module (guix packages) > + #:use-module (guix serialization) > + #:use-module (guix upstream) > + #:use-module (guix utils) > + #:use-module (srfi srfi-1) > + #:use-module (srfi srfi-11) > + #:use-module (srfi srfi-26) > + #:export (composer->guix-package > + %composer-updater > + composer-recursive-import > + > + %composer-base-url)) > + > +(define %composer-base-url > + (make-parameter "https://repo.packagist.org")) > + > +;; XXX adapted from (guix scripts hash) > +(define (file-hash file select? recursive?) > + ;; Compute the hash of FILE. > + (if recursive? > + (let-values (((port get-hash) (open-sha256-port))) > + (write-file file port #:select? select?) > + (force-output port) > + (get-hash)) > + (call-with-input-file file port-sha256))) > + > +;; XXX taken from (guix scripts hash) > +(define (vcs-file? file stat) > + (case (stat:type stat) > + ((directory) > + (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) > + ((regular) > + ;; Git sub-modules have a '.git' file that is a regular text file. > + (string=3D? (basename file) ".git")) > + (else > + #f))) > + > +(define (fix-version version) > + "Return a fixed version from a version string. For instance, v10.1 ->= 10.1" > + (cond > + ((string-prefix? "version" version) > + (if (char-set-contains? char-set:digit (string-ref version 7)) > + (substring version 7) > + (substring version 8))) > + ((string-prefix? "v" version) > + (substring version 1)) > + (else version))) > + > +(define (latest-version versions) > + (fold (lambda (a b) (if (version>? (fix-version a) (fix-version b)) a = b)) > + (car versions) versions)) > + > +(define (json->require dict) > + (if dict > + (let loop ((result '()) (require dict)) > + (match require > + (() result) > + ((((? (cut string-contains <> "/") name) . _) > + require ...) > + (loop (cons name result) require)) > + ((_ require ...) (loop result require)))) > + '())) > + > +(define-json-mapping <composer-source> make-composer-source composer-sou= rce? > + json->composer-source > + (type composer-source-type) > + (url composer-source-url) > + (reference composer-source-reference)) > + > +(define-json-mapping <composer-package> make-composer-package composer-p= ackage? > + json->composer-package > + (description composer-package-description) > + (homepage composer-package-homepage) > + (source composer-package-source "source" json->composer-source) > + (name composer-package-name "name" php-package-name) > + (version composer-package-version "version" fix-version) > + (require composer-package-require "require" json->require) > + (dev-require composer-package-dev-require "require-dev" json->require) > + (license composer-package-license "license" > + (lambda (vector) > + (map string->license (vector->list vector))))) > + > +(define* (composer-fetch name #:optional version) > + "Return an alist representation of the Composer metadata for the packa= ge NAME, > +or #f on failure." > + (let ((package (json-fetch > + (string-append (%composer-base-url) "/p/" name ".json= ")))) > + (if package > + (let* ((packages (assoc-ref package "packages")) > + (package (or (assoc-ref packages name) package)) > + (versions (filter > + (lambda (version) > + (and (not (string-contains version "dev")) > + (not (string-contains version "beta"))= )) > + (map car package))) > + (version (or (if (null? version) #f version) > + (latest-version versions)))) > + (assoc-ref package version)) > + #f))) > + > +(define (php-package-name name) > + "Given the NAME of a package on Packagist, return a Guix-compliant nam= e for > +the package." > + (let ((name (string-join (string-split name #\/) "-"))) > + (if (string-prefix? "php-" name) > + (snake-case name) > + (string-append "php-" (snake-case name))))) > + > +(define (make-php-sexp composer-package) > + "Return the `package' s-expression for a PHP package for the given > +COMPOSER-PACKAGE." > + (let* ((source (composer-package-source composer-package)) > + (dependencies (map php-package-name > + (composer-package-require composer-package))) > + (dev-dependencies (map php-package-name > + (composer-package-dev-require composer-p= ackage))) > + (git? (equal? (composer-source-type source) "git"))) > + ((if git? call-with-temporary-directory call-with-temporary-output-f= ile) > + (lambda* (temp #:optional port) > + (and (if git? > + (begin > + (mkdir-p temp) > + (git-fetch (composer-source-url source) > + (composer-source-reference source) > + temp)) > + (url-fetch (composer-source-url source) temp)) > + `(package > + (name ,(composer-package-name composer-package)) > + (version ,(composer-package-version composer-package)) > + (source (origin > + ,@(if git? > + `((method git-fetch) > + (uri (git-reference > + (url ,(composer-source-url sourc= e)) > + (commit ,(composer-source-refere= nce source)))) > + (file-name (git-file-name name version)) > + (sha256 > + (base32 > + ,(bytevector->nix-base32-string > + (file-hash temp (negate vcs-file?= ) #t))))) > + `((method url-fetch) > + (uri ,(composer-source-url source)) > + (sha256 (base32 ,(guix-hash-url temp)))= )))) > + (build-system composer-build-system) > + ,@(if (null? dependencies) > + '() > + `((inputs > + (,'quasiquote > + ,(map (lambda (name) > + `(,name > + (,'unquote > + ,(string->symbol name)))) > + dependencies))))) > + ,@(if (null? dev-dependencies) > + '() > + `((native-inputs > + (,'quasiquote > + ,(map (lambda (name) > + `(,name > + (,'unquote > + ,(string->symbol name)))) > + dev-dependencies))))) > + (synopsis "") > + (description ,(composer-package-description composer-pack= age)) > + (home-page ,(composer-package-homepage composer-package)) > + (license ,(match (composer-package-license composer-packa= ge) > + (() #f) > + ((license) license) > + (_ license))))))))) > + > +(define* (composer->guix-package package-name #:optional version) > + "Fetch the metadata for PACKAGE-NAME from packagist.org, and return the > +`package' s-expression corresponding to that package, or #f on failure." > + (let ((package (composer-fetch package-name version))) > + (and package > + (let* ((package (json->composer-package package)) > + (dependencies-names (composer-package-require package)) > + (dev-dependencies-names (composer-package-dev-require pa= ckage))) > + (values (make-php-sexp package) > + (append dependencies-names dev-dependencies-names))))= )) > + > +(define (guix-name->composer-name name) > + "Given a guix package name, return the name of the package in Packagis= t." > + (if (string-prefix? "php-" name) > + (let ((components (string-split (substring name 4) #\-))) > + (match components > + ((namespace name ...) > + (string-append namespace "/" (string-join name "-"))))) > + name)) > + > +(define (guix-package->composer-name package) > + "Given a Composer PACKAGE built from Packagist, return the name of the > +package in Packagist." > + (let ((upstream-name (assoc-ref > + (package-properties package) > + 'upstream-name)) > + (name (package-name package))) > + (if upstream-name > + upstream-name > + (guix-name->composer-name name)))) > + > +(define (string->license str) > + "Convert the string STR into a license object." > + (match str > + ("GNU LGPL" 'license:lgpl2.0) > + ("GPL" 'license:gpl3) > + ((or "BSD" "BSD License" "BSD-3-Clause") 'license:bsd-3) > + ((or "MIT" "MIT license" "Expat license") 'license:expat) > + ("Public domain" 'license:public-domain) > + ((or "Apache License, Version 2.0" "Apache 2.0") 'license:asl2.0) > + (_ #f))) > + > +(define (php-package? package) > + "Return true if PACKAGE is a PHP package from Packagist." > + (and > + (eq? (build-system-name (package-build-system package)) 'composer) > + (string-prefix? "php-" (package-name package)))) > + > +(define (latest-release package) > + "Return an <upstream-source> for the latest release of PACKAGE." > + (let* ((php-name (guix-package->composer-name package)) > + (metadata (composer-fetch php-name)) > + (package (json->composer-package metadata)) > + (version (composer-package-version package)) > + (url (composer-source-url (composer-package-source package)))) > + (upstream-source > + (package (package-name package)) > + (version version) > + (urls (list url))))) > + > +(define %composer-updater > + (upstream-updater > + (name 'composer) > + (description "Updater for Composer packages") > + (pred php-package?) > + (import latest-release))) > + > +(define* (composer-recursive-import package-name #:optional version) > + (recursive-import package-name '() > + #:repo->guix-package composer->guix-package > + #:guix-name php-package-name)) > diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm > index 4ddd8d46a1..8c58dd35e2 100644 > --- a/guix/scripts/import.scm > +++ b/guix/scripts/import.scm > @@ -47,7 +47,7 @@ (define %standard-import-options '()) > > (define importers '("gnu" "pypi" "cpan" "hackage" "stackage" "egg" "elpa" > "gem" "go" "cran" "crate" "texlive" "json" "opam" > - "minetest" "elm" "hexpm")) > + "minetest" "elm" "hexpm" "composer")) > > (define (resolve-importer name) > (let ((module (resolve-interface > diff --git a/guix/scripts/import/composer.scm b/guix/scripts/import/compo= ser.scm > new file mode 100644 > index 0000000000..412bae6318 > --- /dev/null > +++ b/guix/scripts/import/composer.scm > @@ -0,0 +1,107 @@ > +;;; GNU Guix --- Functional package management for GNU > +;;; Copyright =C2=A9 2015 David Thompson <davet@HIDDEN> > +;;; Copyright =C2=A9 2018 Oleg Pykhalov <go.wigust@HIDDEN> > +;;; > +;;; This file is part of GNU Guix. > +;;; > +;;; GNU Guix is free software; you can redistribute it and/or modify it > +;;; under the terms of the GNU General Public License as published by > +;;; the Free Software Foundation; either version 3 of the License, or (at > +;;; your option) any later version. > +;;; > +;;; GNU Guix is distributed in the hope that it will be useful, but > +;;; WITHOUT ANY WARRANTY; without even the implied warranty of > +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +;;; GNU General Public License for more details. > +;;; > +;;; You should have received a copy of the GNU General Public License > +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. > + > +(define-module (guix scripts import composer) > + #:use-module (guix ui) > + #:use-module (guix utils) > + #:use-module (guix scripts) > + #:use-module (guix import composer) > + #:use-module (guix scripts import) > + #:use-module (srfi srfi-1) > + #:use-module (srfi srfi-11) > + #:use-module (srfi srfi-37) > + #:use-module (srfi srfi-41) > + #:use-module (ice-9 match) > + #:use-module (ice-9 format) > + #:export (guix-import-composer)) > + > + > +;;; > +;;; Command-line options. > +;;; > + > +(define %default-options > + '()) > + > +(define (show-help) > + (display (G_ "Usage: guix import composer PACKAGE-NAME > +Import and convert the Composer package for PACKAGE-NAME.\n")) > + (display (G_ " > + -h, --help display this help and exit")) > + (display (G_ " > + -V, --version display version information and exit")) > + (display (G_ " > + -r, --recursive generate package expressions for all Composer p= ackages\ > + that are not yet in Guix")) > + (newline) > + (show-bug-report-information)) > + > +(define %options > + ;; Specification of the command-line options. > + (cons* (option '(#\h "help") #f #f > + (lambda args > + (show-help) > + (exit 0))) > + (option '(#\V "version") #f #f > + (lambda args > + (show-version-and-exit "guix import composer"))) > + (option '(#\r "recursive") #f #f > + (lambda (opt name arg result) > + (alist-cons 'recursive #t result))) > + %standard-import-options)) > + > + > +;;; > +;;; Entry point. > +;;; > + > +(define (guix-import-composer . args) > + (define (parse-options) > + ;; Return the alist of option values. > + (args-fold* args %options > + (lambda (opt name arg result) > + (leave (G_ "~A: unrecognized option~%") name)) > + (lambda (arg result) > + (alist-cons 'argument arg result)) > + %default-options)) > + > + (let* ((opts (parse-options)) > + (args (filter-map (match-lambda > + (('argument . value) > + value) > + (_ #f)) > + (reverse opts)))) > + (match args > + ((package-name) > + (if (assoc-ref opts 'recursive) > + (map (match-lambda > + ((and ('package ('name name) . rest) pkg) > + `(define-public ,(string->symbol name) > + ,pkg)) > + (_ #f)) > + (composer-recursive-import package-name)) > + (let ((sexp (composer->guix-package package-name))) > + (unless sexp > + (leave (G_ "failed to download meta-data for package '~a'= ~%") > + package-name)) > + sexp))) > + (() > + (leave (G_ "too few arguments~%"))) > + ((many ...) > + (leave (G_ "too many arguments~%")))))) > diff --git a/tests/composer.scm b/tests/composer.scm > new file mode 100644 > index 0000000000..cefaf9f434 > --- /dev/null > +++ b/tests/composer.scm > @@ -0,0 +1,92 @@ > +;;; GNU Guix --- Functional package management for GNU > +;;; Copyright =C2=A9 2020 Julien Lepiller <julien@HIDDEN> > +;;; > +;;; This file is part of GNU Guix. > +;;; > +;;; GNU Guix is free software; you can redistribute it and/or modify it > +;;; under the terms of the GNU General Public License as published by > +;;; the Free Software Foundation; either version 3 of the License, or (at > +;;; your option) any later version. > +;;; > +;;; GNU Guix is distributed in the hope that it will be useful, but > +;;; WITHOUT ANY WARRANTY; without even the implied warranty of > +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +;;; GNU General Public License for more details. > +;;; > +;;; You should have received a copy of the GNU General Public License > +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. > + > +(define-module (test-composer) > + #:use-module (guix import composer) > + #:use-module (guix base32) > + #:use-module (gcrypt hash) > + #:use-module (guix tests http) > + #:use-module (guix grafts) > + #:use-module (srfi srfi-64) > + #:use-module (web client) > + #:use-module (ice-9 match)) > + > +;; Globally disable grafts because they can trigger early builds. > +(%graft? #f) > + > +(define test-json > + "{ > + \"packages\": { > + \"foo/bar\": { > + \"0.1\": { > + \"name\": \"foo/bar\", > + \"description\": \"description\", > + \"keywords\": [\"testing\"], > + \"homepage\": \"http://example.com\", > + \"version\": \"0.1\", > + \"license\": [\"BSD-3-Clause\"], > + \"source\": { > + \"type\": \"url\", > + \"url\": \"http://example.com/Bar-0.1.tar.gz\" > + }, > + \"require\": {}, > + \"require-dev\": {\"phpunit/phpunit\": \"1.0.0\"} > + } > + } > + } > +}") > + > +(define test-source > + "foobar") > + > +;; Avoid collisions with other tests. > +(%http-server-port 10450) > + > +(test-begin "composer") > + > +(test-assert "composer->guix-package" > + ;; Replace network resources with sample data. > + (with-http-server `((200 ,test-json) > + (200 ,test-source)) > + (parameterize ((%composer-base-url (%local-url)) > + (current-http-proxy (%local-url))) > + (match (composer->guix-package "foo/bar") > + (('package > + ('name "php-foo-bar") > + ('version "0.1") > + ('source ('origin > + ('method 'url-fetch) > + ('uri "http://example.com/Bar-0.1.tar.gz") > + ('sha256 > + ('base32 > + (? string? hash))))) > + ('build-system 'composer-build-system) > + ('native-inputs > + ('quasiquote > + (("php-phpunit-phpunit" ('unquote 'php-phpunit-phpunit))))) > + ('synopsis "") > + ('description "description") > + ('home-page "http://example.com") > + ('license 'license:bsd-3)) > + (string=3D? (bytevector->nix-base32-string > + (call-with-input-string test-source port-sha256)) > + hash)) > + (x > + (pk 'fail x #f)))))) > + > +(test-end "composer") > > base-commit: fafd3caef0d51811a5da81d6061789e2908b0dac > prerequisite-patch-id: eb618ab7b10483d917c308a38792af98baa517e2 > prerequisite-patch-id: c12968d02d99c253f858586a86b16fa32d41f1c1 > prerequisite-patch-id: 09d995d48139f8e61183d5634cda13a01cdb50f7 > prerequisite-patch-id: 86baa45ec2aad977c8c8135f7613aa391155de6d > prerequisite-patch-id: 3425fbbff6a603d60b4e143ea2141aabf4ddc92c > prerequisite-patch-id: c373c01aab5dcba3503a97d51c62a595147a041c > prerequisite-patch-id: cda857c790b88c681c4e713c5f71e40291970daf > prerequisite-patch-id: 8e234d0f4d93d2aad499eec8842be3d28da98707 > prerequisite-patch-id: 5f664cb2fd995a53765c5ffc19a708ac795cc0c4 > prerequisite-patch-id: ed447cba9cf9b7e1a1b47aa27acb14f8f2da0a8e > prerequisite-patch-id: 9f80c5bbbfb8cd3347951c4d57634e93ffa79924 > prerequisite-patch-id: 1aaa9f0d466e2d6837f75844df48a98beb70ff24 > prerequisite-patch-id: 34502820d8c0355b3ed2638c457084edeaba029d > prerequisite-patch-id: a96258da9e78cfb9ac9893cdcdeb38b69b75f134 > prerequisite-patch-id: 4a2da4ee89dbbdb2244845149ce6da967ddd5268 > prerequisite-patch-id: 9f9c4205781d1f0e2bb7af2d21875de08ee3ecd5 > prerequisite-patch-id: 9697db9b50cab8f7974c32383e0a9a786ecbd8f9 > prerequisite-patch-id: ebbd089a3313232347273c723d3deb1bf8c9bf81 > prerequisite-patch-id: e93360d66936b9efd70a6ffd41f6ecda177ad7b8 > prerequisite-patch-id: 19d76f45db1c59bd9ccd2e4e1125ffd698e9d6ce > prerequisite-patch-id: 929b39ded7ad095e9f768f7d484bbd3b7a486a3c > prerequisite-patch-id: 5e1262f77d55c91eadca113223faa84935bffd60 > prerequisite-patch-id: ad370d41983418fa704215aa3458f97c75d5d128 > prerequisite-patch-id: f179c922613390d249a365625c2ee545a908029d > prerequisite-patch-id: 03b0aaa382ddda0819ddb62479cd1885c930ddea > prerequisite-patch-id: 83b8b3a072520705dcba4b67712a29553bea1548 > prerequisite-patch-id: 9308fa06526d9bacdbcdd347cc225f6f3f87811a > prerequisite-patch-id: a017243a1a4b406caed9cec048d194cdc33d1a25 > prerequisite-patch-id: e8d5b2e787904b0dd1a650d7a0012b91a430cb03 > prerequisite-patch-id: 1cc872245864ace22db43cf2d268a87190b333b6 > prerequisite-patch-id: c277dcca77f3acde51bdffe932b9250e454086ad > prerequisite-patch-id: ea926073e68d5af7f6c76a6333520cc5f42c9789 > prerequisite-patch-id: 10008b9b34ccc8f87f2fcd8391075fe57244ac72 > prerequisite-patch-id: 443d7e3eb85f36848c2120979f9f1d3a78f8bf38 > prerequisite-patch-id: 6414c2d65c1806942d7f834e9300a8ecf8fd743f > prerequisite-patch-id: 8c6dec06b716c39ca7fada0f2872078612917779 > prerequisite-patch-id: 62e28252e9b7ab11edb03609b68369feb499f883 > prerequisite-patch-id: 84c9361c4c6d7662cfb3235cc4a6640a53e00622 > prerequisite-patch-id: 0f27045bc50089a9a88da7818448a50cd28dd295 > prerequisite-patch-id: 500413da3a81e75c5fbca62a21d9457d7b1ad8a8 > prerequisite-patch-id: 6f48169f4d69da277bcdecb8f40d2f608941d9f9 > prerequisite-patch-id: fc8b43573cc6b90033769de63ca235b16159190d > prerequisite-patch-id: ae749fc3fa0ab1768841ffb4633847b5b2233881 > prerequisite-patch-id: 46b8490d2b338229a2f3c5e39427275cf46982ba > prerequisite-patch-id: b1bb7dfb35069a2b30f5b2714bc19a249be3e1b5 > prerequisite-patch-id: 94848222eb08beb53530ba6ce626e9d8bcffecd4 > prerequisite-patch-id: f8181365677e68d8628013c7636e9ff56214ac9e > prerequisite-patch-id: aebc0f8156c409599cc7aced4b708bb5ea08a2b2 > prerequisite-patch-id: 4ce416249f6d3176a51d7e4cbbd2c6bf2982bab6 > prerequisite-patch-id: 5e14463dcc090e497bb1d29c1b4c822b43d5fdca > prerequisite-patch-id: 89306b41386cb29db7c147e8c4468a3b4d8d292d > prerequisite-patch-id: 29e414b1ede9108047ff224e1e24a3adb2c44c52 > prerequisite-patch-id: 7e15edfd04cd291f54284d13dcdbebcfb456b752 > prerequisite-patch-id: b8c18091929e58b49847ab510d3d75a8a934cad0 > prerequisite-patch-id: 7a607a1659b22afb0c21dec3d8eb1e2ed51e47a9 > prerequisite-patch-id: 89fbd04f11e5bef5703ba7ea4c2064d5ba63c4d4 > prerequisite-patch-id: b421048677352ea536dd93a61d6de987fb95d60b > prerequisite-patch-id: 25a03298bdfd6a691bb8cf68690009f8e46447e0 > prerequisite-patch-id: 3924163576eafdac47ac06de311ac317730e6631 > prerequisite-patch-id: 69b1d81677b507242f556c3e2fcf5290aeca445c > prerequisite-patch-id: a378fa79002001da51ae91eb026769eddb8a593b > prerequisite-patch-id: 86bb35c89ec3cc1b6ec47f238c84a154d5e9a1aa > prerequisite-patch-id: f8d0709d94ed99b1530bad1908ca27b1b56ea84e > prerequisite-patch-id: dcb65983aa914b8f1d1a8fbdfba34714ddb7f6fa > prerequisite-patch-id: 89752146a063d0706885819e244b4179196538b8 > prerequisite-patch-id: 1f9e7627d0b23302159cdab3d939fcec52f7ca70 > prerequisite-patch-id: f706bfa95ba0e5e72c206537ed207feb95daa888 > prerequisite-patch-id: 9b60c519b0df65eeacd5779808e0d75b011ebf7f > prerequisite-patch-id: cd6cd74eca502ebce581c223cd0d2ac4278912e8 > prerequisite-patch-id: b86e08404ef83877dfa3b76a80a12b02c61b1326 > prerequisite-patch-id: 9417f8d92995cf417bb3c4afa0786b05a756d48a > prerequisite-patch-id: 59dda13243375b013396981a4f9e17abd694d734 > prerequisite-patch-id: 89be058d0605cb8278d5d3384bb44911b188dd90 > prerequisite-patch-id: 70c26fde2fde34c031a95ef74a3321710dc4961e > prerequisite-patch-id: 38a27cdf8cbe03fdf5f9bafa5ba53f3ba644a5ad > prerequisite-patch-id: 40a6d2e51dff2531c40a38087a8aea1be7108792 > prerequisite-patch-id: 024d1bba9bcd449d2b8196b2f1a64a197cafaed8 > prerequisite-patch-id: e83d54aa767ebab267530fca74d60366160a5253 > prerequisite-patch-id: c34734661161c27224316dc519609db5c6d87a1e > prerequisite-patch-id: a58d739146fe46f6c7f203e5d2e0f114bd3f7834 > prerequisite-patch-id: 1ff8499f5ec69b737d77053e6809ec3a0b599ebc > prerequisite-patch-id: 498e5608bca9b5ebcb3592a556e75f5dcc2b7076 > prerequisite-patch-id: df6dfdea7c3d9db4649d857ce55fbeb99d4febca > prerequisite-patch-id: 453b66b1faaaebaa1666954185de327298aa0578 > prerequisite-patch-id: f98da1de781c203a53cae73c5bb707240d21cb0a > prerequisite-patch-id: 14b1718dbc4fb9cd94e1094a4d44ebfcfe6ad869 > prerequisite-patch-id: 3b68944fa8fb2fab0c21d6ff73f649f53dd6f551 > prerequisite-patch-id: 82d1e6bcd221f982b6ab1ed0e9a90d46a39562c4 > prerequisite-patch-id: c9cce20b146f955b715d15c0c384c9acc6176493 > prerequisite-patch-id: c204491c1db4f5056711768265f101e881e4e415 > prerequisite-patch-id: e66e13fbde027e99552fc6d80ff8d48c110a18f2 > prerequisite-patch-id: 3c313f0a20730c653c8f5ec4f318e2485a8ef60f > prerequisite-patch-id: 925c466172c01c4b5976ac019961cbe240f0cddd > prerequisite-patch-id: e81e0aded80adf18c861f67624a179a15ef68906 > prerequisite-patch-id: 001675f7da57d25731c7c71f6f2dcaa7409e5664 > prerequisite-patch-id: d65bf6ef5f51da0acba72d332d60167b34e193e1 > prerequisite-patch-id: fc7c9a5024037363319b58520480a6c4a8a5dcff > prerequisite-patch-id: 5aae8c77d028459d944021f4943558411deb0662 > prerequisite-patch-id: 71fa80813ad36528e8a737249424d90827933c16 > prerequisite-patch-id: 65dc75b8e1ddb45542480a8867ecd7a63ab3112e > prerequisite-patch-id: 8619aa1dec17409d9b5ecb6ed0a2cc7d1563c174 > prerequisite-patch-id: 6473142746dc5b448ec9698d577f47b4da6cd1d5 > prerequisite-patch-id: eb6689695d5d1b6c650de0c86a805a45b80ab88d > prerequisite-patch-id: 7d50679dad38c9f859ec231da2db78919818b40e > prerequisite-patch-id: faeb97c5f9c07754bd0bf0be59254091470978c2 > prerequisite-patch-id: 56e31c3ab9ed9ff19aca25d5ffb9655c6515b692 > prerequisite-patch-id: 8d7418e017eec3c6e56b55f9ff6181cc3dcc1a17 > prerequisite-patch-id: 84f58e5a274c980ae6905e764d479e1c960149ca > prerequisite-patch-id: ada6a2d9427bff9dd7fd115a91300a1f7379995c > prerequisite-patch-id: 108161d5500b39b3ac55d202b5b9af817d829724 > prerequisite-patch-id: c89b0fc7dadc53facc45ccf9991503430b7e7799 > prerequisite-patch-id: d62e2be8f9fd6a1d9ac8dfa2cdc4db6d4a4327ac > prerequisite-patch-id: f8f4375b2b16ffae596d416607c00b374f485299 > prerequisite-patch-id: 36b1a9c3e0e9f91b7172e1211231759a6cb81473 > prerequisite-patch-id: 8cb6ac6a5188c817bb3a6a86920001de75bb7225 > prerequisite-patch-id: 17ef87336a8c664e0109a7466c9f7d37f5901167 --=20 Best regards, Nicolas Graves
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH v3] guix: import: composer: Fix match-lambda with a default fallback. References: <20200713002055.1553f136@HIDDEN> In-Reply-To: <20200713002055.1553f136@HIDDEN> Resent-From: Nicolas Graves <ngraves@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Tue, 26 Sep 2023 11:26:01 +0000 Resent-Message-ID: <handler.42338.B42338.169572754316076 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Cc: ngraves@HIDDEN Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.169572754316076 (code B ref 42338); Tue, 26 Sep 2023 11:26:01 +0000 Received: (at 42338) by debbugs.gnu.org; 26 Sep 2023 11:25:43 +0000 Received: from localhost ([127.0.0.1]:47464 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ql6CE-0004BE-F4 for submit <at> debbugs.gnu.org; Tue, 26 Sep 2023 07:25:43 -0400 Received: from 5.mo584.mail-out.ovh.net ([188.165.44.50]:35381) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1ql6CA-0004B0-IP for 42338 <at> debbugs.gnu.org; Tue, 26 Sep 2023 07:25:40 -0400 Received: from director8.ghost.mail-out.ovh.net (unknown [10.108.1.93]) by mo584.mail-out.ovh.net (Postfix) with ESMTP id 2B2E227EFD for <42338 <at> debbugs.gnu.org>; Tue, 26 Sep 2023 11:25:23 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-bgkg8 (unknown [10.111.208.151]) by director8.ghost.mail-out.ovh.net (Postfix) with ESMTPS id C7E261FE65; Tue, 26 Sep 2023 11:25:22 +0000 (UTC) Received: from ngraves.fr ([37.59.142.108]) by ghost-submission-6684bf9d7b-bgkg8 with ESMTPSA id lu/eK6K/EmWRYwAAAgtjpw (envelope-from <ngraves@HIDDEN>); Tue, 26 Sep 2023 11:25:22 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-108S00272797648-57d1-4049-a2a8-5ddb49f96c0b, 673A0E1412D75BE9E6E9083740E1979C5D801E24) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 81.67.140.142 From: Nicolas Graves <ngraves@HIDDEN> Date: Tue, 26 Sep 2023 13:25:16 +0200 Message-ID: <24918b74efadc1bd47c7cf90aedf3ce821ab7048.1695727516.git.ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 13808880882807988962 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvjedrtddtgdduudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecunecujfgurhephffvvefufffkofgggfestdekredtredttdenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeekffegteffgfffjeegjedvfffgtddvueeutefgfeeuvdejgedvgeejjeevueeuveenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegtddrudegvddpfeejrdehledrudegvddruddtkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepgedvfeefkeesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheekgedpmhhouggvpehsmhhtphhouhht X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * guix/import/composer.scm: (composer-package): Fix match-lambda with a default fallback. (composer-autoload): Fix match-lambda with a default fallback. --- guix/build/composer-build-system.scm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/guix/build/composer-build-system.scm b/guix/build/composer-build-system.scm index 7df2b7c400..d891ea3a6d 100644 --- a/guix/build/composer-build-system.scm +++ b/guix/build/composer-build-system.scm @@ -46,12 +46,12 @@ (define-json-mapping <composer-autoload> make-composer-autoload composer-autoloa json->composer-autoload (psr-4 composer-autoload-psr-4 "psr-4" (match-lambda - (#f '()) - (psr-4 psr-4))) + (psr-4 psr-4) + (_ '()))) (classmap composer-autoload-classmap "classmap" (match-lambda - (#f '()) - (#(lst ...) lst)))) + (#(lst ...) lst) + (_ '())))) (define-json-mapping <composer-package> make-composer-package composer-package? json->composer-package @@ -62,12 +62,12 @@ (define-json-mapping <composer-package> make-composer-package composer-package? (dev-require composer-package-dev-require "require-dev" json->require) (scripts composer-package-scripts "scripts" (match-lambda - (#f '()) - ((scripts ...) scripts))) + ((scripts ...) scripts) + (_ '()))) (binaries composer-package-binaries "bin" (match-lambda - (#f '()) - (#(lst ...) lst)))) + (#(lst ...) lst) + (_ '())))) (define* (read-package-data #:key (filename "composer.json")) (call-with-input-file filename base-commit: fafd3caef0d51811a5da81d6061789e2908b0dac prerequisite-patch-id: eb618ab7b10483d917c308a38792af98baa517e2 prerequisite-patch-id: c12968d02d99c253f858586a86b16fa32d41f1c1 prerequisite-patch-id: 09d995d48139f8e61183d5634cda13a01cdb50f7 prerequisite-patch-id: 86baa45ec2aad977c8c8135f7613aa391155de6d prerequisite-patch-id: 3425fbbff6a603d60b4e143ea2141aabf4ddc92c prerequisite-patch-id: c373c01aab5dcba3503a97d51c62a595147a041c prerequisite-patch-id: cda857c790b88c681c4e713c5f71e40291970daf prerequisite-patch-id: 8e234d0f4d93d2aad499eec8842be3d28da98707 prerequisite-patch-id: 5f664cb2fd995a53765c5ffc19a708ac795cc0c4 prerequisite-patch-id: ed447cba9cf9b7e1a1b47aa27acb14f8f2da0a8e prerequisite-patch-id: 9f80c5bbbfb8cd3347951c4d57634e93ffa79924 prerequisite-patch-id: 1aaa9f0d466e2d6837f75844df48a98beb70ff24 prerequisite-patch-id: 34502820d8c0355b3ed2638c457084edeaba029d prerequisite-patch-id: a96258da9e78cfb9ac9893cdcdeb38b69b75f134 prerequisite-patch-id: 4a2da4ee89dbbdb2244845149ce6da967ddd5268 prerequisite-patch-id: 9f9c4205781d1f0e2bb7af2d21875de08ee3ecd5 prerequisite-patch-id: 9697db9b50cab8f7974c32383e0a9a786ecbd8f9 prerequisite-patch-id: ebbd089a3313232347273c723d3deb1bf8c9bf81 prerequisite-patch-id: e93360d66936b9efd70a6ffd41f6ecda177ad7b8 prerequisite-patch-id: 19d76f45db1c59bd9ccd2e4e1125ffd698e9d6ce prerequisite-patch-id: 929b39ded7ad095e9f768f7d484bbd3b7a486a3c prerequisite-patch-id: 5e1262f77d55c91eadca113223faa84935bffd60 prerequisite-patch-id: ad370d41983418fa704215aa3458f97c75d5d128 prerequisite-patch-id: f179c922613390d249a365625c2ee545a908029d prerequisite-patch-id: 03b0aaa382ddda0819ddb62479cd1885c930ddea prerequisite-patch-id: 83b8b3a072520705dcba4b67712a29553bea1548 prerequisite-patch-id: 9308fa06526d9bacdbcdd347cc225f6f3f87811a prerequisite-patch-id: a017243a1a4b406caed9cec048d194cdc33d1a25 prerequisite-patch-id: e8d5b2e787904b0dd1a650d7a0012b91a430cb03 prerequisite-patch-id: 1cc872245864ace22db43cf2d268a87190b333b6 prerequisite-patch-id: c277dcca77f3acde51bdffe932b9250e454086ad prerequisite-patch-id: ea926073e68d5af7f6c76a6333520cc5f42c9789 prerequisite-patch-id: 10008b9b34ccc8f87f2fcd8391075fe57244ac72 prerequisite-patch-id: 443d7e3eb85f36848c2120979f9f1d3a78f8bf38 prerequisite-patch-id: 6414c2d65c1806942d7f834e9300a8ecf8fd743f prerequisite-patch-id: 8c6dec06b716c39ca7fada0f2872078612917779 prerequisite-patch-id: 62e28252e9b7ab11edb03609b68369feb499f883 prerequisite-patch-id: 84c9361c4c6d7662cfb3235cc4a6640a53e00622 prerequisite-patch-id: 0f27045bc50089a9a88da7818448a50cd28dd295 prerequisite-patch-id: 500413da3a81e75c5fbca62a21d9457d7b1ad8a8 prerequisite-patch-id: 6f48169f4d69da277bcdecb8f40d2f608941d9f9 prerequisite-patch-id: fc8b43573cc6b90033769de63ca235b16159190d prerequisite-patch-id: ae749fc3fa0ab1768841ffb4633847b5b2233881 prerequisite-patch-id: 46b8490d2b338229a2f3c5e39427275cf46982ba prerequisite-patch-id: b1bb7dfb35069a2b30f5b2714bc19a249be3e1b5 prerequisite-patch-id: 94848222eb08beb53530ba6ce626e9d8bcffecd4 prerequisite-patch-id: f8181365677e68d8628013c7636e9ff56214ac9e prerequisite-patch-id: aebc0f8156c409599cc7aced4b708bb5ea08a2b2 prerequisite-patch-id: 4ce416249f6d3176a51d7e4cbbd2c6bf2982bab6 prerequisite-patch-id: 5e14463dcc090e497bb1d29c1b4c822b43d5fdca prerequisite-patch-id: 89306b41386cb29db7c147e8c4468a3b4d8d292d prerequisite-patch-id: 29e414b1ede9108047ff224e1e24a3adb2c44c52 prerequisite-patch-id: 7e15edfd04cd291f54284d13dcdbebcfb456b752 prerequisite-patch-id: b8c18091929e58b49847ab510d3d75a8a934cad0 prerequisite-patch-id: 7a607a1659b22afb0c21dec3d8eb1e2ed51e47a9 prerequisite-patch-id: 89fbd04f11e5bef5703ba7ea4c2064d5ba63c4d4 prerequisite-patch-id: b421048677352ea536dd93a61d6de987fb95d60b prerequisite-patch-id: 25a03298bdfd6a691bb8cf68690009f8e46447e0 prerequisite-patch-id: 3924163576eafdac47ac06de311ac317730e6631 prerequisite-patch-id: 69b1d81677b507242f556c3e2fcf5290aeca445c prerequisite-patch-id: a378fa79002001da51ae91eb026769eddb8a593b prerequisite-patch-id: 86bb35c89ec3cc1b6ec47f238c84a154d5e9a1aa prerequisite-patch-id: f8d0709d94ed99b1530bad1908ca27b1b56ea84e prerequisite-patch-id: dcb65983aa914b8f1d1a8fbdfba34714ddb7f6fa prerequisite-patch-id: 89752146a063d0706885819e244b4179196538b8 prerequisite-patch-id: 1f9e7627d0b23302159cdab3d939fcec52f7ca70 prerequisite-patch-id: f706bfa95ba0e5e72c206537ed207feb95daa888 prerequisite-patch-id: 9b60c519b0df65eeacd5779808e0d75b011ebf7f prerequisite-patch-id: cd6cd74eca502ebce581c223cd0d2ac4278912e8 prerequisite-patch-id: b86e08404ef83877dfa3b76a80a12b02c61b1326 prerequisite-patch-id: 9417f8d92995cf417bb3c4afa0786b05a756d48a prerequisite-patch-id: 59dda13243375b013396981a4f9e17abd694d734 prerequisite-patch-id: 89be058d0605cb8278d5d3384bb44911b188dd90 prerequisite-patch-id: 70c26fde2fde34c031a95ef74a3321710dc4961e prerequisite-patch-id: 38a27cdf8cbe03fdf5f9bafa5ba53f3ba644a5ad prerequisite-patch-id: 40a6d2e51dff2531c40a38087a8aea1be7108792 prerequisite-patch-id: 024d1bba9bcd449d2b8196b2f1a64a197cafaed8 prerequisite-patch-id: e83d54aa767ebab267530fca74d60366160a5253 prerequisite-patch-id: c34734661161c27224316dc519609db5c6d87a1e prerequisite-patch-id: a58d739146fe46f6c7f203e5d2e0f114bd3f7834 prerequisite-patch-id: 1ff8499f5ec69b737d77053e6809ec3a0b599ebc prerequisite-patch-id: 498e5608bca9b5ebcb3592a556e75f5dcc2b7076 prerequisite-patch-id: df6dfdea7c3d9db4649d857ce55fbeb99d4febca prerequisite-patch-id: 453b66b1faaaebaa1666954185de327298aa0578 prerequisite-patch-id: f98da1de781c203a53cae73c5bb707240d21cb0a prerequisite-patch-id: 14b1718dbc4fb9cd94e1094a4d44ebfcfe6ad869 prerequisite-patch-id: 3b68944fa8fb2fab0c21d6ff73f649f53dd6f551 prerequisite-patch-id: 82d1e6bcd221f982b6ab1ed0e9a90d46a39562c4 prerequisite-patch-id: c9cce20b146f955b715d15c0c384c9acc6176493 prerequisite-patch-id: c204491c1db4f5056711768265f101e881e4e415 prerequisite-patch-id: e66e13fbde027e99552fc6d80ff8d48c110a18f2 prerequisite-patch-id: 3c313f0a20730c653c8f5ec4f318e2485a8ef60f prerequisite-patch-id: 925c466172c01c4b5976ac019961cbe240f0cddd prerequisite-patch-id: e81e0aded80adf18c861f67624a179a15ef68906 prerequisite-patch-id: 001675f7da57d25731c7c71f6f2dcaa7409e5664 prerequisite-patch-id: d65bf6ef5f51da0acba72d332d60167b34e193e1 prerequisite-patch-id: fc7c9a5024037363319b58520480a6c4a8a5dcff prerequisite-patch-id: 5aae8c77d028459d944021f4943558411deb0662 prerequisite-patch-id: 71fa80813ad36528e8a737249424d90827933c16 prerequisite-patch-id: 65dc75b8e1ddb45542480a8867ecd7a63ab3112e prerequisite-patch-id: 8619aa1dec17409d9b5ecb6ed0a2cc7d1563c174 prerequisite-patch-id: 6473142746dc5b448ec9698d577f47b4da6cd1d5 prerequisite-patch-id: eb6689695d5d1b6c650de0c86a805a45b80ab88d prerequisite-patch-id: 7d50679dad38c9f859ec231da2db78919818b40e prerequisite-patch-id: faeb97c5f9c07754bd0bf0be59254091470978c2 prerequisite-patch-id: 56e31c3ab9ed9ff19aca25d5ffb9655c6515b692 prerequisite-patch-id: 8d7418e017eec3c6e56b55f9ff6181cc3dcc1a17 prerequisite-patch-id: 84f58e5a274c980ae6905e764d479e1c960149ca prerequisite-patch-id: ada6a2d9427bff9dd7fd115a91300a1f7379995c prerequisite-patch-id: 108161d5500b39b3ac55d202b5b9af817d829724 prerequisite-patch-id: c89b0fc7dadc53facc45ccf9991503430b7e7799 prerequisite-patch-id: d62e2be8f9fd6a1d9ac8dfa2cdc4db6d4a4327ac prerequisite-patch-id: f8f4375b2b16ffae596d416607c00b374f485299 prerequisite-patch-id: 36b1a9c3e0e9f91b7172e1211231759a6cb81473 prerequisite-patch-id: 8cb6ac6a5188c817bb3a6a86920001de75bb7225 prerequisite-patch-id: 17ef87336a8c664e0109a7466c9f7d37f5901167 prerequisite-patch-id: a2c72266baec1b3eb5706d43157d93ae8db5e42d prerequisite-patch-id: 27503579f8bdfadb95847b8dd5bf3732f5149cfb prerequisite-patch-id: 50d6d9c6ff0734705ae384ede694b547f4973249 prerequisite-patch-id: 81cd72752ab376d459dceff93f71715e55a55846 prerequisite-patch-id: 922cec7ef3d21275f5933968f5b704e0bed64ce5 prerequisite-patch-id: 1f0903e8846cd59d0d5a3dcbf9a5a82ad4dcb5cd prerequisite-patch-id: 69d839b9d5b794ef1b7dee9c592ed20300f8539f -- 2.41.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH v3] guix: import: composer: Fix match-lambda with a default fallback. Resent-From: Nicolas Graves <ngraves@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Tue, 26 Sep 2023 11:28:02 +0000 Resent-Message-ID: <handler.42338.B42338.169572766616285 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.169572766616285 (code B ref 42338); Tue, 26 Sep 2023 11:28:02 +0000 Received: (at 42338) by debbugs.gnu.org; 26 Sep 2023 11:27:46 +0000 Received: from localhost ([127.0.0.1]:47469 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ql6ED-0004Eb-9x for submit <at> debbugs.gnu.org; Tue, 26 Sep 2023 07:27:45 -0400 Received: from 9.mo561.mail-out.ovh.net ([87.98.184.141]:53509) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1ql6E9-0004EO-Ke for 42338 <at> debbugs.gnu.org; Tue, 26 Sep 2023 07:27:44 -0400 Received: from director7.ghost.mail-out.ovh.net (unknown [10.109.138.21]) by mo561.mail-out.ovh.net (Postfix) with ESMTP id 5F290277DE for <42338 <at> debbugs.gnu.org>; Tue, 26 Sep 2023 11:27:27 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-5mx8z (unknown [10.110.171.111]) by director7.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 1BA761FED9 for <42338 <at> debbugs.gnu.org>; Tue, 26 Sep 2023 11:27:27 +0000 (UTC) Received: from ngraves.fr ([37.59.142.98]) by ghost-submission-6684bf9d7b-5mx8z with ESMTPSA id QV55AB/AEmVXYwAA9jNCbg (envelope-from <ngraves@HIDDEN>) for <42338 <at> debbugs.gnu.org>; Tue, 26 Sep 2023 11:27:27 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-98R0026ea449c7-8c6d-4fdb-b5ce-a0c45d9c21ac, 673A0E1412D75BE9E6E9083740E1979C5D801E24) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 81.67.140.142 From: Nicolas Graves <ngraves@HIDDEN> In-Reply-To: <24918b74efadc1bd47c7cf90aedf3ce821ab7048.1695727516.git.ngraves@HIDDEN> References: <24918b74efadc1bd47c7cf90aedf3ce821ab7048.1695727516.git.ngraves@HIDDEN> Date: Tue, 26 Sep 2023 13:27:26 +0200 Message-ID: <87h6nhtbs1.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain X-Ovh-Tracer-Id: 13843783780259979822 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvjedrtddtgdduvdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecunecujfgurhephffvufgjfhffkfggtgesthdtredttddttdenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeeijefgffffudeivefgudeihfdtgfeljefhvdevhfegkeejvedthfdtfeeljeehgfenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegtddrudegvddpfeejrdehledrudegvddrleeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeegvdeffeekseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehiedupdhmohguvgepshhmthhpohhuth X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) I haven't tested building packages, and it seemed that there still was the same issue as the importer (no fallback for a match). With this additional patch, packages seem to build well. On 2023-09-26 13:25, Nicolas Graves wrote: > * guix/import/composer.scm: > (composer-package): Fix match-lambda with a default fallback. > (composer-autoload): Fix match-lambda with a default fallback. > --- > guix/build/composer-build-system.scm | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > > diff --git a/guix/build/composer-build-system.scm b/guix/build/composer-build-system.scm > index 7df2b7c400..d891ea3a6d 100644 > --- a/guix/build/composer-build-system.scm > +++ b/guix/build/composer-build-system.scm > @@ -46,12 +46,12 @@ (define-json-mapping <composer-autoload> make-composer-autoload composer-autoloa > json->composer-autoload > (psr-4 composer-autoload-psr-4 "psr-4" > (match-lambda > - (#f '()) > - (psr-4 psr-4))) > + (psr-4 psr-4) > + (_ '()))) > (classmap composer-autoload-classmap "classmap" > (match-lambda > - (#f '()) > - (#(lst ...) lst)))) > + (#(lst ...) lst) > + (_ '())))) > > (define-json-mapping <composer-package> make-composer-package composer-package? > json->composer-package > @@ -62,12 +62,12 @@ (define-json-mapping <composer-package> make-composer-package composer-package? > (dev-require composer-package-dev-require "require-dev" json->require) > (scripts composer-package-scripts "scripts" > (match-lambda > - (#f '()) > - ((scripts ...) scripts))) > + ((scripts ...) scripts) > + (_ '()))) > (binaries composer-package-binaries "bin" > (match-lambda > - (#f '()) > - (#(lst ...) lst)))) > + (#(lst ...) lst) > + (_ '())))) > > (define* (read-package-data #:key (filename "composer.json")) > (call-with-input-file filename > > base-commit: fafd3caef0d51811a5da81d6061789e2908b0dac > prerequisite-patch-id: eb618ab7b10483d917c308a38792af98baa517e2 > prerequisite-patch-id: c12968d02d99c253f858586a86b16fa32d41f1c1 > prerequisite-patch-id: 09d995d48139f8e61183d5634cda13a01cdb50f7 > prerequisite-patch-id: 86baa45ec2aad977c8c8135f7613aa391155de6d > prerequisite-patch-id: 3425fbbff6a603d60b4e143ea2141aabf4ddc92c > prerequisite-patch-id: c373c01aab5dcba3503a97d51c62a595147a041c > prerequisite-patch-id: cda857c790b88c681c4e713c5f71e40291970daf > prerequisite-patch-id: 8e234d0f4d93d2aad499eec8842be3d28da98707 > prerequisite-patch-id: 5f664cb2fd995a53765c5ffc19a708ac795cc0c4 > prerequisite-patch-id: ed447cba9cf9b7e1a1b47aa27acb14f8f2da0a8e > prerequisite-patch-id: 9f80c5bbbfb8cd3347951c4d57634e93ffa79924 > prerequisite-patch-id: 1aaa9f0d466e2d6837f75844df48a98beb70ff24 > prerequisite-patch-id: 34502820d8c0355b3ed2638c457084edeaba029d > prerequisite-patch-id: a96258da9e78cfb9ac9893cdcdeb38b69b75f134 > prerequisite-patch-id: 4a2da4ee89dbbdb2244845149ce6da967ddd5268 > prerequisite-patch-id: 9f9c4205781d1f0e2bb7af2d21875de08ee3ecd5 > prerequisite-patch-id: 9697db9b50cab8f7974c32383e0a9a786ecbd8f9 > prerequisite-patch-id: ebbd089a3313232347273c723d3deb1bf8c9bf81 > prerequisite-patch-id: e93360d66936b9efd70a6ffd41f6ecda177ad7b8 > prerequisite-patch-id: 19d76f45db1c59bd9ccd2e4e1125ffd698e9d6ce > prerequisite-patch-id: 929b39ded7ad095e9f768f7d484bbd3b7a486a3c > prerequisite-patch-id: 5e1262f77d55c91eadca113223faa84935bffd60 > prerequisite-patch-id: ad370d41983418fa704215aa3458f97c75d5d128 > prerequisite-patch-id: f179c922613390d249a365625c2ee545a908029d > prerequisite-patch-id: 03b0aaa382ddda0819ddb62479cd1885c930ddea > prerequisite-patch-id: 83b8b3a072520705dcba4b67712a29553bea1548 > prerequisite-patch-id: 9308fa06526d9bacdbcdd347cc225f6f3f87811a > prerequisite-patch-id: a017243a1a4b406caed9cec048d194cdc33d1a25 > prerequisite-patch-id: e8d5b2e787904b0dd1a650d7a0012b91a430cb03 > prerequisite-patch-id: 1cc872245864ace22db43cf2d268a87190b333b6 > prerequisite-patch-id: c277dcca77f3acde51bdffe932b9250e454086ad > prerequisite-patch-id: ea926073e68d5af7f6c76a6333520cc5f42c9789 > prerequisite-patch-id: 10008b9b34ccc8f87f2fcd8391075fe57244ac72 > prerequisite-patch-id: 443d7e3eb85f36848c2120979f9f1d3a78f8bf38 > prerequisite-patch-id: 6414c2d65c1806942d7f834e9300a8ecf8fd743f > prerequisite-patch-id: 8c6dec06b716c39ca7fada0f2872078612917779 > prerequisite-patch-id: 62e28252e9b7ab11edb03609b68369feb499f883 > prerequisite-patch-id: 84c9361c4c6d7662cfb3235cc4a6640a53e00622 > prerequisite-patch-id: 0f27045bc50089a9a88da7818448a50cd28dd295 > prerequisite-patch-id: 500413da3a81e75c5fbca62a21d9457d7b1ad8a8 > prerequisite-patch-id: 6f48169f4d69da277bcdecb8f40d2f608941d9f9 > prerequisite-patch-id: fc8b43573cc6b90033769de63ca235b16159190d > prerequisite-patch-id: ae749fc3fa0ab1768841ffb4633847b5b2233881 > prerequisite-patch-id: 46b8490d2b338229a2f3c5e39427275cf46982ba > prerequisite-patch-id: b1bb7dfb35069a2b30f5b2714bc19a249be3e1b5 > prerequisite-patch-id: 94848222eb08beb53530ba6ce626e9d8bcffecd4 > prerequisite-patch-id: f8181365677e68d8628013c7636e9ff56214ac9e > prerequisite-patch-id: aebc0f8156c409599cc7aced4b708bb5ea08a2b2 > prerequisite-patch-id: 4ce416249f6d3176a51d7e4cbbd2c6bf2982bab6 > prerequisite-patch-id: 5e14463dcc090e497bb1d29c1b4c822b43d5fdca > prerequisite-patch-id: 89306b41386cb29db7c147e8c4468a3b4d8d292d > prerequisite-patch-id: 29e414b1ede9108047ff224e1e24a3adb2c44c52 > prerequisite-patch-id: 7e15edfd04cd291f54284d13dcdbebcfb456b752 > prerequisite-patch-id: b8c18091929e58b49847ab510d3d75a8a934cad0 > prerequisite-patch-id: 7a607a1659b22afb0c21dec3d8eb1e2ed51e47a9 > prerequisite-patch-id: 89fbd04f11e5bef5703ba7ea4c2064d5ba63c4d4 > prerequisite-patch-id: b421048677352ea536dd93a61d6de987fb95d60b > prerequisite-patch-id: 25a03298bdfd6a691bb8cf68690009f8e46447e0 > prerequisite-patch-id: 3924163576eafdac47ac06de311ac317730e6631 > prerequisite-patch-id: 69b1d81677b507242f556c3e2fcf5290aeca445c > prerequisite-patch-id: a378fa79002001da51ae91eb026769eddb8a593b > prerequisite-patch-id: 86bb35c89ec3cc1b6ec47f238c84a154d5e9a1aa > prerequisite-patch-id: f8d0709d94ed99b1530bad1908ca27b1b56ea84e > prerequisite-patch-id: dcb65983aa914b8f1d1a8fbdfba34714ddb7f6fa > prerequisite-patch-id: 89752146a063d0706885819e244b4179196538b8 > prerequisite-patch-id: 1f9e7627d0b23302159cdab3d939fcec52f7ca70 > prerequisite-patch-id: f706bfa95ba0e5e72c206537ed207feb95daa888 > prerequisite-patch-id: 9b60c519b0df65eeacd5779808e0d75b011ebf7f > prerequisite-patch-id: cd6cd74eca502ebce581c223cd0d2ac4278912e8 > prerequisite-patch-id: b86e08404ef83877dfa3b76a80a12b02c61b1326 > prerequisite-patch-id: 9417f8d92995cf417bb3c4afa0786b05a756d48a > prerequisite-patch-id: 59dda13243375b013396981a4f9e17abd694d734 > prerequisite-patch-id: 89be058d0605cb8278d5d3384bb44911b188dd90 > prerequisite-patch-id: 70c26fde2fde34c031a95ef74a3321710dc4961e > prerequisite-patch-id: 38a27cdf8cbe03fdf5f9bafa5ba53f3ba644a5ad > prerequisite-patch-id: 40a6d2e51dff2531c40a38087a8aea1be7108792 > prerequisite-patch-id: 024d1bba9bcd449d2b8196b2f1a64a197cafaed8 > prerequisite-patch-id: e83d54aa767ebab267530fca74d60366160a5253 > prerequisite-patch-id: c34734661161c27224316dc519609db5c6d87a1e > prerequisite-patch-id: a58d739146fe46f6c7f203e5d2e0f114bd3f7834 > prerequisite-patch-id: 1ff8499f5ec69b737d77053e6809ec3a0b599ebc > prerequisite-patch-id: 498e5608bca9b5ebcb3592a556e75f5dcc2b7076 > prerequisite-patch-id: df6dfdea7c3d9db4649d857ce55fbeb99d4febca > prerequisite-patch-id: 453b66b1faaaebaa1666954185de327298aa0578 > prerequisite-patch-id: f98da1de781c203a53cae73c5bb707240d21cb0a > prerequisite-patch-id: 14b1718dbc4fb9cd94e1094a4d44ebfcfe6ad869 > prerequisite-patch-id: 3b68944fa8fb2fab0c21d6ff73f649f53dd6f551 > prerequisite-patch-id: 82d1e6bcd221f982b6ab1ed0e9a90d46a39562c4 > prerequisite-patch-id: c9cce20b146f955b715d15c0c384c9acc6176493 > prerequisite-patch-id: c204491c1db4f5056711768265f101e881e4e415 > prerequisite-patch-id: e66e13fbde027e99552fc6d80ff8d48c110a18f2 > prerequisite-patch-id: 3c313f0a20730c653c8f5ec4f318e2485a8ef60f > prerequisite-patch-id: 925c466172c01c4b5976ac019961cbe240f0cddd > prerequisite-patch-id: e81e0aded80adf18c861f67624a179a15ef68906 > prerequisite-patch-id: 001675f7da57d25731c7c71f6f2dcaa7409e5664 > prerequisite-patch-id: d65bf6ef5f51da0acba72d332d60167b34e193e1 > prerequisite-patch-id: fc7c9a5024037363319b58520480a6c4a8a5dcff > prerequisite-patch-id: 5aae8c77d028459d944021f4943558411deb0662 > prerequisite-patch-id: 71fa80813ad36528e8a737249424d90827933c16 > prerequisite-patch-id: 65dc75b8e1ddb45542480a8867ecd7a63ab3112e > prerequisite-patch-id: 8619aa1dec17409d9b5ecb6ed0a2cc7d1563c174 > prerequisite-patch-id: 6473142746dc5b448ec9698d577f47b4da6cd1d5 > prerequisite-patch-id: eb6689695d5d1b6c650de0c86a805a45b80ab88d > prerequisite-patch-id: 7d50679dad38c9f859ec231da2db78919818b40e > prerequisite-patch-id: faeb97c5f9c07754bd0bf0be59254091470978c2 > prerequisite-patch-id: 56e31c3ab9ed9ff19aca25d5ffb9655c6515b692 > prerequisite-patch-id: 8d7418e017eec3c6e56b55f9ff6181cc3dcc1a17 > prerequisite-patch-id: 84f58e5a274c980ae6905e764d479e1c960149ca > prerequisite-patch-id: ada6a2d9427bff9dd7fd115a91300a1f7379995c > prerequisite-patch-id: 108161d5500b39b3ac55d202b5b9af817d829724 > prerequisite-patch-id: c89b0fc7dadc53facc45ccf9991503430b7e7799 > prerequisite-patch-id: d62e2be8f9fd6a1d9ac8dfa2cdc4db6d4a4327ac > prerequisite-patch-id: f8f4375b2b16ffae596d416607c00b374f485299 > prerequisite-patch-id: 36b1a9c3e0e9f91b7172e1211231759a6cb81473 > prerequisite-patch-id: 8cb6ac6a5188c817bb3a6a86920001de75bb7225 > prerequisite-patch-id: 17ef87336a8c664e0109a7466c9f7d37f5901167 > prerequisite-patch-id: a2c72266baec1b3eb5706d43157d93ae8db5e42d > prerequisite-patch-id: 27503579f8bdfadb95847b8dd5bf3732f5149cfb > prerequisite-patch-id: 50d6d9c6ff0734705ae384ede694b547f4973249 > prerequisite-patch-id: 81cd72752ab376d459dceff93f71715e55a55846 > prerequisite-patch-id: 922cec7ef3d21275f5933968f5b704e0bed64ce5 > prerequisite-patch-id: 1f0903e8846cd59d0d5a3dcbf9a5a82ad4dcb5cd > prerequisite-patch-id: 69d839b9d5b794ef1b7dee9c592ed20300f8539f -- Best regards, Nicolas Graves
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH v4] guix: composer-build-system: Fix match-lambda with a fallback. References: <20200713002055.1553f136@HIDDEN> In-Reply-To: <20200713002055.1553f136@HIDDEN> Resent-From: Nicolas Graves <ngraves@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Tue, 26 Sep 2023 11:30:02 +0000 Resent-Message-ID: <handler.42338.B42338.169572779016489 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Cc: ngraves@HIDDEN Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.169572779016489 (code B ref 42338); Tue, 26 Sep 2023 11:30:02 +0000 Received: (at 42338) by debbugs.gnu.org; 26 Sep 2023 11:29:50 +0000 Received: from localhost ([127.0.0.1]:47473 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ql6GC-0004Ho-6s for submit <at> debbugs.gnu.org; Tue, 26 Sep 2023 07:29:50 -0400 Received: from 9.mo550.mail-out.ovh.net ([178.32.108.172]:60031) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1ql6G5-0004HZ-Uk for 42338 <at> debbugs.gnu.org; Tue, 26 Sep 2023 07:29:46 -0400 Received: from director10.ghost.mail-out.ovh.net (unknown [10.108.4.54]) by mo550.mail-out.ovh.net (Postfix) with ESMTP id 828EA27309 for <42338 <at> debbugs.gnu.org>; Tue, 26 Sep 2023 11:29:27 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-56jqj (unknown [10.110.115.108]) by director10.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 25DED1FD5B; Tue, 26 Sep 2023 11:29:27 +0000 (UTC) Received: from ngraves.fr ([37.59.142.97]) by ghost-submission-6684bf9d7b-56jqj with ESMTPSA id JdOPBZfAEmW2mxkA28VGTA (envelope-from <ngraves@HIDDEN>); Tue, 26 Sep 2023 11:29:27 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-97G0025601e932-7b6d-449f-9c40-b0167c7b997e, 673A0E1412D75BE9E6E9083740E1979C5D801E24) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 81.67.140.142 From: Nicolas Graves <ngraves@HIDDEN> Date: Tue, 26 Sep 2023 13:29:22 +0200 Message-ID: <0cfb53602b5fddfab305d55573ed36910dba379a.1695727762.git.ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 13877560779738178274 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvjedrtddtgdduvdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecunecujfgurhephffvvefufffkofgggfestdekredtredttdenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeekffegteffgfffjeegjedvfffgtddvueeutefgfeeuvdejgedvgeejjeevueeuveenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegtddrudegvddpfeejrdehledrudegvddrleejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeegvdeffeekseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehhedtpdhmohguvgepshhmthhpohhuth X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * guix/build/composer-build-system.scm: (composer-package): Fix match-lambda with a default fallback. (composer-autoload): Fix match-lambda with a default fallback. --- guix/build/composer-build-system.scm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/guix/build/composer-build-system.scm b/guix/build/composer-build-system.scm index 7df2b7c400..d891ea3a6d 100644 --- a/guix/build/composer-build-system.scm +++ b/guix/build/composer-build-system.scm @@ -46,12 +46,12 @@ (define-json-mapping <composer-autoload> make-composer-autoload composer-autoloa json->composer-autoload (psr-4 composer-autoload-psr-4 "psr-4" (match-lambda - (#f '()) - (psr-4 psr-4))) + (psr-4 psr-4) + (_ '()))) (classmap composer-autoload-classmap "classmap" (match-lambda - (#f '()) - (#(lst ...) lst)))) + (#(lst ...) lst) + (_ '())))) (define-json-mapping <composer-package> make-composer-package composer-package? json->composer-package @@ -62,12 +62,12 @@ (define-json-mapping <composer-package> make-composer-package composer-package? (dev-require composer-package-dev-require "require-dev" json->require) (scripts composer-package-scripts "scripts" (match-lambda - (#f '()) - ((scripts ...) scripts))) + ((scripts ...) scripts) + (_ '()))) (binaries composer-package-binaries "bin" (match-lambda - (#f '()) - (#(lst ...) lst)))) + (#(lst ...) lst) + (_ '())))) (define* (read-package-data #:key (filename "composer.json")) (call-with-input-file filename base-commit: fafd3caef0d51811a5da81d6061789e2908b0dac prerequisite-patch-id: eb618ab7b10483d917c308a38792af98baa517e2 prerequisite-patch-id: c12968d02d99c253f858586a86b16fa32d41f1c1 prerequisite-patch-id: 09d995d48139f8e61183d5634cda13a01cdb50f7 prerequisite-patch-id: 86baa45ec2aad977c8c8135f7613aa391155de6d prerequisite-patch-id: 3425fbbff6a603d60b4e143ea2141aabf4ddc92c prerequisite-patch-id: c373c01aab5dcba3503a97d51c62a595147a041c prerequisite-patch-id: cda857c790b88c681c4e713c5f71e40291970daf prerequisite-patch-id: 8e234d0f4d93d2aad499eec8842be3d28da98707 prerequisite-patch-id: 5f664cb2fd995a53765c5ffc19a708ac795cc0c4 prerequisite-patch-id: ed447cba9cf9b7e1a1b47aa27acb14f8f2da0a8e prerequisite-patch-id: 9f80c5bbbfb8cd3347951c4d57634e93ffa79924 prerequisite-patch-id: 1aaa9f0d466e2d6837f75844df48a98beb70ff24 prerequisite-patch-id: 34502820d8c0355b3ed2638c457084edeaba029d prerequisite-patch-id: a96258da9e78cfb9ac9893cdcdeb38b69b75f134 prerequisite-patch-id: 4a2da4ee89dbbdb2244845149ce6da967ddd5268 prerequisite-patch-id: 9f9c4205781d1f0e2bb7af2d21875de08ee3ecd5 prerequisite-patch-id: 9697db9b50cab8f7974c32383e0a9a786ecbd8f9 prerequisite-patch-id: ebbd089a3313232347273c723d3deb1bf8c9bf81 prerequisite-patch-id: e93360d66936b9efd70a6ffd41f6ecda177ad7b8 prerequisite-patch-id: 19d76f45db1c59bd9ccd2e4e1125ffd698e9d6ce prerequisite-patch-id: 929b39ded7ad095e9f768f7d484bbd3b7a486a3c prerequisite-patch-id: 5e1262f77d55c91eadca113223faa84935bffd60 prerequisite-patch-id: ad370d41983418fa704215aa3458f97c75d5d128 prerequisite-patch-id: f179c922613390d249a365625c2ee545a908029d prerequisite-patch-id: 03b0aaa382ddda0819ddb62479cd1885c930ddea prerequisite-patch-id: 83b8b3a072520705dcba4b67712a29553bea1548 prerequisite-patch-id: 9308fa06526d9bacdbcdd347cc225f6f3f87811a prerequisite-patch-id: a017243a1a4b406caed9cec048d194cdc33d1a25 prerequisite-patch-id: e8d5b2e787904b0dd1a650d7a0012b91a430cb03 prerequisite-patch-id: 1cc872245864ace22db43cf2d268a87190b333b6 prerequisite-patch-id: c277dcca77f3acde51bdffe932b9250e454086ad prerequisite-patch-id: ea926073e68d5af7f6c76a6333520cc5f42c9789 prerequisite-patch-id: 10008b9b34ccc8f87f2fcd8391075fe57244ac72 prerequisite-patch-id: 443d7e3eb85f36848c2120979f9f1d3a78f8bf38 prerequisite-patch-id: 6414c2d65c1806942d7f834e9300a8ecf8fd743f prerequisite-patch-id: 8c6dec06b716c39ca7fada0f2872078612917779 prerequisite-patch-id: 62e28252e9b7ab11edb03609b68369feb499f883 prerequisite-patch-id: 84c9361c4c6d7662cfb3235cc4a6640a53e00622 prerequisite-patch-id: 0f27045bc50089a9a88da7818448a50cd28dd295 prerequisite-patch-id: 500413da3a81e75c5fbca62a21d9457d7b1ad8a8 prerequisite-patch-id: 6f48169f4d69da277bcdecb8f40d2f608941d9f9 prerequisite-patch-id: fc8b43573cc6b90033769de63ca235b16159190d prerequisite-patch-id: ae749fc3fa0ab1768841ffb4633847b5b2233881 prerequisite-patch-id: 46b8490d2b338229a2f3c5e39427275cf46982ba prerequisite-patch-id: b1bb7dfb35069a2b30f5b2714bc19a249be3e1b5 prerequisite-patch-id: 94848222eb08beb53530ba6ce626e9d8bcffecd4 prerequisite-patch-id: f8181365677e68d8628013c7636e9ff56214ac9e prerequisite-patch-id: aebc0f8156c409599cc7aced4b708bb5ea08a2b2 prerequisite-patch-id: 4ce416249f6d3176a51d7e4cbbd2c6bf2982bab6 prerequisite-patch-id: 5e14463dcc090e497bb1d29c1b4c822b43d5fdca prerequisite-patch-id: 89306b41386cb29db7c147e8c4468a3b4d8d292d prerequisite-patch-id: 29e414b1ede9108047ff224e1e24a3adb2c44c52 prerequisite-patch-id: 7e15edfd04cd291f54284d13dcdbebcfb456b752 prerequisite-patch-id: b8c18091929e58b49847ab510d3d75a8a934cad0 prerequisite-patch-id: 7a607a1659b22afb0c21dec3d8eb1e2ed51e47a9 prerequisite-patch-id: 89fbd04f11e5bef5703ba7ea4c2064d5ba63c4d4 prerequisite-patch-id: b421048677352ea536dd93a61d6de987fb95d60b prerequisite-patch-id: 25a03298bdfd6a691bb8cf68690009f8e46447e0 prerequisite-patch-id: 3924163576eafdac47ac06de311ac317730e6631 prerequisite-patch-id: 69b1d81677b507242f556c3e2fcf5290aeca445c prerequisite-patch-id: a378fa79002001da51ae91eb026769eddb8a593b prerequisite-patch-id: 86bb35c89ec3cc1b6ec47f238c84a154d5e9a1aa prerequisite-patch-id: f8d0709d94ed99b1530bad1908ca27b1b56ea84e prerequisite-patch-id: dcb65983aa914b8f1d1a8fbdfba34714ddb7f6fa prerequisite-patch-id: 89752146a063d0706885819e244b4179196538b8 prerequisite-patch-id: 1f9e7627d0b23302159cdab3d939fcec52f7ca70 prerequisite-patch-id: f706bfa95ba0e5e72c206537ed207feb95daa888 prerequisite-patch-id: 9b60c519b0df65eeacd5779808e0d75b011ebf7f prerequisite-patch-id: cd6cd74eca502ebce581c223cd0d2ac4278912e8 prerequisite-patch-id: b86e08404ef83877dfa3b76a80a12b02c61b1326 prerequisite-patch-id: 9417f8d92995cf417bb3c4afa0786b05a756d48a prerequisite-patch-id: 59dda13243375b013396981a4f9e17abd694d734 prerequisite-patch-id: 89be058d0605cb8278d5d3384bb44911b188dd90 prerequisite-patch-id: 70c26fde2fde34c031a95ef74a3321710dc4961e prerequisite-patch-id: 38a27cdf8cbe03fdf5f9bafa5ba53f3ba644a5ad prerequisite-patch-id: 40a6d2e51dff2531c40a38087a8aea1be7108792 prerequisite-patch-id: 024d1bba9bcd449d2b8196b2f1a64a197cafaed8 prerequisite-patch-id: e83d54aa767ebab267530fca74d60366160a5253 prerequisite-patch-id: c34734661161c27224316dc519609db5c6d87a1e prerequisite-patch-id: a58d739146fe46f6c7f203e5d2e0f114bd3f7834 prerequisite-patch-id: 1ff8499f5ec69b737d77053e6809ec3a0b599ebc prerequisite-patch-id: 498e5608bca9b5ebcb3592a556e75f5dcc2b7076 prerequisite-patch-id: df6dfdea7c3d9db4649d857ce55fbeb99d4febca prerequisite-patch-id: 453b66b1faaaebaa1666954185de327298aa0578 prerequisite-patch-id: f98da1de781c203a53cae73c5bb707240d21cb0a prerequisite-patch-id: 14b1718dbc4fb9cd94e1094a4d44ebfcfe6ad869 prerequisite-patch-id: 3b68944fa8fb2fab0c21d6ff73f649f53dd6f551 prerequisite-patch-id: 82d1e6bcd221f982b6ab1ed0e9a90d46a39562c4 prerequisite-patch-id: c9cce20b146f955b715d15c0c384c9acc6176493 prerequisite-patch-id: c204491c1db4f5056711768265f101e881e4e415 prerequisite-patch-id: e66e13fbde027e99552fc6d80ff8d48c110a18f2 prerequisite-patch-id: 3c313f0a20730c653c8f5ec4f318e2485a8ef60f prerequisite-patch-id: 925c466172c01c4b5976ac019961cbe240f0cddd prerequisite-patch-id: e81e0aded80adf18c861f67624a179a15ef68906 prerequisite-patch-id: 001675f7da57d25731c7c71f6f2dcaa7409e5664 prerequisite-patch-id: d65bf6ef5f51da0acba72d332d60167b34e193e1 prerequisite-patch-id: fc7c9a5024037363319b58520480a6c4a8a5dcff prerequisite-patch-id: 5aae8c77d028459d944021f4943558411deb0662 prerequisite-patch-id: 71fa80813ad36528e8a737249424d90827933c16 prerequisite-patch-id: 65dc75b8e1ddb45542480a8867ecd7a63ab3112e prerequisite-patch-id: 8619aa1dec17409d9b5ecb6ed0a2cc7d1563c174 prerequisite-patch-id: 6473142746dc5b448ec9698d577f47b4da6cd1d5 prerequisite-patch-id: eb6689695d5d1b6c650de0c86a805a45b80ab88d prerequisite-patch-id: 7d50679dad38c9f859ec231da2db78919818b40e prerequisite-patch-id: faeb97c5f9c07754bd0bf0be59254091470978c2 prerequisite-patch-id: 56e31c3ab9ed9ff19aca25d5ffb9655c6515b692 prerequisite-patch-id: 8d7418e017eec3c6e56b55f9ff6181cc3dcc1a17 prerequisite-patch-id: 84f58e5a274c980ae6905e764d479e1c960149ca prerequisite-patch-id: ada6a2d9427bff9dd7fd115a91300a1f7379995c prerequisite-patch-id: 108161d5500b39b3ac55d202b5b9af817d829724 prerequisite-patch-id: c89b0fc7dadc53facc45ccf9991503430b7e7799 prerequisite-patch-id: d62e2be8f9fd6a1d9ac8dfa2cdc4db6d4a4327ac prerequisite-patch-id: f8f4375b2b16ffae596d416607c00b374f485299 prerequisite-patch-id: 36b1a9c3e0e9f91b7172e1211231759a6cb81473 prerequisite-patch-id: 8cb6ac6a5188c817bb3a6a86920001de75bb7225 prerequisite-patch-id: 17ef87336a8c664e0109a7466c9f7d37f5901167 prerequisite-patch-id: a2c72266baec1b3eb5706d43157d93ae8db5e42d prerequisite-patch-id: 27503579f8bdfadb95847b8dd5bf3732f5149cfb prerequisite-patch-id: 50d6d9c6ff0734705ae384ede694b547f4973249 prerequisite-patch-id: 81cd72752ab376d459dceff93f71715e55a55846 prerequisite-patch-id: 922cec7ef3d21275f5933968f5b704e0bed64ce5 prerequisite-patch-id: 1f0903e8846cd59d0d5a3dcbf9a5a82ad4dcb5cd prerequisite-patch-id: 69d839b9d5b794ef1b7dee9c592ed20300f8539f -- 2.41.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH v3 1/7] guix: import: Add composer importer. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sat, 14 Oct 2023 15:49:01 +0000 Resent-Message-ID: <handler.42338.B42338.169729853632446 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Nicolas Graves <ngraves@HIDDEN> Cc: Josselin Poiret <dev@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, 42338 <at> debbugs.gnu.org, Ricardo Wurmus <rekado@HIDDEN>, Christopher Baines <guix@HIDDEN> Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.169729853632446 (code B ref 42338); Sat, 14 Oct 2023 15:49:01 +0000 Received: (at 42338) by debbugs.gnu.org; 14 Oct 2023 15:48:56 +0000 Received: from localhost ([127.0.0.1]:50244 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qrgsp-0008RC-P5 for submit <at> debbugs.gnu.org; Sat, 14 Oct 2023 11:48:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51146) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1qrgsm-0008QG-Rf for 42338 <at> debbugs.gnu.org; Sat, 14 Oct 2023 11:48:53 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1qrgsH-0007jp-OQ; Sat, 14 Oct 2023 11:48:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=4TfhYBmQ19fO7nm5g1x7oU6aafIi0pGX+oYJn+uoHD0=; b=ipczeY/+sIuRTaTZ/Os4 88w38bsmQzRVhVG5uMQZOjY4XWpK51S5IFkMDeebRX7mXyud05o+NBSmgvz2cA7sdcfBJUlrpOBKv sE4ZNgfvVwOLD3gYGB7GbYb+Llqzm689PcCe8H5QGaebKDgA1WOaneGWqEOVmNU+KCQcLRNkG3QL0 nk80A2DLZT/lZ6obXZAxMLeShriJoWlafJS8LzrDOnv/2jSGOCbKc5y9dDaHg6AziI4s0Sk/5nKWH xfKVRr+6qGWV03pMEWIJy7/vuv7dUg8DDpRoLQQkeIUv04KZMJbE7OeGjgDtQi8CSsQ8TwFPDKlMS Q5F1wk2UxhBzdw==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN> In-Reply-To: <6abfbb4d4d57642fea6bae5835ff0d365de7e24a.1695724304.git.ngraves@HIDDEN> (Nicolas Graves's message of "Tue, 26 Sep 2023 12:31:38 +0200") References: <20200713002055.1553f136@HIDDEN> <6abfbb4d4d57642fea6bae5835ff0d365de7e24a.1695724304.git.ngraves@HIDDEN> Date: Sat, 14 Oct 2023 17:48:18 +0200 Message-ID: <87edhxfbnh.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) 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 <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Hi Nicolas, Nicolas Graves <ngraves@HIDDEN> skribis: > * guix/import/composer.scm: New file. > * guix/scripts/import/composer.scm: New file. > * guix/tests/composer.scm: New file. > * Makefile.am: Add them. > * guix/scripts/import.scm: Add composer importer. > * doc/guix.texi (Invoking guix import): Mention it. I=E2=80=99m a bit at loss with this patch series because there are two v3 threads, one v4 thread that contains a single patch, and the original versions contained many more patches. I think it=E2=80=99s OK to separate out the =E2=80=9Cgnu: Add php-*=E2=80= =9D patches, it=E2=80=99s probably clearer. However, could you come up with a v5 that includes all the =E2=80=98guix import composer=E2=80=99 changes that we would need t= o apply? How does that sound? I have a couple of comments: > +@item composer > +@cindex Composer > +@cindex PHP > +Import metadat from the @uref{https://getcomposer.org/, Composer} package ^ Typo. > +++ b/guix/import/composer.scm > @@ -0,0 +1,270 @@ > +;;; GNU Guix --- Functional package management for GNU > +;;; Copyright =C2=A9 2019 Julien Lepiller <julien@HIDDEN> Maybe add yourself too? > +;; XXX adapted from (guix scripts hash) > +(define (file-hash file select? recursive?) > + ;; Compute the hash of FILE. > + (if recursive? > + (let-values (((port get-hash) (open-sha256-port))) > + (write-file file port #:select? select?) > + (force-output port) > + (get-hash)) > + (call-with-input-file file port-sha256))) > + > +;; XXX taken from (guix scripts hash) > +(define (vcs-file? file stat) These two procedures are now exported from (guix hash), so you can remove them and #:use-module (guix hash) instead. > +(define* (composer-fetch name #:optional version) > + "Return an alist representation of the Composer metadata for the packa= ge NAME, > +or #f on failure." > + (let ((package (json-fetch > + (string-append (%composer-base-url) "/p/" name ".json= ")))) > + (if package > + (let* ((packages (assoc-ref package "packages")) > + (package (or (assoc-ref packages name) package)) > + (versions (filter > + (lambda (version) > + (and (not (string-contains version "dev")) > + (not (string-contains version "beta"))= )) > + (map car package))) > + (version (or (if (null? version) #f version) > + (latest-version versions)))) > + (assoc-ref package version)) Instead of returning an alist, directly return a <composer-package> record. > +(define (php-package? package) > + "Return true if PACKAGE is a PHP package from Packagist." > + (and > + (eq? (build-system-name (package-build-system package)) 'composer) Rather: (eq? (package-build-system package) composer-build-system). (The =E2=80=98name=E2=80=99 field is for debugging purposes only.) > +(define (latest-release package) > + "Return an <upstream-source> for the latest release of PACKAGE." > + (let* ((php-name (guix-package->composer-name package)) > + (metadata (composer-fetch php-name)) > + (package (json->composer-package metadata)) > + (version (composer-package-version package)) > + (url (composer-source-url (composer-package-source package)))) > + (upstream-source > + (package (package-name package)) > + (version version) > + (urls (list url))))) Maybe we can do that later, but note that <upstream-source> has an =E2=80=98inputs=E2=80=99 field nowadays; if you feel it in, =E2=80=98guix r= efresh -u=E2=80=99 is able to update dependencies in addition to version/hash. (If you leave it for later, please add a TODO.) > +;; Avoid collisions with other tests. > +(%http-server-port 10450) This is now unnecessary: by default a random unused port is chosen and everything=E2=80=99s fine. > +(test-begin "composer") > + > +(test-assert "composer->guix-package" > + ;; Replace network resources with sample data. > + (with-http-server `((200 ,test-json) > + (200 ,test-source)) > + (parameterize ((%composer-base-url (%local-url)) > + (current-http-proxy (%local-url))) > + (match (composer->guix-package "foo/bar") > + (('package > + ('name "php-foo-bar") > + ('version "0.1") For clarity, you can write: (match =E2=80=A6 (`(package (name "php-foo-bar") (version "0.1") =E2=80=A6) =E2=80=A6)) See commit 654fcf9971bb01389d577be07c6ec0f68940c743. > + ('native-inputs > + ('quasiquote > + (("php-phpunit-phpunit" ('unquote 'php-phpunit-phpunit))))) Please change the importer so that it emits inputs without labels: (native-inputs (list php-phpunit-phpunit)) One last thing: consider adding an =E2=80=98etc/news.scm=E2=80=99 entry so = people can learn about the new importer. Thanks in advance! Ludo=E2=80=99.
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 1/9] guix: import: Add composer importer. Resent-From: Nicolas Graves <ngraves@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Thu, 02 Nov 2023 15:17:02 +0000 Resent-Message-ID: <handler.42338.B42338.169893817324813 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Cc: ngraves@HIDDEN Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.169893817324813 (code B ref 42338); Thu, 02 Nov 2023 15:17:02 +0000 Received: (at 42338) by debbugs.gnu.org; 2 Nov 2023 15:16:13 +0000 Received: from localhost ([127.0.0.1]:55727 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qyZQZ-0006Ru-ET for submit <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:16:12 -0400 Received: from 3.mo550.mail-out.ovh.net ([46.105.60.232]:53239) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1qyZQW-0006Re-Aq for 42338 <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:16:10 -0400 Received: from director5.ghost.mail-out.ovh.net (unknown [10.109.146.175]) by mo550.mail-out.ovh.net (Postfix) with ESMTP id E3C7D29140 for <42338 <at> debbugs.gnu.org>; Thu, 2 Nov 2023 15:15:31 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-5bvmw (unknown [10.110.171.164]) by director5.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 630231FE0B; Thu, 2 Nov 2023 15:15:31 +0000 (UTC) Received: from ngraves.fr ([37.59.142.97]) by ghost-submission-6684bf9d7b-5bvmw with ESMTPSA id fAXTExO9Q2XJMgEAkImNtA (envelope-from <ngraves@HIDDEN>); Thu, 02 Nov 2023 15:15:31 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-97G002dd0adf45-fa51-410d-847f-4ae285d0607a, 1761E107A7246F2314AE904A186E6A889A3776EC) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 87.88.157.103 From: Nicolas Graves <ngraves@HIDDEN> Date: Thu, 2 Nov 2023 16:04:21 +0100 Message-ID: <20231102151523.30581-2-ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231102151523.30581-1-ngraves@HIDDEN> References: <20231102151523.30581-1-ngraves@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 13624233299882271458 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedruddtiedgjeehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfgggtgfesthekredtredtjeenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeduheefjefggfffhfdtjedvudetleevveejveevtdetfeeiheejgfejhedtieekueenucffohhmrghinhepghgvthgtohhmphhoshgvrhdrohhrghdpghhnuhdrohhrghdpphgrtghkrghgihhsthdrohhrghdpvgigrghmphhlvgdrtghomhenucfkphepuddvjedrtddrtddruddpkeejrdekkedrudehjedruddtfedpfeejrdehledrudegvddrleejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeegvdeffeekseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehhedtpdhmohguvgepshhmthhpohhuth X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * guix/import/composer.scm: New file. * guix/scripts/import/composer.scm: New file. * guix/tests/composer.scm: New file. * Makefile.am: Add them. * guix/scripts/import.scm: Add composer importer. * doc/guix.texi (Invoking guix import): Mention it. --- Makefile.am | 3 + doc/guix.texi | 20 +++ guix/import/composer.scm | 270 +++++++++++++++++++++++++++++++ guix/scripts/import.scm | 2 +- guix/scripts/import/composer.scm | 107 ++++++++++++ tests/composer.scm | 92 +++++++++++ 6 files changed, 493 insertions(+), 1 deletion(-) create mode 100644 guix/import/composer.scm create mode 100644 guix/scripts/import/composer.scm create mode 100644 tests/composer.scm diff --git a/Makefile.am b/Makefile.am index 310a231259..3fec98f064 100644 --- a/Makefile.am +++ b/Makefile.am @@ -274,6 +274,7 @@ MODULES = \ guix/search-paths.scm \ guix/packages.scm \ guix/import/cabal.scm \ + guix/import/composer.scm \ guix/import/cpan.scm \ guix/import/cran.scm \ guix/import/crate.scm \ @@ -332,6 +333,7 @@ MODULES = \ guix/scripts/home/import.scm \ guix/scripts/lint.scm \ guix/scripts/challenge.scm \ + guix/scripts/import/composer.scm \ guix/scripts/import/crate.scm \ guix/scripts/import/cpan.scm \ guix/scripts/import/cran.scm \ @@ -504,6 +506,7 @@ SCM_TESTS = \ tests/challenge.scm \ tests/channels.scm \ tests/combinators.scm \ + tests/composer.scm \ tests/containers.scm \ tests/cpan.scm \ tests/cpio.scm \ diff --git a/doc/guix.texi b/doc/guix.texi index 8c5697589f..0e64654715 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -14539,6 +14539,26 @@ guix import hexpm cf@@0.3.0 Additional options include: +@table @code +@item --recursive +@itemx -r +Traverse the dependency graph of the given upstream package recursively +and generate package expressions for all those packages that are not yet +in Guix. +@end table + +@item composer +@cindex Composer +@cindex PHP +Import metadat from the @uref{https://getcomposer.org/, Composer} package +archive used by the PHP community, as in this example: + +@example +guix import composer phpunit/phpunit +@end example + +Additional options include: + @table @code @item --recursive @itemx -r diff --git a/guix/import/composer.scm b/guix/import/composer.scm new file mode 100644 index 0000000000..c152f402bb --- /dev/null +++ b/guix/import/composer.scm @@ -0,0 +1,270 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2019 Julien Lepiller <julien@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (guix import composer) + #:use-module (ice-9 match) + #:use-module (json) + #:use-module (gcrypt hash) + #:use-module (guix base32) + #:use-module (guix build git) + #:use-module (guix build utils) + #:use-module (guix build-system) + #:use-module (guix import json) + #:use-module (guix import utils) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (guix serialization) + #:use-module (guix upstream) + #:use-module (guix utils) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-11) + #:use-module (srfi srfi-26) + #:export (composer->guix-package + %composer-updater + composer-recursive-import + + %composer-base-url)) + +(define %composer-base-url + (make-parameter "https://repo.packagist.org")) + +;; XXX adapted from (guix scripts hash) +(define (file-hash file select? recursive?) + ;; Compute the hash of FILE. + (if recursive? + (let-values (((port get-hash) (open-sha256-port))) + (write-file file port #:select? select?) + (force-output port) + (get-hash)) + (call-with-input-file file port-sha256))) + +;; XXX taken from (guix scripts hash) +(define (vcs-file? file stat) + (case (stat:type stat) + ((directory) + (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) + ((regular) + ;; Git sub-modules have a '.git' file that is a regular text file. + (string=? (basename file) ".git")) + (else + #f))) + +(define (fix-version version) + "Return a fixed version from a version string. For instance, v10.1 -> 10.1" + (cond + ((string-prefix? "version" version) + (if (char-set-contains? char-set:digit (string-ref version 7)) + (substring version 7) + (substring version 8))) + ((string-prefix? "v" version) + (substring version 1)) + (else version))) + +(define (latest-version versions) + (fold (lambda (a b) (if (version>? (fix-version a) (fix-version b)) a b)) + (car versions) versions)) + +(define (json->require dict) + (if dict + (let loop ((result '()) (require dict)) + (match require + (() result) + ((((? (cut string-contains <> "/") name) . _) + require ...) + (loop (cons name result) require)) + ((_ require ...) (loop result require)))) + '())) + +(define-json-mapping <composer-source> make-composer-source composer-source? + json->composer-source + (type composer-source-type) + (url composer-source-url) + (reference composer-source-reference)) + +(define-json-mapping <composer-package> make-composer-package composer-package? + json->composer-package + (description composer-package-description) + (homepage composer-package-homepage) + (source composer-package-source "source" json->composer-source) + (name composer-package-name "name" php-package-name) + (version composer-package-version "version" fix-version) + (require composer-package-require "require" json->require) + (dev-require composer-package-dev-require "require-dev" json->require) + (license composer-package-license "license" + (lambda (vector) + (map string->license (vector->list vector))))) + +(define* (composer-fetch name #:optional version) + "Return an alist representation of the Composer metadata for the package NAME, +or #f on failure." + (let ((package (json-fetch + (string-append (%composer-base-url) "/p/" name ".json")))) + (if package + (let* ((packages (assoc-ref package "packages")) + (package (or (assoc-ref packages name) package)) + (versions (filter + (lambda (version) + (and (not (string-contains version "dev")) + (not (string-contains version "beta")))) + (map car package))) + (version (or (if (null? version) #f version) + (latest-version versions)))) + (assoc-ref package version)) + #f))) + +(define (php-package-name name) + "Given the NAME of a package on Packagist, return a Guix-compliant name for +the package." + (let ((name (string-join (string-split name #\/) "-"))) + (if (string-prefix? "php-" name) + (snake-case name) + (string-append "php-" (snake-case name))))) + +(define (make-php-sexp composer-package) + "Return the `package' s-expression for a PHP package for the given +COMPOSER-PACKAGE." + (let* ((source (composer-package-source composer-package)) + (dependencies (map php-package-name + (composer-package-require composer-package))) + (dev-dependencies (map php-package-name + (composer-package-dev-require composer-package))) + (git? (equal? (composer-source-type source) "git"))) + ((if git? call-with-temporary-directory call-with-temporary-output-file) + (lambda* (temp #:optional port) + (and (if git? + (begin + (mkdir-p temp) + (git-fetch (composer-source-url source) + (composer-source-reference source) + temp)) + (url-fetch (composer-source-url source) temp)) + `(package + (name ,(composer-package-name composer-package)) + (version ,(composer-package-version composer-package)) + (source (origin + ,@(if git? + `((method git-fetch) + (uri (git-reference + (url ,(composer-source-url source)) + (commit ,(composer-source-reference source)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + ,(bytevector->nix-base32-string + (file-hash temp (negate vcs-file?) #t))))) + `((method url-fetch) + (uri ,(composer-source-url source)) + (sha256 (base32 ,(guix-hash-url temp))))))) + (build-system composer-build-system) + ,@(if (null? dependencies) + '() + `((inputs + (,'quasiquote + ,(map (lambda (name) + `(,name + (,'unquote + ,(string->symbol name)))) + dependencies))))) + ,@(if (null? dev-dependencies) + '() + `((native-inputs + (,'quasiquote + ,(map (lambda (name) + `(,name + (,'unquote + ,(string->symbol name)))) + dev-dependencies))))) + (synopsis "") + (description ,(composer-package-description composer-package)) + (home-page ,(composer-package-homepage composer-package)) + (license ,(match (composer-package-license composer-package) + (() #f) + ((license) license) + (_ license))))))))) + +(define* (composer->guix-package package-name #:optional version) + "Fetch the metadata for PACKAGE-NAME from packagist.org, and return the +`package' s-expression corresponding to that package, or #f on failure." + (let ((package (composer-fetch package-name version))) + (and package + (let* ((package (json->composer-package package)) + (dependencies-names (composer-package-require package)) + (dev-dependencies-names (composer-package-dev-require package))) + (values (make-php-sexp package) + (append dependencies-names dev-dependencies-names)))))) + +(define (guix-name->composer-name name) + "Given a guix package name, return the name of the package in Packagist." + (if (string-prefix? "php-" name) + (let ((components (string-split (substring name 4) #\-))) + (match components + ((namespace name ...) + (string-append namespace "/" (string-join name "-"))))) + name)) + +(define (guix-package->composer-name package) + "Given a Composer PACKAGE built from Packagist, return the name of the +package in Packagist." + (let ((upstream-name (assoc-ref + (package-properties package) + 'upstream-name)) + (name (package-name package))) + (if upstream-name + upstream-name + (guix-name->composer-name name)))) + +(define (string->license str) + "Convert the string STR into a license object." + (match str + ("GNU LGPL" 'license:lgpl2.0) + ("GPL" 'license:gpl3) + ((or "BSD" "BSD License" "BSD-3-Clause") 'license:bsd-3) + ((or "MIT" "MIT license" "Expat license") 'license:expat) + ("Public domain" 'license:public-domain) + ((or "Apache License, Version 2.0" "Apache 2.0") 'license:asl2.0) + (_ #f))) + +(define (php-package? package) + "Return true if PACKAGE is a PHP package from Packagist." + (and + (eq? (build-system-name (package-build-system package)) 'composer) + (string-prefix? "php-" (package-name package)))) + +(define (latest-release package) + "Return an <upstream-source> for the latest release of PACKAGE." + (let* ((php-name (guix-package->composer-name package)) + (metadata (composer-fetch php-name)) + (package (json->composer-package metadata)) + (version (composer-package-version package)) + (url (composer-source-url (composer-package-source package)))) + (upstream-source + (package (package-name package)) + (version version) + (urls (list url))))) + +(define %composer-updater + (upstream-updater + (name 'composer) + (description "Updater for Composer packages") + (pred php-package?) + (import latest-release))) + +(define* (composer-recursive-import package-name #:optional version) + (recursive-import package-name '() + #:repo->guix-package composer->guix-package + #:guix-name php-package-name)) diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm index 4ddd8d46a1..8c58dd35e2 100644 --- a/guix/scripts/import.scm +++ b/guix/scripts/import.scm @@ -47,7 +47,7 @@ (define %standard-import-options '()) (define importers '("gnu" "pypi" "cpan" "hackage" "stackage" "egg" "elpa" "gem" "go" "cran" "crate" "texlive" "json" "opam" - "minetest" "elm" "hexpm")) + "minetest" "elm" "hexpm" "composer")) (define (resolve-importer name) (let ((module (resolve-interface diff --git a/guix/scripts/import/composer.scm b/guix/scripts/import/composer.scm new file mode 100644 index 0000000000..412bae6318 --- /dev/null +++ b/guix/scripts/import/composer.scm @@ -0,0 +1,107 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2015 David Thompson <davet@HIDDEN> +;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (guix scripts import composer) + #:use-module (guix ui) + #:use-module (guix utils) + #:use-module (guix scripts) + #:use-module (guix import composer) + #:use-module (guix scripts import) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-11) + #:use-module (srfi srfi-37) + #:use-module (srfi srfi-41) + #:use-module (ice-9 match) + #:use-module (ice-9 format) + #:export (guix-import-composer)) + + +;;; +;;; Command-line options. +;;; + +(define %default-options + '()) + +(define (show-help) + (display (G_ "Usage: guix import composer PACKAGE-NAME +Import and convert the Composer package for PACKAGE-NAME.\n")) + (display (G_ " + -h, --help display this help and exit")) + (display (G_ " + -V, --version display version information and exit")) + (display (G_ " + -r, --recursive generate package expressions for all Composer packages\ + that are not yet in Guix")) + (newline) + (show-bug-report-information)) + +(define %options + ;; Specification of the command-line options. + (cons* (option '(#\h "help") #f #f + (lambda args + (show-help) + (exit 0))) + (option '(#\V "version") #f #f + (lambda args + (show-version-and-exit "guix import composer"))) + (option '(#\r "recursive") #f #f + (lambda (opt name arg result) + (alist-cons 'recursive #t result))) + %standard-import-options)) + + +;;; +;;; Entry point. +;;; + +(define (guix-import-composer . args) + (define (parse-options) + ;; Return the alist of option values. + (args-fold* args %options + (lambda (opt name arg result) + (leave (G_ "~A: unrecognized option~%") name)) + (lambda (arg result) + (alist-cons 'argument arg result)) + %default-options)) + + (let* ((opts (parse-options)) + (args (filter-map (match-lambda + (('argument . value) + value) + (_ #f)) + (reverse opts)))) + (match args + ((package-name) + (if (assoc-ref opts 'recursive) + (map (match-lambda + ((and ('package ('name name) . rest) pkg) + `(define-public ,(string->symbol name) + ,pkg)) + (_ #f)) + (composer-recursive-import package-name)) + (let ((sexp (composer->guix-package package-name))) + (unless sexp + (leave (G_ "failed to download meta-data for package '~a'~%") + package-name)) + sexp))) + (() + (leave (G_ "too few arguments~%"))) + ((many ...) + (leave (G_ "too many arguments~%")))))) diff --git a/tests/composer.scm b/tests/composer.scm new file mode 100644 index 0000000000..cefaf9f434 --- /dev/null +++ b/tests/composer.scm @@ -0,0 +1,92 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2020 Julien Lepiller <julien@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (test-composer) + #:use-module (guix import composer) + #:use-module (guix base32) + #:use-module (gcrypt hash) + #:use-module (guix tests http) + #:use-module (guix grafts) + #:use-module (srfi srfi-64) + #:use-module (web client) + #:use-module (ice-9 match)) + +;; Globally disable grafts because they can trigger early builds. +(%graft? #f) + +(define test-json + "{ + \"packages\": { + \"foo/bar\": { + \"0.1\": { + \"name\": \"foo/bar\", + \"description\": \"description\", + \"keywords\": [\"testing\"], + \"homepage\": \"http://example.com\", + \"version\": \"0.1\", + \"license\": [\"BSD-3-Clause\"], + \"source\": { + \"type\": \"url\", + \"url\": \"http://example.com/Bar-0.1.tar.gz\" + }, + \"require\": {}, + \"require-dev\": {\"phpunit/phpunit\": \"1.0.0\"} + } + } + } +}") + +(define test-source + "foobar") + +;; Avoid collisions with other tests. +(%http-server-port 10450) + +(test-begin "composer") + +(test-assert "composer->guix-package" + ;; Replace network resources with sample data. + (with-http-server `((200 ,test-json) + (200 ,test-source)) + (parameterize ((%composer-base-url (%local-url)) + (current-http-proxy (%local-url))) + (match (composer->guix-package "foo/bar") + (('package + ('name "php-foo-bar") + ('version "0.1") + ('source ('origin + ('method 'url-fetch) + ('uri "http://example.com/Bar-0.1.tar.gz") + ('sha256 + ('base32 + (? string? hash))))) + ('build-system 'composer-build-system) + ('native-inputs + ('quasiquote + (("php-phpunit-phpunit" ('unquote 'php-phpunit-phpunit))))) + ('synopsis "") + ('description "description") + ('home-page "http://example.com") + ('license 'license:bsd-3)) + (string=? (bytevector->nix-base32-string + (call-with-input-string test-source port-sha256)) + hash)) + (x + (pk 'fail x #f)))))) + +(test-end "composer") -- 2.41.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 0/9] Composer build system References: <20200713002055.1553f136@HIDDEN> In-Reply-To: <20200713002055.1553f136@HIDDEN> Resent-From: Nicolas Graves <ngraves@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Thu, 02 Nov 2023 15:17:02 +0000 Resent-Message-ID: <handler.42338.B42338.169893817424825 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Cc: ngraves@HIDDEN Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.169893817424825 (code B ref 42338); Thu, 02 Nov 2023 15:17:02 +0000 Received: (at 42338) by debbugs.gnu.org; 2 Nov 2023 15:16:14 +0000 Received: from localhost ([127.0.0.1]:55731 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qyZQa-0006SA-Tx for submit <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:16:13 -0400 Received: from 6.mo583.mail-out.ovh.net ([178.32.119.138]:43117) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1qyZQV-0006Rc-HQ for 42338 <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:16:11 -0400 Received: from director2.ghost.mail-out.ovh.net (unknown [10.108.16.84]) by mo583.mail-out.ovh.net (Postfix) with ESMTP id B533E29045 for <42338 <at> debbugs.gnu.org>; Thu, 2 Nov 2023 15:15:30 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-b6sp8 (unknown [10.110.171.76]) by director2.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 5BF261FE41; Thu, 2 Nov 2023 15:15:30 +0000 (UTC) Received: from ngraves.fr ([37.59.142.97]) by ghost-submission-6684bf9d7b-b6sp8 with ESMTPSA id CX3PERK9Q2VxCgEAozr0hw (envelope-from <ngraves@HIDDEN>); Thu, 02 Nov 2023 15:15:30 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-97G002b2002d1b-b7de-4ad6-9833-7a3decde58e2, 1761E107A7246F2314AE904A186E6A889A3776EC) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 87.88.157.103 From: Nicolas Graves <ngraves@HIDDEN> Date: Thu, 2 Nov 2023 16:04:20 +0100 Message-ID: <20231102151523.30581-1-ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 13623951824403817186 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedruddtiedgjeegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepkeffgeetfffgffejgeejvdffgfdtvdeuueetgfefuedvjeegvdegjeejveeuueevnecukfhppeduvdejrddtrddtrddupdekjedrkeekrdduheejrddutdefpdefjedrheelrddugedvrdeljeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepgedvfeefkeesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheekfedpmhhouggvpehsmhhtphhouhhtpdgukhhimhepnhhonhgv X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) This is the result of my further rework of the composer import and build-system. The `guix: import: composer` commits can be squashed easily. This is now tested on 94 php packages with all testing enabled except for 3 packages. I will submit these packages as a whole in the alphabetical order (the bootstrap order is not worth it IMO) in a new guix issue. Before accepting it, I also would like to propose a change of names. If me make an analogy with python: tool: pip <-> composer package hub: pypi <-> packagist build-system: python/pyproject <-> php Since we only take about 90 lines of real composer code, I would rather call the build-system php-build-system. Same thing: instead of `guix import composer` we should rather call `guix import packagist`. If that's OK, I'll change it with the next (and hopefully last!) version of this build system. Nicolas Graves (9): guix: import: Add composer importer. gnu: Add composer-classloader. guix: Add composer-build-system. guix: import: composer: Use memoization. guix: import: composer: Fix json->require. guix: import: composer: More robust string->license. guix: import: composer: Modern inputs formatting. guix: import: composer: Full rewrite composer-fetch. gnu: composer-build-system: Full check phase rewrite. Makefile.am | 6 + doc/guix.texi | 34 +++ gnu/local.mk | 1 + gnu/packages/aux-files/findclass.php | 125 +++++++++++ gnu/packages/php-xyz.scm | 60 ++++++ guix/build-system/composer.scm | 164 +++++++++++++++ guix/build/composer-build-system.scm | 300 +++++++++++++++++++++++++++ guix/import/composer.scm | 267 ++++++++++++++++++++++++ guix/scripts/import.scm | 2 +- guix/scripts/import/composer.scm | 107 ++++++++++ tests/composer.scm | 88 ++++++++ 11 files changed, 1153 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/aux-files/findclass.php create mode 100644 gnu/packages/php-xyz.scm create mode 100644 guix/build-system/composer.scm create mode 100644 guix/build/composer-build-system.scm create mode 100644 guix/import/composer.scm create mode 100644 guix/scripts/import/composer.scm create mode 100644 tests/composer.scm -- 2.41.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 2/9] gnu: Add composer-classloader. Resent-From: Nicolas Graves <ngraves@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Thu, 02 Nov 2023 15:17:03 +0000 Resent-Message-ID: <handler.42338.B42338.169893817524854 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Cc: ngraves@HIDDEN Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.169893817524854 (code B ref 42338); Thu, 02 Nov 2023 15:17:03 +0000 Received: (at 42338) by debbugs.gnu.org; 2 Nov 2023 15:16:15 +0000 Received: from localhost ([127.0.0.1]:55734 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qyZQc-0006Sg-Lp for submit <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:16:15 -0400 Received: from 1.mo560.mail-out.ovh.net ([46.105.63.121]:33451) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1qyZQX-0006Rh-MP for 42338 <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:16:12 -0400 Received: from director11.ghost.mail-out.ovh.net (unknown [10.109.156.73]) by mo560.mail-out.ovh.net (Postfix) with ESMTP id 5D8942894B for <42338 <at> debbugs.gnu.org>; Thu, 2 Nov 2023 15:15:33 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-z6wpr (unknown [10.110.103.53]) by director11.ghost.mail-out.ovh.net (Postfix) with ESMTPS id B41431FDB0; Thu, 2 Nov 2023 15:15:32 +0000 (UTC) Received: from ngraves.fr ([37.59.142.101]) by ghost-submission-6684bf9d7b-z6wpr with ESMTPSA id ljVBJxS9Q2XB1wAAYRCRfQ (envelope-from <ngraves@HIDDEN>); Thu, 02 Nov 2023 15:15:32 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-101G0040ac6b001-4210-4b8e-86bc-964885c20b98, 1761E107A7246F2314AE904A186E6A889A3776EC) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 87.88.157.103 From: Nicolas Graves <ngraves@HIDDEN> Date: Thu, 2 Nov 2023 16:04:22 +0100 Message-ID: <20231102151523.30581-3-ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231102151523.30581-1-ngraves@HIDDEN> References: <20231102151523.30581-1-ngraves@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 13624796248925266658 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedruddtiedgjeegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfgggtgfesthekredtredtjeenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeeugeeukeelheehteeuueeileffveetgffghfffueffhfejvedvgeelleetueduheenucffohhmrghinhepghhnuhdrohhrghdpghhithhhuhgsrdgtohhmpdhgvghttghomhhpohhsvghrrdhorhhgnecukfhppeduvdejrddtrddtrddupdekjedrkeekrdduheejrddutdefpdefjedrheelrddugedvrddutddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeegvdeffeekseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehiedtpdhmohguvgepshhmthhpohhuth X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * gnu/packages/php-xyz.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. --- gnu/local.mk | 1 + gnu/packages/php-xyz.scm | 60 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 gnu/packages/php-xyz.scm diff --git a/gnu/local.mk b/gnu/local.mk index 83b5268c7e..f1d16f873c 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -502,6 +502,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/photo.scm \ %D%/packages/phabricator.scm \ %D%/packages/php.scm \ + %D%/packages/php-xyz.scm \ %D%/packages/piet.scm \ %D%/packages/pikchr.scm \ %D%/packages/pkg-config.scm \ diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm new file mode 100644 index 0000000000..ac90ee3c25 --- /dev/null +++ b/gnu/packages/php-xyz.scm @@ -0,0 +1,60 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2019 Julien Lepiller <julien@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (gnu packages php-xyz) + #:use-module (gnu packages) + #:use-module (gnu packages php) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix git-download) + #:use-module (guix build-system composer) + #:use-module (guix build-system gnu) + #:use-module (guix utils) + #:use-module ((guix licenses) #:prefix license:)) + +(define-public composer-classloader + (package + (name "composer-classloader") + (version "1.9.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/composer/composer") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0127zmmg3yx84ljngfs86q7kjhyypybkf4d1ihfrfnzgynzxfxdf")))) + (build-system gnu-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (delete 'configure) + (delete 'build) + (delete 'check) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out"))) + (install-file "src/Composer/Autoload/ClassLoader.php" + (string-append out "/share/web/composer/")))))))) + (home-page "https://getcomposer.org") + (synopsis "PHP class loader extracted from the composer package") + (description "This package contains the class loader class used by Composer to +build its autoloading feature. This package is used by the composer-build-system +to build its own store-aware autoloading feature.") + (license license:expat))) -- 2.41.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 3/9] guix: Add composer-build-system. Resent-From: Nicolas Graves <ngraves@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Thu, 02 Nov 2023 15:17:03 +0000 Resent-Message-ID: <handler.42338.B42338.169893817724868 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Cc: ngraves@HIDDEN Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.169893817724868 (code B ref 42338); Thu, 02 Nov 2023 15:17:03 +0000 Received: (at 42338) by debbugs.gnu.org; 2 Nov 2023 15:16:17 +0000 Received: from localhost ([127.0.0.1]:55737 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qyZQd-0006Sq-9M for submit <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:16:16 -0400 Received: from 12.mo550.mail-out.ovh.net ([87.98.162.229]:36135) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1qyZQY-0006Rk-Lz for 42338 <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:16:13 -0400 Received: from director8.ghost.mail-out.ovh.net (unknown [10.108.1.240]) by mo550.mail-out.ovh.net (Postfix) with ESMTP id 4939D2930B for <42338 <at> debbugs.gnu.org>; Thu, 2 Nov 2023 15:15:34 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-hcdqm (unknown [10.108.16.245]) by director8.ghost.mail-out.ovh.net (Postfix) with ESMTPS id D38021FE98; Thu, 2 Nov 2023 15:15:33 +0000 (UTC) Received: from ngraves.fr ([37.59.142.105]) by ghost-submission-6684bf9d7b-hcdqm with ESMTPSA id VOciLxW9Q2X25QAASAp2eQ (envelope-from <ngraves@HIDDEN>); Thu, 02 Nov 2023 15:15:33 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-105G006ceb6e5a4-753e-4779-97fb-fee577110b0b, 1761E107A7246F2314AE904A186E6A889A3776EC) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 87.88.157.103 From: Nicolas Graves <ngraves@HIDDEN> Date: Thu, 2 Nov 2023 16:04:23 +0100 Message-ID: <20231102151523.30581-4-ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231102151523.30581-1-ngraves@HIDDEN> References: <20231102151523.30581-1-ngraves@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 13625077726803387106 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedruddtiedgjeehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfgggtgfesthekredtredtjeenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpefhgfehieffffdvjedujeelkeefuefhueehvdetieehiefhteffueejjeeuteffjeenucffohhmrghinhepghgvthgtohhmphhoshgvrhdrohhrghdpughunhgvrdgsuhhilhgupdhgihhthhhusgdrtghomhdpghhnuhdrohhrghdpvgigrghmphhlvgdrtghomhenucfkphepuddvjedrtddrtddruddpkeejrdekkedrudehjedruddtfedpfeejrdehledrudegvddruddtheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepgedvfeefkeesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheehtddpmhhouggvpehsmhhtphhouhht X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * guix/build-system/composer.scm: New file. * guix/build/composer-build-system.scm: New file. * gnu/packages/aux-files/findclass.php: New file. * Makefile.am: Add them. * doc/guix.texi (Build Systems): Document it. --- Makefile.am | 3 + doc/guix.texi | 16 +- gnu/packages/aux-files/findclass.php | 125 ++++++++++++++ guix/build-system/composer.scm | 162 ++++++++++++++++++ guix/build/composer-build-system.scm | 247 +++++++++++++++++++++++++++ tests/composer.scm | 36 ++-- 6 files changed, 568 insertions(+), 21 deletions(-) create mode 100644 gnu/packages/aux-files/findclass.php create mode 100644 guix/build-system/composer.scm create mode 100644 guix/build/composer-build-system.scm diff --git a/Makefile.am b/Makefile.am index 3fec98f064..47d1cb19ed 100644 --- a/Makefile.am +++ b/Makefile.am @@ -149,6 +149,7 @@ MODULES = \ guix/build-system/chicken.scm \ guix/build-system/clojure.scm \ guix/build-system/cmake.scm \ + guix/build-system/composer.scm \ guix/build-system/dub.scm \ guix/build-system/dune.scm \ guix/build-system/elm.scm \ @@ -206,6 +207,7 @@ MODULES = \ guix/build/cargo-utils.scm \ guix/build/chicken-build-system.scm \ guix/build/cmake-build-system.scm \ + guix/build/composer-build-system.scm \ guix/build/dub-build-system.scm \ guix/build/dune-build-system.scm \ guix/build/elm-build-system.scm \ @@ -411,6 +413,7 @@ dist_noinst_DATA = \ AUX_FILES = \ gnu/packages/aux-files/chromium/master-preferences.json \ gnu/packages/aux-files/emacs/guix-emacs.el \ + gnu/packages/aux-files/findclass.php \ gnu/packages/aux-files/guix.vim \ gnu/packages/aux-files/linux-libre/6.5-arm.conf \ gnu/packages/aux-files/linux-libre/6.5-arm64.conf \ diff --git a/doc/guix.texi b/doc/guix.texi index 0e64654715..6a1c0aeaa5 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -9554,6 +9554,20 @@ debugging information''), which roughly means that code is compiled with @code{-O2 -g}, as is the case for Autoconf-based packages by default. @end defvar +@defvar {Scheme Variable} composer-build-system +This variable is exported by @code{(guix build-system composer)}. It +implements the build procedure for packages using +@url{https://getcomposer.org/, Composer}, the PHP package manager. + +It automatically adds the @code{php} package to the set of inputs. Which +package is used can be specified with the @code{#:php} parameter. + +The @code{#:test-target} parameter is used to control which script is run +for the tests. By default, the @code{test} script is run if it exists. If +the script does not exist, the build system will run @code{phpunit} from the +source directory, assuming there is a @file{phpunit.xml} file. +@end defvar + @defvar dune-build-system This variable is exported by @code{(guix build-system dune)}. It supports builds of packages using @uref{https://dune.build/, Dune}, a build @@ -14550,7 +14564,7 @@ in Guix. @item composer @cindex Composer @cindex PHP -Import metadat from the @uref{https://getcomposer.org/, Composer} package +Import metadata from the @uref{https://getcomposer.org/, Composer} package archive used by the PHP community, as in this example: @example diff --git a/gnu/packages/aux-files/findclass.php b/gnu/packages/aux-files/findclass.php new file mode 100644 index 0000000000..d0b250c8e1 --- /dev/null +++ b/gnu/packages/aux-files/findclass.php @@ -0,0 +1,125 @@ +<?php +/** + * The content of this file is copied from composer's src/Composer/Autoload/ClassMapGenerator.php + * the findClasses method was extracted, to prevent using any dependency. + * + * Composer (and thus this file) is distributed under the expat license, and + * ClassMapGenerator.php also contains this notice: + * + * This file is part of Composer. + * + * (c) Nils Adermann <naderman@HIDDEN> + * Jordi Boggiano <j.boggiano@HIDDEN> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * This file is copied from the Symfony package. + * + * (c) Fabien Potencier <fabien@HIDDEN> + * + * To the extent to wich it makes sense, as the author of the extract: + * Copyright © 2020 Julien Lepiller <julien@HIDDEN> + */ + +/** + * Extract the classes in the given file + * + * @param string $path The file to check + * @throws \RuntimeException + * @return array The found classes + */ +function findClasses($path) +{ + $extraTypes = PHP_VERSION_ID < 50400 ? '' : '|trait'; + if (defined('HHVM_VERSION') && version_compare(HHVM_VERSION, '3.3', '>=')) { + $extraTypes .= '|enum'; + } + // Use @ here instead of Silencer to actively suppress 'unhelpful' output + // @link https://github.com/composer/composer/pull/4886 + $contents = @php_strip_whitespace($path); + if (!$contents) { + if (!file_exists($path)) { + $message = 'File at "%s" does not exist, check your classmap definitions'; + } elseif (!is_readable($path)) { + $message = 'File at "%s" is not readable, check its permissions'; + } elseif ('' === trim(file_get_contents($path))) { + // The input file was really empty and thus contains no classes + return array(); + } else { + $message = 'File at "%s" could not be parsed as PHP, it may be binary or corrupted'; + } + $error = error_get_last(); + if (isset($error['message'])) { + $message .= PHP_EOL . 'The following message may be helpful:' . PHP_EOL . $error['message']; + } + throw new \RuntimeException(sprintf($message, $path)); + } + // return early if there is no chance of matching anything in this file + if (!preg_match('{\b(?:class|interface'.$extraTypes.')\s}i', $contents)) { + return array(); + } + // strip heredocs/nowdocs + $contents = preg_replace('{<<<[ \t]*([\'"]?)(\w+)\\1(?:\r\n|\n|\r)(?:.*?)(?:\r\n|\n|\r)(?:\s*)\\2(?=\s+|[;,.)])}s', 'null', $contents); + // strip strings + $contents = preg_replace('{"[^"\\\\]*+(\\\\.[^"\\\\]*+)*+"|\'[^\'\\\\]*+(\\\\.[^\'\\\\]*+)*+\'}s', 'null', $contents); + // strip leading non-php code if needed + if (substr($contents, 0, 2) !== '<?') { + $contents = preg_replace('{^.+?<\?}s', '<?', $contents, 1, $replacements); + if ($replacements === 0) { + return array(); + } + } + // strip non-php blocks in the file + $contents = preg_replace('{\?>(?:[^<]++|<(?!\?))*+<\?}s', '?><?', $contents); + // strip trailing non-php code if needed + $pos = strrpos($contents, '?>'); + if (false !== $pos && false === strpos(substr($contents, $pos), '<?')) { + $contents = substr($contents, 0, $pos); + } + // strip comments if short open tags are in the file + if (preg_match('{(<\?)(?!(php|hh))}i', $contents)) { + $contents = preg_replace('{//.* | /\*(?:[^*]++|\*(?!/))*\*/}x', '', $contents); + } + preg_match_all('{ + (?: + \b(?<![\$:>])(?P<type>class|interface'.$extraTypes.') \s++ (?P<name>[a-zA-Z_\x7f-\xff:][a-zA-Z0-9_\x7f-\xff:\-]*+) + | \b(?<![\$:>])(?P<ns>namespace) (?P<nsname>\s++[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+(?:\s*+\\\\\s*+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+)*+)? \s*+ [\{;] + ) + }ix', $contents, $matches); + $classes = array(); + $namespace = ''; + for ($i = 0, $len = count($matches['type']); $i < $len; $i++) { + if (!empty($matches['ns'][$i])) { + $namespace = str_replace(array(' ', "\t", "\r", "\n"), '', $matches['nsname'][$i]) . '\\'; + } else { + $name = $matches['name'][$i]; + // skip anon classes extending/implementing + if ($name === 'extends' || $name === 'implements') { + continue; + } + if ($name[0] === ':') { + // This is an XHP class, https://github.com/facebook/xhp + $name = 'xhp'.substr(str_replace(array('-', ':'), array('_', '__'), $name), 1); + } elseif ($matches['type'][$i] === 'enum') { + // In Hack, something like: + // enum Foo: int { HERP = '123'; } + // The regex above captures the colon, which isn't part of + // the class name. + $name = rtrim($name, ':'); + } + $classes[] = ltrim($namespace . $name, '\\'); + } + } + return $classes; +} + +$options = getopt('i:f:', []); +$file = $options["f"]; +$input = $options["i"]; + +$classes = findClasses($file); +foreach($classes as $class) { + echo '$classmap[\''.$class.'\'] = \''.$input.'/'.$file.'\';'; + echo "\n"; +} diff --git a/guix/build-system/composer.scm b/guix/build-system/composer.scm new file mode 100644 index 0000000000..8bf99ff9c5 --- /dev/null +++ b/guix/build-system/composer.scm @@ -0,0 +1,162 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2019 Julien Lepiller <julien@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. +(define-module (guix build-system composer) + #:use-module (guix store) + #:use-module (guix utils) + #:use-module (guix derivations) + #:use-module (guix search-paths) + #:use-module (guix build-system) + #:use-module (guix build-system gnu) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (gnu packages) + #:use-module (ice-9 match) + #:use-module (srfi srfi-1) + #:export (%composer-build-system-modules + lower + composer-build + composer-build-system)) + +;; Commentary: +;; +;; Standard build procedure for PHP packages using Composer. This is implemented +;; as an extension of `gnu-build-system'. +;; +;; Code: + +(define (default-php) + "Return the default PHP package." + + ;; Do not use `@' to avoid introducing circular dependencies. + (let ((module (resolve-interface '(gnu packages php)))) + (module-ref module 'php))) + +(define (default-findclass) + "Return the default findclass script." + (search-auxiliary-file "findclass.php")) + +(define (default-composer-classloader) + "Return the default composer-classloader package." + + ;; Do not use `@' to avoid introducing circular dependencies. + (let ((module (resolve-interface '(gnu packages php-xyz)))) + (module-ref module 'composer-classloader))) + +(define %composer-build-system-modules + ;; Build-side modules imported by default. + `((guix build composer-build-system) + (guix build union) + (json) + (json builder) + (json parser) + (json record) + ,@%gnu-build-system-modules)) + +(define* (lower name + #:key source inputs native-inputs outputs system target + (php (default-php)) + (composer-classloader (default-composer-classloader)) + (findclass (default-findclass)) + #:allow-other-keys + #:rest arguments) + "Return a bag for NAME." + (define private-keywords + '(#:target #:php #:composer-classloader #:findclass #:inputs #:native-inputs)) + + (and (not target) ;XXX: no cross-compilation + (bag + (name name) + (system system) + (host-inputs `(,@(if source + `(("source" ,source)) + '()) + ,@inputs + + ;; Keep the standard inputs of 'gnu-build-system'. + ,@(standard-packages))) + (build-inputs `(("php" ,php) + ("findclass.php" ,findclass) + ("composer-classloader" ,composer-classloader) + ,@native-inputs)) + (outputs outputs) + (build composer-build) + (arguments (strip-keyword-arguments private-keywords arguments))))) + +(define* (composer-build name inputs + #:key + guile source + (outputs '("out")) + (configure-flags ''()) + (search-paths '()) + (out-of-source? #t) + (composer-file "composer.json") + (tests? #t) + (test-target "test") + (install-target "install") + (validate-runpath? #t) + (patch-shebangs? #t) + (strip-binaries? #t) + (strip-flags #~'("--strip-debug")) + (strip-directories #~'("lib" "lib64" "libexec" + "bin" "sbin")) + (phases '(@ (guix build composer-build-system) + %standard-phases)) + (system (%current-system)) + (imported-modules %composer-build-system-modules) + (modules '((guix build composer-build-system) + (guix build utils)))) + "Build SOURCE using PHP, and with INPUTS. This assumes that SOURCE provides +a 'composer.json' file as its build system." + (define builder + (with-imported-modules imported-modules + #~(begin + (use-modules #$@(sexp->gexp modules)) + + #$(with-build-variables inputs outputs + #~(composer-build + #:source #$source + #:system #$system + #:outputs %outputs + #:inputs %build-inputs + #:search-paths '#$(map search-path-specification->sexp + search-paths) + #:phases #$phases + #:out-of-source? #$out-of-source? + #:composer-file #$composer-file + #:tests? #$tests? + #:test-target #$test-target + #:install-target #$install-target + #:validate-runpath? #$validate-runpath? + #:patch-shebangs? #$patch-shebangs? + #:strip-binaries? #$strip-binaries? + #:strip-flags #$strip-flags + #:strip-directories #$strip-directories))))) + + (gexp->derivation name builder + #:system system + #:target #f + #:graft? #f + #:guile-for-build guile)) + +(define composer-build-system + (build-system + (name 'composer) + (description "The standard Composer build system") + (lower lower))) + +;;; composer.scm ends here diff --git a/guix/build/composer-build-system.scm b/guix/build/composer-build-system.scm new file mode 100644 index 0000000000..bcbae27021 --- /dev/null +++ b/guix/build/composer-build-system.scm @@ -0,0 +1,247 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2019 Julien Lepiller <julien@HIDDEN> +;;; Copyright © 2023 Nicolas Graves <ngraves@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (guix build composer-build-system) + #:use-module ((guix build gnu-build-system) #:prefix gnu:) + #:use-module (guix build utils) + #:use-module (ice-9 match) + #:use-module (json) + #:use-module (srfi srfi-26) + #:export (%standard-phases + composer-build)) + +;; Commentary: +;; +;; Builder-side code of the standard composer build procedure. +;; +;; Code: + +(define (json->require dict) + (if dict + (let loop ((result '()) (require dict)) + (match require + (() result) + ((((? (cut string-contains <> "/") name) . _) + require ...) + (loop (cons name result) require)) + ((_ require ...) (loop result require)) + (_ result))) + '())) + +(define (if-specified-to-list fn) + (match-lambda + ((? unspecified?) '()) + (arg (fn arg)) + (_ '()))) + +(define-json-mapping <composer-autoload> make-composer-autoload + composer-autoload? + json->composer-autoload + (psr-4 composer-autoload-psr-4 "psr-4" (if-specified-to-list identity)) + (classmap composer-autoload-classmap "classmap" + (if-specified-to-list vector->list))) + +(define-json-mapping <composer-package> make-composer-package composer-package? + json->composer-package + (name composer-package-name) + (autoload composer-package-autoload "autoload" + (if-specified-to-list json->composer-autoload)) + (autoload-dev composer-package-autoload-dev "autoload-dev" + (if-specified-to-list json->composer-autoload)) + (require composer-package-require "require" json->require) + (dev-require composer-package-dev-require "require-dev" json->require) + (scripts composer-package-scripts "scripts" + (if-specified-to-list identity)) + (binaries composer-package-binaries "bin" + (if-specified-to-list vector->list))) + +(define* (read-package-data #:key (filename "composer.json")) + (call-with-input-file filename + (lambda (port) + (json->composer-package (json->scm port))))) + +(define* (check #:key composer-file inputs outputs tests? test-target #:allow-other-keys) + "Test the given package." + (when tests? + (mkdir-p "vendor") + (create-autoload (string-append (getcwd) "/vendor") composer-file + (append inputs outputs) #:dev-dependencies? #t) + (let* ((package-data (read-package-data #:filename composer-file)) + (scripts (composer-package-scripts package-data)) + (test-script (assoc-ref scripts test-target)) + (dependencies (composer-package-require package-data)) + (dependencies-dev (composer-package-dev-require package-data)) + (name (composer-package-name package-data))) + (for-each + (match-lambda + ((_ . input) + (let ((bin (find-php-bin input))) + (when bin + (copy-recursively bin "vendor/bin"))))) + inputs) + (match test-script + ((? string? command) + (unless (zero? (system command)) + (throw 'failed-command command))) + (('@ (? string? command) ...) + (for-each + (lambda (c) + (unless (zero? (system c)) + (throw 'failed-command c))) + command)) + (#f (invoke "vendor/bin/phpunit")))))) + +(define (find-php-bin input) + (let* ((web-dir (string-append input "/share/web")) + (vendors (if (file-exists? web-dir) + (find-files web-dir "^vendor$" #:directories? #t) + #f))) + (match vendors + ((vendor) + (let ((bin (string-append vendor "/bin"))) + (and (file-exists? bin) bin))) + (_ #f)))) + +(define (find-php-dep inputs dependency) + (let loop ((inputs inputs)) + (match inputs + (() (throw 'unsatisfied-dependency "Unsatisfied dependency: required " + dependency)) + (((_ . input) inputs ...) + (let ((autoload (string-append input "/share/web/" dependency + "/vendor/autoload_conf.php"))) + (if (file-exists? autoload) + autoload + (loop inputs)))) + ((input inputs ...) + (let ((autoload (string-append input "/share/web/" dependency + "/vendor/autoload_conf.php"))) + (if (file-exists? autoload) + autoload + (loop inputs))))))) + +(define* (create-autoload vendor composer-file inputs #:key dev-dependencies?) + "creates an autoload.php file that sets up the class locations for this package, +so it can be autoloaded by PHP when the package classes are required." + (with-output-to-file (string-append vendor "/autoload.php") + (lambda _ + (display (string-append + "<?php +// autoload.php @generated by Guix +$map = $psr4map = $classmap = array(); +require_once '" vendor "/autoload_conf.php' +require_once '" (assoc-ref inputs "composer-classloader") "/share/web/composer/ClassLoader.php' +$loader = new \\Composer\\Autoload\\ClassLoader(); +foreach ($map as $namespace => $path) { + $loader->set($namespace, $path); +} +foreach ($psr4map as $namespace => $path) { + $loader->setPsr4($namespace, $path); +} +$loader->addClassMap($classmap); +$loader->register(); +")))) + ;; Now, create autoload_conf.php that contains the actual data, as a set + ;; of arrays + (let* ((package-data (read-package-data #:filename composer-file)) + (autoload (composer-package-autoload package-data)) + (autoload-dev (composer-package-autoload-dev package-data)) + (dependencies (composer-package-require package-data)) + (dependencies-dev (composer-package-dev-require package-data))) + (with-output-to-file (string-append vendor "/autoload_conf.php") + (lambda _ + (format #t "<?php~%") + (format #t "// autoload_conf.php @generated by Guix~%") + (force-output) + (for-each + (lambda (psr4) + (match psr4 + ((key . value) + (format #t "$psr4map['~a'] = '~a/../~a';~%" + (string-join (string-split key #\\) "\\\\") + vendor value)))) + (append + (composer-autoload-psr-4 autoload) + (if dev-dependencies? + (composer-autoload-psr-4 autoload-dev) + '()))) + (for-each + (lambda (classmap) + (for-each + (lambda (file) + (invoke "php" (assoc-ref inputs "findclass.php") + "-i" (string-append vendor "/..") "-f" file)) + (find-files classmap ".(php|hh|inc)$"))) + (append + (composer-autoload-classmap autoload) + (if dev-dependencies? + (composer-autoload-classmap autoload-dev) + '()))) + (for-each + (lambda (dep) + (format #t "require_once '~a';~%" (find-php-dep inputs dep))) + (append + dependencies + (if dev-dependencies? + dependencies-dev + '()))))))) + +(define* (install #:key inputs outputs composer-file #:allow-other-keys) + "Install the given package." + (let* ((out (assoc-ref outputs "out")) + (package-data (read-package-data #:filename composer-file)) + (name (composer-package-name package-data)) + (php-dir (string-append out "/share/web/" name)) + (bin-dir (string-append php-dir "/vendor/bin")) + (bin (string-append out "/bin")) + (binaries (composer-package-binaries package-data))) + (mkdir-p php-dir) + (copy-recursively "." php-dir) + (mkdir-p (string-append php-dir "/vendor")) + (when binaries + (mkdir-p bin-dir) + (mkdir-p bin) + (for-each + (lambda (file) + (let ((installed-file (string-append bin-dir "/" (basename file))) + (bin-file (string-append bin "/" (basename file))) + (original-file (string-append php-dir "/" file))) + (symlink original-file installed-file) + (symlink original-file bin-file))) + binaries)) + (create-autoload (string-append php-dir "/vendor") + composer-file inputs))) + +(define %standard-phases + ;; Everything is as with the GNU Build System except for the `configure' + ;; , `build', `check' and `install' phases. + (modify-phases gnu:%standard-phases + (delete 'bootstrap) + (delete 'configure) + (delete 'build) + (delete 'check) + (replace 'install install) + (add-after 'install 'check check))) + +(define* (composer-build #:key inputs (phases %standard-phases) + #:allow-other-keys #:rest args) + "Build the given package, applying all of PHASES in order." + (apply gnu:gnu-build #:inputs inputs #:phases phases args)) + +;;; composer-build-system.scm ends here diff --git a/tests/composer.scm b/tests/composer.scm index cefaf9f434..9114fef19e 100644 --- a/tests/composer.scm +++ b/tests/composer.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2020 Julien Lepiller <julien@HIDDEN> +;;; Copyright © 2023 Nicolas Graves <ngraves@HIDDEN> ;;; ;;; This file is part of GNU Guix. ;;; @@ -54,9 +55,6 @@ (define test-json (define test-source "foobar") -;; Avoid collisions with other tests. -(%http-server-port 10450) - (test-begin "composer") (test-assert "composer->guix-package" @@ -66,23 +64,21 @@ (define test-source (parameterize ((%composer-base-url (%local-url)) (current-http-proxy (%local-url))) (match (composer->guix-package "foo/bar") - (('package - ('name "php-foo-bar") - ('version "0.1") - ('source ('origin - ('method 'url-fetch) - ('uri "http://example.com/Bar-0.1.tar.gz") - ('sha256 - ('base32 - (? string? hash))))) - ('build-system 'composer-build-system) - ('native-inputs - ('quasiquote - (("php-phpunit-phpunit" ('unquote 'php-phpunit-phpunit))))) - ('synopsis "") - ('description "description") - ('home-page "http://example.com") - ('license 'license:bsd-3)) + (`(package + (name "php-foo-bar") + (version "0.1") + (source (origin + (method url-fetch) + (uri "http://example.com/Bar-0.1.tar.gz") + (sha256 + (base32 + ,(? string? hash))))) + (build-system composer-build-system) + (native-inputs (list php-phpunit-phpunit)) + (synopsis "") + (description "description") + (home-page "http://example.com") + (license license:bsd-3)) (string=? (bytevector->nix-base32-string (call-with-input-string test-source port-sha256)) hash)) -- 2.41.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 5/9] guix: import: composer: Fix json->require. Resent-From: Nicolas Graves <ngraves@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Thu, 02 Nov 2023 15:17:03 +0000 Resent-Message-ID: <handler.42338.B42338.169893817724876 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Cc: ngraves@HIDDEN Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.169893817724876 (code B ref 42338); Thu, 02 Nov 2023 15:17:03 +0000 Received: (at 42338) by debbugs.gnu.org; 2 Nov 2023 15:16:17 +0000 Received: from localhost ([127.0.0.1]:55740 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qyZQf-0006T3-0e for submit <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:16:17 -0400 Received: from 11.mo584.mail-out.ovh.net ([46.105.34.195]:59591) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1qyZQa-0006S0-IB for 42338 <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:16:13 -0400 Received: from director3.ghost.mail-out.ovh.net (unknown [10.109.156.215]) by mo584.mail-out.ovh.net (Postfix) with ESMTP id 54B40254F4 for <42338 <at> debbugs.gnu.org>; Thu, 2 Nov 2023 15:15:36 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-j6nvq (unknown [10.110.115.83]) by director3.ghost.mail-out.ovh.net (Postfix) with ESMTPS id E519D1FE4B; Thu, 2 Nov 2023 15:15:35 +0000 (UTC) Received: from ngraves.fr ([37.59.142.107]) by ghost-submission-6684bf9d7b-j6nvq with ESMTPSA id 9jqNMxe9Q2W9CwEACb9Dmg (envelope-from <ngraves@HIDDEN>); Thu, 02 Nov 2023 15:15:35 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-107S001da423eab-35e9-482e-84f2-df4fa6b86ce2, 1761E107A7246F2314AE904A186E6A889A3776EC) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 87.88.157.103 From: Nicolas Graves <ngraves@HIDDEN> Date: Thu, 2 Nov 2023 16:04:25 +0100 Message-ID: <20231102151523.30581-6-ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231102151523.30581-1-ngraves@HIDDEN> References: <20231102151523.30581-1-ngraves@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 13625640672733356770 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedruddtiedgjeehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepleffjeetueethfefkeffffefvddukeejkefgleduiedthfekvefhiedvhfffgeegnecukfhppeduvdejrddtrddtrddupdekjedrkeekrdduheejrddutdefpdefjedrheelrddugedvrddutdejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeegvdeffeekseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehkeegpdhmohguvgepshhmthhpohhuth X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) --- guix/import/composer.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/guix/import/composer.scm b/guix/import/composer.scm index 177dc63092..3acbbecf82 100644 --- a/guix/import/composer.scm +++ b/guix/import/composer.scm @@ -88,7 +88,8 @@ (define (json->require dict) ((((? (cut string-contains <> "/") name) . _) require ...) (loop (cons name result) require)) - ((_ require ...) (loop result require)))) + ((_ require ...) (loop result require)) + (_ result))) '())) (define-json-mapping <composer-source> make-composer-source composer-source? -- 2.41.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 4/9] guix: import: composer: Use memoization. Resent-From: Nicolas Graves <ngraves@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Thu, 02 Nov 2023 15:17:04 +0000 Resent-Message-ID: <handler.42338.B42338.169893817824887 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Cc: ngraves@HIDDEN Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.169893817824887 (code B ref 42338); Thu, 02 Nov 2023 15:17:04 +0000 Received: (at 42338) by debbugs.gnu.org; 2 Nov 2023 15:16:18 +0000 Received: from localhost ([127.0.0.1]:55742 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qyZQf-0006TB-Bc for submit <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:16:17 -0400 Received: from 14.mo561.mail-out.ovh.net ([188.165.43.98]:50435) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1qyZQa-0006Rq-1p for 42338 <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:16:14 -0400 Received: from director1.ghost.mail-out.ovh.net (unknown [10.109.138.16]) by mo561.mail-out.ovh.net (Postfix) with ESMTP id 3A0A324C0A for <42338 <at> debbugs.gnu.org>; Thu, 2 Nov 2023 15:15:35 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-lx9jx (unknown [10.110.115.9]) by director1.ghost.mail-out.ovh.net (Postfix) with ESMTPS id D442B1FD4A; Thu, 2 Nov 2023 15:15:34 +0000 (UTC) Received: from ngraves.fr ([37.59.142.101]) by ghost-submission-6684bf9d7b-lx9jx with ESMTPSA id klFlLha9Q2WgCgEAHdxDdw (envelope-from <ngraves@HIDDEN>); Thu, 02 Nov 2023 15:15:34 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-101G004445aa8b7-b815-4ee7-9e76-ae52f463b746, 1761E107A7246F2314AE904A186E6A889A3776EC) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 87.88.157.103 From: Nicolas Graves <ngraves@HIDDEN> Date: Thu, 2 Nov 2023 16:04:24 +0100 Message-ID: <20231102151523.30581-5-ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231102151523.30581-1-ngraves@HIDDEN> References: <20231102151523.30581-1-ngraves@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 13625359200884286178 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedruddtiedgjeegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepgffgfeevhfegueetgeektdeiueejieelteffudeugfefffelffegveeffeetffdtnecuffhomhgrihhnpehprggtkhgrghhishhtrdhorhhgnecukfhppeduvdejrddtrddtrddupdekjedrkeekrdduheejrddutdefpdefjedrheelrddugedvrddutddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeegvdeffeekseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehiedupdhmohguvgepshhmthhpohhuth X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) --- guix/import/composer.scm | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/guix/import/composer.scm b/guix/import/composer.scm index c152f402bb..177dc63092 100644 --- a/guix/import/composer.scm +++ b/guix/import/composer.scm @@ -27,6 +27,7 @@ (define-module (guix import composer) #:use-module (guix import json) #:use-module (guix import utils) #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix memoization) #:use-module (guix packages) #:use-module (guix serialization) #:use-module (guix upstream) @@ -197,16 +198,18 @@ (define (make-php-sexp composer-package) ((license) license) (_ license))))))))) -(define* (composer->guix-package package-name #:optional version) - "Fetch the metadata for PACKAGE-NAME from packagist.org, and return the +(define composer->guix-package + (memoize + (lambda* (package-name #:key version #:allow-other-keys) + "Fetch the metadata for PACKAGE-NAME from packagist.org, and return the `package' s-expression corresponding to that package, or #f on failure." - (let ((package (composer-fetch package-name version))) - (and package - (let* ((package (json->composer-package package)) - (dependencies-names (composer-package-require package)) - (dev-dependencies-names (composer-package-dev-require package))) - (values (make-php-sexp package) - (append dependencies-names dev-dependencies-names)))))) + (let ((package (composer-fetch package-name version))) + (and package + (let* ((package (json->composer-package package)) + (dependencies-names (composer-package-require package)) + (dev-dependencies-names (composer-package-dev-require package))) + (values (make-php-sexp package) + (append dependencies-names dev-dependencies-names)))))))) (define (guix-name->composer-name name) "Given a guix package name, return the name of the package in Packagist." @@ -265,6 +268,7 @@ (define %composer-updater (import latest-release))) (define* (composer-recursive-import package-name #:optional version) - (recursive-import package-name '() + (recursive-import package-name + #:version version #:repo->guix-package composer->guix-package #:guix-name php-package-name)) -- 2.41.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 6/9] guix: import: composer: More robust string->license. Resent-From: Nicolas Graves <ngraves@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Thu, 02 Nov 2023 15:17:04 +0000 Resent-Message-ID: <handler.42338.B42338.169893817824895 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Cc: ngraves@HIDDEN Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.169893817824895 (code B ref 42338); Thu, 02 Nov 2023 15:17:04 +0000 Received: (at 42338) by debbugs.gnu.org; 2 Nov 2023 15:16:18 +0000 Received: from localhost ([127.0.0.1]:55745 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qyZQg-0006TR-1V for submit <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:16:18 -0400 Received: from 15.mo583.mail-out.ovh.net ([178.33.107.29]:58247) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1qyZQb-0006S7-9p for 42338 <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:16:14 -0400 Received: from director1.ghost.mail-out.ovh.net (unknown [10.109.143.209]) by mo583.mail-out.ovh.net (Postfix) with ESMTP id 2500F290DF for <42338 <at> debbugs.gnu.org>; Thu, 2 Nov 2023 15:15:37 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-5vftv (unknown [10.110.103.233]) by director1.ghost.mail-out.ovh.net (Postfix) with ESMTPS id CCB2D1FD4A; Thu, 2 Nov 2023 15:15:36 +0000 (UTC) Received: from ngraves.fr ([37.59.142.95]) by ghost-submission-6684bf9d7b-5vftv with ESMTPSA id vP3MLxi9Q2WXOAAA7QFvrQ (envelope-from <ngraves@HIDDEN>); Thu, 02 Nov 2023 15:15:36 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-95G0017ea76c2c-fe64-4adb-abb7-3062077a8d2c, 1761E107A7246F2314AE904A186E6A889A3776EC) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 87.88.157.103 From: Nicolas Graves <ngraves@HIDDEN> Date: Thu, 2 Nov 2023 16:04:26 +0100 Message-ID: <20231102151523.30581-7-ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231102151523.30581-1-ngraves@HIDDEN> References: <20231102151523.30581-1-ngraves@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 13625922151867474658 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedruddtiedgjeegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepleffjeetueethfefkeffffefvddukeejkefgleduiedthfekvefhiedvhfffgeegnecukfhppeduvdejrddtrddtrddupdekjedrkeekrdduheejrddutdefpdefjedrheelrddugedvrdelheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepgedvfeefkeesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheekfedpmhhouggvpehsmhhtphhouhht X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * guix/import/composer.scm (string->license): Use spdx-string->license. Fall back to unknown-license!. --- guix/import/composer.scm | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/guix/import/composer.scm b/guix/import/composer.scm index 3acbbecf82..49f16caedf 100644 --- a/guix/import/composer.scm +++ b/guix/import/composer.scm @@ -109,7 +109,10 @@ (define-json-mapping <composer-package> make-composer-package composer-package? (dev-require composer-package-dev-require "require-dev" json->require) (license composer-package-license "license" (lambda (vector) - (map string->license (vector->list vector))))) + (let ((l (map string->license (vector->list vector)))) + (if (eq? (length l) 1) + (car l) + `(list ,@l)))))) (define* (composer-fetch name #:optional version) "Return an alist representation of the Composer metadata for the package NAME, @@ -194,10 +197,8 @@ (define (make-php-sexp composer-package) (synopsis "") (description ,(composer-package-description composer-package)) (home-page ,(composer-package-homepage composer-package)) - (license ,(match (composer-package-license composer-package) - (() #f) - ((license) license) - (_ license))))))))) + (license ,(or (composer-package-license composer-package) + 'unknown-license!)))))))) (define composer->guix-package (memoize @@ -234,14 +235,15 @@ (define (guix-package->composer-name package) (define (string->license str) "Convert the string STR into a license object." - (match str - ("GNU LGPL" 'license:lgpl2.0) - ("GPL" 'license:gpl3) - ((or "BSD" "BSD License" "BSD-3-Clause") 'license:bsd-3) - ((or "MIT" "MIT license" "Expat license") 'license:expat) - ("Public domain" 'license:public-domain) - ((or "Apache License, Version 2.0" "Apache 2.0") 'license:asl2.0) - (_ #f))) + (or (spdx-string->license str) + (match str + ("GNU LGPL" 'license:lgpl2.0) + ("GPL" 'license:gpl3) + ((or "BSD" "BSD License") 'license:bsd-3) + ((or "MIT" "MIT license" "Expat license") 'license:expat) + ("Public domain" 'license:public-domain) + ((or "Apache License, Version 2.0" "Apache 2.0") 'license:asl2.0) + (_ 'unknown-license!)))) (define (php-package? package) "Return true if PACKAGE is a PHP package from Packagist." -- 2.41.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 7/9] guix: import: composer: Modern inputs formatting. Resent-From: Nicolas Graves <ngraves@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Thu, 02 Nov 2023 15:17:05 +0000 Resent-Message-ID: <handler.42338.B42338.169893818124910 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Cc: ngraves@HIDDEN Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.169893818124910 (code B ref 42338); Thu, 02 Nov 2023 15:17:05 +0000 Received: (at 42338) by debbugs.gnu.org; 2 Nov 2023 15:16:21 +0000 Received: from localhost ([127.0.0.1]:55747 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qyZQi-0006Tg-Hk for submit <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:16:20 -0400 Received: from 16.mo581.mail-out.ovh.net ([46.105.72.216]:33203) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1qyZQd-0006Sb-05 for 42338 <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:16:16 -0400 Received: from director7.ghost.mail-out.ovh.net (unknown [10.109.138.157]) by mo581.mail-out.ovh.net (Postfix) with ESMTP id 9A18F28600 for <42338 <at> debbugs.gnu.org>; Thu, 2 Nov 2023 15:15:38 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-9zq47 (unknown [10.109.156.164]) by director7.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 292E01FE9F; Thu, 2 Nov 2023 15:15:38 +0000 (UTC) Received: from ngraves.fr ([37.59.142.103]) by ghost-submission-6684bf9d7b-9zq47 with ESMTPSA id zaljBRq9Q2W56ywAE7nfSw (envelope-from <ngraves@HIDDEN>); Thu, 02 Nov 2023 15:15:38 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-103G00529ac9067-6092-4558-8956-154312092193, 1761E107A7246F2314AE904A186E6A889A3776EC) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 87.88.157.103 From: Nicolas Graves <ngraves@HIDDEN> Date: Thu, 2 Nov 2023 16:04:27 +0100 Message-ID: <20231102151523.30581-8-ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231102151523.30581-1-ngraves@HIDDEN> References: <20231102151523.30581-1-ngraves@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 13626203623896900322 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedruddtiedgjeehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepleffjeetueethfefkeffffefvddukeejkefgleduiedthfekvefhiedvhfffgeegnecukfhppeduvdejrddtrddtrddupdekjedrkeekrdduheejrddutdefpdefjedrheelrddugedvrddutdefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeegvdeffeekseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehkedupdhmohguvgepshhmthhpohhuth X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * guix/import/composer.scm (make-php-sexp): Update inputs formatting. --- guix/import/composer.scm | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/guix/import/composer.scm b/guix/import/composer.scm index 49f16caedf..89c8ea9113 100644 --- a/guix/import/composer.scm +++ b/guix/import/composer.scm @@ -179,21 +179,11 @@ (define (make-php-sexp composer-package) ,@(if (null? dependencies) '() `((inputs - (,'quasiquote - ,(map (lambda (name) - `(,name - (,'unquote - ,(string->symbol name)))) - dependencies))))) + (list ,@(map string->symbol dependencies))))) ,@(if (null? dev-dependencies) '() `((native-inputs - (,'quasiquote - ,(map (lambda (name) - `(,name - (,'unquote - ,(string->symbol name)))) - dev-dependencies))))) + (list ,@(map string->symbol dev-dependencies))))) (synopsis "") (description ,(composer-package-description composer-package)) (home-page ,(composer-package-homepage composer-package)) -- 2.41.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 8/9] guix: import: composer: Full rewrite composer-fetch. Resent-From: Nicolas Graves <ngraves@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Thu, 02 Nov 2023 15:17:05 +0000 Resent-Message-ID: <handler.42338.B42338.169893818124916 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Cc: ngraves@HIDDEN Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.169893818124916 (code B ref 42338); Thu, 02 Nov 2023 15:17:05 +0000 Received: (at 42338) by debbugs.gnu.org; 2 Nov 2023 15:16:21 +0000 Received: from localhost ([127.0.0.1]:55749 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qyZQi-0006Tj-SA for submit <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:16:21 -0400 Received: from 17.mo582.mail-out.ovh.net ([46.105.36.150]:59293) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1qyZQe-0006Sn-2u for 42338 <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:16:17 -0400 Received: from director1.ghost.mail-out.ovh.net (unknown [10.108.20.46]) by mo582.mail-out.ovh.net (Postfix) with ESMTP id C14A128462 for <42338 <at> debbugs.gnu.org>; Thu, 2 Nov 2023 15:15:39 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-k8mr2 (unknown [10.109.138.190]) by director1.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 60D351FD41; Thu, 2 Nov 2023 15:15:39 +0000 (UTC) Received: from ngraves.fr ([37.59.142.105]) by ghost-submission-6684bf9d7b-k8mr2 with ESMTPSA id HYukExu9Q2WXQgIAdDy9bg (envelope-from <ngraves@HIDDEN>); Thu, 02 Nov 2023 15:15:39 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-105G0069d9f1393-d23a-4b1f-8691-7df5f51645dd, 1761E107A7246F2314AE904A186E6A889A3776EC) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 87.88.157.103 From: Nicolas Graves <ngraves@HIDDEN> Date: Thu, 2 Nov 2023 16:04:28 +0100 Message-ID: <20231102151523.30581-9-ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231102151523.30581-1-ngraves@HIDDEN> References: <20231102151523.30581-1-ngraves@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 13626485098148848354 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedruddtiedgjeegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepgffgfeevhfegueetgeektdeiueejieelteffudeugfefffelffegveeffeetffdtnecuffhomhgrihhnpehprggtkhgrghhishhtrdhorhhgnecukfhppeduvdejrddtrddtrddupdekjedrkeekrdduheejrddutdefpdefjedrheelrddugedvrddutdehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeegvdeffeekseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehkedvpdhmohguvgepshhmthhpohhuth X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Change-Id: I1c01c242cefe0bc4cfc9bd9a5717d10a61dd575e --- guix/import/composer.scm | 154 +++++++++++++++++++-------------------- 1 file changed, 77 insertions(+), 77 deletions(-) diff --git a/guix/import/composer.scm b/guix/import/composer.scm index 89c8ea9113..2cc8861bdd 100644 --- a/guix/import/composer.scm +++ b/guix/import/composer.scm @@ -19,7 +19,7 @@ (define-module (guix import composer) #:use-module (ice-9 match) #:use-module (json) - #:use-module (gcrypt hash) + #:use-module (guix hash) #:use-module (guix base32) #:use-module (guix build git) #:use-module (guix build utils) @@ -44,27 +44,6 @@ (define-module (guix import composer) (define %composer-base-url (make-parameter "https://repo.packagist.org")) -;; XXX adapted from (guix scripts hash) -(define (file-hash file select? recursive?) - ;; Compute the hash of FILE. - (if recursive? - (let-values (((port get-hash) (open-sha256-port))) - (write-file file port #:select? select?) - (force-output port) - (get-hash)) - (call-with-input-file file port-sha256))) - -;; XXX taken from (guix scripts hash) -(define (vcs-file? file stat) - (case (stat:type stat) - ((directory) - (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) - ((regular) - ;; Git sub-modules have a '.git' file that is a regular text file. - (string=? (basename file) ".git")) - (else - #f))) - (define (fix-version version) "Return a fixed version from a version string. For instance, v10.1 -> 10.1" (cond @@ -114,22 +93,36 @@ (define-json-mapping <composer-package> make-composer-package composer-package? (car l) `(list ,@l)))))) -(define* (composer-fetch name #:optional version) - "Return an alist representation of the Composer metadata for the package NAME, -or #f on failure." - (let ((package (json-fetch - (string-append (%composer-base-url) "/p/" name ".json")))) - (if package - (let* ((packages (assoc-ref package "packages")) - (package (or (assoc-ref packages name) package)) - (versions (filter - (lambda (version) - (and (not (string-contains version "dev")) - (not (string-contains version "beta")))) - (map car package))) - (version (or (if (null? version) #f version) - (latest-version versions)))) - (assoc-ref package version)) +(define (valid-version? v) + (let ((d (string-downcase v))) + (and (not (string-contains d "dev")) + (not (string-contains d "beta")) + (not (string-contains d "rc"))))) + +(define* (composer-fetch name #:key (version #f)) + "Return a composer-package representation of the Composer metadata for the +package NAME with optional VERSION, or #f on failure." + (let* ((url (string-append (%composer-base-url) "/p/" name ".json")) + (packages (and=> (json-fetch url) + (lambda (pkg) + (let ((pkgs (assoc-ref pkg "packages"))) + (or (assoc-ref pkgs name) pkg)))))) + (if packages + (json->composer-package + (if version + (assoc-ref packages version) + (cdr + (reduce + (lambda (new cur-max) + (match new + (((? valid-version? version) . tail) + (if (version>? (fix-version version) + (fix-version (car cur-max))) + (cons* version tail) + cur-max)) + (_ cur-max))) + (cons* "0.0.0" #f) + packages)))) #f))) (define (php-package-name name) @@ -158,47 +151,55 @@ (define (make-php-sexp composer-package) (composer-source-reference source) temp)) (url-fetch (composer-source-url source) temp)) - `(package - (name ,(composer-package-name composer-package)) - (version ,(composer-package-version composer-package)) - (source (origin - ,@(if git? - `((method git-fetch) - (uri (git-reference - (url ,(composer-source-url source)) - (commit ,(composer-source-reference source)))) - (file-name (git-file-name name version)) - (sha256 - (base32 - ,(bytevector->nix-base32-string - (file-hash temp (negate vcs-file?) #t))))) - `((method url-fetch) - (uri ,(composer-source-url source)) - (sha256 (base32 ,(guix-hash-url temp))))))) - (build-system composer-build-system) - ,@(if (null? dependencies) - '() - `((inputs - (list ,@(map string->symbol dependencies))))) - ,@(if (null? dev-dependencies) - '() - `((native-inputs - (list ,@(map string->symbol dev-dependencies))))) - (synopsis "") - (description ,(composer-package-description composer-package)) - (home-page ,(composer-package-homepage composer-package)) - (license ,(or (composer-package-license composer-package) - 'unknown-license!)))))))) + `(define-public ,(string->symbol + (composer-package-name composer-package)) + (package + (name ,(composer-package-name composer-package)) + (version ,(composer-package-version composer-package)) + (source + (origin + ,@(if git? + `((method git-fetch) + (uri (git-reference + (url ,(if (string-suffix? + ".git" + (composer-source-url source)) + (string-drop-right + (composer-source-url source) + (string-length ".git")) + (composer-source-url source))) + (commit ,(composer-source-reference source)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + ,(bytevector->nix-base32-string + (file-hash* temp))))) + `((method url-fetch) + (uri ,(composer-source-url source)) + (sha256 (base32 ,(guix-hash-url temp))))))) + (build-system composer-build-system) + ,@(if (null? dependencies) + '() + `((inputs + (list ,@(map string->symbol dependencies))))) + ,@(if (null? dev-dependencies) + '() + `((native-inputs + (list ,@(map string->symbol dev-dependencies))))) + (synopsis "") + (description ,(composer-package-description composer-package)) + (home-page ,(composer-package-homepage composer-package)) + (license ,(or (composer-package-license composer-package) + 'unknown-license!))))))))) (define composer->guix-package (memoize - (lambda* (package-name #:key version #:allow-other-keys) + (lambda* (package-name #:key (version #f) #:allow-other-keys) "Fetch the metadata for PACKAGE-NAME from packagist.org, and return the `package' s-expression corresponding to that package, or #f on failure." - (let ((package (composer-fetch package-name version))) + (let ((package (composer-fetch package-name #:version version))) (and package - (let* ((package (json->composer-package package)) - (dependencies-names (composer-package-require package)) + (let* ((dependencies-names (composer-package-require package)) (dev-dependencies-names (composer-package-dev-require package))) (values (make-php-sexp package) (append dependencies-names dev-dependencies-names)))))))) @@ -238,14 +239,13 @@ (define (string->license str) (define (php-package? package) "Return true if PACKAGE is a PHP package from Packagist." (and - (eq? (build-system-name (package-build-system package)) 'composer) - (string-prefix? "php-" (package-name package)))) + (eq? (package-build-system package) composer-build-system) + (string-prefix? "php-" (package-name package)))) (define (latest-release package) "Return an <upstream-source> for the latest release of PACKAGE." (let* ((php-name (guix-package->composer-name package)) - (metadata (composer-fetch php-name)) - (package (json->composer-package metadata)) + (package (composer-fetch php-name)) (version (composer-package-version package)) (url (composer-source-url (composer-package-source package)))) (upstream-source -- 2.41.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH 9/9] gnu: composer-build-system: Full check phase rewrite. Resent-From: Nicolas Graves <ngraves@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Thu, 02 Nov 2023 15:17:06 +0000 Resent-Message-ID: <handler.42338.B42338.169893818224925 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Cc: ngraves@HIDDEN Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.169893818224925 (code B ref 42338); Thu, 02 Nov 2023 15:17:06 +0000 Received: (at 42338) by debbugs.gnu.org; 2 Nov 2023 15:16:22 +0000 Received: from localhost ([127.0.0.1]:55751 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qyZQj-0006Tu-Iu for submit <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:16:22 -0400 Received: from 10.mo576.mail-out.ovh.net ([46.105.73.241]:42317) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1qyZQf-0006T1-Dj for 42338 <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:16:18 -0400 Received: from director2.ghost.mail-out.ovh.net (unknown [10.109.146.175]) by mo576.mail-out.ovh.net (Postfix) with ESMTP id 3C4982C822 for <42338 <at> debbugs.gnu.org>; Thu, 2 Nov 2023 15:15:40 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-dv48j (unknown [10.110.208.218]) by director2.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 7B14F1FE81; Thu, 2 Nov 2023 15:15:40 +0000 (UTC) Received: from ngraves.fr ([37.59.142.95]) by ghost-submission-6684bf9d7b-dv48j with ESMTPSA id wQXxGhy9Q2WVJgAA8wfQ9g (envelope-from <ngraves@HIDDEN>); Thu, 02 Nov 2023 15:15:40 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-95G0011f1c6534-6a77-47fc-94cb-b1f951337a60, 1761E107A7246F2314AE904A186E6A889A3776EC) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 87.88.157.103 From: Nicolas Graves <ngraves@HIDDEN> Date: Thu, 2 Nov 2023 16:04:29 +0100 Message-ID: <20231102151523.30581-10-ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231102151523.30581-1-ngraves@HIDDEN> References: <20231102151523.30581-1-ngraves@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 13626766575565333218 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedruddtiedgjeegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepleffjeetueethfefkeffffefvddukeejkefgleduiedthfekvefhiedvhfffgeegnecukfhppeduvdejrddtrddtrddupdekjedrkeekrdduheejrddutdefpdefjedrheelrddugedvrdelheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepgedvfeefkeesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheejiedpmhhouggvpehsmhhtphhouhht X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Change-Id: I824b27b925cd718ee83ef6b2ee4a8a1e69455de6 --- guix/build-system/composer.scm | 2 + guix/build/composer-build-system.scm | 239 ++++++++++++++++----------- 2 files changed, 148 insertions(+), 93 deletions(-) diff --git a/guix/build-system/composer.scm b/guix/build-system/composer.scm index 8bf99ff9c5..7d2ad2b398 100644 --- a/guix/build-system/composer.scm +++ b/guix/build-system/composer.scm @@ -107,6 +107,7 @@ (define* (composer-build name inputs (composer-file "composer.json") (tests? #t) (test-target "test") + (test-flags ''()) (install-target "install") (validate-runpath? #t) (patch-shebangs? #t) @@ -140,6 +141,7 @@ (define builder #:composer-file #$composer-file #:tests? #$tests? #:test-target #$test-target + #:test-flags #$test-flags #:install-target #$install-target #:validate-runpath? #$validate-runpath? #:patch-shebangs? #$patch-shebangs? diff --git a/guix/build/composer-build-system.scm b/guix/build/composer-build-system.scm index bcbae27021..6f05801ad1 100644 --- a/guix/build/composer-build-system.scm +++ b/guix/build/composer-build-system.scm @@ -53,9 +53,22 @@ (define (if-specified-to-list fn) (define-json-mapping <composer-autoload> make-composer-autoload composer-autoload? json->composer-autoload - (psr-4 composer-autoload-psr-4 "psr-4" (if-specified-to-list identity)) + (psr-4 composer-autoload-psr-4 "psr-4" + (match-lambda + ((? unspecified?) '()) + ((? (lambda (al) + (and (list? al) (pair? (car al)) (vector? (cdar al)))) al) + (append-map + (lambda (vect-el) + (list (cons (caar al) vect-el))) + (vector->list (cdar al)))) + ((? list? l) l) + (_ '()))) + (psr-0 composer-autoload-psr-0 "psr-0" (if-specified-to-list identity)) (classmap composer-autoload-classmap "classmap" - (if-specified-to-list vector->list))) + (if-specified-to-list vector->list)) + (files composer-autoload-files "files" + (if-specified-to-list vector->list))) (define-json-mapping <composer-package> make-composer-package composer-package? json->composer-package @@ -76,65 +89,57 @@ (define* (read-package-data #:key (filename "composer.json")) (lambda (port) (json->composer-package (json->scm port))))) -(define* (check #:key composer-file inputs outputs tests? test-target #:allow-other-keys) - "Test the given package." +(define* (create-test-autoload #:key composer-file inputs outputs tests? + #:allow-other-keys) + "Create the autoload.php file for tests. This is a standalone phase so that +the autoload.php file can be edited before the check phase." (when tests? (mkdir-p "vendor") (create-autoload (string-append (getcwd) "/vendor") composer-file - (append inputs outputs) #:dev-dependencies? #t) - (let* ((package-data (read-package-data #:filename composer-file)) - (scripts (composer-package-scripts package-data)) - (test-script (assoc-ref scripts test-target)) - (dependencies (composer-package-require package-data)) - (dependencies-dev (composer-package-dev-require package-data)) - (name (composer-package-name package-data))) - (for-each - (match-lambda - ((_ . input) - (let ((bin (find-php-bin input))) - (when bin - (copy-recursively bin "vendor/bin"))))) - inputs) - (match test-script - ((? string? command) - (unless (zero? (system command)) - (throw 'failed-command command))) - (('@ (? string? command) ...) - (for-each - (lambda (c) - (unless (zero? (system c)) - (throw 'failed-command c))) - command)) - (#f (invoke "vendor/bin/phpunit")))))) + inputs #:dev-dependencies? #t))) -(define (find-php-bin input) - (let* ((web-dir (string-append input "/share/web")) - (vendors (if (file-exists? web-dir) - (find-files web-dir "^vendor$" #:directories? #t) - #f))) - (match vendors - ((vendor) - (let ((bin (string-append vendor "/bin"))) - (and (file-exists? bin) bin))) - (_ #f)))) +(define (find-bin script inputs) + (search-input-file inputs + (string-append + "bin/" + (string-drop script (string-length "vendor/bin/"))))) -(define (find-php-dep inputs dependency) - (let loop ((inputs inputs)) - (match inputs - (() (throw 'unsatisfied-dependency "Unsatisfied dependency: required " - dependency)) - (((_ . input) inputs ...) - (let ((autoload (string-append input "/share/web/" dependency - "/vendor/autoload_conf.php"))) - (if (file-exists? autoload) - autoload - (loop inputs)))) - ((input inputs ...) - (let ((autoload (string-append input "/share/web/" dependency - "/vendor/autoload_conf.php"))) - (if (file-exists? autoload) - autoload - (loop inputs))))))) +(define* (check #:key composer-file inputs + tests? test-target test-flags #:allow-other-keys) + "Test the given package. +Please note that none of the PHP packages at the time of the rewrite of the +build-system did use the test-script field. This means that the @code{match +test-script} part is not tested on a real example and relies on the original +implementation." + (if tests? + (let* ((package-data (read-package-data #:filename composer-file)) + (scripts (composer-package-scripts package-data)) + (test-script (assoc-ref scripts test-target))) + (match test-script + ((? string? bin) + (let ((command (find-bin bin inputs))) + (unless (zero? (apply system command test-flags)) + (throw 'failed-command command)))) + (('@ (? string? bins) ...) + (for-each + (lambda (c) + (let ((command (find-bin bin inputs))) + (unless (zero? (apply system command test-flags)) + (throw 'failed-command command)))) + bins)) + (_ (if (file-exists? "phpunit.xml.dist") + (apply invoke + (with-exception-handler + (lambda (exn) + (if (search-error? exn) + (error "\ +Missing php-phpunit-phpunit native input.~%") + (raise exn))) + (lambda () + (search-input-file (or inputs '()) "bin/phpunit"))) + test-flags)) + (format #t "No test suite found.~%")))) + (format #t "Test suite not run.~%"))) (define* (create-autoload vendor composer-file inputs #:key dev-dependencies?) "creates an autoload.php file that sets up the class locations for this package, @@ -144,15 +149,14 @@ (define* (create-autoload vendor composer-file inputs #:key dev-dependencies?) (display (string-append "<?php // autoload.php @generated by Guix -$map = $psr4map = $classmap = array(); -require_once '" vendor "/autoload_conf.php' -require_once '" (assoc-ref inputs "composer-classloader") "/share/web/composer/ClassLoader.php' +$psr4map = $classmap = array(); +require_once '" vendor "/autoload_conf.php'; +require_once '" (assoc-ref inputs "composer-classloader") "/share/web/composer/ClassLoader.php'; $loader = new \\Composer\\Autoload\\ClassLoader(); -foreach ($map as $namespace => $path) { - $loader->set($namespace, $path); -} -foreach ($psr4map as $namespace => $path) { - $loader->setPsr4($namespace, $path); +foreach ($psr4map as $namespace => $paths) { + foreach ($paths as $path) { + $loader->addPsr4($namespace, $path); + } } $loader->addClassMap($classmap); $loader->register(); @@ -170,37 +174,85 @@ (define* (create-autoload vendor composer-file inputs #:key dev-dependencies?) (format #t "// autoload_conf.php @generated by Guix~%") (force-output) (for-each - (lambda (psr4) - (match psr4 - ((key . value) - (format #t "$psr4map['~a'] = '~a/../~a';~%" - (string-join (string-split key #\\) "\\\\") - vendor value)))) + (match-lambda + ((key . value) + (let ((vals (if (list? value) + (reverse value) + (list value)))) + (apply + format + #t + (string-append + "$psr4map['~a'][] = [" + (string-join + (make-list (length vals) "'~a/../~a'") ",") + "];~%") + (cons* (string-join (string-split key #\\) "\\\\") + (append-map (lambda (v) (list vendor v)) vals))))) + (_ (format #t ""))) + (merge-duplicates (append - (composer-autoload-psr-4 autoload) - (if dev-dependencies? - (composer-autoload-psr-4 autoload-dev) - '()))) + (composer-autoload-psr-4 autoload) + (if (and dev-dependencies? (not (null? autoload-dev))) + (composer-autoload-psr-4 autoload-dev) + '())) + '())) (for-each - (lambda (classmap) - (for-each - (lambda (file) - (invoke "php" (assoc-ref inputs "findclass.php") - "-i" (string-append vendor "/..") "-f" file)) - (find-files classmap ".(php|hh|inc)$"))) - (append - (composer-autoload-classmap autoload) - (if dev-dependencies? - (composer-autoload-classmap autoload-dev) - '()))) + (lambda (psr0) + (match psr0 + ((key . value) + (format #t "$psr4map['~a'][] = ['~a/../~a/~a'];~%" + (string-join (string-split key #\\) "\\\\") + vendor + value + (string-join (string-split key #\\) "/"))) + (_ (format #t "")))) + (append + (composer-autoload-psr-0 autoload) + (if (and dev-dependencies? (not (null? autoload-dev))) + (composer-autoload-psr-0 autoload-dev) + '()))) (for-each - (lambda (dep) - (format #t "require_once '~a';~%" (find-php-dep inputs dep))) - (append - dependencies - (if dev-dependencies? - dependencies-dev - '()))))))) + (lambda (classmap) + (for-each + (lambda (file) + (invoke "php" (assoc-ref inputs "findclass.php") + "-i" (string-append vendor "/..") "-f" file)) + (find-files classmap ".(php|hh|inc)$"))) + (append + (composer-autoload-classmap autoload) + (if (and dev-dependencies? (not (null? autoload-dev))) + (composer-autoload-classmap autoload-dev) + '()))) + (for-each + (lambda (file) + (format #t "require_once '~a/../~a';~%" vendor file)) + (append + (composer-autoload-files autoload) + (if (and dev-dependencies? (not (null? autoload-dev))) + (composer-autoload-files autoload-dev) + '()))) + (for-each + (lambda (dep) + (format + #t "require_once '~a';~%" + (search-input-file + inputs + (string-append "/share/web/" dep "/vendor/autoload_conf.php")))) + dependencies) + ;; Also add native-inputs that are not necessarily given in the + ;; composer.json. This allows to simply add a package in tests by + ;; adding it in native-inputs, without the need to patch composer.json. + (for-each + (match-lambda + ((name . loc) + (match (find-files loc "autoload_conf\\.php$") + (() #t) + (((? string? conf) . ()) + (format #t "require_once '~a';~%" conf)) + (_ #t))) + (_ #t)) + (or inputs '())))))) (define* (install #:key inputs outputs composer-file #:allow-other-keys) "Install the given package." @@ -237,7 +289,8 @@ (define %standard-phases (delete 'build) (delete 'check) (replace 'install install) - (add-after 'install 'check check))) + (add-after 'install 'check check) + (add-after 'install 'create-test-autoload create-test-autoload))) (define* (composer-build #:key inputs (phases %standard-phases) #:allow-other-keys #:rest args) -- 2.41.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH v5 0/9] Composer build-system References: <20200713002055.1553f136@HIDDEN> In-Reply-To: <20200713002055.1553f136@HIDDEN> Resent-From: Nicolas Graves <ngraves@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Thu, 02 Nov 2023 15:19:01 +0000 Resent-Message-ID: <handler.42338.B42338.169893829125192 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Cc: ngraves@HIDDEN Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.169893829125192 (code B ref 42338); Thu, 02 Nov 2023 15:19:01 +0000 Received: (at 42338) by debbugs.gnu.org; 2 Nov 2023 15:18:11 +0000 Received: from localhost ([127.0.0.1]:55766 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qyZSU-0006YG-HW for submit <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:18:10 -0400 Received: from 3.mo582.mail-out.ovh.net ([178.33.253.26]:52565) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1qyZSS-0006Y6-KD for 42338 <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:18:09 -0400 Received: from director4.ghost.mail-out.ovh.net (unknown [10.109.138.16]) by mo582.mail-out.ovh.net (Postfix) with ESMTP id 6460E28342 for <42338 <at> debbugs.gnu.org>; Thu, 2 Nov 2023 15:17:32 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-z6wpr (unknown [10.110.208.100]) by director4.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 0A0921FE62; Thu, 2 Nov 2023 15:17:31 +0000 (UTC) Received: from ngraves.fr ([37.59.142.108]) by ghost-submission-6684bf9d7b-z6wpr with ESMTPSA id 0KlEOYu9Q2XU2AAAYRCRfQ (envelope-from <ngraves@HIDDEN>); Thu, 02 Nov 2023 15:17:31 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-108S002cf8ddfa8-4286-460a-bfd5-2bd344a1eaa0, 1761E107A7246F2314AE904A186E6A889A3776EC) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 87.88.157.103 From: Nicolas Graves <ngraves@HIDDEN> Date: Thu, 2 Nov 2023 16:16:47 +0100 Message-ID: <20231102151725.31362-1-ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 13658291771180901090 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedruddtiedgjeegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepkeffgeetfffgffejgeejvdffgfdtvdeuueetgfefuedvjeegvdegjeejveeuueevnecukfhppeduvdejrddtrddtrddupdekjedrkeekrdduheejrddutdefpdefjedrheelrddugedvrddutdeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeegvdeffeekseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehkedvpdhmohguvgepshhmthhpohhuth X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) This is the result of my further rework of the composer import and build-system. The `guix: import: composer` commits can be squashed easily. This is now tested on 94 php packages with all testing enabled except for 3 packages. I will submit these packages as a whole in the alphabetical order (the bootstrap order is not worth it IMO) in a new guix issue. Before accepting it, I also would like to propose a change of names. If me make an analogy with python: tool: pip <-> composer package hub: pypi <-> packagist build-system: python/pyproject <-> php Since we only take about 90 lines of real composer code, I would rather call the build-system php-build-system. Same thing: instead of `guix import composer` we should rather call `guix import packagist`. If that's OK, I'll change it with the next (and hopefully last!) version of this build system. Nicolas Graves (9): guix: import: Add composer importer. gnu: Add composer-classloader. guix: Add composer-build-system. guix: import: composer: Use memoization. guix: import: composer: Fix json->require. guix: import: composer: More robust string->license. guix: import: composer: Modern inputs formatting. guix: import: composer: Full rewrite composer-fetch. gnu: composer-build-system: Full check phase rewrite. Makefile.am | 6 + doc/guix.texi | 34 +++ gnu/local.mk | 1 + gnu/packages/aux-files/findclass.php | 125 +++++++++++ gnu/packages/php-xyz.scm | 60 ++++++ guix/build-system/composer.scm | 164 +++++++++++++++ guix/build/composer-build-system.scm | 300 +++++++++++++++++++++++++++ guix/import/composer.scm | 267 ++++++++++++++++++++++++ guix/scripts/import.scm | 2 +- guix/scripts/import/composer.scm | 107 ++++++++++ tests/composer.scm | 88 ++++++++ 11 files changed, 1153 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/aux-files/findclass.php create mode 100644 gnu/packages/php-xyz.scm create mode 100644 guix/build-system/composer.scm create mode 100644 guix/build/composer-build-system.scm create mode 100644 guix/import/composer.scm create mode 100644 guix/scripts/import/composer.scm create mode 100644 tests/composer.scm -- 2.41.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH v5 1/9] guix: import: Add composer importer. Resent-From: Nicolas Graves <ngraves@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Thu, 02 Nov 2023 15:19:02 +0000 Resent-Message-ID: <handler.42338.B42338.169893829425215 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Cc: ngraves@HIDDEN Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.169893829425215 (code B ref 42338); Thu, 02 Nov 2023 15:19:02 +0000 Received: (at 42338) by debbugs.gnu.org; 2 Nov 2023 15:18:14 +0000 Received: from localhost ([127.0.0.1]:55769 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qyZSW-0006Ya-UQ for submit <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:18:14 -0400 Received: from 6.mo560.mail-out.ovh.net ([87.98.165.38]:57765) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1qyZST-0006Y8-TO for 42338 <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:18:11 -0400 Received: from director9.ghost.mail-out.ovh.net (unknown [10.108.1.219]) by mo560.mail-out.ovh.net (Postfix) with ESMTP id 8D4C8256E9 for <42338 <at> debbugs.gnu.org>; Thu, 2 Nov 2023 15:17:33 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-wwgj2 (unknown [10.110.115.9]) by director9.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 421A91FE55; Thu, 2 Nov 2023 15:17:33 +0000 (UTC) Received: from ngraves.fr ([37.59.142.107]) by ghost-submission-6684bf9d7b-wwgj2 with ESMTPSA id hprzBI29Q2XpKAAA3NU5ow (envelope-from <ngraves@HIDDEN>); Thu, 02 Nov 2023 15:17:33 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-107S0016ec37c43-80dc-4918-9d05-69331be9ba87, 1761E107A7246F2314AE904A186E6A889A3776EC) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 87.88.157.103 From: Nicolas Graves <ngraves@HIDDEN> Date: Thu, 2 Nov 2023 16:16:48 +0100 Message-ID: <20231102151725.31362-2-ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231102151725.31362-1-ngraves@HIDDEN> References: <20231102151725.31362-1-ngraves@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 13658573248153772770 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedruddtiedgjeegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfgggtgfesthekredtredtjeenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeduheefjefggfffhfdtjedvudetleevveejveevtdetfeeiheejgfejhedtieekueenucffohhmrghinhepghgvthgtohhmphhoshgvrhdrohhrghdpghhnuhdrohhrghdpphgrtghkrghgihhsthdrohhrghdpvgigrghmphhlvgdrtghomhenucfkphepuddvjedrtddrtddruddpkeejrdekkedrudehjedruddtfedpfeejrdehledrudegvddruddtjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepgedvfeefkeesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheeitddpmhhouggvpehsmhhtphhouhht X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * guix/import/composer.scm: New file. * guix/scripts/import/composer.scm: New file. * guix/tests/composer.scm: New file. * Makefile.am: Add them. * guix/scripts/import.scm: Add composer importer. * doc/guix.texi (Invoking guix import): Mention it. --- Makefile.am | 3 + doc/guix.texi | 20 +++ guix/import/composer.scm | 270 +++++++++++++++++++++++++++++++ guix/scripts/import.scm | 2 +- guix/scripts/import/composer.scm | 107 ++++++++++++ tests/composer.scm | 92 +++++++++++ 6 files changed, 493 insertions(+), 1 deletion(-) create mode 100644 guix/import/composer.scm create mode 100644 guix/scripts/import/composer.scm create mode 100644 tests/composer.scm diff --git a/Makefile.am b/Makefile.am index 310a231259..3fec98f064 100644 --- a/Makefile.am +++ b/Makefile.am @@ -274,6 +274,7 @@ MODULES = \ guix/search-paths.scm \ guix/packages.scm \ guix/import/cabal.scm \ + guix/import/composer.scm \ guix/import/cpan.scm \ guix/import/cran.scm \ guix/import/crate.scm \ @@ -332,6 +333,7 @@ MODULES = \ guix/scripts/home/import.scm \ guix/scripts/lint.scm \ guix/scripts/challenge.scm \ + guix/scripts/import/composer.scm \ guix/scripts/import/crate.scm \ guix/scripts/import/cpan.scm \ guix/scripts/import/cran.scm \ @@ -504,6 +506,7 @@ SCM_TESTS = \ tests/challenge.scm \ tests/channels.scm \ tests/combinators.scm \ + tests/composer.scm \ tests/containers.scm \ tests/cpan.scm \ tests/cpio.scm \ diff --git a/doc/guix.texi b/doc/guix.texi index 8c5697589f..0e64654715 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -14539,6 +14539,26 @@ guix import hexpm cf@@0.3.0 Additional options include: +@table @code +@item --recursive +@itemx -r +Traverse the dependency graph of the given upstream package recursively +and generate package expressions for all those packages that are not yet +in Guix. +@end table + +@item composer +@cindex Composer +@cindex PHP +Import metadat from the @uref{https://getcomposer.org/, Composer} package +archive used by the PHP community, as in this example: + +@example +guix import composer phpunit/phpunit +@end example + +Additional options include: + @table @code @item --recursive @itemx -r diff --git a/guix/import/composer.scm b/guix/import/composer.scm new file mode 100644 index 0000000000..c152f402bb --- /dev/null +++ b/guix/import/composer.scm @@ -0,0 +1,270 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2019 Julien Lepiller <julien@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (guix import composer) + #:use-module (ice-9 match) + #:use-module (json) + #:use-module (gcrypt hash) + #:use-module (guix base32) + #:use-module (guix build git) + #:use-module (guix build utils) + #:use-module (guix build-system) + #:use-module (guix import json) + #:use-module (guix import utils) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (guix serialization) + #:use-module (guix upstream) + #:use-module (guix utils) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-11) + #:use-module (srfi srfi-26) + #:export (composer->guix-package + %composer-updater + composer-recursive-import + + %composer-base-url)) + +(define %composer-base-url + (make-parameter "https://repo.packagist.org")) + +;; XXX adapted from (guix scripts hash) +(define (file-hash file select? recursive?) + ;; Compute the hash of FILE. + (if recursive? + (let-values (((port get-hash) (open-sha256-port))) + (write-file file port #:select? select?) + (force-output port) + (get-hash)) + (call-with-input-file file port-sha256))) + +;; XXX taken from (guix scripts hash) +(define (vcs-file? file stat) + (case (stat:type stat) + ((directory) + (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) + ((regular) + ;; Git sub-modules have a '.git' file that is a regular text file. + (string=? (basename file) ".git")) + (else + #f))) + +(define (fix-version version) + "Return a fixed version from a version string. For instance, v10.1 -> 10.1" + (cond + ((string-prefix? "version" version) + (if (char-set-contains? char-set:digit (string-ref version 7)) + (substring version 7) + (substring version 8))) + ((string-prefix? "v" version) + (substring version 1)) + (else version))) + +(define (latest-version versions) + (fold (lambda (a b) (if (version>? (fix-version a) (fix-version b)) a b)) + (car versions) versions)) + +(define (json->require dict) + (if dict + (let loop ((result '()) (require dict)) + (match require + (() result) + ((((? (cut string-contains <> "/") name) . _) + require ...) + (loop (cons name result) require)) + ((_ require ...) (loop result require)))) + '())) + +(define-json-mapping <composer-source> make-composer-source composer-source? + json->composer-source + (type composer-source-type) + (url composer-source-url) + (reference composer-source-reference)) + +(define-json-mapping <composer-package> make-composer-package composer-package? + json->composer-package + (description composer-package-description) + (homepage composer-package-homepage) + (source composer-package-source "source" json->composer-source) + (name composer-package-name "name" php-package-name) + (version composer-package-version "version" fix-version) + (require composer-package-require "require" json->require) + (dev-require composer-package-dev-require "require-dev" json->require) + (license composer-package-license "license" + (lambda (vector) + (map string->license (vector->list vector))))) + +(define* (composer-fetch name #:optional version) + "Return an alist representation of the Composer metadata for the package NAME, +or #f on failure." + (let ((package (json-fetch + (string-append (%composer-base-url) "/p/" name ".json")))) + (if package + (let* ((packages (assoc-ref package "packages")) + (package (or (assoc-ref packages name) package)) + (versions (filter + (lambda (version) + (and (not (string-contains version "dev")) + (not (string-contains version "beta")))) + (map car package))) + (version (or (if (null? version) #f version) + (latest-version versions)))) + (assoc-ref package version)) + #f))) + +(define (php-package-name name) + "Given the NAME of a package on Packagist, return a Guix-compliant name for +the package." + (let ((name (string-join (string-split name #\/) "-"))) + (if (string-prefix? "php-" name) + (snake-case name) + (string-append "php-" (snake-case name))))) + +(define (make-php-sexp composer-package) + "Return the `package' s-expression for a PHP package for the given +COMPOSER-PACKAGE." + (let* ((source (composer-package-source composer-package)) + (dependencies (map php-package-name + (composer-package-require composer-package))) + (dev-dependencies (map php-package-name + (composer-package-dev-require composer-package))) + (git? (equal? (composer-source-type source) "git"))) + ((if git? call-with-temporary-directory call-with-temporary-output-file) + (lambda* (temp #:optional port) + (and (if git? + (begin + (mkdir-p temp) + (git-fetch (composer-source-url source) + (composer-source-reference source) + temp)) + (url-fetch (composer-source-url source) temp)) + `(package + (name ,(composer-package-name composer-package)) + (version ,(composer-package-version composer-package)) + (source (origin + ,@(if git? + `((method git-fetch) + (uri (git-reference + (url ,(composer-source-url source)) + (commit ,(composer-source-reference source)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + ,(bytevector->nix-base32-string + (file-hash temp (negate vcs-file?) #t))))) + `((method url-fetch) + (uri ,(composer-source-url source)) + (sha256 (base32 ,(guix-hash-url temp))))))) + (build-system composer-build-system) + ,@(if (null? dependencies) + '() + `((inputs + (,'quasiquote + ,(map (lambda (name) + `(,name + (,'unquote + ,(string->symbol name)))) + dependencies))))) + ,@(if (null? dev-dependencies) + '() + `((native-inputs + (,'quasiquote + ,(map (lambda (name) + `(,name + (,'unquote + ,(string->symbol name)))) + dev-dependencies))))) + (synopsis "") + (description ,(composer-package-description composer-package)) + (home-page ,(composer-package-homepage composer-package)) + (license ,(match (composer-package-license composer-package) + (() #f) + ((license) license) + (_ license))))))))) + +(define* (composer->guix-package package-name #:optional version) + "Fetch the metadata for PACKAGE-NAME from packagist.org, and return the +`package' s-expression corresponding to that package, or #f on failure." + (let ((package (composer-fetch package-name version))) + (and package + (let* ((package (json->composer-package package)) + (dependencies-names (composer-package-require package)) + (dev-dependencies-names (composer-package-dev-require package))) + (values (make-php-sexp package) + (append dependencies-names dev-dependencies-names)))))) + +(define (guix-name->composer-name name) + "Given a guix package name, return the name of the package in Packagist." + (if (string-prefix? "php-" name) + (let ((components (string-split (substring name 4) #\-))) + (match components + ((namespace name ...) + (string-append namespace "/" (string-join name "-"))))) + name)) + +(define (guix-package->composer-name package) + "Given a Composer PACKAGE built from Packagist, return the name of the +package in Packagist." + (let ((upstream-name (assoc-ref + (package-properties package) + 'upstream-name)) + (name (package-name package))) + (if upstream-name + upstream-name + (guix-name->composer-name name)))) + +(define (string->license str) + "Convert the string STR into a license object." + (match str + ("GNU LGPL" 'license:lgpl2.0) + ("GPL" 'license:gpl3) + ((or "BSD" "BSD License" "BSD-3-Clause") 'license:bsd-3) + ((or "MIT" "MIT license" "Expat license") 'license:expat) + ("Public domain" 'license:public-domain) + ((or "Apache License, Version 2.0" "Apache 2.0") 'license:asl2.0) + (_ #f))) + +(define (php-package? package) + "Return true if PACKAGE is a PHP package from Packagist." + (and + (eq? (build-system-name (package-build-system package)) 'composer) + (string-prefix? "php-" (package-name package)))) + +(define (latest-release package) + "Return an <upstream-source> for the latest release of PACKAGE." + (let* ((php-name (guix-package->composer-name package)) + (metadata (composer-fetch php-name)) + (package (json->composer-package metadata)) + (version (composer-package-version package)) + (url (composer-source-url (composer-package-source package)))) + (upstream-source + (package (package-name package)) + (version version) + (urls (list url))))) + +(define %composer-updater + (upstream-updater + (name 'composer) + (description "Updater for Composer packages") + (pred php-package?) + (import latest-release))) + +(define* (composer-recursive-import package-name #:optional version) + (recursive-import package-name '() + #:repo->guix-package composer->guix-package + #:guix-name php-package-name)) diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm index 4ddd8d46a1..8c58dd35e2 100644 --- a/guix/scripts/import.scm +++ b/guix/scripts/import.scm @@ -47,7 +47,7 @@ (define %standard-import-options '()) (define importers '("gnu" "pypi" "cpan" "hackage" "stackage" "egg" "elpa" "gem" "go" "cran" "crate" "texlive" "json" "opam" - "minetest" "elm" "hexpm")) + "minetest" "elm" "hexpm" "composer")) (define (resolve-importer name) (let ((module (resolve-interface diff --git a/guix/scripts/import/composer.scm b/guix/scripts/import/composer.scm new file mode 100644 index 0000000000..412bae6318 --- /dev/null +++ b/guix/scripts/import/composer.scm @@ -0,0 +1,107 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2015 David Thompson <davet@HIDDEN> +;;; Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (guix scripts import composer) + #:use-module (guix ui) + #:use-module (guix utils) + #:use-module (guix scripts) + #:use-module (guix import composer) + #:use-module (guix scripts import) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-11) + #:use-module (srfi srfi-37) + #:use-module (srfi srfi-41) + #:use-module (ice-9 match) + #:use-module (ice-9 format) + #:export (guix-import-composer)) + + +;;; +;;; Command-line options. +;;; + +(define %default-options + '()) + +(define (show-help) + (display (G_ "Usage: guix import composer PACKAGE-NAME +Import and convert the Composer package for PACKAGE-NAME.\n")) + (display (G_ " + -h, --help display this help and exit")) + (display (G_ " + -V, --version display version information and exit")) + (display (G_ " + -r, --recursive generate package expressions for all Composer packages\ + that are not yet in Guix")) + (newline) + (show-bug-report-information)) + +(define %options + ;; Specification of the command-line options. + (cons* (option '(#\h "help") #f #f + (lambda args + (show-help) + (exit 0))) + (option '(#\V "version") #f #f + (lambda args + (show-version-and-exit "guix import composer"))) + (option '(#\r "recursive") #f #f + (lambda (opt name arg result) + (alist-cons 'recursive #t result))) + %standard-import-options)) + + +;;; +;;; Entry point. +;;; + +(define (guix-import-composer . args) + (define (parse-options) + ;; Return the alist of option values. + (args-fold* args %options + (lambda (opt name arg result) + (leave (G_ "~A: unrecognized option~%") name)) + (lambda (arg result) + (alist-cons 'argument arg result)) + %default-options)) + + (let* ((opts (parse-options)) + (args (filter-map (match-lambda + (('argument . value) + value) + (_ #f)) + (reverse opts)))) + (match args + ((package-name) + (if (assoc-ref opts 'recursive) + (map (match-lambda + ((and ('package ('name name) . rest) pkg) + `(define-public ,(string->symbol name) + ,pkg)) + (_ #f)) + (composer-recursive-import package-name)) + (let ((sexp (composer->guix-package package-name))) + (unless sexp + (leave (G_ "failed to download meta-data for package '~a'~%") + package-name)) + sexp))) + (() + (leave (G_ "too few arguments~%"))) + ((many ...) + (leave (G_ "too many arguments~%")))))) diff --git a/tests/composer.scm b/tests/composer.scm new file mode 100644 index 0000000000..cefaf9f434 --- /dev/null +++ b/tests/composer.scm @@ -0,0 +1,92 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2020 Julien Lepiller <julien@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (test-composer) + #:use-module (guix import composer) + #:use-module (guix base32) + #:use-module (gcrypt hash) + #:use-module (guix tests http) + #:use-module (guix grafts) + #:use-module (srfi srfi-64) + #:use-module (web client) + #:use-module (ice-9 match)) + +;; Globally disable grafts because they can trigger early builds. +(%graft? #f) + +(define test-json + "{ + \"packages\": { + \"foo/bar\": { + \"0.1\": { + \"name\": \"foo/bar\", + \"description\": \"description\", + \"keywords\": [\"testing\"], + \"homepage\": \"http://example.com\", + \"version\": \"0.1\", + \"license\": [\"BSD-3-Clause\"], + \"source\": { + \"type\": \"url\", + \"url\": \"http://example.com/Bar-0.1.tar.gz\" + }, + \"require\": {}, + \"require-dev\": {\"phpunit/phpunit\": \"1.0.0\"} + } + } + } +}") + +(define test-source + "foobar") + +;; Avoid collisions with other tests. +(%http-server-port 10450) + +(test-begin "composer") + +(test-assert "composer->guix-package" + ;; Replace network resources with sample data. + (with-http-server `((200 ,test-json) + (200 ,test-source)) + (parameterize ((%composer-base-url (%local-url)) + (current-http-proxy (%local-url))) + (match (composer->guix-package "foo/bar") + (('package + ('name "php-foo-bar") + ('version "0.1") + ('source ('origin + ('method 'url-fetch) + ('uri "http://example.com/Bar-0.1.tar.gz") + ('sha256 + ('base32 + (? string? hash))))) + ('build-system 'composer-build-system) + ('native-inputs + ('quasiquote + (("php-phpunit-phpunit" ('unquote 'php-phpunit-phpunit))))) + ('synopsis "") + ('description "description") + ('home-page "http://example.com") + ('license 'license:bsd-3)) + (string=? (bytevector->nix-base32-string + (call-with-input-string test-source port-sha256)) + hash)) + (x + (pk 'fail x #f)))))) + +(test-end "composer") -- 2.41.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH v5 2/9] gnu: Add composer-classloader. Resent-From: Nicolas Graves <ngraves@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Thu, 02 Nov 2023 15:19:02 +0000 Resent-Message-ID: <handler.42338.B42338.169893829425222 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Cc: ngraves@HIDDEN Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.169893829425222 (code B ref 42338); Thu, 02 Nov 2023 15:19:02 +0000 Received: (at 42338) by debbugs.gnu.org; 2 Nov 2023 15:18:14 +0000 Received: from localhost ([127.0.0.1]:55771 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qyZSY-0006Ye-4K for submit <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:18:14 -0400 Received: from 20.mo561.mail-out.ovh.net ([178.33.47.94]:40581) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1qyZSV-0006YF-0G for 42338 <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:18:12 -0400 Received: from director8.ghost.mail-out.ovh.net (unknown [10.108.16.142]) by mo561.mail-out.ovh.net (Postfix) with ESMTP id C9EA627D59 for <42338 <at> debbugs.gnu.org>; Thu, 2 Nov 2023 15:17:34 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-9zq47 (unknown [10.108.1.13]) by director8.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 62A621FE99; Thu, 2 Nov 2023 15:17:34 +0000 (UTC) Received: from ngraves.fr ([37.59.142.105]) by ghost-submission-6684bf9d7b-9zq47 with ESMTPSA id XckMEY69Q2XD7CwAE7nfSw (envelope-from <ngraves@HIDDEN>); Thu, 02 Nov 2023 15:17:34 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-105G0062b0fbf16-11c9-443d-bdb1-9cb4921880ae, 1761E107A7246F2314AE904A186E6A889A3776EC) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 87.88.157.103 From: Nicolas Graves <ngraves@HIDDEN> Date: Thu, 2 Nov 2023 16:16:49 +0100 Message-ID: <20231102151725.31362-3-ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231102151725.31362-1-ngraves@HIDDEN> References: <20231102151725.31362-1-ngraves@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 13658854724022493922 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedruddtiedgjeehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfgggtgfesthekredtredtjeenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeeugeeukeelheehteeuueeileffveetgffghfffueffhfejvedvgeelleetueduheenucffohhmrghinhepghhnuhdrohhrghdpghhithhhuhgsrdgtohhmpdhgvghttghomhhpohhsvghrrdhorhhgnecukfhppeduvdejrddtrddtrddupdekjedrkeekrdduheejrddutdefpdefjedrheelrddugedvrddutdehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeegvdeffeekseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehiedupdhmohguvgepshhmthhpohhuth X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * gnu/packages/php-xyz.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. --- gnu/local.mk | 1 + gnu/packages/php-xyz.scm | 60 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 gnu/packages/php-xyz.scm diff --git a/gnu/local.mk b/gnu/local.mk index 83b5268c7e..f1d16f873c 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -502,6 +502,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/photo.scm \ %D%/packages/phabricator.scm \ %D%/packages/php.scm \ + %D%/packages/php-xyz.scm \ %D%/packages/piet.scm \ %D%/packages/pikchr.scm \ %D%/packages/pkg-config.scm \ diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm new file mode 100644 index 0000000000..ac90ee3c25 --- /dev/null +++ b/gnu/packages/php-xyz.scm @@ -0,0 +1,60 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2019 Julien Lepiller <julien@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (gnu packages php-xyz) + #:use-module (gnu packages) + #:use-module (gnu packages php) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix git-download) + #:use-module (guix build-system composer) + #:use-module (guix build-system gnu) + #:use-module (guix utils) + #:use-module ((guix licenses) #:prefix license:)) + +(define-public composer-classloader + (package + (name "composer-classloader") + (version "1.9.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/composer/composer") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0127zmmg3yx84ljngfs86q7kjhyypybkf4d1ihfrfnzgynzxfxdf")))) + (build-system gnu-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (delete 'configure) + (delete 'build) + (delete 'check) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out"))) + (install-file "src/Composer/Autoload/ClassLoader.php" + (string-append out "/share/web/composer/")))))))) + (home-page "https://getcomposer.org") + (synopsis "PHP class loader extracted from the composer package") + (description "This package contains the class loader class used by Composer to +build its autoloading feature. This package is used by the composer-build-system +to build its own store-aware autoloading feature.") + (license license:expat))) -- 2.41.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH v5 3/9] guix: Add composer-build-system. Resent-From: Nicolas Graves <ngraves@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Thu, 02 Nov 2023 15:19:03 +0000 Resent-Message-ID: <handler.42338.B42338.169893830025262 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Cc: ngraves@HIDDEN Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.169893830025262 (code B ref 42338); Thu, 02 Nov 2023 15:19:03 +0000 Received: (at 42338) by debbugs.gnu.org; 2 Nov 2023 15:18:20 +0000 Received: from localhost ([127.0.0.1]:55776 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qyZSc-0006ZE-K8 for submit <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:18:20 -0400 Received: from 20.mo584.mail-out.ovh.net ([46.105.33.73]:57807) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1qyZSY-0006Yc-Mo for 42338 <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:18:17 -0400 Received: from director4.ghost.mail-out.ovh.net (unknown [10.108.20.237]) by mo584.mail-out.ovh.net (Postfix) with ESMTP id 690F6285F5 for <42338 <at> debbugs.gnu.org>; Thu, 2 Nov 2023 15:17:38 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-w9xmf (unknown [10.110.208.100]) by director4.ghost.mail-out.ovh.net (Postfix) with ESMTPS id E6BAC1FE62; Thu, 2 Nov 2023 15:17:37 +0000 (UTC) Received: from ngraves.fr ([37.59.142.110]) by ghost-submission-6684bf9d7b-w9xmf with ESMTPSA id dCRiM5G9Q2VUGQEAkDpEYg (envelope-from <ngraves@HIDDEN>); Thu, 02 Nov 2023 15:17:37 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-110S004142ef62d-54e7-431e-8685-21e24224c375, 1761E107A7246F2314AE904A186E6A889A3776EC) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 87.88.157.103 From: Nicolas Graves <ngraves@HIDDEN> Date: Thu, 2 Nov 2023 16:16:50 +0100 Message-ID: <20231102151725.31362-4-ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231102151725.31362-1-ngraves@HIDDEN> References: <20231102151725.31362-1-ngraves@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 13659980621468132066 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedruddtiedgjeehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfgggtgfesthekredtredtjeenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpefhgfehieffffdvjedujeelkeefuefhueehvdetieehiefhteffueejjeeuteffjeenucffohhmrghinhepghgvthgtohhmphhoshgvrhdrohhrghdpughunhgvrdgsuhhilhgupdhgihhthhhusgdrtghomhdpghhnuhdrohhrghdpvgigrghmphhlvgdrtghomhenucfkphepuddvjedrtddrtddruddpkeejrdekkedrudehjedruddtfedpfeejrdehledrudegvddruddutdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepgedvfeefkeesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheekgedpmhhouggvpehsmhhtphhouhht X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * guix/build-system/composer.scm: New file. * guix/build/composer-build-system.scm: New file. * gnu/packages/aux-files/findclass.php: New file. * Makefile.am: Add them. * doc/guix.texi (Build Systems): Document it. --- Makefile.am | 3 + doc/guix.texi | 16 +- gnu/packages/aux-files/findclass.php | 125 ++++++++++++++ guix/build-system/composer.scm | 162 ++++++++++++++++++ guix/build/composer-build-system.scm | 247 +++++++++++++++++++++++++++ tests/composer.scm | 36 ++-- 6 files changed, 568 insertions(+), 21 deletions(-) create mode 100644 gnu/packages/aux-files/findclass.php create mode 100644 guix/build-system/composer.scm create mode 100644 guix/build/composer-build-system.scm diff --git a/Makefile.am b/Makefile.am index 3fec98f064..47d1cb19ed 100644 --- a/Makefile.am +++ b/Makefile.am @@ -149,6 +149,7 @@ MODULES = \ guix/build-system/chicken.scm \ guix/build-system/clojure.scm \ guix/build-system/cmake.scm \ + guix/build-system/composer.scm \ guix/build-system/dub.scm \ guix/build-system/dune.scm \ guix/build-system/elm.scm \ @@ -206,6 +207,7 @@ MODULES = \ guix/build/cargo-utils.scm \ guix/build/chicken-build-system.scm \ guix/build/cmake-build-system.scm \ + guix/build/composer-build-system.scm \ guix/build/dub-build-system.scm \ guix/build/dune-build-system.scm \ guix/build/elm-build-system.scm \ @@ -411,6 +413,7 @@ dist_noinst_DATA = \ AUX_FILES = \ gnu/packages/aux-files/chromium/master-preferences.json \ gnu/packages/aux-files/emacs/guix-emacs.el \ + gnu/packages/aux-files/findclass.php \ gnu/packages/aux-files/guix.vim \ gnu/packages/aux-files/linux-libre/6.5-arm.conf \ gnu/packages/aux-files/linux-libre/6.5-arm64.conf \ diff --git a/doc/guix.texi b/doc/guix.texi index 0e64654715..6a1c0aeaa5 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -9554,6 +9554,20 @@ debugging information''), which roughly means that code is compiled with @code{-O2 -g}, as is the case for Autoconf-based packages by default. @end defvar +@defvar {Scheme Variable} composer-build-system +This variable is exported by @code{(guix build-system composer)}. It +implements the build procedure for packages using +@url{https://getcomposer.org/, Composer}, the PHP package manager. + +It automatically adds the @code{php} package to the set of inputs. Which +package is used can be specified with the @code{#:php} parameter. + +The @code{#:test-target} parameter is used to control which script is run +for the tests. By default, the @code{test} script is run if it exists. If +the script does not exist, the build system will run @code{phpunit} from the +source directory, assuming there is a @file{phpunit.xml} file. +@end defvar + @defvar dune-build-system This variable is exported by @code{(guix build-system dune)}. It supports builds of packages using @uref{https://dune.build/, Dune}, a build @@ -14550,7 +14564,7 @@ in Guix. @item composer @cindex Composer @cindex PHP -Import metadat from the @uref{https://getcomposer.org/, Composer} package +Import metadata from the @uref{https://getcomposer.org/, Composer} package archive used by the PHP community, as in this example: @example diff --git a/gnu/packages/aux-files/findclass.php b/gnu/packages/aux-files/findclass.php new file mode 100644 index 0000000000..d0b250c8e1 --- /dev/null +++ b/gnu/packages/aux-files/findclass.php @@ -0,0 +1,125 @@ +<?php +/** + * The content of this file is copied from composer's src/Composer/Autoload/ClassMapGenerator.php + * the findClasses method was extracted, to prevent using any dependency. + * + * Composer (and thus this file) is distributed under the expat license, and + * ClassMapGenerator.php also contains this notice: + * + * This file is part of Composer. + * + * (c) Nils Adermann <naderman@HIDDEN> + * Jordi Boggiano <j.boggiano@HIDDEN> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * This file is copied from the Symfony package. + * + * (c) Fabien Potencier <fabien@HIDDEN> + * + * To the extent to wich it makes sense, as the author of the extract: + * Copyright © 2020 Julien Lepiller <julien@HIDDEN> + */ + +/** + * Extract the classes in the given file + * + * @param string $path The file to check + * @throws \RuntimeException + * @return array The found classes + */ +function findClasses($path) +{ + $extraTypes = PHP_VERSION_ID < 50400 ? '' : '|trait'; + if (defined('HHVM_VERSION') && version_compare(HHVM_VERSION, '3.3', '>=')) { + $extraTypes .= '|enum'; + } + // Use @ here instead of Silencer to actively suppress 'unhelpful' output + // @link https://github.com/composer/composer/pull/4886 + $contents = @php_strip_whitespace($path); + if (!$contents) { + if (!file_exists($path)) { + $message = 'File at "%s" does not exist, check your classmap definitions'; + } elseif (!is_readable($path)) { + $message = 'File at "%s" is not readable, check its permissions'; + } elseif ('' === trim(file_get_contents($path))) { + // The input file was really empty and thus contains no classes + return array(); + } else { + $message = 'File at "%s" could not be parsed as PHP, it may be binary or corrupted'; + } + $error = error_get_last(); + if (isset($error['message'])) { + $message .= PHP_EOL . 'The following message may be helpful:' . PHP_EOL . $error['message']; + } + throw new \RuntimeException(sprintf($message, $path)); + } + // return early if there is no chance of matching anything in this file + if (!preg_match('{\b(?:class|interface'.$extraTypes.')\s}i', $contents)) { + return array(); + } + // strip heredocs/nowdocs + $contents = preg_replace('{<<<[ \t]*([\'"]?)(\w+)\\1(?:\r\n|\n|\r)(?:.*?)(?:\r\n|\n|\r)(?:\s*)\\2(?=\s+|[;,.)])}s', 'null', $contents); + // strip strings + $contents = preg_replace('{"[^"\\\\]*+(\\\\.[^"\\\\]*+)*+"|\'[^\'\\\\]*+(\\\\.[^\'\\\\]*+)*+\'}s', 'null', $contents); + // strip leading non-php code if needed + if (substr($contents, 0, 2) !== '<?') { + $contents = preg_replace('{^.+?<\?}s', '<?', $contents, 1, $replacements); + if ($replacements === 0) { + return array(); + } + } + // strip non-php blocks in the file + $contents = preg_replace('{\?>(?:[^<]++|<(?!\?))*+<\?}s', '?><?', $contents); + // strip trailing non-php code if needed + $pos = strrpos($contents, '?>'); + if (false !== $pos && false === strpos(substr($contents, $pos), '<?')) { + $contents = substr($contents, 0, $pos); + } + // strip comments if short open tags are in the file + if (preg_match('{(<\?)(?!(php|hh))}i', $contents)) { + $contents = preg_replace('{//.* | /\*(?:[^*]++|\*(?!/))*\*/}x', '', $contents); + } + preg_match_all('{ + (?: + \b(?<![\$:>])(?P<type>class|interface'.$extraTypes.') \s++ (?P<name>[a-zA-Z_\x7f-\xff:][a-zA-Z0-9_\x7f-\xff:\-]*+) + | \b(?<![\$:>])(?P<ns>namespace) (?P<nsname>\s++[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+(?:\s*+\\\\\s*+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+)*+)? \s*+ [\{;] + ) + }ix', $contents, $matches); + $classes = array(); + $namespace = ''; + for ($i = 0, $len = count($matches['type']); $i < $len; $i++) { + if (!empty($matches['ns'][$i])) { + $namespace = str_replace(array(' ', "\t", "\r", "\n"), '', $matches['nsname'][$i]) . '\\'; + } else { + $name = $matches['name'][$i]; + // skip anon classes extending/implementing + if ($name === 'extends' || $name === 'implements') { + continue; + } + if ($name[0] === ':') { + // This is an XHP class, https://github.com/facebook/xhp + $name = 'xhp'.substr(str_replace(array('-', ':'), array('_', '__'), $name), 1); + } elseif ($matches['type'][$i] === 'enum') { + // In Hack, something like: + // enum Foo: int { HERP = '123'; } + // The regex above captures the colon, which isn't part of + // the class name. + $name = rtrim($name, ':'); + } + $classes[] = ltrim($namespace . $name, '\\'); + } + } + return $classes; +} + +$options = getopt('i:f:', []); +$file = $options["f"]; +$input = $options["i"]; + +$classes = findClasses($file); +foreach($classes as $class) { + echo '$classmap[\''.$class.'\'] = \''.$input.'/'.$file.'\';'; + echo "\n"; +} diff --git a/guix/build-system/composer.scm b/guix/build-system/composer.scm new file mode 100644 index 0000000000..8bf99ff9c5 --- /dev/null +++ b/guix/build-system/composer.scm @@ -0,0 +1,162 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2019 Julien Lepiller <julien@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. +(define-module (guix build-system composer) + #:use-module (guix store) + #:use-module (guix utils) + #:use-module (guix derivations) + #:use-module (guix search-paths) + #:use-module (guix build-system) + #:use-module (guix build-system gnu) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (gnu packages) + #:use-module (ice-9 match) + #:use-module (srfi srfi-1) + #:export (%composer-build-system-modules + lower + composer-build + composer-build-system)) + +;; Commentary: +;; +;; Standard build procedure for PHP packages using Composer. This is implemented +;; as an extension of `gnu-build-system'. +;; +;; Code: + +(define (default-php) + "Return the default PHP package." + + ;; Do not use `@' to avoid introducing circular dependencies. + (let ((module (resolve-interface '(gnu packages php)))) + (module-ref module 'php))) + +(define (default-findclass) + "Return the default findclass script." + (search-auxiliary-file "findclass.php")) + +(define (default-composer-classloader) + "Return the default composer-classloader package." + + ;; Do not use `@' to avoid introducing circular dependencies. + (let ((module (resolve-interface '(gnu packages php-xyz)))) + (module-ref module 'composer-classloader))) + +(define %composer-build-system-modules + ;; Build-side modules imported by default. + `((guix build composer-build-system) + (guix build union) + (json) + (json builder) + (json parser) + (json record) + ,@%gnu-build-system-modules)) + +(define* (lower name + #:key source inputs native-inputs outputs system target + (php (default-php)) + (composer-classloader (default-composer-classloader)) + (findclass (default-findclass)) + #:allow-other-keys + #:rest arguments) + "Return a bag for NAME." + (define private-keywords + '(#:target #:php #:composer-classloader #:findclass #:inputs #:native-inputs)) + + (and (not target) ;XXX: no cross-compilation + (bag + (name name) + (system system) + (host-inputs `(,@(if source + `(("source" ,source)) + '()) + ,@inputs + + ;; Keep the standard inputs of 'gnu-build-system'. + ,@(standard-packages))) + (build-inputs `(("php" ,php) + ("findclass.php" ,findclass) + ("composer-classloader" ,composer-classloader) + ,@native-inputs)) + (outputs outputs) + (build composer-build) + (arguments (strip-keyword-arguments private-keywords arguments))))) + +(define* (composer-build name inputs + #:key + guile source + (outputs '("out")) + (configure-flags ''()) + (search-paths '()) + (out-of-source? #t) + (composer-file "composer.json") + (tests? #t) + (test-target "test") + (install-target "install") + (validate-runpath? #t) + (patch-shebangs? #t) + (strip-binaries? #t) + (strip-flags #~'("--strip-debug")) + (strip-directories #~'("lib" "lib64" "libexec" + "bin" "sbin")) + (phases '(@ (guix build composer-build-system) + %standard-phases)) + (system (%current-system)) + (imported-modules %composer-build-system-modules) + (modules '((guix build composer-build-system) + (guix build utils)))) + "Build SOURCE using PHP, and with INPUTS. This assumes that SOURCE provides +a 'composer.json' file as its build system." + (define builder + (with-imported-modules imported-modules + #~(begin + (use-modules #$@(sexp->gexp modules)) + + #$(with-build-variables inputs outputs + #~(composer-build + #:source #$source + #:system #$system + #:outputs %outputs + #:inputs %build-inputs + #:search-paths '#$(map search-path-specification->sexp + search-paths) + #:phases #$phases + #:out-of-source? #$out-of-source? + #:composer-file #$composer-file + #:tests? #$tests? + #:test-target #$test-target + #:install-target #$install-target + #:validate-runpath? #$validate-runpath? + #:patch-shebangs? #$patch-shebangs? + #:strip-binaries? #$strip-binaries? + #:strip-flags #$strip-flags + #:strip-directories #$strip-directories))))) + + (gexp->derivation name builder + #:system system + #:target #f + #:graft? #f + #:guile-for-build guile)) + +(define composer-build-system + (build-system + (name 'composer) + (description "The standard Composer build system") + (lower lower))) + +;;; composer.scm ends here diff --git a/guix/build/composer-build-system.scm b/guix/build/composer-build-system.scm new file mode 100644 index 0000000000..bcbae27021 --- /dev/null +++ b/guix/build/composer-build-system.scm @@ -0,0 +1,247 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2019 Julien Lepiller <julien@HIDDEN> +;;; Copyright © 2023 Nicolas Graves <ngraves@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (guix build composer-build-system) + #:use-module ((guix build gnu-build-system) #:prefix gnu:) + #:use-module (guix build utils) + #:use-module (ice-9 match) + #:use-module (json) + #:use-module (srfi srfi-26) + #:export (%standard-phases + composer-build)) + +;; Commentary: +;; +;; Builder-side code of the standard composer build procedure. +;; +;; Code: + +(define (json->require dict) + (if dict + (let loop ((result '()) (require dict)) + (match require + (() result) + ((((? (cut string-contains <> "/") name) . _) + require ...) + (loop (cons name result) require)) + ((_ require ...) (loop result require)) + (_ result))) + '())) + +(define (if-specified-to-list fn) + (match-lambda + ((? unspecified?) '()) + (arg (fn arg)) + (_ '()))) + +(define-json-mapping <composer-autoload> make-composer-autoload + composer-autoload? + json->composer-autoload + (psr-4 composer-autoload-psr-4 "psr-4" (if-specified-to-list identity)) + (classmap composer-autoload-classmap "classmap" + (if-specified-to-list vector->list))) + +(define-json-mapping <composer-package> make-composer-package composer-package? + json->composer-package + (name composer-package-name) + (autoload composer-package-autoload "autoload" + (if-specified-to-list json->composer-autoload)) + (autoload-dev composer-package-autoload-dev "autoload-dev" + (if-specified-to-list json->composer-autoload)) + (require composer-package-require "require" json->require) + (dev-require composer-package-dev-require "require-dev" json->require) + (scripts composer-package-scripts "scripts" + (if-specified-to-list identity)) + (binaries composer-package-binaries "bin" + (if-specified-to-list vector->list))) + +(define* (read-package-data #:key (filename "composer.json")) + (call-with-input-file filename + (lambda (port) + (json->composer-package (json->scm port))))) + +(define* (check #:key composer-file inputs outputs tests? test-target #:allow-other-keys) + "Test the given package." + (when tests? + (mkdir-p "vendor") + (create-autoload (string-append (getcwd) "/vendor") composer-file + (append inputs outputs) #:dev-dependencies? #t) + (let* ((package-data (read-package-data #:filename composer-file)) + (scripts (composer-package-scripts package-data)) + (test-script (assoc-ref scripts test-target)) + (dependencies (composer-package-require package-data)) + (dependencies-dev (composer-package-dev-require package-data)) + (name (composer-package-name package-data))) + (for-each + (match-lambda + ((_ . input) + (let ((bin (find-php-bin input))) + (when bin + (copy-recursively bin "vendor/bin"))))) + inputs) + (match test-script + ((? string? command) + (unless (zero? (system command)) + (throw 'failed-command command))) + (('@ (? string? command) ...) + (for-each + (lambda (c) + (unless (zero? (system c)) + (throw 'failed-command c))) + command)) + (#f (invoke "vendor/bin/phpunit")))))) + +(define (find-php-bin input) + (let* ((web-dir (string-append input "/share/web")) + (vendors (if (file-exists? web-dir) + (find-files web-dir "^vendor$" #:directories? #t) + #f))) + (match vendors + ((vendor) + (let ((bin (string-append vendor "/bin"))) + (and (file-exists? bin) bin))) + (_ #f)))) + +(define (find-php-dep inputs dependency) + (let loop ((inputs inputs)) + (match inputs + (() (throw 'unsatisfied-dependency "Unsatisfied dependency: required " + dependency)) + (((_ . input) inputs ...) + (let ((autoload (string-append input "/share/web/" dependency + "/vendor/autoload_conf.php"))) + (if (file-exists? autoload) + autoload + (loop inputs)))) + ((input inputs ...) + (let ((autoload (string-append input "/share/web/" dependency + "/vendor/autoload_conf.php"))) + (if (file-exists? autoload) + autoload + (loop inputs))))))) + +(define* (create-autoload vendor composer-file inputs #:key dev-dependencies?) + "creates an autoload.php file that sets up the class locations for this package, +so it can be autoloaded by PHP when the package classes are required." + (with-output-to-file (string-append vendor "/autoload.php") + (lambda _ + (display (string-append + "<?php +// autoload.php @generated by Guix +$map = $psr4map = $classmap = array(); +require_once '" vendor "/autoload_conf.php' +require_once '" (assoc-ref inputs "composer-classloader") "/share/web/composer/ClassLoader.php' +$loader = new \\Composer\\Autoload\\ClassLoader(); +foreach ($map as $namespace => $path) { + $loader->set($namespace, $path); +} +foreach ($psr4map as $namespace => $path) { + $loader->setPsr4($namespace, $path); +} +$loader->addClassMap($classmap); +$loader->register(); +")))) + ;; Now, create autoload_conf.php that contains the actual data, as a set + ;; of arrays + (let* ((package-data (read-package-data #:filename composer-file)) + (autoload (composer-package-autoload package-data)) + (autoload-dev (composer-package-autoload-dev package-data)) + (dependencies (composer-package-require package-data)) + (dependencies-dev (composer-package-dev-require package-data))) + (with-output-to-file (string-append vendor "/autoload_conf.php") + (lambda _ + (format #t "<?php~%") + (format #t "// autoload_conf.php @generated by Guix~%") + (force-output) + (for-each + (lambda (psr4) + (match psr4 + ((key . value) + (format #t "$psr4map['~a'] = '~a/../~a';~%" + (string-join (string-split key #\\) "\\\\") + vendor value)))) + (append + (composer-autoload-psr-4 autoload) + (if dev-dependencies? + (composer-autoload-psr-4 autoload-dev) + '()))) + (for-each + (lambda (classmap) + (for-each + (lambda (file) + (invoke "php" (assoc-ref inputs "findclass.php") + "-i" (string-append vendor "/..") "-f" file)) + (find-files classmap ".(php|hh|inc)$"))) + (append + (composer-autoload-classmap autoload) + (if dev-dependencies? + (composer-autoload-classmap autoload-dev) + '()))) + (for-each + (lambda (dep) + (format #t "require_once '~a';~%" (find-php-dep inputs dep))) + (append + dependencies + (if dev-dependencies? + dependencies-dev + '()))))))) + +(define* (install #:key inputs outputs composer-file #:allow-other-keys) + "Install the given package." + (let* ((out (assoc-ref outputs "out")) + (package-data (read-package-data #:filename composer-file)) + (name (composer-package-name package-data)) + (php-dir (string-append out "/share/web/" name)) + (bin-dir (string-append php-dir "/vendor/bin")) + (bin (string-append out "/bin")) + (binaries (composer-package-binaries package-data))) + (mkdir-p php-dir) + (copy-recursively "." php-dir) + (mkdir-p (string-append php-dir "/vendor")) + (when binaries + (mkdir-p bin-dir) + (mkdir-p bin) + (for-each + (lambda (file) + (let ((installed-file (string-append bin-dir "/" (basename file))) + (bin-file (string-append bin "/" (basename file))) + (original-file (string-append php-dir "/" file))) + (symlink original-file installed-file) + (symlink original-file bin-file))) + binaries)) + (create-autoload (string-append php-dir "/vendor") + composer-file inputs))) + +(define %standard-phases + ;; Everything is as with the GNU Build System except for the `configure' + ;; , `build', `check' and `install' phases. + (modify-phases gnu:%standard-phases + (delete 'bootstrap) + (delete 'configure) + (delete 'build) + (delete 'check) + (replace 'install install) + (add-after 'install 'check check))) + +(define* (composer-build #:key inputs (phases %standard-phases) + #:allow-other-keys #:rest args) + "Build the given package, applying all of PHASES in order." + (apply gnu:gnu-build #:inputs inputs #:phases phases args)) + +;;; composer-build-system.scm ends here diff --git a/tests/composer.scm b/tests/composer.scm index cefaf9f434..9114fef19e 100644 --- a/tests/composer.scm +++ b/tests/composer.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2020 Julien Lepiller <julien@HIDDEN> +;;; Copyright © 2023 Nicolas Graves <ngraves@HIDDEN> ;;; ;;; This file is part of GNU Guix. ;;; @@ -54,9 +55,6 @@ (define test-json (define test-source "foobar") -;; Avoid collisions with other tests. -(%http-server-port 10450) - (test-begin "composer") (test-assert "composer->guix-package" @@ -66,23 +64,21 @@ (define test-source (parameterize ((%composer-base-url (%local-url)) (current-http-proxy (%local-url))) (match (composer->guix-package "foo/bar") - (('package - ('name "php-foo-bar") - ('version "0.1") - ('source ('origin - ('method 'url-fetch) - ('uri "http://example.com/Bar-0.1.tar.gz") - ('sha256 - ('base32 - (? string? hash))))) - ('build-system 'composer-build-system) - ('native-inputs - ('quasiquote - (("php-phpunit-phpunit" ('unquote 'php-phpunit-phpunit))))) - ('synopsis "") - ('description "description") - ('home-page "http://example.com") - ('license 'license:bsd-3)) + (`(package + (name "php-foo-bar") + (version "0.1") + (source (origin + (method url-fetch) + (uri "http://example.com/Bar-0.1.tar.gz") + (sha256 + (base32 + ,(? string? hash))))) + (build-system composer-build-system) + (native-inputs (list php-phpunit-phpunit)) + (synopsis "") + (description "description") + (home-page "http://example.com") + (license license:bsd-3)) (string=? (bytevector->nix-base32-string (call-with-input-string test-source port-sha256)) hash)) -- 2.41.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH v5 5/9] guix: import: composer: Fix json->require. Resent-From: Nicolas Graves <ngraves@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Thu, 02 Nov 2023 15:19:03 +0000 Resent-Message-ID: <handler.42338.B42338.169893830025272 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Cc: ngraves@HIDDEN Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.169893830025272 (code B ref 42338); Thu, 02 Nov 2023 15:19:03 +0000 Received: (at 42338) by debbugs.gnu.org; 2 Nov 2023 15:18:20 +0000 Received: from localhost ([127.0.0.1]:55780 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qyZSe-0006ZQ-8h for submit <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:18:20 -0400 Received: from 3.mo582.mail-out.ovh.net ([178.33.253.26]:48231) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1qyZSa-0006Yt-JE for 42338 <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:18:17 -0400 Received: from director10.ghost.mail-out.ovh.net (unknown [10.109.156.215]) by mo582.mail-out.ovh.net (Postfix) with ESMTP id CD4EC22DCE for <42338 <at> debbugs.gnu.org>; Thu, 2 Nov 2023 15:17:40 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-cfcvv (unknown [10.110.171.34]) by director10.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 85E051FE9C; Thu, 2 Nov 2023 15:17:40 +0000 (UTC) Received: from ngraves.fr ([37.59.142.106]) by ghost-submission-6684bf9d7b-cfcvv with ESMTPSA id R4GJHJS9Q2WFEQEA0wFIyQ (envelope-from <ngraves@HIDDEN>); Thu, 02 Nov 2023 15:17:40 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-106R006a2988ee5-162b-46ba-8cf6-7d026d76c949, 1761E107A7246F2314AE904A186E6A889A3776EC) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 87.88.157.103 From: Nicolas Graves <ngraves@HIDDEN> Date: Thu, 2 Nov 2023 16:16:52 +0100 Message-ID: <20231102151725.31362-6-ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231102151725.31362-1-ngraves@HIDDEN> References: <20231102151725.31362-1-ngraves@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 13660543571319317218 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedruddtiedgjeegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepleffjeetueethfefkeffffefvddukeejkefgleduiedthfekvefhiedvhfffgeegnecukfhppeduvdejrddtrddtrddupdekjedrkeekrdduheejrddutdefpdefjedrheelrddugedvrddutdeinecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeegvdeffeekseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehkedvpdhmohguvgepshhmthhpohhuth X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) --- guix/import/composer.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/guix/import/composer.scm b/guix/import/composer.scm index 177dc63092..3acbbecf82 100644 --- a/guix/import/composer.scm +++ b/guix/import/composer.scm @@ -88,7 +88,8 @@ (define (json->require dict) ((((? (cut string-contains <> "/") name) . _) require ...) (loop (cons name result) require)) - ((_ require ...) (loop result require)))) + ((_ require ...) (loop result require)) + (_ result))) '())) (define-json-mapping <composer-source> make-composer-source composer-source? -- 2.41.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH v5 4/9] guix: import: composer: Use memoization. Resent-From: Nicolas Graves <ngraves@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Thu, 02 Nov 2023 15:19:03 +0000 Resent-Message-ID: <handler.42338.B42338.169893830125280 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Cc: ngraves@HIDDEN Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.169893830125280 (code B ref 42338); Thu, 02 Nov 2023 15:19:03 +0000 Received: (at 42338) by debbugs.gnu.org; 2 Nov 2023 15:18:21 +0000 Received: from localhost ([127.0.0.1]:55783 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qyZSe-0006ZZ-QG for submit <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:18:21 -0400 Received: from 3.mo560.mail-out.ovh.net ([46.105.58.226]:58487) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1qyZSZ-0006Yr-W6 for 42338 <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:18:17 -0400 Received: from director9.ghost.mail-out.ovh.net (unknown [10.108.1.219]) by mo560.mail-out.ovh.net (Postfix) with ESMTP id CDC4226DC5 for <42338 <at> debbugs.gnu.org>; Thu, 2 Nov 2023 15:17:39 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-4qhnc (unknown [10.110.103.155]) by director9.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 70B6F1FE2D; Thu, 2 Nov 2023 15:17:39 +0000 (UTC) Received: from ngraves.fr ([37.59.142.107]) by ghost-submission-6684bf9d7b-4qhnc with ESMTPSA id po6fDJO9Q2UHFAEAIaFYXg (envelope-from <ngraves@HIDDEN>); Thu, 02 Nov 2023 15:17:39 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-107S0011e7a6a1a-d072-4966-a8a2-91deed8b9b29, 1761E107A7246F2314AE904A186E6A889A3776EC) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 87.88.157.103 From: Nicolas Graves <ngraves@HIDDEN> Date: Thu, 2 Nov 2023 16:16:51 +0100 Message-ID: <20231102151725.31362-5-ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231102151725.31362-1-ngraves@HIDDEN> References: <20231102151725.31362-1-ngraves@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 13660262095901156066 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedruddtiedgjeehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepgffgfeevhfegueetgeektdeiueejieelteffudeugfefffelffegveeffeetffdtnecuffhomhgrihhnpehprggtkhgrghhishhtrdhorhhgnecukfhppeduvdejrddtrddtrddupdekjedrkeekrdduheejrddutdefpdefjedrheelrddugedvrddutdejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeegvdeffeekseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehiedtpdhmohguvgepshhmthhpohhuth X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) --- guix/import/composer.scm | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/guix/import/composer.scm b/guix/import/composer.scm index c152f402bb..177dc63092 100644 --- a/guix/import/composer.scm +++ b/guix/import/composer.scm @@ -27,6 +27,7 @@ (define-module (guix import composer) #:use-module (guix import json) #:use-module (guix import utils) #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix memoization) #:use-module (guix packages) #:use-module (guix serialization) #:use-module (guix upstream) @@ -197,16 +198,18 @@ (define (make-php-sexp composer-package) ((license) license) (_ license))))))))) -(define* (composer->guix-package package-name #:optional version) - "Fetch the metadata for PACKAGE-NAME from packagist.org, and return the +(define composer->guix-package + (memoize + (lambda* (package-name #:key version #:allow-other-keys) + "Fetch the metadata for PACKAGE-NAME from packagist.org, and return the `package' s-expression corresponding to that package, or #f on failure." - (let ((package (composer-fetch package-name version))) - (and package - (let* ((package (json->composer-package package)) - (dependencies-names (composer-package-require package)) - (dev-dependencies-names (composer-package-dev-require package))) - (values (make-php-sexp package) - (append dependencies-names dev-dependencies-names)))))) + (let ((package (composer-fetch package-name version))) + (and package + (let* ((package (json->composer-package package)) + (dependencies-names (composer-package-require package)) + (dev-dependencies-names (composer-package-dev-require package))) + (values (make-php-sexp package) + (append dependencies-names dev-dependencies-names)))))))) (define (guix-name->composer-name name) "Given a guix package name, return the name of the package in Packagist." @@ -265,6 +268,7 @@ (define %composer-updater (import latest-release))) (define* (composer-recursive-import package-name #:optional version) - (recursive-import package-name '() + (recursive-import package-name + #:version version #:repo->guix-package composer->guix-package #:guix-name php-package-name)) -- 2.41.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH v5 7/9] guix: import: composer: Modern inputs formatting. Resent-From: Nicolas Graves <ngraves@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Thu, 02 Nov 2023 15:19:04 +0000 Resent-Message-ID: <handler.42338.B42338.169893830125289 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Cc: ngraves@HIDDEN Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.169893830125289 (code B ref 42338); Thu, 02 Nov 2023 15:19:04 +0000 Received: (at 42338) by debbugs.gnu.org; 2 Nov 2023 15:18:21 +0000 Received: from localhost ([127.0.0.1]:55785 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qyZSf-0006Zh-7d for submit <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:18:21 -0400 Received: from 12.mo582.mail-out.ovh.net ([178.32.125.228]:33887) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1qyZSd-0006ZD-8F for 42338 <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:18:20 -0400 Received: from director4.ghost.mail-out.ovh.net (unknown [10.109.138.16]) by mo582.mail-out.ovh.net (Postfix) with ESMTP id 2A19F229AF for <42338 <at> debbugs.gnu.org>; Thu, 2 Nov 2023 15:17:43 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-w9xmf (unknown [10.110.171.120]) by director4.ghost.mail-out.ovh.net (Postfix) with ESMTPS id E0AB81FD68; Thu, 2 Nov 2023 15:17:42 +0000 (UTC) Received: from ngraves.fr ([37.59.142.97]) by ghost-submission-6684bf9d7b-w9xmf with ESMTPSA id 563qM5a9Q2VgGQEAkDpEYg (envelope-from <ngraves@HIDDEN>); Thu, 02 Nov 2023 15:17:42 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-97G00207eb3580-2e67-4d3f-b4f9-4660a3fd04b9, 1761E107A7246F2314AE904A186E6A889A3776EC) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 87.88.157.103 From: Nicolas Graves <ngraves@HIDDEN> Date: Thu, 2 Nov 2023 16:16:54 +0100 Message-ID: <20231102151725.31362-8-ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231102151725.31362-1-ngraves@HIDDEN> References: <20231102151725.31362-1-ngraves@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 13661387996363678434 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedruddtiedgjeegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepleffjeetueethfefkeffffefvddukeejkefgleduiedthfekvefhiedvhfffgeegnecukfhppeduvdejrddtrddtrddupdekjedrkeekrdduheejrddutdefpdefjedrheelrddugedvrdeljeenucevlhhushhtvghrufhiiigvpedvnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepgedvfeefkeesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheekvddpmhhouggvpehsmhhtphhouhht X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * guix/import/composer.scm (make-php-sexp): Update inputs formatting. --- guix/import/composer.scm | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/guix/import/composer.scm b/guix/import/composer.scm index 49f16caedf..89c8ea9113 100644 --- a/guix/import/composer.scm +++ b/guix/import/composer.scm @@ -179,21 +179,11 @@ (define (make-php-sexp composer-package) ,@(if (null? dependencies) '() `((inputs - (,'quasiquote - ,(map (lambda (name) - `(,name - (,'unquote - ,(string->symbol name)))) - dependencies))))) + (list ,@(map string->symbol dependencies))))) ,@(if (null? dev-dependencies) '() `((native-inputs - (,'quasiquote - ,(map (lambda (name) - `(,name - (,'unquote - ,(string->symbol name)))) - dev-dependencies))))) + (list ,@(map string->symbol dev-dependencies))))) (synopsis "") (description ,(composer-package-description composer-package)) (home-page ,(composer-package-homepage composer-package)) -- 2.41.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH v5 6/9] guix: import: composer: More robust string->license. Resent-From: Nicolas Graves <ngraves@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Thu, 02 Nov 2023 15:19:04 +0000 Resent-Message-ID: <handler.42338.B42338.169893830525313 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Cc: ngraves@HIDDEN Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.169893830525313 (code B ref 42338); Thu, 02 Nov 2023 15:19:04 +0000 Received: (at 42338) by debbugs.gnu.org; 2 Nov 2023 15:18:25 +0000 Received: from localhost ([127.0.0.1]:55788 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qyZSi-0006aC-J4 for submit <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:18:24 -0400 Received: from 1.mo575.mail-out.ovh.net ([46.105.41.146]:34115) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1qyZSd-0006Z1-4t for 42338 <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:18:21 -0400 Received: from director6.ghost.mail-out.ovh.net (unknown [10.108.16.216]) by mo575.mail-out.ovh.net (Postfix) with ESMTP id 4A15928F5A for <42338 <at> debbugs.gnu.org>; Thu, 2 Nov 2023 15:17:42 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-m2wzr (unknown [10.110.171.34]) by director6.ghost.mail-out.ovh.net (Postfix) with ESMTPS id DD9D91FEA9; Thu, 2 Nov 2023 15:17:41 +0000 (UTC) Received: from ngraves.fr ([37.59.142.99]) by ghost-submission-6684bf9d7b-m2wzr with ESMTPSA id ydjfJ5W9Q2UW9QAAgBOxzA (envelope-from <ngraves@HIDDEN>); Thu, 02 Nov 2023 15:17:41 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-99G003faf7ff7b-72cf-49aa-a267-83035e8d9a5b, 1761E107A7246F2314AE904A186E6A889A3776EC) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 87.88.157.103 From: Nicolas Graves <ngraves@HIDDEN> Date: Thu, 2 Nov 2023 16:16:53 +0100 Message-ID: <20231102151725.31362-7-ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231102151725.31362-1-ngraves@HIDDEN> References: <20231102151725.31362-1-ngraves@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 13661106521551069922 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedruddtiedgjeehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepleffjeetueethfefkeffffefvddukeejkefgleduiedthfekvefhiedvhfffgeegnecukfhppeduvdejrddtrddtrddupdekjedrkeekrdduheejrddutdefpdefjedrheelrddugedvrdelleenucevlhhushhtvghrufhiiigvpedvnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepgedvfeefkeesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheejhedpmhhouggvpehsmhhtphhouhht X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * guix/import/composer.scm (string->license): Use spdx-string->license. Fall back to unknown-license!. --- guix/import/composer.scm | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/guix/import/composer.scm b/guix/import/composer.scm index 3acbbecf82..49f16caedf 100644 --- a/guix/import/composer.scm +++ b/guix/import/composer.scm @@ -109,7 +109,10 @@ (define-json-mapping <composer-package> make-composer-package composer-package? (dev-require composer-package-dev-require "require-dev" json->require) (license composer-package-license "license" (lambda (vector) - (map string->license (vector->list vector))))) + (let ((l (map string->license (vector->list vector)))) + (if (eq? (length l) 1) + (car l) + `(list ,@l)))))) (define* (composer-fetch name #:optional version) "Return an alist representation of the Composer metadata for the package NAME, @@ -194,10 +197,8 @@ (define (make-php-sexp composer-package) (synopsis "") (description ,(composer-package-description composer-package)) (home-page ,(composer-package-homepage composer-package)) - (license ,(match (composer-package-license composer-package) - (() #f) - ((license) license) - (_ license))))))))) + (license ,(or (composer-package-license composer-package) + 'unknown-license!)))))))) (define composer->guix-package (memoize @@ -234,14 +235,15 @@ (define (guix-package->composer-name package) (define (string->license str) "Convert the string STR into a license object." - (match str - ("GNU LGPL" 'license:lgpl2.0) - ("GPL" 'license:gpl3) - ((or "BSD" "BSD License" "BSD-3-Clause") 'license:bsd-3) - ((or "MIT" "MIT license" "Expat license") 'license:expat) - ("Public domain" 'license:public-domain) - ((or "Apache License, Version 2.0" "Apache 2.0") 'license:asl2.0) - (_ #f))) + (or (spdx-string->license str) + (match str + ("GNU LGPL" 'license:lgpl2.0) + ("GPL" 'license:gpl3) + ((or "BSD" "BSD License") 'license:bsd-3) + ((or "MIT" "MIT license" "Expat license") 'license:expat) + ("Public domain" 'license:public-domain) + ((or "Apache License, Version 2.0" "Apache 2.0") 'license:asl2.0) + (_ 'unknown-license!)))) (define (php-package? package) "Return true if PACKAGE is a PHP package from Packagist." -- 2.41.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH v5 8/9] guix: import: composer: Full rewrite composer-fetch. Resent-From: Nicolas Graves <ngraves@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Thu, 02 Nov 2023 15:19:04 +0000 Resent-Message-ID: <handler.42338.B42338.169893830525320 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Cc: ngraves@HIDDEN Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.169893830525320 (code B ref 42338); Thu, 02 Nov 2023 15:19:04 +0000 Received: (at 42338) by debbugs.gnu.org; 2 Nov 2023 15:18:25 +0000 Received: from localhost ([127.0.0.1]:55790 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qyZSi-0006aE-Tt for submit <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:18:25 -0400 Received: from 7.mo575.mail-out.ovh.net ([46.105.63.230]:35809) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1qyZSe-0006ZG-6W for 42338 <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:18:21 -0400 Received: from director8.ghost.mail-out.ovh.net (unknown [10.109.143.79]) by mo575.mail-out.ovh.net (Postfix) with ESMTP id 21FDA28F49 for <42338 <at> debbugs.gnu.org>; Thu, 2 Nov 2023 15:17:44 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-vt5f5 (unknown [10.110.103.93]) by director8.ghost.mail-out.ovh.net (Postfix) with ESMTPS id B5C3A1FEB4; Thu, 2 Nov 2023 15:17:43 +0000 (UTC) Received: from ngraves.fr ([37.59.142.99]) by ghost-submission-6684bf9d7b-vt5f5 with ESMTPSA id x1lWKZe9Q2Vq5gAA5SnFsg (envelope-from <ngraves@HIDDEN>); Thu, 02 Nov 2023 15:17:43 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-99G003d815ace5-ccaf-45bc-aa7d-6b6576e44ec2, 1761E107A7246F2314AE904A186E6A889A3776EC) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 87.88.157.103 From: Nicolas Graves <ngraves@HIDDEN> Date: Thu, 2 Nov 2023 16:16:55 +0100 Message-ID: <20231102151725.31362-9-ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231102151725.31362-1-ngraves@HIDDEN> References: <20231102151725.31362-1-ngraves@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 13661669471634907874 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedruddtiedgjeehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepgffgfeevhfegueetgeektdeiueejieelteffudeugfefffelffegveeffeetffdtnecuffhomhgrihhnpehprggtkhgrghhishhtrdhorhhgnecukfhppeduvdejrddtrddtrddupdekjedrkeekrdduheejrddutdefpdefjedrheelrddugedvrdelleenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepgedvfeefkeesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheejhedpmhhouggvpehsmhhtphhouhht X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Change-Id: I1c01c242cefe0bc4cfc9bd9a5717d10a61dd575e --- guix/import/composer.scm | 154 +++++++++++++++++++-------------------- 1 file changed, 77 insertions(+), 77 deletions(-) diff --git a/guix/import/composer.scm b/guix/import/composer.scm index 89c8ea9113..2cc8861bdd 100644 --- a/guix/import/composer.scm +++ b/guix/import/composer.scm @@ -19,7 +19,7 @@ (define-module (guix import composer) #:use-module (ice-9 match) #:use-module (json) - #:use-module (gcrypt hash) + #:use-module (guix hash) #:use-module (guix base32) #:use-module (guix build git) #:use-module (guix build utils) @@ -44,27 +44,6 @@ (define-module (guix import composer) (define %composer-base-url (make-parameter "https://repo.packagist.org")) -;; XXX adapted from (guix scripts hash) -(define (file-hash file select? recursive?) - ;; Compute the hash of FILE. - (if recursive? - (let-values (((port get-hash) (open-sha256-port))) - (write-file file port #:select? select?) - (force-output port) - (get-hash)) - (call-with-input-file file port-sha256))) - -;; XXX taken from (guix scripts hash) -(define (vcs-file? file stat) - (case (stat:type stat) - ((directory) - (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) - ((regular) - ;; Git sub-modules have a '.git' file that is a regular text file. - (string=? (basename file) ".git")) - (else - #f))) - (define (fix-version version) "Return a fixed version from a version string. For instance, v10.1 -> 10.1" (cond @@ -114,22 +93,36 @@ (define-json-mapping <composer-package> make-composer-package composer-package? (car l) `(list ,@l)))))) -(define* (composer-fetch name #:optional version) - "Return an alist representation of the Composer metadata for the package NAME, -or #f on failure." - (let ((package (json-fetch - (string-append (%composer-base-url) "/p/" name ".json")))) - (if package - (let* ((packages (assoc-ref package "packages")) - (package (or (assoc-ref packages name) package)) - (versions (filter - (lambda (version) - (and (not (string-contains version "dev")) - (not (string-contains version "beta")))) - (map car package))) - (version (or (if (null? version) #f version) - (latest-version versions)))) - (assoc-ref package version)) +(define (valid-version? v) + (let ((d (string-downcase v))) + (and (not (string-contains d "dev")) + (not (string-contains d "beta")) + (not (string-contains d "rc"))))) + +(define* (composer-fetch name #:key (version #f)) + "Return a composer-package representation of the Composer metadata for the +package NAME with optional VERSION, or #f on failure." + (let* ((url (string-append (%composer-base-url) "/p/" name ".json")) + (packages (and=> (json-fetch url) + (lambda (pkg) + (let ((pkgs (assoc-ref pkg "packages"))) + (or (assoc-ref pkgs name) pkg)))))) + (if packages + (json->composer-package + (if version + (assoc-ref packages version) + (cdr + (reduce + (lambda (new cur-max) + (match new + (((? valid-version? version) . tail) + (if (version>? (fix-version version) + (fix-version (car cur-max))) + (cons* version tail) + cur-max)) + (_ cur-max))) + (cons* "0.0.0" #f) + packages)))) #f))) (define (php-package-name name) @@ -158,47 +151,55 @@ (define (make-php-sexp composer-package) (composer-source-reference source) temp)) (url-fetch (composer-source-url source) temp)) - `(package - (name ,(composer-package-name composer-package)) - (version ,(composer-package-version composer-package)) - (source (origin - ,@(if git? - `((method git-fetch) - (uri (git-reference - (url ,(composer-source-url source)) - (commit ,(composer-source-reference source)))) - (file-name (git-file-name name version)) - (sha256 - (base32 - ,(bytevector->nix-base32-string - (file-hash temp (negate vcs-file?) #t))))) - `((method url-fetch) - (uri ,(composer-source-url source)) - (sha256 (base32 ,(guix-hash-url temp))))))) - (build-system composer-build-system) - ,@(if (null? dependencies) - '() - `((inputs - (list ,@(map string->symbol dependencies))))) - ,@(if (null? dev-dependencies) - '() - `((native-inputs - (list ,@(map string->symbol dev-dependencies))))) - (synopsis "") - (description ,(composer-package-description composer-package)) - (home-page ,(composer-package-homepage composer-package)) - (license ,(or (composer-package-license composer-package) - 'unknown-license!)))))))) + `(define-public ,(string->symbol + (composer-package-name composer-package)) + (package + (name ,(composer-package-name composer-package)) + (version ,(composer-package-version composer-package)) + (source + (origin + ,@(if git? + `((method git-fetch) + (uri (git-reference + (url ,(if (string-suffix? + ".git" + (composer-source-url source)) + (string-drop-right + (composer-source-url source) + (string-length ".git")) + (composer-source-url source))) + (commit ,(composer-source-reference source)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + ,(bytevector->nix-base32-string + (file-hash* temp))))) + `((method url-fetch) + (uri ,(composer-source-url source)) + (sha256 (base32 ,(guix-hash-url temp))))))) + (build-system composer-build-system) + ,@(if (null? dependencies) + '() + `((inputs + (list ,@(map string->symbol dependencies))))) + ,@(if (null? dev-dependencies) + '() + `((native-inputs + (list ,@(map string->symbol dev-dependencies))))) + (synopsis "") + (description ,(composer-package-description composer-package)) + (home-page ,(composer-package-homepage composer-package)) + (license ,(or (composer-package-license composer-package) + 'unknown-license!))))))))) (define composer->guix-package (memoize - (lambda* (package-name #:key version #:allow-other-keys) + (lambda* (package-name #:key (version #f) #:allow-other-keys) "Fetch the metadata for PACKAGE-NAME from packagist.org, and return the `package' s-expression corresponding to that package, or #f on failure." - (let ((package (composer-fetch package-name version))) + (let ((package (composer-fetch package-name #:version version))) (and package - (let* ((package (json->composer-package package)) - (dependencies-names (composer-package-require package)) + (let* ((dependencies-names (composer-package-require package)) (dev-dependencies-names (composer-package-dev-require package))) (values (make-php-sexp package) (append dependencies-names dev-dependencies-names)))))))) @@ -238,14 +239,13 @@ (define (string->license str) (define (php-package? package) "Return true if PACKAGE is a PHP package from Packagist." (and - (eq? (build-system-name (package-build-system package)) 'composer) - (string-prefix? "php-" (package-name package)))) + (eq? (package-build-system package) composer-build-system) + (string-prefix? "php-" (package-name package)))) (define (latest-release package) "Return an <upstream-source> for the latest release of PACKAGE." (let* ((php-name (guix-package->composer-name package)) - (metadata (composer-fetch php-name)) - (package (json->composer-package metadata)) + (package (composer-fetch php-name)) (version (composer-package-version package)) (url (composer-source-url (composer-package-source package)))) (upstream-source -- 2.41.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH v5 9/9] gnu: composer-build-system: Full check phase rewrite. Resent-From: Nicolas Graves <ngraves@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Thu, 02 Nov 2023 15:19:05 +0000 Resent-Message-ID: <handler.42338.B42338.169893830625327 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Cc: ngraves@HIDDEN Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.169893830625327 (code B ref 42338); Thu, 02 Nov 2023 15:19:05 +0000 Received: (at 42338) by debbugs.gnu.org; 2 Nov 2023 15:18:26 +0000 Received: from localhost ([127.0.0.1]:55792 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qyZSj-0006aL-Hu for submit <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:18:26 -0400 Received: from 8.mo550.mail-out.ovh.net ([178.33.110.239]:40205) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1qyZSf-0006ZX-C2 for 42338 <at> debbugs.gnu.org; Thu, 02 Nov 2023 11:18:22 -0400 Received: from director2.ghost.mail-out.ovh.net (unknown [10.108.4.253]) by mo550.mail-out.ovh.net (Postfix) with ESMTP id 4A914290F0 for <42338 <at> debbugs.gnu.org>; Thu, 2 Nov 2023 15:17:45 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-qvpd6 (unknown [10.110.171.251]) by director2.ghost.mail-out.ovh.net (Postfix) with ESMTPS id C56111FE79; Thu, 2 Nov 2023 15:17:44 +0000 (UTC) Received: from ngraves.fr ([37.59.142.110]) by ghost-submission-6684bf9d7b-qvpd6 with ESMTPSA id uc23LJi9Q2V3MgEAyqyfIw (envelope-from <ngraves@HIDDEN>); Thu, 02 Nov 2023 15:17:44 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-110S004da97deae-e500-47b6-835b-a6d0b8d515a5, 1761E107A7246F2314AE904A186E6A889A3776EC) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 87.88.157.103 From: Nicolas Graves <ngraves@HIDDEN> Date: Thu, 2 Nov 2023 16:16:56 +0100 Message-ID: <20231102151725.31362-10-ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231102151725.31362-1-ngraves@HIDDEN> References: <20231102151725.31362-1-ngraves@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 13661950945032987362 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedruddtiedgjeehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepleffjeetueethfefkeffffefvddukeejkefgleduiedthfekvefhiedvhfffgeegnecukfhppeduvdejrddtrddtrddupdekjedrkeekrdduheejrddutdefpdefjedrheelrddugedvrdduuddtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeegvdeffeekseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehhedtpdhmohguvgepshhmthhpohhuthdpughkihhmpehprghssh X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Change-Id: I824b27b925cd718ee83ef6b2ee4a8a1e69455de6 --- guix/build-system/composer.scm | 2 + guix/build/composer-build-system.scm | 239 ++++++++++++++++----------- 2 files changed, 148 insertions(+), 93 deletions(-) diff --git a/guix/build-system/composer.scm b/guix/build-system/composer.scm index 8bf99ff9c5..7d2ad2b398 100644 --- a/guix/build-system/composer.scm +++ b/guix/build-system/composer.scm @@ -107,6 +107,7 @@ (define* (composer-build name inputs (composer-file "composer.json") (tests? #t) (test-target "test") + (test-flags ''()) (install-target "install") (validate-runpath? #t) (patch-shebangs? #t) @@ -140,6 +141,7 @@ (define builder #:composer-file #$composer-file #:tests? #$tests? #:test-target #$test-target + #:test-flags #$test-flags #:install-target #$install-target #:validate-runpath? #$validate-runpath? #:patch-shebangs? #$patch-shebangs? diff --git a/guix/build/composer-build-system.scm b/guix/build/composer-build-system.scm index bcbae27021..6f05801ad1 100644 --- a/guix/build/composer-build-system.scm +++ b/guix/build/composer-build-system.scm @@ -53,9 +53,22 @@ (define (if-specified-to-list fn) (define-json-mapping <composer-autoload> make-composer-autoload composer-autoload? json->composer-autoload - (psr-4 composer-autoload-psr-4 "psr-4" (if-specified-to-list identity)) + (psr-4 composer-autoload-psr-4 "psr-4" + (match-lambda + ((? unspecified?) '()) + ((? (lambda (al) + (and (list? al) (pair? (car al)) (vector? (cdar al)))) al) + (append-map + (lambda (vect-el) + (list (cons (caar al) vect-el))) + (vector->list (cdar al)))) + ((? list? l) l) + (_ '()))) + (psr-0 composer-autoload-psr-0 "psr-0" (if-specified-to-list identity)) (classmap composer-autoload-classmap "classmap" - (if-specified-to-list vector->list))) + (if-specified-to-list vector->list)) + (files composer-autoload-files "files" + (if-specified-to-list vector->list))) (define-json-mapping <composer-package> make-composer-package composer-package? json->composer-package @@ -76,65 +89,57 @@ (define* (read-package-data #:key (filename "composer.json")) (lambda (port) (json->composer-package (json->scm port))))) -(define* (check #:key composer-file inputs outputs tests? test-target #:allow-other-keys) - "Test the given package." +(define* (create-test-autoload #:key composer-file inputs outputs tests? + #:allow-other-keys) + "Create the autoload.php file for tests. This is a standalone phase so that +the autoload.php file can be edited before the check phase." (when tests? (mkdir-p "vendor") (create-autoload (string-append (getcwd) "/vendor") composer-file - (append inputs outputs) #:dev-dependencies? #t) - (let* ((package-data (read-package-data #:filename composer-file)) - (scripts (composer-package-scripts package-data)) - (test-script (assoc-ref scripts test-target)) - (dependencies (composer-package-require package-data)) - (dependencies-dev (composer-package-dev-require package-data)) - (name (composer-package-name package-data))) - (for-each - (match-lambda - ((_ . input) - (let ((bin (find-php-bin input))) - (when bin - (copy-recursively bin "vendor/bin"))))) - inputs) - (match test-script - ((? string? command) - (unless (zero? (system command)) - (throw 'failed-command command))) - (('@ (? string? command) ...) - (for-each - (lambda (c) - (unless (zero? (system c)) - (throw 'failed-command c))) - command)) - (#f (invoke "vendor/bin/phpunit")))))) + inputs #:dev-dependencies? #t))) -(define (find-php-bin input) - (let* ((web-dir (string-append input "/share/web")) - (vendors (if (file-exists? web-dir) - (find-files web-dir "^vendor$" #:directories? #t) - #f))) - (match vendors - ((vendor) - (let ((bin (string-append vendor "/bin"))) - (and (file-exists? bin) bin))) - (_ #f)))) +(define (find-bin script inputs) + (search-input-file inputs + (string-append + "bin/" + (string-drop script (string-length "vendor/bin/"))))) -(define (find-php-dep inputs dependency) - (let loop ((inputs inputs)) - (match inputs - (() (throw 'unsatisfied-dependency "Unsatisfied dependency: required " - dependency)) - (((_ . input) inputs ...) - (let ((autoload (string-append input "/share/web/" dependency - "/vendor/autoload_conf.php"))) - (if (file-exists? autoload) - autoload - (loop inputs)))) - ((input inputs ...) - (let ((autoload (string-append input "/share/web/" dependency - "/vendor/autoload_conf.php"))) - (if (file-exists? autoload) - autoload - (loop inputs))))))) +(define* (check #:key composer-file inputs + tests? test-target test-flags #:allow-other-keys) + "Test the given package. +Please note that none of the PHP packages at the time of the rewrite of the +build-system did use the test-script field. This means that the @code{match +test-script} part is not tested on a real example and relies on the original +implementation." + (if tests? + (let* ((package-data (read-package-data #:filename composer-file)) + (scripts (composer-package-scripts package-data)) + (test-script (assoc-ref scripts test-target))) + (match test-script + ((? string? bin) + (let ((command (find-bin bin inputs))) + (unless (zero? (apply system command test-flags)) + (throw 'failed-command command)))) + (('@ (? string? bins) ...) + (for-each + (lambda (c) + (let ((command (find-bin bin inputs))) + (unless (zero? (apply system command test-flags)) + (throw 'failed-command command)))) + bins)) + (_ (if (file-exists? "phpunit.xml.dist") + (apply invoke + (with-exception-handler + (lambda (exn) + (if (search-error? exn) + (error "\ +Missing php-phpunit-phpunit native input.~%") + (raise exn))) + (lambda () + (search-input-file (or inputs '()) "bin/phpunit"))) + test-flags)) + (format #t "No test suite found.~%")))) + (format #t "Test suite not run.~%"))) (define* (create-autoload vendor composer-file inputs #:key dev-dependencies?) "creates an autoload.php file that sets up the class locations for this package, @@ -144,15 +149,14 @@ (define* (create-autoload vendor composer-file inputs #:key dev-dependencies?) (display (string-append "<?php // autoload.php @generated by Guix -$map = $psr4map = $classmap = array(); -require_once '" vendor "/autoload_conf.php' -require_once '" (assoc-ref inputs "composer-classloader") "/share/web/composer/ClassLoader.php' +$psr4map = $classmap = array(); +require_once '" vendor "/autoload_conf.php'; +require_once '" (assoc-ref inputs "composer-classloader") "/share/web/composer/ClassLoader.php'; $loader = new \\Composer\\Autoload\\ClassLoader(); -foreach ($map as $namespace => $path) { - $loader->set($namespace, $path); -} -foreach ($psr4map as $namespace => $path) { - $loader->setPsr4($namespace, $path); +foreach ($psr4map as $namespace => $paths) { + foreach ($paths as $path) { + $loader->addPsr4($namespace, $path); + } } $loader->addClassMap($classmap); $loader->register(); @@ -170,37 +174,85 @@ (define* (create-autoload vendor composer-file inputs #:key dev-dependencies?) (format #t "// autoload_conf.php @generated by Guix~%") (force-output) (for-each - (lambda (psr4) - (match psr4 - ((key . value) - (format #t "$psr4map['~a'] = '~a/../~a';~%" - (string-join (string-split key #\\) "\\\\") - vendor value)))) + (match-lambda + ((key . value) + (let ((vals (if (list? value) + (reverse value) + (list value)))) + (apply + format + #t + (string-append + "$psr4map['~a'][] = [" + (string-join + (make-list (length vals) "'~a/../~a'") ",") + "];~%") + (cons* (string-join (string-split key #\\) "\\\\") + (append-map (lambda (v) (list vendor v)) vals))))) + (_ (format #t ""))) + (merge-duplicates (append - (composer-autoload-psr-4 autoload) - (if dev-dependencies? - (composer-autoload-psr-4 autoload-dev) - '()))) + (composer-autoload-psr-4 autoload) + (if (and dev-dependencies? (not (null? autoload-dev))) + (composer-autoload-psr-4 autoload-dev) + '())) + '())) (for-each - (lambda (classmap) - (for-each - (lambda (file) - (invoke "php" (assoc-ref inputs "findclass.php") - "-i" (string-append vendor "/..") "-f" file)) - (find-files classmap ".(php|hh|inc)$"))) - (append - (composer-autoload-classmap autoload) - (if dev-dependencies? - (composer-autoload-classmap autoload-dev) - '()))) + (lambda (psr0) + (match psr0 + ((key . value) + (format #t "$psr4map['~a'][] = ['~a/../~a/~a'];~%" + (string-join (string-split key #\\) "\\\\") + vendor + value + (string-join (string-split key #\\) "/"))) + (_ (format #t "")))) + (append + (composer-autoload-psr-0 autoload) + (if (and dev-dependencies? (not (null? autoload-dev))) + (composer-autoload-psr-0 autoload-dev) + '()))) (for-each - (lambda (dep) - (format #t "require_once '~a';~%" (find-php-dep inputs dep))) - (append - dependencies - (if dev-dependencies? - dependencies-dev - '()))))))) + (lambda (classmap) + (for-each + (lambda (file) + (invoke "php" (assoc-ref inputs "findclass.php") + "-i" (string-append vendor "/..") "-f" file)) + (find-files classmap ".(php|hh|inc)$"))) + (append + (composer-autoload-classmap autoload) + (if (and dev-dependencies? (not (null? autoload-dev))) + (composer-autoload-classmap autoload-dev) + '()))) + (for-each + (lambda (file) + (format #t "require_once '~a/../~a';~%" vendor file)) + (append + (composer-autoload-files autoload) + (if (and dev-dependencies? (not (null? autoload-dev))) + (composer-autoload-files autoload-dev) + '()))) + (for-each + (lambda (dep) + (format + #t "require_once '~a';~%" + (search-input-file + inputs + (string-append "/share/web/" dep "/vendor/autoload_conf.php")))) + dependencies) + ;; Also add native-inputs that are not necessarily given in the + ;; composer.json. This allows to simply add a package in tests by + ;; adding it in native-inputs, without the need to patch composer.json. + (for-each + (match-lambda + ((name . loc) + (match (find-files loc "autoload_conf\\.php$") + (() #t) + (((? string? conf) . ()) + (format #t "require_once '~a';~%" conf)) + (_ #t))) + (_ #t)) + (or inputs '())))))) (define* (install #:key inputs outputs composer-file #:allow-other-keys) "Install the given package." @@ -237,7 +289,8 @@ (define %standard-phases (delete 'build) (delete 'check) (replace 'install install) - (add-after 'install 'check check))) + (add-after 'install 'check check) + (add-after 'install 'create-test-autoload create-test-autoload))) (define* (composer-build #:key inputs (phases %standard-phases) #:allow-other-keys #:rest args) -- 2.41.0
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [Nicolas Graves via Guix-patches via] [bug#42338] [PATCH v5 0/9] Composer build-system Resent-From: Nicolas Graves <ngraves@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Thu, 07 Dec 2023 12:37:02 +0000 Resent-Message-ID: <handler.42338.B42338.170195261414040 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN> Cc: Josselin Poiret <dev@HIDDEN>, 42338 <at> debbugs.gnu.org, Mathieu Othacehe <othacehe@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Christopher Baines <guix@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN> Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.170195261414040 (code B ref 42338); Thu, 07 Dec 2023 12:37:02 +0000 Received: (at 42338) by debbugs.gnu.org; 7 Dec 2023 12:36:54 +0000 Received: from localhost ([127.0.0.1]:41327 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1rBDcc-0003eM-AI for submit <at> debbugs.gnu.org; Thu, 07 Dec 2023 07:36:54 -0500 Received: from 8.mo584.mail-out.ovh.net ([188.165.33.112]:53851) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1rBDcY-0003eA-2V for 42338 <at> debbugs.gnu.org; Thu, 07 Dec 2023 07:36:53 -0500 Received: from director6.ghost.mail-out.ovh.net (unknown [10.108.4.44]) by mo584.mail-out.ovh.net (Postfix) with ESMTP id 202B92932A for <42338 <at> debbugs.gnu.org>; Thu, 7 Dec 2023 12:36:34 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-zjhh8 (unknown [10.110.171.110]) by director6.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 0D67A1FEA9; Thu, 7 Dec 2023 12:36:31 +0000 (UTC) Received: from ngraves.fr ([37.59.142.95]) by ghost-submission-6684bf9d7b-zjhh8 with ESMTPSA id mfNTOk+8cWVysQkAfdXY+A (envelope-from <ngraves@HIDDEN>); Thu, 07 Dec 2023 12:36:31 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-95G001415ce06f-dea8-4dd0-a197-e284b552f7cc, F167F2758619D3209121FEA782FE70F808DEEB4F) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 80.214.69.23 From: Nicolas Graves <ngraves@HIDDEN> In-Reply-To: <87ttq3u8m4.fsf@HIDDEN> References: <20231102151725.31362-1-ngraves@HIDDEN> <87ttq3u8m4.fsf@HIDDEN> Date: Thu, 07 Dec 2023 13:36:30 +0100 Message-ID: <87o7f2xk8h.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain X-Ovh-Tracer-Id: 13569908630813598392 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrudekvddggeefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefujghffffkgggtsehttdertddttddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepveekleeujedthefgffekleekhffhffetgfdvheekleeuhfehueeljedtjefhvdfgnecukfhppeduvdejrddtrddtrddupdektddrvddugedrieelrddvfedpfeejrdehledrudegvddrleehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeegvdeffeekseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehkeegpdhmohguvgepshhmthhpohhuth X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Just a quick reminder for this patch series. ;) The right version is the v5 now, and I was asking for opinions on a change of names too ;) Cheers, Nicolas On 2023-11-02 22:51, Nicolas Graves wrote: > Sorry I did send the patch series twice because I forgot the v5 in the > first. > > You can find the packages attached if useful for testing, but I will > commit only after we agree on the proper renaming of the import and > build-system, so that I can do it in a sole patch series. > > > > -------------------- Start of forwarded message -------------------- > Subject: [bug#42338] [PATCH v5 0/9] Composer build-system > To: 42338 <at> debbugs.gnu.org > Cc: ngraves@HIDDEN > Date: Thu, 2 Nov 2023 16:16:47 +0100 > From: Nicolas Graves via Guix-patches via <guix-patches@HIDDEN> > > This is the result of my further rework of the composer import and > build-system. The `guix: import: composer` commits can be squashed > easily. > > This is now tested on 94 php packages with all testing enabled except > for 3 packages. I will submit these packages as a whole in the > alphabetical order (the bootstrap order is not worth it IMO) in a new > guix issue. > > Before accepting it, I also would like to propose a change of > names. If me make an analogy with python: > tool: pip <-> composer > package hub: pypi <-> packagist > build-system: python/pyproject <-> php > > Since we only take about 90 lines of real composer code, I would > rather call the build-system php-build-system. > Same thing: instead of `guix import composer` we should rather call > `guix import packagist`. > > If that's OK, I'll change it with the next (and hopefully last!) > version of this build system. > > Nicolas Graves (9): > guix: import: Add composer importer. > gnu: Add composer-classloader. > guix: Add composer-build-system. > guix: import: composer: Use memoization. > guix: import: composer: Fix json->require. > guix: import: composer: More robust string->license. > guix: import: composer: Modern inputs formatting. > guix: import: composer: Full rewrite composer-fetch. > gnu: composer-build-system: Full check phase rewrite. > > Makefile.am | 6 + > doc/guix.texi | 34 +++ > gnu/local.mk | 1 + > gnu/packages/aux-files/findclass.php | 125 +++++++++++ > gnu/packages/php-xyz.scm | 60 ++++++ > guix/build-system/composer.scm | 164 +++++++++++++++ > guix/build/composer-build-system.scm | 300 +++++++++++++++++++++++++++ > guix/import/composer.scm | 267 ++++++++++++++++++++++++ > guix/scripts/import.scm | 2 +- > guix/scripts/import/composer.scm | 107 ++++++++++ > tests/composer.scm | 88 ++++++++ > 11 files changed, 1153 insertions(+), 1 deletion(-) > create mode 100644 gnu/packages/aux-files/findclass.php > create mode 100644 gnu/packages/php-xyz.scm > create mode 100644 guix/build-system/composer.scm > create mode 100644 guix/build/composer-build-system.scm > create mode 100644 guix/import/composer.scm > create mode 100644 guix/scripts/import/composer.scm > create mode 100644 tests/composer.scm > > -- > 2.41.0 > > > > > -------------------- End of forwarded message -------------------- > > -- > Best regards, > Nicolas Graves -- Best regards, Nicolas Graves
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH] Add composer build system (PHP) References: <20200713002055.1553f136@HIDDEN> In-Reply-To: <20200713002055.1553f136@HIDDEN> Resent-From: Charlie McMackin <charliemac@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 10 Dec 2023 07:25:03 +0000 Resent-Message-ID: <handler.42338.B42338.17021930894078 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.17021930894078 (code B ref 42338); Sun, 10 Dec 2023 07:25:03 +0000 Received: (at 42338) by debbugs.gnu.org; 10 Dec 2023 07:24:49 +0000 Received: from localhost ([127.0.0.1]:49395 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1rCEBE-00013U-Ej for submit <at> debbugs.gnu.org; Sun, 10 Dec 2023 02:24:49 -0500 Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]:55313) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <charliemac@HIDDEN>) id 1rC5Ns-0008JM-39 for 42338 <at> debbugs.gnu.org; Sat, 09 Dec 2023 17:01:16 -0500 Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2c9c18e7990so44047871fa.2 for <42338 <at> debbugs.gnu.org>; Sat, 09 Dec 2023 14:01:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=endparen-com.20230601.gappssmtp.com; s=20230601; t=1702159255; x=1702764055; darn=debbugs.gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=h8iuoUiazhdicdNNX/ARGFmW7pXC7aufBTpPFFoKQxs=; b=Y0OyQ2Hbn+lUVV/hx2wZCW7wrlMCMv0FSPrQLj63Dip0Q0AAOSTtx9Hfu4mM9pn2fF oQSmf+IkOdZLtleckNj99QFcdIxb+V7MKdovdAf2N+qGAx0Z9kW48IcBXb5WhaGPVsgi HHnB4aQfHNe8RukxWQ0KO+Tk02DjVMgbwL4UIG+Z+vv9YU5tSuDRHz2OzewRfi9GZlek SA9VlBomEbmv0eLoq5+0G8ZCOd82ztEU5ML8QmnjbVgpUwfYOxus0XR2prmDOdKjm80U jXXAGzKD0p+4Pc0/GKU9ZDpWIpLfqG1qG6WgewiflSdd1P+BXZfguyqUqobuyb6e0Nxz NL/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702159255; x=1702764055; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=h8iuoUiazhdicdNNX/ARGFmW7pXC7aufBTpPFFoKQxs=; b=d8Z3Be8E/8sTW2qGm9sz2OapntVE/mgBIcoKFU27oeFms2BRE0w4HycPfqPmgKmRF5 xFZy+rj7NR3Y01mMhAMhiGL2EFh1xkWelsqFkgc5uZ/XA+ZmjrtTcIRvZGqblwSy/qqu yHGA36EmM5XBBrpcv4GYSIIIqEuOfDU0cz4KN4EcTYXgT5bM1na75PinBTXukjCnbhN5 kiGvAzgQA93G2Q/6hX6mbHvX09txEFsM7y02oFsN+pVroNcJxGUf9t7VjEUD6hquCqCk LzwfI9CwWiaUGyYPllZBcY3ryPZOeEyySmrYEs8ccYi6C3Xbzkj1LSnrYnm7fRl7EKgd HuVg== X-Gm-Message-State: AOJu0Yz22ospjhhgmtKED8b9lsWOQ/liXAzaHTobw+bXlu0jyj4US5Fp fDs/Vi/4vvy2ybdQWo1fs9Ohs+o4GfF0pfGnWWN2pMLXF/xbiF7m99E= X-Google-Smtp-Source: AGHT+IGSlR8Ln05dktKqO4ZTzUPVr781CvsHM0JqgIGjO4wWK9KdDHRYDVETkkJKUJ60ESvRRsYlfx+JuizhlgQMdYc= X-Received: by 2002:a2e:9ec4:0:b0:2ca:1615:bc40 with SMTP id h4-20020a2e9ec4000000b002ca1615bc40mr652197ljk.22.1702159255275; Sat, 09 Dec 2023 14:00:55 -0800 (PST) MIME-Version: 1.0 From: Charlie McMackin <charliemac@HIDDEN> Date: Sat, 9 Dec 2023 16:00:44 -0600 Message-ID: <CAO6UgkSO6wuQaXeyN9FsBtRqmxq661gV5CZSBt=vXizYJJuAWQ@HIDDEN> Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.0 (/) X-Mailman-Approved-At: Sun, 10 Dec 2023 02:24:43 -0500 X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hello, I'm another user interested in this patch series. Thanks for carrying it forward. I thought I would try it out myself and give feedback if I discovered anything but I'm running into issues with the v5 patch series: 1. When I run `git am -3` on the archive mbox for this patch series, I have to skip patch 0 (empty) and then it fails on patch 0004 with; Applying: guix: Add composer-build-system. error: sha1 information is lacking or useless (Makefile.am). error: could not build fake ancestor Patch failed at 0004 guix: Add composer-build-system. I'm trying to apply to a branch with HEAD at 61f2d84e75. 2. I am a bit new to applying patches from mail but I thought I could resolve the problem if I knew where the branch began and applied there. However, I am not able to find where this patch series branches from. Should that information (the ancestor SHA1) be in the PATCH 0? Is there something I'm missing with `git am` style patches? 3. Without any authority, making it `guix import packagist` sounds reasonable to me given the existing patterns with other importers like pypi and crate. 4. Do you plan to add a news.scm entry in the next patch series as suggested by Ludovic? I look forward to testing this out! Thanks, Charlie
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH v5 0/9] Composer build-system Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Mon, 18 Dec 2023 22:35:01 +0000 Resent-Message-ID: <handler.42338.B42338.17029388432620 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Nicolas Graves <ngraves@HIDDEN> Cc: Julien Lepiller <julien@HIDDEN>, 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.17029388432620 (code B ref 42338); Mon, 18 Dec 2023 22:35:01 +0000 Received: (at 42338) by debbugs.gnu.org; 18 Dec 2023 22:34:03 +0000 Received: from localhost ([127.0.0.1]:33761 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1rFMBW-0000gA-GB for submit <at> debbugs.gnu.org; Mon, 18 Dec 2023 17:34:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46112) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1rFMBU-0000fb-T8 for 42338 <at> debbugs.gnu.org; Mon, 18 Dec 2023 17:34:01 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1rFMBK-0001yM-OS; Mon, 18 Dec 2023 17:33:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=nZgnvjRRTvgkiLZ1yI3L5LC6oNESn3EwdcYX5ZA49aY=; b=bgaGVCzHFJciPFm0WdJb ogJcBcTim2mWbULJTO4eDGrb4BrZSYW6D3QHSFT1UwzNrY5H9gZY530FkaYjeaVmSTFwMPgUOJ32t EBTpubIMMSOiaeYmpFBobgWLmhmdbc/5VQ9juQLLs2Vhikmz1X0TJCm2sFB4nWUbjSwjRk+vERomW Zapjb1ibgJEf0dSdZmHkiQPaJ44FWu2T3SMGXxrSS5qvoP1pkbi1cfbbo3sNJXjMkMm45K/J9bY/I thl9ryLtO3EOXrq8Uso5ovc7o04AQJqg9XXMiQIGLtTe8pAufveQPlH16d1LNHDmy4JfZRQfJ7tD2 Ap0CFVP7f+OMCQ==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN> In-Reply-To: <20231102151725.31362-1-ngraves@HIDDEN> (Nicolas Graves's message of "Thu, 2 Nov 2023 16:16:47 +0100") References: <20200713002055.1553f136@HIDDEN> <20231102151725.31362-1-ngraves@HIDDEN> Date: Mon, 18 Dec 2023 23:33:27 +0100 Message-ID: <87sf3zi1jc.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) 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 <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Hi, Nicolas Graves <ngraves@HIDDEN> skribis: > This is the result of my further rework of the composer import and > build-system. The `guix: import: composer` commits can be squashed > easily. > > This is now tested on 94 php packages with all testing enabled except > for 3 packages. I will submit these packages as a whole in the > alphabetical order (the bootstrap order is not worth it IMO) in a new > guix issue. > > Before accepting it, I also would like to propose a change of > names. If me make an analogy with python: > tool: pip <-> composer > package hub: pypi <-> packagist > build-system: python/pyproject <-> php > > Since we only take about 90 lines of real composer code, I would > rather call the build-system php-build-system.=20 > Same thing: instead of `guix import composer` we should rather call > `guix import packagist`. > > If that's OK, I'll change it with the next (and hopefully last!) > version of this build system. > > Nicolas Graves (9): > guix: import: Add composer importer. > gnu: Add composer-classloader. > guix: Add composer-build-system. > guix: import: composer: Use memoization. > guix: import: composer: Fix json->require. > guix: import: composer: More robust string->license. > guix: import: composer: Modern inputs formatting. > guix: import: composer: Full rewrite composer-fetch. > gnu: composer-build-system: Full check phase rewrite. In the interest of moving forward, I pushed this: 6454788a5c build-system/composer: Do not import host-side Guile-JSON modu= les. 9dab758791 build-system: Add =E2=80=98composer-build-system=E2=80=99. e8fd78d54e gnu: Add composer-classloader. b7e3945283 guix: import: Add composer importer. I squashed the importer commits. However, I also add to make way too many fixes to my taste: adding missing #:use-module, fixing unbound variables (guessing=E2=80=A6), fixing typos, untangling and build system commit that was fixing things in the importer, fixing =E2=80=98tests/composer.scm=E2=80=99 which wouldn=E2=80=99= t pass, fixing a case where the importer would return a single value instead of two (breaking recursive imports), and probably others that I forgot. Not great. Could you please take a closer look and see whether anything is amiss at this point? Next, which PHP packages do we add? Julien initially submitted 30ish of them, should we take those? Or are you planning to submit a separate set? It would also be nice if the updater would fill in the =E2=80=98inputs=E2= =80=99 fields of <upstream-source>: that would allow =E2=80=98guix refresh -u=E2=80=99 to automatically update inputs. Thanks in advance! Ludo=E2=80=99.
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH v5 0/9] Composer build-system Resent-From: Nicolas Graves <ngraves@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Tue, 19 Dec 2023 07:45:02 +0000 Resent-Message-ID: <handler.42338.B42338.17029718425149 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN> Cc: Julien Lepiller <julien@HIDDEN>, 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.17029718425149 (code B ref 42338); Tue, 19 Dec 2023 07:45:02 +0000 Received: (at 42338) by debbugs.gnu.org; 19 Dec 2023 07:44:02 +0000 Received: from localhost ([127.0.0.1]:34335 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1rFUlm-0001Kq-44 for submit <at> debbugs.gnu.org; Tue, 19 Dec 2023 02:44:02 -0500 Received: from 13.mo583.mail-out.ovh.net ([87.98.182.191]:43019) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1rFUlj-0001KB-Ad for 42338 <at> debbugs.gnu.org; Tue, 19 Dec 2023 02:44:00 -0500 Received: from director2.ghost.mail-out.ovh.net (unknown [10.108.25.63]) by mo583.mail-out.ovh.net (Postfix) with ESMTP id 244D12AB8E for <42338 <at> debbugs.gnu.org>; Tue, 19 Dec 2023 07:43:54 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-wq7pb (unknown [10.110.178.91]) by director2.ghost.mail-out.ovh.net (Postfix) with ESMTPS id D28D81FDFC; Tue, 19 Dec 2023 07:43:52 +0000 (UTC) Received: from ngraves.fr ([37.59.142.97]) by ghost-submission-6684bf9d7b-wq7pb with ESMTPSA id vBrfMLhJgWVSjBQADzcBsA (envelope-from <ngraves@HIDDEN>); Tue, 19 Dec 2023 07:43:52 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-97G002ba3c86b2-7385-4856-8826-bdae334f915d, 0A183DEDD9F7D7733B4F13041BD52F66DC821FED) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 81.67.140.142 From: Nicolas Graves <ngraves@HIDDEN> In-Reply-To: <87sf3zi1jc.fsf@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <20231102151725.31362-1-ngraves@HIDDEN> <87sf3zi1jc.fsf@HIDDEN> Date: Tue, 19 Dec 2023 08:43:50 +0100 Message-ID: <87plz24oy1.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Ovh-Tracer-Id: 5312558712057291458 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvddtledguddtjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufgjfhffkfggtgfgsehtqhertddttdejnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepffduleekjeevteelueffjeefffethffhffeutdettefhleeuleevffejvdfftdffnecukfhppeduvdejrddtrddtrddupdekuddrieejrddugedtrddugedvpdefjedrheelrddugedvrdeljeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepgedvfeefkeesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheekfedpmhhouggvpehsmhhtphhouhht X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) On 2023-12-18 23:33, Ludovic Court=C3=A8s wrote: > Hi, > > Nicolas Graves <ngraves@HIDDEN> skribis: > >> This is the result of my further rework of the composer import and >> build-system. The `guix: import: composer` commits can be squashed >> easily. >> >> This is now tested on 94 php packages with all testing enabled except >> for 3 packages. I will submit these packages as a whole in the >> alphabetical order (the bootstrap order is not worth it IMO) in a new >> guix issue. >> >> Before accepting it, I also would like to propose a change of >> names. If me make an analogy with python: >> tool: pip <-> composer >> package hub: pypi <-> packagist >> build-system: python/pyproject <-> php >> >> Since we only take about 90 lines of real composer code, I would >> rather call the build-system php-build-system.=20 >> Same thing: instead of `guix import composer` we should rather call >> `guix import packagist`. Do you have an opinion on this? I guess now that's in the code, we can keep it as is, but that's sad we didn't get to discuss on this.=20 >> >> If that's OK, I'll change it with the next (and hopefully last!) >> version of this build system. >> >> Nicolas Graves (9): >> guix: import: Add composer importer. >> gnu: Add composer-classloader. >> guix: Add composer-build-system. >> guix: import: composer: Use memoization. >> guix: import: composer: Fix json->require. >> guix: import: composer: More robust string->license. >> guix: import: composer: Modern inputs formatting. >> guix: import: composer: Full rewrite composer-fetch. >> gnu: composer-build-system: Full check phase rewrite. > > In the interest of moving forward, I pushed this: > > 6454788a5c build-system/composer: Do not import host-side Guile-JSON mo= dules. > 9dab758791 build-system: Add =E2=80=98composer-build-system=E2=80=99. > e8fd78d54e gnu: Add composer-classloader. > b7e3945283 guix: import: Add composer importer. > > I squashed the importer commits. > > However, I also add to make way too many fixes to my taste: adding > missing #:use-module, fixing unbound variables (guessing=E2=80=A6), fixing > typos, untangling and build system commit that was fixing things in the > importer, fixing =E2=80=98tests/composer.scm=E2=80=99 which wouldn=E2=80= =99t pass, fixing a case > where the importer would return a single value instead of two (breaking > recursive imports), and probably others that I forgot. Not great. > > Could you please take a closer look and see whether anything is amiss at > this point? Not great indeed, seemed to work fine on my end, will take a look. I hope I didn't send a different patch series than intended.=20 > > Next, which PHP packages do we add? Julien initially submitted 30ish of > them, should we take those? Or are you planning to submit a separate > set? I have a set of 94-97 packages, I've sent them in an email to you and Julien (an email from ngraves@HIDDEN on november 2nd), these should work with this set of commits. Will cut that in commits and submit them quickly.=20 > > It would also be nice if the updater would fill in the =E2=80=98inputs=E2= =80=99 fields > of <upstream-source>: that would allow =E2=80=98guix refresh -u=E2=80=99 = to > automatically update inputs. I will first focus on fixes and packages. > > Thanks in advance! > > Ludo=E2=80=99. --=20 Best regards, Nicolas Graves
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH] Add composer build system (PHP) References: <20200713002055.1553f136@HIDDEN> In-Reply-To: <20200713002055.1553f136@HIDDEN> Resent-From: Wilko Meyer <w@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Wed, 20 Dec 2023 10:57:02 +0000 Resent-Message-ID: <handler.42338.B42338.17030697726078 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.17030697726078 (code B ref 42338); Wed, 20 Dec 2023 10:57:02 +0000 Received: (at 42338) by debbugs.gnu.org; 20 Dec 2023 10:56:12 +0000 Received: from localhost ([127.0.0.1]:38712 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1rFuFH-0001Zu-UZ for submit <at> debbugs.gnu.org; Wed, 20 Dec 2023 05:56:12 -0500 Received: from mail.wmeyer.eu ([95.216.196.112]:52578) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <w@HIDDEN>) id 1rFuFE-0001ZU-BW for 42338 <at> debbugs.gnu.org; Wed, 20 Dec 2023 05:56:10 -0500 From: Wilko Meyer <w@HIDDEN> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wmeyer.eu; s=mail; t=1703069758; bh=wPtvNW5kYxGtB++2e6Qm6MOCUoLVOZnsbE5tLL/vuNM=; h=From:To:Subject:Date; b=DRqmB6zXxeEVwVhd8tliqdQRc/4oC7zFlWBDkRv8p6TKou71sTklBYY4tkwSmlmWG cQV2Oq5eXxPmxjZhplLIDY+a1ijDQ2/ym5zEluYsG2QXwCinufzTt9Hmp4TnqGKPLC eCWDGyEk6fhWCyJBIW4UqXFx/PrQ7qn8x7gfUSSU= Date: Wed, 20 Dec 2023 11:41:55 +0100 Message-ID: <87il4t9m8u.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hi, Just wanted to say thanks for all this work, was really surprised to see a composer-build-system in Guix and a handy packagist importer! As far as I'm aware, there's not a structure in gnu/packages yet for composer packages. Hope this is the right place to ask, I'm considering packaging my more used dependencies for Guix, do they go into php.scm/php-xyz.scm? a yet-to-be-created packagist.scm? Should there be a more thematic grouping (e.g. how python*.scm is currently structured)? Thanks for this great work! -- Kind regards, Wilko Meyer w@HIDDEN
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH] Add composer build system (PHP) Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Wed, 20 Dec 2023 11:33:01 +0000 Resent-Message-ID: <handler.42338.B.17030719527963 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org, w@HIDDEN X-Debbugs-Original-To: guix-patches@HIDDEN, Wilko Meyer <w@HIDDEN>, 42338 <at> debbugs.gnu.org Received: via spool by submit <at> debbugs.gnu.org id=B.17030719527963 (code B ref -1); Wed, 20 Dec 2023 11:33:01 +0000 Received: (at submit) by debbugs.gnu.org; 20 Dec 2023 11:32:32 +0000 Received: from localhost ([127.0.0.1]:38782 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1rFuoO-00024I-AP for submit <at> debbugs.gnu.org; Wed, 20 Dec 2023 06:32:31 -0500 Received: from lists.gnu.org ([2001:470:142::17]:57784) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1rFuoM-000242-St for submit <at> debbugs.gnu.org; Wed, 20 Dec 2023 06:32:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <julien@HIDDEN>) id 1rFuoD-00066K-UY for guix-patches@HIDDEN; Wed, 20 Dec 2023 06:32:18 -0500 Received: from lepiller.eu ([89.234.186.109] helo=hermes.lepiller.eu) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <julien@HIDDEN>) id 1rFuoC-0007Yt-5f for guix-patches@HIDDEN; Wed, 20 Dec 2023 06:32:17 -0500 Received: from hermes.lepiller.eu (localhost [127.0.0.1]) by hermes.lepiller.eu (OpenSMTPD) with ESMTP id 0d98bae2; Wed, 20 Dec 2023 11:32:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:subject:in-reply-to:references:message-id:mime-version :content-type:content-transfer-encoding; s=dkim; bh=96DgHu/HhnoC uRaksi5h6svMHxztplRLNRD5yqSLVT0=; b=H1cbJfcqsfVNn/sG8wXNy3LfSx0b YQ2z3EUiflJZtCIph1OGjLP72qDUw6XzcJj5/tEgCuPSdME5aqLwZvj5N2jXm4+h dMEA4IvxaC0PeVCVy182V0L3dD1VRgV6he3zqWdQy4RnIPoXru6Zr6ie7ux0qPNV El/az98OJilBWZTOfzgTslFDTLKRWMI1PZlBPVxO+GhbufHZoWDvCYXPK82n38/D aDDu/S6lOupm6rZ/5j/OIfRmaPnnjfhkSIoQZ2ALq6godJsgdFk6GgxDRYoFG6kU FA5PC62EtYvHjCbEk1b6SeMne0/NpZupcE76E0rmHjt72HP31wBLRD58ig== Received: by hermes.lepiller.eu (OpenSMTPD) with ESMTPSA id af2a9866 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 20 Dec 2023 11:32:07 +0000 (UTC) Date: Wed, 20 Dec 2023 12:31:58 +0100 From: Julien Lepiller <julien@HIDDEN> User-Agent: K-9 Mail for Android In-Reply-To: <87il4t9m8u.fsf@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <87il4t9m8u.fsf@HIDDEN> Message-ID: <6DF3CCBA-7B74-4B1F-B2DD-98800C3D3C80@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=89.234.186.109; envelope-from=julien@HIDDEN; helo=hermes.lepiller.eu X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.0 (/) Hi, I would put them in php-xyz=2Escm=2E php=2Escm would be for the compiler a= nd language tools=2E If we start having a lot of php packages, we could sta= rt creating more modules=2E I don't think packagist=2Escm would work, similar to how we have python=2E= scm, not pypi=2Escm :) Le 20 d=C3=A9cembre 2023 11:41:55 GMT+01:00, Wilko Meyer <w@wmeyer=2Eeu> a= =C3=A9crit=C2=A0: >Hi, > >Just wanted to say thanks for all this work, was really surprised to see >a composer-build-system in Guix and a handy packagist importer! > >As far as I'm aware, there's not a structure in gnu/packages yet for >composer packages=2E Hope this is the right place to ask, I'm considering >packaging my more used dependencies for Guix, do they go into >php=2Escm/php-xyz=2Escm? a yet-to-be-created packagist=2Escm? Should ther= e be >a more thematic grouping (e=2Eg=2E how python*=2Escm is currently structu= red)? > >Thanks for this great work! >
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH] Add composer build system (PHP) Resent-From: Julien Lepiller <julien@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Wed, 20 Dec 2023 11:33:02 +0000 Resent-Message-ID: <handler.42338.B42338.17030719417935 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338 <at> debbugs.gnu.org, w@HIDDEN X-Debbugs-Original-To: guix-patches@HIDDEN, Wilko Meyer <w@HIDDEN>, 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.17030719417935 (code B ref 42338); Wed, 20 Dec 2023 11:33:02 +0000 Received: (at 42338) by debbugs.gnu.org; 20 Dec 2023 11:32:21 +0000 Received: from localhost ([127.0.0.1]:38779 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1rFuoG-00023u-Vv for submit <at> debbugs.gnu.org; Wed, 20 Dec 2023 06:32:21 -0500 Received: from lepiller.eu ([89.234.186.109]:57620 helo=hermes.lepiller.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1rFuoB-00023i-Dl for 42338 <at> debbugs.gnu.org; Wed, 20 Dec 2023 06:32:19 -0500 Received: from hermes.lepiller.eu (localhost [127.0.0.1]) by hermes.lepiller.eu (OpenSMTPD) with ESMTP id 0d98bae2; Wed, 20 Dec 2023 11:32:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:subject:in-reply-to:references:message-id:mime-version :content-type:content-transfer-encoding; s=dkim; bh=96DgHu/HhnoC uRaksi5h6svMHxztplRLNRD5yqSLVT0=; b=H1cbJfcqsfVNn/sG8wXNy3LfSx0b YQ2z3EUiflJZtCIph1OGjLP72qDUw6XzcJj5/tEgCuPSdME5aqLwZvj5N2jXm4+h dMEA4IvxaC0PeVCVy182V0L3dD1VRgV6he3zqWdQy4RnIPoXru6Zr6ie7ux0qPNV El/az98OJilBWZTOfzgTslFDTLKRWMI1PZlBPVxO+GhbufHZoWDvCYXPK82n38/D aDDu/S6lOupm6rZ/5j/OIfRmaPnnjfhkSIoQZ2ALq6godJsgdFk6GgxDRYoFG6kU FA5PC62EtYvHjCbEk1b6SeMne0/NpZupcE76E0rmHjt72HP31wBLRD58ig== Received: by hermes.lepiller.eu (OpenSMTPD) with ESMTPSA id af2a9866 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 20 Dec 2023 11:32:07 +0000 (UTC) Date: Wed, 20 Dec 2023 12:31:58 +0100 From: Julien Lepiller <julien@HIDDEN> User-Agent: K-9 Mail for Android In-Reply-To: <87il4t9m8u.fsf@HIDDEN> References: <20200713002055.1553f136@HIDDEN> <87il4t9m8u.fsf@HIDDEN> Message-ID: <6DF3CCBA-7B74-4B1F-B2DD-98800C3D3C80@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hi, I would put them in php-xyz=2Escm=2E php=2Escm would be for the compiler a= nd language tools=2E If we start having a lot of php packages, we could sta= rt creating more modules=2E I don't think packagist=2Escm would work, similar to how we have python=2E= scm, not pypi=2Escm :) Le 20 d=C3=A9cembre 2023 11:41:55 GMT+01:00, Wilko Meyer <w@wmeyer=2Eeu> a= =C3=A9crit=C2=A0: >Hi, > >Just wanted to say thanks for all this work, was really surprised to see >a composer-build-system in Guix and a handy packagist importer! > >As far as I'm aware, there's not a structure in gnu/packages yet for >composer packages=2E Hope this is the right place to ask, I'm considering >packaging my more used dependencies for Guix, do they go into >php=2Escm/php-xyz=2Escm? a yet-to-be-created packagist=2Escm? Should ther= e be >a more thematic grouping (e=2Eg=2E how python*=2Escm is currently structu= red)? > >Thanks for this great work! >
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH] Add composer build system (PHP) Resent-From: Wilko Meyer <w@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Wed, 20 Dec 2023 11:48:02 +0000 Resent-Message-ID: <handler.42338.B.170307284719327 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Julien Lepiller <julien@HIDDEN> Cc: w@HIDDEN, 42338 <at> debbugs.gnu.org X-Debbugs-Original-Cc: Wilko Meyer <w@HIDDEN>, guix-patches@HIDDEN, 42338 <at> debbugs.gnu.org Received: via spool by submit <at> debbugs.gnu.org id=B.170307284719327 (code B ref -1); Wed, 20 Dec 2023 11:48:02 +0000 Received: (at submit) by debbugs.gnu.org; 20 Dec 2023 11:47:27 +0000 Received: from localhost ([127.0.0.1]:38799 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1rFv2t-00051d-EF for submit <at> debbugs.gnu.org; Wed, 20 Dec 2023 06:47:27 -0500 Received: from lists.gnu.org ([2001:470:142::17]:57646) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <w@HIDDEN>) id 1rFv2r-00051M-LD for submit <at> debbugs.gnu.org; Wed, 20 Dec 2023 06:47:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <w@HIDDEN>) id 1rFv2f-000081-P8 for guix-patches@HIDDEN; Wed, 20 Dec 2023 06:47:13 -0500 Received: from mail.wmeyer.eu ([95.216.196.112]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <w@HIDDEN>) id 1rFv2c-0004bZ-Nk for guix-patches@HIDDEN; Wed, 20 Dec 2023 06:47:13 -0500 References: <20200713002055.1553f136@HIDDEN> <87il4t9m8u.fsf@HIDDEN> <6DF3CCBA-7B74-4B1F-B2DD-98800C3D3C80@HIDDEN> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wmeyer.eu; s=mail; t=1703072822; bh=KNp+6g7aavWpdQ/BT1TwgyhzC58dDsNTSN5Ip8G9rAI=; h=References:From:To:Cc:Subject:Date:In-reply-to; b=QnGaOXZjMJ8UDWLtbsZdY2xNeY+wKMaIyVs3hLxtAjgVOveTLJNc+WZlH9xQyjHXg VtEry/US2v33YpQNlyGgacuz5xsyCPIbXtr5yKHGvQFQ24lvygTodaLQUK68F88BPc aZa1CGqUi1d8acXYAPUgOsd0rNqczKDMUQzU+aEw= From: Wilko Meyer <w@HIDDEN> Date: Wed, 20 Dec 2023 12:40:43 +0100 In-reply-to: <6DF3CCBA-7B74-4B1F-B2DD-98800C3D3C80@HIDDEN> Message-ID: <87edfh9juy.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=95.216.196.112; envelope-from=w@HIDDEN; helo=mail.wmeyer.eu X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.1 (/) Hi Julien, Julien Lepiller <julien@HIDDEN> writes: > I would put them in php-xyz.scm. php.scm would be for the compiler and language tools. If we start having a lot of php packages, we could start creating more modules. Sounds good! > I don't think packagist.scm would work, similar to how we have > python.scm, not pypi.scm :) We do have crates-io.scm and rust{,-apps}.scm for rust, which is why I was asking (though I don't know the background of why crates-io.scm was chosen for rust crates). But that may be more of an outlier then in the structure of gnu/packages. -- Kind regards, Wilko Meyer w@HIDDEN
X-Loop: help-debbugs@HIDDEN Subject: [bug#42338] [PATCH] Add composer build system (PHP) Resent-From: Wilko Meyer <w@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Wed, 20 Dec 2023 11:48:02 +0000 Resent-Message-ID: <handler.42338.B42338.170307283419298 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Julien Lepiller <julien@HIDDEN> Cc: w@HIDDEN, 42338 <at> debbugs.gnu.org X-Debbugs-Original-Cc: Wilko Meyer <w@HIDDEN>, guix-patches@HIDDEN, 42338 <at> debbugs.gnu.org Received: via spool by 42338-submit <at> debbugs.gnu.org id=B42338.170307283419298 (code B ref 42338); Wed, 20 Dec 2023 11:48:02 +0000 Received: (at 42338) by debbugs.gnu.org; 20 Dec 2023 11:47:14 +0000 Received: from localhost ([127.0.0.1]:38796 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1rFv2g-00051B-1t for submit <at> debbugs.gnu.org; Wed, 20 Dec 2023 06:47:14 -0500 Received: from mail.wmeyer.eu ([95.216.196.112]:37356) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <w@HIDDEN>) id 1rFv2d-00050z-Tj for 42338 <at> debbugs.gnu.org; Wed, 20 Dec 2023 06:47:12 -0500 References: <20200713002055.1553f136@HIDDEN> <87il4t9m8u.fsf@HIDDEN> <6DF3CCBA-7B74-4B1F-B2DD-98800C3D3C80@HIDDEN> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wmeyer.eu; s=mail; t=1703072822; bh=KNp+6g7aavWpdQ/BT1TwgyhzC58dDsNTSN5Ip8G9rAI=; h=References:From:To:Cc:Subject:Date:In-reply-to; b=QnGaOXZjMJ8UDWLtbsZdY2xNeY+wKMaIyVs3hLxtAjgVOveTLJNc+WZlH9xQyjHXg VtEry/US2v33YpQNlyGgacuz5xsyCPIbXtr5yKHGvQFQ24lvygTodaLQUK68F88BPc aZa1CGqUi1d8acXYAPUgOsd0rNqczKDMUQzU+aEw= From: Wilko Meyer <w@HIDDEN> Date: Wed, 20 Dec 2023 12:40:43 +0100 In-reply-to: <6DF3CCBA-7B74-4B1F-B2DD-98800C3D3C80@HIDDEN> Message-ID: <87edfh9juy.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hi Julien, Julien Lepiller <julien@HIDDEN> writes: > I would put them in php-xyz.scm. php.scm would be for the compiler and language tools. If we start having a lot of php packages, we could start creating more modules. Sounds good! > I don't think packagist.scm would work, similar to how we have > python.scm, not pypi.scm :) We do have crates-io.scm and rust{,-apps}.scm for rust, which is why I was asking (though I don't know the background of why crates-io.scm was chosen for rust crates). But that may be more of an outlier then in the structure of gnu/packages. -- Kind regards, Wilko Meyer w@HIDDEN
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.