2022-04-20 13:56:13 +02:00
|
|
|
#
|
|
|
|
# spec file for package helix
|
|
|
|
#
|
2023-02-11 01:22:01 +01:00
|
|
|
# Copyright (c) 2023 SUSE LLC
|
2022-04-20 13:56:13 +02:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2023-03-06 11:31:07 +01:00
|
|
|
# Workaround for quilt to work
|
|
|
|
%if "x%{?rust_arches}" == "x"
|
|
|
|
%global rust_arches x86_64
|
|
|
|
%endif
|
2022-05-19 03:49:22 +02:00
|
|
|
|
2023-03-06 11:31:07 +01:00
|
|
|
%global _helix_runtimedir %{_libdir}/%{name}/runtime
|
2022-04-20 13:56:13 +02:00
|
|
|
|
|
|
|
Name: helix
|
2023-04-06 11:38:59 +02:00
|
|
|
Version: 23.03
|
2022-04-20 13:56:13 +02:00
|
|
|
Release: 0
|
|
|
|
Summary: A post-modern modal text editor written in Rust
|
2023-04-06 11:38:59 +02:00
|
|
|
License: (Apache-2.0 OR MIT) AND BSD-3-Clause AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (MIT OR Apache-2.0 OR Zlib) AND (MIT or Unlicense) AND (Zlib OR Apache-2.0 OR MIT) AND Apache-2.0 AND BSL-1.0 AND ISC AND MIT AND MPL-2.0 AND Zlib AND MPL-2.0
|
2022-05-19 03:49:22 +02:00
|
|
|
URL: https://github.com/helix-editor/helix
|
2023-03-06 11:31:07 +01:00
|
|
|
# This tarball includes fetched grammars
|
2023-04-06 11:38:59 +02:00
|
|
|
Source0: https://github.com/helix-editor/helix/releases/download/%{version}/%{name}-%{version}-source.tar.xz#/%{name}-%{version}.tar.xz
|
2022-08-28 16:06:56 +02:00
|
|
|
Source1: vendor.tar.xz
|
2022-04-20 13:56:13 +02:00
|
|
|
Source2: cargo_config
|
2022-12-07 14:09:50 +01:00
|
|
|
Source3: README-suse-maint.md
|
2022-12-07 14:24:38 +01:00
|
|
|
Source4: helix-rpmlintrc
|
2022-05-30 16:50:15 +02:00
|
|
|
BuildRequires: c++_compiler
|
|
|
|
BuildRequires: c_compiler
|
2022-04-20 13:56:13 +02:00
|
|
|
BuildRequires: cargo-packaging
|
2022-12-07 13:39:46 +01:00
|
|
|
BuildRequires: hicolor-icon-theme
|
2023-03-01 01:05:14 +01:00
|
|
|
BuildRequires: update-desktop-files
|
2023-03-06 11:31:07 +01:00
|
|
|
Recommends: %{name}-runtime
|
2022-05-19 03:45:13 +02:00
|
|
|
ExclusiveArch: %{rust_arches}
|
2022-04-20 13:56:13 +02:00
|
|
|
|
|
|
|
%description
|
|
|
|
A kakoune/neovim inspired modal text editor with built-in LSP and
|
|
|
|
has treesitter support for syntax highlighting and improved navigation
|
|
|
|
|
2022-10-15 12:18:45 +02:00
|
|
|
%package bash-completion
|
|
|
|
Summary: Bash Completion for %{name}
|
|
|
|
Group: System/Shells
|
|
|
|
Supplements: (%{name} and bash-completion)
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
%description bash-completion
|
|
|
|
Bash command-line completion support for %{name}.
|
|
|
|
|
|
|
|
%package fish-completion
|
|
|
|
Summary: Fish Completion for %{name}
|
|
|
|
Group: System/Shells
|
|
|
|
Supplements: (%{name} and fish)
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
%description fish-completion
|
|
|
|
Fish command-line completion support for %{name}.
|
|
|
|
|
|
|
|
%package zsh-completion
|
|
|
|
Summary: Zsh Completion for %{name}
|
|
|
|
Group: System/Shells
|
|
|
|
Supplements: (%{name} and zsh)
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
%description zsh-completion
|
|
|
|
Zsh command-line completion support for %{name}.
|
|
|
|
|
2022-08-28 16:06:56 +02:00
|
|
|
%package runtime
|
|
|
|
Summary: Runtime files for %{name}
|
2023-03-06 11:31:07 +01:00
|
|
|
Recommends: %{name}
|
2022-08-28 15:34:19 +02:00
|
|
|
|
|
|
|
%description runtime
|
|
|
|
Helix runtime files. Separated due to how huge the runtime files are.
|
|
|
|
The runtime contains tree-sitter and grammars that makes run helix normally
|
|
|
|
if there is no runtime present in the users config directory specifically
|
|
|
|
`XDG_CONFIG_HOME/helix`.
|
|
|
|
|
2023-03-06 11:31:07 +01:00
|
|
|
%prep
|
|
|
|
%autosetup -a1 -p1 -c -n %{name}-%{version}
|
|
|
|
mkdir -p .cargo
|
|
|
|
cp %{SOURCE2} .cargo/config.toml
|
|
|
|
|
|
|
|
# Remove shell definitions
|
|
|
|
sed -e '/^\#\!\/usr\/bin\/env .*/d' -i contrib/completion/hx.*
|
|
|
|
|
2022-04-20 13:56:13 +02:00
|
|
|
%build
|
2022-05-30 16:50:15 +02:00
|
|
|
%{cargo_build}
|
2022-04-20 13:56:13 +02:00
|
|
|
|
2022-10-15 12:18:45 +02:00
|
|
|
# Shell completions
|
|
|
|
sed -i "s|hx|helix|g" contrib/completion/hx.*
|
|
|
|
|
|
|
|
# Desktop file
|
|
|
|
sed -i "s|hx|helix|g" contrib/Helix.desktop
|
|
|
|
|
2022-04-20 13:56:13 +02:00
|
|
|
%install
|
2023-03-06 11:31:07 +01:00
|
|
|
install -d -m 0755 %{buildroot}%{_bindir}
|
|
|
|
install -m 0755 target/release/hx %{buildroot}%{_bindir}/%{name}
|
|
|
|
|
|
|
|
install -d -m 0755 %{buildroot}%{_helix_runtimedir}
|
|
|
|
cp -av "runtime/queries" %{buildroot}%{_helix_runtimedir}
|
|
|
|
cp -av "runtime/themes" %{buildroot}%{_helix_runtimedir}
|
2022-08-28 16:23:29 +02:00
|
|
|
find "%{_builddir}/%{name}-%{version}/runtime/grammars" -type f -name '*.so' -exec \
|
2022-05-31 01:08:10 +02:00
|
|
|
install --verbose -Dm 755 {} -t "%{buildroot}%{_helix_runtimedir}/grammars" \;
|
2022-12-07 13:04:22 +01:00
|
|
|
install -Dm644 runtime/tutor -t %{buildroot}%{_helix_runtimedir}
|
2022-04-20 13:56:13 +02:00
|
|
|
|
2023-04-06 15:28:56 +02:00
|
|
|
# Not needed during runtime
|
|
|
|
rm -rfv %{buildroot}%{_helix_runtimedir}/grammars/sources
|
|
|
|
|
2022-10-15 12:18:45 +02:00
|
|
|
# Desktop application file
|
|
|
|
install -Dm644 -T %{_builddir}/%{name}-%{version}/contrib/Helix.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop
|
2023-03-01 01:05:14 +01:00
|
|
|
%suse_update_desktop_file %{name}
|
2022-10-15 12:18:45 +02:00
|
|
|
|
|
|
|
# Icon
|
2022-12-07 13:39:46 +01:00
|
|
|
install -Dm644 -T %{_builddir}/%{name}-%{version}/logo.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
|
2022-10-15 12:18:45 +02:00
|
|
|
|
|
|
|
# Shell completions
|
|
|
|
install -Dm644 -T %{_builddir}/%{name}-%{version}/contrib/completion/hx.bash %{buildroot}%{_datadir}/bash-completion/completions/%{name}
|
|
|
|
install -Dm644 -T %{_builddir}/%{name}-%{version}/contrib/completion/hx.fish %{buildroot}%{_datadir}/fish/vendor_completions.d/%{name}.fish
|
|
|
|
install -Dm644 -T %{_builddir}/%{name}-%{version}/contrib/completion/hx.zsh %{buildroot}%{_datadir}/zsh/site-functions/_%{name}
|
|
|
|
|
2023-03-08 16:33:36 +01:00
|
|
|
%pre
|
|
|
|
if [ -l "%{_helix_runtimedir}" ] ; then
|
|
|
|
rm -f "%{_helix_runtimedir}"
|
|
|
|
fi
|
|
|
|
|
2022-04-20 13:56:13 +02:00
|
|
|
%files
|
|
|
|
%license LICENSE
|
2022-05-30 16:50:15 +02:00
|
|
|
%doc README.md CHANGELOG.md languages.toml docs/CONTRIBUTING.md docs/architecture.md docs/vision.md
|
2023-03-06 11:31:07 +01:00
|
|
|
%{_bindir}/%{name}
|
2022-10-15 12:18:45 +02:00
|
|
|
|
|
|
|
# Desktop application file
|
2022-12-07 13:45:49 +01:00
|
|
|
%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
|
2022-10-15 12:18:45 +02:00
|
|
|
%{_datadir}/applications/*
|
|
|
|
|
2023-03-06 11:31:07 +01:00
|
|
|
%dir %{_libdir}/helix
|
2022-10-15 12:18:45 +02:00
|
|
|
|
2022-09-08 00:13:21 +02:00
|
|
|
# Tutor
|
2023-03-06 11:31:07 +01:00
|
|
|
%dir %{_helix_runtimedir}
|
2022-12-07 13:04:22 +01:00
|
|
|
%{_helix_runtimedir}/tutor
|
2022-05-30 16:50:15 +02:00
|
|
|
|
2022-08-28 15:34:19 +02:00
|
|
|
%files runtime
|
2022-05-30 16:50:15 +02:00
|
|
|
# Runtimes and runtime files
|
2022-05-30 16:59:42 +02:00
|
|
|
# Grammars
|
2023-03-06 11:31:07 +01:00
|
|
|
%dir %{_helix_runtimedir}/grammars
|
2022-09-03 15:34:47 +02:00
|
|
|
%{_helix_runtimedir}/grammars/*
|
2022-05-30 16:59:42 +02:00
|
|
|
# Queries
|
2023-03-06 11:31:07 +01:00
|
|
|
%dir %{_helix_runtimedir}/queries
|
2022-09-03 15:34:47 +02:00
|
|
|
%{_helix_runtimedir}/queries/*
|
2022-05-30 16:59:42 +02:00
|
|
|
# Themes
|
2023-03-06 11:31:07 +01:00
|
|
|
%dir %{_helix_runtimedir}/themes
|
2022-09-03 15:34:47 +02:00
|
|
|
%{_helix_runtimedir}/themes/*
|
|
|
|
|
2022-10-15 12:18:45 +02:00
|
|
|
%files bash-completion
|
|
|
|
%{_datadir}/bash-completion/*
|
|
|
|
|
|
|
|
%files fish-completion
|
|
|
|
%dir %{_datadir}/fish
|
|
|
|
%{_datadir}/fish/*
|
|
|
|
|
|
|
|
%files zsh-completion
|
|
|
|
%dir %{_datadir}/zsh
|
|
|
|
%{_datadir}/zsh/*
|
|
|
|
|
2022-04-20 13:56:13 +02:00
|
|
|
%changelog
|