From 46345917ebe190b90280b71b7126d679d90c771d Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Mon, 18 Sep 2023 19:31:44 +0200 Subject: [PATCH 1/2] Add sassc 3.6.2 This is a direct copy of https://github.com/lazka/sassc/tree/meson which I've created for gtk back in the days. This project is in a similar situation as #1153. There exists an upstream PR for adding meson (https://github.com/sass/sassc/pull/269), but the project is unmaintained, so unlikely to see progress there. --- releases.json | 8 ++++ subprojects/packagefiles/sassc/meson.build | 47 ++++++++++++++++++++++ subprojects/sassc.wrap | 9 +++++ 3 files changed, 64 insertions(+) create mode 100644 subprojects/packagefiles/sassc/meson.build create mode 100644 subprojects/sassc.wrap diff --git a/releases.json b/releases.json index 521ca1196..b5c7f98d8 100644 --- a/releases.json +++ b/releases.json @@ -2492,6 +2492,14 @@ "4.1.0-1" ] }, + "sassc": { + "program_names": [ + "sassc" + ], + "versions": [ + "3.6.2-1" + ] + }, "sdl2": { "dependency_names": [ "sdl2", diff --git a/subprojects/packagefiles/sassc/meson.build b/subprojects/packagefiles/sassc/meson.build new file mode 100644 index 000000000..5455c3248 --- /dev/null +++ b/subprojects/packagefiles/sassc/meson.build @@ -0,0 +1,47 @@ +project('sassc', 'c', + version: '3.6.2', + meson_version : '>= 0.48.0', + default_options: [ + 'c_std=c99', + 'buildtype=debugoptimized', + ]) + +version_conf_data = configuration_data() +version_conf_data.set('PACKAGE_VERSION', meson.project_version()) + +add_project_arguments( + '-D_POSIX_C_SOURCE', + '-DSASSC_VERSION="@0@"'.format(meson.project_version()), + language: ['c']) + +configure_file( + input: 'sassc_version.h.in', + output: 'sassc_version.h', + configuration: version_conf_data) + +libsass_dep = dependency( + 'libsass', + fallback: ['libsass', 'libsass_dep']) + +sassc_sources = ['sassc.c'] + +incs = [] +if host_machine.system() == 'windows' + windows = import('windows') + win_res = windows.compile_resources( + 'res/libsass.rc', + depend_files: ['res/libsass.ico']) + sassc_sources += [win_res] + incs += [include_directories(join_paths('win', 'posix'))] + sassc_sources += [join_paths('win', 'posix', 'getopt.c')] +endif + +sassc = executable( + 'sassc', + sassc_sources, + dependencies: [libsass_dep], + include_directories: incs, + install: true, +) + +meson.override_find_program('sassc', sassc) diff --git a/subprojects/sassc.wrap b/subprojects/sassc.wrap new file mode 100644 index 000000000..f874e8eaa --- /dev/null +++ b/subprojects/sassc.wrap @@ -0,0 +1,9 @@ +[wrap-file] +directory = sassc-3.6.2 +source_url = https://github.com/sass/sassc/archive/refs/tags/3.6.2.tar.gz +source_filename = sassc-3.6.2.tar.gz +source_hash = 608dc9002b45a91d11ed59e352469ecc05e4f58fc1259fc9a9f5b8f0f8348a03 +patch_directory = sassc + +[provide] +program_names = sassc From f0cee7b7b3961eac8fd37ebc1ea2c9e51a24746c Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Tue, 19 Sep 2023 11:02:55 +0200 Subject: [PATCH 2/2] sassc: review suggestions --- subprojects/packagefiles/sassc/meson.build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/subprojects/packagefiles/sassc/meson.build b/subprojects/packagefiles/sassc/meson.build index 5455c3248..29dd6f608 100644 --- a/subprojects/packagefiles/sassc/meson.build +++ b/subprojects/packagefiles/sassc/meson.build @@ -31,9 +31,9 @@ if host_machine.system() == 'windows' win_res = windows.compile_resources( 'res/libsass.rc', depend_files: ['res/libsass.ico']) - sassc_sources += [win_res] - incs += [include_directories(join_paths('win', 'posix'))] - sassc_sources += [join_paths('win', 'posix', 'getopt.c')] + sassc_sources += win_res + incs += include_directories('win/posix') + sassc_sources += 'win/posix/getopt.c' endif sassc = executable(