Blob Blame History Raw
%global srcname pyfastnoisesimd

Name:           python-%{srcname}
Version:        0.4.1
Release:        1%{?dist}
Summary:        Python Fast Noise with SIMD

License:        BSD
URL:            http://github.com/robbmcleod/pyfastnoisesimd
Source0:        https://files.pythonhosted.org/packages/source/p/%{srcname}/%{srcname}-%{version}.tar.gz
# https://github.com/Auburns/FastNoiseSIMD/commit/32873404111701397781fe9ef21931fed4f7f766
# https://github.com/Auburns/FastNoiseSIMD/commit/575c0047bbfd2bac841359daa9db220a9f97a638
# https://github.com/Auburns/FastNoiseSIMD/pull/27
Patch0001:      0001-Update-casts-for-NEON.patch
# https://github.com/Auburns/FastNoiseSIMD/pull/31
Patch0002:      0002-Use-fallback-for-PPC64-and-S390x.patch
# https://github.com/robbmcleod/pyfastnoisesimd/pull/15
Patch0003:      0003-Add-platform-specific-flags-for-NEON.patch
# https://github.com/Auburns/FastNoiseSIMD/pull/32
Patch0004:      0004-Use-getauxval-to-check-for-NEON-on-Linux.patch
# https://github.com/robbmcleod/pyfastnoisesimd/pull/20
Patch0005:      0005-Fix-alignment-on-non-optimized-systems.patch

%global _description \
PyFastNoiseSIMD is a wrapper around Jordan Peck's synthetic noise library which \
has been accelerated with SIMD instruction sets. \
\
Parallelism is further enhanced by the use of concurrent.futures to \
multi-thread the generation of noise for large arrays. Thread scaling is \
generally in the range of 50-90%, depending largely on the vectorized \
instruction set used. The number of threads, defaults to the number of virtual \
cores on the system.

%description %{_description}


%package -n     python3-%{srcname}
Summary:        %{summary}
%{?python_provide:%python_provide python3-%{srcname}}

BuildRequires:  gcc-c++
BuildRequires:  python3-devel
BuildRequires:  python3dist(setuptools) >= 34.1.0
BuildRequires:  python3dist(numpy) > 1.7

Requires:       python3dist(numpy) > 1.7

%description -n python3-%{srcname} %{_description}


%prep
%autosetup -n %{srcname}-%{version} -p1

# Remove bundled egg-info
rm -rf %{srcname}.egg-info
# Fix line endings
for file in README.rst; do
    sed "s|\r||g" ${file} > ${file}.new
    touch -r ${file} ${file}.new
    mv ${file}.new ${file}
done


%build
%py3_build


%install
%py3_install


%check
mkdir empty
pushd empty
PYTHONPATH="%{buildroot}%{python3_sitearch}" \
    %{__python3} -c "import sys; import pyfastnoisesimd; sys.exit(0 if pyfastnoisesimd.test().wasSuccessful() else 1)"
popd


%files -n python3-%{srcname}
%doc README.rst
%license LICENSE
%{python3_sitearch}/%{srcname}
%{python3_sitearch}/%{srcname}-%{version}-py?.?.egg-info


%changelog
* Sun Jan 13 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.4.1-1
- Update to latest version

* Fri Jul 20 2018 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.3.2-1
- Initial package.