Blob Blame History Raw
%global with_snapshot 0
%global commit 34da2d23bbf32abf44da11d2cdca595dc7318cec
%global shortcommit %(c=%{commit}; echo ${c:0:7})

Name:		ispc
Version:	1.16.1
%if %{with_snapshot}
Release:	%autorelease -p -s %{shortcommit}
Release:	%autorelease
Summary:	C-based SPMD programming language compiler

License:	BSD
%if %{with_snapshot}
BuildRequires:	bison
BuildRequires:	cmake
BuildRequires:	clang-devel
BuildRequires:	doxygen
BuildRequires:	flex 
BuildRequires:	gcc-c++
BuildRequires:	llvm-devel
BuildRequires:	pkgconfig(ncurses)
BuildRequires:	pkgconfig(python3)
# Hardcoded path from 32-bit glibc-devel needed to build
# See
%ifarch x86_64
BuildRequires:	/usr/lib/crt1.o
BuildRequires:	pkgconfig(zlib)

# Upstream only supports these architectures
ExclusiveArch:	x86_64 aarch64


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

%if %{with_snapshot}
%autosetup -n %{name}-%{commit} -p1
%autosetup -n %{name}-%{version} -p1

# Use gcc rather clang by default
sed -i 's|set(CMAKE_C_COMPILER "clang")|set(CMAKE_C_COMPILER "gcc")|g' CMakeLists.txt
sed -i 's|set(CMAKE_CXX_COMPILER "clang++")|set(CMAKE_CXX_COMPILER "g++")|g' CMakeLists.txt

# Delete unrecognized command options from gcc-c++
sed -i 's|-Wno-c99-extensions -Wno-deprecated-register||g' CMakeLists.txt

# Suppress warning message as error
sed -i 's| -Werror ||g' CMakeLists.txt 

# Fix all Python shebangs recursively in .
%py3_shebang_fix .

%cmake \
	-DCMAKE_EXE_LINKER_FLAGS="%{optflags} -fPIE" \


%license LICENSE.txt