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