Skip to content

Commit

Permalink
Merge pull request #87 from matty0ung/dbFixes
Browse files Browse the repository at this point in the history
Upgrade to Qt 6
  • Loading branch information
matty0ung authored Oct 11, 2024
2 parents 28f5738 + 69d72db commit 689417f
Show file tree
Hide file tree
Showing 119 changed files with 3,465 additions and 2,379 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/linux-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
# have only Python 3.6.7 and Ubuntu 20.04 only have Python 3.8.2. However Ubuntu 22.04 has Python 3.10.6.) There
# are ways to get around this, but, in this context, it's simplest to use a canned GitHub action.
#
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install Frameworks and Libraries, and set up Meson build environment
Expand All @@ -88,6 +88,7 @@ jobs:
$GITHUB_WORKSPACE
- name: Build (with Meson)
id: meson-build
working-directory: ${{github.workspace}}/mbuild
shell: bash
run: |
Expand All @@ -98,6 +99,7 @@ jobs:
# The 'export QT_QPA_PLATFORM=offscreen' stops Qt's xcb sub-module trying to connect to a non-existent display
# (which would cause the test runner to abort before running any tests).
- name: Test (via Meson)
id: meson-test
working-directory: ${{github.workspace}}/mbuild
shell: bash
run: |
Expand All @@ -106,12 +108,14 @@ jobs:
meson test
- name: Build (with CMake)
id: cmake-build
working-directory: ${{github.workspace}}/build
shell: bash
run: |
make
- name: Test (via CMake)
id: cmake-test
working-directory: ${{github.workspace}}/build
shell: bash
env:
Expand Down Expand Up @@ -143,20 +147,20 @@ jobs:
mbuild/packages/linux/brewken*.rpm.sha256sum
retention-days: 7

- name: Recover Debris Artifacts (CMake)
if: ${{ failure() }}
- name: Recover Debris Artifacts (Meson)
if: ${{ failure() && (steps.meson-build.conclusion == 'failure' || steps.meson-test.conclusion == 'failure') }}
uses: actions/upload-artifact@v4
with:
name: build-results-${{matrix.os}}
path: build
name: mbuild-results-${{matrix.os}}
path: mbuild
retention-days: 1

- name: Recover Debris Artifacts (Meson)
if: ${{ failure() }}
- name: Recover Debris Artifacts (CMake)
if: ${{ failure() && (steps.cmake-build.conclusion == 'failure' || steps.cmake-test.conclusion == 'failure') }}
uses: actions/upload-artifact@v4
with:
name: mbuild-results-${{matrix.os}}
path: mbuild
name: build-results-${{matrix.os}}
path: build
retention-days: 1

# Meson test doesn't show log output on the terminal, but puts it straight to a log file. We don't want to have
Expand Down
25 changes: 11 additions & 14 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,36 +154,33 @@ jobs:
Expand-Archive -Path C:/_/build/nsis/Nsislog.zip -DestinationPath C:/_/build/nsis/Nsislog
Tree /f C:/_/build
# Somehow, running the configure script sets up CMake to use Ninja rather than Makefiles, which is then in
# conflict with our other assumptions about CMake. Error message says remove CMakeCache.txt before running CMake,
# so we do that as a short-term fix (on the assumption that, longer term, we'll be moving to Meson).
# The configure script does default set-up for CMake that is enough for us here
- name: CMake Config
shell: msys2 {0}
run: |
cd /C/_
./configure
cd build
rm CMakeCache.txt
cmake .. -DCMAKE_RC_COMPILER:FILEPATH=windres.exe -G "MinGW Makefiles"
- name: Build (with Meson)
shell: msys2 {0}
run: |
cd /C/_/mbuild
pwd
meson compile
# The pwd and find ../third-party commands below are just diagnostics, but it's generally useful to have too
# much rather than not enough diagnostic info on these GitHub action builds
#
# This is the same reason we specify the --verbose option on CMake
- name: Build (with CMake)
shell: msys2 {0}
run: |
cd /C/_/build
pwd
tree -sh
cmake --build .
cmake --build . --verbose
ls
- name: Build (with Meson)
shell: msys2 {0}
run: |
cd /C/_/mbuild
pwd
meson compile
# The 'export QT_DEBUG_PLUGINS=1' give us diagnostics in the event that there are problems initialising QT
# The 'export QT_QPA_PLATFORM=offscreen' stops Qt's xcb sub-module trying to connect to a non-existent display
# (which would cause the test runner to abort before running any tests).
Expand Down
177 changes: 102 additions & 75 deletions CMakeLists.txt

