]> TLD Linux GIT Repositories - packages/llvm.git/blob - llvm.spec
- updated to 8.0.1
[packages/llvm.git] / llvm.spec
1 #
2 # NOTE:
3 #  - normal build (x86_64) requires about 80 GB of disk space
4 #
5 # TODO:
6 # - move and package:
7 #       %{_datadir}/clang/bash-autocomplete.sh
8 #       %{_datadir}/clang/clang-format-sublime.py - sublime plugin
9 #       %{_datadir}/clang/clang-format.el - clang tools emacs integration
10 #       %{_datadir}/clang/clang-include-fixer.el
11 #       %{_datadir}/clang/clang-rename.el
12 # - no content in doc package (it used to contain parts of clang apidocs and some examples)
13 # - system isl in polly?
14 #
15 # Conditional build:
16 %bcond_without  lldb            # LLDB debugger
17 %bcond_without  polly           # Polly cache-locality optimization, auto-parallelism and vectorization
18 %bcond_without  rt              # compiler-rt libraries
19 %bcond_without  multilib        # compiler-rt multilib libraries
20 %bcond_with     ocaml           # OCaml binding
21 %bcond_without  doc             # HTML docs and man pages
22 %bcond_with     apidocs         # doxygen docs (HUGE, so they are not built by default)
23 %bcond_with     tests           # run tests
24
25 # No ocaml on other arches or no native ocaml (required for ocaml-ctypes)
26 %ifnarch %{ix86} %{x8664} %{arm} aarch64 ppc sparc sparcv9
27 %undefine       with_ocaml
28 %endif
29
30 Summary:        The Low Level Virtual Machine (An Optimizing Compiler Infrastructure)
31 Summary(pl.UTF-8):      Niskopoziomowa maszyna wirtualna (infrastruktura kompilatora optymalizującego)
32 Name:           llvm
33 Version:        8.0.1
34 Release:        1
35 License:        University of Illinois/NCSA Open Source License
36 Group:          Development/Languages
37 #Source0Download: http://releases.llvm.org/download.html
38 Source0:        https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/llvm-%{version}.src.tar.xz
39 # Source0-md5:  9a3b63df01c52556f7afb5617934e79e
40 Source1:        https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/cfe-%{version}.src.tar.xz
41 # Source1-md5:  28db72b57ca99307259773e4ac74a6d3
42 Source2:        https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/compiler-rt-%{version}.src.tar.xz
43 # Source2-md5:  c251e582862f9fcc880802f8f2920096
44 Source3:        https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/lldb-%{version}.src.tar.xz
45 # Source3-md5:  c2777536fe0d4151c6aa30773f51af20
46 Source4:        https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/polly-%{version}.src.tar.xz
47 # Source4-md5:  1ef3f82d49d0fb00fa92ce6e1b095da1
48 Source5:        https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/clang-tools-extra-%{version}.src.tar.xz
49 # Source5-md5:  b7c55438f792a1d5698696100a8731e0
50 Source6:        https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/lld-%{version}.src.tar.xz
51 # Source6-md5:  ee4fe10c625bbc66b1055c5d33017daf
52 Patch1:         %{name}-tld.patch
53 Patch3:         x32-gcc-toolchain.patch
54 Patch4:         cmake-buildtype.patch
55 Patch5:         %{name}-ocaml-shared.patch
56 URL:            http://llvm.org/
57 BuildRequires:  bash
58 BuildRequires:  bison
59 BuildRequires:  cmake >= 3.4.3
60 BuildRequires:  flex
61 BuildRequires:  gcc >= 5:3.4
62 # gcc4 might be installed, but not current __cc
63 %if "%(echo %{cc_version} | cut -d. -f1,2)" < "3.4"
64 BuildRequires:  __cc >= 3.4
65 %endif
66 BuildRequires:  groff
67 BuildRequires:  libedit-devel
68 BuildRequires:  libltdl-devel
69 BuildRequires:  libstdc++-devel >= 5:3.4
70 BuildRequires:  ncurses-devel
71 %if %{with ocaml}
72 BuildRequires:  ocaml >= 4.00.0
73 BuildRequires:  ocaml-ctypes-devel >= 0.4
74 BuildRequires:  ocaml-findlib
75 BuildRequires:  ocaml-ocamldoc
76 BuildRequires:  ocaml-ounit >= 2
77 %endif
78 BuildRequires:  perl-base >= 1:5.6
79 BuildRequires:  perl-tools-pod
80 BuildRequires:  python >= 1:2.7
81 BuildRequires:  rpm >= 4.5-87
82 BuildRequires:  rpm-pythonprov
83 BuildRequires:  rpmbuild(macros) >= 1.734
84 %{?with_doc:BuildRequires:      sphinx-pdg}
85 BuildRequires:  tar >= 1:1.22
86 BuildRequires:  xz
87 BuildRequires:  zlib-devel
88 %if %{with apidocs}
89 BuildRequires:  doxygen
90 BuildRequires:  graphviz
91 %endif
92 %if %{with tests}
93 BuildRequires:  dejagnu
94 BuildRequires:  tcl-devel
95 %endif
96 %if %{with rt} && %{with multilib}
97 %ifarch %{x8664}
98 BuildRequires:  gcc-c++-multilib
99 BuildRequires:  libstdc++-multilib-devel
100 %endif
101 %ifarch x32
102 BuildRequires:  gcc-c++-multilib
103 BuildRequires:  glibc-devel(x86_64)
104 BuildRequires:  libstdc++-multilib-devel
105 %endif
106 %endif
107 %if %{with lldb}
108 BuildRequires:  epydoc
109 %ifarch i386 i486
110 BuildRequires:  libatomic-devel
111 %endif
112 BuildRequires:  libxml2-devel >= 2
113 BuildRequires:  ncurses-ext-devel
114 BuildRequires:  python-devel >= 2
115 BuildRequires:  swig-python >= 3.0.11
116 %endif
117 %if %{with polly}
118 #BuildRequires: gmp-devel or imath-devel (private copy in polly/lib/External/isl/imath)
119 # private copy in polly/lib/External/isl
120 #BuildRequires: isl-devel >= 0.18
121 #TODO (bcond): cuda-devel (with POLLY_ENABLE_GPGPU_CODEGEN=ON)
122 %endif
123 %if %{with ocaml}
124 BuildConflicts: llvm-ocaml
125 %endif
126 Requires:       %{name}-libs = %{version}-%{release}
127 # LLVM is not supported on PPC64
128 # http://llvm.org/bugs/show_bug.cgi?id=3729
129 ExcludeArch:    ppc64
130 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
131
132 %define         abi     8
133 %define         _sysconfdir     /etc/%{name}
134
135 %define         specflags_ppc   -fno-var-tracking-assignments
136 # ix86 and x32 - the same issue as https://llvm.org/bugs/show_bug.cgi?id=27237
137 # use -gsplit-dwarf only when building packages with debuginfo
138 # to avoid excessive disk space usage
139 %if 0%{?_enable_debug_packages}
140 %define         specflags       -gsplit-dwarf
141 %endif
142
143 # strip corrupts: $RPM_BUILD_ROOT/usr/lib64/llvm-gcc/bin/llvm-c++ ...
144 %define         _noautostrip    .*/\\(libmud.*\\.a\\|bin/llvm-.*\\|lib.*++\\.a\\)
145
146 # clang doesn't know -fvar-tracking-assignments, and leaving it here would pollute llvm-config
147 # -Werror=format-security is for swig
148 # TODO: add - -Werror=format-security to tools/lldb/scripts/LLDBWrapPython.cpp
149 %define         filterout_c     -fvar-tracking-assignments
150 %define         filterout_cxx   -fvar-tracking-assignments -Werror=format-security
151 %define         filterout_ccpp  -fvar-tracking-assignments
152
153 %description
154 LLVM is a compiler infrastructure designed for compile-time,
155 link-time, runtime, and idle-time optimization of programs from
156 arbitrary programming languages. LLVM is written in C++ and has been
157 developed since 2000 at the University of Illinois and Apple. It
158 currently supports compilation of C and C++ programs using clang
159 frontend.
160
161 %description -l pl.UTF-8
162 LLVM to infrastruktura kompilatora zaprojektowana do optymalizacji
163 czasu kompilowania, linkowania, działania i bezczynności programów w
164 dowolnych językach programowania. Jest napisana w C++, rozwijana od
165 roku 2000 przez Uniwersytet w Illinois i Apple. Aktualnie obsługuje
166 kompilację programów w C i C++ przy użyciu frontendu clang.
167
168 %package libs
169 Summary:        LLVM shared libraries
170 Summary(pl.UTF-8):      Biblioteki współdzielone LLVM-a
171 Group:          Libraries
172 Conflicts:      llvm < 3.2
173
174 %description libs
175 LLVM shared libraries.
176
177 %description libs -l pl.UTF-8
178 Biblioteki współdzielone LLVM-a.
179
180 %package devel
181 Summary:        Static libraries and header files for LLVM
182 Summary(pl.UTF-8):      Biblioteki statyczne i pliki nagłówkowe dla LLVM-a
183 Group:          Development/Languages
184 Requires:       %{name}-libs = %{version}-%{release}
185 Requires:       libstdc++-devel >= 6:3.4
186
187 %description devel
188 This package contains static libraries and header files needed to
189 develop new native programs that use the LLVM infrastructure.
190
191 %description devel -l pl.UTF-8
192 Ten pakiet zawiera biblioteki statyczne oraz pliki nagłówkowe
193 potrzebne do tworzenia nowych programów natywnych wykorzystujących
194 infrastrukturę LLVM.
195
196 %package doc
197 Summary:        Documentation for LLVM
198 Summary(pl.UTF-8):      Dokumentacja do LLVM-a
199 Group:          Documentation
200 # does not require base
201
202 %description doc
203 Documentation for the LLVM compiler infrastructure.
204
205 %description doc -l pl.UTF-8
206 Dokumentacja do infrastruktury kompilatorów LLVM.
207
208 %package apidocs
209 Summary:        API documentation for LLVM
210 Summary(pl.UTF-8):      Dokumentacja API LLVM-a
211 Group:          Development/Languages
212 Requires:       %{name}-doc = %{version}-%{release}
213
214 %description apidocs
215 API documentation for the LLVM compiler infrastructure.
216
217 %description apidocs -l pl.UTF-8
218 Dokumentacja API infrastruktury kompilatorów LLVM.
219
220 %package polly
221 Summary:        Polyhedral optimizations for LLVM
222 Summary(pl.UTF-8):      Optymalizacje wielościanowe dla LLVM-a
223 Group:          Development/Tools
224 URL:            http://polly.llvm.org/
225 Requires:       %{name} = %{version}-%{release}
226
227 %description polly
228 Polly is a high-level loop and data-locality optimizer and
229 optimization infrastructure for LLVM. It uses an abstract mathematical
230 representation based on integer polyhedra to analyze and optimize the
231 memory access pattern of a program.
232
233 %description polly -l pl.UTF-8
234 Polly to wysokopoziomowy optymalizator i infrastruktura LLVM-a do
235 optymalizacji pętli i położenia danych. Wykorzystuje abstrakcyjną
236 reprezentację matematyczną opartą na wielościanach całkowitoliczbowych
237 do analizy i optymalizacji wzorców dostępu do pamięci przez program.
238
239 %package polly-devel
240 Summary:        Header files for LLVM Polly optimization infrastructure
241 Summary(pl.UTF-8):      Pliki nagłówkowe infrastruktury optymalizacji LLVM-a Polly
242 Group:          Development/Libraries
243 URL:            http://polly.llvm.org/
244 Requires:       %{name}-devel = %{version}-%{release}
245 Requires:       %{name}-polly = %{version}-%{release}
246
247 %description polly-devel
248 Header files for LLVM Polly optimization infrastructure.
249
250 %description polly-devel -l pl.UTF-8
251 Pliki nagłówkowe infrastruktury optymalizacji LLVM-a Polly.
252
253 %package -n clang
254 Summary:        A C language family frontend for LLVM
255 Summary(pl.UTF-8):      Frontend LLVM-a do języków z rodziny C
256 License:        NCSA
257 Group:          Development/Languages
258 Requires:       %{name} = %{version}-%{release}
259 Requires:       clang-libs = %{version}-%{release}
260
261 %description -n clang
262 clang: noun 1. A loud, resonant, metallic sound. 2. The strident call
263 of a crane or goose. 3. C-language family front-end toolkit.
264
265 The goal of the Clang project is to create a new C, C++, Objective C
266 and Objective C++ front-end for the LLVM compiler. Its tools are built
267 as libraries and designed to be loosely-coupled and extendable.
268
269 %description -n clang -l pl.UTF-8
270 clang (z angielskiego): 1. głośny, rezonujący, metaliczny dźwięk; 2.
271 piskliwy odgłos żurawia lub gęsi; 3. narzędzia frontendowe dla języków
272 z rodziny C.
273
274 Celem projektu Clang jest utworzenie nowego frontendu dla kompilatora
275 LLVM do języków C, C++, Objective C i Objective C++. Narzędzia są
276 budowane jako biblioteki i zaprojektowane z myślą o swobodnym łączeniu
277 i rozszerzaniu.
278
279 %package -n clang-libs
280 Summary:        Clang shared libraries
281 Summary(pl.UTF-8):      Biblioteki współdzielone Clanga
282 Group:          Libraries
283
284 %description -n clang-libs
285 Clang shared libraries.
286
287 %description -n clang-libs -l pl.UTF-8
288 Biblioteki współdzielone Clanga.
289
290 %package -n clang-multilib
291 Summary:        A C language family frontend for LLVM - 32-bit support
292 Summary(pl.UTF-8):      Frontend LLVM-a do języków z rodziny C - obsługa binariów 32-bitowych
293 License:        NCSA
294 Group:          Development/Languages
295 Requires:       clang = %{version}-%{release}
296
297 %description -n clang-multilib
298 clang: noun 1. A loud, resonant, metallic sound. 2. The strident call
299 of a crane or goose. 3. C-language family front-end toolkit.
300
301 The goal of the Clang project is to create a new C, C++, Objective C
302 and Objective C++ front-end for the LLVM compiler. Its tools are built
303 as libraries and designed to be loosely-coupled and extendable.
304
305 This package contains the C compiler support for producing 32-bit
306 programs on 64-bit host.
307
308 %description -n clang-multilib -l pl.UTF-8
309 clang (z angielskiego): 1. głośny, rezonujący, metaliczny dźwięk; 2.
310 piskliwy odgłos żurawia lub gęsi; 3. narzędzia frontendowe dla języków
311 z rodziny C.
312
313 Celem projektu Clang jest utworzenie nowego frontendu dla kompilatora
314 LLVM do języków C, C++, Objective C i Objective C++. Narzędzia są
315 budowane jako biblioteki i zaprojektowane z myślą o swobodnym łączeniu
316 i rozszerzaniu.
317
318 Ten pakiet zawiera rozszerzenie kompilatora C o obsługę tworzenia
319 programów 32-bitowych na maszynie 64-bitowej.
320
321 %package -n clang-analyzer
322 Summary:        A source code analysis framework
323 Summary(pl.UTF-8):      Szkielet do analizy kodu źródłowego
324 License:        NCSA
325 Group:          Development/Languages
326 Requires:       clang = %{version}-%{release}
327 # not picked up automatically since files are currently not instaled
328 # in standard Python hierarchies yet
329 Requires:       python
330
331 %description -n clang-analyzer
332 The Clang Static Analyzer consists of both a source code analysis
333 framework and a standalone tool that finds bugs in C and Objective-C
334 programs. The standalone tool is invoked from the command-line, and is
335 intended to run in tandem with a build of a project or code base.
336
337 %description -n clang-analyzer -l pl.UTF-8
338 Clang Static Analyzer składa się ze szkieletu do analizy kodu
339 źródłowego oraz samodzielnego narzędzia znajdującego błędy w
340 programach w C i C++. Narzędzie jest wywoływane z linii poleceń, z
341 myślą o uruchamianiu wraz z kompilacją projektu lub kodu.
342
343 %package -n clang-devel
344 Summary:        Header files for Clang
345 Summary(pl.UTF-8):      Pliki nagłówkowe Clanga
346 Group:          Development/Languages
347 Requires:       %{name}-devel = %{version}-%{release}
348 Requires:       clang = %{version}-%{release}
349
350 %description -n clang-devel
351 This package contains header files for the Clang compiler.
352
353 %description -n clang-devel -l pl.UTF-8
354 Ten pakiet zawiera pliki nagłówkowe kompilatora Clang.
355
356 %package -n clang-doc
357 Summary:        Documentation for Clang
358 Summary(pl.UTF-8):      Dokumentacja do Clanga
359 Group:          Documentation
360 Requires:       %{name} = %{version}-%{release}
361
362 %description -n clang-doc
363 Documentation for the Clang compiler front-end.
364
365 %description -n clang-doc -l pl.UTF-8
366 Dokumentacja do frontendu kompilatora Clang.
367
368 %package -n clang-apidocs
369 Summary:        API documentation for Clang
370 Summary(pl.UTF-8):      Dokumentacja API Clanga
371 Group:          Development/Languages
372 Requires:       clang-doc = %{version}-%{release}
373
374 %description -n clang-apidocs
375 API documentation for the Clang compiler.
376
377 %description -n clang-apidocs -l pl.UTF-8
378 Dokumentacja API kompilatora Clang.
379
380 %package -n clang-tools-extra
381 Summary:        Extra tools for Clang
382 Summary(pl.UTF-8):      Dodatkowe narzędzia do kompilatora Clang
383 Group:          Development/Tools
384 URL:            http://clang.llvm.org/docs/ClangTools.html
385 Requires:       clang = %{version}-%{release}
386
387 %description -n clang-tools-extra
388 Extra tools for Clang.
389
390 %description -n clang-tools-extra -l pl.UTF-8
391 Dodatkowe narzędzia do kompilatora Clang.
392
393 %package -n lld
394 Summary:        The LLVM linker
395 Summary(pl.UTF-8):      Konsolidator z projektu LLVM
396 Group:          Development/Libraries
397 URL:            http://lld.llvm.org/
398 Requires:       %{name} = %{version}-%{release}
399
400 %description -n lld
401 lld is a new set of modular code for creating linker tools.
402
403 %description -n lld -l pl.UTF-8
404 lld to nowy zbiór modularnego kodu do tworzenia narzędzi
405 konsolidujących.
406
407 %package -n lld-devel
408 Summary:        Development files for LLD linker tools
409 Summary(pl.UTF-8):      Pliki programistyczne narzędzi konsolidujących LLD
410 Group:          Development/Tools
411 URL:            http://lld.llvm.org/
412 Requires:       %{name}-devel = %{version}-%{release}
413
414 %description -n lld-devel
415 Development files for LLD linker tools.
416
417 %description -n lld-devel -l pl.UTF-8
418 Pliki programistyczne narzędzi konsolidujących LLD.
419
420 %package -n lldb
421 Summary:        Next generation high-performance debugger
422 Summary(pl.UTF-8):      Wydajny debugger nowej generacji
423 Group:          Development/Debuggers
424 URL:            http://lldb.llvm.org/
425 Requires:       %{name} = %{version}-%{release}
426 Requires:       python-six
427
428 %description -n lldb
429 LLDB is a next generation, high-performance debugger. It is built as a
430 set of reusable components which highly leverage existing libraries in
431 the larger LLVM Project, such as the Clang expression parser and LLVM
432 disassembler.
433
434 %description -n lldb -l pl.UTF-8
435 LLDB to wydajny debugger nowej generacji. Jest zbudowany w oparciu o
436 komponenty wielokrotnego użytku, wykorzystujące istniejące biblioteki
437 w projekcie LLVM, takie jak analizator wyrażeń kompilatora Clang oraz
438 disasembler LLVM.
439
440 %package -n lldb-devel
441 Summary:        Development files for LLDB debugger
442 Summary(pl.UTF-8):      Pliki programistyczne debuggera LLDB
443 Group:          Development/Libraries
444 URL:            http://lldb.llvm.org/
445 Requires:       %{name}-devel = %{version}-%{release}
446 Requires:       clang-devel = %{version}-%{release}
447 Requires:       lldb = %{version}-%{release}
448
449 %description -n lldb-devel
450 Development files for LLDB debugger.
451
452 %description -n lldb-devel -l pl.UTF-8
453 Pliki programistyczne debuggera LLDB.
454
455 %package ocaml
456 Summary:        OCaml binding for LLVM
457 Summary(pl.UTF-8):      Wiązanie OCamla do LLVM-a
458 Group:          Libraries
459 Requires:       %{name} = %{version}-%{release}
460 %if %{with ocaml}
461 %requires_eq    ocaml-runtime
462 %endif
463
464 %description ocaml
465 OCaml binding for LLVM.
466
467 %description ocaml -l pl.UTF-8
468 Wiązanie OCamla do LLVM-a.
469
470 %package ocaml-devel
471 Summary:        Development files for LLVM OCaml binding
472 Summary(pl.UTF-8):      Pliki programistyczne wiązania OCamla do LLVM-a
473 Group:          Development/Libraries
474 Requires:       %{name}-devel = %{version}-%{release}
475 Requires:       %{name}-ocaml = %{version}-%{release}
476
477 %description ocaml-devel
478 The llvm-ocaml-devel package contains libraries and signature files
479 for developing applications that use llvm-ocaml binding.
480
481 %description ocaml-devel -l pl.UTF-8
482 Ten pakiet zawiera biblioteki i pliki sygnatur do tworzenia aplikacji
483 wykorzystujących wiązanie llvm-ocaml.
484
485 %package ocaml-doc
486 Summary:        Documentation for LLVM's OCaml binding
487 Summary(pl.UTF-8):      Dokumentacja wiązania OCamla do LLVM-a
488 Group:          Documentation
489 Requires:       %{name}-ocaml = %{version}-%{release}
490
491 %description ocaml-doc
492 HTML documentation for LLVM's OCaml binding.
493
494 %description ocaml-doc -l pl.UTF-8
495 Dokumentacja HTML wiązania OCamla do LLVM-a.
496
497 %package opt-viewer
498 Summary:        Optimization records visualization tools
499 Summary(pl.UTF-8):      Narzędzia do wizualizacji rekordów optymalizacji
500 Group:          Development/Tools
501 Requires:       %{name} = %{version}
502 BuildArch:      noarch
503
504 %description opt-viewer
505 Optimization records visualization tools.
506
507 %description opt-viewer -l pl.UTF-8
508 Narzędzia do wizualizacji rekordów optymalizacji.
509
510 %package -n vim-plugin-clang
511 Summary:        Clang format and rename integration for Vim
512 Summary(pl.UTF-8):      Integracja narzędzi Clang do formatowania i zmiany nazw z Vimem
513 Group:          Applications/Editors/Vim
514 Requires:       vim-rt >= 4:7.0
515 BuildArch:      noarch
516
517 %description -n vim-plugin-clang
518 Clang format and rename integration for Vim.
519
520 %description -n vim-plugin-clang -l pl.UTF-8
521 Integracja narzędzi Clang do formatowania i zmiany nazw z Vimem.
522
523 %prep
524 %setup -q -n %{name}-%{version}.src -a1 %{?with_rt:-a2} %{?with_lldb:-a3} %{?with_polly:-a4} -a5 -a6
525 %{__mv} cfe-%{version}.src tools/clang
526 %{?with_rt:%{__mv} compiler-rt-%{version}.src projects/compiler-rt}
527 %{?with_lldb:%{__mv} lldb-%{version}.src tools/lldb}
528 %{?with_polly:%{__mv} polly-%{version}.src tools/polly}
529 %{__mv} clang-tools-extra-%{version}.src tools/clang/tools/extra
530 %{__mv} lld-%{version}.src tools/lld
531
532 %patch1 -p1
533 %patch3 -p1
534 %patch4 -p1
535 %patch5 -p1
536
537 grep -rl /usr/bin/env tools utils | xargs sed -i -e '1{
538         s,^#!.*bin/env python,#!%{__python},
539         s,^#!.*bin/env perl,#!%{__perl},
540 }'
541
542 find -name '*.py' -print0 | xargs -0 sed -i -e '1{
543         s,^#!.*bin/python.*,#!%{__python},
544 }'
545
546 %build
547 install -d build
548
549 # Disabling assertions now, rec. by pure and needed for OpenGTL
550 # TESTFIX no PIC on ix86: http://llvm.org/bugs/show_bug.cgi?id=3801
551 cd build
552 CPPFLAGS="%{rpmcppflags} -D_FILE_OFFSET_BITS=64"
553
554 %cmake \
555 %if "%{_lib}" == "lib64"
556         -DLLVM_LIBDIR_SUFFIX:STRING=64 \
557 %endif
558 %if "%{_lib}" == "libx32"
559         -DLLVM_LIBDIR_SUFFIX:STRING=x32 \
560 %endif
561 %if %{with apidocs}
562         -DLLVM_ENABLE_DOXYGEN:BOOL=ON \
563 %endif
564 %if %{with doc}
565         -DLLVM_ENABLE_SPHINX:BOOL=ON \
566         -DSPHINX_WARNINGS_AS_ERRORS=OFF \
567 %endif
568         -DLLVM_ENABLE_ASSERTIONS:BOOL=OFF \
569         -DLLVM_ENABLE_CXX1Y:BOOL=ON \
570         -DLLVM_ENABLE_RTTI:BOOL=ON \
571         -DLLVM_ENABLE_PIC:BOOL=ON \
572         -DLLVM_BINDINGS_LIST:LIST="%{?with_ocaml:ocaml}" \
573         -DLLVM_BUILD_LLVM_DYLIB:BOOL=ON \
574         -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
575         -DBUILD_SHARED_LIBS:BOOL=OFF \
576         -DENABLE_LINKER_BUILD_ID:BOOL=ON \
577         -DLLVM_BINUTILS_INCDIR:STRING=%{_includedir} \
578         ../
579
580 %{__make} \
581         VERBOSE=1 \
582         OPTIMIZE_OPTION="%{rpmcflags} %{rpmcppflags}"
583
584 %if %{with tests}
585 %{__make} check 2>&1 | tee llvm-testlog.txt
586 %{__make} -C tools/clang test 2>&1 | tee clang-testlog.txt
587 %endif
588
589 %if %{with doc}
590 %{__make} -C docs docs-llvm-html
591 %{__make} -C docs docs-llvm-man
592 %if %{with ocaml}
593 %{__make} -C docs ocaml_doc
594 %endif
595 %{__make} -C tools/clang/docs docs-clang-html
596 %{__make} -C tools/clang/docs docs-clang-man
597 %{__make} -C tools/lld/docs docs-lld-html
598 %{__make} \
599         LD_LIBRARY_PATH=$(pwd)/%{_lib} \
600         -C tools/lldb/docs lldb-python-doc
601 %{__make} -C tools/lldb/docs lldb-cpp-doc
602 %endif
603
604 %install
605 rm -rf $RPM_BUILD_ROOT
606
607 %{__make} -j1 -C build install \
608         DESTDIR=$RPM_BUILD_ROOT
609
610 # only some .pyc files are created by make install
611 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
612 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
613
614 # Adjust static analyzer installation
615 # http://clang-analyzer.llvm.org/installation#OtherPlatforms
616 install -d $RPM_BUILD_ROOT%{_libdir}/scan-build
617 %{__mv} $RPM_BUILD_ROOT%{_prefix}/libexec/c??-analyzer $RPM_BUILD_ROOT%{_libdir}/scan-build
618 %{__sed} -i -e 's,/\.\./libexec/,/../%{_lib}/scan-build/,' $RPM_BUILD_ROOT%{_bindir}/scan-build
619 %py_comp $RPM_BUILD_ROOT%{_datadir}/scan-view
620 %py_ocomp $RPM_BUILD_ROOT%{_datadir}/scan-view
621 %py_postclean %{_datadir}/scan-view
622
623 # not installed by cmake buildsystem
624 install build/bin/pp-trace $RPM_BUILD_ROOT%{_bindir}
625
626 %if %{with doc}
627 cp -p build/docs/man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
628 # these tools are not installed
629 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/{FileCheck,llvm-build}.1
630 # make links
631 echo '.so llvm-ar.1' > $RPM_BUILD_ROOT%{_mandir}/man1/llvm-ranlib.1
632 %endif
633
634 # Move documentation back to build directory
635 %if %{with ocaml}
636 rm -rf ocamldocs
637 %{__mv} $RPM_BUILD_ROOT%{_docdir}/llvm/ocaml-html ocamldocs
638 %endif
639
640 # and separate the apidoc
641 %if %{with apidocs}
642 rm -rf clang-apidoc
643 cp -a build/tools/clang/docs/html clang-apidoc
644 %endif
645
646 # And prepare Clang documentation
647 rm -rf clang-docs
648 install -d clang-docs
649 for f in LICENSE.TXT NOTES.txt README.txt; do
650         ln tools/clang/$f clang-docs
651 done
652
653 %{__rm} $RPM_BUILD_ROOT%{_bindir}/{c-index-test,llvm-c-test}
654 # not this OS
655 %{__rm} $RPM_BUILD_ROOT%{_datadir}/clang/clang-format-bbedit.applescript
656 # use system six
657 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/six.py*
658 # it seems it is used internally by an extra clang tool
659 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libfindAllSymbols.a
660
661 # disable completeness check incompatible with split packaging
662 %{__sed} -i -e '/^foreach(target .*IMPORT_CHECK_TARGETS/,/^endforeach/d; /^unset(_IMPORT_CHECK_TARGETS)/d' $RPM_BUILD_ROOT%{_libdir}/cmake/llvm/LLVMExports.cmake
663
664 %clean
665 rm -rf $RPM_BUILD_ROOT
666
667 %post   libs -p /sbin/ldconfig
668 %postun libs -p /sbin/ldconfig
669
670 %post   -n clang-libs -p /sbin/ldconfig
671 %postun -n clang-libs -p /sbin/ldconfig
672
673 %post   -n lldb -p /sbin/ldconfig
674 %postun -n lldb -p /sbin/ldconfig
675
676 %files
677 %defattr(644,root,root,755)
678 %doc CREDITS.TXT LICENSE.TXT README.txt %{?with_tests:llvm-testlog.txt}
679 %attr(755,root,root) %{_bindir}/bugpoint
680 %attr(755,root,root) %{_bindir}/dsymutil
681 %attr(755,root,root) %{_bindir}/llc
682 %attr(755,root,root) %{_bindir}/lli
683 %attr(755,root,root) %{_bindir}/llvm-ar
684 %attr(755,root,root) %{_bindir}/llvm-as
685 %attr(755,root,root) %{_bindir}/llvm-bcanalyzer
686 %attr(755,root,root) %{_bindir}/llvm-cat
687 %attr(755,root,root) %{_bindir}/llvm-cfi-verify
688 %attr(755,root,root) %{_bindir}/llvm-cov
689 %attr(755,root,root) %{_bindir}/llvm-cvtres
690 %attr(755,root,root) %{_bindir}/llvm-cxxdump
691 %attr(755,root,root) %{_bindir}/llvm-cxxfilt
692 %attr(755,root,root) %{_bindir}/llvm-cxxmap
693 %attr(755,root,root) %{_bindir}/llvm-diff
694 %attr(755,root,root) %{_bindir}/llvm-dis
695 %attr(755,root,root) %{_bindir}/llvm-dlltool
696 %attr(755,root,root) %{_bindir}/llvm-dwarfdump
697 %attr(755,root,root) %{_bindir}/llvm-dwp
698 %attr(755,root,root) %{_bindir}/llvm-elfabi
699 %attr(755,root,root) %{_bindir}/llvm-exegesis
700 %attr(755,root,root) %{_bindir}/llvm-extract
701 %attr(755,root,root) %{_bindir}/llvm-lib
702 %attr(755,root,root) %{_bindir}/llvm-link
703 %attr(755,root,root) %{_bindir}/llvm-lto
704 %attr(755,root,root) %{_bindir}/llvm-lto2
705 %attr(755,root,root) %{_bindir}/llvm-mc
706 %attr(755,root,root) %{_bindir}/llvm-mca
707 %attr(755,root,root) %{_bindir}/llvm-modextract
708 %attr(755,root,root) %{_bindir}/llvm-mt
709 %attr(755,root,root) %{_bindir}/llvm-nm
710 %attr(755,root,root) %{_bindir}/llvm-objcopy
711 %attr(755,root,root) %{_bindir}/llvm-objdump
712 %attr(755,root,root) %{_bindir}/llvm-opt-report
713 %attr(755,root,root) %{_bindir}/llvm-pdbutil
714 %attr(755,root,root) %{_bindir}/llvm-profdata
715 %attr(755,root,root) %{_bindir}/llvm-ranlib
716 %attr(755,root,root) %{_bindir}/llvm-rc
717 %attr(755,root,root) %{_bindir}/llvm-readelf
718 %attr(755,root,root) %{_bindir}/llvm-readobj
719 %attr(755,root,root) %{_bindir}/llvm-rtdyld
720 %attr(755,root,root) %{_bindir}/llvm-size
721 %attr(755,root,root) %{_bindir}/llvm-split
722 %attr(755,root,root) %{_bindir}/llvm-strip
723 %attr(755,root,root) %{_bindir}/llvm-stress
724 %attr(755,root,root) %{_bindir}/llvm-strings
725 %attr(755,root,root) %{_bindir}/llvm-symbolizer
726 %attr(755,root,root) %{_bindir}/llvm-tblgen
727 %attr(755,root,root) %{_bindir}/llvm-undname
728 %attr(755,root,root) %{_bindir}/llvm-xray
729 %attr(755,root,root) %{_bindir}/obj2yaml
730 %attr(755,root,root) %{_bindir}/opt
731 %attr(755,root,root) %{_bindir}/sancov
732 %attr(755,root,root) %{_bindir}/sanstats
733 %attr(755,root,root) %{_bindir}/verify-uselistorder
734 %attr(755,root,root) %{_bindir}/yaml2obj
735 %if %{with doc}
736 %{_mandir}/man1/bugpoint.1*
737 %{_mandir}/man1/dsymutil.1*
738 %{_mandir}/man1/lit.1*
739 %{_mandir}/man1/llc.1*
740 %{_mandir}/man1/lli.1*
741 %{_mandir}/man1/llvm-ar.1*
742 %{_mandir}/man1/llvm-as.1*
743 %{_mandir}/man1/llvm-bcanalyzer.1*
744 %{_mandir}/man1/llvm-cov.1*
745 %{_mandir}/man1/llvm-cxxmap.1*
746 %{_mandir}/man1/llvm-diff.1*
747 %{_mandir}/man1/llvm-dis.1*
748 %{_mandir}/man1/llvm-dwarfdump.1*
749 %{_mandir}/man1/llvm-exegesis.1*
750 %{_mandir}/man1/llvm-extract.1*
751 %{_mandir}/man1/llvm-lib.1*
752 %{_mandir}/man1/llvm-link.1*
753 %{_mandir}/man1/llvm-mca.1*
754 %{_mandir}/man1/llvm-nm.1*
755 %{_mandir}/man1/llvm-objdump.1*
756 %{_mandir}/man1/llvm-pdbutil.1*
757 %{_mandir}/man1/llvm-profdata.1*
758 %{_mandir}/man1/llvm-ranlib.1*
759 %{_mandir}/man1/llvm-readobj.1*
760 %{_mandir}/man1/llvm-stress.1*
761 %{_mandir}/man1/llvm-symbolizer.1*
762 %{_mandir}/man1/opt.1*
763 %{_mandir}/man1/tblgen.1*
764 %endif
765
766 %files libs
767 %defattr(644,root,root,755)
768 %attr(755,root,root) %{_libdir}/libLLVM-%{abi}.so
769 # non-soname symlink
770 %attr(755,root,root) %{_libdir}/libLLVM-%{version}.so
771 %attr(755,root,root) %ghost %{_libdir}/libLTO.so.8
772 %attr(755,root,root) %{_libdir}/LLVMgold.so
773 %attr(755,root,root) %{_libdir}/libOptRemarks.so.8
774
775 %files devel
776 %defattr(644,root,root,755)
777 %attr(755,root,root) %{_bindir}/llvm-config
778 %attr(755,root,root) %{_libdir}/libLLVM.so
779 %attr(755,root,root) %{_libdir}/libLTO.so
780 %attr(755,root,root) %{_libdir}/libOptRemarks.so
781 %{_libdir}/libLLVM*.a
782 %{_includedir}/llvm
783 %{_includedir}/llvm-c
784 %{_libdir}/cmake/llvm
785 %if %{with doc}
786 %{_mandir}/man1/llvm-config.1*
787 %endif
788
789 #%files doc
790 #%defattr(644,root,root,755)
791
792 %if %{with apidocs}
793 %files apidocs
794 %defattr(644,root,root,755)
795 %doc apidoc/*
796 %endif
797
798 %if %{with polly}
799 %files polly
800 %defattr(644,root,root,755)
801 %doc tools/polly/{CREDITS.txt,LICENSE.txt,README} tools/polly/www/{bugs,changelog,contributors}.html
802 %attr(755,root,root) %{_libdir}/LLVMPolly.so
803
804 %files polly-devel
805 %defattr(644,root,root,755)
806 %{_libdir}/libPolly.a
807 %{_libdir}/libPollyISL.a
808 %{_libdir}/libPollyPPCG.a
809 %{_includedir}/polly
810 %{_libdir}/cmake/polly
811 %endif
812
813 %files -n clang
814 %defattr(644,root,root,755)
815 %doc clang-docs/{LICENSE.TXT,NOTES.txt,README.txt} %{?with_tests:clang-testlog.txt}
816 %attr(755,root,root) %{_bindir}/clang
817 %attr(755,root,root) %{_bindir}/clang++
818 %attr(755,root,root) %{_bindir}/clang-%{abi}
819 %attr(755,root,root) %{_bindir}/clang-check
820 %attr(755,root,root) %{_bindir}/clang-cl
821 %attr(755,root,root) %{_bindir}/clang-cpp
822 %attr(755,root,root) %{_bindir}/clang-format
823 %attr(755,root,root) %{_bindir}/clang-import-test
824 %attr(755,root,root) %{_bindir}/clang-offload-bundler
825 %attr(755,root,root) %{_bindir}/git-clang-format
826 %dir %{_libdir}/clang
827 %dir %{_libdir}/clang/%{version}
828 %{_libdir}/clang/%{version}/include
829 %if %{with rt}
830 %ifarch %{ix86} %{x8664}
831 %dir %{_libdir}/clang/%{version}/lib
832 %dir %{_libdir}/clang/%{version}/lib/linux
833 %dir %{_libdir}/clang/%{version}/share
834 %endif
835 %ifarch x32
836 %if %{with multilib}
837 %dir %{_libdir}/clang/%{version}/lib
838 %dir %{_libdir}/clang/%{version}/lib/linux
839 %dir %{_libdir}/clang/%{version}/share
840 %endif
841 %endif
842 %ifarch %{ix86}
843 %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-i*86.a
844 %attr(755,root,root) %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-i*86.so
845 %endif
846 %ifarch %{x8664}
847 %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-x86_64.a
848 %attr(755,root,root) %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-x86_64.so
849 %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-x86_64.a.syms
850 %endif
851 %ifarch %{ix86} %{x8664} %{arm} aarch64 mips mips64 ppc64
852 %{_libdir}/clang/%{version}/share/asan_blacklist.txt
853 %endif
854 %ifarch %{ix86} %{x8664} mips64
855 %{_libdir}/clang/%{version}/share/cfi_blacklist.txt
856 %endif
857 %ifarch %{x8664} aarch64 mips64
858 %{_libdir}/clang/%{version}/share/dfsan_abilist.txt
859 %{_libdir}/clang/%{version}/share/msan_blacklist.txt
860 %endif
861 %ifarch %{x8664} aarch64
862 %{_libdir}/clang/%{version}/share/hwasan_blacklist.txt
863 %endif
864 %ifarch x32
865 %if %{with multilib}
866 %{_libdir}/clang/%{version}/share/asan_blacklist.txt
867 %{_libdir}/clang/%{version}/share/cfi_blacklist.txt
868 %{_libdir}/clang/%{version}/share/dfsan_abilist.txt
869 %{_libdir}/clang/%{version}/share/msan_blacklist.txt
870 %{_libdir}/clang/%{version}/share/hwasan_blacklist.txt
871 %endif
872 %endif
873 %endif
874 %dir %{_datadir}/clang
875 %{_datadir}/clang/clang-format-diff.py
876
877 %files -n clang-libs
878 %defattr(644,root,root,755)
879 %attr(755,root,root) %{_libdir}/libclang.so.%{abi}
880
881 %if %{with rt} && %{with multilib}
882 %ifarch %{x8664} x32
883 %files -n clang-multilib
884 %defattr(644,root,root,755)
885 %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-i386.a
886 %attr(755,root,root) %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-i386.so
887 %endif
888 %ifarch x32
889 %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-x86_64.a
890 %attr(755,root,root) %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-x86_64.so
891 %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-x86_64.a.syms
892 %endif
893 %endif
894
895 %files -n clang-analyzer
896 %defattr(644,root,root,755)
897 %attr(755,root,root) %{_bindir}/scan-build
898 %attr(755,root,root) %{_bindir}/scan-view
899 %{_datadir}/scan-build
900 %{_datadir}/scan-view
901 %{_mandir}/man1/scan-build.1*
902 %dir %{_libdir}/scan-build
903 %attr(755,root,root) %{_libdir}/scan-build/c++-analyzer
904 %attr(755,root,root) %{_libdir}/scan-build/ccc-analyzer
905
906 %files -n clang-devel
907 %defattr(644,root,root,755)
908 %attr(755,root,root) %{_libdir}/libclang.so
909 %{_libdir}/libclang*.a
910 %{_includedir}/clang
911 %{_includedir}/clang-c
912 %{_libdir}/cmake/clang
913
914 %files -n clang-doc
915 %defattr(644,root,root,755)
916 %doc tools/clang/docs/*.{html,png,txt}
917
918 %if %{with apidocs}
919 %files -n clang-apidocs
920 %defattr(644,root,root,755)
921 %doc clang-apidoc/*
922 %endif
923
924 %files -n clang-tools-extra
925 %defattr(644,root,root,755)
926 %doc tools/clang/tools/extra/{CODE_OWNERS.TXT,README.txt}
927 %attr(755,root,root) %{_bindir}/clang-apply-replacements
928 %attr(755,root,root) %{_bindir}/clang-change-namespace
929 %attr(755,root,root) %{_bindir}/clang-extdef-mapping
930 %attr(755,root,root) %{_bindir}/clang-include-fixer
931 %attr(755,root,root) %{_bindir}/clang-query
932 %attr(755,root,root) %{_bindir}/clang-refactor
933 %attr(755,root,root) %{_bindir}/clang-rename
934 %attr(755,root,root) %{_bindir}/clang-reorder-fields
935 %attr(755,root,root) %{_bindir}/clang-tidy
936 %attr(755,root,root) %{_bindir}/clangd
937 %attr(755,root,root) %{_bindir}/diagtool
938 %attr(755,root,root) %{_bindir}/find-all-symbols
939 %attr(755,root,root) %{_bindir}/hmaptool
940 %attr(755,root,root) %{_bindir}/modularize
941 %attr(755,root,root) %{_bindir}/pp-trace
942 %{_datadir}/clang/clang-include-fixer.py
943 %{_datadir}/clang/clang-tidy-diff.py
944 %{_datadir}/clang/run-clang-tidy.py
945 %{_datadir}/clang/run-find-all-symbols.py
946
947 %files -n lld
948 %defattr(644,root,root,755)
949 %doc tools/lld/{LICENSE.TXT,README.md}
950 %attr(755,root,root) %{_bindir}/ld.lld
951 %attr(755,root,root) %{_bindir}/ld64.lld
952 %attr(755,root,root) %{_bindir}/lld
953 %attr(755,root,root) %{_bindir}/lld-link
954 %attr(755,root,root) %{_bindir}/wasm-ld
955
956 %files -n lld-devel
957 %defattr(644,root,root,755)
958 %{_libdir}/liblld[ACDEHMRWXY]*.a
959 %{_includedir}/lld
960
961 %if %{with lldb}
962 %files -n lldb
963 %defattr(644,root,root,755)
964 %attr(755,root,root) %{_bindir}/lldb
965 %attr(755,root,root) %{_bindir}/lldb-argdumper
966 %attr(755,root,root) %{_bindir}/lldb-mi
967 %attr(755,root,root) %{_bindir}/lldb-server
968 %attr(755,root,root) %{_bindir}/lldb-test
969 %attr(755,root,root) %{_bindir}/lldb-vscode
970 %attr(755,root,root) %{_libdir}/liblldb.so.%{version}
971 %attr(755,root,root) %ghost %{_libdir}/liblldb.so.8
972 %attr(755,root,root) %ghost %{_libdir}/liblldbIntelFeatures.so.8
973 %dir %{py_sitedir}/lldb
974 %attr(755,root,root) %{py_sitedir}/lldb/lldb-argdumper
975 %{py_sitedir}/lldb/formatters
976 %{py_sitedir}/lldb/runtime
977 %{py_sitedir}/lldb/utils
978 %{py_sitedir}/lldb/__init__.py[co]
979 %{py_sitedir}/lldb/embedded_interpreter.py[co]
980 %attr(755,root,root) %{py_sitedir}/lldb/_lldb.so
981 %attr(755,root,root) %{py_sitedir}/readline.so
982
983 %files -n lldb-devel
984 %defattr(644,root,root,755)
985 %attr(755,root,root) %{_libdir}/liblldb.so
986 %attr(755,root,root) %{_libdir}/liblldbIntelFeatures.so
987 %{_libdir}/liblldb*.a
988 %{_includedir}/lldb
989 %endif
990
991 %if %{with ocaml}
992 %files ocaml
993 %defattr(644,root,root,755)
994 %attr(755,root,root) %{_libdir}/ocaml/stublibs/dllllvm*.so
995 %dir %{_libdir}/ocaml/llvm
996 %{_libdir}/ocaml/llvm/llvm*.cma
997 %{_libdir}/ocaml/llvm/llvm*.cmi
998 %{_libdir}/ocaml/META.llvm*
999
1000 %files ocaml-devel
1001 %defattr(644,root,root,755)
1002 %{_libdir}/ocaml/llvm/libllvm*.a
1003 %{_libdir}/ocaml/llvm/llvm*.a
1004 %{_libdir}/ocaml/llvm/llvm*.cmx
1005 %{_libdir}/ocaml/llvm/llvm*.cmxa
1006 %{_libdir}/ocaml/llvm/llvm*.mli
1007
1008 %files ocaml-doc
1009 %defattr(644,root,root,755)
1010 %doc ocamldocs/*
1011 %endif
1012
1013 %files opt-viewer
1014 %defattr(644,root,root,755)
1015 %{_datadir}/opt-viewer
1016
1017 %files -n vim-plugin-clang
1018 %defattr(644,root,root,755)
1019 %{_datadir}/clang/clang-format.py
1020 %{_datadir}/clang/clang-rename.py