Skip to content

Commit 451e727

Browse files
authored
Merge branch 'jamulussoftware:main' into master
2 parents cc246a5 + bb1639a commit 451e727

File tree

356 files changed

+27707
-58245
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

356 files changed

+27707
-58245
lines changed

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,7 @@ function_next_line = false
2727

2828
[libs/**]
2929
ignore = true
30+
31+
[*.py]
32+
# This is the widest that is still PEP-8 compliant
33+
max_line_length = 99

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ assignees: ''
1414

1515
<!--
1616
List possible approaches with pros and cons, reference any relevant discussion threads if possible, and consider tagging the main participants.
17-
Please note the contribution guidelines (https://github.com/jamulussoftware/jamulus/blob/master/CONTRIBUTING.md), especially the part about "keeping it simple and stupid".
17+
Please note the contribution guidelines (https://github.com/jamulussoftware/jamulus/blob/main/CONTRIBUTING.md), especially the part about "keeping it simple and stupid".
1818
-->
1919

2020
<!-- Describe the solution you'd like -->

.github/autobuild/android.sh

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,29 @@
11
#!/bin/bash
2+
##############################################################################
3+
# Copyright (c) 2022-2024
4+
#
5+
# Author(s):
6+
# Christian Hoffmann
7+
# The Jamulus Development Team
8+
#
9+
##############################################################################
10+
#
11+
# This program is free software; you can redistribute it and/or modify it under
12+
# the terms of the GNU General Public License as published by the Free Software
13+
# Foundation; either version 2 of the License, or (at your option) any later
14+
# version.
15+
#
16+
# This program is distributed in the hope that it will be useful, but WITHOUT
17+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18+
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
19+
# details.
20+
#
21+
# You should have received a copy of the GNU General Public License along with
22+
# this program; if not, write to the Free Software Foundation, Inc.,
23+
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24+
#
25+
##############################################################################
26+
227
set -eu
328

429
# Some of the following version pinnings are semi-automatically checked for
@@ -7,7 +32,7 @@ COMMANDLINETOOLS_VERSION=6858069
732
ANDROID_NDK_VERSION=r21d
833
ANDROID_PLATFORM=android-30
934
ANDROID_BUILD_TOOLS=30.0.2
10-
AQTINSTALL_VERSION=3.0.2
35+
AQTINSTALL_VERSION=3.1.15
1136
QT_VERSION=5.15.2
1237

1338
# Only variables which are really needed by sub-commands are exported.

.github/autobuild/extractVersionChangelog.pl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,29 @@
11
#!/usr/bin/env perl
2+
##############################################################################
3+
# Copyright (c) 2021-2024
4+
#
5+
# Author(s):
6+
# ann0see
7+
# Christian Hoffmann
8+
# The Jamulus Development Team
9+
#
10+
##############################################################################
11+
#
12+
# This program is free software; you can redistribute it and/or modify it under
13+
# the terms of the GNU General Public License as published by the Free Software
14+
# Foundation; either version 2 of the License, or (at your option) any later
15+
# version.
16+
#
17+
# This program is distributed in the hope that it will be useful, but WITHOUT
18+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19+
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
20+
# details.
21+
#
22+
# You should have received a copy of the GNU General Public License along with
23+
# this program; if not, write to the Free Software Foundation, Inc.,
24+
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25+
#
26+
##############################################################################
227

328
use strict;
429
use warnings;

.github/autobuild/get_build_vars.py

Lines changed: 45 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,36 @@
11
#!/usr/bin/env python3
2-
# This script is trigged from the Github Autobuild workflow.
3-
# It analyzes Jamulus.pro and git push details (tag vs. branch, etc.) to decide
4-
# - whether a release should be created,
5-
# - whether it is a pre-release, and
6-
# - what its title should be.
2+
##############################################################################
3+
# Copyright (c) 2022-2024
4+
#
5+
# Author(s):
6+
# Christian Hoffmann
7+
# The Jamulus Development Team
8+
#
9+
##############################################################################
10+
#
11+
# This program is free software; you can redistribute it and/or modify it under
12+
# the terms of the GNU General Public License as published by the Free Software
13+
# Foundation; either version 2 of the License, or (at your option) any later
14+
# version.
15+
#
16+
# This program is distributed in the hope that it will be useful, but WITHOUT
17+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18+
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
19+
# details.
20+
#
21+
# You should have received a copy of the GNU General Public License along with
22+
# this program; if not, write to the Free Software Foundation, Inc.,
23+
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24+
#
25+
##############################################################################
26+
27+
"""
28+
This script is triggered from the GitHub Autobuild workflow.
29+
It analyzes Jamulus.pro and git push details (tag vs. branch, etc.) to decide
30+
- whether a release should be created,
31+
- whether it is a pre-release, and
32+
- what its title should be.
33+
"""
734

835
import os
936
import re
@@ -15,10 +42,10 @@
1542
def get_version_from_jamulus_pro():
1643
with open(REPO_PATH + '/Jamulus.pro', 'r') as f:
1744
pro_content = f.read()
18-
m = re.search(r'^VERSION\s*=\s*(\S+)$', pro_content, re.MULTILINE)
19-
if not m:
20-
raise Exception("Unable to determine Jamulus.pro VERSION")
21-
return m.group(1)
45+
matches = re.search(r'^VERSION\s*=\s*(\S+)$', pro_content, re.MULTILINE)
46+
if not matches:
47+
raise ValueError("Unable to determine Jamulus.pro VERSION")
48+
return matches.group(1)
2249

2350

2451
def get_git_hash():
@@ -34,26 +61,26 @@ def get_git_hash():
3461

3562
def get_build_version(jamulus_pro_version):
3663
if "dev" in jamulus_pro_version:
37-
version = "{}-{}".format(jamulus_pro_version, get_git_hash())
64+
version = f"{jamulus_pro_version}-{get_git_hash()}"
3865
return 'intermediate', version
3966

4067
version = jamulus_pro_version
4168
return 'release', version
4269

4370

4471
def set_github_variable(varname, varval):
45-
print("{}='{}'".format(varname, varval)) # console output
46-
outputfile = os.getenv('GITHUB_OUTPUT')
47-
with open(outputfile, "a") as ghout:
72+
print(f"{varname}='{varval}'") # console output
73+
output_file = os.getenv('GITHUB_OUTPUT')
74+
with open(output_file, "a") as ghout:
4875
ghout.write(f"{varname}={varval}\n")
4976

5077
jamulus_pro_version = get_version_from_jamulus_pro()
5178
set_github_variable("JAMULUS_PRO_VERSION", jamulus_pro_version)
5279
build_type, build_version = get_build_version(jamulus_pro_version)
5380
print(f'building a version of type "{build_type}": {build_version}')
5481

55-
fullref = os.environ['GITHUB_REF']
56-
publish_to_release = bool(re.match(r'^refs/tags/r\d+_\d+_\d+\S*$', fullref))
82+
full_ref = os.environ['GITHUB_REF']
83+
publish_to_release = bool(re.match(r'^refs/tags/r\d+_\d+_\d+\S*$', full_ref))
5784

5885
# BUILD_VERSION is required for all builds including branch pushes
5986
# and PRs:
@@ -65,12 +92,12 @@ def set_github_variable(varname, varval):
6592
set_github_variable("PUBLISH_TO_RELEASE", str(publish_to_release).lower())
6693

6794
if publish_to_release:
68-
reflist = fullref.split("/", 2)
69-
release_tag = reflist[2]
95+
ref_list = full_ref.split("/", 2)
96+
release_tag = ref_list[2]
7097
release_title = f"Release {build_version} ({release_tag})"
7198
is_prerelease = not re.match(r'^r\d+_\d+_\d+$', release_tag)
7299
if not is_prerelease and build_version != release_tag[1:].replace('_', '.'):
73-
raise Exception(f"non-pre-release tag {release_tag} doesn't match Jamulus.pro VERSION = {build_version}")
100+
raise ValueError(f"non-pre-release tag {release_tag} doesn't match Jamulus.pro VERSION = {build_version}")
74101

75102
# Those variables are only used when a release is created at all:
76103
set_github_variable("IS_PRERELEASE", str(is_prerelease).lower())

.github/autobuild/ios.sh

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,35 @@
11
#!/bin/bash
2+
##############################################################################
3+
# Copyright (c) 2022-2024
4+
#
5+
# Author(s):
6+
# Christian Hoffmann
7+
# The Jamulus Development Team
8+
#
9+
##############################################################################
10+
#
11+
# This program is free software; you can redistribute it and/or modify it under
12+
# the terms of the GNU General Public License as published by the Free Software
13+
# Foundation; either version 2 of the License, or (at your option) any later
14+
# version.
15+
#
16+
# This program is distributed in the hope that it will be useful, but WITHOUT
17+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18+
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
19+
# details.
20+
#
21+
# You should have received a copy of the GNU General Public License along with
22+
# this program; if not, write to the Free Software Foundation, Inc.,
23+
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24+
#
25+
##############################################################################
26+
227
set -eu
328

429
QT_DIR=/usr/local/opt/qt
530
# The following version pinnings are semi-automatically checked for
631
# updates. Verify .github/workflows/bump-dependencies.yaml when changing those manually:
7-
AQTINSTALL_VERSION=3.0.2
32+
AQTINSTALL_VERSION=3.1.15
833

934
if [[ ! ${QT_VERSION:-} =~ [0-9]+\.[0-9]+\..* ]]; then
1035
echo "Environment variable QT_VERSION must be set to a valid Qt version"
@@ -23,14 +48,14 @@ setup() {
2348
python3 -m pip install "aqtinstall==${AQTINSTALL_VERSION}"
2449
# Install actual ios Qt:
2550
local qtmultimedia=()
26-
if [[ ! "${QT_VERSION}" =~ 5\..* ]]; then
51+
if [[ ! "${QT_VERSION}" =~ 5\.[0-9]+\.[0-9]+ ]]; then
2752
# From Qt6 onwards, qtmultimedia is a module and cannot be installed
2853
# as an archive anymore.
2954
qtmultimedia=("--modules")
3055
fi
3156
qtmultimedia+=("qtmultimedia")
3257
python3 -m aqt install-qt --outputdir "${QT_DIR}" mac ios "${QT_VERSION}" --archives qtbase qttools qttranslations "${qtmultimedia[@]}"
33-
if [[ ! "${QT_VERSION}" =~ 5\..* ]]; then
58+
if [[ ! "${QT_VERSION}" =~ 5\.[0-9]+\.[0-9]+ ]]; then
3459
# Starting with Qt6, ios' qtbase install does no longer include a real qmake binary.
3560
# Instead, it is a script which invokes the mac desktop qmake.
3661
# As of aqtinstall 2.1.0 / 04/2022, desktop qtbase has to be installed manually:

.github/autobuild/linux_deb.sh

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,29 @@
11
#!/bin/bash
2+
##############################################################################
3+
# Copyright (c) 2022-2024
4+
#
5+
# Author(s):
6+
# Christian Hoffmann
7+
# The Jamulus Development Team
8+
#
9+
##############################################################################
10+
#
11+
# This program is free software; you can redistribute it and/or modify it under
12+
# the terms of the GNU General Public License as published by the Free Software
13+
# Foundation; either version 2 of the License, or (at your option) any later
14+
# version.
15+
#
16+
# This program is distributed in the hope that it will be useful, but WITHOUT
17+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18+
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
19+
# details.
20+
#
21+
# You should have received a copy of the GNU General Public License along with
22+
# this program; if not, write to the Free Software Foundation, Inc.,
23+
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24+
#
25+
##############################################################################
26+
227
set -eu
328

429
if [[ ! ${JAMULUS_BUILD_VERSION:-} =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then
@@ -50,7 +75,7 @@ setup_cross_compiler() {
5075
if [[ "${TARGET_ARCH}" == amd64 ]]; then
5176
return
5277
fi
53-
local GCC_VERSION=7 # 7 is the default on 18.04, there is no reason not to update once 18.04 is out of support
78+
local GCC_VERSION=9 # 9 is the default on 20.04, there is no reason not to update once 20.04 is out of support
5479
sudo apt install -qq -y --no-install-recommends "g++-${GCC_VERSION}-${ABI_NAME}" "qt5-qmake:${TARGET_ARCH}" "qtbase5-dev:${TARGET_ARCH}" "libjack-jackd2-dev:${TARGET_ARCH}" "qtmultimedia5-dev:${TARGET_ARCH}"
5580
sudo update-alternatives --install "/usr/bin/${ABI_NAME}-g++" g++ "/usr/bin/${ABI_NAME}-g++-${GCC_VERSION}" 10
5681
sudo update-alternatives --install "/usr/bin/${ABI_NAME}-gcc" gcc "/usr/bin/${ABI_NAME}-gcc-${GCC_VERSION}" 10

.github/autobuild/mac.sh

Lines changed: 58 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,35 @@
11
#!/bin/bash
2+
##############################################################################
3+
# Copyright (c) 2022-2024
4+
#
5+
# Author(s):
6+
# Christian Hoffmann
7+
# The Jamulus Development Team
8+
#
9+
##############################################################################
10+
#
11+
# This program is free software; you can redistribute it and/or modify it under
12+
# the terms of the GNU General Public License as published by the Free Software
13+
# Foundation; either version 2 of the License, or (at your option) any later
14+
# version.
15+
#
16+
# This program is distributed in the hope that it will be useful, but WITHOUT
17+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18+
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
19+
# details.
20+
#
21+
# You should have received a copy of the GNU General Public License along with
22+
# this program; if not, write to the Free Software Foundation, Inc.,
23+
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24+
#
25+
##############################################################################
26+
227
set -eu
328

429
QT_DIR=/usr/local/opt/qt
530
# The following version pinnings are semi-automatically checked for
631
# updates. Verify .github/workflows/bump-dependencies.yaml when changing those manually:
7-
AQTINSTALL_VERSION=3.0.2
32+
AQTINSTALL_VERSION=3.1.15
833

934
TARGET_ARCHS="${TARGET_ARCHS:-}"
1035

@@ -24,7 +49,7 @@ setup() {
2449
echo "Installing Qt..."
2550
python3 -m pip install "aqtinstall==${AQTINSTALL_VERSION}"
2651
local qtmultimedia=()
27-
if [[ ! "${QT_VERSION}" =~ 5\..* ]]; then
52+
if [[ ! "${QT_VERSION}" =~ 5\.[0-9]+\.[0-9]+ ]]; then
2853
# From Qt6 onwards, qtmultimedia is a module and cannot be installed
2954
# as an archive anymore.
3055
qtmultimedia=("--modules")
@@ -41,14 +66,27 @@ prepare_signing() {
4166
[[ -n "${MACOS_CERTIFICATE:-}" ]] || return 1
4267
[[ -n "${MACOS_CERTIFICATE_ID:-}" ]] || return 1
4368
[[ -n "${MACOS_CERTIFICATE_PWD:-}" ]] || return 1
44-
[[ -n "${NOTARIZATION_PASSWORD:-}" ]] || return 1
4569
[[ -n "${KEYCHAIN_PASSWORD:-}" ]] || return 1
4670

71+
# Check for notarization (not wanted on self signed build)
72+
if [[ -z "${NOTARIZATION_PASSWORD}" ]]; then
73+
echo "Notarization password not found or empty. This suggests we might run a self signed build."
74+
if [[ -z "${MACOS_CA_PUBLICKEY}" ]]; then
75+
echo "Warning: The CA public key wasn't set or is empty. Skipping signing."
76+
return 1
77+
fi
78+
fi
79+
4780
echo "Signing was requested and all dependencies are satisfied"
4881

4982
# Put the cert to a file
5083
echo "${MACOS_CERTIFICATE}" | base64 --decode > certificate.p12
5184

85+
# If set, put the CA public key into a file
86+
if [[ -n "${MACOS_CA_PUBLICKEY}" ]]; then
87+
echo "${MACOS_CA_PUBLICKEY}" | base64 --decode > CA.cer
88+
fi
89+
5290
# Set up a keychain for the build:
5391
security create-keychain -p "${KEYCHAIN_PASSWORD}" build.keychain
5492
security default-keychain -s build.keychain
@@ -58,8 +96,24 @@ prepare_signing() {
5896
security import certificate.p12 -k build.keychain -P "${MACOS_CERTIFICATE_PWD}" -T /usr/bin/codesign
5997
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "${KEYCHAIN_PASSWORD}" build.keychain
6098

61-
# Tell Github Workflow that we need notarization & stapling:
99+
# Tell Github Workflow that we want signing
62100
echo "macos_signed=true" >> "$GITHUB_OUTPUT"
101+
102+
# If set, import CA key to allow self signed key
103+
if [[ -n "${MACOS_CA_PUBLICKEY}" ]]; then
104+
# bypass any GUI related trusting prompt (https://developer.apple.com/forums/thread/671582)
105+
echo "Importing development only CA"
106+
# shellcheck disable=SC2024
107+
sudo security authorizationdb read com.apple.trust-settings.admin > rights
108+
sudo security authorizationdb write com.apple.trust-settings.admin allow
109+
sudo security add-trusted-cert -d -r trustRoot -k "build.keychain" CA.cer
110+
# shellcheck disable=SC2024
111+
sudo security authorizationdb write com.apple.trust-settings.admin < rights
112+
else
113+
# Tell Github Workflow that we need notarization & stapling (non self signed build)
114+
echo "macos_notarize=true" >> "$GITHUB_OUTPUT"
115+
fi
116+
63117
return 0
64118
}
65119

0 commit comments

Comments
 (0)