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