tree-sitter/macros.in
Martin Pluskal 6291acbcdd Accepting request 1160845 from home:Thaodan:editors
- Add packaging macros for tree-sitter grammar
- Add missing dependency for tree-sitter generate

OBS-URL: https://build.opensuse.org/request/show/1160845
OBS-URL: https://build.opensuse.org/package/show/editors/tree-sitter?expand=0&rev=23
2024-03-25 15:00:40 +00:00

27 lines
1019 B
Plaintext

# -*- rpm-spec -*-
# SPDX-License-Identifier: GPL-2.0
# SPDX-FileCopyrightText: 2024 Björn Bidar
%_treesitter_base_name tree-sitter
%_treesitter_grammardir %{_libdir}
%_treesitter_grammar_develdir %{_includedir}/%{_treesitter_base_name}/grammars
%_treesitter_grammar_base_libname lib%{_treesitter_base_name}
%treesitter_target() %{_rpmconfigdir}/tree-sitter-target.py
%treesitter_set_flags export NODE_PATH=$NODE_PATH:%{_treesitter_grammar_develdir}:$PWD
%__treesitter_devel_package_name() %name-devel
%treesitter_devel_package \
%package -n %{__treesitter_devel_package_name} \
Summary: Devel package for %{name} containing it's grammar source \
BuildArch: noarch \
%{_treesitter_devel_provides} \
%description -n %{__treesitter_devel_package_name} \
This package contains grammar sources for use in other grammars. \
%files -n %{__treesitter_devel_package_name} \
%{treesitter_devel_files}
### LUA-MACROS ###
%_treesitter_macro_init %{_treesitter_definitions}%{lua: rpm.define("_treesitter_macro_init %{nil}")}