Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demo Qt 6 build #2222

Draft
wants to merge 89 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
3aa31ef
Fix fileinfoname for non-ASCII characters
lmoureaux Jan 8, 2024
6448b20
Use QString end-to-end for tileset loading
lmoureaux Jan 7, 2024
7037876
Remove fc_stat usage
lmoureaux Jan 7, 2024
46ce360
Remove fc_remove()
lmoureaux Jan 7, 2024
8e0f5e8
Simplify and deprecate codeset conversion functions
lmoureaux Jan 7, 2024
2c42001
Rewrite drawing of citizen sprites to use multiple rows
daavko Jan 8, 2024
5e5738c
Implement review suggestions
daavko Jan 8, 2024
87087c9
Fix and modernize listener<>
lmoureaux Jan 6, 2024
8854191
Make listener<>::instances inline
lmoureaux Jan 7, 2024
83cb7e1
Fix release.yaml to properly run when needed
jwrober Jan 8, 2024
8fde678
Add an Add Ons button to start screen that loads mp installer
jwrober Jan 7, 2024
e23cd9c
Resize mp installer at launch
jwrober Jan 7, 2024
2041389
Remove waitForFinished() per review
jwrober Jan 8, 2024
f953ae4
freeciv21-manual: Remove broken image links
blabber Jan 13, 2024
0786dd0
Move add-ons button to be with options
jwrober Jan 15, 2024
8d4e700
Change 'add ons' to 'add-ons'
jwrober Jan 15, 2024
1826867
Change Add-Ons to Mods, remove Qt client text
jwrober Jan 15, 2024
e6ed4df
Update start screen image for Docs
jwrober Jan 15, 2024
2e3c238
view_units: Fix find, disband and upgrade buttons
blabber Jan 18, 2024
12280b5
README.md: Add FreeBSD
blabber Jan 18, 2024
9692669
Add missing .arg() when there are no more content citizens
lmoureaux Jan 18, 2024
ad74b6b
Force Qt to use FreeType on Windows
lmoureaux Jan 19, 2024
5acf43a
Standardize buttons on start screen
jwrober Jan 19, 2024
af58e06
Better support romantic languages
jwrober Jan 20, 2024
cb22fd9
Add padding per comment
jwrober Jan 20, 2024
7570dc9
Fix missing semi-colon in Classic
jwrober Jan 20, 2024
0ec0ead
Docs: make external packages optional
lmoureaux Jan 20, 2024
5a83ed4
Update the intersphinx specification syntax
lmoureaux Jan 20, 2024
56987a6
cmake: Fix the option to disable man pages
blabber Jan 19, 2024
7f3f7e4
Remove unnecessary statement
blabber Jan 20, 2024
e8cfd4a
cmake: sphinx is a hard dependency for manpages
blabber Jan 21, 2024
ae7c76f
Improve the auto-generated help for combat rounds
lmoureaux Jan 21, 2024
5cdf121
Give the main window a title
lmoureaux Jan 21, 2024
683c5b5
Add an option to add Modpacks from the Game menu
jwrober Jan 21, 2024
507b646
Remove memory leaks as per review
jwrober Jan 21, 2024
37cbd64
Ensure Qt modpack installer if we ask for Client
jwrober Jan 21, 2024
c83d1f0
Windows: rename client shortcuts to "Freeciv21"
lmoureaux Jan 21, 2024
4cc2c2a
Rename the client to "Freeciv21" in AppStream metadata
lmoureaux Jan 21, 2024
476979a
Add redundant city names
jwrober Jan 23, 2024
6270583
Update vcpkgGitCommitId before Alpha.5 release
jwrober Jan 27, 2024
a8331e2
Add AUR to README
psampathkumar Dec 30, 2023
aa11b69
Manual AutoRevision.txt update for 3.1-alpha.5
jwrober Jan 28, 2024
a757235
Update snap package to 3.1-alpha.5
jwrober Jan 30, 2024
ab079a2
Fix various typos in the documentation
blabber Feb 1, 2024
b5756fc
Add the new modpack installer icon
lmoureaux Jan 31, 2024
73a4892
Add the new ruleset editor icon
lmoureaux Jan 31, 2024
9f51f68
Fix license file names in data/icons/
lmoureaux Jan 31, 2024
3a42b14
Use the new ruledit icon
lmoureaux Jan 31, 2024
b09c892
Simplify the version string shown on the main page
lmoureaux Feb 4, 2024
b564f80
Remove usage of word_version
lmoureaux Feb 4, 2024
70d8dcd
Remove word_version()
lmoureaux Feb 4, 2024
45ffb11
Remove fc_comparable_version()
lmoureaux Feb 4, 2024
d3bff2d
Remove freeciv_datafile_version()
lmoureaux Feb 4, 2024
e1b28f1
Remove the emergency version and commit ID
lmoureaux Feb 4, 2024
67b3acd
Docs: Fix two typos
blabber Feb 7, 2024
bda47d6
Docs: Fix a broken sentence
blabber Feb 7, 2024
9bd0357
README.md: Fix command to install on FreeBSD
blabber Feb 7, 2024
3a32c4b
Fix use-after-free in do_attack
lmoureaux Jan 30, 2024
45c02fd
Add a map gen manual page
jwrober Feb 9, 2024
1132fef
Docs: Document CMake option FREECIV_ENABLE_MANPAGES
blabber Feb 9, 2024
527f46b
Bring docs up to date with some gui changes
jwrober Jan 27, 2024
e1ced70
New screenshot, following flathub specs
jwrober Feb 9, 2024
92a2bf3
Update references to the screenshot
jwrober Feb 9, 2024
33a487c
Game manual screenshot
jwrober Feb 9, 2024
c374ee9
Add edit.resize_city(city, size, reason) to the Lua API
lmoureaux Feb 5, 2024
f609764
Expose Unit_Type.pop_cost to Lua
lmoureaux Feb 5, 2024
e066d77
Allow multiple Partisan units in rulesets
lmoureaux Feb 5, 2024
c46f587
Have partisan generation reduce the city size when they cost pop
lmoureaux Feb 5, 2024
f206d35
Better document the behaviour of Inspire_Partisans
lmoureaux Feb 5, 2024
0e69b10
Update documentation as per review
lmoureaux Feb 10, 2024
81fade6
New Slogan
jwrober Feb 11, 2024
02c8036
Update to node.js v20 actions based on deprecation warning
jwrober Feb 10, 2024
481250d
Remove status message used for testing
jwrober Feb 10, 2024
005d9d6
Move Theme files up one directory
jwrober Feb 10, 2024
5164b53
Remove gui-qt from code files
jwrober Feb 10, 2024
59f86b2
Fix regression in themes install
jwrober Feb 14, 2024
c4e2b1b
Support build without manpages on Unix-like OS
blabber Mar 13, 2024
78286f5
Add a missing space in eval-pull-request.rst
lmoureaux Mar 16, 2024
a80351a
fcmp: Fix bogus "query failed" message
blabber Feb 16, 2024
df49b15
fcmp: Prevent possible resource leaks
blabber Feb 18, 2024
ad0861a
fcmp: Prevent possible resource leaks
blabber Feb 19, 2024
12e9064
Fix formatting.
blabber Feb 19, 2024
f0caf34
fcmp: Prevent possible resource leaks
blabber Feb 22, 2024
245a98c
fcmp: Emit correct error if finalizing prepared statements fails
blabber Mar 13, 2024
b3ef50f
Fix an alloc-dealloc mismatch in tile links handling
lmoureaux Mar 17, 2024
85abf41
Build against Qt6
lmoureaux Mar 17, 2024
05bc5a9
Fix utility to build in Qt 6 mode
lmoureaux Mar 17, 2024
0b1aa28
Build the rest of the code with Qt 6
lmoureaux Mar 17, 2024
1d7a4c9
Work around QTBUG-93413 for governor_widget.ui
lmoureaux Mar 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
52 changes: 26 additions & 26 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
build_type: RelWithDebInfo
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install GCC
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
needs: clang-format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install GCC
Expand Down Expand Up @@ -129,7 +129,7 @@ jobs:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: msys2/setup-msys2@v2
Expand Down Expand Up @@ -177,7 +177,7 @@ jobs:
build/Windows-x86_64/Freeciv21-*-Windows-x86_64.exe
build/Windows-x86_64/Freeciv21-*-Windows-x86_64.exe.sha256
- name: Upload a build
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Windows-exe
path: build/Windows-x86_64/Freeciv21-*.exe
Expand All @@ -191,13 +191,13 @@ jobs:
VCPKG_ROOT: C:/vcpkg
VCPKG_DEFAULT_BINARY_CACHE: ${{github.workspace}}/vcpkg/bincache
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: lukka/run-vcpkg@v10
- uses: lukka/run-vcpkg@v11
name: Install dependencies
with:
vcpkgGitCommitId: c8696863d371ab7f46e213d8f5ca923c4aef2a00
vcpkgGitCommitId: 53bef8994c541b6561884a8395ea35715ece75db
- name: Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1
- name: Configure
Expand All @@ -217,7 +217,7 @@ jobs:
env:
VCPKG_BUILD_TYPE: release
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install build tools
Expand All @@ -229,13 +229,13 @@ jobs:
gettext \
create-dmg
brew link gettext --force
- uses: actions/setup-python@v4 # Workaround for #2069
- uses: actions/setup-python@v5 # Workaround for #2069
with:
python-version: '3.11'
- uses: lukka/run-vcpkg@v10
- uses: lukka/run-vcpkg@v11
name: Install dependencies
with:
vcpkgGitCommitId: c8696863d371ab7f46e213d8f5ca923c4aef2a00
vcpkgGitCommitId: 53bef8994c541b6561884a8395ea35715ece75db
- name: Build
uses: lukka/run-cmake@v10
with:
Expand Down Expand Up @@ -286,7 +286,7 @@ jobs:
Freeciv21-*.dmg
Freeciv21-*.dmg.sha256
- name: Upload a build
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: macOS-dmg
path: Freeciv21-*.dmg
Expand Down Expand Up @@ -314,7 +314,7 @@ jobs:
zlib-devel \
libunwind-devel \
elfutils-libs
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Configure
# Set ALWAYS_ROOT because the container user is root and creating an
# unpriviledged user would be too much work.
Expand Down Expand Up @@ -388,8 +388,8 @@ jobs:
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
steps:
- name: checkout
uses: actions/checkout@v3
- uses: cachix/install-nix-action@v19
uses: actions/checkout@v4
- uses: cachix/install-nix-action@v22
- run: nix flake check
# TODO: We can add the build to a cache for others (see cachix.org)
# It's free for FOSS.
Expand All @@ -403,10 +403,10 @@ jobs:
env:
QT_VERSION: v5.15.8-lts-lgpl
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Cache Qt build
id: qtcache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/qt
key: qt-wasm-${{ env.QT_VERSION }}-svg-socket-v2
Expand All @@ -419,7 +419,7 @@ jobs:
clang \
python3 \
gettext
- uses: actions/checkout@v3
- uses: actions/checkout@v4
name: Checkout emsdk
with:
repository: emscripten-core/emsdk
Expand All @@ -442,7 +442,7 @@ jobs:
cd lua-5.4.3
emcmake cmake .
emmake make install
- uses: actions/checkout@v3
- uses: actions/checkout@v4
if: steps.qtcache.outputs.cache-hit != 'true'
name: Checkout qtbase
with:
Expand All @@ -460,7 +460,7 @@ jobs:
git cherry-pick 76d12eea2252c5e537dff15b103bdc1f925cf760
./configure -xplatform wasm-emscripten -opensource -confirm-license -prefix ~/qt -nomake examples
make install
- uses: actions/checkout@v3
- uses: actions/checkout@v4
if: steps.qtcache.outputs.cache-hit != 'true'
name: Checkout qtsvg
with:
Expand All @@ -474,7 +474,7 @@ jobs:
cd qtsvg
~/qt/bin/qmake
make install
- uses: actions/checkout@v3
- uses: actions/checkout@v4
name: Checkout zstd
with:
repository: facebook/zstd
Expand All @@ -487,7 +487,7 @@ jobs:
mkdir bld
emcmake cmake build/cmake -DZSTD_BUILD_PROGRAMS=0 -DZSTD_BUILD_SHARED=0
emmake make install
- uses: actions/checkout@v3
- uses: actions/checkout@v4
name: Checkout extra-cmake-modules
with:
repository: KDE/extra-cmake-modules
Expand All @@ -498,7 +498,7 @@ jobs:
cd ecm
cmake .
sudo make install
- uses: actions/checkout@v3
- uses: actions/checkout@v4
name: Checkout karchive
with:
repository: KDE/karchive
Expand Down Expand Up @@ -543,13 +543,13 @@ jobs:
run: |
cat common/networking/CMakeFiles/networking.dir/includes_CXX.rsp
cat CMakeCache.txt
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cmakecache
path: CMakeCache.txt
- name: Archive production artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wasm-client
path: freeciv21-client.*
Expand All @@ -558,7 +558,7 @@ jobs:
name: clang-format Code Formatter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run clang-format style check for C/C++
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ jobs:
update-autorevision:
name: "Update AutoRevision"
runs-on: ubuntu-22.04
if: github.event_name == 'release'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- # Make sure there are no unstaged changes
Expand All @@ -29,7 +30,7 @@ jobs:
echo Target branch is $branch
echo branch=$branch >> $GITHUB_OUTPUT
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4.0.4
uses: peter-evans/create-pull-request@v6
with:
base: ${{ steps.branch.outputs.branch }}
commit-message: "Release update of AutoRevision.txt"
Expand All @@ -44,8 +45,9 @@ jobs:
update-archive:
name: "Update Source Archive"
runs-on: ubuntu-22.04
if: github.event_name == 'release'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git rev-parse --short=5 HEAD > cmake/AutoRevision.txt
Expand Down Expand Up @@ -78,7 +80,7 @@ jobs:
shell: msys2 {0}
if: github.event_name == 'release' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: msys2/setup-msys2@v2
Expand Down
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Freeciv21 contributors are listed below in alphabetical order:

