Skip to content

Commit

Permalink
Merge branch 'next' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesus89 committed May 12, 2019
2 parents eb1574c + 3917b6a commit ad82855
Show file tree
Hide file tree
Showing 12 changed files with 173 additions and 57 deletions.
47 changes: 21 additions & 26 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,35 @@
sudo: required
dist: trusty

language: cpp

matrix:
include:
- os: linux
env: TARGET=linux_x86_64
- os: linux
env: TARGET=linux_i686
- os: linux
env: TARGET=linux_armv7l
- os: linux
env: TARGET=linux_aarch64
- os: linux
env: TARGET=windows_x86
- os: linux
env: TARGET=windows_amd64
- os: osx
env: TARGET=darwin

- os: linux
env: TARGET=linux_x86_64
- os: linux
env: TARGET=linux_i686
- os: linux
env: TARGET=linux_armv7l
- os: linux
env: TARGET=linux_aarch64
- os: linux
env: TARGET=windows_x86
- os: linux
env: TARGET=windows_amd64
- os: osx
env: TARGET=darwin
before_script:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update -y -qq; fi

- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update -y -qq; fi
script:
- bash build.sh $TARGET
- openssl sha1 _packages/**/*.tar.gz

- bash build.sh $TARGET
- openssl sha1 _packages/**/*.tar.gz
deploy:
provider: releases
api_key:
secure: P3t3txMvsfFXymL/Z6AVsNTygLytSL2F/GNdLpvB3ULwz0qvVzwW0ep0DZIbUxgTbOR341zUpGlKYMaS0EvUAt3TrIATa4nI9CYKavRT8CKrAUyBg2OAN9+gVmBzOEgGvgGkTjzd1OUHn0YjYjYwV2qKXHwUi21q9rXjwc20qB+lVNWkdPe3sOZhI7yUmh3WcU1jGtehQFYlz40i6rS+ivAKC8FN4wf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AEENnbi7kH6oGUfddMk02NffRc+x1BhY0VvZSUPAC5WhSCY61UtdGnYGv7wqKUESBhWPUyZOfpXOE/8rhEE=
file: _packages/**/*.tar.gz
file_glob: true
skip_cleanup: true
on:
repo: FPGAwars/tools-system
all_branches: true
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Tools-system

