Skip to content

Commit 9a9b382

Browse files
committed
[ci skip] [tools] Improve developer build script
1 parent 079ce84 commit 9a9b382

File tree

6 files changed

+48
-28
lines changed

6 files changed

+48
-28
lines changed

ci/common.deps.sh

+11-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,15 @@ ls
55
pwd
66
cd src/addons
77

8-
git clone --recursive -j16 https://github.com/ossia/iscore-addon-network
9-
git clone --recursive -j16 https://github.com/ossia/score-addon-synthimi
10-
git clone --recursive -j16 https://github.com/ossia/score-addon-threedim
8+
if [[ ! -d iscore-addon-network ]]; then
9+
git clone --recursive -j16 https://github.com/ossia/iscore-addon-network
10+
fi
11+
12+
if [[ ! -d score-addon-synthimi ]]; then
13+
git clone --recursive -j16 https://github.com/ossia/score-addon-synthimi
14+
fi
15+
16+
if [[ ! -d score-addon-threedim ]]; then
17+
git clone --recursive -j16 https://github.com/ossia/score-addon-threedim
18+
fi
1119
)

ci/fedora-qt6.deps.sh

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ dnf -y install \
1717
lilv-devel suil-devel \
1818
fftw-devel \
1919
avahi-devel \
20+
libxkbcommon-x11-devel libxkbcommon-devel \
2021
bluez-libs-devel \
2122
qt6-qtbase-devel \
2223
qt6-qtbase-private-devel \

src/plugins/score-plugin-js/CMakeLists.txt

+5-4
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ endif()
1414

1515
if(${QT_PREFIX} MATCHES "Qt6")
1616
find_package(${QT_VERSION} COMPONENTS QmlIntegration)
17-
if(NOT TARGET ${QT_PREFIX}::QmlIntegration)
18-
return()
19-
endif()
2017
endif()
2118

2219
# Files & main target
@@ -65,8 +62,12 @@ target_link_libraries(${PROJECT_NAME} PUBLIC
6562
score_plugin_deviceexplorer score_plugin_protocols
6663
score_plugin_media)
6764

68-
if(TARGET ${QT_PREFIX}::QmlIntegration)
65+
if(${QT_PREFIX} MATCHES "Qt6")
6966
set_target_properties(${PROJECT_NAME} PROPERTIES AUTOMOC 1)
67+
endif()
68+
69+
if(TARGET ${QT_PREFIX}::QmlIntegration)
7070
target_link_libraries(${PROJECT_NAME} PUBLIC ${QT_PREFIX}::QmlIntegration)
7171
endif()
72+
7273
setup_score_plugin(${PROJECT_NAME})

src/plugins/score-plugin-js/JS/Qml/ValueTypes.Qt6.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include <QVector2D>
1313
#include <QVector3D>
1414
#include <QVector4D>
15-
#include <QtQmlIntegration/QtQmlIntegration>
15+
#include <QtQml/qqmlregistration.h>
1616

1717
#include <verdigris>
1818

src/plugins/score-plugin-remotecontrol/CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ if(NOT TARGET ${QT_PREFIX}::WebSockets)
66
return()
77
endif()
88

9+
if(NOT TARGET score_plugin_js)
10+
message(FATAL_ERROR "Remote control plug-in requires score_plugin_js.")
11+
return()
12+
endif()
913
# General initialization
1014
score_common_setup()
1115

tools/developer.sh

+26-20
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
#!/bin/bash -eu
22
echo "Running on OSTYPE: '$OSTYPE'"
3+
DISTRO=""
4+
CODENAME=""
35

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

