Skip to content

Commit

Permalink
Create test-qtrpi-minimal script
Browse files Browse the repository at this point in the history
Close #52
  • Loading branch information
synapticvoid committed Mar 28, 2017
1 parent c1e5750 commit 2e9c5c4
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 35 deletions.
2 changes: 1 addition & 1 deletion Vagrantfile
Expand Up @@ -7,7 +7,7 @@ Vagrant.configure(2) do |config|
config.vm.define "#{ENV['QTRPI_VM_NAME']}" config.vm.define "#{ENV['QTRPI_VM_NAME']}"


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


Expand Down
14 changes: 0 additions & 14 deletions compile-all-versions.sh

This file was deleted.

22 changes: 4 additions & 18 deletions init-qtrpi-minimal.sh
@@ -1,26 +1,12 @@
#!/bin/bash #!/bin/bash


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

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


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


# download and unzip sysroot download_sysroot_minimal
message 'Download sysroot-minimal' download_qtrpi_binaries
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


# create symlink
ln -sf $ROOT/raspi/qt5/bin/qmake $ROOT/bin/qmake-qtrpi
18 changes: 18 additions & 0 deletions test-qtrpi-minimal.sh
@@ -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

22 changes: 22 additions & 0 deletions utils/common.sh
Expand Up @@ -12,6 +12,12 @@ TARGET_HOST=$QTRPI_TARGET_HOST
RASPBIAN_BASENAME='raspbian_latest' RASPBIAN_BASENAME='raspbian_latest'
VERSION='1.1.0' 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 case $TARGET_DEVICE in
'linux-rasp-pi-g++') DEVICE_NAME='rpi1' ;; 'linux-rasp-pi-g++') DEVICE_NAME='rpi1' ;;
'linux-rasp-pi2-g++') DEVICE_NAME='rpi2' ;; 'linux-rasp-pi2-g++') DEVICE_NAME='rpi2' ;;
Expand Down Expand Up @@ -66,3 +72,19 @@ function make_cmd() {
make -j 10 |& tee --append $ROOT/logs/$LOG_FILE.log 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
}

5 changes: 4 additions & 1 deletion utils/compile-example-qopenglwidget.sh
Expand Up @@ -7,10 +7,13 @@ MODULE='qopenglwidget'


message "Building module $MODULE" message "Building module $MODULE"


mkdir -p dist

cd modules/qtbase/examples/opengl/$MODULE cd modules/qtbase/examples/opengl/$MODULE


qmake_cmd $MODULE qmake_cmd $MODULE


make clean make clean
make_cmd $MODULE make_cmd $MODULE
make install
cp $MODULE $ROOT/dist/
2 changes: 1 addition & 1 deletion utils/generate-compressed-sysroot-minimal.sh
Expand Up @@ -8,4 +8,4 @@ BASE_DIR=dist/sysroot
mkdir -p $BASE_DIR mkdir -p $BASE_DIR


message 'Compressing sysroot-minimal' 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.