New upstream version (bz 1527531). Add a python3 subpackage.

This commit is contained in:
Jerry James 2017-12-24 21:45:27 -07:00
parent 19ea46f605
commit 3c59b007cd
4 changed files with 47 additions and 31 deletions

3
.gitignore vendored
View File

@ -1,3 +1,2 @@
/z3-4.4.0.tar.gz
/z3-4.4.1.tar.gz
/z3-4.5.0.tar.gz
/z3-4.6.0.tar.gz

View File

@ -1 +1 @@
f332befa0d66d81818a06279a0973e25 z3-4.5.0.tar.gz
SHA512 (z3-4.6.0.tar.gz) = 92a87292db17ceb4a90e45bce4f6237fe0437a7a5e147b4b63a2cb793e2d59fc04a6aa579ddb904280eac08b4a85c600df092d4c2fa99239199514b9c0363243

View File

@ -1,10 +1,10 @@
--- src/util/hwf.cpp.orig 2016-11-07 15:02:30.000000000 -0700
+++ src/util/hwf.cpp 2016-11-08 21:01:53.533487316 -0700
--- src/util/hwf.cpp.orig 2017-12-19 21:13:53.225563733 -0700
+++ src/util/hwf.cpp 2017-12-19 21:15:00.345290291 -0700
@@ -29,8 +29,7 @@ Revision History:
#include<fenv.h>
#endif
-#if defined(__x86_64__) || defined(_M_X64) || \
-#if defined(__x86_64__) || defined(_M_X64) || \
- defined(__i386) || defined(_M_IX86)
+#if defined(__x86_64__) || defined(_M_X64)
#define USE_INTRINSICS

67
z3.spec
View File

