Skip to content

Commit 24332cf

Browse files
fix linting errors for flathub (flameshot-org#4109)
* fix linting errors for flathub * Update CMakeLists.txt fixed typo Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
1 parent a29fada commit 24332cf

File tree

2 files changed

+48
-54
lines changed

2 files changed

+48
-54
lines changed

CMakeLists.txt

Lines changed: 30 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,6 @@ set(FLAMESHOT_VERSION 13.0.0)
66
# Flameshot-org
77
set(GIT_API_URL "https://api.github.com/repos/flameshot-org/flameshot/releases/latest")
88

9-
# TODO - fix it for all linux distros
10-
#find_package (Git)
11-
#if (GIT_FOUND)
12-
# message("git found: ${GIT_EXECUTABLE} in version ${GIT_VERSION_STRING}")
13-
#
14-
# # set flameshot updates url
15-
# execute_process(COMMAND ${GIT_EXECUTABLE} ls-remote --get-url OUTPUT_VARIABLE GIT_ORIGIN_REMOTE)
16-
# message("GIT_ORIGIN_REMOTE: ${GIT_ORIGIN_REMOTE}")
17-
# string(REGEX REPLACE ".git\r*\n*$" "/releases/latest" GIT_API_URL ${GIT_ORIGIN_REMOTE})
18-
# string(REGEX REPLACE "^.*:" "https://api.github.com/repos/" GIT_API_URL ${GIT_API_URL})
19-
# message("GIT_API_URL: '${GIT_API_URL}'")
20-
#
21-
# # get application version
22-
# execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --abbrev=0 --match v[0-9]* OUTPUT_VARIABLE FLAMESHOT_VERSION)
23-
# string(REGEX REPLACE "\r" "" FLAMESHOT_VERSION ${FLAMESHOT_VERSION})
24-
# string(REGEX REPLACE "\n" "" FLAMESHOT_VERSION ${FLAMESHOT_VERSION})
25-
# string(REGEX REPLACE "^v" "" FLAMESHOT_VERSION ${FLAMESHOT_VERSION})
26-
# message("FLAMESHOT_VERSION: '${FLAMESHOT_VERSION}'")
27-
#else()
28-
# message("git command is not found")
29-
#endif ()
30-
319
project(
3210
flameshot
3311
VERSION ${FLAMESHOT_VERSION}
@@ -46,24 +24,28 @@ option(BUILD_SHARED_LIBS OFF)
4624
#Needed due to linker error with QtColorWidget
4725
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
4826

49-
FetchContent_Declare(
50-
qtColorWidgets
51-
GIT_REPOSITORY https://gitlab.com/mattbas/Qt-Color-Widgets.git
52-
GIT_TAG 352bc8f99bf2174d5724ee70623427aa31ddc26a
53-
)
54-
55-
#Workaround for duplicate GUID in windows WIX installer
56-
if (WIN32)
57-
FetchContent_GetProperties(qtColorWidgets)
58-
if(NOT qtcolorwidgets_POPULATED)
59-
FetchContent_Populate(qtColorWidgets)
60-
add_subdirectory(${qtcolorwidgets_SOURCE_DIR} ${qtcolorwidgets_BINARY_DIR} EXCLUDE_FROM_ALL)
61-
endif()
27+
28+
# Dependency can be fetched via flatpak builder
29+
if(EXISTS "${CMAKE_SOURCE_DIR}/external/Qt-Color-Widgets/CMakeLists.txt")
30+
add_subdirectory("${CMAKE_SOURCE_DIR}/external/Qt-Color-Widgets" EXCLUDE_FROM_ALL)
6231
else()
63-
FetchContent_MakeAvailable(qtColorWidgets)
32+
FetchContent_Declare(
33+
qtColorWidgets
34+
GIT_REPOSITORY https://gitlab.com/mattbas/Qt-Color-Widgets.git
35+
GIT_TAG 352bc8f99bf2174d5724ee70623427aa31ddc26a
36+
)
37+
#Workaround for duplicate GUID in windows WIX installer
38+
if (WIN32)
39+
FetchContent_GetProperties(qtColorWidgets)
40+
if(NOT qtcolorwidgets_POPULATED)
41+
FetchContent_Populate(qtColorWidgets)
42+
add_subdirectory(${qtcolorwidgets_SOURCE_DIR} ${qtcolorwidgets_BINARY_DIR} EXCLUDE_FROM_ALL)
43+
endif()
44+
else()
45+
FetchContent_MakeAvailable(qtColorWidgets)
46+
endif()
6447
endif()
6548

66-
6749
# This can be read from ${PROJECT_NAME} after project() is called
6850
if (APPLE)
6951
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version")
@@ -129,12 +111,17 @@ if (USE_KDSINGLEAPPLICATION)
129111
set(KDSingleApplication_EXAMPLES OFF CACHE BOOL "Don't build the examples")
130112
set(KDSingleApplication_STATIC ON CACHE BOOL "Build static versions of the libraries")
131113

132-
FetchContent_Declare(
133-
kdsingleApplication
134-
GIT_REPOSITORY https://github.com/KDAB/KDSingleApplication.git
135-
GIT_TAG v1.2.0
136-
)
137-
FetchContent_MakeAvailable(KDSingleApplication)
114+
# Check if KDSingleApplication is available locally
115+
if(EXISTS "${CMAKE_SOURCE_DIR}/external/KDSingleApplication/CMakeLists.txt")
116+
add_subdirectory("${CMAKE_SOURCE_DIR}/external/KDSingleApplication")
117+
else()
118+
FetchContent_Declare(
119+
kdsingleApplication
120+
GIT_REPOSITORY https://github.com/KDAB/KDSingleApplication.git
121+
GIT_TAG v1.2.0
122+
)
123+
FetchContent_MakeAvailable(KDSingleApplication)
124+
endif()
138125
endif()
139126

140127
# ToDo: Check if this is used anywhere

packaging/flatpak/org.flameshot.Flameshot.yml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ command: flameshot
66
finish-args:
77
# X11 + XShm access
88
- --share=ipc
9-
- --socket=x11
9+
- --socket=fallback-x11
1010
# Wayland access
1111
- --socket=wayland
1212
- --device=dri
@@ -15,27 +15,34 @@ finish-args:
1515
# QtSingleApplication, allow other instances to see log files
1616
- --env=TMPDIR=/var/tmp
1717
# Allow loading/saving files from anywhere
18-
- --filesystem=host
18+
- --filesystem=xdg-pictures
1919
# Notification access
2020
- --talk-name=org.freedesktop.Notifications
2121
# System Tray Icon
2222
- --talk-name=org.kde.StatusNotifierWatcher
23-
- --own-name=org.kde.*
24-
- --own-name=org.flameshot.Flameshot
2523
modules:
2624
- name: flameshot
2725
buildsystem: cmake-ninja
28-
build-options:
29-
build-args:
30-
- --share=network
3126
config-opts:
3227
- -DCMAKE_BUILD_TYPE=Release
3328
- -DUSE_WAYLAND_CLIPBOARD=1
3429
sources:
35-
# Keep this in until qt6 is merged to master branch. Makes it easy to test flatpak dev builds
36-
# Change the path to the location of the cloned flameshot repo
37-
#- type: dir
38-
# path: /path/to/repo
30+
- type: git
31+
url: https://gitlab.com/mattbas/Qt-Color-Widgets.git
32+
commit: 352bc8f99bf2174d5724ee70623427aa31ddc26a
33+
dest: external/Qt-Color-Widgets
34+
35+
- type: git
36+
url: https://github.com/KDAB/KDSingleApplication.git
37+
tag: v1.2.0
38+
dest: external/KDSingleApplication
39+
3940
- type: git
4041
url: https://github.com/flameshot-org/flameshot.git
4142
branch: master
43+
#tag: v13.0.0
44+
45+
cleanup:
46+
- /share/bash-completion
47+
- /share/man
48+
- /share/zsh

0 commit comments

Comments
 (0)