change the way the native libraries are handled in the pypi module

This commit is contained in:
lperron@google.com
2014-02-14 13:38:07 +00:00
parent 32f508a9d2
commit a9d6f6bf4d
4 changed files with 16 additions and 21 deletions

View File

@@ -264,14 +264,13 @@ ifeq ($(SYSTEM),win)
$(SED) -i -e '/DELETEWIN/d' temp/ortools/setup.py
-del temp\ortools\setup.py-e
else
$(MKDIR) temp$Sortools$Slib
cp lib/_pywrapcp.$(DYNAMIC_SWIG_LIB_SUFFIX) temp/ortools/ortools/constraint_solver
cp lib/_pywraplp.$(DYNAMIC_SWIG_LIB_SUFFIX) temp/ortools/ortools/linear_solver
cp lib/_pywrapgraph.$(DYNAMIC_SWIG_LIB_SUFFIX) temp/ortools/ortools/graph
cp lib/_pywrapknapsack_solver.$(DYNAMIC_SWIG_LIB_SUFFIX) temp/ortools/ortools/algorithms
cp lib/libortools.$(DYNAMIC_LIB_SUFFIX) temp/ortools/lib
cp lib/libortools.$(DYNAMIC_LIB_SUFFIX) temp/ortools/ortools
$(SED) -i -e 's/\.dll/\.so/' temp/ortools/setup.py
$(SED) -i -e 's/DELETEWIN/ /g' temp/ortools/setup.py
$(SED) -i -e 's/DELETEWIN //g' temp/ortools/setup.py
$(SED) -i -e 's/DLL/$(DYNAMIC_LIB_SUFFIX)/g' temp/ortools/setup.py
-rm temp/ortools/setup.py-e
ifeq ($(PLATFORM),MACOSX)

View File

@@ -1,4 +1,4 @@
dependencies/install/bin/patchelf --set-rpath '$ORIGIN/../../lib' temp/ortools/ortools/constraint_solver/_pywrapcp.so
dependencies/install/bin/patchelf --set-rpath '$ORIGIN/../../lib' temp/ortools/ortools/linear_solver/_pywraplp.so
dependencies/install/bin/patchelf --set-rpath '$ORIGIN/../../lib' temp/ortools/ortools/algorithms/_pywrapknapsack_solver.so
dependencies/install/bin/patchelf --set-rpath '$ORIGIN/../../lib' temp/ortools/ortools/graph/_pywrapgraph.so
dependencies/install/bin/patchelf --set-rpath '$ORIGIN/../../ortools' temp/ortools/ortools/constraint_solver/_pywrapcp.so
dependencies/install/bin/patchelf --set-rpath '$ORIGIN/../../ortools' temp/ortools/ortools/linear_solver/_pywraplp.so
dependencies/install/bin/patchelf --set-rpath '$ORIGIN/../../ortools' temp/ortools/ortools/algorithms/_pywrapknapsack_solver.so
dependencies/install/bin/patchelf --set-rpath '$ORIGIN/../../ortools' temp/ortools/ortools/graph/_pywrapgraph.so

View File

@@ -1,6 +1,6 @@
export P=`otool -L temp/ortools/lib/libortools.dylib | grep -v ':' | grep libortools | cut -d '(' -f 1`
echo path to change = $P
install_name_tool -change $P @loader_path/../../lib/libortools.dylib temp/ortools/ortools/algorithms/_pywrapknapsack_solver.so
install_name_tool -change $P @loader_path/../../lib/libortools.dylib temp/ortools/ortools/constraint_solver/_pywrapcp.so
install_name_tool -change $P @loader_path/../../lib/libortools.dylib temp/ortools/ortools/graph/_pywrapgraph.so
install_name_tool -change $P @loader_path/../../lib/libortools.dylib temp/ortools/ortools/linear_solver/_pywraplp.so
install_name_tool -change $P @loader_path/../libortools.dylib temp/ortools/ortools/algorithms/_pywrapknapsack_solver.so
install_name_tool -change $P @loader_path/../libortools.dylib temp/ortools/ortools/constraint_solver/_pywrapcp.so
install_name_tool -change $P @loader_path/../libortools.dylib temp/ortools/ortools/graph/_pywrapgraph.so
install_name_tool -change $P @loader_path/../libortools.dylib temp/ortools/ortools/linear_solver/_pywraplp.so

View File

@@ -26,16 +26,12 @@ setup(
'google-apputils >= 0.4',
'protobuf >= 2.5.0'],
dependency_links = ['http://google-apputils-python.googlecode.com/files/'],
data_files=[(pjoin('ortools', 'constraint_solver'),
[pjoin('ortools', 'constraint_solver', '_pywrapcp.dll')]),
(pjoin('ortools', 'linear_solver'),
[pjoin('ortools', 'linear_solver', '_pywraplp.dll'), ]),
(pjoin('ortools', 'graph'),
[pjoin('ortools', 'graph', '_pywrapgraph.dll'), ]),
(pjoin('ortools', 'algorithms'),
[pjoin('ortools', 'algorithms', '_pywrapknapsack_solver.dll'), ]),
DELETEWIN ('lib', [pjoin('lib', 'libortools.DLL')]),
],
package_data = {
'ortools.constraint_solver' : ['_pywrapcp.dll'],
'ortools.linear_solver' : ['_pywraplp.dll'],
'ortools.graph' : ['_pywrapgraph.dll'],
'ortools.algorithms' : ['_pywrapknapsack_solver.dll'],
DELETEWIN 'ortools' : ['libortools.DLL'] },
license='Apache 2.0',
author = 'Google Inc',
author_email = 'lperron@google.com',