File libclc.spec of Package libclc
Name: libclc
Version: 21.1.6
Release: %mkrel 1
Summary: OpenCL C library for LLVM
License: MIT
Group: System/Libraries
URL: http://libclc.llvm.org/
Source0: llvm-project-%{version}.src.tar.xz
BuildRequires: cmake
BuildRequires: ninja
BuildRequires: python3
BuildRequires: llvm21-devel
BuildRequires: clang21-devel
%description
libclc is an implementation of the OpenCL C standard library as a set of
LLVM bitcode files. It provides built-in functions and math routines for
OpenCL kernels, used by Mesa’s Clover and Rusticl runtimes.
%prep
%setup -q -n llvm-project-%{version}.src
%build
mkdir builddir && cd builddir
cmake ../libclc -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_CONFIG=%{_bindir}/llvm-config \
-DCLANG=%{_bindir}/clang \
-DLLVM_TABLEGEN=%{_bindir}/llvm-tblgen \
-DCLANG_TABLEGEN=%{_bindir}/clang-tblgen \
-DCMAKE_INSTALL_PREFIX=%{_prefix}
ninja
%install
cd builddir
DESTDIR=%{buildroot} ninja install
# Runtime package
%files
%license libclc/LICENSE.TXT
%doc libclc/README.md
%{_datadir}/clc/*.bc
# Development package
%package devel
Summary: Development files for libclc
Group: Development/Libraries
Requires: libclc = %{version}-%{release}
%description devel
Development files for libclc, including pkg-config metadata needed to build
applications against libclc.
%files devel
%{_datadir}/pkgconfig/libclc.pc
%changelog
* Thu Dec 04 2025 Henrik <henrik@example.com> - 21.1.6-1
- Build against llvm21/clang21
- Added explicit LLVM_TABLEGEN and CLANG_TABLEGEN flags
- Split into libclc and libclc-devel subpackages