From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id KN0WDNlqVmWjJgEAG6o9tA:P1 (envelope-from ) for ; Thu, 16 Nov 2023 20:17:45 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id KN0WDNlqVmWjJgEAG6o9tA (envelope-from ) for ; Thu, 16 Nov 2023 20:17:45 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id CB73A14769 for ; Thu, 16 Nov 2023 20:17:44 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=philipmcgrath.com header.s=fm1 header.b=JhYAaRDg; dkim=fail ("body hash did not verify") header.d=messagingengine.com header.s=fm1 header.b=L1McXzZQ; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1700162264; a=rsa-sha256; cv=none; b=auXDu0oHXcrLx/uksg+XxGlocHdajjd5tmaDmGfoL17efJTNABP19whYmZsy6ArQvRE/+6 Sy3RGkCkqFX9cj1BkQivWGloW0nrg8jHEyZesyw3VfCoLAUiz3C4LzJmOnmDYqNYbXKSLH 6I4RBJ0EBB82MjyfF+QlwZrQFZPA4Jlus7Q6IwV2jw4HTE9naWzBD2YyuWg0UDBrA0SQP2 XAR8YJmQkvx+QaJaDp+OkIPfJ3v+NikuLD616nqq0AckOyrgzC+KaHiV/rs+7KUvHwOnQK M7J5emOcbQBGRIGgbB6kZpOwOTFGmXltAre/7nqLPB4cjOwWYLaD5R/UzqLqTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1700162264; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=0nwY3Vgw9Pztyb9izSE1y8idw3Rh3S56IXIeEUllRnc=; b=UsJoKm61p9Aiaz1CW2EWPogVzHtZ7Qb0WXE14QTDwjnaduNoNjA6Ghut9vH1G1djf2jfdg 6z9EiM+cC/M01QbulB1CFMtszoGUh56IIitPYT2/02LtgqCmqG4KPDBr8GJZg4KSl1P7Ly qVnzQndw7Y9iLta6ClPa6EbZrO1N62Mw80SGqYjEdIOkP/7V3zOdTRqI2u1L2GNBEtyvwq 9/EPOAMdcnkb4C9NQVMDojY0A0qEIIbbJ4jUes/mfzVjkUL3YjJxjFcyPtNrL/OsXTAhTd SFWWoXkU5AdaTy7blMi1GAmaq6DPXY/EYodbhcSCDPPOJCdZRqFx+wiwonD/bw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=philipmcgrath.com header.s=fm1 header.b=JhYAaRDg; dkim=fail ("body hash did not verify") header.d=messagingengine.com header.s=fm1 header.b=L1McXzZQ; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r3hrN-0003Yb-JI; Thu, 16 Nov 2023 14:17:05 -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 ) id 1r3hrM-0003Xy-5I for guix-patches@gnu.org; Thu, 16 Nov 2023 14:17:04 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r3hrL-0003Dc-TE for guix-patches@gnu.org; Thu, 16 Nov 2023 14:17:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r3hrL-0003lS-87 for guix-patches@gnu.org; Thu, 16 Nov 2023 14:17:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#67019] [PATCH v2 03/16] gnu: Add lessc. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Nov 2023 19:17:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67019 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 67019@debbugs.gnu.org Cc: Philip McGrath , Liliana Marie Prikler Received: via spool by 67019-submit@debbugs.gnu.org id=B67019.170016220714371 (code B ref 67019); Thu, 16 Nov 2023 19:17:03 +0000 Received: (at 67019) by debbugs.gnu.org; 16 Nov 2023 19:16:47 +0000 Received: from localhost ([127.0.0.1]:44548 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r3hr3-0003jN-RO for submit@debbugs.gnu.org; Thu, 16 Nov 2023 14:16:47 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:49843) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r3hr0-0003i9-D2 for 67019@debbugs.gnu.org; Thu, 16 Nov 2023 14:16:43 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 763D85C01DC; Thu, 16 Nov 2023 14:16:37 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 16 Nov 2023 14:16:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1700162197; x=1700248597; bh=Xv OdDLqITROSIaJCOiKqKZz7yf9S3X44B15JWjrJT20=; b=JhYAaRDghhdFWTa6IV BcL+qt6Gyj2u0t4xZSLPMV0biVHSzXAD5CQeTyZ8OtwYiUdP5RVCZfyRu3mCe8zP kkt/2N/dKau9U5jYxRaKBz0yTFY2EiY+jFcez3da+7i1xcXrnW0UaF5GhW7tWcub zHSjEboVYpSBD2hKWvwRnfee2s8Pbbz7uz6nWeDpEAHcYE5dVpl7GVbI3B2OppVf ObE8yX0q7DccQNHN9fNxsECookk90K1QzuR71VxIzkTff9ZvseR353VplwTz4lGK 4d0r8jckdV2HEQgJD2JZSWkVVocVdXJG9JXSRVOt/MJV9BJfnxM8XEkTpOhi6TIc AGoQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1700162197; x=1700248597; bh=XvOdDLqITROSIaJCOiKqKZz7yf9S3X44B15 JWjrJT20=; b=L1McXzZQiMmDvzfgNP1pfcwZZYSpo8eW4jKOPg2Ti5I2LytWzoN 8hCFtjm0BoDdae+dBDRZ38ErYAj3Unu46j7I0nFBjPWuIcMSnXMW1tHDqICdNLqx QqEZXOMvOi5L8xxj2IecalVs2DfLEjcLBM3b8daiLAEEFfABB6hMVzeS3Pd3Hojb X2Hy4L66ADepG4wL4YeL1Alkxrln7Tz+N2AutIwoUnnIiDvxMW/KeA7kPsVVU23f ezewgRPLgHd/dOP/mpET7ghCkIBNxxSZ1kGhJMHLNnucP2MNLovXEDu8/wLVax2k LnYs5K4mqQtYdSYP75ltguf8urqwW9R1mMg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudefkedguddvtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufffkffojghfgggtgfesthekredtredtjeenucfhrhhomheprfhh ihhlihhpucfotgfirhgrthhhuceophhhihhlihhpsehphhhilhhiphhmtghgrhgrthhhrd gtohhmqeenucggtffrrghtthgvrhhnpefhgfekhfdtgfeitdetuefhvedvteefvdevuddt kefgvdevhfekveejuefgfeekheenucffohhmrghinhepghhithhhuhgsrdgtohhmpdhlvg hsshgtshhsrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghi lhhfrhhomhepphhhihhlihhpsehphhhilhhiphhmtghgrhgrthhhrdgtohhm X-ME-Proxy: Feedback-ID: i2b1146f3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 16 Nov 2023 14:16:36 -0500 (EST) From: Philip McGrath Date: Thu, 16 Nov 2023 14:15:41 -0500 Message-ID: <83a3e16cf7d86bb07f6cf728acf3872dcae604dc.1700161584.git.philip@philipmcgrath.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx11.migadu.com X-Spam-Score: -1.19 X-Migadu-Queue-Id: CB73A14769 X-Migadu-Spam-Score: -1.19 X-TUID: jPWKPosYFekX * gnu/packages/web.scm (lessc): New variable. --- gnu/packages/web.scm | 183 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 183 insertions(+) diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index 389f7d1375..9efc6ebc9d 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -65,6 +65,7 @@ ;;; Copyright © 2023 Christopher Howard ;;; Copyright © 2023 Felix Lechner ;;; Copyright © 2023 Evgeny Pisemsky +;;; Copyright © 2023 Philip McGrath ;;; ;;; This file is part of GNU Guix. ;;; @@ -99,6 +100,7 @@ (define-module (gnu packages web) #:use-module (guix build-system gnu) #:use-module (guix build-system go) #:use-module (guix build-system meson) + #:use-module (guix build-system node) #:use-module (guix build-system perl) #:use-module (guix build-system pyproject) #:use-module (guix build-system python) @@ -169,6 +171,7 @@ (define-module (gnu packages web) #:use-module (gnu packages ncurses) #:use-module (gnu packages networking) #:use-module (gnu packages node) + #:use-module (gnu packages node-xyz) #:use-module (gnu packages nss) #:use-module (gnu packages openldap) #:use-module (gnu packages openstack) @@ -2344,6 +2347,186 @@ (define-public sassc/libsass-3.5 "0830pjcvhzxh6yixj82x5k5r1xnadjqzi16kp53213icbly0r9ma"))))))) (properties '((hidden? . #t))))) +(define-public lessc + (package + (name "lessc") + (version "4.2.0") + (source + (origin (method git-fetch) + (uri (git-reference + (url "https://github.com/less/less.js") + (commit (string-append "v" version)))) + (sha256 + (base32 "1b6anlafk7lnayxy3vhsi474jcdah2ffaw2qyac5s2ibxb1wmr54")) + (snippet + #~(begin + (use-modules (guix build utils)) + (delete-file-recursively "packages/less/dist"))) + (file-name (git-file-name name version)))) + (build-system node-build-system) + (native-inputs (list esbuild)) + (inputs (list node-copy-anything)) + (arguments + (list + #:tests? #f ; many more dependencies + #:modules + `((guix build node-build-system) + (ice-9 match) + (guix build utils)) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'chdir + (lambda args + (chdir "packages/less"))) + (add-after 'patch-dependencies 'delete-dependencies + (lambda args + (delete-dependencies + '(;; dependencies + "parse-node-version" ; patched out + "tslib" ; probably not needed w/ esbuild + ;; devDependencies + "@less/test-data" + "@less/test-import-module" + "@rollup/plugin-commonjs" + "@rollup/plugin-json" + "@rollup/plugin-node-resolve" + "@typescript-eslint/eslint-plugin" + "@typescript-eslint/parser" + "benny" + "bootstrap-less-port" + "chai" + "cross-env" + "diff" + "eslint" + "fs-extra" + "git-rev" + "globby" + "grunt" + "grunt-cli" + "grunt-contrib-clean" + "grunt-contrib-connect" + "grunt-eslint" + "grunt-saucelabs" + "grunt-shell" + "html-template-tag" + "jit-grunt" + "less-plugin-autoprefix" + "less-plugin-clean-css" + "minimist" + "mocha" + "mocha-headless-chrome" + "mocha-teamcity-reporter" + "nock" + "npm-run-all" + "performance-now" + "phin" + "promise" + "read-glob" + "resolve" + "rollup" + "rollup-plugin-terser" + "rollup-plugin-typescript2" + "semver" + "shx" + "time-grunt" + "ts-node" + "typescript" + "uikit" + ;; optionalDependencies + "errno" + "graceful-fs" + "image-size" + "make-dir" + "mime" + "needle" + "source-map")))) + (add-after 'delete-dependencies 'avoid-parse-node-version + (lambda args + (define version + #$(package-version this-package)) + (substitute* "src/less/index.js" + (("import [{] version [}]" orig) + (string-append "// " orig)) + (("import parseVersion from 'parse-node-version';" orig) + (string-append "// " orig)) + (("const v = parseVersion[(]`v\\$[{]version[}]`[)];" orig) + (string-append "// " orig)) + (("(version: )(\\[v\\.major, v\\.minor, v\\.patch],)" _ lhs rhs) + (string-append + lhs + "[" + (string-join + (list-head (string-split + version (char-set-complement char-set:digit)) + 3) + ", ") + "], // " + rhs))))) + (add-after 'avoid-parse-node-version 'do-not-target-es5 + (lambda args + ;; esbuild can't compile all features to ES5 + (with-atomic-json-file-replacement "tsconfig.json" + (match-lambda + (('@ . alist) + (cons '@ + (map (match-lambda + (("compilerOptions" '@ . alist) + `("compilerOptions" @ ,@(delete '("target" . "ES5") + alist))) + (other + other)) + alist))))))) + (add-after 'do-not-target-es5 'patch-build-script + (lambda args + (define new-build-script + (string-join + `("esbuild" + "--platform=node" + "--format=cjs" + "--outdir=lib" + ,@(find-files "src/less" "\\.js$") + ,@(find-files "src/less-node" "\\.js$")))) + (with-atomic-json-file-replacement "package.json" + (match-lambda + (('@ . alist) + (cons '@ + (map (match-lambda + (("scripts" @ . alist) + `("scripts" @ ,@(map (match-lambda + (("build" . _) + (cons "build" + new-build-script)) + (other + other)) + alist))) + (other + other)) + alist))))))) + (add-after 'build 'build-browser + (lambda args + (invoke "esbuild" + "--bundle" + "--platform=browser" + "--format=cjs" + "--outfile=dist/less.js" + "src/less-browser/bootstrap.js") + (invoke "esbuild" + "--bundle" + "--minify" + "--sourcemap" + "--platform=browser" + "--format=cjs" + "--outfile=dist/less.min.js" + "src/less-browser/bootstrap.js")))))) + (home-page "https://lesscss.org") + (synopsis "Compiler for @acronym{Less} @acronym{CSS} language extension") + ;; XXX: @abbr{} seems better for Less (which is always capitalized that + ;; way), but it is rejected as invalid Texinfo markup here. + (description "@acronym{Less, Leaner Style Sheets} is a +backwards-compatible language extension for @acronym{CSS}. This package +provides @command{lessc}, which compiles Less files to plain @acronym{CSS}.") + (license license:asl2.0))) + (define-public perl-apache-logformat-compiler (package -- 2.41.0