macros for %cmake
[packages/opencl-clang.git] / opencl-clang.spec
CommitLineData
c7dfe9a1 1
ac26e2aa 2# requires the OpenCL patches
2b3682a3 3%define llvm_version 12.0.0
ac26e2aa 4
2b3682a3
JP
5%define spirv_llvm_translator_version 12.0.0
6
7%define gitref 1d1829d930d31309c43512fc17ece51dd314ebde
8%define snap 20210525
c7dfe9a1
JK
9
10Summary: Intel Graphics Compute Runtime for OpenCL
11Name: opencl-clang
2b3682a3
JP
12Version: 12.0.0
13Release: 0.%{snap}.1
c7dfe9a1
JK
14License: University of Illinois/NCSA Open Source License
15Group: Libraries
2b3682a3
JP
16Source0: https://github.com/intel/opencl-clang/archive/%{gitref}/%{name}-%{snap}.tar.gz
17# Source0-md5: aa6983d5d43d2d92727837a8c1669c9f
c7dfe9a1 18URL: https://01.org/compute-runtime
eac18d9c 19BuildRequires: SPIRV-LLVM-Translator-devel >= %{spirv_llvm_translator_version}
15cf855e 20BuildRequires: clang >= %{llvm_rpm_version}
5b943348 21BuildRequires: clang-devel >= %{llvm_version}
c7dfe9a1 22BuildRequires: cmake >= 3.4.3
5b943348 23BuildRequires: llvm-devel >= %{llvm_version}
c7dfe9a1 24BuildRequires: pkgconfig
77ea7f96 25BuildRequires: rpmbuild(macros) >= 1.605
c7dfe9a1
JK
26BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27
28%description
29Common clang is a thin wrapper library around clang. Common clang has
30OpenCL-oriented API and is capable to compile OpenCL C kernels to
31SPIR-V modules.
32
33%package devel
34Summary: Header files for %{name} library
35Summary(pl.UTF-8): Pliki nagłówkowe biblioteki %{name}
36Group: Development/Libraries
15cf855e 37%requires_eq clang-devel
c7dfe9a1
JK
38Requires: %{name} = %{version}-%{release}
39
40%description devel
41Header files for %{name} library.
42
43%description devel -l pl.UTF-8
44Pliki nagłówkowe biblioteki %{name}.
45
46%prep
2b3682a3 47%setup -q -n %{name}-%{gitref}
c7dfe9a1
JK
48
49%build
50install -d build
51cd build
52%cmake \
53 -DUSE_PREBUILT_LLVM=ON \
54 -DPREFERRED_LLVM_VERSION="%{llvm_version}" \
55 -DLLVMSPIRV_INCLUDED_IN_LLVM=OFF \
56 -DSPIRV_TRANSLATOR_DIR="%{_prefix}" \
0a767a56 57 -DGIT_EXECUTABLE=/bin/false \
c7dfe9a1
JK
58 ../
59%{__make}
60
61cd ..
62
63%install
64rm -rf $RPM_BUILD_ROOT
65
66%{__make} -C build install \
67 DESTDIR=$RPM_BUILD_ROOT
68
2b3682a3
JP
69mv $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.12 $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.%{llvm_version}
70ln -s libopencl-clang.so.%{llvm_version} $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.12
c7dfe9a1
JK
71ln -sf libopencl-clang.so.%{llvm_version} $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so
72
73%post -p /sbin/ldconfig
74%postun -p /sbin/ldconfig
75
76%clean
77rm -rf $RPM_BUILD_ROOT
78
79%files
80%defattr(644,root,root,755)
81%doc README.md
82%attr(755,root,root) %{_libdir}/libopencl-clang.so.%{llvm_version}
2b3682a3 83%ghost %attr(755,root,root) %{_libdir}/libopencl-clang.so.12
c7dfe9a1
JK
84
85%files devel
86%defattr(644,root,root,755)
87%attr(755,root,root) %{_libdir}/libopencl-clang.so
88%{_includedir}/cclang
This page took 0.081272 seconds and 4 git commands to generate.