Skip to content

Commit 3fee8d7

Browse files
committed
Cleanup build flags, global namespace and includes
- Separated displays so they don't have to be all built even when the features are disabled. - Removed weird linker magic for display init and replaced it with straightforward (and faster) template functions that behave the same. - Replaced disabled_display_output classes with log messages. - Add explicit errors when feature dependent headers get included where they shouldn't. - Use gperf to build perfect hash for color names instead of custom X11 lookup. This should make it easier to add more color names to the list with no extra cost. - Made alignment use a specific bit layout which greatly simplifies code. - Switch BUILD_MOUSE_EVENTS dependency from OWN_WINDOW to BUILD_X11. - Other minor improvements to some existing code which shouldn't affect behavior. - Add documentation links to sample configs. Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
1 parent d815f9a commit 3fee8d7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+4741
-2369
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Install script for directory: /data/code/FOSS/conky/3rdparty/toluapp
2+
3+
# Set the install prefix
4+
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
5+
set(CMAKE_INSTALL_PREFIX "/usr/local")
6+
endif()
7+
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
8+
9+
# Set the install configuration name.
10+
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
11+
if(BUILD_TYPE)
12+
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
13+
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
14+
else()
15+
set(CMAKE_INSTALL_CONFIG_NAME "RelWithDebInfo")
16+
endif()
17+
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
18+
endif()
19+
20+
# Set the component getting installed.
21+
if(NOT CMAKE_INSTALL_COMPONENT)
22+
if(COMPONENT)
23+
message(STATUS "Install component: \"${COMPONENT}\"")
24+
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
25+
else()
26+
set(CMAKE_INSTALL_COMPONENT)
27+
endif()
28+
endif()
29+
30+
# Install shared libraries without execute permission?
31+
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
32+
set(CMAKE_INSTALL_SO_NO_EXE "0")
33+
endif()
34+
35+
# Is this installation the result of a crosscompile?
36+
if(NOT DEFINED CMAKE_CROSSCOMPILING)
37+
set(CMAKE_CROSSCOMPILING "FALSE")
38+
endif()
39+
40+
# Set default install directory permissions.
41+
if(NOT DEFINED CMAKE_OBJDUMP)
42+
set(CMAKE_OBJDUMP "/usr/bin/objdump")
43+
endif()
44+

