Skip to content

Commit

Permalink
[ci skip] [tools] Improve developer build script
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Aug 30, 2022
1 parent 079ce84 commit 28c6d0a
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 30 deletions.
14 changes: 11 additions & 3 deletions ci/common.deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@ ls
pwd
cd src/addons

git clone --recursive -j16 https://github.com/ossia/iscore-addon-network
git clone --recursive -j16 https://github.com/ossia/score-addon-synthimi
git clone --recursive -j16 https://github.com/ossia/score-addon-threedim
if [[ ! -d iscore-addon-network ]]; then
git clone --recursive -j16 https://github.com/ossia/iscore-addon-network
fi

if [[ ! -d score-addon-synthimi ]]; then
git clone --recursive -j16 https://github.com/ossia/score-addon-synthimi
fi

if [[ ! -d score-addon-threedim ]]; then
git clone --recursive -j16 https://github.com/ossia/score-addon-threedim
fi
)
1 change: 1 addition & 0 deletions ci/fedora-qt6.deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ dnf -y install \
lilv-devel suil-devel \
fftw-devel \
avahi-devel \
libxkbcommon-x11-devel libxkbcommon-devel \
bluez-libs-devel \
qt6-qtbase-devel \
qt6-qtbase-private-devel \
Expand Down
9 changes: 5 additions & 4 deletions src/plugins/score-plugin-js/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ endif()

if(${QT_PREFIX} MATCHES "Qt6")
find_package(${QT_VERSION} COMPONENTS QmlIntegration)
if(NOT TARGET ${QT_PREFIX}::QmlIntegration)
return()
endif()
endif()

# Files & main target
Expand Down Expand Up @@ -65,8 +62,12 @@ target_link_libraries(${PROJECT_NAME} PUBLIC
score_plugin_deviceexplorer score_plugin_protocols
score_plugin_media)

if(TARGET ${QT_PREFIX}::QmlIntegration)
if(${QT_PREFIX} MATCHES "Qt6")
set_target_properties(${PROJECT_NAME} PROPERTIES AUTOMOC 1)
endif()

if(TARGET ${QT_PREFIX}::QmlIntegration)
target_link_libraries(${PROJECT_NAME} PUBLIC ${QT_PREFIX}::QmlIntegration)
endif()

setup_score_plugin(${PROJECT_NAME})
2 changes: 1 addition & 1 deletion src/plugins/score-plugin-js/JS/Qml/ValueTypes.Qt6.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <QVector2D>
#include <QVector3D>
#include <QVector4D>
#include <QtQmlIntegration/QtQmlIntegration>
#include <QtQml/qqmlregistration.h>

#include <verdigris>

Expand Down
4 changes: 4 additions & 0 deletions src/plugins/score-plugin-remotecontrol/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ if(NOT TARGET ${QT_PREFIX}::WebSockets)
return()
endif()

if(NOT TARGET score_plugin_js)
message(FATAL_ERROR "Remote control plug-in requires score_plugin_js.")
return()
endif()
# General initialization
score_common_setup()

Expand Down
50 changes: 28 additions & 22 deletions tools/developer.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
#!/bin/bash -eu
echo "Running on OSTYPE: '$OSTYPE'"
DISTRO=""
CODENAME=""

command -v git >/dev/null 2>&1 || { echo >&2 "Please install git."; exit 1; }

if [[ -d ../.git ]]; then
cd ..
fi

