diff --git a/.circleci/config.yml b/.circleci/config.yml index b98356af3..44db59e69 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,7 +13,6 @@ jobs: - setup_remote_docker: version: 18.06.0-ce - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=debian --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test - - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=fedora --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test raspberrypi3: docker: @@ -28,8 +27,7 @@ jobs: - setup_remote_docker: version: 18.06.0-ce - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=debian --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test - - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=fedora --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test - + raspberrypi2: docker: - image: docker:18.06.0-ce-git @@ -43,23 +41,32 @@ jobs: - setup_remote_docker: version: 18.06.0-ce - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=debian --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test - - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=fedora --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test - + bananapi_m1_plus: - docker: - - image: docker:18.06.0-ce-git - working_directory: $GOPATH/src/github.com/skycoin/libskycoin - environment: - QEMU_PLATFORM: bananapi-m1-plus - - steps: - - run: mkdir -p $GOPATH/src/github.com/ $GOPATH/src/github.com/skycoin - - checkout - - setup_remote_docker: - version: 18.06.0-ce - - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=debian --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test - - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=fedora --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test - + docker: + - image: docker:18.06.0-ce-git + working_directory: $GOPATH/src/github.com/skycoin/libskycoin + environment: + QEMU_PLATFORM: bananapi-m1-plus + + steps: + - run: mkdir -p $GOPATH/src/github.com/ $GOPATH/src/github.com/skycoin + - checkout + - setup_remote_docker: + version: 18.06.0-ce + - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=debian --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test + + publish-github-release_32: + docker: + - image: docker:18.06.0-ce-git + steps: + - run: mkdir -p $GOPATH/src/github.com/ $GOPATH/src/github.com/skycoin + - checkout + - setup_remote_docker: + version: 18.06.0-ce + - run: if [[ $CIRCLE_TAG ]]; then docker build --build-arg SHA1=$CIRCLE_SHA1 --build-arg GITHUB_OAUTH_TOKEN --build-arg PROJECT_USERNAME=$CIRCLE_PROJECT_USERNAME --build-arg PROJECT_REPONAME=$CIRCLE_PROJECT_REPONAME --build-arg QEMU_PLATFORM=raspberrypi3 --build-arg VERSION --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/deploy-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-deploy ; fi + + workflows: version: 2 arm_test: @@ -68,3 +75,4 @@ workflows: - orangepi-plus2 - raspberrypi2 - bananapi_m1_plus + - publish-github-release_32 diff --git a/.travis.yml b/.travis.yml index fd6c96199..db4b522e2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,19 +28,22 @@ install: - go get github.com/gz-c/gox - go get -t ./... - make install-linters - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - sudo apt-get install cmake ; - fi - make install-deps-libc - - make install-lib-curl + - make install-deps-skyapi script: - - make check + - make build-skyapi + - make lint + - make test-libc + - make lint-libc + - make test-skyapi + before_deploy: - export VERSION="$(git describe --tags --exact-match HEAD 2> /dev/null)" - export ARCH="$(uname -m)" - export OS="$(uname -s)" - make build - - tar -c -z -f libskycoin-${VERSION}-${OS}-${ARCH}.tar.gz -C build ./* + - ( cd build && tar czf ../libskycoin-${VERSION}-${OS}-${ARCH}.tar.gz ./* ) + - pwd && ls -l . deploy: - provider: releases api_key: diff --git a/.travis/install_lib_curl.sh b/.travis/install_lib_curl.sh deleted file mode 100644 index b689a24cd..000000000 --- a/.travis/install_lib_curl.sh +++ /dev/null @@ -1,10 +0,0 @@ -cd lib/curl - -mkdir -p build -cd build -# for normal install use following command -cmake .. -make -sudo make install - -cd ../.. diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f6897545..8224130cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Added +### Fixed + +### Changed + +### Removed + +## [0.25.1] - 2019-05-24 + +### Added + +- Export functions in Skycoin 0.25.1 core API's - `skyapi` C client for Skycoin node REST at `lib/curl`. - Support for building `libskycoin` on ARM and 32 / 64 bits. @@ -23,11 +34,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Delete function `SKY_base58_String2Hex` - ## [0.25.0] - 2018-12-19 ### Added +- Export functions in Skycoin 0.25.0 core API's - Coinhour burn factor when creating transactions can be configured at runtime with `USER_BURN_FACTOR` envvar - Max transaction size when creating transactions can be configured at runtime with `USER_MAX_TXN_SIZE` envvar - Max decimals allowed when creating transactions can be configured at runtime with `USER_MAX_DECIMALS` envvar diff --git a/Makefile b/Makefile index d72d952e8..ddab4f37b 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ .DEFAULT_GOAL := help -.PHONY: test-libc test-lint build-libc check +.PHONY: test-libc test-lint build-libc check build build-skyapi test-skyapi .PHONY: install-linters format clean-libc format-libc lint-libc docs COIN ?= skycoin @@ -23,6 +23,9 @@ SKYVENDOR_REL_PATH = $(SKYSRC_REL_PATH)/vendor # Compilation output for libskycoin BUILD_DIR = build BUILDLIB_DIR = $(BUILD_DIR)/libskycoin +BUILDLIBSKYAPI_DIR = $(BUILD_DIR)/libskyapi +LIBNAME_Linux = libskyapi.so +LIBNAME_Darwin = libskyapi.dylib LIB_DIR = lib BIN_DIR = bin DOC_DIR = docs @@ -99,7 +102,12 @@ build-libc-shared: $(BUILDLIB_DIR)/libskycoin.so ## Build libskycoin C shared li build-libc: configure-build build-libc-static build-libc-shared ## Build libskycoin C client libraries -build: build-libc ## Build all C libraries +build-skyapi: ## Build skyapi(libcurl based) library + (cd lib/curl && bash ./install_lib_curl.sh) + mkdir -p ./build/libskyapi + cp lib/curl/build/$(LIBNAME_$(UNAME_S)) ./build/libskyapi + +build: build-libc build-skyapi ## Build libraries ## Build libskycoin C client library and executable C test suites ## with debug symbols. Use this target to debug the source code @@ -119,6 +127,9 @@ test-libc: build-libc ## Run tests for libskycoin C client library test-hw-crypto: install-deps-libc-linux install-lib-curl build-libc ## Run tests for hardware wallet crypto API $(CC) -o $(BIN_DIR)/test_hardwarewallet $(LIB_DIR)/cgo/tests/*.common.c $(LIB_DIR)/cgo/tests/testutils/libsky_string.c $(LIB_DIR)/cgo/tests/testutils/libsky_assert.c $(LIB_DIR)/cgo/tests/testutils/common.c $(LIB_DIR)/cgo/tests/test_main_hw.c -L$(HARDWARE_WALLET_ROOT_DIR)/skycoin-api -Wl,-rpath,$(HARDWARE_WALLET_ROOT_DIR)/skycoin-api -lskycoin-crypto-wrapper -lskycoin-crypto `pkg-config --cflags --libs check` -lpthread -Ilib/cgo -Iinclude -Ibuild/usr/include -I$(HARDWARE_WALLET_ROOT_DIR) $(BIN_DIR)/test_hardwarewallet +test-skyapi: build-skyapi ## Run test for skyapi(libcurl based) library + +test: test-libc test-skyapi ## Run all test for libskycoin docs-skyapi: ## Generate SkyApi (libcurl) documentation openapi-generator generate -g html2 -i lib/swagger/skycoin.v0.25.1.openapi.v2.yml -o $(LIBCURLDOC_DIR) @@ -141,7 +152,7 @@ lint-libc: format-libc clang-tidy lib/cgo/tests/*.c -- $(LIBC_FLAGS) -Wincompatible-pointer-types -check: lint test-libc lint-libc ## Run tests and linters +check: lint test-libc lint-libc test-skyapi ## Run tests and linters install-linters-Linux: ## Install linters on GNU/Linux sudo apt-get update @@ -160,42 +171,58 @@ install-deps-Linux: ## Install deps on GNU/Linux install-deps-Darwin: ## Install deps on Mac OSX brew install $(PKG_LIB_TEST) -install-libraries-deps: ## Install deps for lib\curl wrapper of Skycoin REST API - if [[ "$(UNAME_S)" == "Linux" ]]; then (cd build && wget --no-check-certificate https://cmake.org/files/v3.3/cmake-3.3.2-Linux-x86_64.tar.gz && echo "f3546812c11ce7f5d64dc132a566b749 *cmake-3.3.2-Linux-x86_64.tar.gz" > cmake_md5.txt && md5sum -c cmake_md5.txt && tar -xvf cmake-3.3.2-Linux-x86_64.tar.gz > /dev/null && mv cmake-3.3.2-Linux-x86_64 cmake-install && PATH=$(pwd)/build/cmake-install:$(pwd)/build/cmake-install/bin:$PATH ) ; fi - (cd build && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && bash ./configure && make && sudo make install) - if [[ "$(UNAME_S)" == "Darwin" ]]; then brew install curl ; fi - # install uncrustify - (cd build && git clone https://github.com/uncrustify/uncrustify.git) - (cd build/uncrustify && mkdir build && cd build && cmake .. && make && sudo make install) - install-linters: install-linters-$(UNAME_S) ## Install linters go get -u github.com/FiloSottile/vendorcheck cat ./ci-scripts/install-golangci-lint.sh | sh -s -- -b $(GOPATH)/bin v1.10.2 -install-deps-libc: install-deps-libc-$(OSNAME) install-libraries-deps +install-deps-skyapi-Linux: + mkdir -p deps + sudo add-apt-repository ppa:george-edison55/cmake-3.x -y + sudo apt-get update + sudo apt-get install cmake + sudo apt-get install libcurl3-gnutls + sudo apt remove curl + (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure && make && sudo make install) + (cd deps && git clone https://github.com/uncrustify/uncrustify.git && cd uncrustify && mkdir build && cd build && cmake .. && make && sudo make install) + +install-deps-skyapi-Darwin: + export LDFLAGS="-L/usr/local/opt/curl/lib" + export CPPFLAGS="-I/usr/local/opt/curl/include" + mkdir -p deps + brew update + brew install openssl curl uncrustify || true + (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xf curl-7.58.0.tar.gz && cd curl-7.58.0/ && mkdir build && cd build && cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl .. && make && sudo make install) + +install-deps-libc: install-deps-libc-$(UNAME_S) ## Install deps for libc -check-0.12.0/configure: +install-deps-skyapi: install-deps-skyapi-$(UNAME_S) ## Install skyapi(libcurl based) library. + +install-deps-libc-Linux: configure-build ## Install locally dependencies for testing libskycoin wget -c https://github.com/libcheck/check/releases/download/0.12.0/check-0.12.0.tar.gz tar -xzf check-0.12.0.tar.gz cd check-0.12.0 && ./configure --prefix=/usr --disable-static && make && sudo make install install-deps-libc-linux: configure-build check-0.12.0/configure ## Install locally dependencies for testing libskycoin -install-lib-curl: ## Install Sky Api curl based rest wrapper - bash .travis/install_lib_curl.sh - -install-deps-libc-osx: configure-build ## Install locally dependencies for testing libskycoin +install-deps-libc-Darwin: configure-build ## Install locally dependencies for testing libskycoin brew install check +install-deps: install-deps-libc install-deps-skyapi ## Install deps for libc and skyapi + format: ## Formats the code. Must have goimports installed (use make install-linters). goimports -w -local github.com/skycoin/skycoin ./lib -clean-libc: ## Clean files generate by library +clean-libc: ## Clean files generated by libc rm -rfv $(BUILDLIB_DIR) rm -rfv bin rm -rfv qemu_test_libskycoin* rm -rfv include/libskycoin.h +clean-skyapi: ## Clean files generated by skyapi + rm -rfv $(BUILDLIBSKYAPI_DIR) + +clean: clean-libc clean-skyapi ## Clean all files generated by libraries + format-libc: $(PKG_CLANG_FORMAT) -sort-includes -i -assume-filename=.clang-format lib/cgo/tests/*.c $(PKG_CLANG_FORMAT) -sort-includes -i -assume-filename=.clang-format include/*.h diff --git a/README.md b/README.md index 3fb51c4f1..cbef32f16 100644 --- a/README.md +++ b/README.md @@ -46,48 +46,59 @@ All these make rules require skycoin to be a git submodule of libskycoin | :------------- | :----------: | |build-libc-static |Build libskycoin C static library| |build-libc-shared |Build libskycoin C shared library| -|build-libc |Build libskycoin C client libraries| |build |Build all C libraries +|build-libc |Build libskycoin C client libraries| +|build-skyapi |Build skyapi(libcurl based) library| +|test |Run all test for libskycoin| |test-libc |Run tests for libskycoin C client library| +|test-skyapi |Run test for skyapi(libcurl based) library| |docs |Generate documentation for all libraries| |docs-libc |Generate libskycoin documentation| |docs-skyapi |Generate SkyApi (libcurl) documentation| |lint |Run linters. Use make install-linters first.| |check |Run tests and linters| -|install-libraries-deps |Install deps for `lib\curl` wrapper of Skycoin REST API| +|install-deps |Install deps for libc and skyapi| +|install-deps-libc |Install deps for libc| +|install-deps-skyapi |Install skyapi(libcurl based) library.| |install-linters |Install linters| |format |Formats the code. Must have goimports installed (use make install-linters).| -|clean-libc |Clean files generate by library| - +|clean |Clean all files generated by libraries(libcurl based and libc)| +|clean-libc |Clean files generated by libc| +|clean-skyapi |Clean files generated by skyapi| + ## Development setup - ### Running tests +### Running tests - ```sh - $ make test-libc - ``` +```sh +$ make test-libc +``` - ### Releases +### Releases - #### Update the version +#### Update the version - 0. If the `master` branch has commits that are not in `develop` (e.g. due to a hotfix applied to `master`), merge `master` into `develop` (and fix any build or test failures) - 0. Switch to a new release branch named `release-X.Y.Z` for preparing the release. - 0. Ensure that the submodule at `gopath/src/github.com/skycoin/skycoin` is in sync with respect to the corresponding tag in https://github.com/skycoin/skycoin repository. - 0. Update `CHANGELOG.md`: move the "unreleased" changes to the version and add the date. - 0. Follow the steps in [pre-release testing](#pre-release-testing) - 0. Make a PR merging the release branch into `master` - 0. Review the PR and merge it - 0. Tag the `master` branch with the version number. Version tags start with `v`, e.g. `v0.20.0`. Sign the tag. If you have your GPG key in github, creating a release on the Github website will automatically tag the release. It can be tagged from the command line with `git tag -as v0.20.0 $COMMIT_ID`, but Github will not recognize it as a "release". - 0. Release builds are created and uploaded by travis. To do it manually, checkout the master branch and follow the [create release builds instructions](#creating-release-builds). +0. If the `master` branch has commits that are not in `develop` (e.g. due to a hotfix applied to `master`), merge `master` into `develop` (and fix any build or test failures) +0. Switch to a new release branch named `release-X.Y.Z` for preparing the release. +0. If the release process needs modifications, edit these steps before moving forward +0. Ensure that the submodule at `vendor/github.com/skycoin/skycoin` is in sync with respect to the corresponding tag in https://github.com/skycoin/skycoin repository. +0. Update `CHANGELOG.md`: move the "unreleased" changes to the version and add the date. +0. Run `make docs` to regenerate documentation for all libraries and ensure they ar up-to-date. +0. Follow the steps in [pre-release testing](#pre-release-testing) +0. Make a PR merging the release branch into `master` +0. Review the PR and merge it +0. Tag the `master` branch with the version number. Version tags start with `v`, e.g. `v0.20.0`. Sign the tag. If you have your GPG key in github, creating a release on the Github website will automatically tag the release. It can be tagged from the command line with `git tag -as v0.20.0 $COMMIT_ID`, but Github will not recognize it as a "release". +0. Release builds are created and uploaded by travis. To do it manually, checkout the master branch and follow the [create release builds instructions](#creating-release-builds). +0. Merge changes in `master` back into `develop` branch to start working towards next stable version. - #### Pre-release testing +#### Pre-release testing - Perform these actions before releasing: +Perform these actions before releasing: + +```sh +make check +``` - ```sh - make check - ``` ## Development We have two branches: `master` and `develop`. @@ -148,3 +159,4 @@ This code example can be found at `include/cipher.bitcoin.go.h`. Inside `/* */` we found struct documentation, meanwhile `//<` symbol is used to describe fields of the struct. After that, run `make docs` for a new docs generation. You can found the api documentation at `docs/libc` folder. + diff --git a/docker/images/deploy-arm/Dockerfile b/docker/images/deploy-arm/Dockerfile new file mode 100644 index 000000000..3c446de9c --- /dev/null +++ b/docker/images/deploy-arm/Dockerfile @@ -0,0 +1,26 @@ +ARG QEMU_PLATFORM +FROM balenalib/${QEMU_PLATFORM}-debian-golang + +ARG GITHUB_OAUTH_TOKEN +ARG PROJECT_USERNAME +ARG PROJECT_REPONAME +ARG SHA1 +ADD . $GOPATH/src/github.com/skycoin/libskycoin/ + +RUN [ "cross-build-start" ] + +RUN ls -oa $GOPATH/src/github.com/skycoin/libskycoin/ +RUN sh $GOPATH/src/github.com/skycoin/libskycoin/ci-scripts/docker_install_debian.sh +RUN make -C $GOPATH/src/github.com/skycoin/libskycoin dep +RUN go get github.com/gz-c/gox +RUN go get -t ./... +ENV CGO_ENABLED=1 +RUN export VERSION="$(git describe --tags --exact-match HEAD 2> /dev/null)" +RUN export ARCH="$(uname -m)" +RUN export OS="$(uname -s)" +RUN make -C $GOPATH/src/github.com/skycoin/libskycoin build +RUN tar -c -z -f libskycoin-${VERSION}-${OS}-${ARCH}.tar.gz -C $GOPATH/src/github.com/skycoin/libskycoin/build $GOPATH/src/github.com/skycoin/libskycoin/build/* +RUN go get github.com/tcnksm/ghr +RUN ghr -t ${GITHUB_OAUTH_TOKEN} -u ${PROJECT_USERNAME} -r ${PROJECT_REPONAME} -c ${SHA1} -delete ${VERSION} libskycoin-${VERSION}-${OS}-${ARCH}.tar.gz + +RUN [ "cross-build-end" ] diff --git a/lib/cgo/tests/check_coin.transactions.c b/lib/cgo/tests/check_coin.transactions.c index 6e3a64f81..8f28a0555 100644 --- a/lib/cgo/tests/check_coin.transactions.c +++ b/lib/cgo/tests/check_coin.transactions.c @@ -276,10 +276,11 @@ START_TEST(TestTransactionUpdateHeader) Transaction__Handle handle; coin__Transaction* ptx; ptx = makeTransaction(&handle); - cipher__SHA256 hash, nullHash, hashInner; + cipher__SHA256 hash; + cipher__SHA256 nullHash = ""; + cipher__SHA256 hashInner; memcpy(&hash, &ptx->InnerHash, sizeof(cipher__SHA256)); memset(&ptx->InnerHash, 0, sizeof(cipher__SHA256)); - memset(&nullHash, 0, sizeof(cipher__SHA256)); result = SKY_coin_Transaction_UpdateHeader(handle); ck_assert(!isU8Eq(ptx->InnerHash, nullHash, sizeof(cipher__SHA256))); ck_assert(isU8Eq(ptx->InnerHash, hash, sizeof(cipher__SHA256))); diff --git a/lib/curl/CMakeLists.txt b/lib/curl/CMakeLists.txt index 93d2b57a3..62f57701d 100644 --- a/lib/curl/CMakeLists.txt +++ b/lib/curl/CMakeLists.txt @@ -1,93 +1,88 @@ -cmake_minimum_required (VERSION 2.6) -project (CGenerator) +cmake_minimum_required(VERSION 2.6) +project(CGenerator) -cmake_policy(SET CMP0063 NEW) +#cmake_policy(SET CMP0063 NEW) -set(CMAKE_C_VISIBILITY_PRESET default) -set(CMAKE_CXX_VISIBILITY_PRESET default) -set(CMAKE_VISIBILITY_INLINES_HIDDEN OFF) +#set(CMAKE_C_VISIBILITY_PRESET default) +#set(CMAKE_CXX_VISIBILITY_PRESET default) +#set(CMAKE_VISIBILITY_INLINES_HIDDEN OFF) set(CMAKE_BUILD_TYPE Debug) set(pkgName "skyapi") -find_package(CURL 7.58.0 REQUIRED) -if(CURL_FOUND) - include_directories(${CURL_INCLUDE_DIR}) - set(PLATFORM_LIBRARIES ${PLATFORM_LIBRARIES} ${CURL_LIBRARIES} ) -else(CURL_FOUND) - message(FATAL_ERROR "Could not find the CURL library and development files.") -endif() +find_package(CURL 7.58.0 EXACT REQUIRED) set(SRCS - src/list.c - src/apiKey.c - src/apiClient.c - external/cJSON.c - model/_api_v1_explorer_address_inputs.c - model/_api_v1_explorer_address_outputs.c - model/_api_v1_explorer_address_status.c - model/_api_v1_pending_txs_transaction.c - model/_api_v1_wallet_transaction_hours_selection.c - model/_api_v1_wallet_transaction_to.c - model/_api_v1_wallet_transaction_wallet.c - model/_api_v1_wallets_entries.c - model/_api_v1_wallets_meta.c - model/inline_object.c - model/inline_response_200.c - model/inline_response_200_1.c - model/inline_response_200_2.c - model/inline_response_200_3.c - model/inline_response_200_3_unconfirmed_verify_transaction.c - model/inline_response_200_4.c - model/inline_response_200_5.c - model/inline_response_200_6.c - model/inline_response_200_7.c - model/inline_response_200_7_data.c - model/inline_response_default.c - api/DefaultAPI.c - + ${CMAKE_CURRENT_SOURCE_DIR}/src/list.c + ${CMAKE_CURRENT_SOURCE_DIR}/src/apiKey.c + ${CMAKE_CURRENT_SOURCE_DIR}/src/apiClient.c + ${CMAKE_CURRENT_SOURCE_DIR}/external/cJSON.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_explorer_address_inputs.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_explorer_address_outputs.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_explorer_address_status.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_pending_txs_transaction.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_wallet_transaction_hours_selection.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_wallet_transaction_to.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_wallet_transaction_wallet.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_wallets_entries.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_wallets_meta.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/object.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_object.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_1.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_2.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_3.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_3_unconfirmed_verify_transaction.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_4.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_5.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_6.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_7.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_7_data.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_default.c + ${CMAKE_CURRENT_SOURCE_DIR}/api/DefaultAPI.c ) set(HDRS - include/apiClient.h - include/list.h - include/keyValuePair.h - external/cJSON.h - model/_api_v1_explorer_address_inputs.h - model/_api_v1_explorer_address_outputs.h - model/_api_v1_explorer_address_status.h - model/_api_v1_pending_txs_transaction.h - model/_api_v1_wallet_transaction_hours_selection.h - model/_api_v1_wallet_transaction_to.h - model/_api_v1_wallet_transaction_wallet.h - model/_api_v1_wallets_entries.h - model/_api_v1_wallets_meta.h - model/inline_object.h - model/inline_response_200.h - model/inline_response_200_1.h - model/inline_response_200_2.h - model/inline_response_200_3.h - model/inline_response_200_3_unconfirmed_verify_transaction.h - model/inline_response_200_4.h - model/inline_response_200_5.h - model/inline_response_200_6.h - model/inline_response_200_7.h - model/inline_response_200_7_data.h - model/inline_response_default.h - api/DefaultAPI.h - + ${CMAKE_CURRENT_SOURCE_DIR}/include/apiClient.h + ${CMAKE_CURRENT_SOURCE_DIR}/include/list.h + ${CMAKE_CURRENT_SOURCE_DIR}/include/keyValuePair.h + ${CMAKE_CURRENT_SOURCE_DIR}/external/cJSON.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_explorer_address_inputs.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_explorer_address_outputs.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_explorer_address_status.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_pending_txs_transaction.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_wallet_transaction_hours_selection.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_wallet_transaction_to.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_wallet_transaction_wallet.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_wallets_entries.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_wallets_meta.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/object.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_object.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_1.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_2.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_3.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_3_unconfirmed_verify_transaction.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_4.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_5.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_6.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_7.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_7_data.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_default.h + ${CMAKE_CURRENT_SOURCE_DIR}/api/DefaultAPI.h ) +include_directories(${CURL_INCLUDE_DIR}) # Add library with project file with projectname as library name add_library(${pkgName} SHARED ${SRCS} ${HDRS}) # Link dependent libraries -target_link_libraries(${pkgName} ${CURL_LIBRARIES} ) +target_link_libraries(${pkgName} ${CURL_LIBRARIES}) #install library to destination install(TARGETS ${pkgName} DESTINATION ${CMAKE_INSTALL_PREFIX}) # Setting file variables to null -set(SRCS "") -set(HDRS "") +#set(SRCS "") +#set(HDRS "") ## This section shows how to use the above compiled libary to compile the source files diff --git a/lib/curl/install_lib_curl.sh b/lib/curl/install_lib_curl.sh new file mode 100755 index 000000000..6842eb5b7 --- /dev/null +++ b/lib/curl/install_lib_curl.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +mkdir -p build +cd build +#echo "brew --prefix curl" +#brew --prefix curl +#echo "brew ls --verbose curl" +#brew ls --verbose curl +# for normal install use following command +cmake -DCMAKE_VERBOSE_MAKEFILE=ON .. +grep -R object_convertToJSON ../../ +make +sudo make install + +cd ../..