Skip to content

Commit

Permalink
Merge pull request #78 from matty0ung/json4
Browse files Browse the repository at this point in the history
Streamline our custom Label/LineEdit system, also refactor table model.
  • Loading branch information
matty0ung committed May 28, 2023
2 parents 57398a2 + 3fc7500 commit c15d60a
Show file tree
Hide file tree
Showing 252 changed files with 19,377 additions and 21,865 deletions.
25 changes: 3 additions & 22 deletions .github/workflows/linux-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ jobs:
working-directory: ${{github.workspace}}/build
shell: bash
run: |
pwd
find ../third-party
make
- name: Build (with Meson)
Expand Down Expand Up @@ -122,38 +120,21 @@ jobs:
export QT_QPA_PLATFORM=offscreen
meson test
- name: Package (via CMake/CPack)
working-directory: ${{github.workspace}}/build
shell: bash
run: |
umask 022
make package
- name: Package (New)
# Note that, although we continue to support CMake for local builds and installs, we no longer support packaging
# with CPack/CMake. The bt build script packaging gives us better control over the packaging process.
- name: Package
working-directory: ${{github.workspace}}/mbuild
shell: bash
run: |
umask 022
../bt package
- name: LintianAndRpmLint
continue-on-error: true
working-directory: ${{github.workspace}}/build
shell: bash
run: make package_lint

- name: Upload Linux Packages (Installers)
if: ${{ success() }}
uses: actions/upload-artifact@v3
with:
name: brewken-${{matrix.os}}
path: |
build/brewken*.rpm
build/brewken*.rpm.sha256
build/brewken*.deb
build/brewken*.deb.sha256
build/brewken*.tar.bz2
build/brewken*.tar.bz2.sha256
mbuild/packages/source/brewken*.tar.xz
mbuild/packages/source/brewken*.tar.xz.sha256sum
mbuild/packages/linux/brewken*.deb
Expand Down
16 changes: 4 additions & 12 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,10 @@ jobs:
export QT_QPA_PLATFORM=offscreen
meson test
- name: Package (via CMake/CPack)
# Change `make package` to `make package VERBOSE=1` to get hugely detailed output
run: |
cd build
pwd
make package
pwd
tree -sh
- name: Package (New)
# Note that, although we continue to support CMake for local builds and installs, we no longer support packaging
# with CPack/CMake -- not least because it was very hard to get things working on Mac. The bt build script
# packaging works fine and gives us better control over the packaging process.
- name: Package
shell: bash
run: |
cd mbuild
Expand All @@ -142,8 +136,6 @@ jobs:
with:
name: brewken-dev-mac
path: |
${{github.workspace}}/build/brewken*.dmg
${{github.workspace}}/build/brewken*.dmg.sha256
${{github.workspace}}/mbuild/packages/darwin/brewken*.dmg
${{github.workspace}}/mbuild/packages/darwin/brewken*.dmg.sha256sum
retention-days: 7
Expand Down
13 changes: 4 additions & 9 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,17 +199,14 @@ jobs:
export QT_QPA_PLATFORM=offscreen
meson test
- name: Package (via CMake/CPack)
shell: msys2 {0}
run: |
cd /C/_/build
cmake --build . --target package --verbose
#
# See above for explanation of the extra things we need to do on Windows before running the bt script. Most of
# that does not need doing again here, but PYTHONIOENCODING does need setting again.
#
- name: Package (New)
# Note that, although we continue to support CMake for local builds and installs, we no longer support packaging
# with CPack/CMake. The bt build script packaging gives us better control over the packaging process.
#
- name: Package
shell: msys2 {0}
run: |
cd /C/_/
Expand All @@ -234,8 +231,6 @@ jobs:
with:
name: brewken-dev-${{ matrix.msystem }}
path: |
C:/_/build/brewken*.exe
C:/_/build/brewken*.exe.sha256
C:/_/mbuild/packages/windows/Brewken*Installer.exe
C:/_/mbuild/packages/windows/Brewken*Installer.exe.sha256sum
retention-days: 7
Expand Down
43 changes: 18 additions & 25 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#----------------------------------------------------------------------------------------------------------------------
# CMakeLists.txt is part of Brewken, and is copyright the following authors 2009-2022:
# CMakeLists.txt is part of Brewken, and is copyright the following authors 2009-2023:
# • Chris Pavetto <[email protected]>
# • Dan Cavanagh <[email protected]>
# • Daniel Moreno <[email protected]>
Expand All @@ -24,6 +24,13 @@
# <http://www.gnu.org/licenses/>.
#----------------------------------------------------------------------------------------------------------------------

# ⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
# 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. (Over time the intention is to remove packaging-specific code from this script, not least as it does
# not work properly on Mac and Windows.)
# ⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐

#
# Creates a Makefile in the build directory, from where you can do builds and installs.
#
Expand All @@ -46,26 +53,11 @@
# * make clean - Delete compiled objects so next build starts from scratch
# * sudo make install - Install locally
# * make test - Run unit tests via CTest
# * make package - Makes .deb, .rpm, NSIS Installer, and .tar.bz2 binary packages. (TBD What about Mac?)
#
# On Linux, after make package, it's one of the following to install, if you want to
# install from the package rather than direct from the build tree (with sudo make install).
# (This would typically be for installing the package on a different machine then where the
# build was done.)
# $ sudo dpkg -i brewken*.deb
# $ sudo rpm -i brewken*.rpm
#
# On Mac and Windows environments, the `package` target will create an installer
# that may be executed to finish the installation.
#
# * make package_source - Makes a .tar.bz2 source package.
#
# Custom make targets:
# * make source_doc - Makes Doxygen HTML documentation of the source in doc/html
# * make install-data
# * make install-runtime
# * make package_lint - Runs lintian and rpmlint on packages
#
#
# CMake options
# * CMAKE_INSTALL_PREFIX - /usr/local by default. Set this to /usr on Debian-based systems like Ubuntu.
Expand Down Expand Up @@ -189,13 +181,6 @@ if(UNIX AND NOT APPLE)
elseif(WIN32)
#============================================ Windows Install Directories ===========================================

