Пакет libclc: Specfile

# see also Mesa.spec
%define use_lld_arches x86_64

Name: libclc
Version: 0.2.0
Release: alt4.1

Summary: An open source implementation of the OpenCL 1.1 library requirements
License: BSD
Group: System/Libraries

Url: https://libclc.llvm.org
Source: %name-%version.tar

BuildPreReq: /proc
BuildRequires: python3-base
BuildRequires: libstdc++-devel
BuildRequires: clang >= 9.0.0
BuildRequires: llvm-devel >= 9.0.0

%ifarch %use_lld_arches
BuildRequires: lld >= 9.0.0
%endif
%ifarch %e2k
BuildRequires: gcc-c++
%endif

%description
libclc is an open source, BSD licensed implementation of the library
requirements of the OpenCL C programming language, as specified by the
OpenCL 1.1 Specification. The following sections of the specification
impose library requirements:

  * 6.1: Supported Data Types
  * 6.2.3: Explicit Conversions
  * 6.2.4.2: Reinterpreting Types Using as_type() and as_typen()
  * 6.9: Preprocessor Directives and Macros
  * 6.11: Built-in Functions
  * 9.3: Double Precision Floating-Point
  * 9.4: 64-bit Atomics
  * 9.5: Writing to 3D image memory objects
  * 9.6: Half Precision Floating-Point

libclc is intended to be used with the Clang compiler's OpenCL frontend.

libclc is designed to be portable and extensible. To this end, it provides
generic implementations of most library requirements, allowing the target
to override the generic implementation at the granularity of individual
functions.

libclc currently only supports the PTX target, but support for more
targets is welcome.


%package devel
Summary: Development files for %name
Group: Development/C++
Requires: %name = %version-%release

%description devel
The %name-devel package contains libraries and header files for
developing applications that use %name.

%prep
%setup

%build
export CFLAGS=" -D__extern_always_inline=inline"
./configure.py \
	--prefix=%_prefix \
	--libexecdir=%_prefix/libexec/clc \
	--pkgconfigdir=%_pkgconfigdir \
%ifarch %e2k
	--with-cxx-compiler=%_bindir/g++ \
%endif
	%nil

%make_build

%install
%makeinstall_std

%files
%doc LICENSE.TXT README.TXT CREDITS.TXT
%_prefix/libexec/clc

%files devel
%_includedir/clc
%_pkgconfigdir/*.pc

%changelog
* Sat Apr 11 2020 Michael Shigorin <mike@altlinux.org> 0.2.0-alt4.1
- E2K: build with g++ (lcc actually), thus without lld

* Fri Feb 14 2020 Valery Inozemtsev <shrek@altlinux.ru> 0.2.0-alt4
- git snapshot master.9aa6f35

* Sat Dec 29 2018 Valery Inozemtsev <shrek@altlinux.ru> 0.2.0-alt3
- git snapshot master.1ecb16d

* Fri Aug 10 2018 Valery Inozemtsev <shrek@altlinux.ru> 0.2.0-alt2
- build for aarch64

* Mon Jul 30 2018 Valery Inozemtsev <shrek@altlinux.ru> 0.2.0-alt1
- initial release