]>
Commit | Line | Data |
---|---|---|
f7861971 | 1 | %define crates_ver 0.8.1 |
4a2626ba | 2 | |
92a8f118 JP |
3 | Summary: A viewer for git and diff output |
4 | Name: delta | |
a0e607b4 | 5 | Version: 0.8.2 |
2cf61d60 | 6 | Release: 1 |
92a8f118 JP |
7 | License: MIT |
8 | Group: Applications | |
9 | Source0: https://github.com/dandavison/delta/archive/%{version}/%{name}-%{version}.tar.gz | |
a0e607b4 | 10 | # Source0-md5: 388c2914941359251dcccf9590ec04c1 |
f2b5808f | 11 | # ./create-crates.sh |
4a2626ba | 12 | Source1: %{name}-crates-%{crates_ver}.tar.xz |
f7861971 | 13 | # Source1-md5: 0e7b2ee7898b9532dd4ad9385ed5ef36 |
92a8f118 JP |
14 | URL: https://github.com/dandavison/delta |
15 | BuildRequires: cargo | |
e38c63a4 JP |
16 | BuildRequires: libgit2-devel >= 1.1.0 |
17 | BuildRequires: pkgconfig | |
a311b6b6 | 18 | BuildRequires: rpmbuild(macros) >= 2.004 |
92a8f118 | 19 | BuildRequires: rust |
c42db62c JP |
20 | BuildRequires: tar >= 1:1.22 |
21 | BuildRequires: xz | |
e38c63a4 | 22 | Requires: libgit2 >= 1.1.0 |
a311b6b6 | 23 | ExclusiveArch: %{rust_arches} |
92a8f118 JP |
24 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
25 | ||
26 | %description | |
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 | |
31 | change. | |
32 | ||
33 | Delta's main features are: | |
34 | ||
35 | - Language syntax highlighting with color themes | |
36 | - Within-line highlights based on a Levenshtein edit inference | |
37 | algorithm | |
38 | - Style (foreground color, background color, font attributes) can be | |
39 | configured independently for more than 20 different sections of the | |
40 | diff | |
41 | - Stylable box/line decorations to draw attention to commit, file and | |
42 | hunk header sections. | |
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 | |
46 | by default). | |
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 | |
49 | diff output. | |
50 | ||
51 | %prep | |
4a2626ba JP |
52 | %setup -q -a1 |
53 | ||
54 | %{__mv} delta-%{crates_ver}/* . | |
55 | sed -i -e 's/@@VERSION@@/%{version}/' Cargo.lock | |
92a8f118 JP |
56 | |
57 | # use our offline registry | |
58 | export CARGO_HOME="$(pwd)/.cargo" | |
59 | ||
60 | mkdir -p "$CARGO_HOME" | |
61 | cat >.cargo/config <<EOF | |
62 | [source.crates-io] | |
63 | registry = 'https://github.com/rust-lang/crates.io-index' | |
64 | replace-with = 'vendored-sources' | |
65 | ||
66 | [source.vendored-sources] | |
67 | directory = '$PWD/vendor' | |
68 | EOF | |
69 | ||
70 | %build | |
71 | export CARGO_HOME="$(pwd)/.cargo" | |
72 | ||
e5a4ca85 | 73 | %cargo_build --frozen |
92a8f118 JP |
74 | |
75 | %install | |
76 | rm -rf $RPM_BUILD_ROOT | |
77 | export CARGO_HOME="$(pwd)/.cargo" | |
78 | ||
e5a4ca85 | 79 | %cargo_install --frozen --root $RPM_BUILD_ROOT%{_prefix} --path $PWD |
92a8f118 JP |
80 | %{__rm} $RPM_BUILD_ROOT%{_prefix}/.crates* |
81 | ||
82 | %clean | |
83 | rm -rf $RPM_BUILD_ROOT | |
84 | ||
85 | %files | |
86 | %defattr(644,root,root,755) | |
87 | %doc README.md | |
88 | %attr(755,root,root) %{_bindir}/delta |