From 20666763f064ab476e6d355af06d7a45dadd68fe Mon Sep 17 00:00:00 2001 From: Tomasz Kramkowski Date: Sun, 26 Jun 2022 18:36:48 +0100 Subject: [PATCH] Rewrite polymc.6 in scdoc, build, and install it Co-authored-by: Sefa Eyeoglu Signed-off-by: Tomasz Kramkowski --- CMakeLists.txt | 5 ++- program_info/CMakeLists.txt | 23 ++++++++++++- program_info/polymc.6.scd | 61 +++++++++++++++++++++++++++++++++++ program_info/polymc.6.txt | 64 ------------------------------------- 4 files changed, 87 insertions(+), 66 deletions(-) create mode 100644 program_info/polymc.6.scd delete mode 100644 program_info/polymc.6.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index b09e7fd2..8a4b413e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -238,7 +238,10 @@ elseif(UNIX) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${Launcher_Desktop} DESTINATION ${LAUNCHER_DESKTOP_DEST_DIR}) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${Launcher_MetaInfo} DESTINATION ${LAUNCHER_METAINFO_DEST_DIR}) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${Launcher_SVG} DESTINATION ${LAUNCHER_ICON_DEST_DIR}) - install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${Launcher_ManPage} DESTINATION ${LAUNCHER_MAN_DEST_DIR} RENAME "${Launcher_APP_BINARY_NAME}.6") + + if(Launcher_ManPage) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${Launcher_ManPage} DESTINATION ${LAUNCHER_MAN_DEST_DIR}) + endif() # Install basic runner script if component "portable" is selected configure_file(launcher/Launcher.in "${CMAKE_CURRENT_BINARY_DIR}/LauncherScript" @ONLY) diff --git a/program_info/CMakeLists.txt b/program_info/CMakeLists.txt index 8d835322..b1ba89df 100644 --- a/program_info/CMakeLists.txt +++ b/program_info/CMakeLists.txt @@ -1,3 +1,13 @@ +if(UNIX) + find_package(PkgConfig) + if(PkgConfig_FOUND) + pkg_search_module(SCDOC scdoc) + if(SCDOC_FOUND) + pkg_get_variable(SCDOC_SCDOC scdoc scdoc) + endif() + endif() +endif() + set(Launcher_CommonName "PolyMC") set(Launcher_Copyright "PolyMC Contributors\\n© 2012-2021 MultiMC Contributors") @@ -12,7 +22,6 @@ set(Launcher_DesktopFileName "org.polymc.PolyMC.desktop" PARENT_SCOPE) set(Launcher_Desktop "program_info/org.polymc.PolyMC.desktop" PARENT_SCOPE) set(Launcher_MetaInfo "program_info/org.polymc.PolyMC.metainfo.xml" PARENT_SCOPE) -set(Launcher_ManPage "program_info/polymc.6.txt" PARENT_SCOPE) set(Launcher_SVG "program_info/org.polymc.PolyMC.svg" PARENT_SCOPE) set(Launcher_Branding_ICNS "program_info/polymc.icns" PARENT_SCOPE) set(Launcher_Branding_ICO "program_info/polymc.ico") @@ -28,3 +37,15 @@ configure_file(polymc.rc.in polymc.rc @ONLY) configure_file(polymc.manifest.in polymc.manifest @ONLY) configure_file(polymc.ico polymc.ico COPYONLY) configure_file(win_install.nsi.in win_install.nsi @ONLY) + +if(SCDOC_FOUND) + set(in_scd "${CMAKE_CURRENT_SOURCE_DIR}/polymc.6.scd") + set(out_man "${CMAKE_CURRENT_BINARY_DIR}/polymc.6") + add_custom_command( + DEPENDS "${in_scd}" + OUTPUT "${out_man}" + COMMAND ${SCDOC_SCDOC} < "${in_scd}" > "${out_man}" + ) + add_custom_target(man ALL DEPENDS ${out_man}) + set(Launcher_ManPage "program_info/polymc.6" PARENT_SCOPE) +endif() diff --git a/program_info/polymc.6.scd b/program_info/polymc.6.scd new file mode 100644 index 00000000..f0628cc9 --- /dev/null +++ b/program_info/polymc.6.scd @@ -0,0 +1,61 @@ +polymc(6) + + +# NAME + +polymc - a launcher and instance manager for Minecraft. + + +# SYNOPSIS + +*polymc* [OPTIONS...] + + +# DESCRIPTION + +PolyMC is a custom launcher for Minecraft that allows you to easily manage +multiple installations of Minecraft at once. It also allows you to easily +install and remove mods by simply dragging and dropping. +Here are the current features of PolyMC. + +# OPTIONS + +*-d, --dir*=DIRECTORY + Use DIRECTORY as the PolyMC root. + +*-l, --launch*=INSTANCE_ID + Launch the instance specified by INSTANCE_ID. + +*--alive* + Write a small 'live.check' file after PolyMC starts. + +*-h, --help* + Display help text and exit. + +*-v, --version* + Display program version and exit. + +*-a, --profile*=PROFILE + Use the account specified by PROFILE (only valid in combination with --launch). + +# EXIT STATUS + +*0* + Success + +*1* + Failure (syntax or usage error; configuration error; unexpected error). + +# BUGS + +https://github.com/PolyMC/PolyMC/issues + +# RESOURCES + +GitHub: https://github.com/PolyMC/PolyMC + +Main website: https://polymc.org + +# AUTHORS + +PolyMC Contributors diff --git a/program_info/polymc.6.txt b/program_info/polymc.6.txt deleted file mode 100644 index 8f126cce..00000000 --- a/program_info/polymc.6.txt +++ /dev/null @@ -1,64 +0,0 @@ -POLYMC(1) -========== -:doctype: manpage - - -NAME ----- -polymc - a launcher and instance manager for Minecraft. - - -SYNOPSIS --------- -*polymc* ['OPTIONS'] - - -DESCRIPTION ------------ -PolyMC is a custom launcher for Minecraft that allows you to easily manage -multiple installations of Minecraft at once. It also allows you to easily -install and remove mods by simply dragging and dropping. -Here are the current features of PolyMC. - -OPTIONS -------- -*-d, --dir*='DIRECTORY':: - Use 'DIRECTORY' as the PolyMC root. - -*-l, --launch*='INSTANCE_ID':: - Launch the instance specified by 'INSTANCE_ID'. - -*--alive*:: - Write a small 'live.check' file after PolyMC starts. - -*-h, --help*:: - Display help text and exit. - -*-v, --version*:: - Display program version and exit. -*-a, --profile*='PROFILE':: - Use the account specified by 'PROFILE' (only valid in combination with --launch). - -EXIT STATUS ------------ -*0*:: - Success - -*1*:: - Failure (syntax or usage error; configuration error; unexpected error). - -BUGS ----- - - -RESOURCES ---------- -GitHub: - -Main website: - -AUTHORS -------- -PolyMC Contributors - -// vim: syntax=asciidoc