Skip to content

Commit

Permalink
Merge branch 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
0verEngineer committed Dec 12, 2023
2 parents 2ae23e2 + 66bc256 commit 231c3d3
Show file tree
Hide file tree
Showing 179 changed files with 19,678 additions and 10,656 deletions.
80 changes: 71 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,18 @@ jobs:
runs-on: ubuntu-latest
container:
# image: bilelmoussaoui/flatpak-github-actions:kde-5.15-21.08
image: exactlyonekas/gittyup-flatpak-builder:latest
image: archlinux:latest
options: --privileged
steps:

- name: Update
run: |
pacman --noconfirm -Suy
pacman --noconfirm -S flatpak flatpak-builder xorg-server-xvfb
flatpak install --assumeyes org.kde.Sdk//5.15-21.08
flatpak install --assumeyes org.freedesktop.Sdk.Extension.golang//21.08
flatpak install --assumeyes org.kde.Platform//5.15-21.08
- name: Show environment variables
run: >
echo IS_RELEASE: ${{ env.IS_RELEASE }}
Expand All @@ -67,7 +76,7 @@ jobs:
- name: Replace git tag by the commit id on which it runs
if: github.ref_type != 'tag'
run: >
sed -i 's@tag: gittyup_v[1-9]*.[0-9]*.[0-9]*@commit: "${{ (github.event.pull_request && github.event.pull_request.head.sha) || github.sha }}"@' com.github.Murmele.Gittyup/com.github.Murmele.Gittyup.yml
sed -i 's@tag: .*@commit: "${{ (github.event.pull_request && github.event.pull_request.head.sha) || github.sha }}"@' com.github.Murmele.Gittyup/com.github.Murmele.Gittyup.yml
- name: Use correct git tag
if: github.ref_type == 'tag'
Expand All @@ -88,6 +97,11 @@ jobs:
run: >
sed -i 's@desktop-file-name-suffix: ""@desktop-file-name-suffix: " (Development)"@' com.github.Murmele.Gittyup/com.github.Murmele.Gittyup.yml
- name: Enable automatic update
if: github.ref_type != 'tag'
run: >
sed -i 's@-DENABLE_UPDATE_OVER_GUI=OFF@-DENABLE_UPDATE_OVER_GUI=ON@' com.github.Murmele.Gittyup/com.github.Murmele.Gittyup.yml
- name: Show Flatpak manifest
run: cat com.github.Murmele.Gittyup/com.github.Murmele.Gittyup.yml

Expand Down Expand Up @@ -123,8 +137,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 @@ -193,7 +210,7 @@ jobs:
perl-version: '5.30'

- name: Install Qt
uses: jurplel/install-qt-action@v2.13.0
uses: jurplel/install-qt-action@v3.3.0
timeout-minutes: 10
if: "!matrix.qt.check_only"
with:
Expand All @@ -205,7 +222,7 @@ jobs:
modules: qtwebengine

- name: Install Qt
uses: jurplel/install-qt-action@v2.13.0
uses: jurplel/install-qt-action@v3.3.0
timeout-minutes: 10
if: matrix.qt.check_only
with:
Expand Down Expand Up @@ -264,7 +281,7 @@ jobs:
run: |
mkdir -p build/release
cd build/release
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DDEBUG_OUTPUT=OFF -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 @@ -301,22 +318,65 @@ jobs:
if: matrix.env.pack && !matrix.qt.check_only
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
with:
working-directory: build/release
run: ninja check
run: ninja check --verbose

- name: Test (Windows)
if: matrix.env.ninja_platform == 'win'
run: |
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: GittyupAppImage

