-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdivine.spec
108 lines (82 loc) · 3.3 KB
/
divine.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
%global toolchain clang
Name: divine
Version: 4.4.2_4_gd47985e0b
Release: 13%{?dist}
Summary: Explicit-state model checker
License: ISC License
URL: https://%{name}.fi.muni.cz
Source0: https://%{name}.fi.muni.cz/download/%{name}-%{version}.tar.gz
Source1: divine2csgrep.py
Source2: csexec-divine.sh
Patch0: make_install.patch
Patch1: rpmbuild.patch
# Patches to add missing headers and source files + change paths in divine
Patch2: headers.patch
Patch3: prefix_path.patch
# Patch to rise the testsuite timeout values for Copr builds
Patch4: timeout.patch
# Downstream hotfixes or patches from the next branch
Patch5: hotfix.patch
BuildRequires: python3 perl make cmake ninja-build clang libedit-devel
BuildRequires: ncurses-devel zlib-devel gtest-devel
# optional dependencies
BuildRequires: z3 z3-devel
# if some test fails, gdb is used to gather additional info
BuildRequires: gdb
# 'static-dynamic.sh' test requires a static version of glibc
BuildRequires: glibc-static
# required by 'divine2csgrep'
Requires: python3-pyyaml
# optional dependencies
Requires: python3-pygments z3
%description
TODO
%prep
%autosetup -p1
# use Python 3 explicitly
sed -in 's/python$/python3/' clang/tools/clang-format/clang-format-diff.py
sed -in 's/python$/python3/' clang/tools/clang-format/git-clang-format
sed -in 's/python$/python3/' clang/utils/hmaptool/hmaptool
sed -in 's/python$/python3/' clang/tools/scan-view/bin/scan-view
# use Python 3 instead of 2.7
sed -in 's/env python2.7$/python3/' llvm/tools/opt-viewer/opt-viewer.py
sed -in 's/env python2.7$/python3/' llvm/tools/opt-viewer/opt-stats.py
sed -in 's/env python2.7$/python3/' llvm/tools/opt-viewer/opt-diff.py
sed -in 's/env python2.7$/python3/' llvm/tools/opt-viewer/optrecord.py
sed -in 's/env python2.7$/python3/' llvm/utils/update_llc_test_checks.py
sed -in 's/env python2.7$/python3/' llvm/utils/lit/lit/Test.py
sed -in 's/env python2.7$/python3/' llvm/utils/update_analyze_test_checks.py
sed -in 's/env python2.7$/python3/' llvm/utils/update_test_checks.py
sed -in 's/env python2.7$/python3/' llvm/utils/update_mca_test_checks.py
sed -in 's/env python2.7$/python3/' clang/utils/check_cfc/test_check_cfc.py
sed -in 's/env python2.7$/python3/' clang/utils/check_cfc/check_cfc.py
sed -in 's/env python2.7$/python3/' clang/utils/check_cfc/obj_diff.py
%build
# %%set_build_flags cannot be used as Divine's Clang 7 does not support all the
# requied flags
CC="${CC:-%{__cc}}"
export CC
CXX="${CXX:-%{__cxx}}"
export CXX
make
%install
# skip rpath check for now
export QA_RPATHS=$[ 0x0001 | 0x0010 | 0x0002 ]
%make_install
# create divc++ and diosc++ symlinks (if divcc is invoked as divc++, it should
# automatically link C++ run-time libraries)
ln -sf divcc %{buildroot}/opt/divine/bin/divc++
ln -sf dioscc %{buildroot}/opt/divine/bin/diosc++
# make divine tools available in default $PATH
mkdir -p %{buildroot}%{_bindir}
ln -sf /opt/divine/bin/{diosc{c,++},divc{c,++},divine,lart} \
%{buildroot}%{_bindir}
# install divine2grep and csexec-divine.sh as an executable in path
install -p -D -m 755 %{SOURCE1} %{buildroot}%{_bindir}/divine2csgrep
install -p -D -m 755 %{SOURCE2} %{buildroot}%{_bindir}/csexec-divine
%check
make unit
# make functional
%files
/opt/divine/
%{_bindir}/*