- blabber (Tobias Rehbein)
- DobbyK
- ilkkachu (Ilkka Virta)
- jwrober (James Robertson)
Expand Down
24 changes: 9 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,28 +39,22 @@ include(AutoRevision)
# Set some variables from AutoRevision for use here and later
list(LENGTH FC21_REV_TAG_LIST FC21_REV_TAG_LIST_LENGTH)

# When we tag a stable release we only get 2 of the 4 components populated
# So we manually set some of the variables we need for the full version.
if(${FC21_REV_TAG_LIST_LENGTH} EQUAL 2)
# When we tag a stable release we only get 3 of the 4 components populated,
# so we manually set some of the variables we need for the full version.
if (${FC21_REV_TAG_LIST_LENGTH} EQUAL 3)
list(GET FC21_REV_TAG_LIST 0 FC21_MAJOR_VERSION)
list(GET FC21_REV_TAG_LIST 1 FC21_MINOR_VERSION)
set(FC21_LABEL_VERSION "Stable")
set(FC21_EMER_VERSION "0")
set(FC21_PATCH_VERSION "0")
list(GET FC21_REV_TAG_LIST 2 FC21_PATCH_VERSION)
set(FC21_VERSION_LABEL "stable")
set(IS_STABLE_VERSION true)
set(FREECIV21_VERSION "${FC21_MAJOR_VERSION}.${FC21_MINOR_VERSION}")
set(FREECIV21_VERSION "${FC21_MAJOR_VERSION}.${FC21_MINOR_VERSION}.${FC21_PATCH_VERSION}")
else()
list(GET FC21_REV_TAG_LIST 0 FC21_MAJOR_VERSION)
list(GET FC21_REV_TAG_LIST 1 FC21_MINOR_VERSION)
list(GET FC21_REV_TAG_LIST 2 FC21_LABEL_VERSION)
if (${FC21_REV_TAG_LIST_LENGTH} GREATER 3)
list(GET FC21_REV_TAG_LIST 3 FC21_EMER_VERSION)
else()
set(FC21_EMER_VERSION 0)
endif()
set(FC21_PATCH_VERSION ${FC21_REV_HEAD_HASH_D})
list(GET FC21_REV_TAG_LIST 2 FC21_VERSION_LABEL)
list(GET FC21_REV_TAG_LIST 3 FC21_PATCH_VERSION)
set(IS_STABLE_VERSION false)
set(FREECIV21_VERSION "${FC21_MAJOR_VERSION}.${FC21_MINOR_VERSION}.${FC21_PATCH_VERSION}")
set(FREECIV21_VERSION "${FC21_MAJOR_VERSION}.${FC21_MINOR_VERSION}")
endif()

