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