[![Build Status](https://travis-ci.org/FPGAwars/tools-system.svg?branch=v1.1.0)](https://travis-ci.org/FPGAwars/tools-system)

## Introduction

Static binaries of the **lsftdi** and **lsusb** tools. Packaged for [Apio](https://github.com/FPGAwars/apio).
Expand Down Expand Up @@ -43,6 +45,9 @@ NOTE: *libftdi* and *libusb* libraries are generated for each architecture. In o
* [Juan González-Gómez (Obijuan)](https://github.com/Obijuan)
* [Jesús Arroyo Torrens](https://github.com/Jesus89)

## Contributors
* [Carlos Venegas Arrabe (cavearr)](https://github.com/cavearr)

## License

Licensed under [Creative Commons Attribution-ShareAlike 4.0 International License](http://creativecommons.org/licenses/by-sa/4.0/).
8 changes: 8 additions & 0 deletions build-data/includes/ftdi_eeprom_version.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#ifndef _FTDI_EEPROM_VERSION_H
#define _FTDI_EEPROM_VERSION_H

#define EEPROM_MAJOR_VERSION 0
#define EEPROM_MINOR_VERSION 17
#define EEPROM_VERSION_STRING "0.17"

#endif
16 changes: 14 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
# System tools builder #
##################################

# Set english language for propper pattern matching
export LC_ALL=C

# Generate tools-system-arch-ver.tar.gz from source code
# sources: https://github.com/FPGAwars/tools-system

VERSION=1.1.0
VERSION=1.1.1-beta

# -- Target architectures
ARCH=$1
Expand All @@ -18,6 +21,7 @@ NAME=tools-system
# -- Debug flags
INSTALL_DEPS=1
COMPILE_LSUSB=1
COMPILE_LCONFUSE=1
COMPILE_LSFTDI=1
CREATE_PACKAGE=1

Expand All @@ -39,7 +43,7 @@ mkdir -p $UPSTREAM_DIR

# -- Test script function
function test_bin {
$WORK_DIR/test/test_bin.sh $1
. $WORK_DIR/test/test_bin.sh $1
if [ $? != "0" ]; then
exit 1
fi
Expand Down Expand Up @@ -104,6 +108,14 @@ if [ $COMPILE_LSUSB == "1" ]; then

fi

# --------- Compile lconfuse ---------------------------------------
if [ $COMPILE_LCONFUSE == "1" ]; then

print ">> Compile lconfuse"
. $WORK_DIR/scripts/compile_lconfuse.sh

fi

# --------- Compile lsftdi -----------------------------------------
if [ $COMPILE_LSFTDI == "1" ]; then

Expand Down
8 changes: 0 additions & 8 deletions clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ BUILDS_DIR=$WORK_DIR/_builds
# -- Folder for storing the generated packages
PACKAGES_DIR=$WORK_DIR/_packages

# -- Test script function
function test_bin {
$WORK_DIR/test/test_bin.sh $1
if [ $? != "0" ]; then
exit 1
fi
}

# -- Check ARCH
if [[ $# > 1 ]]; then
echo ""
Expand Down
43 changes: 42 additions & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,47 @@
{
"tools-system":
[

{
"url": "https://github.com/FPGAwars/tools-system/releases/download/v1.1.0/tools-system-darwin-1.1.0.tar.gz",
"sha1": "62fdb6b2714da062375cc745c4b7bdfd182a5695",
"version": "1.1.0",
"system": ["darwin", "darwin_x86_64", "darwin_i386"]
},
{
"url": "https://github.com/FPGAwars/tools-system/releases/download/v1.1.0/tools-system-linux_aarch64-1.1.0.tar.gz",
"sha1": "a213e907956cffd6ac13713f7e9ae215af7d36c9",
"version": "1.1.0",
"system": ["linux_aarch64"]
},
{
"url": "https://github.com/FPGAwars/tools-system/releases/download/v1.1.0/tools-system-linux_armv7l-1.1.0.tar.gz",
"sha1": "eaa9592cb27887320342ed80bfec12498e7f4554",
"version": "1.1.0",
"system": ["linux_armv7l"]
},
{
"url": "https://github.com/FPGAwars/tools-system/releases/download/v1.1.0/tools-system-linux_i686-1.1.0.tar.gz",
"sha1": "e671d02590a0fe8c4e6867ac9ce115314c8d9249",
"version": "1.1.0",
"system": ["linux_i686"]
},
{
"url": "https://github.com/FPGAwars/tools-system/releases/download/v1.1.0/tools-system-linux_x86_64-1.1.0.tar.gz",
"sha1": "0f229a7d2952dd86390d1faa5e1268af8a773a17",
"version": "1.1.0",
"system": ["linux_x86_64"]
},
{
"url": "https://github.com/FPGAwars/tools-system/releases/download/v1.1.0/tools-system-windows_amd64-1.1.0.tar.gz",
"sha1": "a397ecb4b73ef06b370ad8f36c4482a110d5cec1",
"version": "1.1.0",
"system": ["windows_amd64"]
}
{
"url": "https://github.com/FPGAwars/tools-system/releases/download/v1.1.0/tools-system-windows_x86-1.1.0.tar.gz",
"sha1": "84d2695b3872e9128c4a318b837dcd16d525d04c",
"version": "1.1.0",
"system": ["windows", "windows_x86"]
}
]
}
42 changes: 42 additions & 0 deletions scripts/compile_lconfuse.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# -- Compile libconfuse script

VER=3.2.2
LIBCONFUSE=confuse-$VER
TAR_LIBCONFUSE=$LIBCONFUSE.tar.gz
REL_LIBCONFUSE=https://github.com/martinh/libconfuse/releases/download/v$VER/$TAR_LIBCONFUSE

# -- Setup
. $WORK_DIR/scripts/build_setup.sh

cd $UPSTREAM_DIR
# -- Check and download the release
test -e $TAR_LIBCONFUSE || wget $REL_LIBCONFUSE

# -- Unpack the release
tar zxf $TAR_LIBCONFUSE

# -- Copy the upstream sources into the build directory
rsync -a $LIBCONFUSE $BUILD_DIR --exclude .git

cd $BUILD_DIR/$LIBCONFUSE

PREFIX=$BUILD_DIR/$LIBCONFUSE/release

#-- Build libconfuse
if [ $ARCH != "darwin" ]; then
./configure --prefix=$PREFIX --host=$HOST $CONFIG_FLAGS
make
make install
fi

#-- Build simple
cd examples
if [ $ARCH == "darwin" ]; then
$CC -o simple simple.c -lconfuse -I../src
else
$CC -o simple simple.c -static -lconfuse -L$PREFIX/lib -I$PREFIX/include
fi
cd ..

# -- Test the generated executables
test_bin examples/simple
23 changes: 18 additions & 5 deletions scripts/compile_lsftdi.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
# -- Compile lsftdi script

VER=1.2
VER=1.4
LIBFTDI1=libftdi1-$VER
TAR_LIBFTDI1=$LIBFTDI1.tar.bz2
REL_LIBFTDI1=https://www.intra2net.com/en/developer/libftdi/download/$TAR_LIBFTDI1

VER=1.0.20
VER=1.0.22
LIBUSB=libusb-$VER

VER=3.2.2
LIBCONFUSE=confuse-$VER

# -- Setup
. $WORK_DIR/scripts/build_setup.sh

Expand All @@ -26,6 +29,7 @@ cd $BUILD_DIR/$LIBFTDI1

PREFIX=$BUILD_DIR/$LIBFTDI1/release
LIBUSB_PREFIX=$BUILD_DIR/$LIBUSB/release
LIBCONFUSE_PREFIX=$BUILD_DIR/$LIBCONFUSE/release

#-- Build libftdi
if [ $ARCH != "darwin" ]; then
Expand All @@ -47,10 +51,19 @@ else
fi
cd ..

# -- Test the generated executables
if [ $ARCH != "darwin" ]; then
test_bin examples/lsftdi
#-- Build ftdi_eeprom
cd ftdi_eeprom
if [ $ARCH == "darwin" ]; then
$CC -o ftdi_eeprom main.c -lftdi1 -lusb-1.0 -lconfuse -I../src -I$WORK_DIR/build-data/includes -I$PREFIX/include/libftdi1 -I$BUILD_DIR/$LIBUSB/libusb -I$BUILD_DIR/$LIBCONFUSE/src
else
$CC -o ftdi_eeprom main.c -static -lftdi1 -lusb-1.0 -lconfuse -lpthread -L$PREFIX/lib -L$LIBUSB_PREFIX/lib -L$LIBCONFUSE_PREFIX/lib -I$WORK_DIR/build-data/includes -I$PREFIX/include/libftdi1 -I$LIBUSB_PREFIX/include/libusb-1.0 -I$LIBCONFUSE_PREFIX/include
fi
cd ..

# -- Test the generated executables
test_bin examples/lsftdi
test_bin ftdi_eeprom/ftdi_eeprom

# -- Copy the executable into the packages/bin dir
cp examples/lsftdi $PACKAGE_DIR/$NAME/bin/lsftdi$EXE
cp ftdi_eeprom/ftdi_eeprom $PACKAGE_DIR/$NAME/bin/ftdi_eeprom$EXE
2 changes: 1 addition & 1 deletion scripts/compile_lsusb.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -- Compile lsusb script

VER=1.0.20
VER=1.0.22
LIBUSB=libusb-$VER
TAR_LIBUSB=$LIBUSB.tar.bz2
REL_LIBUSB=https://github.com/libusb/libusb/releases/download/v$VER/$TAR_LIBUSB
Expand Down
10 changes: 8 additions & 2 deletions scripts/install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,14 @@ if [ ${ARCH:0:7} == "windows" ]; then
fi

if [ $ARCH == "darwin" ]; then
DEPS="pkg-config libusb libftdi wget"
brew update
which -s brew
if [[ $? != 0 ]] ; then
# Install Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
else
brew update
fi
DEPS="pkg-config libusb libftdi wget confuse"
brew install --force $DEPS
brew unlink $DEPS && brew link --force $DEPS
fi
4 changes: 2 additions & 2 deletions scripts/travis_trigger.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/sh

#echo "> travis login --org"
#echo "> travis login"
#travis login --org

echo "> travis token"
travis token
travis token --org

echo "\n> Enter the token: "
read TOKEN
Expand Down
22 changes: 12 additions & 10 deletions test/test_bin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ echo "" >&2
echo "Testing $FILE file" >&2
echo "------------------------------" >&2

function test0 {
function test_base {
if "${@:2}"
then
echo "$1" >&2
Expand All @@ -18,26 +18,28 @@ function test0 {
fi
}

function test1 {
test0 "- 1. File exists" test -e $1
function test_exists {
test_base "- 1. File exists" test -e $1
}

function test2 {
test0 "- 2. File is executable" test -x $1
function test_exec {
test_base "- 2. File is executable" test -x $1
}

function test3 {
function test_static {
output=$(ldd $1 | grep "not a dynamic executable")
test0 "- 3. File is static" test -n "$output"
test_base "- 3. File is static" test -n "$output"
}

file $FILE

echo "------------------------------" >&2

test1 $FILE
test2 $FILE
test3 $FILE
test_exists $FILE
test_exec $FILE
if [[ $ARCH != "darwin" ]]; then
test_static $FILE
fi

echo "------------------------------" >&2
echo "All tests [PASSED]" >&2
Expand Down

0 comments on commit ad82855

Please sign in to comment.