@ -1,14 +1,8 @@
# Python 3 NOTE: Although there are references to python 3 support in the
# source tree, building with python 3 currently fails. I fixed several
# problems before giving up. If someone would like to fix all of the problems
# and submit the results upstream, I'm sure many people would be grateful.
%global opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0)
%global medtag d57a2a6dce92
%global medtag b0aaa4c6d7a7
Name: z3
Version: 4.5.0
Release: 8%{?dist}
Version: 4.6.0
Release: 1%{?dist}
Summary: Satisfiability Modulo Theories (SMT) solver
License: MIT
@ -29,6 +23,8 @@ BuildRequires: ocaml-ocamldoc
BuildRequires: ocaml-num-devel
BuildRequires: python2-devel
BuildRequires: python2-setuptools
BuildRequires: python3-devel
BuildRequires: python3-setuptools
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
@ -91,6 +87,14 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%description -n python2-%{name}
Python 2 interface to z3.
%package -n python3-%{name}
%{?python_provide:%python_provide python3-%{name}}
Summary: Python 3 interface to z3
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%description -n python3-%{name}
Python 3 interface to z3.
%prep
%setup -q -n %{name}-%{name}-%{version}
%patch0
@ -100,9 +104,9 @@ Python 2 interface to z3.
# contents of the archives in the library, link the library with the correct
# flags, don't hide library symbols needed by the executable, use an soname,
# and build the ocaml files with debug info.
sed -e "s|^\(PYTHON_PACKAGE_DIR=\).*|\1'%{python2_sitearch}/z3'|" \
sed -e "s|^\(PYTHON_PACKAGE_DIR=\).*|\1'%{python2_sitearch}'|" \
-e 's/@$(CXX)/$(CXX)/' \
-e 's/ -O3//;s/ -fomit-frame-pointer//' \
-e '/O3/d' \
-e "s/\(['\"]\)cp\([^[:alnum:]]\)/\1cp -p\2/" \
-e "s/\(SLIBEXTRAFLAGS = '\)'/\1-Wl,--no-whole-archive -Wl,--as-needed'/" \
-e "/SLIBFLAGS/s|-shared|& $RPM_LD_FLAGS -Wl,--whole-archive|" \
@ -131,11 +135,8 @@ mv -f RELEASE_NOTES.utf8 RELEASE_NOTES
find -O3 src -type f -perm /0111 \( -name \*.cpp -o -name \*.h \) \
-exec chmod 0644 {} +
# Fix ocaml documentation generation (broken in 4.4.0, broken more in 4.5.0)
sed -e 's,api\\html\\ml,api/html/ml,' \
-e 's,python/z3.py,python/z3/z3.py,' \
-e 's,z3enums\.mli,z3enums.ml,' \
-i doc/mk_api_doc.py
# Fix ocaml documentation generation (broken in 4.4.0)
sed -i 's,z3enums\.mli,z3enums.ml,' doc/mk_api_doc.py
%build
export CXXFLAGS="$RPM_OPT_FLAGS -fPIC"
@ -144,7 +145,7 @@ export LANG="C.UTF-8"
export PYTHON="%{__python2}"
# This is NOT an autoconf-generated configure script.
./configure -p %{_prefix} --githash=%{medtag} --gmp --java --ml
./configure -p %{_prefix} --githash=%{medtag} --gmp --java --ml --python
# FIXME: intermittent build failures with %%{?_smp_mflags}
make -C build
@ -159,14 +160,29 @@ popd
# Build the documentation
pushd doc
%{__python2} mk_api_doc.py --ml
%{__python2} mk_api_doc.py --ml --no-dotnet
popd
# Build for python3
mv build build2
sed -i "s|%{python2_sitearch}|%{python3_sitearch}|" scripts/mk_util.py
export PYTHON="%{__python3}"
./configure -p %{_prefix} --githash=%{medtag} --gmp --python
# FIXME: intermittent build failures with %%{?_smp_mflags}
make -C build
%install
export LANG="C.UTF-8"
# Install
# Install the python3 interface
make -C build install DESTDIR=%{buildroot}
rm -f %{buildroot}%{python3_sitearch}/%{name}/lib/libz3.so
ln -s %{_libdir}/libz3.so.0 %{buildroot}%{python3_sitearch}/%{name}/lib/libz3.so
# Install the python2 interface
make -C build2 install DESTDIR=%{buildroot}
rm -f %{buildroot}%{python2_sitearch}/%{name}/lib/libz3.so
ln -s %{_libdir}/libz3.so.0 %{buildroot}%{python2_sitearch}/%{name}/lib/libz3.so
# On 64-bit systems, move the library to the right directory
if [ "%{_libdir}" != "%{_prefix}/lib" ]; then
@ -183,12 +199,6 @@ ln -s libz3.so.0 %{buildroot}%{_libdir}/libz3.so
mkdir -p %{buildroot}%{_includedir}/%{name}
mv %{buildroot}%{_includedir}/*.h %{buildroot}%{_includedir}/%{name}
# Install the python interface
mkdir -p %{buildroot}%{python2_sitearch}
cp -a build/python/%{name} %{buildroot}%{python2_sitearch}
ln -s %{_libdir}/lib%{name}.so.0 \
%{buildroot}%{python2_sitearch}/%{name}/lib%{name}.so
# Move the Java interface to its correct location
mkdir -p %{buildroot}%{_libdir}/%{name}
mkdir -p %{buildroot}%{_jnidir}
@ -250,7 +260,14 @@ mv %{buildroot}%{_prefix}/lib/lib%{name}java.so %{buildroot}%{_libdir}/%{name}
%files -n python2-%{name}
%{python2_sitearch}/%{name}/
%files -n python3-%{name}
%{python3_sitearch}/%{name}/
%changelog
* Sun Dec 24 2017 Jerry James <loganjerry@gmail.com> - 4.6.0-1
- New upstream version (bz 1527531)
- Add a python3 subpackage
* Sun Dec 17 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 4.5.0-8
- Python 2 binary package renamed to python2-z3
See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3