Re: [Buildroot] [PATCH 2/2] package/sass: new package

Thomas Petazzoni via buildroot <[email protected]>
Newsgroups net.busybox.buildroot
Message-ID <anWV0uzil1jp4BNN@windsurf>
Hello Alexis,

On Thu, Aug 06, 2026 at 11:24:23PM +0200, Alexis Lothoré wrote:
> sass is a css extension adding programming features to css.
> 
> https://github.com/sass/dart-sass
> 
> The source configured for the package is not a github repository, as the
> official sources for sass are in fact in Dart: those sources are
> automatically built into a javascript module by the corresponding github
> workflow ([1]). Rather than trying to replicate the whole dart build,
> this new package just downloads the sources for sass from npmjs
> directly.
> 
> [1]
> https://github.com/sass/dart-sass/blob/main/.github/workflows/release.yml
> 
> Signed-off-by: Alexis Lothoré <[email protected]>

I am not super clear on what sass exactly does/is. But some time ago,
we dropped all JS libraries from Buildroot:

  https://lore.kernel.org/buildroot/[email protected]/

But sass doesn't seem to be one of those static JS libraries I guess
because it installs some executable host tool?

> diff --git a/package/sass/sass.mk b/package/sass/sass.mk
> new file mode 100644
> index 000000000000..c79109be44a2
> --- /dev/null
> +++ b/package/sass/sass.mk
> @@ -0,0 +1,30 @@
> +################################################################################
> +#
> +# sass
> +#
> +################################################################################
> +
> +SASS_VERSION = 1.102.0
> +SASS_SOURCE = sass-$(SASS_VERSION).tgz
> +SASS_SITE = https://registry.npmjs.org/sass/-
> +SASS_LICENSE = MIT
> +SASS_LICENSE_FILES = LICENSE
> +HOST_SASS_DEPENDENCIES = host-nodejs
> +
> +define HOST_SASS_BUILD_CMDS
> +	$(HOST_DIR)/bin/npm install \
> +		--prefix $(@D) \
> +		--production \
> +		--no-audit \
> +		--no-fund

What is this "npm install" doing? Isn't it downloading random stuff
from the Internet?

> +endef
> +
> +define HOST_SASS_INSTALL_CMDS
> +	$(INSTALL) -m 0755 -d $(HOST_DIR)/lib/node_modules/sass
> +	$(INSTALL) -m 0755 $(@D)/sass.js $(HOST_DIR)/lib/node_modules/sass/
> +	$(INSTALL) -m 0755 $(@D)/sass.dart.js $(HOST_DIR)/lib/node_modules/sass/
> +	rsync -a $(@D)/node_modules $(HOST_DIR)/lib/node_modules/sass/

"cp -dpfr" instead of "rsync -a".

> +	ln -sf ../lib/node_modules/sass/sass.js $(HOST_DIR)/bin/sass
> +endef
> +
> +$(eval $(host-generic-package))
> diff --git a/support/testing/tests/package/test_sass.py b/support/testing/tests/package/test_sass.py
> new file mode 100644
> index 000000000000..2739eff7f680
> --- /dev/null
> +++ b/support/testing/tests/package/test_sass.py

Please add this file to the DEVELOPERS file.

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.