updated to snap from LLVM 12 branch (until proper release is made)
[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
c7dfe9a1
JK
25BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
27%description
28Common clang is a thin wrapper library around clang. Common clang has
29OpenCL-oriented API and is capable to compile OpenCL C kernels to
30SPIR-V modules.
31
32%package devel
33Summary: Header files for %{name} library
34Summary(pl.UTF-8): Pliki nagłówkowe biblioteki %{name}
35Group: Development/Libraries
15cf855e 36%requires_eq clang-devel
c7dfe9a1
JK
37Requires: %{name} = %{version}-%{release}
38
39%description devel
40Header files for %{name} library.
41
42%description devel -l pl.UTF-8
43Pliki nagłówkowe biblioteki %{name}.
44
45%prep
2b3682a3 46%setup -q -n %{name}-%{gitref}
c7dfe9a1
JK
47
48%build
49install -d build
50cd build
51%cmake \
52 -DUSE_PREBUILT_LLVM=ON \
53 -DPREFERRED_LLVM_VERSION="%{llvm_version}" \
54 -DLLVMSPIRV_INCLUDED_IN_LLVM=OFF \
55 -DSPIRV_TRANSLATOR_DIR="%{_prefix}" \
0a767a56 56 -DGIT_EXECUTABLE=/bin/false \
c7dfe9a1
JK
57 ../
58%{__make}
59
60cd ..
61
62%install
63rm -rf $RPM_BUILD_ROOT
64
65%{__make} -C build install \
66 DESTDIR=$RPM_BUILD_ROOT
67
2b3682a3
JP
68mv $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.12 $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.%{llvm_version}
69ln -s libopencl-clang.so.%{llvm_version} $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.12
c7dfe9a1
JK
70ln -sf libopencl-clang.so.%{llvm_version} $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so
71
72%post -p /sbin/ldconfig
73%postun -p /sbin/ldconfig
74
75%clean
76rm -rf $RPM_BUILD_ROOT
77
78%files
79%defattr(644,root,root,755)
80%doc README.md
81%attr(755,root,root) %{_libdir}/libopencl-clang.so.%{llvm_version}
2b3682a3 82%ghost %attr(755,root,root) %{_libdir}/libopencl-clang.so.12
c7dfe9a1
JK
83
84%files devel
85%defattr(644,root,root,755)
86%attr(755,root,root) %{_libdir}/libopencl-clang.so
87%{_includedir}/cclang
This page took 0.085407 seconds and 4 git commands to generate.