]>
Commit | Line | Data |
---|---|---|
92a8f118 JP |
1 | Summary: A viewer for git and diff output |
2 | Name: delta | |
0e378336 | 3 | Version: 0.5.0 |
92a8f118 JP |
4 | Release: 1 |
5 | License: MIT | |
6 | Group: Applications | |
7 | Source0: https://github.com/dandavison/delta/archive/%{version}/%{name}-%{version}.tar.gz | |
0e378336 | 8 | # Source0-md5: d75f73bc71407b86489eff88f837274d |
f2b5808f | 9 | # ./create-crates.sh |
92a8f118 | 10 | Source1: %{name}-crates-%{version}.tar.xz |
0e378336 | 11 | # Source1-md5: 55f896f9511f16f17d8d209d903904f1 |
92a8f118 JP |
12 | URL: https://github.com/dandavison/delta |
13 | BuildRequires: cargo | |
14 | BuildRequires: rust | |
15 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
16 | ||
17 | %description | |
18 | Delta aims to make studying diffs both efficient and enjoyable: it | |
19 | allows you to make extensive changes to the layout and styling of | |
20 | diffs, as well as allowing you to stay arbitrarily close to the | |
21 | default git/diff output, changing just the aspects that you want to | |
22 | change. | |
23 | ||
24 | Delta's main features are: | |
25 | ||
26 | - Language syntax highlighting with color themes | |
27 | - Within-line highlights based on a Levenshtein edit inference | |
28 | algorithm | |
29 | - Style (foreground color, background color, font attributes) can be | |
30 | configured independently for more than 20 different sections of the | |
31 | diff | |
32 | - Stylable box/line decorations to draw attention to commit, file and | |
33 | hunk header sections. | |
34 | - Line numbering (`-n`) | |
35 | - `--diff-highlight` and `--diff-so-fancy` emulation modes | |
36 | - Code can be copied directly from the diff (`-/+` markers are removed | |
37 | by default). | |
38 | - `n` and `N` keybindings to move between files in large diffs, and | |
39 | between diffs in `log -p` views (`--navigate`) A viewer for git and | |
40 | diff output. | |
41 | ||
42 | %prep | |
43 | %setup -q -b1 | |
44 | ||
45 | # use our offline registry | |
46 | export CARGO_HOME="$(pwd)/.cargo" | |
47 | ||
48 | mkdir -p "$CARGO_HOME" | |
49 | cat >.cargo/config <<EOF | |
50 | [source.crates-io] | |
51 | registry = 'https://github.com/rust-lang/crates.io-index' | |
52 | replace-with = 'vendored-sources' | |
53 | ||
54 | [source.vendored-sources] | |
55 | directory = '$PWD/vendor' | |
56 | EOF | |
57 | ||
58 | %build | |
59 | export CARGO_HOME="$(pwd)/.cargo" | |
60 | ||
61 | cargo -v build --release --frozen | |
62 | ||
63 | %install | |
64 | rm -rf $RPM_BUILD_ROOT | |
65 | export CARGO_HOME="$(pwd)/.cargo" | |
66 | ||
67 | cargo -v install --frozen --root $RPM_BUILD_ROOT%{_prefix} --path $PWD | |
68 | %{__rm} $RPM_BUILD_ROOT%{_prefix}/.crates* | |
69 | ||
70 | %clean | |
71 | rm -rf $RPM_BUILD_ROOT | |
72 | ||
73 | %files | |
74 | %defattr(644,root,root,755) | |
75 | %doc README.md | |
76 | %attr(755,root,root) %{_bindir}/delta |