# For some damn reason, for the NSIS installer,
# the prefix needs to be empty. Also, seems that the .exe
# needs to be in bin/. Fucking piece of shit CPack...
# Can anybody shed some light on this situation?
#set(CMAKE_INSTALL_PREFIX "")
set(CPACK_INSTALL_PREFIX "")

set(installSubDir_data "data")
set(installSubDir_doc "doc")
set(installSubDir_bin "bin")
Expand Down Expand Up @@ -242,8 +227,8 @@ set(RUNTIME_INSTALL_COMPONENT "Runtime")
# We use different compilers on different platforms. Where possible, we want to let CMake handle the actual compiler
# settings
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# We need C++20 for std::map::contains(), C++17 or later for nested namespaces and structured bindings, and C++11 or
# later for lambdas.
# We need C++20 for std::map::contains() and concepts, C++17 or later for nested namespaces and structured bindings, and
# C++11 or later for lambdas.
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
Expand Down Expand Up @@ -285,6 +270,7 @@ if(NOT ${NO_MESSING_WITH_FLAGS})
else()
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g3 -no-pie -fno-pie")
endif()

endif()

# Speed up compilation if using gcc.
Expand All @@ -293,6 +279,13 @@ if(NOT ${NO_MESSING_WITH_FLAGS})
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -pipe")
endif()
endif()
if(CMAKE_COMPILER_IS_GNUCXX)
#
# On older versions of GCC, it is not sufficient to specify C++20 to enable concepts, you also have to set a
# special compiler flag.
#
add_compile_options(-fconcepts)
endif()

# Windows-specific compilation settings
if(WIN32)
Expand Down
42 changes: 39 additions & 3 deletions bt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
#-----------------------------------------------------------------------------------------------------------------------

#-----------------------------------------------------------------------------------------------------------------------
# This build tool (bt) script helps with Git setup, meson build configuration and packaging. Usage is:
# This build tool (bt) script helps with Git setup, meson build configuration and packaging. You need to have Python
# 3.10 or newer installed first. On Windows you also need to have Pip installed and to do some extra manual stuff noted
# below.
#
# Usage is:
#
# ./bt setup Sets up Git options and configures the 'mbuild' meson build directory
#
Expand All @@ -27,7 +31,8 @@
# need to be for a local install). Then creates a distributable package, making use
# of various build variables passed back from Meson.
#
#
# NOTE: This tool, used in conjunction with Meson, is now the official way to build and package the software. We
# continue to support CMake for local compiles and installs, but not for packaging.
#
# .:TODO:. At some point we should be able to retire:
# configure
Expand All @@ -42,6 +47,37 @@
# double quotes avoids having to escape a single quote.
#-----------------------------------------------------------------------------------------------------------------------

#-----------------------------------------------------------------------------------------------------------------------
# **********************************************************************************************************************
# *
# * WINDOWS USERS PLEASE NOTE that, on Windows, we assume you are running in the MSYS2 MINGW32 environment. There are
# * also a couple of extra things you need to do before running this bt script:
# *
# * - For historical reasons, Linux and other platforms need to run both Python v2 (still used by some bits of
# * system) and Python v3 (eg that you installed yourself) so there are usually two corresponding Python
# * executables, python2 and python3. On Windows there is only whatever Python you installed and it's called
# * python.exe. To keep the shebang in the bt script working, we just make a softlink to python called python3:
# *
# * if [[ ! -f $(dirname $(which python))/python3 ]]; then ln -s $(which python) $(dirname $(which python))/python3; fi
# *
# * - Getting Unicode input/output to work is fun. We should already have a Unicode locale, but it seems we also
# * need to set PYTHONIOENCODING (see https://docs.python.org/3/using/cmdline.html#envvar-PYTHONIOENCODING, even
# * though it seems to imply you don't need to set it on recent versions of Python).
# *
# * export PYTHONIOENCODING=utf8
# *
# * - The version of Pip we install above does not put it in the "right" place. Specifically it will not be in the
# * PATH when we run bt. The following seems to be the least hacky way around this:
# *
# * curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
# * python get-pip.py
# * python -m pip install -U --force-reinstall pip
# *
# * See https://stackoverflow.com/questions/48087004/installing-pip-on-msys for more discussion on this.
# *
# **********************************************************************************************************************
#-----------------------------------------------------------------------------------------------------------------------

#-----------------------------------------------------------------------------------------------------------------------
# Python built-in modules we use
#-----------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -1158,7 +1194,7 @@ def doPackage():
#
# Debian and RPM both want the debugging information stripped from the executable.
#
# .:TBD:. One day perhaps we could be friendlyi and still ship the debugging info, just in a separate .dbg
# .:TBD:. One day perhaps we could be friendly and still ship the debugging info, just in a separate .dbg
# file. The procedure to do this is described in the 'only-keep-debug' section of `man objcopy`. However, we
# need to work out where to put the .dbg file so that it remains usable but lintian does not complain about it.
#
Expand Down
Loading

0 comments on commit c15d60a

Please sign in to comment.