git: a6cd5e6562ba - main - science/arbor: Replace the units bundled lib with external dependency

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Mon, 26 Aug 2024 00:52:35 UTC
The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a6cd5e6562bab547071b08337e0285b81522e227

commit a6cd5e6562bab547071b08337e0285b81522e227
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2024-08-25 22:13:52 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2024-08-26 00:52:24 +0000

    science/arbor: Replace the units bundled lib with external dependency
---
 science/arbor/Makefile                   |  8 ++++++--
 science/arbor/distinfo                   |  4 +---
 science/arbor/files/patch-CMakeLists.txt | 19 +++++++++++++++++++
 science/arbor/pkg-plist                  |  1 -
 4 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/science/arbor/Makefile b/science/arbor/Makefile
index b0d9aeda07ea..b1752bf03828 100644
--- a/science/arbor/Makefile
+++ b/science/arbor/Makefile
@@ -1,6 +1,7 @@
 PORTNAME=	arbor
 DISTVERSIONPREFIX=	v
 DISTVERSION=	0.10.1
+PORTREVISION=	1
 CATEGORIES=	science
 
 MAINTAINER=	yuri@FreeBSD.org
@@ -19,7 +20,8 @@ BUILD_DEPENDS=	bash:shells/bash \
 		${PYTHON_PKGNAMEPREFIX}svgwrite>0:graphics/py-svgwrite@${PY_FLAVOR}
 BUILD_DEPENDS+=	${LOCALBASE}/lib/cmake/GTest/GTestConfig.cmake:devel/googletest # https://github.com/arbor-sim/arbor/issues/2205
 LIB_DEPENDS=	libhwloc.so:devel/hwloc2 \
-		libpugixml.so:textproc/pugixml
+		libpugixml.so:textproc/pugixml \
+		libunits.so:misc/units
 RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}svgwrite>0:graphics/py-svgwrite@${PY_FLAVOR}
 TEST_DEPENDS=	googletest>=0:devel/googletest
 
@@ -27,13 +29,15 @@ USES=		cmake compiler:c++17-lang localbase python shebangfix
 
 USE_GITHUB=	yes
 GH_ACCOUNT=	arbor-sim
-GH_TUPLE=	LLNL:units:7917f5f:units/ext/units
 
 SHEBANG_FILES=	scripts/arbor-build-catalogue
 
 CMAKE_ON=	BUILD_SHARED_LIBS
+CMAKE_OFF=	ARB_USE_BUNDLED_UNITS
 CMAKE_ARGS=	-DPython3_EXECUTABLE=${PYTHON_CMD}
 
+LDFLAGS+=	-L${LOCALBASE}/lib -lunits
+
 OPTIONS_DEFINE=		NATIVE
 
 NATIVE_CMAKE_ON=	-DARB_ARCH=native
diff --git a/science/arbor/distinfo b/science/arbor/distinfo
index 80f2fcad4032..895ebcc91640 100644
--- a/science/arbor/distinfo
+++ b/science/arbor/distinfo
@@ -1,5 +1,3 @@
-TIMESTAMP = 1723264051
+TIMESTAMP = 1724617928
 SHA256 (arbor-sim-arbor-v0.10.1_GH0.tar.gz) = 6a9a209dc20ab6edcf9847a70b0b4dbabf0c0d3c7e6e29b5bec7c00de9d7b8ae
 SIZE (arbor-sim-arbor-v0.10.1_GH0.tar.gz) = 10159032
-SHA256 (LLNL-units-7917f5f_GH0.tar.gz) = 5ea0edf7dfe48185c05f1fd455ef66a483fc5fa6d8586bef4e4b219ef0f3e378
-SIZE (LLNL-units-7917f5f_GH0.tar.gz) = 1878237
diff --git a/science/arbor/files/patch-CMakeLists.txt b/science/arbor/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..b813375ca016
--- /dev/null
+++ b/science/arbor/files/patch-CMakeLists.txt
@@ -0,0 +1,19 @@
+--- CMakeLists.txt.orig	2024-08-09 10:22:00 UTC
++++ CMakeLists.txt
+@@ -40,7 +40,7 @@ check_cxx_compiler_flag("-march=native" CXX_HAS_NATIVE
+ 
+ # Specify target architecture.
+ check_cxx_compiler_flag("-march=native" CXX_HAS_NATIVE)
+-if(CXX_HAS_NATIVE)
++if(FALSE AND CXX_HAS_NATIVE)
+     set(ARB_DEFAULT_ARCH "native")
+ else()
+     set(ARB_DEFAULT_ARCH "none")
+@@ -307,7 +307,6 @@ install(TARGETS ext-units EXPORT arbor-targets)
+ install(TARGETS ext-random123 EXPORT arbor-targets)
+ target_link_libraries(arbor-public-deps INTERFACE ext-units)
+ install(TARGETS ext-units EXPORT arbor-targets)
+-install(TARGETS units compile_flags_target EXPORT arbor-targets)
+ 
+ # Keep track of packages we need to add to the generated CMake config
+ # file for arbor.
diff --git a/science/arbor/pkg-plist b/science/arbor/pkg-plist
index db7fee5f5693..f7844f35709c 100644
--- a/science/arbor/pkg-plist
+++ b/science/arbor/pkg-plist
@@ -121,5 +121,4 @@ lib/cmake/arbor/arbor-targets.cmake
 lib/libarbor.so
 lib/libarborenv.so
 lib/libarborio.so
-lib/libunits.a
 %%DATADIR%%/BuildModules.cmake