Commit 5c8ee61e authored by Jaromil's avatar Jaromil
Browse files

build the python module on OSX

install swig in travis' brew,
use gcc in place of ld for osx
always use CC for -shared linking of python modules
parent a8507a1e
......@@ -27,12 +27,14 @@ addons:
before_install:
- git submodule update --init --recursive
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install swig; fi
# - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker run -dit --name emscripten -v $(pwd):/src trzeci/emscripten:sdk-incoming-64bit bash ; fi
# - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then mkdir -p /usr/local/musl/lib && cp /usr/lib/x86_64-linux-musl/libc.a /usr/local/musl/lib/libc.a ;fi
script:
- mkdir -p build
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then make osx && make check-osx && cp -v src/zenroom.command build/zenroom.command; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then make osx-python && cp -v src/_zenroom.so build/_zenroom.so; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then make clean && cd lib/milagro-crypto-c && git clean -fd && cd - ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then make ios-armv7; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then make clean && cd lib/milagro-crypto-c && git clean -fd && cd - ;fi
......@@ -60,6 +62,18 @@ deploy:
repo: DECODEproject/zenroom
branch: "$RELEASE_BRANCH"
condition: $TRAVIS_OS_NAME = osx
- provider: releases
api_key:
secure: lHmD0cuCkAxWT4s4s7HX8Wz4qrpm8XBbz1GT/Ei56iZJAUTtTEQqAyqD22MnqnBAtpOlSHx/S92iok/VAWmW22H9PD58cob7oimfmkViJq/xLg1x7EW2xVQL2tDF+eB2Rv2iQQ9UBuIy9jSftnlZSs3RBiLzFQDrSLTZe2KDOLrGk4WAuHGpl568jWuHAGNVmSBLSekhw1ucQQhy77qSz/zLp7XH09/Qrk0iYqoVSqgx4wKoeNFHHgq2EB67t1/ar2PAAUHMkpYSxxqNog0wr4OVpOtxBj0f1HJ5gdsAZUXpFyownymZc3fC2UMMJwjgUTcOCnlDW7GUw/kEMneXaGKAlHoH5r7r5gXk4pDCGA4gsk4TMkXwu0rJ6mOKgyKc9XWjBJoCvp2+uFMkEiwQA/VUU9GdoyxH4uKc6VjZo9YajJ89DjV4djr7l6E+0AWHaIo1TvdD5LiaXwM836afzXegwHGEC6yxL4TqZYdyLetxLRweIHY9E9D3Lb9y8qkQU5ZmGxdNV5BK2PmmzupV8Va4wwk5ONnRTAwYWmpmTTBll7DwE98HvmW/yDqIPlyGWk0/pGsCJSnxTbAnu1uns0qQrljpTCms46cezCiWZhlKcFwBucQ0999LOULKPTffVHzRdc4HLWW5XUVQsnlE8kiWALhayiE+Y3wgiPvAgP8=
file: build/_zenroom.so
skip_cleanup: true
draft: true
name: Zenroom $TRAVIS_TAG Python module (Apple/OSX build)
on:
tags: true
repo: DECODEproject/zenroom
branch: "$RELEASE_BRANCH"
condition: $TRAVIS_OS_NAME = osx
- provider: releases
api_key:
secure: lHmD0cuCkAxWT4s4s7HX8Wz4qrpm8XBbz1GT/Ei56iZJAUTtTEQqAyqD22MnqnBAtpOlSHx/S92iok/VAWmW22H9PD58cob7oimfmkViJq/xLg1x7EW2xVQL2tDF+eB2Rv2iQQ9UBuIy9jSftnlZSs3RBiLzFQDrSLTZe2KDOLrGk4WAuHGpl568jWuHAGNVmSBLSekhw1ucQQhy77qSz/zLp7XH09/Qrk0iYqoVSqgx4wKoeNFHHgq2EB67t1/ar2PAAUHMkpYSxxqNog0wr4OVpOtxBj0f1HJ5gdsAZUXpFyownymZc3fC2UMMJwjgUTcOCnlDW7GUw/kEMneXaGKAlHoH5r7r5gXk4pDCGA4gsk4TMkXwu0rJ6mOKgyKc9XWjBJoCvp2+uFMkEiwQA/VUU9GdoyxH4uKc6VjZo9YajJ89DjV4djr7l6E+0AWHaIo1TvdD5LiaXwM836afzXegwHGEC6yxL4TqZYdyLetxLRweIHY9E9D3Lb9y8qkQU5ZmGxdNV5BK2PmmzupV8Va4wwk5ONnRTAwYWmpmTTBll7DwE98HvmW/yDqIPlyGWk0/pGsCJSnxTbAnu1uns0qQrljpTCms46cezCiWZhlKcFwBucQ0999LOULKPTffVHzRdc4HLWW5XUVQsnlE8kiWALhayiE+Y3wgiPvAgP8=
......
......@@ -136,8 +136,15 @@ linux-lib: cflags += -shared -DLIBRARY
linux-python: apply-patches lua53 milagro lpeglabel
swig -python ${pwd}/build/swig.i
${gcc} ${cflags} -c ${pwd}/build/swig_wrap.c \
-o src/zen_python.o $(shell pkg-config python --cflags)
CC=${gcc} CFLAGS="${cflags}" LDFLAGS="${ldflags}" LDADD="${ldadd}" \
-o src/zen_python.o
CC=${gcc} LD=${ld} CFLAGS="${cflags}" LDFLAGS="${ldflags}" LDADD="${ldadd}" \
make -C src python
osx-python: apply-patches lua53 milagro lpeglabel
swig -python ${pwd}/build/swig.i
${gcc} ${cflags} -c ${pwd}/build/swig_wrap.c \
-o src/zen_python.o
CC=${gcc} LD=${ld} CFLAGS="${cflags}" LDFLAGS="${ldflags}" LDADD="${ldadd}" \
make -C src python
linux-go: apply-patches lua53 milagro lpeglabel
......
......@@ -64,10 +64,16 @@ endif
ifneq (,$(findstring osx,$(MAKECMDGOALS)))
cflags := ${cflags} -fPIC ${cflags_protection} -D'ARCH=\"OSX\"' -DARCH_OSX
ld := ${gcc}
ldflags := -lm
system := Darwin
endif
ifneq (,$(findstring python,$(MAKECMDGOALS)))
cflags += $(shell pkg-config python --cflags)
ldflags += $(shell pkg-config python --libs)
endif
ifneq (,$(findstring javascript,$(MAKECMDGOALS)))
gcc := ${EMSCRIPTEN}/emcc
ar := ${EMSCRIPTEN}/emar
......
......@@ -55,7 +55,7 @@ linux-lib: ${SOURCES}
${CC} ${CFLAGS} ${SOURCES} -o libzenroom-${ARCH}-${VERSION}-${BRANCH}-${HASH}.so ${LDFLAGS} ${LDADD}
python: ${SOURCES}
${LD} -shared ${SOURCES} zen_python.o -o _zenroom.so ${LDFLAGS} ${LDADD}
${CC} -shared ${SOURCES} zen_python.o -o _zenroom.so ${LDFLAGS} ${LDADD}
go: ${SOURCES}
${LD} -shared ${SOURCES} zen_go.o -o libzenroomgo.so ${LDFLAGS} ${LDADD}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment