Skip to content

Commit

Permalink
devel/libcjson: Improve port
Browse files Browse the repository at this point in the history
* Rework Makefile to follow Porters Handbook more closely
* Fix issues reported by DEVELOPER=yes
* Adjust CMAKE args to be readable and there's no need to list
  every possible option
* Compile to c89 standard as other distros and upstream [1]
* Drop static libs, nothing in tree uses them

1: https://github.com/DaveGamble/cJSON/blob/v1.7.18/CMakeLists.txt#L22
   DaveGamble/cJSON#836

PR:		279133
Approved by:	portmgr (maintainer timeout, 2+ weeks)
  • Loading branch information
Daniel Engberg authored and Daniel Engberg committed Jun 6, 2024
1 parent a0dbbd8 commit 0bed524
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
25 changes: 15 additions & 10 deletions devel/libcjson/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
PORTNAME= libcjson
PORTVERSION= 1.7.18
DISTVERSIONPREFIX= v
DISTVERSION= 1.7.18
PORTREVISION= 1
CATEGORIES= devel

MAINTAINER= [email protected]
Expand All @@ -10,17 +11,21 @@ WWW= https://github.com/DaveGamble/cJSON
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE

USES= cmake:testing compiler:c11 pathfix

CMAKE_OFF= CJSON_OVERRIDE_BUILD_SHARED_LIBS ENABLE_CJSON_TEST ENABLE_CUSTOM_COMPILER_FLAGS ENABLE_HIDDEN_SYMBOLS ENABLE_SAFE_STACK ENABLE_SANITIZERS
CMAKE_ON= BUILD_SHARED_AND_STATIC_LIBS BUILD_SHARED_LIBS CJSON_BUILD_SHARED_LIBS ENABLE_CJSON_UNINSTALL ENABLE_CJSON_UTILS ENABLE_CJSON_VERSION_SO ENABLE_LOCALES ENABLE_PUBLIC_SYMBOLS ENABLE_TARGET_EXPORT
CMAKE_TESTING_ON= ENABLE_CJSON_TEST ENABLE_SAFE_STACK
USE_CSTD= c11

PLIST_SUB= PORTVERSION=${PORTVERSION}
USES= cmake:testing pathfix
USE_LDCONFIG= yes

USE_GITHUB= yes
GH_ACCOUNT= DaveGamble
GH_PROJECT= cJSON
USE_GITHUB= yes

USE_CSTD= c89

PLIST_SUB= DISTVERSION=${DISTVERSION}

CMAKE_TESTING_ON= ENABLE_CJSON_TEST

CMAKE_OFF= ENABLE_CJSON_TEST \
ENABLE_CUSTOM_COMPILER_FLAGS
CMAKE_ON= ENABLE_CJSON_UTILS

.include <bsd.port.mk>
2 changes: 1 addition & 1 deletion devel/libcjson/distinfo
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
TIMESTAMP = 1715842516
TIMESTAMP = 1716050739
SHA256 (DaveGamble-cJSON-v1.7.18_GH0.tar.gz) = 3aa806844a03442c00769b83e99970be70fbef03735ff898f4811dd03b9f5ee5
SIZE (DaveGamble-cJSON-v1.7.18_GH0.tar.gz) = 354726
6 changes: 2 additions & 4 deletions devel/libcjson/pkg-plist
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ lib/cmake/cJSON/cjson-%%CMAKE_BUILD_TYPE%%.cmake
lib/cmake/cJSON/cjson.cmake
lib/cmake/cJSON/cjson_utils-%%CMAKE_BUILD_TYPE%%.cmake
lib/cmake/cJSON/cjson_utils.cmake
lib/libcjson.a
lib/libcjson.so
lib/libcjson.so.1
lib/libcjson.so.%%PORTVERSION%%
lib/libcjson_utils.a
lib/libcjson.so.%%DISTVERSION%%
lib/libcjson_utils.so
lib/libcjson_utils.so.1
lib/libcjson_utils.so.%%PORTVERSION%%
lib/libcjson_utils.so.%%DISTVERSION%%
libdata/pkgconfig/libcjson.pc
libdata/pkgconfig/libcjson_utils.pc

0 comments on commit 0bed524

Please sign in to comment.