File ispc.spec of Package ispc

# spec file for package ispc
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2020 LISA GmbH, Bingen, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

Name:           ispc
Version:        1.14.1
Release:        0
Summary:        C-based SPMD programming language compiler
License:        BSD-3-Clause
Group:          Development/Languages/C and C++
BuildRequires:  bison
BuildRequires:  clang-devel
BuildRequires:  cmake >= 3.13
BuildRequires:  doxygen
BuildRequires:  flex
BuildRequires:  llvm-devel
BuildRequires:  ncurses-devel
BuildRequires:  zlib-devel
BuildRequires:  pkgconfig(python3)
ExclusiveArch:  %{arm} x86_64
%ifarch x86_64
# for some reason, ispc want to link to /usr/lib/crt1.o from glibc-devel-32bit for x86_64
BuildRequires:  glibc-devel-32bit

A compiler for a variant of the C programming language, with extensions for
"single program, multiple data" (SPMD) programming.
%setup -q

# other distributions seem to provide curses compatibility links to ncurses
sed -i 's|${PROJECT_NAME} pthread z tinfo curses)|${PROJECT_NAME} pthread z tinfo ncurses)|' CMakeLists.txt

# fix clang library modules for new clang as carried in TW and 15.2
%if 0%{?_llvm_sonum} >= 10 || ( 0%{?sle_version} == 150200 && 0%{?is_opensuse} )
sed -i 's|set(CLANG_LIBRARY_LIST .*)|set(CLANG_LIBRARY_LIST clang-cpp)|' CMakeLists.txt

%define _lto_cflags "-flto=thin"
echo "optflags: %{optflags}"
# our llvm is built without assertions, which is required for DUMPS to be operational
%cmake \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_INSTALL_PREFIX=%{_prefix} \
        -DCMAKE_C_FLAGS:STRING="$CFLAGS %{optflags} -fPIE" \
        -DCMAKE_CXX_FLAGS:STRING="$CXXFLAGS %{optflags} -fPIE" \
        -DCMAKE_EXE_LINKER_FLAGS="%{optflags} -pie" \



%license LICENSE.txt
%doc *.md

openSUSE Build Service is sponsored by