%global commit_simde fefc7857ff3e785b988a61a8f5f3c5bd5eb24342
%global short_commit_simde %(c=%{commit_simde}; echo ${c:0:7})
# Disable debuginfo package for the header only package.
%global debug_package %{nil}
# Disable the auto_set_build_flags. Because it sets clang flags for gcc in
# the %check section.
%undefine _auto_set_build_flags
%global simde_version 0.7.6
# %%global rc_version 1
Name: simde
Version: %{simde_version}%{?rc_version:~rc%{rc_version}}
# Align the release format with the packages setting Source0 by commit hash
# such as podman.spec and moby-engine.spec.
Release: 1.git%{short_commit_simde}%{?dist}
Summary: SIMD Everywhere
# find simde/ -type f | xargs licensecheck
# simde: MIT
# simde/check.h: CC0
# simde/debug-trap.h: CC0
# simde/simde-arch.h: CC0
# removed in %%prep (unbundled):
# simde/hedley.h: CC0
License: MIT and CC0
URL: https://github.com/simd-everywhere/simde
Source0: https://github.com/simd-everywhere/simde/archive/%{commit_simde}.tar.gz
# Use the `.packit/ci.sh` on the pull-requset below until it will be merged.
# https://github.com/simd-everywhere/simde/blob/master/.packit/ci.sh
# https://github.com/simd-everywhere/simde/pull/1044
Source1: ci.sh
# gcc and clang are used in the unit tests.
BuildRequires: clang
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: meson
# Header-only library dependency
# See https://docs.fedoraproject.org/en-US/packaging-guidelines/#_packaging_header_only_libraries
BuildRequires: hedley-devel
BuildRequires: hedley-static
BuildRequires: %{_bindir}/time
# Do not set noarch for header only package.
# See https://docs.fedoraproject.org/en-US/packaging-guidelines/#_packaging_header_only_libraries
%description
%{summary}
The SIMDe header-only library provides fast, portable implementations of SIMD
intrinsics on hardware which doesn't natively support them, such as calling
SSE functions on ARM. There is no performance penalty if the hardware supports
the native implementation (e.g., SSE/AVX runs at full speed on x86,
NEON on ARM, etc.).
%package devel
Summary: Header files for SIMDe development
Provides: %{name}-static = %{version}-%{release}
# The API includes the hedley header-only library.
Requires: hedley-devel%{?_isa}
Requires: hedley-static
%description devel
The simde-devel package contains the header files needed
to develop programs that use the SIMDe.
%prep
%autosetup -n %{name}-%{commit_simde} -p1
ln -svf %{_includedir}/hedley.h %{name}/
%install
mkdir -p %{buildroot}%{_includedir}
cp -a simde %{buildroot}%{_includedir}
ln -svf ../hedley.h %{buildroot}%{_includedir}/%{name}/
%check
# Check version.
version_major=$(grep '^#define SIMDE_VERSION_MAJOR ' simde/simde-common.h | cut -d ' ' -f 3)
version_minor=$(grep '^#define SIMDE_VERSION_MINOR ' simde/simde-common.h | cut -d ' ' -f 3)
version_micro=$(grep '^#define SIMDE_VERSION_MICRO ' simde/simde-common.h | cut -d ' ' -f 3)
test "%{simde_version}" = "${version_major}.${version_minor}.${version_micro}"
# Check if all the shipped file is a valid header file.
# Suppress the command logging during the check by running on bash.
bash - <<\EOF
for file in $(find simde/ -type f); do
if ! [[ "${file}" =~ \.h$ ]]; then
echo "${file} is not a header file."
exit 1
elif [ -x "${file}" ]; then
echo "${file} has executable bit."
exit 1
fi
done
EOF
# Only test the GCC and Clang cases with RPM build flags.
# If you find test failures on the cases, reproduce it in the upstream CI.
# in the O2 or RPM build flags cases, and report it.
# See .
# Copy to use the modified script.
cp -p "%{SOURCE1}" ci.sh
# Use the meson RPM package instead of the PyPI package.
sed -i -e '/^pip3 install meson/ s/^/#/' ci.sh
# Comment out the default configurations.
sed -i -e '/^IGNORE_EXIT_STATUS=/,/^SKIP_i686_GCC_DEFAULT=/ s/^/#/' ci.sh
# Print the difference on the debugging purpose.
diff -u "%{SOURCE1}" ci.sh || :
# Prepare to test on the GCC case with RPM build flags.
cp -p ci.sh ci_gcc.sh
# Print the failing messages in the CPU cases without checking the exit status.
IGNORE_EXIT_STATUS=
%ifarch i686 ppc64le
IGNORE_EXIT_STATUS=true
%endif
# Prepare the configuration.
cat > config.txt < config.txt <.
# Append the `-fno-strict-aliasing` for a compatibility from the past commit
# below, though it's not related to the shipping simde RPM package.
# https://src.fedoraproject.org/rpms/simde/c/3371c3a422f2512562fd4641b956d0c4b848c7ec
%global toolchain clang
export CI_CLANG_RPM_CFLAGS="%{build_cflags} -fno-strict-aliasing"
export CI_CLANG_RPM_CXXFLAGS="%{build_cxxflags} -fno-strict-aliasing"
export CI_CLANG_RPM_LDFLAGS="%{build_ldflags}"
%global toolchain gcc
export CI_GCC_RPM_CFLAGS="%{build_cflags} -fno-strict-aliasing"
export CI_GCC_RPM_CXXFLAGS="%{build_cxxflags} -fno-strict-aliasing"
export CI_GCC_RPM_LDFLAGS="%{build_ldflags}"
# Run tests.
/bin/time -f '=> [%E]' ./ci_gcc.sh
/bin/time -f '=> [%E]' ./ci_clang.sh
%files devel
%license COPYING
%doc README.md
%{_includedir}/%{name}
%changelog
* Mon Jun 12 2023 Jun Aruga - 0.7.6-1.gitfefc785
- Upgrade to SIMDe 0.7.6.
* Thu Feb 16 2023 Jun Aruga - 0.7.4~rc1-1.git9609eb2
- Upgrade to SIMDe 0.7.4 rc1.
Resolves: rhbz#2047012
Resolves: rhbz#2166982
* Sat Jan 21 2023 Fedora Release Engineering - 0.7.3-4.git3378ab3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Sat Jul 23 2022 Fedora Release Engineering - 0.7.3-3.git3378ab3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Sat Jan 22 2022 Fedora Release Engineering - 0.7.3-2.git3378ab3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Sun Aug 01 2021 Jun Aruga - 0.7.3-1.git3378ab3
- Upgrade to SIMDe 0.7.3 upstream master branch commit 3378ab3.
* Fri Jul 23 2021 Fedora Release Engineering - 0.7.2-2.git22609d4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Sun Apr 04 2021 Jun Aruga - 0.7.2-1.git22609d4
- Upgrade to SIMDe 0.7.2.
Resolves: rhbz#1940179
* Wed Mar 24 2021 Benjamin A. Beasley - 0.0.0-10.git396e05c
- Fix incorrectly-arched dependency on hedley-static
* Tue Mar 23 2021 Jun Aruga - 0.0.0-9.git396e05c
- Fix a warning by the rpmlint.
* Mon Mar 22 2021 Benjamin A. Beasley - 0.0.0-9.git396e05c
- Unbundle hedley dependency
* Mon Mar 08 2021 Jun Aruga - 0.0.0-8.git396e05c
- Fix FTBFS.
Resolves: rhbz#1923371
* Sat Feb 13 2021 Jeff Law - 0.0.0-7.git396e05c
- Compile with -fno-strict-aliasing as this code clearly violates ISO aliasing rules
* Wed Jan 27 2021 Fedora Release Engineering - 0.0.0-6.git396e05c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Tue Aug 04 2020 Jun Aruga - 0.0.0-5.git396e05c
- Fix FTBFS.
Resolves: rhbz#1865487
- Skip clang flags case for arm 32-bit due to the segmentation fault.
* Sat Aug 01 2020 Fedora Release Engineering - 0.0.0-4.git396e05c
- Second attempt - Rebuilt for
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Wed Jul 29 2020 Fedora Release Engineering - 0.0.0-3.git396e05c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Fri May 08 2020 Jun Aruga - 0.0.0-2.git396e05c
- Update to the latest upstream commit: 396e05c.
* Fri Apr 10 2020 Jun Aruga - 0.0.0-1.git29b9110
- Initial package