publish:
# https://github.com/marvinpinto/actions/issues/177
needs: [flatpak, build]
Expand Down Expand Up @@ -347,7 +407,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 All @@ -363,6 +423,7 @@ jobs:
**/artifacts/Gittyup macos/Gittyup*.dmg
**/artifacts/Gittyup Flatpak/com.github.Murmele.Gittyup.yml
**/Gittyup-x86_64/*.flatpak
**/artifacts/GittyupAppImage/*
- name: Update GitHub release (version tag)
uses: marvinpinto/action-automatic-releases@latest
Expand All @@ -378,6 +439,7 @@ jobs:
**/artifacts/Gittyup macos/Gittyup*.dmg
**/artifacts/Gittyup Flatpak/com.github.Murmele.Gittyup.yml
**/Gittyup-x86_64/*.flatpak
**/artifacts/GittyupAppImage/*
# needed otherwise the docs folder is not available
- name: Checkout repository
Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
build
.cache
.DS_Store
.project
.vscode/
CMakeLists.txt.user
cmake-build-debug/
cmake-build-release/
build
.idea/
.venv
compile_commands.json

7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
repos:
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v13.0.1
hooks:
- id: clang-format
args: [ -i ]

48 changes: 43 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
cmake_minimum_required(VERSION 3.6.2)
cmake_minimum_required(VERSION 3.12)
project(Gittyup)

# Set name and version.
set(GITTYUP_NAME "Gittyup")
set(GITTYUP_EXECUTABLE_NAME "gittyup")
set(GITTYUP_IDENTIFIER "com.github.Murmele.Gittyup")
set(GITTYUP_VERSION_MAJOR 1)
set(GITTYUP_VERSION_MINOR 2)
set(GITTYUP_VERSION_PATCH 1)
set(GITTYUP_VERSION_MINOR 3)
set(GITTYUP_VERSION_PATCH 0)
set(GITTYUP_VERSION
"${GITTYUP_VERSION_MAJOR}.${GITTYUP_VERSION_MINOR}.${GITTYUP_VERSION_PATCH}"
)

string(TIMESTAMP CURR_YEAR "%Y")
add_compile_definitions(CURR_YEAR=${CURR_YEAR})
configure_file(${CMAKE_SOURCE_DIR}/LICENSE.md.in ${CMAKE_SOURCE_DIR}/LICENSE.md
@ONLY NEWLINE_STYLE UNIX)

# Write version to file so it can be used also from external, for example in the
# github manifest
file(WRITE "${CMAKE_BINARY_DIR}/Version.txt" ${GITTYUP_VERSION})
Expand Down Expand Up @@ -45,6 +52,7 @@ set(BUILD_SHARED_LIBS OFF)

option(FLATPAK "Building for flatpak" OFF)
option(DEBUG_FLATPAK "Building but using flatpak urls for testing" OFF)
option(ENABLE_UPDATE_OVER_GUI "Enable updating from the Gittyup gui" ON)
option(USE_SYSTEM_OPENSSL "Use the system-wide OpenSSL installation" OFF)
option(
USE_SYSTEM_LIBGIT2
Expand All @@ -68,7 +76,10 @@ set(LUA_MODULES_PATH
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)

if(UNIX AND NOT APPLE)
if(HAIKU)
# qsort_r in libgit2 requires this
set(CMAKE_EXE_LINKER_FLAGS -lgnu)
elseif(UNIX AND NOT APPLE)
set(CMAKE_EXE_LINKER_FLAGS -ldl)
endif()

Expand All @@ -86,9 +97,20 @@ if(UNIX)
set(QT_MODULES ${QT_MODULES} DBus)
endif()

option(DEBUG_OUTPUT "Print debug output" ON)
option(DEBUG_OUTPUT
"Print debug output (Only available if debug menu is enabled!)" ON)
option(DEBUG_OUTPUT_GENERAL "Enable general debug messages" ON)
option(DEBUG_OUTPUT_REFRESH "Enable debug messages to debug the refresh flow"
OFF)
if(NOT DEBUG_OUTPUT)
add_compile_definitions(QT_NO_DEBUG_OUTPUT)
else()
if(DEBUG_OUTPUT_GENERAL)
add_compile_definitions(DEBUG_OUTPUT_GENERAL)
endif()
if(DEBUG_OUTPUT_REFRESH)
add_compile_definitions(DEBUG_OUTPUT_REFRESH)
endif()
endif()

find_package(
Expand All @@ -103,6 +125,10 @@ if(FLATPAK)
add_compile_definitions(FLATPAK)
endif()

if(ENABLE_UPDATE_OVER_GUI)
add_compile_definitions(ENABLE_UPDATE_OVER_GUI)
endif()

if(DEBUG_FLATPAK)
add_compile_definitions(DEBUG_FLATPAK)
endif()
Expand All @@ -125,6 +151,18 @@ if(APPLE)
endforeach()
endif()

if(APPLE)
set(CONTENTS_DIR ${GITTYUP_EXECUTABLE_NAME}.app/Contents)
set(RESOURCES_DIR ${CONTENTS_DIR}/Resources)
set(L10N_INSTALL_DIR ${RESOURCES_DIR}/l10n)
elseif(UNIX)
set(L10N_INSTALL_DIR ${CMAKE_INSTALL_LOCALEDIR}/${GITTYUP_NAME})
set(RESOURCES_DIR ${CMAKE_INSTALL_DATADIR}/${GITTYUP_NAME})
else()
set(L10N_INSTALL_DIR Resources/l10n)
set(RESOURCES_DIR Resources)
endif()

add_subdirectory(dep)
add_subdirectory(src)
add_subdirectory(l10n)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MIT License

Copyright (c) 2018 Scientific Toolworks, Inc.
Copyright (c) 2021-2022 Gittyup contributors
Copyright (c) 2021-2023 Gittyup contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
22 changes: 22 additions & 0 deletions LICENSE.md.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
MIT License

Copyright (c) 2018 Scientific Toolworks, Inc.
Copyright (c) 2021-@CURR_YEAR@ Gittyup contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,11 @@ where `<path-to-qt>` points to the Qt install directory that contains
`bin`, `lib`, etc.

**Build**

```
ninja
```

### A Convenient Shell Script for Ubuntu is available [here](https://raw.githubusercontent.com/Murmele/Gittyup/master/pack/buildUbuntu.sh), and will install all the necessary prerequisites, and build a release version for immediate use.

How to Install
-----------------
Expand Down Expand Up @@ -177,7 +180,6 @@ function run_disown_silence(){
run_disown_silence flatpak run com.github.Murmele.Gittyup
```


How to Contribute
-----------------

Expand All @@ -192,6 +194,15 @@ branch. Create pull requests against the `master` branch. Follow the
[seven guidelines](https://chris.beams.io/posts/git-commit/) to writing a
great commit message.

Prior to committing a change, please use `cl-format.sh` to ensure your code
adheres to the formatting conventions for this project. You can also use the
`setup-env.sh` script to install a pre-commit hook which will automatically
run `clang-format` against all modified files.

Prior to pushing a change, please ensure you run the unit tests to avoid any
regressions. These are found in `<build-dir>/test` and can be run using
`ctest`.

License
-------

Expand Down
Loading

0 comments on commit 231c3d3

Please sign in to comment.