Skip to content

Commit 27dcf32

Browse files
committed
Add libsass 3.6.4
This is a direct copy of https://github.com/lazka/libsass/tree/meson which I've created for gtk back in the days. There is an open PR for adding meson support upstream in sass/libsass#3073 but the project is considered deprecated and hasn't seen a commit in over a year, so there is not much hope for progress there. There is a newer 3.6.5 release out, but I wanted to copy things as is from my fork first and look at updating it later.
1 parent b160efa commit 27dcf32

File tree

5 files changed

+163
-0
lines changed

5 files changed

+163
-0
lines changed

releases.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,6 +1437,14 @@
14371437
"1.6.17-2"
14381438
]
14391439
},
1440+
"libsass": {
1441+
"dependency_names": [
1442+
"libsass"
1443+
],
1444+
"versions": [
1445+
"3.6.4-1"
1446+
]
1447+
},
14401448
"libsndfile": {
14411449
"dependency_names": [
14421450
"sndfile"

subprojects/libsass.wrap

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[wrap-file]
2+
directory = libsass-3.6.4
3+
source_url = https://github.com/sass/libsass/archive/refs/tags/3.6.4.tar.gz
4+
source_filename = libsass-3.6.4.tar.gz
5+
source_hash = f9484d9a6df60576e791566eab2f757a97fd414fce01dd41fc0a693ea5db2889
6+
patch_directory = libsass
7+
8+
[provide]
9+
libsass = libsass_dep
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
install_headers('sass.h', 'sass2scss.h')
2+
3+
version_conf_data = configuration_data()
4+
version_conf_data.set('PACKAGE_VERSION', meson.project_version())
5+
6+
version_h = configure_file(
7+
input: 'sass/version.h.in',
8+
output: 'version.h',
9+
configuration: version_conf_data)
10+
11+
install_headers(
12+
'sass/base.h', 'sass/context.h', 'sass/functions.h', 'sass/values.h',
13+
version_h,
14+
subdir: 'sass')
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
project('libsass', 'c', 'cpp',
2+
version: '3.6.4',
3+
meson_version : '>= 0.48.0',
4+
default_options: [
5+
'c_std=c99',
6+
'cpp_std=c++11',
7+
'buildtype=debugoptimized',
8+
])
9+
10+
add_project_arguments(
11+
'-DLIBSASS_VERSION="@0@"'.format(meson.project_version()),
12+
language: ['cpp'])
13+
14+
cpp = meson.get_compiler('cpp')
15+
if cpp.get_id() != 'msvc'
16+
add_project_arguments(
17+
cpp.get_supported_arguments(['-Wno-non-virtual-dtor']),
18+
language: ['cpp'])
19+
endif
20+
21+
inc = include_directories('include')
22+
winres_path = files(join_paths('res', 'resource.rc'))
23+
24+
subdir('include')
25+
subdir('src')
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
cpp_sources = [
2+
'ast.cpp',
3+
'ast_values.cpp',
4+
'ast_supports.cpp',
5+
'ast_sel_cmp.cpp',
6+
'ast_sel_unify.cpp',
7+
'ast_sel_super.cpp',
8+
'ast_sel_weave.cpp',
9+
'ast_selectors.cpp',
10+
'context.cpp',
11+
'constants.cpp',
12+
'fn_utils.cpp',
13+
'fn_miscs.cpp',
14+
'fn_maps.cpp',
15+
'fn_lists.cpp',
16+
'fn_colors.cpp',
17+
'fn_numbers.cpp',
18+
'fn_strings.cpp',
19+
'fn_selectors.cpp',
20+
'color_maps.cpp',
21+
'environment.cpp',
22+
'ast_fwd_decl.cpp',
23+
'bind.cpp',
24+
'file.cpp',
25+
'util.cpp',
26+
'util_string.cpp',
27+
'json.cpp',
28+
'units.cpp',
29+
'values.cpp',
30+
'plugins.cpp',
31+
'source.cpp',
32+
'position.cpp',
33+
'lexer.cpp',
34+
'parser.cpp',
35+
'parser_selectors.cpp',
36+
'prelexer.cpp',
37+
'eval.cpp',
38+
'eval_selectors.cpp',
39+
'expand.cpp',
40+
'listize.cpp',
41+
'cssize.cpp',
42+
'extender.cpp',
43+
'extension.cpp',
44+
'stylesheet.cpp',
45+
'output.cpp',
46+
'inspect.cpp',
47+
'emitter.cpp',
48+
'check_nesting.cpp',
49+
'remove_placeholders.cpp',
50+
'sass.cpp',
51+
'sass_values.cpp',
52+
'sass_context.cpp',
53+
'sass_functions.cpp',
54+
'sass2scss.cpp',
55+
'backtrace.cpp',
56+
'operators.cpp',
57+
'ast2c.cpp',
58+
'c2ast.cpp',
59+
'to_value.cpp',
60+
'source_map.cpp',
61+
'error_handling.cpp',
62+
'memory/allocator.cpp',
63+
'memory/shared_ptr.cpp',
64+
'utf8_string.cpp',
65+
'base64vlq.cpp',
66+
]
67+
68+
c_sources = [
69+
'cencode.c',
70+
]
71+
72+
sass_sources = cpp_sources + c_sources
73+
74+
if host_machine.system() == 'windows'
75+
windows = import('windows')
76+
sass_sources += [windows.compile_resources(winres_path)]
77+
endif
78+
79+
dl_dep = cpp.find_library('dl', required : false)
80+
81+
libsass = shared_library(
82+
'sass',
83+
sass_sources,
84+
dependencies: [dl_dep],
85+
c_args: ['-DADD_EXPORTS'],
86+
cpp_args: ['-DADD_EXPORTS'],
87+
include_directories: inc,
88+
install: true)
89+
90+
libsass_dep = declare_dependency(
91+
link_with: libsass,
92+
include_directories: [inc])
93+
94+
conf_data = configuration_data()
95+
conf_data.set('prefix', get_option('prefix'))
96+
conf_data.set('exec_prefix', '${prefix}')
97+
conf_data.set('libdir', join_paths('${exec_prefix}', get_option('libdir')))
98+
conf_data.set('includedir', join_paths('${prefix}', get_option('includedir')))
99+
conf_data.set('VERSION', meson.project_version())
100+
101+
pkg_install_dir = join_paths(get_option('libdir'), 'pkgconfig')
102+
103+
configure_file(
104+
input: 'support/libsass.pc.in',
105+
output: 'libsass.pc',
106+
configuration: conf_data,
107+
install_dir: pkg_install_dir)

0 commit comments

Comments
 (0)