Index: head/math/ogdf/Makefile =================================================================== --- head/math/ogdf/Makefile (revision 568006) +++ head/math/ogdf/Makefile (revision 568007) @@ -1,35 +1,32 @@ # Created by: Pietro Cerutti # $FreeBSD$ PORTNAME= ogdf PORTVERSION= 2020.02 CATEGORIES= math MASTER_SITES= https://ogdf.uos.de/wp-content/uploads/2020/02/ DISTNAME= ${PORTNAME}.v${PORTVERSION} MAINTAINER= woodsb02@FreeBSD.org COMMENT= C++ class library for the automatic layout of diagrams LICENSE= GPLv2 GPLv3 LICENSE_COMB= dual LICENSE_FILE_GPLv2= ${WRKSRC}/LICENSE_GPL_v2.txt LICENSE_FILE_GPLv3= ${WRKSRC}/LICENSE_GPL_v3.txt -ONLY_FOR_ARCHS= amd64 i386 -ONLY_FOR_ARCHS_REASON= fails to compile: reports "include/cpuid.h:11:2: this header is for x86 only" - CONFLICTS_INSTALL= CoinMP-[0-9]* USES= cmake compiler:c++11-lang zip USE_LDCONFIG= yes CMAKE_ARGS= -DBUILD_SHARED_LIBS:BOOL=ON \ -DEXAMPLES_INSTALL_DIR:PATH=${EXAMPLESDIR_REL} WRKSRC= ${WRKDIR}/${PORTNAME:tu} OPTIONS_DEFINE= EXAMPLES post-install: @${RMDIR} ${STAGEDIR}${PREFIX}/include/ogdf/lib/minisat/doc .include Index: head/math/ogdf/files/patch-src_ogdf_basic_System.cpp =================================================================== --- head/math/ogdf/files/patch-src_ogdf_basic_System.cpp (revision 568006) +++ head/math/ogdf/files/patch-src_ogdf_basic_System.cpp (revision 568007) @@ -1,77 +1,95 @@ ---- src/ogdf/basic/System.cpp.orig 2015-05-29 15:36:49 UTC +--- src/ogdf/basic/System.cpp.orig 2020-02-09 22:05:19 UTC +++ src/ogdf/basic/System.cpp -@@ -52,6 +52,13 @@ +@@ -56,6 +56,13 @@ #include #include #include +#elif defined(OGDF_SYSTEM_FREEBSD) +#include +#include +#include +#include +#include +#include #elif defined(OGDF_SYSTEM_UNIX) #include #endif -@@ -308,6 +315,40 @@ size_t System::memoryUsedByProcess() +@@ -67,7 +74,7 @@ + # include + # include + #endif +-#ifdef __GNUC__ ++#if defined(__GNUC__) && (defined(__amd64__) || defined(__i386__)) + # include + #endif + +@@ -81,7 +88,7 @@ static inline void cpuid(int CPUInfo[4], int infoType) + uint32_t c = 0; + uint32_t d = 0; + +-# ifdef __GNUC__ ++#if defined(__GNUC__) && (defined(__amd64__) || defined(__i386__)) + __get_cpuid(infoType, &a, &b, &c, &d); + # endif + +@@ -289,6 +296,40 @@ size_t System::memoryUsedByProcess() return 0; } +#elif defined(OGDF_SYSTEM_FREEBSD) + +long long System::physicalMemory() +{ + unsigned long value; + size_t size = sizeof( value ); + if (sysctlbyname("hw.physmem", (void *)&value, &size, NULL, 0) != -1) + return value; + else + return 0; +} + +long long System::availablePhysicalMemory() +{ + int pageSize = getpagesize (); + unsigned long result; + size_t size = sizeof (result); + + if (sysctlbyname("vm.stats.vm.v_free_count", (void *)&result, &size, NULL, 0) != -1) + return result * pageSize; + else + return 0; +} + + +size_t System::memoryUsedByProcess() +{ + struct rusage r; + if (getrusage(RUSAGE_SELF, &r) != -1) + return r.ru_maxrss; + else + return 0; +} + #else // LINUX, NOT MAC OS long long System::physicalMemory() -@@ -389,6 +430,19 @@ size_t System::memoryInFreelistOfMalloc( +@@ -370,6 +411,19 @@ size_t System::memoryInFreelistOfMalloc() { - return mstats().chunks_free; + return mstats().bytes_free; } + +#elif defined(OGDF_SYSTEM_FREEBSD) + +size_t System::memoryAllocatedByMalloc() +{ + return 0; +} + +size_t System::memoryInFreelistOfMalloc() +{ + return 0; +} + #else size_t System::memoryAllocatedByMalloc()