]> git.pld-linux.org Git - packages/delta.git/blame - delta.spec
up to 0.17.0
[packages/delta.git] / delta.spec
CommitLineData
c8b6b30d
JP
1#
2# Conditional build:
3%bcond_without system_libgit2 # use system installed libgit2
4
2b4de7b7 5%define crates_ver 0.17.0
4a2626ba 6
92a8f118
JP
7Summary: A viewer for git and diff output
8Name: delta
2b4de7b7
JP
9Version: 0.17.0
10Release: 1
92a8f118
JP
11License: MIT
12Group: Applications
13Source0: https://github.com/dandavison/delta/archive/%{version}/%{name}-%{version}.tar.gz
2b4de7b7 14# Source0-md5: 323ef94cc3d9c0b21691ecc5e250708f
4a2626ba 15Source1: %{name}-crates-%{crates_ver}.tar.xz
2b4de7b7 16# Source1-md5: c32b2651ccef34736929edaca477a269
92a8f118
JP
17URL: https://github.com/dandavison/delta
18BuildRequires: cargo
c8b6b30d 19%if %{with system_libgit2}
2b4de7b7
JP
20BuildRequires: libgit2-devel < 1.8.0
21BuildRequires: libgit2-devel >= 1.7.2
c8b6b30d 22%endif
2b4de7b7 23BuildRequires: oniguruma-devel >= 6.9.8
e38c63a4 24BuildRequires: pkgconfig
a311b6b6 25BuildRequires: rpmbuild(macros) >= 2.004
92a8f118 26BuildRequires: rust
5efbe121 27BuildRequires: rust-bindgen
c42db62c
JP
28BuildRequires: tar >= 1:1.22
29BuildRequires: xz
2b4de7b7
JP
30%{?with_system_libgit2:Requires: libgit2 >= 1.7.2}
31Requires: oniguruma >= 6.9.8
a311b6b6 32ExclusiveArch: %{rust_arches}
92a8f118
JP
33BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34
35%description
36Delta aims to make studying diffs both efficient and enjoyable: it
37allows you to make extensive changes to the layout and styling of
38diffs, as well as allowing you to stay arbitrarily close to the
39default git/diff output, changing just the aspects that you want to
40change.
41
42Delta's main features are:
43
44- Language syntax highlighting with color themes
45- Within-line highlights based on a Levenshtein edit inference
46 algorithm
47- Style (foreground color, background color, font attributes) can be
48 configured independently for more than 20 different sections of the
49 diff
50- Stylable box/line decorations to draw attention to commit, file and
51 hunk header sections.
52- Line numbering (`-n`)
53- `--diff-highlight` and `--diff-so-fancy` emulation modes
54- Code can be copied directly from the diff (`-/+` markers are removed
55 by default).
56- `n` and `N` keybindings to move between files in large diffs, and
57 between diffs in `log -p` views (`--navigate`) A viewer for git and
58 diff output.
59
60%prep
4a2626ba
JP
61%setup -q -a1
62
63%{__mv} delta-%{crates_ver}/* .
64sed -i -e 's/@@VERSION@@/%{version}/' Cargo.lock
92a8f118
JP
65
66# use our offline registry
67export CARGO_HOME="$(pwd)/.cargo"
68
69mkdir -p "$CARGO_HOME"
70cat >.cargo/config <<EOF
71[source.crates-io]
72registry = 'https://github.com/rust-lang/crates.io-index'
73replace-with = 'vendored-sources'
74
75[source.vendored-sources]
76directory = '$PWD/vendor'
77EOF
78
79%build
80export CARGO_HOME="$(pwd)/.cargo"
52f29b20 81export RUSTONIG_SYSTEM_LIBONIG=true
92a8f118 82
e5a4ca85 83%cargo_build --frozen
92a8f118
JP
84
85%install
86rm -rf $RPM_BUILD_ROOT
87export CARGO_HOME="$(pwd)/.cargo"
88
780dd575 89export RUSTONIG_SYSTEM_LIBONIG=true
e5a4ca85 90%cargo_install --frozen --root $RPM_BUILD_ROOT%{_prefix} --path $PWD
92a8f118
JP
91%{__rm} $RPM_BUILD_ROOT%{_prefix}/.crates*
92
93%clean
94rm -rf $RPM_BUILD_ROOT
95
96%files
97%defattr(644,root,root,755)
98%doc README.md
99%attr(755,root,root) %{_bindir}/delta
This page took 0.292892 seconds and 5 git commands to generate.