diff --git a/lpsolve55/bld.bat b/lpsolve55/bld.bat new file mode 100755 index 0000000..c9f96b8 --- /dev/null +++ b/lpsolve55/bld.bat @@ -0,0 +1,6 @@ +copy "%PREFIX%\..\..\libs\libpython27.dll.a" "%PREFIX%\libs\libpython27.a" +copy "%PREFIX%\..\..\Lib\distutils\distutils.cfg" "%PREFIX%\Lib\distutils\distutils.cfg" + +cd extra\Python +"%PYTHON%" setup.py install +if errorlevel 1 exit 1 diff --git a/lpsolve55/build.sh b/lpsolve55/build.sh new file mode 100644 index 0000000..cb637f1 --- /dev/null +++ b/lpsolve55/build.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +cd ./extra/Python +$PYTHON setup.py install diff --git a/lpsolve55/hash_osx.patch b/lpsolve55/hash_osx.patch new file mode 100644 index 0000000..11fdc89 --- /dev/null +++ b/lpsolve55/hash_osx.patch @@ -0,0 +1,10 @@ +--- ./extra/Python/hash.c ++++ ./extra/Python/hash.c +@@ -8,7 +8,6 @@ + + #include + #include +-#include + #include + + #include "hash.h" diff --git a/lpsolve55/meta.yaml b/lpsolve55/meta.yaml new file mode 100644 index 0000000..3e87426 --- /dev/null +++ b/lpsolve55/meta.yaml @@ -0,0 +1,37 @@ +package: + name: lpsolve55 + version: 5.5 + +source: + fn: lp_solve_5.5.2.5_Python_source.tar.gz + url: https://sourceforge.net/projects/lpsolve/files/lpsolve/5.5.2.5/lp_solve_5.5.2.5_Python_source.tar.gz + md5: 937f97a6e236e6ddc095485673a7a9ce + + patches: + - setup.patch # [unix] + - setup_win.patch # [win] + - hash_osx.patch # [osx] + +build: + number: 1 + +requirements: + build: + - python + - setuptools + - numpy + - lpsolve + + run: + - python + - numpy + - lpsolve + +test: + imports: + - lpsolve55 + +about: + home: http://lpsolve.sourceforge.net/ + license: LGPL + summary: "Linear Program Solver, Python Interface to lpsolve" diff --git a/lpsolve55/setup.patch b/lpsolve55/setup.patch new file mode 100644 index 0000000..854e1a1 --- /dev/null +++ b/lpsolve55/setup.patch @@ -0,0 +1,23 @@ +--- ./extra/Python/setup.py ++++ ./extra/Python/setup.py +@@ -6,9 +6,9 @@ + NUMPYPATH = '.' + if os.path.isdir(p + '/include/numpy'): + NUMPY = 'NUMPY' +-elif os.path.isdir(p + '/Lib/site-packages/numpy/core/include/numpy'): ++elif os.path.isdir(p + '/lib/python2.7/site-packages/numpy/core/include/numpy'): + NUMPY = 'NUMPY' +- NUMPYPATH = p + '/Lib/site-packages/numpy/core/include' ++ NUMPYPATH = p + '/lib/python2.7/site-packages/numpy/core/include' + else: + NUMPY = 'NONUMPY' + print 'numpy: ' + NUMPY +@@ -29,7 +29,7 @@ + ext_modules = [Extension("lpsolve55", + ["lpsolve.c", "hash.c", "pythonmod.c"], + define_macros=[('PYTHON', '1'), (WIN32, '1'), ('NODEBUG', '1'), ('DINLINE', 'static'), (NUMPY, '1'), ('_CRT_SECURE_NO_WARNINGS', '1')], +- include_dirs=['../..', NUMPYPATH], ++ include_dirs=[p + '/include', NUMPYPATH], + library_dirs=[LPSOLVE55], + libraries = ["lpsolve55"]) + ] diff --git a/lpsolve55/setup_win.patch b/lpsolve55/setup_win.patch new file mode 100644 index 0000000..2f35afd --- /dev/null +++ b/lpsolve55/setup_win.patch @@ -0,0 +1,11 @@ +--- ./extra/Python/setup.py ++++ ./extra/Python/setup.py +@@ -29,7 +29,7 @@ + ext_modules = [Extension("lpsolve55", + ["lpsolve.c", "hash.c", "pythonmod.c"], + define_macros=[('PYTHON', '1'), (WIN32, '1'), ('NODEBUG', '1'), ('DINLINE', 'static'), (NUMPY, '1'), ('_CRT_SECURE_NO_WARNINGS', '1')], +- include_dirs=['../..', NUMPYPATH], ++ include_dirs=[p + '/Library/include/lpsolve', NUMPYPATH], + library_dirs=[LPSOLVE55], + libraries = ["lpsolve55"]) + ]