Large diffs are not rendered by default.

14 changes: 12 additions & 2 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#----------------------------------------------------------------------------------------------------------------------
# configure is part of Brewken, and is copyright the following authors 2009-2021:
# configure is part of Brewken, and is copyright the following authors 2009-2024:
# • Matt Young <[email protected]>
# • Philip Greggory Lee <[email protected]>
#
Expand All @@ -16,6 +16,16 @@
# <http://www.gnu.org/licenses/>.
#----------------------------------------------------------------------------------------------------------------------

#
# This script can be used to help set up the build directory for doing CMake builds.
#
# ⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
# NB: Meson and the `bt` build tool Python script are now the primary way of building and packaging the software. You
# can also still CMake to compile the product and install it locally, but we no longer support using CMake to do
# packaging.
# ⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
#

# Stop when something failed
set -e

Expand Down Expand Up @@ -96,4 +106,4 @@ cd build/
cmake $CMAKEOPTIONS ../

# Tell the user what to do (if everything went well...)
echo -e "\n\n\tNow, cd to build/ and run \"make\"\n"
echo -e "\n\n\tNow, cd to build/ and run \"make\" (or \"cmake --build .\" on Windows)\n"
2 changes: 1 addition & 1 deletion doc/manpage.1.md.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ all the important parameters, helps you with mash temperatures, and just
makes the process of recipe formulation much easier.

# COPYRIGHT
Copyright © various authors 2009-2023 -- see accompanying documentation
Copyright © various authors 2009-2024 -- see accompanying documentation