CPackConfig.cmake

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# This file will be configured to contain variables for CPack. These variables
2+
# should be set in the CMake list file of the project before CPack module is
3+
# included. The list of available CPACK_xxx variables and their associated
4+
# documentation may be obtained using
5+
# cpack --help-variable-list
6+
#
7+
# Some variables are common to all generators (e.g. CPACK_PACKAGE_NAME)
8+
# and some are specific to a generator
9+
# (e.g. CPACK_NSIS_EXTRA_INSTALL_COMMANDS). The generator specific variables
10+
# usually begin with CPACK_<GENNAME>_xxxx.
11+
12+
13+
set(CPACK_BUILD_SOURCE_DIRS "/data/code/FOSS/conky;/data/code/FOSS/conky")
14+
set(CPACK_CMAKE_GENERATOR "Unix Makefiles")
15+
set(CPACK_COMPONENTS_ALL "")
16+
set(CPACK_COMPONENT_UNSPECIFIED_HIDDEN "TRUE")
17+
set(CPACK_COMPONENT_UNSPECIFIED_REQUIRED "TRUE")
18+
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>=2.10-1), libgcc1 (>= 1:4.4.0)")
19+
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Brenden Matthews")
20+
set(CPACK_DEFAULT_PACKAGE_DESCRIPTION_FILE "/usr/share/cmake/Templates/CPack.GenericDescription.txt")
21+
set(CPACK_DEFAULT_PACKAGE_DESCRIPTION_SUMMARY "conky built using CMake")
22+
set(CPACK_GENERATOR "TGZ;STGZ;DEB")
23+
set(CPACK_INNOSETUP_ARCHITECTURE "x64")
24+
set(CPACK_INSTALL_CMAKE_PROJECTS "/data/code/FOSS/conky;conky;ALL;/")
25+
set(CPACK_INSTALL_PREFIX "/usr/local")
26+
set(CPACK_MODULE_PATH "/data/code/FOSS/conky/cmake")
27+
set(CPACK_NSIS_DISPLAY_NAME "conky")
28+
set(CPACK_NSIS_INSTALLER_ICON_CODE "")
29+
set(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "")
30+
set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
31+
set(CPACK_NSIS_PACKAGE_NAME "conky")
32+
set(CPACK_NSIS_UNINSTALL_NAME "Uninstall")
33+
set(CPACK_OBJCOPY_EXECUTABLE "/usr/bin/objcopy")
34+
set(CPACK_OBJDUMP_EXECUTABLE "/usr/bin/objdump")
35+
set(CPACK_OUTPUT_CONFIG_FILE "/data/code/FOSS/conky/CPackConfig.cmake")
36+
set(CPACK_PACKAGE_CONTACT "brenden@diddyinc.com")
37+
set(CPACK_PACKAGE_DEFAULT_LOCATION "/")
38+
set(CPACK_PACKAGE_DESCRIPTION_FILE "/usr/share/cmake/Templates/CPack.GenericDescription.txt")
39+
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "conky built using CMake")
40+
set(CPACK_PACKAGE_FILE_NAME "conky-1.20.1_pre-Linux-")
41+
set(CPACK_PACKAGE_INSTALL_DIRECTORY "conky")
42+
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "conky")
43+
set(CPACK_PACKAGE_NAME "conky")
44+
set(CPACK_PACKAGE_RELOCATABLE "true")
45+
set(CPACK_PACKAGE_VENDOR "Humanity")
46+
set(CPACK_PACKAGE_VERSION "1.20.1")
47+
set(CPACK_PACKAGE_VERSION_MAJOR "1")
48+
set(CPACK_PACKAGE_VERSION_MINOR "20")
49+
set(CPACK_PACKAGE_VERSION_PATCH "1")
50+
set(CPACK_READELF_EXECUTABLE "/usr/bin/readelf")
51+
set(CPACK_RESOURCE_FILE_LICENSE "/usr/share/cmake/Templates/CPack.GenericLicense.txt")
52+
set(CPACK_RESOURCE_FILE_README "/usr/share/cmake/Templates/CPack.GenericDescription.txt")
53+
set(CPACK_RESOURCE_FILE_WELCOME "/usr/share/cmake/Templates/CPack.GenericWelcome.txt")
54+
set(CPACK_SET_DESTDIR "OFF")
55+
set(CPACK_SOURCE_GENERATOR "TBZ2")
56+
set(CPACK_SOURCE_IGNORE_FILES "~$;\\.git.*$;\\..*\\.swp$;build.*$")
57+
set(CPACK_SOURCE_OUTPUT_CONFIG_FILE "/data/code/FOSS/conky/CPackSourceConfig.cmake")
58+
set(CPACK_SOURCE_PACKAGE_FILE_NAME "conky-1.20.1_pre-src")
59+
set(CPACK_STRIP_FILES "true")
60+
set(CPACK_SYSTEM_NAME "Linux")
61+
set(CPACK_THREADS "1")
62+
set(CPACK_TOPLEVEL_TAG "Linux")
63+
set(CPACK_WIX_SIZEOF_VOID_P "8")
64+
65+
if(NOT CPACK_PROPERTIES_FILE)
66+
set(CPACK_PROPERTIES_FILE "/data/code/FOSS/conky/CPackProperties.cmake")
67+
endif()
68+
69+
if(EXISTS ${CPACK_PROPERTIES_FILE})
70+
include(${CPACK_PROPERTIES_FILE})
71+
endif()

