diff options
author | Enrico Granata <egranata@google.com> | 2019-04-29 16:28:35 -0700 |
---|---|---|
committer | Enrico Granata <egranata@google.com> | 2019-04-29 16:28:35 -0700 |
commit | 19d8880b3215b7d3d2e77545a7fe13cc3efa0776 (patch) | |
tree | 33930c2dd2c9e89a21ce7ab9d1951a085fe030e8 /src/CI | |
parent | 65afdc3a8c7a5d4df8107fc12c353264c0e9ccf6 (diff) | |
download | libiio-19d8880b3215b7d3d2e77545a7fe13cc3efa0776.tar.gz |
Initial import of libiio
This brings revision 0.15 of libiio into the codebase
Bug: 128636517
Test: Files show up in tree
Change-Id: I246c0461ee491ac2ee77dee60c6eac0720627e2b
Diffstat (limited to 'src/CI')
-rwxr-xr-x | src/CI/travis/before_deploy | 178 | ||||
-rwxr-xr-x | src/CI/travis/before_install_darwin | 11 | ||||
-rwxr-xr-x | src/CI/travis/before_install_linux | 8 | ||||
-rwxr-xr-x | src/CI/travis/deploy | 70 | ||||
-rw-r--r-- | src/CI/travis/deploy.rsa.enc | bin | 0 -> 1680 bytes | |||
-rwxr-xr-x | src/CI/travis/make_darwin | 13 | ||||
-rwxr-xr-x | src/CI/travis/make_linux | 8 | ||||
-rw-r--r-- | src/CI/travis/zip.txt | 62 |
8 files changed, 350 insertions, 0 deletions
diff --git a/src/CI/travis/before_deploy b/src/CI/travis/before_deploy new file mode 100755 index 0000000..1164dcf --- /dev/null +++ b/src/CI/travis/before_deploy @@ -0,0 +1,178 @@ +#!/bin/sh + +# Don't prepare a deploy on a Coverity build +if [ "x${COVERITY_SCAN_PROJECT_NAME}" != "x" ] ; then exit 0; fi + +deploy=0 +if [ -z "$TRAVIS_BUILD_DIR" ] ; then + t=$(find ./ -name CMakeCache.txt|head -1) + if [ -n "${t}" ] ; then + cd $(dirname $(dirname ${t})) + TRAVIS_BUILD_DIR=$(pwd) + else + echo "I am confused - can't find CMakeCache.txt" + exit + fi +else + cd $TRAVIS_BUILD_DIR +fi +pwd + +if [ -z "${LDIST}" ] ; then + LDIST=-$(lsb_release -c | awk '{print $NF}') +fi + +check_file() +{ +temp="" +for i in $(find ./ -name CMakeCache.txt) +do +hit=$(find $(dirname ${i}) -maxdepth 1 -name "libiio*.$1" | grep -v -- ${LDIST}) +if [ "$(echo ${hit} | wc -w)" -gt "1" ] ; then + echo "I am confused - more than 2 $1 files!" + echo $hit + exit 1 +else + if [ "$(echo ${hit} | wc -w)" -eq "1" ] ; then + if [ -z "${temp}" ] ; then + temp=$hit + else + echo "I am confused - more than 2 $1 files" + echo $temp + echo $hit + exit 1 + fi + fi +fi +done +} + +check_file deb +if [ -n "${temp}" ] ; then + deploy=$(expr ${deploy} + 1) + if [ -z "${TARGET_DEB}" ] ; then + export TARGET_DEB=$(echo ${temp} | \ + sed -e 's:^./.*/::' -e 's:.deb$::')${LDIST}.deb + fi + echo "deploying ${temp} to nightly $TARGET_DEB" + if [ -z "${RELEASE_PKG_FILE_DEB}" ] ; then + export RELEASE_PKG_FILE_DEB=$(dirname ${temp})/${TARGET_DEB} + cp ${temp} ${RELEASE_PKG_FILE_DEB} + fi + echo ${TARGET_DEB} + ls -lh ${temp} + echo ${RELEASE_PKG_FILE_DEB} + ls -lh ${RELEASE_PKG_FILE_DEB} +else + echo "Skipping deployment of debian package" +fi + +check_file rpm +if [ -n "${temp}" ] ; then + deploy=$(expr ${deploy} + 1) + if [ -z "${TARGET_RPM}" ] ; then + export TARGET_RPM=$(echo ${temp} | \ + sed -e 's:^./.*/::' -e 's:.rpm$::')${LDIST}.rpm + fi + echo "deploying ${temp} to nightly $TARGET_RPM" + if [ -z "${RELEASE_PKG_FILE_RPM}" ] ; then + export RELEASE_PKG_FILE_RPM=$(dirname ${temp})/${TARGET_RPM} + cp ${temp} ${RELEASE_PKG_FILE_RPM} + fi + echo ${TARGET_RPM} + ls -lh ${temp} + echo ${RELEASE_PKG_FILE_RPM} + ls -lh ${RELEASE_PKG_FILE_RPM} +else + echo "Skipping deployment of rpm package" +fi + +check_file tar.gz +if [ -n "${temp}" ] ; then + deploy=$(expr ${deploy} + 1) + if [ -z "${TARGET_TGZ}" ] ; then + echo Add the MATLAB bindings into the tar file + ( + cd $(dirname ${temp}) + if [ -d tarball_fixup ] ; then + rm -rf tarball_fixup + fi + mkdir tarball_fixup && cd tarball_fixup + + if [ "$TRAVIS_OS_NAME" = "osx" ] ; then + tar --strip-components=1 -xzf ${TRAVIS_BUILD_DIR}/${temp} + else + tar -xzf ${TRAVIS_BUILD_DIR}/${temp} + fi + + mkdir -p usr/include usr/lib/matlab/iio + cp ${TRAVIS_BUILD_DIR}/bindings/matlab/iio-wrapper.h usr/include/ + cp ${TRAVIS_BUILD_DIR}/bindings/matlab/*.m usr/lib/matlab/iio/ + + if [ "$TRAVIS_OS_NAME" = "osx" ] ; then + cd usr/lib + ln -fs ../../Library/Frameworks/iio.framework/iio libiio.dylib + install_name_tool -change /usr/local/opt/libusb/lib/libusb-1.0.0.dylib @rpath/libusb-1.0.dylib libiio.dylib + install_name_tool -add_rpath @loader_path/../../../../../usr/lib libiio.dylib + install_name_tool -add_rpath /usr/local/opt/libusb/lib libiio.dylib + + cd ../include + ln -s ../../Library/Frameworks/iio.framework/Headers/iio.h iio.h + + # Update references for tools + cd ../.. + TOOLS=Library/Frameworks/iio.framework/Tools/* + for tool in $TOOLS + do + install_name_tool -add_rpath @loader_path/../../ $tool + done + cp /usr/local/lib/libusb-1.0.dylib usr/lib/ + chmod +w usr/lib/libusb-1.0.dylib + install_name_tool -id @rpath/libusb-1.0.dylib usr/lib/libusb-1.0.dylib + + tar -czf ${TRAVIS_BUILD_DIR}/${temp} usr Library + else + tar -czf ${TRAVIS_BUILD_DIR}/${temp} usr lib + fi + ) + + export TARGET_TGZ=$(echo ${temp} | \ + sed -e 's:^./.*/::' -e 's:.tar.gz$::')${LDIST}.tar.gz; + fi + echo "deploying ${temp} to $TARGET_TGZ" + if [ -z "${RELEASE_PKG_FILE_TGZ}" ] ; then + export RELEASE_PKG_FILE_TGZ=$(dirname ${temp})/${TARGET_TGZ} + cp ${temp} ${RELEASE_PKG_FILE_TGZ} + fi + echo ${TARGET_TGZ} + ls -lh ${temp} + echo ${RELEASE_PKG_FILE_TGZ} + ls -lh ${RELEASE_PKG_FILE_TGZ} +else + echo "Skipping deployment of tarball" +fi + +check_file pkg +if [ -n "${temp}" ] ; then + deploy=$(expr ${deploy} + 1) + if [ -z "${TARGET_PKG}" ] ; then + export TARGET_PKG=$(echo ${temp} | \ + sed -e 's:^./.*/::' -e 's:.pkg$::')${LDIST}.pkg + fi + echo "deploying ${temp} to nightly $TARGET_PKG" + if [ -z "${RELEASE_PKG_FILE_PKG}" ] ; then + export RELEASE_PKG_FILE_PKG=$(dirname ${temp})/${TARGET_PKG} + cp ${temp} ${RELEASE_PKG_FILE_PKG} + fi + echo ${TARGET_PKG} + ls -lh ${temp} + echo ${RELEASE_PKG_FILE_PKG} + ls -lh ${RELEASE_PKG_FILE_PKG} +else + echo "Skipping deployment of OS X package" +fi + +if [ "${deploy}" -eq "0" ] ; then + echo did not deploy any files + exit 1 +fi diff --git a/src/CI/travis/before_install_darwin b/src/CI/travis/before_install_darwin new file mode 100755 index 0000000..68da765 --- /dev/null +++ b/src/CI/travis/before_install_darwin @@ -0,0 +1,11 @@ +#!/bin/sh + +brew update +if ! brew ls --version cmake &>/dev/null; then + brew install cmake +else + brew upgrade cmake +fi +brew install doxygen +brew install --build-from-source libusb +brew install libxml2 diff --git a/src/CI/travis/before_install_linux b/src/CI/travis/before_install_linux new file mode 100755 index 0000000..76ee7db --- /dev/null +++ b/src/CI/travis/before_install_linux @@ -0,0 +1,8 @@ +#!/bin/sh + +sudo apt-get -qq update +sudo apt-get install -y cmake doxygen libaio-dev libavahi-client-dev libavahi-common-dev libusb-1.0-0-dev libxml2-dev rpm tar bzip2 gzip +if [ `sudo apt-cache search libserialport-dev | wc -l` -gt 0 ] ; then + sudo apt-get install -y libserialport-dev +fi + diff --git a/src/CI/travis/deploy b/src/CI/travis/deploy new file mode 100755 index 0000000..18941f7 --- /dev/null +++ b/src/CI/travis/deploy @@ -0,0 +1,70 @@ +#!/bin/sh + +cd $TRAVIS_BUILD_DIR + +send() +{ +if [ "$#" -ne 3 ] ; then + echo "skipping deployment of something" + echo "send called with $@" + return +fi + +if [ "x$1" = "x" ] ; then + echo no file to send + return +fi + +if [ ! -r "$1" ] ; then + echo "file $1 is not readable" + ls -l $1 + return +fi + +if [ $BRANCH_PULL ] ; then + branch=$BRANCH_PULL +else + branch=$BRANCH +fi + +FROM=$1 +TO=${branch}_$2 +LATE=${branch}_latest_libiio${LDIST}$3 +GLOB=${DEPLOY_TO}/${branch}_libiio-* + +echo attemting to deploy $FROM to $TO +echo and ${branch}_libiio${LDIST}$3 +ssh -V + +echo "cd ${DEPLOY_TO}" > script$3 +if curl -m 10 -s -I -f -o /dev/null http://swdownloads.analog.com/cse/travis_builds/${TO} ; then + echo "rm ${TO}" >> script$3 +fi +echo "put ${FROM} ${TO}" >> script$3 +echo "ls -l ${TO}" >> script$3 +if curl -m 10 -s -I -f -o /dev/null http://swdownloads.analog.com/cse/travis_builds/${LATE} ; then + echo "rm ${LATE}" >> script$3 +fi +echo "symlink ${TO} ${LATE}" >> script$3 +echo "ls -l ${LATE}" >> script$3 +echo "bye" >> script$3 + +sftp ${EXTRA_SSH} -b script$3 ${SSHUSER}@${SSHHOST} + +# limit things to a few files, so things don't grow forever +if [ "${LDIST}" = "-precise" -a "$3" = ".deb" ] ; then + for files in $(ssh ${EXTRA_SSH} ${SSHUSER}@${SSHHOST} \ + "ls -lt ${GLOB}" | tail -n +100 | awk '{print $NF}') + do + ssh ${EXTRA_SSH} ${SSHUSER}@${SSHHOST} \ + "rm ${DEPLOY_TO}/${files}" + done +fi +} + +# from to suffix +send ${RELEASE_PKG_FILE_DEB} ${TARGET_DEB} .deb +send ${RELEASE_PKG_FILE_RPM} ${TARGET_RPM} .rpm +send ${RELEASE_PKG_FILE_TGZ} ${TARGET_TGZ} .tar.gz +send ${RELEASE_PKG_FILE_PKG} ${TARGET_PKG} .pkg + diff --git a/src/CI/travis/deploy.rsa.enc b/src/CI/travis/deploy.rsa.enc Binary files differnew file mode 100644 index 0000000..78fe1ff --- /dev/null +++ b/src/CI/travis/deploy.rsa.enc diff --git a/src/CI/travis/make_darwin b/src/CI/travis/make_darwin new file mode 100755 index 0000000..4fe4e44 --- /dev/null +++ b/src/CI/travis/make_darwin @@ -0,0 +1,13 @@ +#!/bin/sh + +if [ "x${COVERITY_SCAN_PROJECT_NAME}" != "x" ] ; then exit 0; fi + +cd $TRAVIS_BUILD_DIR/build +cmake -DOSX_PACKAGE=ON .. +make +ls + +cd $TRAVIS_BUILD_DIR/build_tar +cmake -DOSX_PACKAGE=OFF -DENABLE_PACKAGING=ON .. +make && make package +ls diff --git a/src/CI/travis/make_linux b/src/CI/travis/make_linux new file mode 100755 index 0000000..688fabd --- /dev/null +++ b/src/CI/travis/make_linux @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ "x${COVERITY_SCAN_PROJECT_NAME}" != "x" ] ; then exit 0; fi + +cd $TRAVIS_BUILD_DIR/build +cmake -DENABLE_PACKAGING=ON -DDEB_DETECT_DEPENDENCIES=ON .. +make && make package + diff --git a/src/CI/travis/zip.txt b/src/CI/travis/zip.txt new file mode 100644 index 0000000..0427357 --- /dev/null +++ b/src/CI/travis/zip.txt @@ -0,0 +1,62 @@ + libiio Windows binary snapshot - README + + ********************************************************************* + * The latest version of this snapshot can always be downloaded at: * + * https://github.com/analogdevicesinc/libiio * + ********************************************************************* + +In this archive, you should find the following directories: +o ./include : Common include files +o ./MinGW32 : 32-bit binaries compiled by the MinGW toolchain +o ./MinGW64 : 64-bit binaries compiled by the MinGW toolchain +o ./MS32 : 32-bit binaries compiled by the MicroSoft toolchain +o ./MS64 : 364bit binaries compiled by the MicroSoft toolchain + +o Visual Studio: + - Open existing or create a new project for your application + - Copy iio.h, from the include\ directory, into your project and make sure that + the location where the file reside appears in the 'Additional Include + Directories' section (Configuration Properties -> C/C++ -> General). + - Copy the relevant .lib file from MS32\ or MS64\ and add 'libiio.lib' to + your 'Additional Dependencies' (Configuration Properties -> Linker -> Input) + Also make sure that the directory where libiio.lib resides is added to + 'Additional Library Directories' (Configuration Properties -> Linker + -> General) + - If you use the static version of the libiio library, make sure that + 'Runtime Library' is set to 'Multi-threaded DLL (/MD)' (Configuration + Properties -> C/C++ -> Code Generation). + - Compile and run your application. If you use the DLL version of libiio, + remember that you need to have a copy of the DLL either in the runtime + directory or in system32 + +o WDK/DDK: + - The following is an example of a sources files that you can use to compile + a libiio 1.0 based console application. In this sample ..\libiio\ is the + directory where you would have copied libiio.h as well as the relevant + libiio.lib + + TARGETNAME=your_app + TARGETTYPE=PROGRAM + USE_MSVCRT=1 + UMTYPE=console + INCLUDES=..\libiio;$(DDK_INC_PATH) + TARGETLIBS=..\libiio\libiio.lib + SOURCES=your_app.c + +o MinGW/cygwin + - Copy libiio.h, from include/ to your default include directory, + and copy the MinGW32/ or MinGW64/ .a files to your default library directory. + Or, if you don't want to use the default locations, make sure that you feed + the relevant -I and -L options to the compiler. + - Add the '-liio' linker option when compiling. + +o Additional information: + - The libiio API documentation can be accessed at: + http://analogdevicesinc.github.io/libiio/ + - For some libiio samples (including source), please have a look in examples/ + and tests/ directories + - The MinGW and MS generated DLLs are fully interchangeable, provided that you + use the import libs provided or generate one from the .def also provided. + - If you find any issue, please visit + http://analogdevicesinc.github.io/libiio/ + and check the Issues section |