Skip to content

Commit

Permalink
Merge branch 'master' into patch-gittyup-qt6
Browse files Browse the repository at this point in the history
  • Loading branch information
Murmele authored Nov 14, 2023
2 parents 35680a2 + bbb6b88 commit 75a6d21
Show file tree
Hide file tree
Showing 24 changed files with 15,123 additions and 8,746 deletions.
55 changes: 51 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,11 @@ jobs:
os: ubuntu-latest
ninja_platform: linux
qt_platform: linux
qt_arch: gcc_64
openssl_arch: linux-x86_64
cmake_flags: "-DGENERATE_APPDATA=ON"
ld_library_arch: linux-x86-64
cmake_flags: "-DGENERATE_APPDATA=ON -DCMAKE_INSTALL_PREFIX=/usr -DUSE_SYSTEM_QT=ON -DENABLE_UPDATE_OVER_GUI=OFF"
pack: 0
cmake_env: {}

- name: macos
Expand Down Expand Up @@ -246,7 +249,7 @@ jobs:
run: |
mkdir -p build/release
cd build/release
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DGITTYUP_CI_TESTS=ON ${{ env.CMAKE_FLAGS }} ${{ matrix.env.cmake_flags }} ../..
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DUPDATE_TRANSLATIONS=ON -DGITTYUP_CI_TESTS=ON ${{ env.CMAKE_FLAGS }} ${{ matrix.env.cmake_flags }} ../..
- name: Build Information
run: |
Expand Down Expand Up @@ -283,9 +286,14 @@ jobs:
if: matrix.env.pack
uses: actions/upload-artifact@v3
with:
path: build/release/VERSION.txt
path: build/release/Version.txt
name: Gittyup-VERSION

