2024-01-13 08:15:51 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, autoreconfHook
|
2023-10-19 13:55:26 +00:00
|
|
|
, testers
|
2024-01-13 08:15:51 +00:00
|
|
|
|
|
|
|
# for passthru.tests
|
|
|
|
, gtk3
|
|
|
|
, gtk4
|
|
|
|
, sassc
|
2023-10-19 13:55:26 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "libsass";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "3.6.5"; # also check sassc for updates
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sass";
|
2023-10-19 13:55:26 +00:00
|
|
|
repo = finalAttrs.pname;
|
|
|
|
rev = finalAttrs.version;
|
2021-06-28 23:13:55 +00:00
|
|
|
sha256 = "1cxj6r85d5f3qxdwzxrmkx8z875hig4cr8zsi30w6vj23cyds3l2";
|
2020-04-24 23:36:52 +00:00
|
|
|
# Remove unicode file names which leads to different checksums on HFS+
|
|
|
|
# vs. other filesystems because of unicode normalisation.
|
2022-06-16 17:23:12 +00:00
|
|
|
postFetch = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
rm -r $out/test/e2e/unicode-pwd
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "CVE-2022-26592.CVE-2022-43357.CVE-2022-43358.patch";
|
|
|
|
url = "https://github.com/sass/libsass/pull/3184/commits/5bb0ea0c4b2ebebe542933f788ffacba459a717a.patch";
|
|
|
|
hash = "sha256-DR6pKFWL70uJt//drzq34LeTzT8rUqgUTpgfUHpD2s4=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
preConfigure = ''
|
2023-10-19 13:55:26 +00:00
|
|
|
export LIBSASS_VERSION=${finalAttrs.version}
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ autoreconfHook ];
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit gtk3 gtk4 sassc;
|
|
|
|
pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
|
|
|
|
};
|
2023-10-19 13:55:26 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A C/C++ implementation of a Sass compiler";
|
|
|
|
homepage = "https://github.com/sass/libsass";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ codyopel offline ];
|
2023-10-19 13:55:26 +00:00
|
|
|
pkgConfigModules = [ "libsass" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
2023-10-19 13:55:26 +00:00
|
|
|
})
|