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

Require gperf at build-time #1870

Merged
merged 1 commit into from
Apr 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cmake/Conky.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ endif(NOT APP_UNAME)

find_program(APP_GPERF gperf)

if(NOT APP_GPERF)
message(FATAL_ERROR "Unable to find program 'gperf' (required at build-time as of Conky v1.20.2)")
endif(NOT APP_GPERF)

if(NOT RELEASE)
find_program(APP_GIT git)

Expand Down
25 changes: 10 additions & 15 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,16 @@ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/defconfig.h)
endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/defconfig.h)

# Generate colour-names.hh with gperf
if(APP_GPERF)
execute_process(
INPUT_FILE "${CMAKE_SOURCE_DIR}/data/color-names.yml"
OUTPUT_FILE "${CMAKE_BINARY_DIR}/data/color-names.gperf"
COMMAND sh "${CMAKE_SOURCE_DIR}/bin/format-colors.sh"
)
execute_process(
INPUT_FILE "${CMAKE_BINARY_DIR}/data/color-names.gperf"
OUTPUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/colour-names.hh"
COMMAND ${APP_GPERF} --ignore-case -LC++ -Zcolor_name_hash -t -7 -m1 -C -E
)
else(APP_GPERF)
message(WARNING "'gperf' program not found, using stub colour-names.hh; colors names will not be parsed")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/colour-names-stub.hh" "${CMAKE_CURRENT_BINARY_DIR}/colour-names.hh" COPYONLY)
endif(APP_GPERF)
execute_process(
INPUT_FILE "${CMAKE_SOURCE_DIR}/data/color-names.yml"
OUTPUT_FILE "${CMAKE_BINARY_DIR}/data/color-names.gperf"
COMMAND sh "${CMAKE_SOURCE_DIR}/bin/format-colors.sh"
)
execute_process(
INPUT_FILE "${CMAKE_BINARY_DIR}/data/color-names.gperf"
OUTPUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/colour-names.hh"
COMMAND ${APP_GPERF} --ignore-case -LC++ -Zcolor_name_hash -t -7 -m1 -C -E
)

set(conky_sources
${conky_sources}
Expand Down
22 changes: 0 additions & 22 deletions src/colour-names-stub.hh

This file was deleted.