Skip to content
Permalink
Browse files

Create test-qtrpi-minimal script

Close #52
  • Loading branch information
synapticvoid committed Mar 28, 2017
1 parent c1e5750 commit 2e9c5c4ce51d88e94d9634bb9953bc0f9cd0a3f7
@@ -7,7 +7,7 @@ Vagrant.configure(2) do |config|
config.vm.define "#{ENV['QTRPI_VM_NAME']}"

config.vm.provider "virtualbox" do |v|
v.memory = 2048
v.memory = 4096
v.cpus = 8
end

This file was deleted.

@@ -1,26 +1,12 @@
#!/bin/bash

QTRPI_BASE_URL='http://www.qtrpi.com/downloads'

source ${0%/*}/utils/common.sh

# prepare environment
$UTILS_DIR/utils/init-common.sh
$UTILS_DIR/utils/synchronize-toolchain.sh
$UTILS_DIR/init-common.sh
$UTILS_DIR/synchronize-toolchain.sh
cd_root

# download and unzip sysroot
message 'Download sysroot-minimal'
SYSROOT_ZIP=sysroot-minimal-latest.zip
curl -o $SYSROOT_ZIP $QTRPI_BASE_URL/sysroot/qtrpi-sysroot-minimal-latest.zip
unzip $SYSROOT_ZIP
$UTILS_DIR/utils/switch-sysroot.sh minimal

# download qtrpi
message 'Download qtrpi binaries'
QTRPI_ZIP="qtrpi-${DEVICE_NAME}_qt-${QT_VERSION}.zip"
curl -o $QTRPI_ZIP $QTRPI_BASE_URL/qtrpi/$DEVICE_NAME/$QTRPI_ZIP
unzip $QTRPI_ZIP
download_sysroot_minimal
download_qtrpi_binaries

# create symlink
ln -sf $ROOT/raspi/qt5/bin/qmake $ROOT/bin/qmake-qtrpi
@@ -0,0 +1,18 @@
#!/bin/bash

QTRPI_BASE_URL='http://www.qtrpi.com/downloads'

source ${0%/*}/utils/common.sh

export QTRPI_CURL_OPT="--user $CI_AUTH_USER:$CI_AUTH_PASSWORD"
export QTRPI_BASE_URL="$CI_BASE_URL/job/qtrpi/QT_VERSION=$QTRPI_QT_VERSION,TARGET_DEVICE=$QTRPI_TARGET_DEVICE/lastSuccessfulBuild/artifact/dist"

pushd $ROOT
download_qtrpi_binaries
curl $QTRPI_CURL_OPT \
-o raspi/qt5pi/qopenglwidget \
$QTRPI_BASE_URL/qopenglwidget
popd

./deploy-qtrpi.sh --prepare-rpi

@@ -12,6 +12,12 @@ TARGET_HOST=$QTRPI_TARGET_HOST
RASPBIAN_BASENAME='raspbian_latest'
VERSION='1.1.0'

QTRPI_ZIP="qtrpi-${DEVICE_NAME}_qt-${QT_VERSION}.zip"
QTRPI_BASE_URL='http://www.qtrpi.com/downloads'
QTRPI_SYSROOT_URL="$QTRPI_BASE_URL/sysroot/qtrpi-sysroot-minimal-latest.zip"
QTRPI_MINIMAL_URL="$QTRPI_BASE_URL/qtrpi/$DEVICE_NAME/$QTRPI_ZIP"
QTRPI_CURL_OPT=''

case $TARGET_DEVICE in
'linux-rasp-pi-g++') DEVICE_NAME='rpi1' ;;
'linux-rasp-pi2-g++') DEVICE_NAME='rpi2' ;;
@@ -66,3 +72,19 @@ function make_cmd() {
make -j 10 |& tee --append $ROOT/logs/$LOG_FILE.log
}

function download_sysroot_minimal() {
message "Download sysroot-minimal from $QTRPI_SYSROOT_URL"
SYSROOT_ZIP='sysroot-minimal-latest.zip'
curl $QTRPI_CURL_OPT -o $SYSROOT_ZIP $QTRPI_SYSROOT_URL
unzip -o $SYSROOT_ZIP
$UTILS_DIR/utils/switch-sysroot.sh minimal
}

function download_qtrpi_binaries() {
message "Download qtrpi binaries from $QTRPI_MINIMAL_URL"
curl $QTRPI_CURL_OPT -o $QTRPI_ZIP $QTRPI_MINIMAL_URL
unzip -o $QTRPI_ZIP

ln -sf $ROOT/raspi/qt5/bin/qmake $ROOT/bin/qmake-qtrpi
}

@@ -7,10 +7,13 @@ MODULE='qopenglwidget'

message "Building module $MODULE"

mkdir -p dist

cd modules/qtbase/examples/opengl/$MODULE

qmake_cmd $MODULE

make clean
make_cmd $MODULE
make install

cp $MODULE $ROOT/dist/
@@ -8,4 +8,4 @@ BASE_DIR=dist/sysroot
mkdir -p $BASE_DIR

message 'Compressing sysroot-minimal'
zip --symlinks -r -q $ROOT/$BASE_DIR/qtrpi-sysroot-minimal-$RASPBIAN_BASENAME.zip raspbian/sysroot-minimal
zip --symlinks -r -q $ROOT/$BASE_DIR/qtrpi-sysroot-minimal-latest.zip raspbian/sysroot-minimal

0 comments on commit 2e9c5c4

Please sign in to comment.