This repository has been archived by the owner on Feb 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from stephentu/master
Add conda recipes for distributions
- Loading branch information
Showing
8 changed files
with
118 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
libprotobuf recipe is copied from: | ||
https://github.com/stephentu/conda-recipes/tree/master/libprotobuf | ||
|
||
it is not pushed to conda-recipes since it builds against libc++ instead of libstdc++, | ||
and is replicated here for convenience | ||
|
||
the protobuf recipe is pushed mainstream to conda/conda-recipes: | ||
https://github.com/conda/conda-recipes/tree/master/protobuf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh | ||
if [ "`uname`" = "Darwin" ]; then | ||
export MACOSX_DEPLOYMENT_TARGET=10.7 | ||
fi | ||
echo "Conda build env" | ||
printenv | ||
echo "protoc: `which protoc`" | ||
git clone https://github.com/forcedotcom/distributions.git | ||
cd distributions && git checkout tags/2.0.23 | ||
make protobuf | ||
mkdir build && cd build | ||
DISTRIBUTIONS_USE_PROTOBUF=1 cmake \ | ||
-DCMAKE_INSTALL_PREFIX=${PREFIX} \ | ||
-DEXTRA_INCLUDE_PATH=${PREFIX}/include \ | ||
-DEXTRA_LIBRARY_PATH=${PREFIX}/lib .. | ||
make VERBOSE=1 && make install | ||
cd .. | ||
PYDISTRIBUTIONS_USE_LIB=1 LIBRARY_PATH=${PREFIX}/lib EXTRA_INCLUDE_PATH=${PREFIX}/include $PYTHON setup.py install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package: | ||
name: distributions | ||
version: "2.0.23" | ||
|
||
requirements: | ||
build: | ||
- cmake | ||
- python | ||
- numpy | ||
- cython >=0.20.2 | ||
- libprotobuf | ||
- pyflakes | ||
- eigen3 | ||
run: | ||
- python | ||
- numpy | ||
- protobuf | ||
- libprotobuf | ||
- simplejson | ||
|
||
test: | ||
imports: | ||
- distributions | ||
- distributions.lp | ||
- distributions.lp.models | ||
- distributions.lp.models.bb | ||
|
||
about: | ||
home: https://github.com/forcedotcom/distributions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/sh | ||
export CXXFLAGS="-I${PREFIX}/include" | ||
export LDFLAGS="-L${PREFIX}/lib" | ||
export PKG_CONFIG_PATH="${PREFIX}/lib/pkgconfig" | ||
if [ "`uname`" = "Darwin" ]; then | ||
# conda sets MACOSX_DEPLOYMENT_TARGET=10.5, but we need to build with | ||
# -stdlib=libc++; see | ||
# https://code.google.com/p/protobuf/issues/detail?id=449 | ||
export MACOSX_DEPLOYMENT_TARGET=10.7 | ||
export CXXFLAGS="${CXXFLAGS}" | ||
export CC=clang | ||
export CXX="clang++ -std=c++11 -stdlib=libc++" | ||
fi | ||
./configure --prefix=${PREFIX} --without-zlib | ||
make -j | ||
make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package: | ||
name: libprotobuf | ||
version: "2.5.0" | ||
|
||
source: | ||
fn: libprotobuf-2.5.0.tar.gz | ||
url: https://protobuf.googlecode.com/files/protobuf-2.5.0.tar.gz | ||
sha1: 7f6ea7bc1382202fb1ce8c6933f1ef8fea0c0148 | ||
|
||
test: | ||
files: | ||
- schema.proto | ||
- test.cc | ||
|
||
about: | ||
home: http://code.google.com/p/protobuf/ | ||
license: New BSD License | ||
summary: 'Protocol Buffers C library/compiler' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/sh | ||
if [ "`uname`" = "Darwin" ]; then | ||
# conda sets MACOSX_DEPLOYMENT_TARGET=10.5, but we need to build with | ||
# -stdlib=libc++ | ||
export MACOSX_DEPLOYMENT_TARGET=10.7 | ||
export CXX="g++ -stdlib=libc++" | ||
else | ||
export CXX=g++ | ||
fi | ||
echo "Conda testing env:" | ||
printenv | ||
protoc schema.proto --cpp_out=. | ||
${CXX} -v -I${PREFIX}/include -L${PREFIX}/lib -o test test.cc schema.pb.cc -lprotobuf | ||
export DYLD_LIBRARY_PATH=${PREFIX}/lib | ||
export LD_LIBRARY_PATH=${PREFIX}/lib | ||
./test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
message HelloWorld { | ||
required string message = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#include "schema.pb.h" | ||
#include <cassert> | ||
int | ||
main(int argc, char **argv) | ||
{ | ||
HelloWorld m; | ||
m.set_message("hi"); | ||
assert( m.message() == "hi" ); | ||
return 0; | ||
} |