math/py-or-tools: Update 7.7 -> 8.1

This commit is contained in:
Yuri Victorovich 2020-12-30 17:54:19 +00:00
parent 239743130f
commit 767d3c1c35
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=559677
8 changed files with 66 additions and 45 deletions

View file

@ -2,8 +2,7 @@
PORTNAME= or-tools
DISTVERSIONPREFIX= v
DISTVERSION= 7.7
PORTREVISION= 2
DISTVERSION= 8.1
CATEGORIES= math
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@ -16,8 +15,9 @@ LICENSE_FILE= ${WRKSRC}/LICENSE-2.0.txt
BROKEN_i386= SWIG wrapped code invalid in 32 bit architecture, regenerate code using -DSWIGWORDSIZE32 # see https://github.com/google/or-tools/issues/2130
PY_DEPENDS= ${PYTHON_PKGNAMEPREFIX}protobuf>0:devel/py-protobuf@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}six>0:devel/py-six@${PY_FLAVOR}
${PYTHON_PKGNAMEPREFIX}absl-py>0:devel/py-absl-py@${PY_FLAVOR}
BUILD_DEPENDS= ${PY_DEPENDS} \
protoc-gen-mypy:devel/py-mypy-protobuf@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pip>0:devel/py-pip@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}virtualenv>0:devel/py-virtualenv@${PY_FLAVOR} \
@ -31,7 +31,7 @@ LIB_DEPENDS= libabsl_base.so:devel/abseil \
libprotobuf.so:devel/protobuf
RUN_DEPENDS= ${PY_DEPENDS}
USES= blaslapack cmake compiler:c++11-lang pkgconfig python:3.6+
USES= blaslapack cmake:insource compiler:c++17-lang pkgconfig python:3.6+
USE_GITHUB= yes
GH_ACCOUNT= google
USE_PYTHON= flavors
@ -42,8 +42,12 @@ CMAKE_ARGS= -DSWIG_EXECUTABLE=${LOCALBASE}/bin/swig -DFREEBSD_PYTHON_VER=${PYTHO
CONFIGURE_ENV= UNIX_CBC_DIR=${LOCALBASE} UNIX_CLP_DIR=${LOCALBASE}
BUILD_ENV= UNIX_CBC_DIR=${LOCALBASE} UNIX_CLP_DIR=${LOCALBASE}
post-configure: # https://github.com/google/or-tools/issues/2109
@${REINPLACE_CMD} -e 's|protobuf::protoc|protoc -I${LOCALBASE}/include| ; s|protobuf$$:$$:protoc||' ${BUILD_WRKSRC}/build.ninja
OPTIONS_DEFINE= SCIP
#OPTIONS_DEFAULT= SCIP # undesirable to make it default because SCIP's license doesn't allow package build, and this would block package availability for math/py-or-tools
SCIP_DESC= Use the SCIP solver # SCIP package isn't built because of licensing restrictions
SCIP_CMAKE_BOOL= USE_SCIP
SCIP_LIB_DEPENDS= libscip.so:math/SCIP
do-install: # by default cmake installs the whole or-tools project without the python part, so extract the wheel and install python files manually here
${MKDIR} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}

View file

@ -1,3 +1,3 @@
TIMESTAMP = 1596476022
SHA256 (google-or-tools-v7.7_GH0.tar.gz) = d20eb031ea3f1b75e55e44ae6acdb674ee6fb31e7a56498be32dc83ba9bc13bd
SIZE (google-or-tools-v7.7_GH0.tar.gz) = 184809285
TIMESTAMP = 1609281777
SHA256 (google-or-tools-v8.1_GH0.tar.gz) = beb9fe379977033151045d0815d26c628ad99d74d68b9f3b707578492723731e
SIZE (google-or-tools-v8.1_GH0.tar.gz) = 232290953

View file

@ -1,4 +1,4 @@
--- cmake/python.cmake.orig 2020-08-03 18:30:02 UTC
--- cmake/python.cmake.orig 2020-12-09 16:30:21 UTC
+++ cmake/python.cmake
@@ -23,7 +23,7 @@ if(UNIX AND NOT APPLE)
endif()
@ -8,4 +8,13 @@
+find_package(Python ${FREEBSD_PYTHON_VER} EXACT REQUIRED COMPONENTS Interpreter Development)
if(Python_VERSION VERSION_GREATER_EQUAL 3)
list(APPEND CMAKE_SWIG_FLAGS "-py3")
list(APPEND CMAKE_SWIG_FLAGS "-py3" "-DPY3")
@@ -206,7 +206,7 @@ if(BUILD_TESTING)
COMMAND ${VENV_EXECUTABLE} ${VENV_DIR}
# Must not call it in a folder containing the setup.py otherwise pip call it
# (i.e. "python setup.py bdist") while we want to consume the wheel package
- COMMAND ${VENV_Python_EXECUTABLE} -m pip install --find-links=${CMAKE_CURRENT_BINARY_DIR}/python/dist ${PROJECT_NAME}
+ COMMAND ${VENV_Python_EXECUTABLE} -m pip install --no-index --find-links=${CMAKE_CURRENT_BINARY_DIR}/python/dist ${PROJECT_NAME}
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/test.py.in ${VENV_DIR}/test.py
BYPRODUCTS ${VENV_DIR}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} VERBATIM)

