Skip to content

Commit

Permalink
Update man page
Browse files Browse the repository at this point in the history
  • Loading branch information
Sude- committed Jun 4, 2024
1 parent 49692c4 commit b59a49e
Show file tree
Hide file tree
Showing 6 changed files with 818 additions and 184 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
sudo apt -y install ninja-build build-essential libcurl4-openssl-dev libboost-regex-dev \
libjsoncpp-dev librhash-dev libtinyxml2-dev libtidy-dev \
libboost-system-dev libboost-filesystem-dev libboost-program-options-dev \
libboost-date-time-dev libboost-iostreams-dev help2man cmake \
libboost-date-time-dev libboost-iostreams-dev cmake \
pkg-config zlib1g-dev qtwebengine5-dev
- name: Configure
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*.[oa]
bin/*
obj/*
*.1
*.gz
Makefile
CMakeCache.txt
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@ It uses the same API as GOG Galaxy which doesn't have Linux support at the momen
## Make dependencies
* [cmake](https://cmake.org/) >= 3.5.0
* [ninja](https://github.com/ninja-build/ninja)
* [help2man](https://www.gnu.org/software/help2man/help2man.html) (optional, man page generation)

## Debian/Ubuntu

# apt install build-essential libcurl4-openssl-dev libboost-regex-dev \
libjsoncpp-dev librhash-dev libtinyxml2-dev libtidy-dev \
libboost-system-dev libboost-filesystem-dev libboost-program-options-dev \
libboost-date-time-dev libboost-iostreams-dev help2man cmake \
libboost-date-time-dev libboost-iostreams-dev cmake \
pkg-config zlib1g-dev qtwebengine5-dev ninja-build

### Build and install
Expand All @@ -36,7 +35,7 @@ It uses the same API as GOG Galaxy which doesn't have Linux support at the momen
```
sudo dnf install cmake make gcc gcc-c++ glibc tinyxml2-devel rhash-devel \
libtidy-devel tinyxml-devel jsoncpp-devel libcurl-devel \
boost-devel help2man
boost-devel
```
### Build and Install
```
Expand Down
18 changes: 7 additions & 11 deletions man/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
find_program(HELP2MAN help2man DOC "Location of the help2man program")
find_program(GZIP gzip DOC "Location of the gzip program")
mark_as_advanced(HELP2MAN)
mark_as_advanced(GZIP)

include(GNUInstallDirs)

if(HELP2MAN AND GZIP)
set(H2M_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.supplemental.groff")
set(MAN_PAGE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.1")
if(GZIP)
set(MAN_PAGE "${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.1")
set(MAN_FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.1.gz")
add_custom_command(
OUTPUT ${MAN_FILE}
COMMAND ${HELP2MAN} -N -i ${H2M_FILE} -o ${MAN_PAGE} "\"${PROJECT_BINARY_DIR}/${PROJECT_NAME}${CMAKE_EXECUTABLE_SUFFIX}\""
COMMAND ${GZIP} -f -9 ${MAN_PAGE}
MAIN_DEPENDENCY ${H2M_FILE}
COMMAND ${GZIP} -c -9 ${MAN_PAGE} > ${MAN_FILE}
MAIN_DEPENDENCY ${MAN_PAGE}
COMMENT "Building man page"
VERBATIM
)
add_custom_target(manpage ALL DEPENDS ${MAN_FILE} ${PROJECT_NAME})
install(FILES ${MAN_FILE} DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
else(HELP2MAN AND GZIP)
message("WARNING: One of the following is missing: help2man, gzip; man page will not be generated")
endif(HELP2MAN AND GZIP)
else(GZIP)
message("WARNING: One of the following is missing: gzip; man page will not be generated")
endif(GZIP)
Loading

0 comments on commit b59a49e

Please sign in to comment.