CPackSourceConfig.cmake

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# This file will be configured to contain variables for CPack. These variables
2+
# should be set in the CMake list file of the project before CPack module is
3+
# included. The list of available CPACK_xxx variables and their associated
4+
# documentation may be obtained using
5+
# cpack --help-variable-list
6+
#
7+
# Some variables are common to all generators (e.g. CPACK_PACKAGE_NAME)
8+
# and some are specific to a generator
9+
# (e.g. CPACK_NSIS_EXTRA_INSTALL_COMMANDS). The generator specific variables
10+
# usually begin with CPACK_<GENNAME>_xxxx.
11+
12+
13+
set(CPACK_BUILD_SOURCE_DIRS "/data/code/FOSS/conky;/data/code/FOSS/conky")
14+
set(CPACK_CMAKE_GENERATOR "Unix Makefiles")
15+
set(CPACK_COMPONENTS_ALL "")
16+
set(CPACK_COMPONENT_UNSPECIFIED_HIDDEN "TRUE")
17+
set(CPACK_COMPONENT_UNSPECIFIED_REQUIRED "TRUE")
18+
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>=2.10-1), libgcc1 (>= 1:4.4.0)")
19+
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Brenden Matthews")
20+
set(CPACK_DEFAULT_PACKAGE_DESCRIPTION_FILE "/usr/share/cmake/Templates/CPack.GenericDescription.txt")
21+
set(CPACK_DEFAULT_PACKAGE_DESCRIPTION_SUMMARY "conky built using CMake")
22+
set(CPACK_GENERATOR "TBZ2")
23+
set(CPACK_IGNORE_FILES "~$;\\.git.*$;\\..*\\.swp$;build.*$")
24+
set(CPACK_INNOSETUP_ARCHITECTURE "x64")
25+
set(CPACK_INSTALLED_DIRECTORIES "/data/code/FOSS/conky;/")
26+
set(CPACK_INSTALL_CMAKE_PROJECTS "")
27+
set(CPACK_INSTALL_PREFIX "/usr/local")
28+
set(CPACK_MODULE_PATH "/data/code/FOSS/conky/cmake")
29+
set(CPACK_NSIS_DISPLAY_NAME "conky")
30+
set(CPACK_NSIS_INSTALLER_ICON_CODE "")
31+
set(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "")
32+
set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
33+
set(CPACK_NSIS_PACKAGE_NAME "conky")
34+
set(CPACK_NSIS_UNINSTALL_NAME "Uninstall")
35+
set(CPACK_OBJCOPY_EXECUTABLE "/usr/bin/objcopy")
36+
set(CPACK_OBJDUMP_EXECUTABLE "/usr/bin/objdump")
37+
set(CPACK_OUTPUT_CONFIG_FILE "/data/code/FOSS/conky/CPackConfig.cmake")
38+
set(CPACK_PACKAGE_CONTACT "brenden@diddyinc.com")
39+
set(CPACK_PACKAGE_DEFAULT_LOCATION "/")
40+
set(CPACK_PACKAGE_DESCRIPTION_FILE "/usr/share/cmake/Templates/CPack.GenericDescription.txt")
41+
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "conky built using CMake")
42+
set(CPACK_PACKAGE_FILE_NAME "conky-1.20.1_pre-src")
43+
set(CPACK_PACKAGE_INSTALL_DIRECTORY "conky")
44+
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "conky")
45+
set(CPACK_PACKAGE_NAME "conky")
46+
set(CPACK_PACKAGE_RELOCATABLE "true")
47+
set(CPACK_PACKAGE_VENDOR "Humanity")
48+
set(CPACK_PACKAGE_VERSION "1.20.1")
49+
set(CPACK_PACKAGE_VERSION_MAJOR "1")
50+
set(CPACK_PACKAGE_VERSION_MINOR "20")
51+
set(CPACK_PACKAGE_VERSION_PATCH "1")
52+
set(CPACK_READELF_EXECUTABLE "/usr/bin/readelf")
53+
set(CPACK_RESOURCE_FILE_LICENSE "/usr/share/cmake/Templates/CPack.GenericLicense.txt")
54+
set(CPACK_RESOURCE_FILE_README "/usr/share/cmake/Templates/CPack.GenericDescription.txt")
55+
set(CPACK_RESOURCE_FILE_WELCOME "/usr/share/cmake/Templates/CPack.GenericWelcome.txt")
56+
set(CPACK_RPM_PACKAGE_SOURCES "ON")
57+
set(CPACK_SET_DESTDIR "OFF")
58+
set(CPACK_SOURCE_GENERATOR "TBZ2")
59+
set(CPACK_SOURCE_IGNORE_FILES "~$;\\.git.*$;\\..*\\.swp$;build.*$")
60+
set(CPACK_SOURCE_INSTALLED_DIRECTORIES "/data/code/FOSS/conky;/")
61+
set(CPACK_SOURCE_OUTPUT_CONFIG_FILE "/data/code/FOSS/conky/CPackSourceConfig.cmake")
62+
set(CPACK_SOURCE_PACKAGE_FILE_NAME "conky-1.20.1_pre-src")
63+
set(CPACK_SOURCE_TOPLEVEL_TAG "Linux-Source")
64+
set(CPACK_STRIP_FILES "")
65+
set(CPACK_SYSTEM_NAME "Linux")
66+
set(CPACK_THREADS "1")
67+
set(CPACK_TOPLEVEL_TAG "Linux-Source")
68+
set(CPACK_WIX_SIZEOF_VOID_P "8")
69+
70+
if(NOT CPACK_PROPERTIES_FILE)
71+
set(CPACK_PROPERTIES_FILE "/data/code/FOSS/conky/CPackProperties.cmake")
72+
endif()
73+
74+
if(EXISTS ${CPACK_PROPERTIES_FILE})
75+
include(${CPACK_PROPERTIES_FILE})
76+
endif()

