From 4d82602de60b4c94ab4c49f12bb66c47df881cb4 Mon Sep 17 00:00:00 2001 From: debris Date: Fri, 10 Apr 2015 19:30:10 +0200 Subject: [PATCH 01/12] fixed msvc build --- src/jsonrpccpp/CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/jsonrpccpp/CMakeLists.txt b/src/jsonrpccpp/CMakeLists.txt index 34d60e3d..8178481b 100644 --- a/src/jsonrpccpp/CMakeLists.txt +++ b/src/jsonrpccpp/CMakeLists.txt @@ -65,7 +65,7 @@ target_link_libraries(jsonrpccommon ${JSONCPP_LIBRARIES}) set_target_properties(jsonrpccommon PROPERTIES OUTPUT_NAME jsonrpccpp-common) # setup static common library -if (BUILD_STATIC_LIBS) +if (BUILD_STATIC_LIBS OR MSVC) add_library(jsonrpccommonStatic STATIC ${jsonrpc_source_common} ${jsonrpc_header} ${jsonrpc_helper_source_common}) target_link_libraries(jsonrpccommonStatic ${JSONCPP_LIBRARIES}) set_target_properties(jsonrpccommonStatic PROPERTIES OUTPUT_NAME jsonrpccpp-common) @@ -73,33 +73,33 @@ endif() # setup shared client library add_library(jsonrpcclient SHARED ${jsonrpc_source_client} ${jsonrpc_header} ${jsonrpc_header_client} ${client_connector_source}) -add_dependencies(jsonrpcclient jsonrpccommon) target_link_libraries(jsonrpcclient jsonrpccommon ${client_connector_libs}) set_target_properties(jsonrpcclient PROPERTIES OUTPUT_NAME jsonrpccpp-client) # setup static client library -if (BUILD_STATIC_LIBS) +if (BUILD_STATIC_LIBS OR MSVC) add_library(jsonrpcclientStatic STATIC ${jsonrpc_source_client} ${jsonrpc_header} ${jsonrpc_header_client} ${client_connector_source}) target_link_libraries(jsonrpcclientStatic jsonrpccommonStatic ${client_connector_libs}) set_target_properties(jsonrpcclientStatic PROPERTIES OUTPUT_NAME jsonrpccpp-client) + add_dependencies(jsonrpcclient jsonrpccommonStatic) endif() # setup shared server library add_library(jsonrpcserver SHARED ${jsonrpc_source_server} ${jsonrpc_header} ${jsonrpc_header_server} ${server_connector_source}) -add_dependencies(jsonrpcserver jsonrpccommon) target_link_libraries(jsonrpcserver jsonrpccommon ${server_connector_libs}) set_target_properties(jsonrpcserver PROPERTIES OUTPUT_NAME jsonrpccpp-server) # setup static server library -if (BUILD_STATIC_LIBS) +if (BUILD_STATIC_LIBS OR MSVC) add_library(jsonrpcserverStatic STATIC ${jsonrpc_source_server} ${jsonrpc_header} ${jsonrpc_header_server} ${server_connector_source}) target_link_libraries(jsonrpcserverStatic jsonrpccommonStatic ${server_connector_libs}) set_target_properties(jsonrpcserverStatic PROPERTIES OUTPUT_NAME jsonrpccpp-server) + add_dependencies(jsonrpcserver jsonrpccommonStatic) endif() set(ALL_LIBS jsonrpccommon jsonrpcclient jsonrpcserver) -if (BUILD_STATIC_LIBS) +if (BUILD_STATIC_LIBS OR MSVC) list(APPEND ALL_LIBS jsonrpccommonStatic jsonrpcclientStatic jsonrpcserverStatic) endif() From 93b917146ac5cf2f7595049909005e9b56ea515f Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Fri, 10 Apr 2015 19:47:48 +0200 Subject: [PATCH 02/12] appveyor CI --- appveyor.yml | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000..2982e6ca --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,75 @@ +version: 0.5.0.{build} + +branches: + only: + - master + - develop + +os: Windows Server 2012 R2 + +clone_folder: c:\projects\libjson-rpc-cpp + +#platform: Any CPU +#configuration: Debug + +install: + # by default, all script lines are interpreted as batch + +# scripts to run before build +before_build: + + # setup dependency directory + - mkdir c:\projects\libjson-rpc-cpp\deps + - mkdir c:\projects\libjson-rpc-cpp\deps\install + - cd c:\projects\libjson-rpc-cpp\deps + + # get boost + - echo "Downloading boost..." + - curl -O https://build.ethdev.com/builds/windows-precompiled/boost.tar.gz + - echo "Unzipping boost..." + - 7z x boost.tar.gz > nul + - 7z x boost.tar > nul + - echo "boost unzipped!" + - cmake -E copy_directory boost install + + # get curl + - echo "Downloading curl..." + - curl -O https://build.ethdev.com/builds/windows-precompiled/curl.tar.gz + - echo "Unzipping curl..." + - 7z x curl.tar.gz > nul + - 7z x curl.tar > nul + - echo "curl unzipped!" + - cmake -E copy_directory curl install + + # get microhttpd + - echo "Downloading microhttpd..." + - curl -O https://build.ethdev.com/builds/windows-precompiled/microhttpd.tar.gz + - echo "Unzipping microhttpd..." + - 7z x microhttpd.tar.gz > nul + - 7z x microhttpd.tar > nul + - echo "microhttpd unzipped!" + - cmake -E copy_directory microhttpd install + + # get jsoncpp + - echo "Downloading jsoncpp..." + - curl -O https://build.ethdev.com/builds/windows-precompiled/jsoncpp.tar.gz + - echo "Unzipping jsoncpp..." + - 7z x jsoncpp.tar.gz > nul + - 7z x jsoncpp.tar > nul + - echo "jsoncpp unzipped!" + - cmake -E copy_directory jsoncpp install + + # argtable not supported + + - ls + - echo "Running cmake..." + - cd c:\projects\libjson-rpc-cpp + - cmake -DCMAKE_PREFIX_PATH="c:/projects/libjson-rpc-cpp/deps/install" -DCOMPILE_STUBGEN=NO . + +build: + project: ALL_BUILD.vcxproj # path to Visual Studio solution or project + +after_build: + - echo "Running tests..." + - echo "Finished!" + From 403fb41cba225398705eb2bd94856f6fb01d9192 Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Fri, 10 Apr 2015 20:12:09 +0200 Subject: [PATCH 03/12] running tests on appveyor CI after successfull build --- appveyor.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 2982e6ca..44b96e0c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -60,8 +60,7 @@ before_build: - cmake -E copy_directory jsoncpp install # argtable not supported - - - ls + - echo "Running cmake..." - cd c:\projects\libjson-rpc-cpp - cmake -DCMAKE_PREFIX_PATH="c:/projects/libjson-rpc-cpp/deps/install" -DCOMPILE_STUBGEN=NO . @@ -70,6 +69,12 @@ build: project: ALL_BUILD.vcxproj # path to Visual Studio solution or project after_build: + # copy missing dlls + - cd c:\projects\libjson-rpc-cpp\bin\Debug + - cmake -E copy c:\projects\libjson-rpc-cpp\deps\install\bin\libmicrohttpd-dll_d.dll . + + # run tests - echo "Running tests..." + - unit_testsuite.exe - echo "Finished!" From 3cacb0a2a01d33de275592085ba8c2ec3b45703f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Tue, 28 Apr 2015 20:24:59 +0200 Subject: [PATCH 04/12] Add Gentoo install instructions --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index da786f61..074270ab 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,12 @@ For Arch Linux there is a [PKGBUILD provided in the AUR](https://aur.archlinux.o sudo aura -A libjson-rpc-cpp ``` +**Gentoo Linux** + +```sh +sudo emerge dev-cpp/libjson-rpc-cpp +``` + **Mac OS X** For OS X a [Brew](http://brew.sh) package is available: From aadcb86013926dd0d9b9d7a80ad103ecaa345de4 Mon Sep 17 00:00:00 2001 From: Peter Spiess-Knafl Date: Thu, 7 May 2015 10:46:58 +0200 Subject: [PATCH 05/12] deactivate appveyor build. --- appveyor.yml | 80 ---------------------------------------------------- 1 file changed, 80 deletions(-) delete mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 44b96e0c..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,80 +0,0 @@ -version: 0.5.0.{build} - -branches: - only: - - master - - develop - -os: Windows Server 2012 R2 - -clone_folder: c:\projects\libjson-rpc-cpp - -#platform: Any CPU -#configuration: Debug - -install: - # by default, all script lines are interpreted as batch - -# scripts to run before build -before_build: - - # setup dependency directory - - mkdir c:\projects\libjson-rpc-cpp\deps - - mkdir c:\projects\libjson-rpc-cpp\deps\install - - cd c:\projects\libjson-rpc-cpp\deps - - # get boost - - echo "Downloading boost..." - - curl -O https://build.ethdev.com/builds/windows-precompiled/boost.tar.gz - - echo "Unzipping boost..." - - 7z x boost.tar.gz > nul - - 7z x boost.tar > nul - - echo "boost unzipped!" - - cmake -E copy_directory boost install - - # get curl - - echo "Downloading curl..." - - curl -O https://build.ethdev.com/builds/windows-precompiled/curl.tar.gz - - echo "Unzipping curl..." - - 7z x curl.tar.gz > nul - - 7z x curl.tar > nul - - echo "curl unzipped!" - - cmake -E copy_directory curl install - - # get microhttpd - - echo "Downloading microhttpd..." - - curl -O https://build.ethdev.com/builds/windows-precompiled/microhttpd.tar.gz - - echo "Unzipping microhttpd..." - - 7z x microhttpd.tar.gz > nul - - 7z x microhttpd.tar > nul - - echo "microhttpd unzipped!" - - cmake -E copy_directory microhttpd install - - # get jsoncpp - - echo "Downloading jsoncpp..." - - curl -O https://build.ethdev.com/builds/windows-precompiled/jsoncpp.tar.gz - - echo "Unzipping jsoncpp..." - - 7z x jsoncpp.tar.gz > nul - - 7z x jsoncpp.tar > nul - - echo "jsoncpp unzipped!" - - cmake -E copy_directory jsoncpp install - - # argtable not supported - - - echo "Running cmake..." - - cd c:\projects\libjson-rpc-cpp - - cmake -DCMAKE_PREFIX_PATH="c:/projects/libjson-rpc-cpp/deps/install" -DCOMPILE_STUBGEN=NO . - -build: - project: ALL_BUILD.vcxproj # path to Visual Studio solution or project - -after_build: - # copy missing dlls - - cd c:\projects\libjson-rpc-cpp\bin\Debug - - cmake -E copy c:\projects\libjson-rpc-cpp\deps\install\bin\libmicrohttpd-dll_d.dll . - - # run tests - - echo "Running tests..." - - unit_testsuite.exe - - echo "Finished!" - From 01e11b72f437687d44e0caf52b8698f115ebe505 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ricles=20Lopes=20Machado?= Date: Sat, 16 May 2015 23:08:10 -0300 Subject: [PATCH 06/12] Fix bug in JavaScript client --- src/stubgenerator/client/jsclientstubgenerator.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/stubgenerator/client/jsclientstubgenerator.cpp b/src/stubgenerator/client/jsclientstubgenerator.cpp index 7807b925..f2405dd0 100644 --- a/src/stubgenerator/client/jsclientstubgenerator.cpp +++ b/src/stubgenerator/client/jsclientstubgenerator.cpp @@ -23,7 +23,9 @@ using namespace std; request.id = id++;\n\ request.jsonrpc = \"2.0\";\n\ request.method = method;\n\ - request.params = params\n\ + if (params !== null) {\n\ + request.params = params\n\ + }\n\ JSON.stringify(request);\n\ \n\ $.ajax({\n\ From 54eadbda884f47cd125bc7c950676c63ffcbf17c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ricles=20Lopes=20Machado?= Date: Sat, 16 May 2015 23:13:10 -0300 Subject: [PATCH 07/12] Update jsclientstubgenerator.cpp --- src/stubgenerator/client/jsclientstubgenerator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stubgenerator/client/jsclientstubgenerator.cpp b/src/stubgenerator/client/jsclientstubgenerator.cpp index f2405dd0..93044382 100644 --- a/src/stubgenerator/client/jsclientstubgenerator.cpp +++ b/src/stubgenerator/client/jsclientstubgenerator.cpp @@ -24,7 +24,7 @@ using namespace std; request.jsonrpc = \"2.0\";\n\ request.method = method;\n\ if (params !== null) {\n\ - request.params = params\n\ + request.params = params;\n\ }\n\ JSON.stringify(request);\n\ \n\ From 67795bacb508a698550e1218a732f2bdae804b6d Mon Sep 17 00:00:00 2001 From: gogo40 Date: Tue, 19 May 2015 23:22:29 -0300 Subject: [PATCH 08/12] Added a dockerfile to generate the android version of libjson-rpc-cpp --- docker/Dockerfile | 227 +++++++++++++++++++++++++++++++++++ docker/build_android_libs.sh | 5 + 2 files changed, 232 insertions(+) create mode 100644 docker/Dockerfile create mode 100755 docker/build_android_libs.sh diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 00000000..286d492d --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,227 @@ +# THIS DOCKERFILE TRIES TO COMPILE CURL, LIBMICROHTTPD, JSONCPP, ARGTABLE AND LIBJSON-RPC-CPP FOR ANDROID +# Based on Victor Laskin Dockerfile (http://vitiy.info/dockerfile-example-to-compile-libcurl-for-android-inside-docker-container/) + +FROM debian:jessie + +MAINTAINER Péricles Lopes Machado + +ENV ANDROID_SDK_PACKAGE android-sdk_r24.2-linux.tgz +ENV ANDROID_NDK_PACKAGE android-ndk-r10e-linux-x86_64.bin + +# Install compilation tools + +RUN apt-get update && apt-get install -y \ + automake \ + build-essential \ + wget \ + p7zip-full \ + bash + + +# Download SDK / NDK + +RUN mkdir /Android && cd Android && mkdir output +WORKDIR /Android + +RUN wget http://dl.google.com/android/$ANDROID_SDK_PACKAGE +RUN wget http://dl.google.com/android/ndk/$ANDROID_NDK_PACKAGE + +# Extracting ndk/sdk + +RUN tar -xvzf $ANDROID_SDK_PACKAGE && \ + chmod a+x $ANDROID_NDK_PACKAGE && \ + 7z x $ANDROID_NDK_PACKAGE + +# Set ENV variables + +ENV ANDROID_HOME /Android/android-sdk-linux +ENV NDK_ROOT /Android/android-ndk-r10e + +ENV PATH $PATH:$ANDROID_HOME/tools +ENV PATH $PATH:$ANDROID_HOME/platform-tools + +# Make stand alone toolchain (Modify platform / arch here) + +RUN mkdir=toolchain-arm && \ +bash $NDK_ROOT/build/tools/make-standalone-toolchain.sh \ +--verbose --platform=android-14 --install-dir=toolchain-arm \ +--arch=arm --toolchain=arm-linux-androideabi-4.9 --system=linux-x86_64 + +ENV TOOLCHAIN /Android/toolchain-arm +ENV SYSROOT $TOOLCHAIN/sysroot +ENV PATH $PATH:$TOOLCHAIN/bin:$SYSROOT/usr/local/bin + +# Configure toolchain path + +ENV ARCH armv7 + +ENV CROSS_COMPILE arm-linux-androideabi +ENV CC arm-linux-androideabi-gcc +ENV CXX arm-linux-androideabi-g++ +ENV AR arm-linux-androideabi-ar +ENV AS arm-linux-androideabi-as +ENV LD arm-linux-androideabi-ld +ENV RANLIB arm-linux-androideabi-ranlib +ENV NM arm-linux-androideabi-nm +ENV STRIP arm-linux-androideabi-strip +ENV CHOST arm-linux-androideabi + +ENV CPPFLAGS -std=c++11 + +# Download and extract curl + +ENV CFLAGS \ +-v -DANDROID --sysroot=$SYSROOT -mandroid -march=$ARCH -mfloat-abi=softfp -mfpu=vfp -mthumb + +ENV CPPFLAGS $CPPFLAGS $CFLAGS \ +-Wno-psabi -march=armv7-a \ +-mfloat-abi=softfp -mfpu=vfp -ffunction-sections \ +-funwind-tables -fstack-protector -fno-short-enums \ +-DANDROID -Wa,--noexecstack -fno-builtin-memmove \ +-std=gnu++0x -O2 -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -mthumb -std=c++1y -Wall -Wno-psabi -W -D_REENTRANT -fPIE + +ENV LDFLAGS -L${TOOLCHAIN}/include + + +# download, configure and make Zlib + +RUN wget http://zlib.net/zlib-1.2.8.tar.gz && \ + tar -xzf zlib-1.2.8.tar.gz && \ + mv zlib-1.2.8 zlib +RUN cd zlib && ./configure && \ + make && \ + ls -hs . && \ + cp libz.a /Android/output + + +RUN wget http://curl.haxx.se/download/curl-7.38.0.tar.gz && \ + tar -xzf curl-7.38.0.tar.gz +RUN cd curl-7.38.0 && ./configure --host=arm-linux-androideabi \ +--enable-shared --disable-static \ +--disable-dependency-tracking \ +--with-zlib=/Android/zlib --without-ca-bundle --without-ca-path \ +--enable-ipv6 --disable-ftp --disable-file --disable-ldap \ +--disable-ldaps --disable-rtsp --disable-proxy --disable-dict\ + --disable-telnet --disable-tftp --disable-pop3 --disable-imap\ + --disable-smtp --disable-gopher --disable-sspi --disable-manual\ + --target=arm-linux-androideabi --build=x86_64-unknown-linux-gnu || cat config.log + +# Make curl + +RUN cd curl-7.38.0 && \ + make && \ + ls lib/.libs/ && \ + cp lib/.libs/libcurl.so /Android/output && \ + ls -hs /Android/output && \ + mkdir /output + + +# ziplib + +RUN wget http://www.nih.at/libzip/libzip-0.11.2.tar.gz && \ + tar -xzf libzip-0.11.2.tar.gz && \ + mv libzip-0.11.2 libzip && \ + cd libzip && \ + ./configure --help && \ + ./configure --enable-shared --disable-static --host=arm-linux-androideabi --target=arm-linux-androideabi && \ + make && \ + ls -hs lib && \ + cp lib/.libs/libzip.so /Android/output && \ + mkdir /Android/output/ziplib && \ + cp lib/*.c /Android/output/ziplib && \ + cp lib/*.h /Android/output/ziplib && \ + cp config.h /Android/output/ziplib + + +RUN apt-get install -y git cmake + +#clone android-cmake-toolchain +RUN git clone https://github.com/taka-no-me/android-cmake.git + +#clone and build jsoncpp project +RUN git clone https://github.com/gogo40/jsoncpp.git + +RUN mkdir jsoncpp-dev && \ + cd jsoncpp-dev && \ + cmake -DCMAKE_TOOLCHAIN_FILE=/Android/android-cmake/android.toolchain.cmake \ + -DANDROID_NDK=$NDK_ROOT \ + -DCMAKE_BUILD_TYPE=Release \ + -DANDROID_ABI="armeabi-v7a" \ + -DJSONCPP_WITH_TESTS=NO \ + -DBUILD_STATIC_LIBS=OFF -DBUILD_SHARED_LIBS=ON \ + /Android/jsoncpp && \ + make && \ + ls + + +#get and build argtable +RUN wget http://prdownloads.sourceforge.net/argtable/argtable2-13.tar.gz && \ + tar -xzf argtable2-13.tar.gz + +RUN mkdir argtable-dev && \ + cd argtable-dev && \ + cmake -DCMAKE_TOOLCHAIN_FILE=/Android/android-cmake/android.toolchain.cmake \ + -DANDROID_NDK=$NDK_ROOT \ + -DCMAKE_BUILD_TYPE=Release \ + -DANDROID_ABI="armeabi-v7a" \ + /Android/argtable2-13 && \ + make && \ + ls + +#get and build libmicrohttpd +RUN wget http://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.42.tar.gz && \ + tar -xzf libmicrohttpd-0.9.42.tar.gz + +RUN cd libmicrohttpd-0.9.42 && \ + ./configure --host=arm-linux-androideabi \ + --enable-shared --disable-static \ + --disable-dependency-tracking \ + --target=arm-linux-androideabi \ + --build=x86_64-unknown-linux-gnu || cat config.log && \ + make && \ + ls + + +RUN cp /Android/jsoncpp-dev/src/lib_json/libjsoncpp.so /Android/output +RUN cp /Android/argtable-dev/src/libargtable2.a /Android/output +RUN cp /Android/libmicrohttpd-0.9.42/src/microhttpd/.libs/libmicrohttpd.so /Android/output + +#get and build libjson-rpc-cpp-android +RUN git clone https://github.com/cinemast/libjson-rpc-cpp.git + +RUN cd /Android/libjson-rpc-cpp && \ + cmake -DCMAKE_TOOLCHAIN_FILE=/Android/android-cmake/android.toolchain.cmake \ + -DANDROID_NDK=$NDK_ROOT \ + -DCMAKE_BUILD_TYPE=Release \ + -DANDROID_ABI="armeabi-v7a" \ + -DBUILD_STATIC_LIBS=OFF -DBUILD_SHARED_LIBS=ON \ + -DCURL_INCLUDE_DIR=/Android/curl-7.38.0/include \ + -DCURL_LIBRARY=/Android/curl-7.38.0/lib/.libs/libcurl.so \ + -DARGTABLE_INCLUDE_DIR=/Android/argtable2-13/src \ + -DARGTABLE_LIBRARY=/Android/argtable-dev/src/libargtable2.a \ + -DJSONCPP_INCLUDE_DIR=/Android/jsoncpp/include \ + -DJSONCPP_LIBRARY=/Android/jsoncpp-dev/src/lib_json/libjsoncpp.so \ + -DMHD_INCLUDE_DIR=/Android/libmicrohttpd-0.9.42/src/include \ + -DMHD_LIBRARY=/Android/libmicrohttpd-0.9.42/src/microhttpd/.libs/libmicrohttpd.so \ + /Android/libjson-rpc-cpp + +RUN \ +ls /Android/argtable2-13/src && \ +cp -r /Android/curl-7.38.0/include/curl /Android/libjson-rpc-cpp/src && \ +cd /Android/libjson-rpc-cpp && \ + make jsonrpccommon && \ + make jsonrpcserver && \ + make jsonrpcclient + +RUN cp /Android/libjson-rpc-cpp/lib/*.so /Android/output +RUN cp -r /Android/argtable2-13 /Android/output +RUN cp -r /Android/libmicrohttpd-0.9.42 /Android/output +RUN cp -r /Android/jsoncpp /Android/output +RUN cp -r /Android/curl-7.38.0 /Android/output +RUN cp -r /Android/libjson-rpc-cpp /Android/output + +# To get the results run container with output folder +# Example: docker run -v HOSTFOLDER:/output --rm=true IMAGENAME + +ENTRYPOINT cp -r /Android/output/* /output + diff --git a/docker/build_android_libs.sh b/docker/build_android_libs.sh new file mode 100755 index 00000000..d63dce5c --- /dev/null +++ b/docker/build_android_libs.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +docker build -t android/libjson-rpc-cpp . +docker run -v $PWD/output:/output --rm=true android/libjson-rpc-cpp + From 13d9e1d6f3b08cf0f4164ab33195b1bd7c04b50f Mon Sep 17 00:00:00 2001 From: gogo40 Date: Wed, 20 May 2015 04:07:03 -0300 Subject: [PATCH 09/12] improve Dockerfile --- docker/Dockerfile | 167 ++++++++++++++++++++-------------------------- 1 file changed, 74 insertions(+), 93 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 286d492d..7748b5c6 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,6 +1,6 @@ # THIS DOCKERFILE TRIES TO COMPILE CURL, LIBMICROHTTPD, JSONCPP, ARGTABLE AND LIBJSON-RPC-CPP FOR ANDROID # Based on Victor Laskin Dockerfile (http://vitiy.info/dockerfile-example-to-compile-libcurl-for-android-inside-docker-container/) - + FROM debian:jessie MAINTAINER Péricles Lopes Machado @@ -11,11 +11,13 @@ ENV ANDROID_NDK_PACKAGE android-ndk-r10e-linux-x86_64.bin # Install compilation tools RUN apt-get update && apt-get install -y \ - automake \ - build-essential \ - wget \ - p7zip-full \ - bash +automake \ +build-essential \ +wget \ +p7zip-full \ +bash \ +cmake \ +git # Download SDK / NDK @@ -29,8 +31,8 @@ RUN wget http://dl.google.com/android/ndk/$ANDROID_NDK_PACKAGE # Extracting ndk/sdk RUN tar -xvzf $ANDROID_SDK_PACKAGE && \ - chmod a+x $ANDROID_NDK_PACKAGE && \ - 7z x $ANDROID_NDK_PACKAGE +chmod a+x $ANDROID_NDK_PACKAGE && \ +7z x $ANDROID_NDK_PACKAGE # Set ENV variables @@ -82,58 +84,28 @@ ENV CPPFLAGS $CPPFLAGS $CFLAGS \ ENV LDFLAGS -L${TOOLCHAIN}/include - -# download, configure and make Zlib - -RUN wget http://zlib.net/zlib-1.2.8.tar.gz && \ - tar -xzf zlib-1.2.8.tar.gz && \ - mv zlib-1.2.8 zlib -RUN cd zlib && ./configure && \ - make && \ - ls -hs . && \ - cp libz.a /Android/output - - RUN wget http://curl.haxx.se/download/curl-7.38.0.tar.gz && \ - tar -xzf curl-7.38.0.tar.gz +tar -xzf curl-7.38.0.tar.gz RUN cd curl-7.38.0 && ./configure --host=arm-linux-androideabi \ --enable-shared --disable-static \ --disable-dependency-tracking \ --with-zlib=/Android/zlib --without-ca-bundle --without-ca-path \ --enable-ipv6 --disable-ftp --disable-file --disable-ldap \ --disable-ldaps --disable-rtsp --disable-proxy --disable-dict\ - --disable-telnet --disable-tftp --disable-pop3 --disable-imap\ - --disable-smtp --disable-gopher --disable-sspi --disable-manual\ - --target=arm-linux-androideabi --build=x86_64-unknown-linux-gnu || cat config.log +--disable-telnet --disable-tftp --disable-pop3 --disable-imap\ +--disable-smtp --disable-gopher --disable-sspi --disable-manual\ +--target=arm-linux-androideabi --build=x86_64-unknown-linux-gnu || cat config.log # Make curl RUN cd curl-7.38.0 && \ - make && \ - ls lib/.libs/ && \ - cp lib/.libs/libcurl.so /Android/output && \ - ls -hs /Android/output && \ - mkdir /output - - -# ziplib - -RUN wget http://www.nih.at/libzip/libzip-0.11.2.tar.gz && \ - tar -xzf libzip-0.11.2.tar.gz && \ - mv libzip-0.11.2 libzip && \ - cd libzip && \ - ./configure --help && \ - ./configure --enable-shared --disable-static --host=arm-linux-androideabi --target=arm-linux-androideabi && \ - make && \ - ls -hs lib && \ - cp lib/.libs/libzip.so /Android/output && \ - mkdir /Android/output/ziplib && \ - cp lib/*.c /Android/output/ziplib && \ - cp lib/*.h /Android/output/ziplib && \ - cp config.h /Android/output/ziplib - - -RUN apt-get install -y git cmake +make \ +CC=arm-linux-androideabi-gcc \ +CXX=arm-linux-androideabi-g++ && \ +ls lib/.libs/ && \ +cp lib/.libs/libcurl.so /Android/output && \ +ls -hs /Android/output && \ +mkdir /output #clone android-cmake-toolchain RUN git clone https://github.com/taka-no-me/android-cmake.git @@ -142,44 +114,52 @@ RUN git clone https://github.com/taka-no-me/android-cmake.git RUN git clone https://github.com/gogo40/jsoncpp.git RUN mkdir jsoncpp-dev && \ - cd jsoncpp-dev && \ - cmake -DCMAKE_TOOLCHAIN_FILE=/Android/android-cmake/android.toolchain.cmake \ - -DANDROID_NDK=$NDK_ROOT \ - -DCMAKE_BUILD_TYPE=Release \ - -DANDROID_ABI="armeabi-v7a" \ - -DJSONCPP_WITH_TESTS=NO \ - -DBUILD_STATIC_LIBS=OFF -DBUILD_SHARED_LIBS=ON \ - /Android/jsoncpp && \ - make && \ - ls +cd jsoncpp-dev && \ +cmake -DCMAKE_TOOLCHAIN_FILE=/Android/android-cmake/android.toolchain.cmake \ +-DANDROID_NDK=$NDK_ROOT \ +-DCMAKE_BUILD_TYPE=Release \ +-DANDROID_ABI="armeabi-v7a" \ +-DANDROID_NATIVE_API_LEVEL=14 \ +-DJSONCPP_WITH_TESTS=NO \ +-DBUILD_STATIC_LIBS=OFF -DBUILD_SHARED_LIBS=ON \ +/Android/jsoncpp && \ +make \ +CC=arm-linux-androideabi-gcc \ +CXX=arm-linux-androideabi-g++ && \ +ls #get and build argtable RUN wget http://prdownloads.sourceforge.net/argtable/argtable2-13.tar.gz && \ - tar -xzf argtable2-13.tar.gz +tar -xzf argtable2-13.tar.gz RUN mkdir argtable-dev && \ - cd argtable-dev && \ - cmake -DCMAKE_TOOLCHAIN_FILE=/Android/android-cmake/android.toolchain.cmake \ - -DANDROID_NDK=$NDK_ROOT \ - -DCMAKE_BUILD_TYPE=Release \ - -DANDROID_ABI="armeabi-v7a" \ - /Android/argtable2-13 && \ - make && \ - ls +cd argtable-dev && \ +cmake -DCMAKE_TOOLCHAIN_FILE=/Android/android-cmake/android.toolchain.cmake \ +-DANDROID_NDK=$NDK_ROOT \ +-DCMAKE_BUILD_TYPE=Release \ +-DANDROID_ABI="armeabi-v7a" \ +-DANDROID_NATIVE_API_LEVEL=14 \ +/Android/argtable2-13 && \ +make \ +CC=arm-linux-androideabi-gcc \ +CXX=arm-linux-androideabi-g++ && \ +ls #get and build libmicrohttpd RUN wget http://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.42.tar.gz && \ - tar -xzf libmicrohttpd-0.9.42.tar.gz +tar -xzf libmicrohttpd-0.9.42.tar.gz RUN cd libmicrohttpd-0.9.42 && \ - ./configure --host=arm-linux-androideabi \ - --enable-shared --disable-static \ - --disable-dependency-tracking \ - --target=arm-linux-androideabi \ - --build=x86_64-unknown-linux-gnu || cat config.log && \ - make && \ - ls +./configure --host=arm-linux-androideabi \ +--enable-shared --disable-static \ +--disable-dependency-tracking \ +--target=arm-linux-androideabi \ +--build=x86_64-unknown-linux-gnu || cat config.log && \ +make \ +CC=arm-linux-androideabi-gcc \ +CXX=arm-linux-androideabi-g++ && \ +ls RUN cp /Android/jsoncpp-dev/src/lib_json/libjsoncpp.so /Android/output @@ -190,28 +170,29 @@ RUN cp /Android/libmicrohttpd-0.9.42/src/microhttpd/.libs/libmicrohttpd.so /Andr RUN git clone https://github.com/cinemast/libjson-rpc-cpp.git RUN cd /Android/libjson-rpc-cpp && \ - cmake -DCMAKE_TOOLCHAIN_FILE=/Android/android-cmake/android.toolchain.cmake \ - -DANDROID_NDK=$NDK_ROOT \ - -DCMAKE_BUILD_TYPE=Release \ - -DANDROID_ABI="armeabi-v7a" \ - -DBUILD_STATIC_LIBS=OFF -DBUILD_SHARED_LIBS=ON \ - -DCURL_INCLUDE_DIR=/Android/curl-7.38.0/include \ - -DCURL_LIBRARY=/Android/curl-7.38.0/lib/.libs/libcurl.so \ - -DARGTABLE_INCLUDE_DIR=/Android/argtable2-13/src \ - -DARGTABLE_LIBRARY=/Android/argtable-dev/src/libargtable2.a \ - -DJSONCPP_INCLUDE_DIR=/Android/jsoncpp/include \ - -DJSONCPP_LIBRARY=/Android/jsoncpp-dev/src/lib_json/libjsoncpp.so \ - -DMHD_INCLUDE_DIR=/Android/libmicrohttpd-0.9.42/src/include \ - -DMHD_LIBRARY=/Android/libmicrohttpd-0.9.42/src/microhttpd/.libs/libmicrohttpd.so \ - /Android/libjson-rpc-cpp +cmake -DCMAKE_TOOLCHAIN_FILE=/Android/android-cmake/android.toolchain.cmake \ +-DANDROID_NDK=$NDK_ROOT \ +-DCMAKE_BUILD_TYPE=Release \ +-DANDROID_ABI="armeabi-v7a" \ +-DANDROID_NATIVE_API_LEVEL=14 \ +-DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=ON \ +-DCURL_INCLUDE_DIR=/Android/curl-7.38.0/include \ +-DCURL_LIBRARY=/Android/curl-7.38.0/lib/.libs/libcurl.so \ +-DARGTABLE_INCLUDE_DIR=/Android/argtable2-13/src \ +-DARGTABLE_LIBRARY=/Android/argtable-dev/src/libargtable2.a \ +-DJSONCPP_INCLUDE_DIR=/Android/jsoncpp/include \ +-DJSONCPP_LIBRARY=/Android/jsoncpp-dev/src/lib_json/libjsoncpp.so \ +-DMHD_INCLUDE_DIR=/Android/libmicrohttpd-0.9.42/src/include \ +-DMHD_LIBRARY=/Android/libmicrohttpd-0.9.42/src/microhttpd/.libs/libmicrohttpd.so \ +/Android/libjson-rpc-cpp RUN \ ls /Android/argtable2-13/src && \ cp -r /Android/curl-7.38.0/include/curl /Android/libjson-rpc-cpp/src && \ cd /Android/libjson-rpc-cpp && \ - make jsonrpccommon && \ - make jsonrpcserver && \ - make jsonrpcclient +make \ +CC=arm-linux-androideabi-gcc \ +CXX=arm-linux-androideabi-g++ RUN cp /Android/libjson-rpc-cpp/lib/*.so /Android/output RUN cp -r /Android/argtable2-13 /Android/output From d243dce861222788566d32256873b7bfd51eae93 Mon Sep 17 00:00:00 2001 From: gogo40 Date: Wed, 20 May 2015 04:15:20 -0300 Subject: [PATCH 10/12] using debian:sid --- docker/Dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 7748b5c6..298eb908 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,7 +1,7 @@ # THIS DOCKERFILE TRIES TO COMPILE CURL, LIBMICROHTTPD, JSONCPP, ARGTABLE AND LIBJSON-RPC-CPP FOR ANDROID # Based on Victor Laskin Dockerfile (http://vitiy.info/dockerfile-example-to-compile-libcurl-for-android-inside-docker-container/) -FROM debian:jessie +FROM debian:sid MAINTAINER Péricles Lopes Machado @@ -17,7 +17,10 @@ wget \ p7zip-full \ bash \ cmake \ -git +git \ +libjsonrpccpp-dev \ +libjsonrpccpp \ +libjsonrpccpp-tools # Download SDK / NDK From 6ebb1b9a5ae8725319b1800a37ff8fbbf4d5ecee Mon Sep 17 00:00:00 2001 From: gogo40 Date: Wed, 20 May 2015 04:32:10 -0300 Subject: [PATCH 11/12] libjsonrpc-cpp-tools added in dockerfile --- docker/Dockerfile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 298eb908..297ccf7e 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -19,7 +19,6 @@ bash \ cmake \ git \ libjsonrpccpp-dev \ -libjsonrpccpp \ libjsonrpccpp-tools @@ -94,10 +93,10 @@ RUN cd curl-7.38.0 && ./configure --host=arm-linux-androideabi \ --disable-dependency-tracking \ --with-zlib=/Android/zlib --without-ca-bundle --without-ca-path \ --enable-ipv6 --disable-ftp --disable-file --disable-ldap \ ---disable-ldaps --disable-rtsp --disable-proxy --disable-dict\ ---disable-telnet --disable-tftp --disable-pop3 --disable-imap\ ---disable-smtp --disable-gopher --disable-sspi --disable-manual\ ---target=arm-linux-androideabi --build=x86_64-unknown-linux-gnu || cat config.log +--disable-ldaps --disable-rtsp --disable-proxy --disable-dict \ +--disable-telnet --disable-tftp --disable-pop3 --disable-imap \ +--disable-smtp --disable-gopher --disable-sspi --disable-manual \ +--target=arm-linux-androideabi --build=x86_64-unknown-linux-gnu # Make curl From 1798576d7c7b5c41405d00a43f11587c3afbcf08 Mon Sep 17 00:00:00 2001 From: gogo40 Date: Wed, 10 Jun 2015 12:12:30 -0300 Subject: [PATCH 12/12] create a Dockerfile to build libjson-rpc-cpp n Linux/Debian --- docker/Dockerfile | 220 +++++------------------------- docker/build_android_libs.sh | 5 - docker/build_linux_debian_libs.sh | 5 + 3 files changed, 37 insertions(+), 193 deletions(-) delete mode 100755 docker/build_android_libs.sh create mode 100755 docker/build_linux_debian_libs.sh diff --git a/docker/Dockerfile b/docker/Dockerfile index 297ccf7e..6c4e5b3e 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,210 +1,54 @@ -# THIS DOCKERFILE TRIES TO COMPILE CURL, LIBMICROHTTPD, JSONCPP, ARGTABLE AND LIBJSON-RPC-CPP FOR ANDROID +# THIS DOCKERFILE DOWNLOADS AND COMPILES CURL, LIBMICROHTTPD, JSONCPP, ARGTABLE AND LIBJSON-RPC-CPP FOR LINUX/DEBIAN + +# 2015, author: Péricles Lopes Machado (gogo40) # Based on Victor Laskin Dockerfile (http://vitiy.info/dockerfile-example-to-compile-libcurl-for-android-inside-docker-container/) FROM debian:sid MAINTAINER Péricles Lopes Machado -ENV ANDROID_SDK_PACKAGE android-sdk_r24.2-linux.tgz -ENV ANDROID_NDK_PACKAGE android-ndk-r10e-linux-x86_64.bin +# Create output directories + +# Directory to export generated files +RUN mkdir /output + +# Directory with generated files +RUN mkdir /build && mkdir /build/include # Install compilation tools -RUN apt-get update && apt-get install -y \ -automake \ -build-essential \ +RUN apt-get update + +RUN apt-get install -y \ wget \ -p7zip-full \ -bash \ +build-essential \ cmake \ -git \ -libjsonrpccpp-dev \ -libjsonrpccpp-tools +libjsoncpp-dev \ +libargtable2-dev \ +libcurl4-openssl-dev \ +libmicrohttpd-dev \ +git +# Clone and build libjson-rpc-cpp -# Download SDK / NDK +RUN git clone https://github.com/cinemast/libjson-rpc-cpp.git -RUN mkdir /Android && cd Android && mkdir output -WORKDIR /Android - -RUN wget http://dl.google.com/android/$ANDROID_SDK_PACKAGE -RUN wget http://dl.google.com/android/ndk/$ANDROID_NDK_PACKAGE - -# Extracting ndk/sdk +RUN cd /libjson-rpc-cpp && \ +cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=ON \ +/libjson-rpc-cpp -RUN tar -xvzf $ANDROID_SDK_PACKAGE && \ -chmod a+x $ANDROID_NDK_PACKAGE && \ -7z x $ANDROID_NDK_PACKAGE +RUN cd /libjson-rpc-cpp && \ +make -j $(nproc) && \ +make install -# Set ENV variables - -ENV ANDROID_HOME /Android/android-sdk-linux -ENV NDK_ROOT /Android/android-ndk-r10e - -ENV PATH $PATH:$ANDROID_HOME/tools -ENV PATH $PATH:$ANDROID_HOME/platform-tools - -# Make stand alone toolchain (Modify platform / arch here) - -RUN mkdir=toolchain-arm && \ -bash $NDK_ROOT/build/tools/make-standalone-toolchain.sh \ ---verbose --platform=android-14 --install-dir=toolchain-arm \ ---arch=arm --toolchain=arm-linux-androideabi-4.9 --system=linux-x86_64 - -ENV TOOLCHAIN /Android/toolchain-arm -ENV SYSROOT $TOOLCHAIN/sysroot -ENV PATH $PATH:$TOOLCHAIN/bin:$SYSROOT/usr/local/bin - -# Configure toolchain path - -ENV ARCH armv7 - -ENV CROSS_COMPILE arm-linux-androideabi -ENV CC arm-linux-androideabi-gcc -ENV CXX arm-linux-androideabi-g++ -ENV AR arm-linux-androideabi-ar -ENV AS arm-linux-androideabi-as -ENV LD arm-linux-androideabi-ld -ENV RANLIB arm-linux-androideabi-ranlib -ENV NM arm-linux-androideabi-nm -ENV STRIP arm-linux-androideabi-strip -ENV CHOST arm-linux-androideabi - -ENV CPPFLAGS -std=c++11 - -# Download and extract curl - -ENV CFLAGS \ --v -DANDROID --sysroot=$SYSROOT -mandroid -march=$ARCH -mfloat-abi=softfp -mfpu=vfp -mthumb - -ENV CPPFLAGS $CPPFLAGS $CFLAGS \ --Wno-psabi -march=armv7-a \ --mfloat-abi=softfp -mfpu=vfp -ffunction-sections \ --funwind-tables -fstack-protector -fno-short-enums \ --DANDROID -Wa,--noexecstack -fno-builtin-memmove \ --std=gnu++0x -O2 -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -mthumb -std=c++1y -Wall -Wno-psabi -W -D_REENTRANT -fPIE - -ENV LDFLAGS -L${TOOLCHAIN}/include - -RUN wget http://curl.haxx.se/download/curl-7.38.0.tar.gz && \ -tar -xzf curl-7.38.0.tar.gz -RUN cd curl-7.38.0 && ./configure --host=arm-linux-androideabi \ ---enable-shared --disable-static \ ---disable-dependency-tracking \ ---with-zlib=/Android/zlib --without-ca-bundle --without-ca-path \ ---enable-ipv6 --disable-ftp --disable-file --disable-ldap \ ---disable-ldaps --disable-rtsp --disable-proxy --disable-dict \ ---disable-telnet --disable-tftp --disable-pop3 --disable-imap \ ---disable-smtp --disable-gopher --disable-sspi --disable-manual \ ---target=arm-linux-androideabi --build=x86_64-unknown-linux-gnu - -# Make curl - -RUN cd curl-7.38.0 && \ -make \ -CC=arm-linux-androideabi-gcc \ -CXX=arm-linux-androideabi-g++ && \ -ls lib/.libs/ && \ -cp lib/.libs/libcurl.so /Android/output && \ -ls -hs /Android/output && \ -mkdir /output - -#clone android-cmake-toolchain -RUN git clone https://github.com/taka-no-me/android-cmake.git - -#clone and build jsoncpp project -RUN git clone https://github.com/gogo40/jsoncpp.git - -RUN mkdir jsoncpp-dev && \ -cd jsoncpp-dev && \ -cmake -DCMAKE_TOOLCHAIN_FILE=/Android/android-cmake/android.toolchain.cmake \ --DANDROID_NDK=$NDK_ROOT \ --DCMAKE_BUILD_TYPE=Release \ --DANDROID_ABI="armeabi-v7a" \ --DANDROID_NATIVE_API_LEVEL=14 \ --DJSONCPP_WITH_TESTS=NO \ --DBUILD_STATIC_LIBS=OFF -DBUILD_SHARED_LIBS=ON \ -/Android/jsoncpp && \ -make \ -CC=arm-linux-androideabi-gcc \ -CXX=arm-linux-androideabi-g++ && \ -ls - - -#get and build argtable -RUN wget http://prdownloads.sourceforge.net/argtable/argtable2-13.tar.gz && \ -tar -xzf argtable2-13.tar.gz - -RUN mkdir argtable-dev && \ -cd argtable-dev && \ -cmake -DCMAKE_TOOLCHAIN_FILE=/Android/android-cmake/android.toolchain.cmake \ --DANDROID_NDK=$NDK_ROOT \ --DCMAKE_BUILD_TYPE=Release \ --DANDROID_ABI="armeabi-v7a" \ --DANDROID_NATIVE_API_LEVEL=14 \ -/Android/argtable2-13 && \ -make \ -CC=arm-linux-androideabi-gcc \ -CXX=arm-linux-androideabi-g++ && \ -ls - -#get and build libmicrohttpd -RUN wget http://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.42.tar.gz && \ -tar -xzf libmicrohttpd-0.9.42.tar.gz - -RUN cd libmicrohttpd-0.9.42 && \ -./configure --host=arm-linux-androideabi \ ---enable-shared --disable-static \ ---disable-dependency-tracking \ ---target=arm-linux-androideabi \ ---build=x86_64-unknown-linux-gnu || cat config.log && \ -make \ -CC=arm-linux-androideabi-gcc \ -CXX=arm-linux-androideabi-g++ && \ -ls - - -RUN cp /Android/jsoncpp-dev/src/lib_json/libjsoncpp.so /Android/output -RUN cp /Android/argtable-dev/src/libargtable2.a /Android/output -RUN cp /Android/libmicrohttpd-0.9.42/src/microhttpd/.libs/libmicrohttpd.so /Android/output - -#get and build libjson-rpc-cpp-android -RUN git clone https://github.com/cinemast/libjson-rpc-cpp.git +# Copy to output generated files -RUN cd /Android/libjson-rpc-cpp && \ -cmake -DCMAKE_TOOLCHAIN_FILE=/Android/android-cmake/android.toolchain.cmake \ --DANDROID_NDK=$NDK_ROOT \ --DCMAKE_BUILD_TYPE=Release \ --DANDROID_ABI="armeabi-v7a" \ --DANDROID_NATIVE_API_LEVEL=14 \ --DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=ON \ --DCURL_INCLUDE_DIR=/Android/curl-7.38.0/include \ --DCURL_LIBRARY=/Android/curl-7.38.0/lib/.libs/libcurl.so \ --DARGTABLE_INCLUDE_DIR=/Android/argtable2-13/src \ --DARGTABLE_LIBRARY=/Android/argtable-dev/src/libargtable2.a \ --DJSONCPP_INCLUDE_DIR=/Android/jsoncpp/include \ --DJSONCPP_LIBRARY=/Android/jsoncpp-dev/src/lib_json/libjsoncpp.so \ --DMHD_INCLUDE_DIR=/Android/libmicrohttpd-0.9.42/src/include \ --DMHD_LIBRARY=/Android/libmicrohttpd-0.9.42/src/microhttpd/.libs/libmicrohttpd.so \ -/Android/libjson-rpc-cpp - -RUN \ -ls /Android/argtable2-13/src && \ -cp -r /Android/curl-7.38.0/include/curl /Android/libjson-rpc-cpp/src && \ -cd /Android/libjson-rpc-cpp && \ -make \ -CC=arm-linux-androideabi-gcc \ -CXX=arm-linux-androideabi-g++ - -RUN cp /Android/libjson-rpc-cpp/lib/*.so /Android/output -RUN cp -r /Android/argtable2-13 /Android/output -RUN cp -r /Android/libmicrohttpd-0.9.42 /Android/output -RUN cp -r /Android/jsoncpp /Android/output -RUN cp -r /Android/curl-7.38.0 /Android/output -RUN cp -r /Android/libjson-rpc-cpp /Android/output +RUN cp -r /libjson-rpc-cpp/lib /build +RUN cp -r /usr/local/include/jsonrpccpp /build/include/jsonrpccpp # To get the results run container with output folder # Example: docker run -v HOSTFOLDER:/output --rm=true IMAGENAME -ENTRYPOINT cp -r /Android/output/* /output +ENTRYPOINT cp -r /build/* /output + diff --git a/docker/build_android_libs.sh b/docker/build_android_libs.sh deleted file mode 100755 index d63dce5c..00000000 --- a/docker/build_android_libs.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -docker build -t android/libjson-rpc-cpp . -docker run -v $PWD/output:/output --rm=true android/libjson-rpc-cpp - diff --git a/docker/build_linux_debian_libs.sh b/docker/build_linux_debian_libs.sh new file mode 100755 index 00000000..a0b56b5a --- /dev/null +++ b/docker/build_linux_debian_libs.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +docker build -t debian/libjson-rpc-cpp . +docker run -v $PWD/output:/output --rm=true debian/libjson-rpc-cpp +