1 %define crates_ver 0.14.0
3 Summary: A viewer for git and diff output
9 Source0: https://github.com/dandavison/delta/archive/%{version}/%{name}-%{version}.tar.gz
10 # Source0-md5: 08b42a61cfad8fa9ffab4ef4a5acf1fc
11 Source1: %{name}-crates-%{crates_ver}.tar.xz
12 # Source1-md5: 0ed34d114e7d7c0f57f09c712344f675
13 URL: https://github.com/dandavison/delta
15 BuildRequires: libgit2-devel >= 1.4.0
16 BuildRequires: oniguruma-devel >= 6.9.3
17 BuildRequires: pkgconfig
18 BuildRequires: rpmbuild(macros) >= 2.004
20 BuildRequires: tar >= 1:1.22
22 Requires: libgit2 >= 1.4.0
23 Requires: oniguruma >= 6.9.3
24 ExclusiveArch: %{rust_arches}
25 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28 Delta aims to make studying diffs both efficient and enjoyable: it
29 allows you to make extensive changes to the layout and styling of
30 diffs, as well as allowing you to stay arbitrarily close to the
31 default git/diff output, changing just the aspects that you want to
34 Delta's main features are:
36 - Language syntax highlighting with color themes
37 - Within-line highlights based on a Levenshtein edit inference
39 - Style (foreground color, background color, font attributes) can be
40 configured independently for more than 20 different sections of the
42 - Stylable box/line decorations to draw attention to commit, file and
44 - Line numbering (`-n`)
45 - `--diff-highlight` and `--diff-so-fancy` emulation modes
46 - Code can be copied directly from the diff (`-/+` markers are removed
48 - `n` and `N` keybindings to move between files in large diffs, and
49 between diffs in `log -p` views (`--navigate`) A viewer for git and
55 %{__mv} delta-%{crates_ver}/* .
56 sed -i -e 's/@@VERSION@@/%{version}/' Cargo.lock
58 # use our offline registry
59 export CARGO_HOME="$(pwd)/.cargo"
61 mkdir -p "$CARGO_HOME"
62 cat >.cargo/config <<EOF
64 registry = 'https://github.com/rust-lang/crates.io-index'
65 replace-with = 'vendored-sources'
67 [source.vendored-sources]
68 directory = '$PWD/vendor'
72 export CARGO_HOME="$(pwd)/.cargo"
73 export RUSTONIG_SYSTEM_LIBONIG=true
78 rm -rf $RPM_BUILD_ROOT
79 export CARGO_HOME="$(pwd)/.cargo"
81 %cargo_install --frozen --root $RPM_BUILD_ROOT%{_prefix} --path $PWD
82 %{__rm} $RPM_BUILD_ROOT%{_prefix}/.crates*
85 rm -rf $RPM_BUILD_ROOT
88 %defattr(644,root,root,755)
90 %attr(755,root,root) %{_bindir}/delta