From 3f93e100d345dc7a36b8f1603bd7895a25b7d421 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Kov=C3=A1cs?= Date: Fri, 29 Sep 2023 23:13:17 +0200 Subject: [PATCH 01/11] Update copyright year --- tools/create-deb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/create-deb b/tools/create-deb index ac90aef6..95de82d2 100755 --- a/tools/create-deb +++ b/tools/create-deb @@ -55,7 +55,7 @@ Upstream-Name: xaos Source: https://github.com/xaos-project/XaoS Files: * -Copyright: 2020 The XaoS Project +Copyright: 2023 The XaoS Project License: GPL-1" > "$DOCDIR/copyright" git-changelog -x > "$DOCDIR/changelog" From 05c8c5dc784a7074a21914aee969dbe6556cfa9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Kov=C3=A1cs?= Date: Sun, 1 Oct 2023 22:55:45 +0200 Subject: [PATCH 02/11] Update Windows packaging infos --- tools/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/README.md b/tools/README.md index 7811e55a..8b5b83c0 100644 --- a/tools/README.md +++ b/tools/README.md @@ -21,11 +21,21 @@ Before running the script `deploy-win.bat` from command line you need to add the path of tools `windeployqt.exe` and `binarycreator.exe` to the environmental system variable PATH. +Important: `windeployqt.exe` will use the first C++ compiler from the path. +To avoid getting the wrong DLLs (because of availability of multiple compilers +on your system) make sure that the used compiler is found as first one. +If you use the wrong DLLs, XaoS will not start. + +See also https://stackoverflow.com/questions/43397609/qt-deployment-for-windows-copies-incorrect-dll-for-mingw + To avoid problems with finding certain files, you should make sure that there is no special character in the full path of the `XaoS` folder. Otherwise some files may be missing from the installation bundle (for example, the .cat files). +To create the .zip file, simply copy the bin folder in it and also the +folders catalog/, examples/ and tutorial/. + MacOS ----- From f3eb461fac53670fd08cc3b84da6c50491612ca3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Kov=C3=A1cs?= Date: Mon, 2 Oct 2023 08:57:42 +0200 Subject: [PATCH 03/11] Add scripts for WebAssembly compilation --- tools/compile-qt-web | 44 ++++++++++++++++++++++++++++++++++++++++++ tools/compile-xaos-web | 14 ++++++++++++++ 2 files changed, 58 insertions(+) create mode 100755 tools/compile-qt-web create mode 100755 tools/compile-xaos-web diff --git a/tools/compile-qt-web b/tools/compile-qt-web new file mode 100755 index 00000000..47e31ee8 --- /dev/null +++ b/tools/compile-qt-web @@ -0,0 +1,44 @@ +#!/bin/bash + +# This script compiles Qt6 to be able to build XaoS for WebAssembly. +# Make sure that you have enough disk space. At least 45 GB is recommended. + +# See also https://doc.qt.io/qt-6.5/wasm.html and https://wiki.qt.io/Building_Qt_6_from_Git. + +QT6_VERSION=6.5.3 +EMSDK_VERSION=3.1.25 +PARALLEL=4 + +QT6_HOST_PATH=`pwd`/qt6-host-install + +# Get emscripten: +test -x emsdk || git clone https://github.com/emscripten-core/emsdk.git +cd emsdk +git pull +./emsdk install $EMSDK_VERSION +./emsdk activate --embedded $EMSDK_VERSION +cd .. + +# Get Qt: +git clone git://code.qt.io/qt/qt5.git qt6 +cd qt6 +git switch v$QT6_VERSION +perl init-repository + +# Compile Qt for the Linux host +cd .. +mkdir qt6-host-build +cd qt6-host-build +../qt6/configure -prefix $QT6_HOST_PATH +cmake --build . --parallel $PARALLEL +cmake --install . + +# Compile Qt for WebAssembly +cd .. +mkdir qt6-wasm-build +cd qt6-wasm-build +. ../emsdk/emsdk_env.sh +../qt6/configure -xplatform wasm-emscripten -nomake examples -prefix $PWD/qtbase \ + -opensource -confirm-license -qt-host-path $QT6_HOST_PATH -device-option QT_EMSCRIPTEN_ASYNCIFY=1 +cmake --build . --parallel $PARALLEL -t qtbase -t qtdeclarative -t qtimageformats +cd .. diff --git a/tools/compile-xaos-web b/tools/compile-xaos-web new file mode 100755 index 00000000..b807ec40 --- /dev/null +++ b/tools/compile-xaos-web @@ -0,0 +1,14 @@ +#!/bin/bash + +# This script compiles XaoS for WebAssembly. + +QT6_WASM_BUILD=`pwd`/qt6-wasm-build +test -x $QT6_WASM_BUILD || { + echo "Run compile-qt-web first." + exit 1 + } + +. emsdk/emsdk_env.sh +cd .. +$QT6_WASM_BUILD/qtbase/bin/qmake +make || true From 8ea00ebbf675904b4addf2bd70ca1c8270fe79a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Kov=C3=A1cs?= Date: Mon, 2 Oct 2023 09:00:40 +0200 Subject: [PATCH 04/11] Attempt to build WASM version as an action --- .github/workflows/build.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 088d13e5..32f5191a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,3 +30,16 @@ jobs: run: qmake - name: make run: make + + wasm: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: prerequisites + run: sudo apt update && sudo apt install build-essential libclang-dev cmake ninja-build + - name: compile-qt-web + run: cd tools && ./compile-qt-web + - name: compile-xaos-web + run: cd tools && ./compile-xaos-web From f7da245b95bc5e15fa6beed4808295cea873c319 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Kov=C3=A1cs?= Date: Mon, 2 Oct 2023 09:17:44 +0200 Subject: [PATCH 05/11] Attempt to fix missing file libclangBasic.a --- .github/workflows/build.yml | 2 +- tools/compile-qt-web | 2 ++ tools/compile-xaos-web | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 32f5191a..548e4645 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,7 +38,7 @@ jobs: steps: - uses: actions/checkout@v1 - name: prerequisites - run: sudo apt update && sudo apt install build-essential libclang-dev cmake ninja-build + run: sudo apt update && sudo apt install build-essential libclang-13-dev cmake ninja-build - name: compile-qt-web run: cd tools && ./compile-qt-web - name: compile-xaos-web diff --git a/tools/compile-qt-web b/tools/compile-qt-web index 47e31ee8..0400beea 100755 --- a/tools/compile-qt-web +++ b/tools/compile-qt-web @@ -11,6 +11,8 @@ PARALLEL=4 QT6_HOST_PATH=`pwd`/qt6-host-install +set -e + # Get emscripten: test -x emsdk || git clone https://github.com/emscripten-core/emsdk.git cd emsdk diff --git a/tools/compile-xaos-web b/tools/compile-xaos-web index b807ec40..f5d124ad 100755 --- a/tools/compile-xaos-web +++ b/tools/compile-xaos-web @@ -2,6 +2,8 @@ # This script compiles XaoS for WebAssembly. +set -e + QT6_WASM_BUILD=`pwd`/qt6-wasm-build test -x $QT6_WASM_BUILD || { echo "Run compile-qt-web first." From e230c415a3ed5912cf3d5e05437e50521cc62f7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Kov=C3=A1cs?= Date: Mon, 2 Oct 2023 09:25:53 +0200 Subject: [PATCH 06/11] Fix branch --- tools/compile-qt-web | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/compile-qt-web b/tools/compile-qt-web index 0400beea..4e3f0912 100755 --- a/tools/compile-qt-web +++ b/tools/compile-qt-web @@ -24,7 +24,7 @@ cd .. # Get Qt: git clone git://code.qt.io/qt/qt5.git qt6 cd qt6 -git switch v$QT6_VERSION +git switch $QT6_VERSION perl init-repository # Compile Qt for the Linux host From 3ddf6c3cd18448dc77a27da7f77bdafd7db3b9d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Kov=C3=A1cs?= Date: Mon, 2 Oct 2023 09:47:51 +0200 Subject: [PATCH 07/11] Attempt to fix build action by adding more dependencies --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 548e4645..3133f771 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,7 +38,7 @@ jobs: steps: - uses: actions/checkout@v1 - name: prerequisites - run: sudo apt update && sudo apt install build-essential libclang-13-dev cmake ninja-build + run: sudo apt update && sudo apt install build-essential libclang-13-dev cmake ninja-build libgl-dev libegl-dev libfontconfig-dev - name: compile-qt-web run: cd tools && ./compile-qt-web - name: compile-xaos-web From 0a9f65a74069c8831dfb26ab5ff0f39f2093943b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Kov=C3=A1cs?= Date: Mon, 2 Oct 2023 12:35:46 +0200 Subject: [PATCH 08/11] Disable wasm, finalize build scripts --- .github/workflows/build.yml | 26 ++++++++++++++------------ tools/compile-qt-web | 2 +- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3133f771..d2e8fc12 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,15 +31,17 @@ jobs: - name: make run: make - wasm: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v1 - - name: prerequisites - run: sudo apt update && sudo apt install build-essential libclang-13-dev cmake ninja-build libgl-dev libegl-dev libfontconfig-dev - - name: compile-qt-web - run: cd tools && ./compile-qt-web - - name: compile-xaos-web - run: cd tools && ./compile-xaos-web +# This requires too much disk space (more than 40 GB), so it is disabled for now: + +# wasm: +# +# runs-on: ubuntu-latest +# +# steps: +# - uses: actions/checkout@v1 +# - name: prerequisites +# run: sudo apt update && sudo apt install build-essential libclang-13-dev cmake ninja-build libgl-dev libegl-dev libfontconfig-dev +# - name: compile-qt-web +# run: cd tools && ./compile-qt-web +# - name: compile-xaos-web +# run: cd tools && ./compile-xaos-web diff --git a/tools/compile-qt-web b/tools/compile-qt-web index 4e3f0912..2247449f 100755 --- a/tools/compile-qt-web +++ b/tools/compile-qt-web @@ -42,5 +42,5 @@ cd qt6-wasm-build . ../emsdk/emsdk_env.sh ../qt6/configure -xplatform wasm-emscripten -nomake examples -prefix $PWD/qtbase \ -opensource -confirm-license -qt-host-path $QT6_HOST_PATH -device-option QT_EMSCRIPTEN_ASYNCIFY=1 -cmake --build . --parallel $PARALLEL -t qtbase -t qtdeclarative -t qtimageformats +cmake --build . --parallel $PARALLEL -t qtbase -t qtdeclarative -t qtimageformats -t qsvgicon -t qsvg cd .. From 36aa53b7b022a6a2dc75faf9e44cf02f4a21bcca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Kov=C3=A1cs?= Date: Fri, 6 Oct 2023 09:21:59 +0200 Subject: [PATCH 09/11] Add $(INSTALL_ROOT) to resolve https://github.com/xaos-project/XaoS/issues/240 --- XaoS.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XaoS.pro b/XaoS.pro index 405d0354..80978d63 100644 --- a/XaoS.pro +++ b/XaoS.pro @@ -89,7 +89,7 @@ wasm{ executable.files = bin/xaos executable.path = $$PREFIX/bin examples.path = $$PREFIX/share/XaoS/examples -examples.extra = find examples -name \'*.xpf\' -exec cp {} $$PREFIX/share/XaoS/examples \; +examples.extra = find examples -name \'*.xpf\' -exec cp {} $(INSTALL_ROOT)$$PREFIX/share/XaoS/examples \; catalogs.files = catalogs/*.cat catalogs.path = $$PREFIX/share/XaoS/catalogs tutorial.files = tutorial/*.x?f From 922202dadecb20bd2826b36152c549deee3f9123 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Kov=C3=A1cs?= Date: Fri, 6 Oct 2023 09:23:14 +0200 Subject: [PATCH 10/11] Update for Qt 6 --- tools/create-deb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/create-deb b/tools/create-deb index 95de82d2..98115ce5 100755 --- a/tools/create-deb +++ b/tools/create-deb @@ -1,7 +1,7 @@ #!/usr/bin/env bash -# This script creates a .deb package of XaoS 4.0 and above. -# Make sure you build the program first ("qmake PREFIX=/usr && make -j4"). +# This script creates a .deb package of XaoS 4.3 and above. +# Make sure you build the program first ("qmake6 PREFIX=/usr && make -j4"). # Required packages before running this script: # lynx pandoc git-extras lintian From 87be45860e20babebbd8aff587506a90971e3a65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Kov=C3=A1cs?= Date: Fri, 6 Oct 2023 09:23:31 +0200 Subject: [PATCH 11/11] Attempt to fix https://github.com/xaos-project/XaoS/issues/225 --- src/util/xstdio.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/util/xstdio.cpp b/src/util/xstdio.cpp index 2c0f7d55..61fe6b31 100644 --- a/src/util/xstdio.cpp +++ b/src/util/xstdio.cpp @@ -171,10 +171,14 @@ xio_file xio_getrandomexample(xio_path name) }; // Select a random sub dir and then random example to fix load random example issue + + // if ../examples exists, add its subdirectories to example_path_taken, otherwise do nothing: QStringList sub_names = get_immediate_subdirectory_names(".." XIO_PATHSEPSTR "examples"); - int randomIndex = QRandomGenerator::global()->bounded(sub_names.length()); - QString randomElement = sub_names.at(randomIndex); - example_paths_taken.append(".." XIO_PATHSEPSTR "examples/"+randomElement); + if (sub_names.length() > 0) { + int randomIndex = QRandomGenerator::global()->bounded(sub_names.length()); + QString randomElement = sub_names.at(randomIndex); + example_paths_taken.append(".." XIO_PATHSEPSTR "examples/"+randomElement); + } char *paths[example_paths_taken.size()]; convertQStringListToArray(example_paths_taken, paths);