meson.build
This file
Path
meson.build
286 lines · 9.2 KiB
Last changed by
Merge branch 'releases/1.15'Daniel Eklöfbefore adoptionfa178b8
History of this fileTake it
The walk stopped after 200 commits: lines older than 6a4c416 point at it.
changelog: add missing refDaniel Eklöfbefore adoption6a4c416
line 1why, one step back1project('fuzzel', 'c',Merge branch 'releases/1.15'Daniel Eklöfbefore adoptionfa178b8
line 2why, one step back2 version: '1.15.0',changelog: add missing refDaniel Eklöfbefore adoption6a4c416
lines 3–58why, one step back3 license: 'MIT',4 meson_version: '>=0.58.0',5 default_options: [6 'c_std=c18',7 'warning_level=1',8 'werror=true',9 'b_ndebug=if-release'])1011is_debug_build = get_option('buildtype').startswith('debug')12cc = meson.get_compiler('c')1314add_project_arguments(15 ['-D_GNU_SOURCE'] +16 (is_debug_build17 ? ['-D_DEBUG']18 : [cc.get_supported_arguments('-fno-asynchronous-unwind-tables')]),19 language: 'c',20)2122if cc.has_function('memfd_create',23 args: ['-D_GNU_SOURCE=200809L'],24 prefix: '#include <sys/mman.h>')25 add_project_arguments('-DMEMFD_CREATE', language: 'c')26endif2728# Compute the relative path used by compiler invocations.29source_root = meson.current_source_dir().split('/')30build_root = meson.global_build_root().split('/')31relative_dir_parts = []32i = 033in_prefix = true34foreach p : build_root35 if i >= source_root.length() or not in_prefix or p != source_root[i]36 in_prefix = false37 relative_dir_parts += '..'38 endif39 i += 140endforeach41i = 042in_prefix = true43foreach p : source_root44 if i >= build_root.length() or not in_prefix or build_root[i] != p45 in_prefix = false46 relative_dir_parts += p47 endif48 i += 149endforeach50relative_dir = join_paths(relative_dir_parts) + '/'5152if cc.has_argument('-fmacro-prefix-map=/foo=')53 add_project_arguments('-fmacro-prefix-map=@0@='.format(relative_dir), language: 'c')54endif5556math = cc.find_library('m')57threads = [dependency('threads'), cc.find_library('stdthreads', required: false)]58fontconfig = dependency('fontconfig')Implement gamma-correct blendingDaniel Eklöfbefore adoption2d19826
line 59why, one step back59pixman = dependency('pixman-1', version: '>=0.46.0')✨ Add resvg as SVG render option.Mark Stosbergbefore adoptionfaf6fea
lines 60–71why, one step back60# Cairo is required for librsvg but not for resvg/nanosvg61if get_option('svg-backend') == 'resvg' or get_option('svg-backend') == 'nanosvg'62 # For resvg/nanosvg, cairo is optional and disabled by default63 if get_option('enable-cairo').auto()64 cairo = dependency('cairo', required: false)65 else66 cairo = dependency('cairo', required: get_option('enable-cairo'))67 endif68else69 # For librsvg or no SVG backend, respect the enable-cairo option70 cairo = dependency('cairo', required: get_option('enable-cairo'))71endifchangelog: add missing refDaniel Eklöfbefore adoption6a4c416
line 72why, one step back72libepoll = dependency('epoll-shim', required: false)Implement gamma-correct blendingDaniel Eklöfbefore adoption2d19826
line 73why, one step back73wayland_protocols = dependency('wayland-protocols', version: '>=1.41')changelog: add missing refDaniel Eklöfbefore adoption6a4c416
lines 74–80why, one step back74wayland_client = dependency('wayland-client')75wayland_cursor = dependency('wayland-cursor')76xkb = dependency('xkbcommon')77system_nanosvg = cc.find_library('nanosvg', required: get_option('system-nanosvg'))78system_nanosvgrast = cc.find_library('nanosvgrast', required: get_option('system-nanosvg'))7980tllist = dependency('tllist', version: '>=1.0.1', fallback: 'tllist')Implement gamma-correct blendingDaniel Eklöfbefore adoption2d19826
line 81why, one step back81fcft = dependency('fcft', version: ['>=3.3.1', '<4.0.0'], fallback: 'fcft')changelog: add missing refDaniel Eklöfbefore adoption6a4c416
lines 82–96why, one step back8283if cairo.found()84 add_project_arguments('-DFUZZEL_ENABLE_CAIRO=1', language: 'c')85endif8687if get_option('png-backend') == 'libpng'88 libpng = dependency('libpng')89 add_project_arguments('-DFUZZEL_ENABLE_PNG_LIBPNG=1', language: 'c')90else91 libpng = declare_dependency()92endif9394if cairo.found() and get_option('svg-backend') == 'librsvg'95 librsvg = dependency('librsvg-2.0')96 nanosvg = declare_dependency()✨ Add resvg as SVG render option.Mark Stosbergbefore adoptionfaf6fea
line 97why, one step back97 resvg = declare_dependency()changelog: add missing refDaniel Eklöfbefore adoption6a4c416
lines 98–115why, one step back98 svg_backend = 'librsvg'99 add_project_arguments('-DFUZZEL_ENABLE_SVG_LIBRSVG=1', language: 'c')100elif get_option('svg-backend') == 'nanosvg'101 if system_nanosvg.found() and system_nanosvgrast.found()102 nanosvg = declare_dependency(103 dependencies: [system_nanosvg, system_nanosvgrast]104 )105 svg_backend = 'nanosvg (system)'106 else107 nanosvg = declare_dependency(108 sources: ['nanosvg.c', '3rd-party/nanosvg/src/nanosvg.h',109 'nanosvgrast.c', '3rd-party/nanosvg/src/nanosvgrast.h'],110 include_directories: '.',111 dependencies: math)112 svg_backend = 'nanosvg (bundled)'113 endif114 add_project_arguments('-DFUZZEL_ENABLE_SVG_NANOSVG=1', language: 'c')115 librsvg = declare_dependency()✨ Add resvg as SVG render option.Mark Stosbergbefore adoptionfaf6fea
lines 116–117why, one step back116 resvg = declare_dependency()117elif get_option('svg-backend') == 'resvg'meson: recent versions of resvg does provide a .pc fileDaniel Eklöfbefore adoptione16378e
lines 118–120why, one step back118 resvg_pc = dependency('resvg', required: false)119 if resvg_pc.found()120 resvg = resvg_pc✨ Add resvg as SVG render option.Mark Stosbergbefore adoptionfaf6fea
lines 121–123why, one step back121 svg_backend = 'resvg'122 add_project_arguments('-DFUZZEL_ENABLE_SVG_RESVG=1', language: 'c')123 elsemeson: recent versions of resvg does provide a .pc fileDaniel Eklöfbefore adoptione16378e
lines 124–132why, one step back124 # earlier versions of resvg doesn't provide pkg-config, so we need125 # to find it manually126 resvg = cc.find_library('resvg', required: true)127 if cc.has_header('resvg.h')128 svg_backend = 'resvg'129 add_project_arguments('-DFUZZEL_ENABLE_SVG_RESVG=1', language: 'c')130 else131 error('resvg.h not found. Please install resvg development files.')132 endif✨ Add resvg as SVG render option.Mark Stosbergbefore adoptionfaf6fea
lines 133–135why, one step back133 endif134 librsvg = declare_dependency()135 nanosvg = declare_dependency()changelog: add missing refDaniel Eklöfbefore adoption6a4c416
lines 136–139why, one step back136else137 svg_backend = 'none'138 librsvg = declare_dependency()139 nanosvg = declare_dependency()✨ Add resvg as SVG render option.Mark Stosbergbefore adoptionfaf6fea
line 140why, one step back140 resvg = declare_dependency()changelog: add missing refDaniel Eklöfbefore adoption6a4c416
lines 141–161why, one step back141endif142143wayland_protocols_datadir = wayland_protocols.get_variable('pkgdatadir')144145wscanner = dependency('wayland-scanner', native: true)146wscanner_prog = find_program(147 wscanner.get_variable('wayland_scanner'), native: true)148149wl_proto_headers = []150wl_proto_src = []151152wl_proto_xml = [153 'external/wlr-layer-shell-unstable-v1.xml',154 wayland_protocols_datadir + '/stable/xdg-shell/xdg-shell.xml',155 wayland_protocols_datadir + '/unstable/xdg-output/xdg-output-unstable-v1.xml',156 wayland_protocols_datadir + '/staging/xdg-activation/xdg-activation-v1.xml',157 wayland_protocols_datadir + '/staging/cursor-shape/cursor-shape-v1.xml',158 wayland_protocols_datadir + '/unstable/tablet/tablet-unstable-v2.xml',159 wayland_protocols_datadir + '/stable/viewporter/viewporter.xml',160 wayland_protocols_datadir + '/staging/fractional-scale/fractional-scale-v1.xml',161 wayland_protocols_datadir / 'unstable/primary-selection/primary-selection-unstable-v1.xml',Implement gamma-correct blendingDaniel Eklöfbefore adoption2d19826
line 162why, one step back162 wayland_protocols_datadir / 'staging/color-management/color-management-v1.xml',wayland: use the single-pixel protocol for the initial, transparent frameDaniel Eklöfbefore adoption82b0558
line 163why, one step back163 wayland_protocols_datadir / 'staging/single-pixel-buffer/single-pixel-buffer-v1.xml',wayland: implement text-input-unstable-v3 for IME supportMark Stosbergbefore adoption43caf1d
line 164why, one step back164 wayland_protocols_datadir / 'unstable/text-input/text-input-unstable-v3.xml',changelog: add missing refDaniel Eklöfbefore adoption6a4c416
lines 165–188why, one step back165]166167foreach prot : wl_proto_xml168 wl_proto_headers += custom_target(169 prot.underscorify() + '-client-header',170 output: '@BASENAME@.h',171 input: prot,172 command: [wscanner_prog, 'client-header', '@INPUT@', '@OUTPUT@'])173174 wl_proto_src += custom_target(175 prot.underscorify() + '-private-code',176 output: '@BASENAME@.c',177 input: prot,178 command: [wscanner_prog, 'private-code', '@INPUT@', '@OUTPUT@'])179endforeach180181env = find_program('env', native: true)182generate_version_sh = files('generate-version.sh')183version = custom_target(184 'generate_version',185 build_always_stale: true,186 output: 'version.h',187 command: [env, 'LC_ALL=C', generate_version_sh, meson.project_version(), '@CURRENT_SOURCE_DIR@', '@OUTPUT@'])188Implement gamma-correct blendingDaniel Eklöfbefore adoption2d19826
lines 189–196why, one step back189python = find_program('python3', native: true)190generate_srgb_funcs = files('srgb.py')191srgb_funcs = custom_target(192 'generate_srgb_funcs',193 output: ['srgb.c', 'srgb.h'],194 command: [python, generate_srgb_funcs, '@OUTPUT0@', '@OUTPUT1@']195)196meson: add fish-based test scriptsDaniel Eklöfbefore adoption7550217
line 197why, one step back197fuzzel = executable(changelog: add missing refDaniel Eklöfbefore adoption6a4c416
lines 198–201why, one step back198 'fuzzel',199 'application.c', 'application.h',200 'char32.c', 'char32.h',201 'clipboard.c', 'clipboard.h',Add `--accept-nth` command line option to select column to outputbbb651before adoption33c9b8e
line 202why, one step back202 'column.c', 'column.h',changelog: add missing refDaniel Eklöfbefore adoption6a4c416
lines 203–224why, one step back203 'config.c', 'config.h',204 'debug.c', 'debug.h',205 'dmenu.c', 'dmenu.h',206 'event.c', 'event.h',207 'fdm.c', 'fdm.h',208 'icon.c', 'icon.h',209 'key-binding.c', 'key-binding.h',210 'log.c', 'log.h',211 'macros.h',212 'main.c',213 'match.c', 'match.h',214 'path.c', 'path.h',215 'png.c', 'png-fuzzel.h',216 'prompt.c', 'prompt.h',217 'render.c', 'render.h',218 'shm.c', 'shm.h',219 'stride.h',220 'uri.c', 'uri.h',221 'wayland.c', 'wayland.h',222 'xdg.c', 'xdg.h',223 'xmalloc.c', 'xmalloc.h',224 'xsnprintf.c', 'xsnprintf.h',timing: new minimal timing frameworkDaniel Eklöfbefore adoption0221d35
line 225why, one step back225 'timing.c', 'timing.h',Implement gamma-correct blendingDaniel Eklöfbefore adoption2d19826
line 226why, one step back226 wl_proto_src + wl_proto_headers, version, srgb_funcs,changelog: add missing refDaniel Eklöfbefore adoption6a4c416
lines 227–235why, one step back227 dependencies: [math,228 threads,229 pixman,230 fontconfig,231 cairo,232 libepoll,233 libpng,234 librsvg,235 nanosvg,✨ Add resvg as SVG render option.Mark Stosbergbefore adoptionfaf6fea
line 236why, one step back236 resvg,changelog: add missing refDaniel Eklöfbefore adoption6a4c416
lines 237–242why, one step back237 wayland_client,238 wayland_cursor,239 xkb,240 tllist,241 fcft],242 install: true)meson: add fish-based test scriptsDaniel Eklöfbefore adoption7550217
lines 243–244why, one step back243244fish = find_program('fish', required: false)meson: tests: require wtypeDaniel Eklöfbefore adoptionb537211
lines 245–246why, one step back245wtype = find_program('wtype', required: false)246if fish.found() and wtype.found()meson: add fish-based test scriptsDaniel Eklöfbefore adoption7550217
lines 247–248why, one step back247 if run_command(fish, '-c fishtape -v', check: false).returncode() == 0248 foreach test_case : [test: accept-nth: new test suiteDaniel Eklöfbefore adoption6d2fb1e
line 249why, one step back249 'accept-nth',meson: re-enable the auto-select testDaniel Eklöfbefore adoption1f83f32
line 250why, one step back250 'auto-select',🐛 Don't ignore execute action when using dmenu modeMark Stosbergbefore adoptionb4e9c1c
line 251why, one step back251 'execute',test: accept-nth: new test suiteDaniel Eklöfbefore adoption6d2fb1e
line 252why, one step back252 'match-mode-fzf',test: add test for --match-nthDaniel Eklöfbefore adoptionda0c1eb
line 253why, one step back253 'match-nth',meson: add fish-based test scriptsDaniel Eklöfbefore adoption7550217
lines 254–267why, one step back254 ]255 test(test_case, fish,256 args: ['-c',257 'fishtape @0@/test/@1@.fish'.format(meson.current_source_dir(),258 test_case)],259 env: {'FUZZEL_TEST_BIN': fuzzel.full_path(),260 'MALLOC_PERTURB_': '0',261 'ASAN_OPTIONS': 'non-empty-invalid-value=0',262 'UBSAN_OPTIONS': 'non-empty-invalid-value=0',263 'MSAN_OPTIONS': 'non-empty-invalid-value=0'},264 is_parallel : false)265 endforeach266 endif267endifchangelog: add missing refDaniel Eklöfbefore adoption6a4c416
lines 268–286why, one step back268269install_data(270 'fuzzel.ini',271 install_dir: join_paths(get_option('sysconfdir'), 'xdg', 'fuzzel'))272install_data(273 'LICENSE', 'README.md', 'CHANGELOG.md',274 install_dir: join_paths(get_option('datadir'), 'doc', 'fuzzel'))275276subdir('completions')277subdir('doc')278279summary(280 {281 'Cairo': cairo.found(),282 'PNG icons': get_option('png-backend'),283 'SVG icons': svg_backend,284 },285 bool_yn: true286)