# Set project
Expand Down
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ The documentation is found on our [documentation website](https://longturn.readt
Installation
------------

### Snap and Flathub Editions
### Snap, Flathub and AUR Editions

<p><a href='https://snapcraft.io/freeciv21'><img width='182' height='56' alt='Get Freeciv21 on Snapcraft' src='https://snapcraft.io/static/images/badges/en/snap-store-white.svg'/></a>&nbsp;<a href='https://flathub.org/apps/net.longturn.freeciv21'><img width='182' height='56' alt='Get Freeciv21 on Flathub' src='https://dl.flathub.org/assets/badges/flathub-badge-i-en.svg'/></a></p>
<p><a href='https://snapcraft.io/freeciv21'><img width='182' height='56' alt='Get Freeciv21 on Snapcraft' src='https://snapcraft.io/static/images/badges/en/snap-store-white.svg'/></a>&nbsp;<a href='https://flathub.org/apps/net.longturn.freeciv21'><img width='182' height='56' alt='Get Freeciv21 on Flathub' src='https://dl.flathub.org/assets/badges/flathub-badge-i-en.svg'/></a>&nbsp;<a href='https://aur.archlinux.org/packages/freeciv21'><img width='182' height'56' alt="AUR version" src="https://img.shields.io/aur/version/freeciv21?style=for-the-badge&logo=archlinux&label=AUR"></p>

### Windows and macOS

Expand Down Expand Up @@ -86,3 +86,17 @@ Alternatively, Freeciv21 can be used with Nix. For this, enable Nix flakes and r
```sh
nix run github:longturn/freeciv21#;
```

### FreeBSD

Freeciv21 is available in the FreeBSD ports tree. You can install the binary
package using this command:
```sh
pkg install freeciv21
```

Although it is recommended to use the binary package, you can also build
Freeciv21 using the ports tree:
```sh
make -C /usr/ports/games/freeciv21 install clean
```
17 changes: 11 additions & 6 deletions client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,13 @@ target_link_libraries(freeciv21-client PRIVATE common)
target_link_libraries(freeciv21-client PRIVATE cvercmp)
target_link_libraries(freeciv21-client PRIVATE tolua)

target_link_libraries(freeciv21-client PRIVATE Qt5::Widgets)
target_link_libraries(freeciv21-client PRIVATE Qt5::Svg)
target_link_libraries(freeciv21-client PRIVATE Qt6::Widgets)
target_link_libraries(freeciv21-client PRIVATE Qt6::Svg)

# Workaround for QTBUG-93413
set_source_files_properties(
widgets/city/governor_widget.ui
PROPERTIES AUTOUIC_OPTIONS "--connections;string")

if(NOT EMSCRIPTEN)
target_sources(freeciv21-client PRIVATE servers.cpp)
Expand All @@ -178,11 +183,11 @@ if (AUDIO_SDL)
endif()

if (APPLE)
qt5_import_plugins(freeciv21-client INCLUDE Qt5::QCocoaIntegrationPlugin Qt5::QSvgPlugin)
qt6_import_plugins(freeciv21-client INCLUDE Qt6::QCocoaIntegrationPlugin Qt6::QSvgPlugin)
endif()

if(EMSCRIPTEN)
qt5_import_plugins(freeciv21-client INCLUDE Qt5::QWasmIntegrationPlugin)
qt6_import_plugins(freeciv21-client INCLUDE Qt6::QWasmIntegrationPlugin)
target_link_options(freeciv21-client PRIVATE
-sASSERTIONS=1
-sWEBSOCKET_URL=wss://
Expand All @@ -200,8 +205,8 @@ if(EMSCRIPTEN)
"--preload-file=${CMAKE_SOURCE_DIR}/data/hexemplio@data/hexemplio"
"--preload-file=${CMAKE_SOURCE_DIR}/data/amplio2.tilespec@data/amplio2.tilespec"
"--preload-file=${CMAKE_SOURCE_DIR}/data/amplio2@data/amplio2"
"--preload-file=${CMAKE_SOURCE_DIR}/data/themes/gui-qt/Classic@data/themes/gui-qt/Classic"
"--preload-file=${CMAKE_SOURCE_DIR}/data/themes/gui-qt/icons@data/themes/gui-qt/icons"
"--preload-file=${CMAKE_SOURCE_DIR}/data/themes/Classic@data/themes/Classic"
"--preload-file=${CMAKE_SOURCE_DIR}/data/themes/icons@data/themes/icons"
"--preload-file=${CMAKE_SOURCE_DIR}/data/stdmusic.musicspec@data/stdmusic.musicspec"
"--preload-file=${CMAKE_SOURCE_DIR}/data/stdmusic@data/stdmusic"
"--preload-file=${CMAKE_SOURCE_DIR}/data/stdsounds@data/stdsounds"
Expand Down
Loading
Loading