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