68
if [[ -d ../.git ]]; then
79
cd ..
8-
fi
9-
10-
if [[ ! -d .git ]]; then
10+
elif [[ -d score/.git ]]; then
11+
cd score
12+
elif [[ ! -d .git ]]; then
1113
git clone --recursive -j16 https://github.com/ossia/score
1214
cd score
1315
fi
@@ -31,8 +33,8 @@ detect_deps_script() {
3133
QT=5
3234
return 0;;
3335
jammy)
34-
DEPS=jammy-qt6
35-
QT=6
36+
DEPS=jammy
37+
QT=5
3638
return 0;;
3739
leap)
3840
DEPS=suse-leap
@@ -50,12 +52,12 @@ detect_deps_script() {
5052
QT=6
5153
return 0;;
5254
debian)
53-
DEPS=jammy-qt6
54-
QT=6
55+
DEPS=jammy
56+
QT=5
5557
return 0;;
5658
ubuntu)
57-
DEPS=jammy-qt6
58-
QT=6
59+
DEPS=jammy
60+
QT=5
5961
return 0;;
6062
fedora)
6163
DEPS=fedora-qt6
@@ -108,18 +110,19 @@ detect_linux_qt_version() {
108110

109111
detect_linux_distro() {
110112
DISTRO=$(awk -F'=' '/^ID=/ {gsub("\"","",$2); print tolower($2) } ' /etc/*-release 2> /dev/null)
113+
CODENAME=""
111114
QT=6
112115
case "$DISTRO" in
113116
arch)
114117
return 0;;
115118
debian)
116-
DISTRO_CODENAME=$(cat /etc/*-release | grep CODENAME | head -n 1 | cut -d= -f2)
117-
if [[ "$DISTRO_CODENAME" == "" ]]; then
118-
DISTRO_CODENAME=sid
119+
CODENAME=$(cat /etc/*-release | grep CODENAME | head -n 1 | cut -d= -f2)
120+
if [[ "$CODENAME" == "" ]]; then
121+
CODENAME=sid
119122
fi
120123
return 0;;
121124
ubuntu)
122-
DISTRO_CODENAME=$(cat /etc/*-release | grep CODENAME | head -n 1 | cut -d= -f2)
125+
CODENAME=$(cat /etc/*-release | grep CODENAME | head -n 1 | cut -d= -f2)
123126
return 0;;
124127
fedora)
125128
return 0;;
@@ -162,9 +165,9 @@ detect_linux_distro() {
162165

163166
if command -v apt >/dev/null 2>&1; then
164167
DISTRO=debian
165-
DISTRO_CODENAME=$(cat /etc/*-release | grep CODENAME | head -n 1 | cut -d= -f2)
166-
if [[ "$DISTRO_CODENAME" == "" ]]; then
167-
DISTRO_CODENAME=sid
168+
CODENAME=$(cat /etc/*-release | grep CODENAME | head -n 1 | cut -d= -f2)
169+
if [[ "$CODENAME" == "" ]]; then
170+
CODENAME=sid
168171
fi
169172
return 0
170173
fi
@@ -188,7 +191,7 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
188191
mkdir -p build-developer
189192
cd build-developer
190193

191-
if [[ -f ./score ]]; then
194+
if [[ ! -f ./score ]]; then
192195
cmake -Wno-dev \
193196
.. \
194197
-DCMAKE_PREFIX_PATH=/usr/local/Cellar/qt \
@@ -210,21 +213,24 @@ elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
210213
(
211214
echo "[developer.sh] Installing dependencies"
212215
detect_linux_distro
213-
detect_qt_version
216+
detect_linux_qt_version
214217
detect_deps_script
215218
source "ci/$DEPS.deps.sh"
216219

217220
echo "[developer.sh] Configuring"
218221
mkdir -p build-developer
219222
cd build-developer
220223

221-
if [[ "$QT" == 5 ]];
224+
if [[ "$QT" == 5 ]]; then
222225
QT_CMAKE_FLAG=''
223226
else
224227
QT_CMAKE_FLAG='-DQT_VERSION=Qt6;6.2'
225228
fi
226229

227-
if [[ -f ./ossia-score ]]; then
230+
echo "ls: "
231+
ls
232+
233+
if [[ ! -f ./ossia-score ]]; then
228234
cmake -Wno-dev \
229235
.. \
230236
-GNinja \

0 commit comments

Comments
 (0)