Skip to content

Commit

Permalink
devel/argtable3: Improve port
Browse files Browse the repository at this point in the history
- Add CMAKE options for avoid compile not installable files
- Remove obsolete dependency
- Now this port installs static and shared libraries
- Bump PORTREVISION
Reported by:	diizzy
  • Loading branch information
alonsobsd committed Feb 18, 2024
1 parent 39cdd78 commit 4a507bc
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
9 changes: 5 additions & 4 deletions devel/argtable3/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
PORTNAME= argtable3
DISTVERSION= 3.2.2
PORTREVISION= 1
CATEGORIES= devel

MAINTAINER= acm@FreeBSD.org
Expand All @@ -9,14 +10,14 @@ WWW= https://www.argtable.org
LICENSE= BSD3CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE

BUILD_DEPENDS= bash>0:shells/bash

USES= cmake compiler:c++11-lang shebangfix
USES= cmake compiler:c++11-lang
USE_GITHUB= yes
GH_ACCOUNT= argtable
GH_TAGNAME= f319bb66252c6d32a0657c774534ba409567aa62

SHEBANG_FILES= ${WRKSRC}/tools/build
CMAKE_OFF= ARGTABLE3_ENABLE_TESTS \
ARGTABLE3_ENABLE_EXAMPLES
CMAKE_ON= BUILD_SHARED_LIBS

post-patch:
${REINPLACE_CMD} '66d' ${WRKSRC}/tools/build
Expand Down
26 changes: 26 additions & 0 deletions devel/argtable3/files/patch-src_CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
--- src/CMakeLists.txt.orig 2024-02-18 21:34:25 UTC
+++ src/CMakeLists.txt
@@ -73,7 +73,8 @@ if(BUILD_SHARED_LIBS AND WIN32)
add_library(argtable3 ${ARGTABLE3_SRC_FILES} "${PROJECT_BINARY_DIR}/src/version.rc")
target_compile_definitions(argtable3 INTERFACE argtable3_IMPORTS)
else()
- add_library(argtable3 ${ARGTABLE3_SRC_FILES})
+ add_library(argtable3_static STATIC ${ARGTABLE3_SRC_FILES})
+ add_library(argtable3 SHARED ${ARGTABLE3_SRC_FILES})
endif()

add_library(${ARGTABLE3_PROJECT_NAME}::argtable3 ALIAS argtable3)
@@ -94,6 +95,13 @@ elseif(WIN32)
endif()

install(TARGETS argtable3
+ EXPORT ${ARGTABLE3_PACKAGE_NAME}Config
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+)
+
+install(TARGETS argtable3_static
EXPORT ${ARGTABLE3_PACKAGE_NAME}Config
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
3 changes: 3 additions & 0 deletions devel/argtable3/pkg-plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ include/argtable3.h
lib/cmake/argtable3/Argtable3Config-release.cmake
lib/cmake/argtable3/Argtable3Config.cmake
lib/cmake/argtable3/Argtable3ConfigVersion.cmake
lib/libargtable3.so
lib/libargtable3.so.0
lib/libargtable3.so.0.0.0
lib/libargtable3_static.a

0 comments on commit 4a507bc

Please sign in to comment.