if [[ ! -d .git ]]; then
elif [[ -d score/.git ]]; then
cd score
elif [[ ! -d .git ]]; then
git clone --recursive -j16 https://github.com/ossia/score
cd score
fi
Expand All @@ -31,8 +33,8 @@ detect_deps_script() {
QT=5
return 0;;
jammy)
DEPS=jammy-qt6
QT=6
DEPS=jammy
QT=5
return 0;;
leap)
DEPS=suse-leap
Expand All @@ -50,12 +52,12 @@ detect_deps_script() {
QT=6
return 0;;
debian)
DEPS=jammy-qt6
QT=6
DEPS=jammy
QT=5
return 0;;
ubuntu)
DEPS=jammy-qt6
QT=6
DEPS=jammy
QT=5
return 0;;
fedora)
DEPS=fedora-qt6
Expand Down Expand Up @@ -108,18 +110,19 @@ detect_linux_qt_version() {

detect_linux_distro() {
DISTRO=$(awk -F'=' '/^ID=/ {gsub("\"","",$2); print tolower($2) } ' /etc/*-release 2> /dev/null)
CODENAME=""
QT=6
case "$DISTRO" in
arch)
return 0;;
debian)
DISTRO_CODENAME=$(cat /etc/*-release | grep CODENAME | head -n 1 | cut -d= -f2)
if [[ "$DISTRO_CODENAME" == "" ]]; then
DISTRO_CODENAME=sid
CODENAME=$(cat /etc/*-release | grep CODENAME | head -n 1 | cut -d= -f2)
if [[ "$CODENAME" == "" ]]; then
CODENAME=sid
fi
return 0;;
ubuntu)
DISTRO_CODENAME=$(cat /etc/*-release | grep CODENAME | head -n 1 | cut -d= -f2)
CODENAME=$(cat /etc/*-release | grep CODENAME | head -n 1 | cut -d= -f2)
return 0;;
fedora)
return 0;;
Expand Down Expand Up @@ -162,9 +165,9 @@ detect_linux_distro() {

if command -v apt >/dev/null 2>&1; then
DISTRO=debian
DISTRO_CODENAME=$(cat /etc/*-release | grep CODENAME | head -n 1 | cut -d= -f2)
if [[ "$DISTRO_CODENAME" == "" ]]; then
DISTRO_CODENAME=sid
CODENAME=$(cat /etc/*-release | grep CODENAME | head -n 1 | cut -d= -f2)
if [[ "$CODENAME" == "" ]]; then
CODENAME=sid
fi
return 0
fi
Expand All @@ -176,19 +179,19 @@ detect_linux_distro() {
if [[ "$OSTYPE" == "darwin"* ]]; then
(
command -v brew >/dev/null 2>&1 || { echo >&2 "Please install Homebrew."; exit 1; }
(brew list | grep qt >/dev/null) && { echo >&2 "Please remove qt@5 as it is incompatible with the required Homebrew Qt 6 package"; exit 1; }
(brew list | grep qt@5 >/dev/null) && { echo >&2 "Please remove qt@5 as it is incompatible with the required Homebrew Qt 6 package"; exit 1; }

echo "[developer.sh] Installing dependencies"
brew update
brew upgrade
brew install ninja qt boost cmake ffmpeg fftw portaudio sdl lv2 lilv suil freetype
brew install ninja qt boost cmake ffmpeg fftw portaudio sdl lv2 lilv freetype
brew cleanup

echo "[developer.sh] Configuring"
mkdir -p build-developer
cd build-developer

if [[ -f ./score ]]; then
if [[ ! -f ./score ]]; then
cmake -Wno-dev \
.. \
-DCMAKE_PREFIX_PATH=/usr/local/Cellar/qt \
Expand All @@ -210,21 +213,24 @@ elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
(
echo "[developer.sh] Installing dependencies"
detect_linux_distro
detect_qt_version
detect_linux_qt_version
detect_deps_script
source "ci/$DEPS.deps.sh"

echo "[developer.sh] Configuring"
mkdir -p build-developer
cd build-developer

if [[ "$QT" == 5 ]];
if [[ "$QT" == 5 ]]; then
QT_CMAKE_FLAG=''
else
QT_CMAKE_FLAG='-DQT_VERSION=Qt6;6.2'
fi

if [[ -f ./ossia-score ]]; then
echo "ls: "
ls

if [[ ! -f ./ossia-score ]]; then
cmake -Wno-dev \
.. \
-GNinja \
Expand Down

0 comments on commit 28c6d0a

Please sign in to comment.