@CONFIG_APPLICATION_NAME_UC@ is free software: you can redistribute it and/or modify it under the terms of the GNU
General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your
Expand Down
48 changes: 32 additions & 16 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@
# - Meson 0.59.0 or newer to use qt.compile_resources, qt.compile_ui and qt.compile_moc
# - Meson 0.60.0 or newer to use + to append items to lists (aka 'list.<plus>' feature -- at least that's what the
# warning message says if you've specified a lower minimum version of Meson)
# We would/will need:
# - Meson 0.62.0 or newer for dep 'dl' custom lookup, but current version of Meson on Ubuntu 22.04 LTS is only 0.61.2
# - Meson 0.63.0 or newer to correctly locate versions of Qt >= 6.1 -- see https://mesonbuild.com/Qt6-module.html
#
# NB: Per https://mesonbuild.com/Reference-manual_functions.html#project the default_options settings "are only used
# when running Meson for the first time"! So if you change any of the default_options settings you *MUST* delete
Expand Down Expand Up @@ -191,7 +191,7 @@
project('brewken', 'cpp',
version: '1.0.0',
license: 'GPL-3.0-or-later',
meson_version: '>=0.60.0',
meson_version: '>=0.63.0',
default_options : ['cpp_std=c++20',
'warning_level=3',
# 'prefer_static=true', See comment above for why this is commented-out for now
Expand Down Expand Up @@ -275,8 +275,8 @@ testRunnerTargetName = mainExecutableTargetName + '_tests'
#=======================================================================================================================
#==================================================== Meson modules ====================================================
#=======================================================================================================================
# Import the Qt tools. See https://mesonbuild.com/Qt5-module.html
qt = import('qt5')
# Import the Qt tools. See https://mesonbuild.com/Qt6-module.html
qt = import('qt6')
# File System module - see https://mesonbuild.com/Fs-module.html
fs = import('fs')

Expand Down Expand Up @@ -325,16 +325,14 @@ sharedLibraryPaths = []
# Note that if you change the minimum Qt version, you need to make corresponding changes to the .github/workflows/*.yml
# files so that GitHub uses the appropriate version of Qt for the automated builds.
#
# 2024-05-19: Removed support for Ubuntu 20.04 because the latest version of Qt available in its packages is 5.12.8,
# which is no longer supported (and, amongst other things, has an old version of SQLite that does not
# support "DROP COLUMN"). Qt 5.15 is the long-term support version of Qt5.
# As of 2024-09-30:
# - Qt 6.2.4 is the maximum available in Ubuntu 22.04 (Jammy).
# - Qt 6.4.2 is the maximum available in Ubuntu 24.04 (Noble).
#
# For the moment, max version we can have here is 5.15.3, because that's what Ubuntu 22.04 topped out at. But note
# that Meson will be happy with newer versions (5.15.13 on Windows & Mac).

minVersionOfQt = '>=6.2.4'
# Tell meson which Qt modules we need
qtCommonDependencies = dependency('qt5',
version : '>=5.15.3',
qtCommonDependencies = dependency('qt6',
version : minVersionOfQt,
modules : ['Core',
'Gui', # Needed for QColor on Mac?
'Multimedia',
Expand All @@ -348,9 +346,9 @@ qtCommonDependencies = dependency('qt5',
static : true)
# The Qt Gui module is only needed for the main program. (We don't want the tests to try to load it or it could barf
# in a GitHub action that does not have a display running.)
qtMainExeDependencies = dependency('qt5', version : '>=5.15.3', modules: ['Gui'])
qtMainExeDependencies = dependency('qt6', version : minVersionOfQt, modules: ['Gui'])
# The Qt Test module is only needed for the unit tests
qtTestRunnerDependencies = dependency('qt5', version : '>=5.15.3', modules: ['Test'])
qtTestRunnerDependencies = dependency('qt6', version : minVersionOfQt, modules: ['Test'])

#===================================================== Find Boost ======================================================
# Boost is a collection of separate libraries, some, but not all, of which are header-only. We only specify the Boost
Expand Down Expand Up @@ -1232,17 +1230,35 @@ generatedFromMocForUnitTests = qt.compile_moc(headers : unitTestMocHeaders,
# manually from the command line with lrelease
# Calling qt.compile_translations will do only the latter, so we need to do the former directly
#
#
# NB: In Qt 5, the `lupdate` command line tool is just invoked as `lupdate` on all three of our build platforms. In
# Qt 6, it's a bit different. We still call `lupdate` on Mac, but, on Windows we need to call `lupdate-qt6` (see file
# list at https://packages.msys2.org/packages/mingw-w64-x86_64-qt6-tools). This is presumably to allow Qt 5 and Qt 6 to
# coexist, but we have to take account of it here.
#
lupdate_name = 'lupdate'
if host_machine.system() == 'windows'
lupdate_name = 'lupdate-qt6'
elif host_machine.system() == 'linux'
lupdate_name = 'lupdate'
endif
lupdate_executable = find_program(lupdate_name, required : true)

#
# Call lupdate to ensure the .ts files are synced with the source code. We need:
# lupdate meson.project_source_root()/src meson.project_source_root()/ui -ts [list of .ts files]
# This tells lupdate to recursively scan the src/ and ui/ subdirectories and update the specified ts files
# Fortunately, we can pass a list of File objects as a parameter to run_command and Meson does the right thing
#
# We make a point here of displaying the output of run_command because we want to show message emitted by lupdate about
# what it did.
message('Running lupdate on the following ts files:', run_command('ls', translationSourceFiles, check: true).stdout())
#
message(
'Running lupdate (', lupdate_executable.full_path(), ') on the following ts files:',
run_command('ls', translationSourceFiles, check: true).stdout()
)
message(
run_command('lupdate',
run_command(lupdate_executable,
meson.project_source_root() + '/src',
meson.project_source_root() + '/ui',
'-ts',
Expand Down
31 changes: 16 additions & 15 deletions packaging/linux/control.in
Original file line number Diff line number Diff line change
Expand Up @@ -75,25 +75,26 @@ Architecture: amd64
# Note that you can see the version of a package libfoobar by running the following command from the shell:
# apt-cache show foobar | grep Version
#
# Note too that we need either libqt5gui5 or libqt5gui5-gles, not both (which is not possible as they conflict).
#
# Normally, this field is (surprisingly) not allowed to be "folded" (ie split across multiple lines). However, we do
# our own folding in the bt build script, so the backslash line continuations are OK here!
#
# From trial-and-error, we discover which libraries have a "t64" version which is used instead of the "base" one (eg
# libqt6network6t64 instead of libqt6network6). This is to do with upgrades to 64-bit time (to fix the "year 2038
# problem") -- per https://wiki.debian.org/ReleaseGoals/64bit-time.
#
Depends: \
libc6 (>= 2.34 ), \
libgcc-s1 (>= 3.3 ), \
libqt5core5a (>= 5.9.5), \
libqt5gui5 (>= 5.9.5) | \
libqt5gui5-gles (>= 5.9.5), \
libqt5multimedia5 (>= 5.9.5), \
libqt5network5 (>= 5.9.5), \
libqt5printsupport5 (>= 5.9.5), \
libqt5sql5 (>= 5.9.5), \
libqt5widgets5 (>= 5.9.5), \
libstdc++6 (>= 11 ), \
libxalan-c112 (>= 1.12 ), \
libxerces-c3.2 (>= 3.2 )
libc6 (>= 2.35 ), \
libgcc-s1 (>= 12.3 ), \
libqt6core6t64 (>= 6.2.4), \
libqt6gui6t64 (>= 6.2.4) | \
libqt6multimedia6 (>= 6.2.4), \
libqt6network6t64 (>= 6.2.4), \
libqt6printsupport6t64 (>= 6.2.4), \
libqt6sql6t64 (>= 6.2.4), \
libqt6widgets6t64 (>= 6.2.4), \
libstdc++6 (>= 12.3 ), \
libxalan-c112t64 (>= 1.12 ), \
libxerces-c3.2t64 (>= 3.2.3)
#
# Installed-Size (Optional) : an estimate of the total amount of disk space required to install the named package
# The disk space is given as the integer value of the estimated installed size in bytes, divided by 1024 and rounded
Expand Down
14 changes: 7 additions & 7 deletions packaging/linux/rpm.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ BuildArch : x86_64
#
Requires : \
libgcc_s1 >= 3.3 , \
libqt5core5 >= 5.9.5, \
libqt5gui5 >= 5.9.5, \
libqt5multimedia5 >= 5.9.5, \
libqt5network5 >= 5.9.5, \
libqt5printsupport5 >= 5.9.5, \
libqt5sql5 >= 5.9.5, \
libqt5widgets5 >= 5.9.5, \
libqt6core6 >= 6.2.4, \
libqt6gui6 >= 6.2.4, \
libqt6multimedia6 >= 6.2.4, \
libqt6network6 >= 6.2.4, \
libqt6printsupport6 >= 6.2.4, \
libqt6sql6 >= 6.2.4, \
libqt6widgets6 >= 6.2.4, \
libstdc++6 >= 11 , \
libxalan-c112 >= 1.12 , \
libxerces-c3_2 >= 3.2
Expand Down
Loading

0 comments on commit 689417f

Please sign in to comment.