1 %define crates_ver 0.8.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: 91dfb57b81caeb1d2a5b79879ba991ee
12 Source1: %{name}-crates-%{crates_ver}.tar.xz
13 # Source1-md5: 5383876724e630e92d3ef9dfa75901be
14 URL: https://github.com/dandavison/delta
16 BuildRequires: libgit2-devel >= 1.1.0
17 BuildRequires: pkgconfig
18 BuildRequires: rpmbuild(macros) >= 2.004
20 BuildRequires: tar >= 1:1.22
22 Requires: libgit2 >= 1.1.0
23 ExclusiveArch: %{rust_arches}
24 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27 Delta aims to make studying diffs both efficient and enjoyable: it
28 allows you to make extensive changes to the layout and styling of
29 diffs, as well as allowing you to stay arbitrarily close to the
30 default git/diff output, changing just the aspects that you want to
33 Delta's main features are:
35 - Language syntax highlighting with color themes
36 - Within-line highlights based on a Levenshtein edit inference
38 - Style (foreground color, background color, font attributes) can be
39 configured independently for more than 20 different sections of the
41 - Stylable box/line decorations to draw attention to commit, file and
43 - Line numbering (`-n`)
44 - `--diff-highlight` and `--diff-so-fancy` emulation modes
45 - Code can be copied directly from the diff (`-/+` markers are removed
47 - `n` and `N` keybindings to move between files in large diffs, and
48 between diffs in `log -p` views (`--navigate`) A viewer for git and
54 %{__mv} delta-%{crates_ver}/* .
55 sed -i -e 's/@@VERSION@@/%{version}/' Cargo.lock
57 # use our offline registry
58 export CARGO_HOME="$(pwd)/.cargo"
60 mkdir -p "$CARGO_HOME"
61 cat >.cargo/config <<EOF
63 registry = 'https://github.com/rust-lang/crates.io-index'
64 replace-with = 'vendored-sources'
66 [source.vendored-sources]
67 directory = '$PWD/vendor'
71 export CARGO_HOME="$(pwd)/.cargo"
76 rm -rf $RPM_BUILD_ROOT
77 export CARGO_HOME="$(pwd)/.cargo"
79 %cargo_install --frozen --root $RPM_BUILD_ROOT%{_prefix} --path $PWD
80 %{__rm} $RPM_BUILD_ROOT%{_prefix}/.crates*
83 rm -rf $RPM_BUILD_ROOT
86 %defattr(644,root,root,755)
88 %attr(755,root,root) %{_bindir}/delta