View file

@ -1,12 +1,15 @@
--- ortools/python/setup.py.in.orig 2020-08-03 20:33:34 UTC
See https://github.com/google/or-tools/issues/2305
--- ortools/python/setup.py.in.orig 2020-12-30 17:40:00 UTC
+++ ortools/python/setup.py.in
@@ -41,7 +41,8 @@ setup(
'@PROJECT_NAME@.util':['$<TARGET_FILE_NAME:sorted_interval_list>', '*.pyi'],
},
include_package_data=True,
- install_requires=['protobuf >= 3.12.2', 'six >= 1.10'],
+ #install_requires=['protobuf >= 3.12.2', 'six >= 1.10'],
+ install_requires=[],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
@@ -42,8 +42,8 @@ setup(
version='@PROJECT_VERSION@',
packages=find_packages(),
install_requires=[
- 'protobuf >= 3.14.0',
- 'absl-py >= 0.11',
+ #'protobuf >= 3.14.0',
+ #'absl-py >= 0.11',
],
package_data={
'@PROJECT_NAME@':[$<$<NOT:$<PLATFORM_ID:Windows>>:'.libs/*', '../$<TARGET_SONAME_FILE_NAME:ortools>'>],

View file

@ -1,11 +0,0 @@
--- ortools/util/fp_utils.h.orig 2020-07-20 23:21:30 UTC
+++ ortools/util/fp_utils.h
@@ -83,6 +83,8 @@ class ScopedFloatingPointEnv {
excepts &= FE_ALL_EXCEPT;
#ifdef __APPLE__
fenv_.__control &= ~excepts;
+#elif defined(__FreeBSD__)
+ //fesetexceptflag(&fenv_, excepts);
#else // Linux
fenv_.__control_word &= ~excepts;
#endif

View file

@ -1,7 +1,7 @@
--- ortools/util/zvector.h.orig 2020-07-20 23:36:37 UTC
--- ortools/util/zvector.h.orig 2020-12-09 16:30:21 UTC
+++ ortools/util/zvector.h
@@ -17,7 +17,11 @@
#if defined(__APPLE__) && defined(__GNUC__)
#if (defined(__APPLE__) || defined(__FreeBSD__)) && defined(__GNUC__)
#include <machine/endian.h>
#elif !defined(_MSC_VER)
+#if defined(__FreeBSD__)

View file

@ -1,13 +1,15 @@
--- tools/setup.py.in.orig 2020-08-03 20:20:27 UTC
See https://github.com/google/or-tools/issues/2305
--- tools/setup.py.in.orig 2020-12-09 16:30:21 UTC
+++ tools/setup.py.in
@@ -46,8 +46,8 @@ setup(
'ortools.util',
],
@@ -42,8 +42,8 @@ setup(
version='VVVV',
packages=find_packages(),
install_requires=[
- 'protobuf >= 3.12.2',
- 'six >= 1.10',
+ #'protobuf >= 3.12.2',
+ #'six >= 1.10',
- 'protobuf >= 3.14.0',
- 'absl-py >= 0.11',
+ #'protobuf >= 3.14.0',
+ #'absl-py >= 0.11',
],
package_data={
'ortools.constraint_solver' : ['_pywrapcp.dll'],
'ortools.constraint_solver' : ['_pywrapcp.dll', '*.pyi'],

View file

@ -1,4 +1,4 @@
%%PYTHON_SITELIBDIR%%/ortools/.libs/libortools.so.7
%%PYTHON_SITELIBDIR%%/ortools/.libs/libortools.so.8
%%PYTHON_SITELIBDIR%%/ortools/__init__.py
%%PYTHON_SITELIBDIR%%/ortools/algorithms/__init__.py
%%PYTHON_SITELIBDIR%%/ortools/algorithms/_pywrapknapsack_solver.so
@ -6,16 +6,25 @@
%%PYTHON_SITELIBDIR%%/ortools/constraint_solver/__init__.py
%%PYTHON_SITELIBDIR%%/ortools/constraint_solver/_pywrapcp.so
%%PYTHON_SITELIBDIR%%/ortools/constraint_solver/assignment_pb2.py
%%PYTHON_SITELIBDIR%%/ortools/constraint_solver/assignment_pb2.pyi
%%PYTHON_SITELIBDIR%%/ortools/constraint_solver/pywrapcp.py
%%PYTHON_SITELIBDIR%%/ortools/constraint_solver/routing_enums_pb2.py
%%PYTHON_SITELIBDIR%%/ortools/constraint_solver/routing_enums_pb2.pyi
%%PYTHON_SITELIBDIR%%/ortools/constraint_solver/routing_parameters_pb2.py
%%PYTHON_SITELIBDIR%%/ortools/constraint_solver/routing_parameters_pb2.pyi
%%PYTHON_SITELIBDIR%%/ortools/constraint_solver/search_limit_pb2.py
%%PYTHON_SITELIBDIR%%/ortools/constraint_solver/search_limit_pb2.pyi
%%PYTHON_SITELIBDIR%%/ortools/constraint_solver/search_stats_pb2.py
%%PYTHON_SITELIBDIR%%/ortools/constraint_solver/search_stats_pb2.pyi
%%PYTHON_SITELIBDIR%%/ortools/constraint_solver/solver_parameters_pb2.py
%%PYTHON_SITELIBDIR%%/ortools/constraint_solver/solver_parameters_pb2.pyi
%%PYTHON_SITELIBDIR%%/ortools/data/__init__.py
%%PYTHON_SITELIBDIR%%/ortools/data/_pywraprcpsp.so
%%PYTHON_SITELIBDIR%%/ortools/data/jobshop_scheduling_pb2.py
%%PYTHON_SITELIBDIR%%/ortools/data/jobshop_scheduling_pb2.pyi
%%PYTHON_SITELIBDIR%%/ortools/data/pywraprcpsp.py
%%PYTHON_SITELIBDIR%%/ortools/data/rcpsp_pb2.py
%%PYTHON_SITELIBDIR%%/ortools/data/rcpsp_pb2.pyi
%%PYTHON_SITELIBDIR%%/ortools/graph/__init__.py
%%PYTHON_SITELIBDIR%%/ortools/graph/_pywrapgraph.so
%%PYTHON_SITELIBDIR%%/ortools/graph/pywrapgraph.py
@ -23,18 +32,23 @@
%%PYTHON_SITELIBDIR%%/ortools/linear_solver/_pywraplp.so
%%PYTHON_SITELIBDIR%%/ortools/linear_solver/linear_solver_natural_api.py
%%PYTHON_SITELIBDIR%%/ortools/linear_solver/linear_solver_pb2.py
%%PYTHON_SITELIBDIR%%/ortools/linear_solver/linear_solver_pb2.pyi
%%PYTHON_SITELIBDIR%%/ortools/linear_solver/pywraplp.py
%%PYTHON_SITELIBDIR%%/ortools/sat/__init__.py
%%PYTHON_SITELIBDIR%%/ortools/sat/_pywrapsat.so
%%PYTHON_SITELIBDIR%%/ortools/sat/boolean_problem_pb2.py
%%PYTHON_SITELIBDIR%%/ortools/sat/boolean_problem_pb2.pyi
%%PYTHON_SITELIBDIR%%/ortools/sat/cp_model_pb2.py
%%PYTHON_SITELIBDIR%%/ortools/sat/cp_model_pb2.pyi
%%PYTHON_SITELIBDIR%%/ortools/sat/python/__init__.py
%%PYTHON_SITELIBDIR%%/ortools/sat/python/cp_model.py
%%PYTHON_SITELIBDIR%%/ortools/sat/python/cp_model_helper.py
%%PYTHON_SITELIBDIR%%/ortools/sat/python/visualization.py
%%PYTHON_SITELIBDIR%%/ortools/sat/pywrapsat.py
%%PYTHON_SITELIBDIR%%/ortools/sat/sat_parameters_pb2.py
%%PYTHON_SITELIBDIR%%/ortools/sat/sat_parameters_pb2.pyi
%%PYTHON_SITELIBDIR%%/ortools/util/__init__.py
%%PYTHON_SITELIBDIR%%/ortools/util/_sorted_interval_list.so
%%PYTHON_SITELIBDIR%%/ortools/util/optional_boolean_pb2.py
%%PYTHON_SITELIBDIR%%/ortools/util/optional_boolean_pb2.pyi
%%PYTHON_SITELIBDIR%%/ortools/util/sorted_interval_list.py