- name: Check Version file
run: |
cd build/release
cat ./Version.txt
- name: Test
if: matrix.env.ninja_platform != 'win' && matrix.env.ninja_platform != 'mac'
uses: GabrielBB/xvfb-action@v1
Expand All @@ -299,6 +307,44 @@ jobs:
cd build/release
ninja check_no_win32_offscreen
- name: Build Appimage
if: matrix.env.ninja_platform == 'linux' && !matrix.qt.check_only
run: |
cd build/release
sudo apt -y install appstream
sudo apt -y install libfuse2
sudo apt -y install libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-shape0
sudo apt -y install libxcb-shm0 libxcb-sync1 libxcb-util1 libxcb-xinerama0 libxcb-xinput0 libxcb-xkb1 libxcb-xrm0 libxcb-xv0 libxcb-xvmc0 libxcb1
mkdir -p AppDir
DESTDIR=AppDir ninja install
export QTDIR=$RUNNER_WORKSPACE/Qt/${{ matrix.qt.version }}/${{ matrix.env.qt_arch }}
rm -rf ./AppDir/usr/include/
strip ./AppDir/usr/bin/cmark ./AppDir/usr/bin/gittyup ./AppDir/usr/bin/indexer ./AppDir/usr/bin/relauncher
wget -c https://github.com/$(wget -q https://github.com/probonopd/go-appimage/releases/expanded_assets/continuous -O - | grep "appimagetool-.*-x86_64.AppImage" | head -n 1 | cut -d '"' -f 2)
chmod +x appimagetool-*.AppImage
QTDIR=$QTDIR ./appimagetool-*.AppImage -s deploy ./AppDir/usr/share/applications/*.desktop --appimage-extract-and-run # Bundle EVERYTHING
# Modify the AppDir: move ld-linux into the same directory as the payload application
# and change AppRun accordingly; so that, e.g., Qt qApp->applicationDirPath() works
mv ./AppDir/lib64/ld-${{ matrix.env.ld_library_arch }}.so.2 ./AppDir/usr/bin/
sed -i -e 's@^LD_LINUX.*@LD_LINUX=$(find "$HERE/usr/bin" -name "ld-*.so.*" | head -n 1)@g' ./AppDir/AppRun
rm ./AppDir/usr/share/metainfo/gittyup.appdata.xml
VERSION=$(cat ./Version.txt)
VERSION="$VERSION" ./appimagetool-*.AppImage ./AppDir # turn AppDir into AppImage
#ls -lh Gittyup-*
- name: Publish Appimage
if: matrix.env.ninja_platform == 'linux' && !matrix.qt.check_only
uses: actions/upload-artifact@v3
with:
path: build/release/*.AppImage
name: Gittyup Appimage

publish:
# https://github.com/marvinpinto/actions/issues/177
needs: [flatpak, build]
Expand Down Expand Up @@ -329,7 +375,7 @@ jobs:
# version is exported from cmake to file
- name: Retrieve version
run: |
echo "::set-output name=VERSION::$(cat artifacts/Gittyup-VERSION/VERSION.txt)"
echo "::set-output name=VERSION::$(cat artifacts/Gittyup-VERSION/Version.txt)"
id: version

- name: Update GitHub release (latest tag)
Expand Down Expand Up @@ -358,6 +404,7 @@ jobs:
**/artifacts/Gittyup macos/Gittyup*.dmg
**/artifacts/Gittyup Flatpak/com.github.Murmele.Gittyup.yml
**/Gittyup-x86_64/*.flatpak
**/artifacts/Gittyup Appimage/*
# needed otherwise the docs folder is not available
- name: Checkout repository
Expand Down
2 changes: 1 addition & 1 deletion cl-fmt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cd "`dirname "$0"`"
# Variable that will hold the name of the clang-format command
FMT=""

FOLDERS=("./src" "./test")
FOLDERS=("./src" "./test" "./l10n")

# We specifically require clang-format v13. Some distros include the version
# number in the name, others don't. Prefer the specifically-named version.
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Report bugs in Gittyup by opening an issue in the
Remember to search for existing issues before creating a new one.

If you still need help, check out our Matrix channel
[Gittyup:martix.org](https://matrix.to/#/#Gittyup:matrix.org).
[Gittyup:matrix.org](https://matrix.to/#/#Gittyup:matrix.org).

Multi language support
======================
Expand Down
12 changes: 12 additions & 0 deletions l10n/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@ set(LANGUAGES
set(SRC_DIR ${CMAKE_SOURCE_DIR}/src)
file(GLOB_RECURSE SOURCE_FILES ${SRC_DIR}/*.h ${SRC_DIR}/*.cpp ${SRC_DIR}/*.mm)

set(SYSTEM_LANG_KEY "System")
set(SUPPORTED_LANGUAGES "{\"${SYSTEM_LANG_KEY}\", \"${SYSTEM_LANG_KEY}\"},")
foreach(LANGUAGE ${LANGUAGES})
set(TS_FILES ${TS_FILES} gittyup_${LANGUAGE}.ts)
set(SUPPORTED_LANGUAGES
"${SUPPORTED_LANGUAGES} {\"${LANGUAGE}\", \"${LANGUAGE}\"},")
endforeach()

set(LANGUAGE_SOURCE_FILE "${CMAKE_CURRENT_BINARY_DIR}/languages.cpp")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/languages.cpp.inc"
${LANGUAGE_SOURCE_FILE} @ONLY)

if(UPDATE_TRANSLATIONS)
# FIXME: Clean removes the .ts files.
qt6_create_translation(QM_FILES ${SOURCE_FILES} ${TS_FILES})
Expand All @@ -28,6 +36,10 @@ endif()
add_custom_target(translations DEPENDS ${QM_FILES})
add_dependencies(gittyup translations)

add_library(translation ${LANGUAGE_SOURCE_FILE})
target_include_directories(translation PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
target_link_libraries(translation Qt5::Core)

# install language files

foreach(LANGUAGE ${LANGUAGES})
Expand Down
Loading

0 comments on commit 75a6d21

Please sign in to comment.