Thursday, September 01, 2022

Remove INSTALL_TARGET from security/lastpass-cli

I would like to modernize cmake.port.mk but first I need to get rid of
some spooky cmake anti-pattern.

OK to build install docs by default?

Rafael

Index: Makefile
===================================================================
RCS file: /cvs/ports/security/lastpass-cli/Makefile,v
retrieving revision 1.23
diff -u -p -u -p -r1.23 Makefile
--- Makefile 8 Mar 2022 08:53:52 -0000 1.23
+++ Makefile 1 Sep 2022 09:00:27 -0000
@@ -25,8 +25,6 @@ LIB_DEPENDS = net/curl \
TEST_DEPENDS = ${BUILD_DEPENDS} \
shells/bash

-INSTALL_TARGET = install install-doc
-
do-extract:
mkdir ${WRKSRC} && \
tar -C ${WRKSRC} -zxf ${FULLDISTDIR}/${DISTNAME}.tar.gz
Index: patches/patch-CMakeLists_txt
===================================================================
RCS file: /cvs/ports/security/lastpass-cli/patches/patch-CMakeLists_txt,v
retrieving revision 1.6
diff -u -p -u -p -r1.6 patch-CMakeLists_txt
--- patches/patch-CMakeLists_txt 8 Mar 2022 08:53:52 -0000 1.6
+++ patches/patch-CMakeLists_txt 1 Sep 2022 09:00:27 -0000
@@ -10,3 +10,14 @@ Index: CMakeLists.txt
if(APPLE)
set(PROJECT_FLAGS "${PROJECT_FLAGS} -Wno-deprecated-declarations")
endif()
+@@ -77,8 +77,9 @@ if (CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
+ target_link_libraries(${PROJECT_NAME} "-lkvm")
+ endif (CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
+
+-add_custom_command(OUTPUT lpass.1 DEPENDS ${CMAKE_SOURCE_DIR}/lpass.1.txt
++add_custom_command(TARGET ${PROJECT_NAME} PRE_BUILD DEPENDS ${CMAKE_SOURCE_DIR}/lpass.1.txt
+ COMMAND a2x -D ./ --no-xmllint -f manpage ${CMAKE_SOURCE_DIR}/lpass.1.txt)
++install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lpass.1 DESTINATION ${CMAKE_INSTALL_PREFIX}/man/man1)
+ add_custom_command(OUTPUT lpass.1.html DEPENDS ${CMAKE_SOURCE_DIR}/lpass.1.txt
+ COMMAND asciidoc -b html5 -a data-uri -a icons -a toc2 -o lpass.1.html ${CMAKE_SOURCE_DIR}/lpass.1.txt)
+

No comments:

Post a Comment