## START: Set by rpmautospec ## (rpmautospec version 0.3.5) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 1; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec %bcond_without check %global binary_name hx %global runtime_directory_path %{_libdir}/helix/runtime Name: helix Version: 23.10 Release: %autorelease # (Apache-2.0 OR MIT) AND BSD-3-Clause # (MIT OR Apache-2.0) AND Unicode-DFS-2016 # 0BSD OR MIT OR Apache-2.0 # Apache-2.0 # Apache-2.0 OR BSL-1.0 # Apache-2.0 OR MIT # Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT # BSD-2-Clause OR Apache-2.0 OR MIT # BSD-3-Clause # CC0-1.0 OR MIT-0 OR Apache-2.0 # ISC # MIT # MIT OR Apache-2.0 # MIT OR Apache-2.0 OR Zlib # MIT OR Zlib OR Apache-2.0 # MPL-2.0 # MPL-2.0+ # Unlicense OR MIT # Zlib # Zlib OR Apache-2.0 OR MIT License: (Apache-2.0 OR MIT) AND BSD-3-Clause AND Unicode-DFS-2016 AND (0BSD OR MIT OR Apache-2.0) AND Apache-2.0 AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (BSD-2-Clause OR Apache-2.0 OR MIT) AND (CC0-1.0 OR MIT-0 OR Apache-2.0) AND ISC AND MIT AND (MIT OR Apache-2.0 OR Zlib) AND MPL-2.0 AND MPL-2.0+ AND (Unlicense OR MIT) AND Zlib Summary: A post-modern modal text editor written in Rust URL: https://helix-editor.com/ # This tarball includes grammars because we can't download them at build time Source: https://github.com/helix-editor/%{name}/releases/download/%{version}/%{name}-%{version}-source.tar.xz # Remove windows dependencies Patch: remove-windows-dependency.patch BuildRequires: cargo-rpm-macros >= 24 BuildRequires: desktop-file-utils BuildRequires: gcc-c++ BuildRequires: git # Required to allow users to fetch and build grammars Requires: git Requires: gcc-c++ %description A Kakoune / Neovim inspired editor, written in Rust. %files %license LICENSE %doc README.md CHANGELOG.md %{_bindir}/%{binary_name} # We include the whole directory here because we always want to have all # grammars + queries installed %{runtime_directory_path} %{_datadir}/applications/Helix.desktop %{_datadir}/pixmaps/helix.png %{bash_completions_dir}/%{binary_name} %{fish_completions_dir}/%{binary_name}.fish %{zsh_completions_dir}/_%{binary_name} # There is also a completion script for elvish shell but elvish is not packaged # so we do not include it %prep %autosetup -c -p1 %cargo_prep %generate_buildrequires %cargo_generate_buildrequires %build # This will set the default runtime directly in the binary export HELIX_DEFAULT_RUNTIME=%{runtime_directory_path} %cargo_build %{cargo_license_summary} %{cargo_license} > LICENSE.dependencies %install # We can't use %%cargo_install here because it does not support setting --path install -Dpm 0755 target/release/%{binary_name} %{buildroot}%{_bindir}/%{binary_name} # Install desktop file and icon desktop-file-install --dir=%{buildroot}%{_datadir}/applications contrib/Helix.desktop install -Dpm 0644 contrib/helix.png %{buildroot}%{_datadir}/pixmaps/helix.png # Install runtime configuration (includes tutor + queries + compiled grammars) # Step 1: create directory structure install -dm 0755 %{buildroot}%{runtime_directory_path}/ install -dm 0755 %{buildroot}%{runtime_directory_path}/grammars install -dm 0755 %{buildroot}%{runtime_directory_path}/queries find runtime/queries/ -type d -exec sh -c 'install -dm 0755 $(basename {}) %{buildroot}%{runtime_directory_path}/queries/$(basename {})' \; install -dm 0755 %{buildroot}%{runtime_directory_path}/themes # Step 2: install files install -Dpm 0644 runtime/tutor %{buildroot}%{runtime_directory_path}/tutor install -Dpm 0755 runtime/grammars/*.so -t %{buildroot}%{runtime_directory_path}/grammars find runtime/queries/ -type f -exec sh -c 'install -Dpm 0644 {} %{buildroot}%{runtime_directory_path}/queries/$(basename $(dirname {}))' \; install -Dpm 0644 runtime/themes/*.toml -t %{buildroot}%{runtime_directory_path}/themes # Add shell completions install -Dpm 0644 contrib/completion/%{binary_name}.bash %{buildroot}/%{bash_completions_dir}/%{binary_name} install -Dpm 0644 contrib/completion/%{binary_name}.fish %{buildroot}/%{fish_completions_dir}/%{binary_name}.fish install -Dpm 0644 contrib/completion/%{binary_name}.zsh %{buildroot}/%{zsh_completions_dir}/_%{binary_name} %if %{with check} %check # Grammars are already built export HELIX_DISABLE_AUTO_GRAMMAR_BUILD=true %cargo_test %{buildroot}%{_bindir}/%{binary_name} --health %endif %changelog * Sun Oct 29 2023 John Doe - 23.10-1 - Uncommitted changes