Skip to content

Commit

Permalink
Add recipe for lpsolve55
Browse files Browse the repository at this point in the history
  • Loading branch information
mliu49 committed Nov 4, 2016
1 parent ca1ffaa commit 23c2e17
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lpsolve55/bld.bat
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions lpsolve55/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

cd ./extra/Python
$PYTHON setup.py install
10 changes: 10 additions & 0 deletions lpsolve55/hash_osx.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- ./extra/Python/hash.c
+++ ./extra/Python/hash.c
@@ -8,7 +8,6 @@

#include <sys/types.h>
#include <stdlib.h>
-#include <malloc.h>
#include <string.h>

#include "hash.h"
37 changes: 37 additions & 0 deletions lpsolve55/meta.yaml
Original file line number Diff line number Diff line change
@@ -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"
23 changes: 23 additions & 0 deletions lpsolve55/setup.patch
Original file line number Diff line number Diff line change
@@ -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"])
]
11 changes: 11 additions & 0 deletions lpsolve55/setup_win.patch
Original file line number Diff line number Diff line change
@@ -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"])
]

0 comments on commit 23c2e17

Please sign in to comment.