build.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#ifndef __BUILD_H
2+
#define __BUILD_H
3+
4+
/* Conky build info */
5+
6+
#define BUILD_ARCH "Linux x86_64"
7+
8+
#endif /* __BUILD_H */

cmake/ConkyBuildOptions.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ dependent_option(BUILD_XSHAPE "Enable Xshape support" true
193193
"BUILD_X11" false
194194
"Xshape support requires X11")
195195
dependent_option(BUILD_XINPUT "Build Xinput 2 support" true
196-
"BUILD_X11;BUILD_MOUSE_EVENTS" false
197-
"Xinput 2 support requires X11 and BUILD_MOUSE_EVENTS enabled")
196+
"BUILD_X11" false
197+
"Xinput 2 support requires X11")
198198

199199
# if we build with any GUI support
200200
if(BUILD_X11)
@@ -206,8 +206,8 @@ if(BUILD_WAYLAND)
206206
endif(BUILD_WAYLAND)
207207

208208
dependent_option(BUILD_MOUSE_EVENTS "Enable mouse event support" true
209-
"BUILD_WAYLAND OR OWN_WINDOW" false
210-
"Mouse event support requires Wayland or OWN_WINDOW enabled")
209+
"BUILD_WAYLAND OR BUILD_X11" false
210+
"Mouse event support requires Wayland or X11 enabled")
211211

212212
# Lua library options
213213
option(BUILD_LUA_CAIRO "Build cairo bindings for Lua" false)

