]> git.pld-linux.org Git - packages/delta.git/blob - delta.spec
up to 0.6.0
[packages/delta.git] / delta.spec
1 %define         crates_ver      0.6.0
2
3 Summary:        A viewer for git and diff output
4 Name:           delta
5 Version:        0.6.0
6 Release:        1
7 License:        MIT
8 Group:          Applications
9 Source0:        https://github.com/dandavison/delta/archive/%{version}/%{name}-%{version}.tar.gz
10 # Source0-md5:  34aa67d3a8caee4772c99d7752d21171
11 # ./create-crates.sh
12 Source1:        %{name}-crates-%{crates_ver}.tar.xz
13 # Source1-md5:  c4793b562c3e5d49ec09744274baab3e
14 URL:            https://github.com/dandavison/delta
15 BuildRequires:  cargo
16 BuildRequires:  rust
17 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
18
19 %description
20 Delta aims to make studying diffs both efficient and enjoyable: it
21 allows you to make extensive changes to the layout and styling of
22 diffs, as well as allowing you to stay arbitrarily close to the
23 default git/diff output, changing just the aspects that you want to
24 change.
25
26 Delta'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
45 %setup -q -a1
46
47 %{__mv} delta-%{crates_ver}/* .
48 sed -i -e 's/@@VERSION@@/%{version}/' Cargo.lock
49
50 # use our offline registry
51 export CARGO_HOME="$(pwd)/.cargo"
52
53 mkdir -p "$CARGO_HOME"
54 cat >.cargo/config <<EOF
55 [source.crates-io]
56 registry = 'https://github.com/rust-lang/crates.io-index'
57 replace-with = 'vendored-sources'
58
59 [source.vendored-sources]
60 directory = '$PWD/vendor'
61 EOF
62
63 %build
64 export CARGO_HOME="$(pwd)/.cargo"
65
66 cargo -v build --release --frozen
67
68 %install
69 rm -rf $RPM_BUILD_ROOT
70 export CARGO_HOME="$(pwd)/.cargo"
71
72 cargo -v install --frozen --root $RPM_BUILD_ROOT%{_prefix} --path $PWD
73 %{__rm} $RPM_BUILD_ROOT%{_prefix}/.crates*
74
75 %clean
76 rm -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.050423 seconds and 3 git commands to generate.