diff --git a/README-suse-maint.md b/README-suse-maint.md deleted file mode 100644 index 2d9b199..0000000 --- a/README-suse-maint.md +++ /dev/null @@ -1,12 +0,0 @@ -From upstream releases, choose the file with `helix--source.tar.xz`. -And run `rpmdev-spectool -g helix.spec`. Create a directory named `helix` where -you should extract the contents of the downloaded tarball. Thereafter, run -`osc service disabledrun`. This will run cargo vendor and compress them inside -a tarball. You can check if you want to disable the cargo update mechanism. - -Please do remember to create separate packages for the runtime and the helix -binary as the former is huge when built. Helix still runs fine without -the runtime but for it to run "normally" a user just needs to run -`helix --grammar fetch` then `helix --grammar build`. The purpose of the -runtime files as a package is to maintain consistency and convenience -and stay faithful with how other packagers do it and when someone needs it. diff --git a/helix-rpmlintrc b/helix-rpmlintrc deleted file mode 100644 index e573e55..0000000 --- a/helix-rpmlintrc +++ /dev/null @@ -1 +0,0 @@ -addFilter("files-duplicate") diff --git a/helix.changes b/helix.changes index 864e481..98f43b5 100644 --- a/helix.changes +++ b/helix.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Wed Sep 11 08:15:58 UTC 2024 - Richard Rahl + +- remove rpmlintrc as using fdupes works as intended +- remove README-suse-maint.md as the packaging changed so much that + the readme is not needed anymore +- put the binary in the bindir, create a symlink for people who still + want to use the full name for the binary + ------------------------------------------------------------------- Sun Jul 14 17:24:29 UTC 2024 - Joshua Smith diff --git a/helix.spec b/helix.spec index 517664e..3b47d3b 100644 --- a/helix.spec +++ b/helix.spec @@ -1,7 +1,7 @@ # # spec file for package helix # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -15,31 +15,28 @@ # Please submit bugfixes or comments via https://bugs.opensuse.org/ # -# Workaround for quilt to work -%if "x%{?rust_arches}" == "x" -%global rust_arches x86_64 -%endif - -%global _helix_runtimedir %{_libdir}/%{name}/runtime +%global _helix_runtimedir %{_libdir}/%{name}/runtime Name: helix Version: 24.07 Release: 0 Summary: A post-modern modal text editor written in Rust -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 +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 (Apache-2.0 OR MIT OR Zlib) AND (MIT OR Unlicense) AND (Apache-2.0 OR Zlib OR MIT) AND Apache-2.0 AND BSL-1.0 AND ISC AND MIT AND MPL-2.0 AND Zlib AND MPL-2.0 URL: https://github.com/helix-editor/helix # This tarball includes fetched grammars -Source0: https://github.com/helix-editor/helix/releases/download/%{version}/%{name}-%{version}-source.tar.xz#/%{name}-%{version}.tar.xz +Source0: %{url}/releases/download/%{version}/%{name}-%{version}-source.tar.xz#/%{name}-%{version}.tar.xz Source1: vendor.tar.zst -Source3: README-suse-maint.md -Source4: helix-rpmlintrc +BuildRequires: bash-completion BuildRequires: c++_compiler BuildRequires: c_compiler BuildRequires: cargo >= 1.74.0 BuildRequires: cargo-packaging +BuildRequires: fdupes +BuildRequires: fish +BuildRequires: git-core BuildRequires: hicolor-icon-theme BuildRequires: update-desktop-files -BuildRequires: git +BuildRequires: zsh Recommends: %{name}-runtime = %{version} ExclusiveArch: %{rust_arches} @@ -49,7 +46,6 @@ has treesitter support for syntax highlighting and improved navigation %package bash-completion Summary: Bash Completion for %{name} -Group: System/Shells Supplements: (%{name} and bash-completion) Requires: %{name} = %{version} BuildArch: noarch @@ -59,7 +55,6 @@ Bash command-line completion support for %{name}. %package fish-completion Summary: Fish Completion for %{name} -Group: System/Shells Supplements: (%{name} and fish) Requires: %{name} = %{version} BuildArch: noarch @@ -69,7 +64,6 @@ Fish command-line completion support for %{name}. %package zsh-completion Summary: Zsh Completion for %{name} -Group: System/Shells Supplements: (%{name} and zsh) Requires: %{name} = %{version} BuildArch: noarch @@ -79,7 +73,6 @@ Zsh command-line completion support for %{name}. %package runtime Summary: Runtime files for %{name} -Version: %{version} Requires: %{name} %description runtime @@ -89,29 +82,22 @@ if there is no runtime present in the users config directory specifically `XDG_CONFIG_HOME/helix`. %prep -%autosetup -a1 -p1 -c -n %{name}-%{version} +%autosetup -a1 -c # Remove shell definitions sed -e '/^\#\!\/usr\/bin\/env .*/d' -i contrib/completion/hx.* %build -export HELIX_DISABLE_AUTO_GRAMMAR_BUILD=true -export TARGET="%_arch" +#be explicit where the default runtime lives +export HELIX_DEFAULT_RUNTIME=%{_libdir}/%{name}/runtime %{cargo_build} cargo run --release --offline -- --grammar build -# Shell completions -sed -i "s|hx|helix|g" contrib/completion/hx.* - -# Desktop file -sed -i "s|hx|helix|g" contrib/Helix.desktop - %install -install -d -m 0755 %{buildroot}%{_bindir} install -d -m 0755 %{buildroot}%{_helix_runtimedir} -install -m 0755 target/release/hx %{buildroot}%{_libdir}/%{name}/hx -ln -sfv "%{_libdir}/%{name}/hx" "%{buildroot}%{_bindir}/helix" +install -Dm0755 ./target/release/hx %{buildroot}%{_bindir}/hx +ln -sfv "%{_bindir}/hx" "%{buildroot}%{_bindir}/%{name}" cp -av "runtime/queries" %{buildroot}%{_helix_runtimedir} cp -av "runtime/themes" %{buildroot}%{_helix_runtimedir} @@ -131,29 +117,29 @@ install -Dm644 -T %{_builddir}/%{name}-%{version}/contrib/Helix.appdata.xml %{bu install -Dm644 -T %{_builddir}/%{name}-%{version}/logo.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg # 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} +install -Dm644 -T %{_builddir}/%{name}-%{version}/contrib/completion/hx.bash %{buildroot}%{_datadir}/bash-completion/completions/hx +install -Dm644 -T %{_builddir}/%{name}-%{version}/contrib/completion/hx.fish %{buildroot}%{_datadir}/fish/vendor_completions.d/hx.fish +install -Dm644 -T %{_builddir}/%{name}-%{version}/contrib/completion/hx.zsh %{buildroot}%{_datadir}/zsh/site-functions/_hx + +%fdupes %{buildroot} %files %license LICENSE %doc README.md CHANGELOG.md languages.toml docs/CONTRIBUTING.md docs/architecture.md docs/vision.md +%{_bindir}/hx %{_bindir}/%{name} # Desktop application file %{_datadir}/icons/hicolor/scalable/apps/%{name}.svg -%{_datadir}/applications/* +%{_datadir}/applications/%{name}.desktop %{_datadir}/metainfo/%{name}.appdata.xml -%dir %{_libdir}/helix +%dir %{_libdir}/%{name} # Tutor %dir %{_helix_runtimedir} %{_helix_runtimedir}/tutor -# Executable -%{_libdir}/%{name}/hx - %files runtime # Runtimes and runtime files # Grammars @@ -167,14 +153,12 @@ install -Dm644 -T %{_builddir}/%{name}-%{version}/contrib/completion/hx.zsh %{bu %{_helix_runtimedir}/themes/* %files bash-completion -%{_datadir}/bash-completion/* +%{_datadir}/bash-completion/completions/hx %files fish-completion -%dir %{_datadir}/fish -%{_datadir}/fish/* +%{_datadir}/fish/vendor_completions.d/hx.fish %files zsh-completion -%dir %{_datadir}/zsh -%{_datadir}/zsh/* +%{_datadir}/zsh/site-functions/_hx %changelog diff --git a/vendor.tar.zst b/vendor.tar.zst index 2a3a250..6a18e6f 100644 --- a/vendor.tar.zst +++ b/vendor.tar.zst @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7a719b173b9d2ef5503a400d9bea212002bb01028fabce845cf7323395dbd099 -size 23904391 +oid sha256:5fe22a1a2bcba19835c944bbfae926e3ec7808629d4b4524bcbf9754ca0bce96 +size 25737226