cmake_install.cmake

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Install script for directory: /data/code/FOSS/conky
2+
3+
# Set the install prefix
4+
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
5+
set(CMAKE_INSTALL_PREFIX "/usr/local")
6+
endif()
7+
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
8+
9+
# Set the install configuration name.
10+
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
11+
if(BUILD_TYPE)
12+
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
13+
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
14+
else()
15+
set(CMAKE_INSTALL_CONFIG_NAME "RelWithDebInfo")
16+
endif()
17+
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
18+
endif()
19+
20+
# Set the component getting installed.
21+
if(NOT CMAKE_INSTALL_COMPONENT)
22+
if(COMPONENT)
23+
message(STATUS "Install component: \"${COMPONENT}\"")
24+
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
25+
else()
26+
set(CMAKE_INSTALL_COMPONENT)
27+
endif()
28+
endif()
29+
30+
# Install shared libraries without execute permission?
31+
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
32+
set(CMAKE_INSTALL_SO_NO_EXE "0")
33+
endif()
34+
35+
# Is this installation the result of a crosscompile?
36+
if(NOT DEFINED CMAKE_CROSSCOMPILING)
37+
set(CMAKE_CROSSCOMPILING "FALSE")
38+
endif()
39+
40+
# Set default install directory permissions.
41+
if(NOT DEFINED CMAKE_OBJDUMP)
42+
set(CMAKE_OBJDUMP "/usr/bin/objdump")
43+
endif()
44+
45+
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
46+
# Include the install script for the subdirectory.
47+
include("/data/code/FOSS/conky/lua/cmake_install.cmake")
48+
endif()
49+
50+
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
51+
# Include the install script for the subdirectory.
52+
include("/data/code/FOSS/conky/data/cmake_install.cmake")
53+
endif()
54+
55+
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
56+
# Include the install script for the subdirectory.
57+
include("/data/code/FOSS/conky/doc/cmake_install.cmake")
58+
endif()
59+
60+
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
61+
# Include the install script for the subdirectory.
62+
include("/data/code/FOSS/conky/3rdparty/toluapp/cmake_install.cmake")
63+
endif()
64+
65+
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
66+
# Include the install script for the subdirectory.
67+
include("/data/code/FOSS/conky/src/cmake_install.cmake")
68+
endif()
69+
70+
if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
71+
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/share/doc/conky-1.20.1_pre" TYPE FILE FILES
72+
"/data/code/FOSS/conky/extras/convert.lua"
73+
"/data/code/FOSS/conky/data/conky_no_x11.conf"
74+
"/data/code/FOSS/conky/data/conky.conf"
75+
)
76+
endif()
77+
78+
if(CMAKE_INSTALL_COMPONENT)
79+
set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt")
80+
else()
81+
set(CMAKE_INSTALL_MANIFEST "install_manifest.txt")
82+
endif()
83+
84+
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
85+
"${CMAKE_INSTALL_MANIFEST_FILES}")
86+
file(WRITE "/data/code/FOSS/conky/${CMAKE_INSTALL_MANIFEST}"
87+
"${CMAKE_INSTALL_MANIFEST_CONTENT}")

cmake_uninstall.cmake

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#
2+
#Conky, a system monitor, based on torsmo
3+
#
4+
#Please see COPYING for details
5+
#
6+
#Copyright(c) 2005 - 2024 Brenden Matthews, et.al.(see AUTHORS)All rights
7+
#reserved.
8+
#
9+
#This program is free software : you can redistribute it and / or \
10+
modify it under
11+
#the terms of the GNU General Public License as published by the Free Software
12+
#Foundation, either version 3 of the License, or (at your option) any later
13+
#version.
14+
#
15+
#This program is distributed in the hope that it will be useful, but WITHOUT
16+
#ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17+
#FOR A PARTICULAR PURPOSE.See the GNU General Public License for more
18+
#details.You should have received a copy of the GNU General Public License
19+
#along with this program.If not, see < http: // www.gnu.org/licenses/>.
20+
#
21+
22+
if (NOT EXISTS ${CMAKE_BINARY_DIR} / install_manifest.txt)
23+
message(
24+
FATAL_ERROR
25+
"Cannot find install manifest: ${CMAKE_BINARY_DIR}/install_manifest.txt")
26+
endif()
27+
28+
file(READ "${CMAKE_BINARY_DIR}/install_manifest.txt" files) string(
29+
REGEX REPLACE
30+
"\n"
31+
";" files "${files}") foreach (file ${files})
32+
message(STATUS "Uninstalling $ENV{DESTDIR}${file}") if (
33+
IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS
34+
"$ENV{DESTDIR}${file}")
35+
exec_program(
36+
${CMAKE_COMMAND} ARGS
37+
"-E remove \"$ENV{DESTDIR}${file}\"" OUTPUT_VARIABLE rm_out
38+
RETURN_VALUE rm_retval) if (NOT
39+
"${rm_retval}" STREQUAL 0)
40+
message(FATAL_ERROR
41+
"Problem when removing $ENV{DESTDIR}${file}")
42+
endif() else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS
43+
"$ENV{DESTDIR}${file}")
44+
message(STATUS
45+
"File $ENV{DESTDIR}${file} does not exist.")
46+
endif() endforeach()

0 commit comments

Comments
 (0)