all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Liliana Marie Prikler <liliana.prikler@gmail.com>
To: Philip McGrath <philip@philipmcgrath.com>, 67019@debbugs.gnu.org
Subject: [bug#67019] [PATCH 03/16] gnu: Add lessc.
Date: Sat, 11 Nov 2023 01:56:06 +0100	[thread overview]
Message-ID: <a4bff90da2e236a8d11d9e414400390eeb416077.camel@gmail.com> (raw)
In-Reply-To: <ab477ad53c7277a9363eb5090493dd2bc81174c8.1699540553.git.philip@philipmcgrath.com>

Am Donnerstag, dem 09.11.2023 um 11:26 -0500 schrieb Philip McGrath:
> * gnu/packages/web.scm (lessc): New variable.
> ---
>  gnu/packages/web.scm | 187
> +++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 187 insertions(+)
> 
> diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
> index 66d09700db..8e22997957 100644
> --- a/gnu/packages/web.scm
> +++ b/gnu/packages/web.scm
> @@ -64,6 +64,7 @@
>  ;;; Copyright © 2023 David Thompson <dthompson2@worcester.edu>
>  ;;; Copyright © 2023 Christopher Howard
> <christopher@librehacker.com>
>  ;;; Copyright © 2023 Felix Lechner <felix.lechner@lease-up.com>
> +;;; Copyright © 2023 Philip McGrath <philip@philipmcgrath.com>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -98,6 +99,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)
> @@ -168,6 +170,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)
> @@ -2343,6 +2346,190 @@ (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)
> +                            `("scripts" @ ,@(filter (match-lambda
> +                                                      (("target"
> "ES5")
> +                                                       #f)
> +                                                      (_
> +                                                       #t))
> +                                                    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)))))))
Can we somehow save a bit of horizontal real-estate here?  Same goes
for 1 and 2.
> +          (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)))
> +
IMHO it doesn't make sense to type @acronym without the expansion.

Cheers

  reply	other threads:[~2023-11-11  0:56 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-09 16:06 [bug#67019] [PATCH 00/16] gnu: Add KaTeX, lessc, and flow-remove-types Philip McGrath
2023-11-09 16:12 ` [bug#67019] [PATCH 01/16] gnu: Add node-is-what Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 02/16] gnu: Add node-copy-anything Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 03/16] gnu: Add lessc Philip McGrath
2023-11-11  0:56   ` Liliana Marie Prikler [this message]
2023-11-15 19:35     ` Philip McGrath
2023-11-15 20:23       ` Liliana Marie Prikler
2023-11-16  0:03         ` Philip McGrath
2023-11-16  1:17           ` Liliana Marie Prikler
2023-11-16  1:51             ` Philip McGrath
2023-11-16  7:18               ` Liliana Marie Prikler
2023-11-16 19:15               ` [bug#67019] [PATCH v2 00/16] gnu: Add KaTeX, lessc, and flow-remove-types Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 01/16] gnu: Add node-is-what Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 02/16] gnu: Add node-copy-anything Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 03/16] gnu: Add lessc Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 04/16] gnu: Add ocaml-wtf8 Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 05/16] gnu: Add ocaml-visitors Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 06/16] gnu: Add ocaml-ppx-gen-rec Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 07/16] gnu: Add ocaml-dtoa Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 08/16] gnu: Add node-vlq Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 09/16] gnu: Add ocaml-flow-parser Philip McGrath
2023-11-16 20:29                   ` Liliana Marie Prikler
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 10/16] gnu: Add node-flow-parser Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 11/16] gnu: Add flow-remove-types Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 12/16] gnu: js-commander: Update to 11.1.0 Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 13/16] gnu: js-commander: Install as a node module Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 14/16] gnu: Add mftrace Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 15/16] gnu: Add font-katex Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 16/16] gnu: Add katex Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 04/16] gnu: Add ocaml-wtf8 Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 05/16] gnu: Add ocaml-visitors Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 06/16] gnu: Add ocaml-ppx-gen-rec Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 07/16] gnu: Add ocaml-dtoa Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 08/16] gnu: Add node-vlq Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 09/16] gnu: Add ocaml-flow-parser Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 10/16] gnu: Add node-flow-parser Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 11/16] gnu: Add flow-remove-types Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 12/16] gnu: js-commander: Update to 11.1.0 Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 13/16] gnu: js-commander: Install as a node module Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 14/16] gnu: Add mftrace Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 15/16] gnu: Add font-katex Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 16/16] gnu: Add katex Philip McGrath

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a4bff90da2e236a8d11d9e414400390eeb416077.camel@gmail.com \
    --to=liliana.prikler@gmail.com \
    --cc=67019@debbugs.gnu.org \
    --cc=philip@philipmcgrath.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.