Update all orthanc ports to the latest version. This includes some
patches from FreeBSD and needs civetweb as a new dependency. Checkout
ports@

I'm not an orthanc user, it was just a graphics/dcmtk rabbit hole challenge.
Test, feedback welcome. Please see graphics/dcmtk and www/civetweb on ports@.

OK?

Index: Makefile.inc
===================================================================
RCS file: /cvs/ports/graphics/orthanc/Makefile.inc,v
retrieving revision 1.7
diff -u -p -r1.7 Makefile.inc
--- Makefile.inc        11 Mar 2022 19:22:58 -0000      1.7
+++ Makefile.inc        4 Jul 2022 18:07:19 -0000
@@ -9,6 +9,9 @@ PERMIT_PACKAGE =        Yes
 
 BUILD_DEPENDS +=       archivers/unzip
 
+FRAMEWORK_VERSION ?=   1.11.1
+FRAMEWORK_DISTFILE ?=  Orthanc-${FRAMEWORK_VERSION}.tar.gz
+
 .if defined(PLUGIN)
 DISTNAME ?=            Orthanc${PLUGIN}-${VERSION}
 PKGNAME ?=             orthanc-plugin-${PLUGIN:L}-${VERSION}
Index: postgresql-plugin/Makefile
===================================================================
RCS file: /cvs/ports/graphics/orthanc/postgresql-plugin/Makefile,v
retrieving revision 1.10
diff -u -p -r1.10 Makefile
--- postgresql-plugin/Makefile  28 May 2022 06:20:01 -0000      1.10
+++ postgresql-plugin/Makefile  4 Jul 2022 18:07:19 -0000
@@ -1,36 +1,49 @@
 COMMENT =              PostgreSQL backend for Orthanc
 
-VERSION =              2.0
+VERSION =              4.0
 PLUGIN =               PostgreSQL
-REVISION =             2
+
+DISTNAME =             Orthanc${PLUGIN}-${VERSION}
+DISTFILES =            ${DISTNAME}${EXTRACT_SUFX}
+EXTRACT_ONLY =         ${DISTNAME}${EXTRACT_SUFX}
+
+DISTFILES +=           ${FRAMEWORK_DISTFILE:C/$/:1/}
+MASTER_SITES1 =                
https://www.orthanc-server.com/downloads/get.php?path=/orthanc/
 
 WANTLIB += ${COMPILER_LIBCXX} boost_atomic-mt boost_chrono-mt
-WANTLIB += boost_date_time-mt boost_filesystem-mt boost_locale-mt
-WANTLIB += boost_regex-mt boost_system-mt boost_thread-mt jsoncpp
-WANTLIB += m pq
+WANTLIB += boost_date_time-mt boost_filesystem-mt boost_iostreams-mt
+WANTLIB += boost_regex-mt boost_system-mt boost_thread-mt crypto
+WANTLIB += jsoncpp m pq ssl uuid z
 
 # __int128, zero-sized arrays (hard failure with base gcc)
 COMPILER =             base-clang ports-clang ports-gcc
 
 MODULES =              lang/python
-MODPY_VERSION =        ${MODPY_DEFAULT_VERSION_2}
+
 MODPY_RUNDEP =         No
 # prevent overrides from the python module
 CONFIGURE_STYLE =      cmake
-       
+
 BUILD_DEPENDS =                databases/postgresql,-server \
                        graphics/orthanc/server
+
 RUN_DEPENDS =          graphics/orthanc/server
+
 LIB_DEPENDS =          databases/postgresql \
                        devel/boost \
-                       devel/jsoncpp
+                       devel/jsoncpp \
+                       sysutils/e2fsprogs
+
+CONFIGURE_ARGS =       -DALLOW_DOWNLOADS=OFF \
+                       -DUSE_SYSTEM_UUID=ON
+
+CONFIGURE_ARGS +=      
-DORTHANC_FRAMEWORK_ROOT="${WRKSRC}/ThirdPartyDownloads/Orthanc-${FRAMEWORK_VERSION}/OrthancFramework/Sources"
 \
+                       -DORTHANC_FRAMEWORK_SOURCE=path
+
+WRKSRC =               ${WRKDIR}/${DISTNAME}/PostgreSQL
 
-CFLAGS=                        -I${LOCALBASE}/include -pthread
-CXXFLAGS=              -I${LOCALBASE}/include -pthread
-MODCMAKE_LDFLAGS=      -L${LOCALBASE}/lib
-
-# XXX: undefined references to testing libs, and requires running postgres
-CONFIGURE_ARGS +=      -DBUILD_UNIT_TESTS=Off
-NO_TEST =              Yes
+post-extract:
+       mkdir ${WRKSRC}/ThirdPartyDownloads/
+       tar -xzf ${DISTDIR}/${FRAMEWORK_DISTFILE} -C 
${WRKSRC}/ThirdPartyDownloads/
 
 .include <bsd.port.mk>
Index: postgresql-plugin/distinfo
===================================================================
RCS file: /cvs/ports/graphics/orthanc/postgresql-plugin/distinfo,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 distinfo
--- postgresql-plugin/distinfo  9 Aug 2017 14:41:54 -0000       1.1.1.1
+++ postgresql-plugin/distinfo  4 Jul 2022 18:07:19 -0000
@@ -1,2 +1,4 @@
-SHA256 (OrthancPostgreSQL-2.0.tar.gz) = 
2e90sBasiejimKtuXpiptIMcGYN34lTCMTCcEvUsN40=
-SIZE (OrthancPostgreSQL-2.0.tar.gz) = 99020
+SHA256 (Orthanc-1.11.1.tar.gz) = pjStyfbdCnTrrrQVZXtfPVGCK0+zR2QdxE87+LW1bbU=
+SHA256 (OrthancPostgreSQL-4.0.tar.gz) = 
pQSe2KXWu4tlKWNs8dn2MdG2H24Lv9xqzK5Fre1CusU=
+SIZE (Orthanc-1.11.1.tar.gz) = 1910916
+SIZE (OrthancPostgreSQL-4.0.tar.gz) = 318047
Index: postgresql-plugin/patches/patch-CMakeLists_txt
===================================================================
RCS file: postgresql-plugin/patches/patch-CMakeLists_txt
diff -N postgresql-plugin/patches/patch-CMakeLists_txt
--- postgresql-plugin/patches/patch-CMakeLists_txt      11 Mar 2022 19:22:59 
-0000      1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,34 +0,0 @@
-Drop version from modules modules.
-https://anonscm.debian.org/viewvc/debian-med/trunk/packages/orthanc-postgresql/trunk/debian/patches/shlibs
-
-Index: CMakeLists.txt
---- CMakeLists.txt.orig
-+++ CMakeLists.txt
-@@ -147,20 +147,17 @@ message("Setting the version of the libraries to ${ORT
- 
- add_definitions(-DORTHANC_POSTGRESQL_VERSION="${ORTHANC_POSTGRESQL_VERSION}")
- 
--set_target_properties(OrthancPostgreSQLStorage PROPERTIES 
--  VERSION ${ORTHANC_POSTGRESQL_VERSION} 
--  SOVERSION ${ORTHANC_POSTGRESQL_VERSION}
--  )
-+set_target_properties(OrthancPostgreSQLStorage PROPERTIES
-+  LINK_FLAGS "-Wl,-soname,libOrthancPostgreSQLStorage.so"
-+  NO_SONAME ON)
-+set_target_properties(OrthancPostgreSQLIndex PROPERTIES
-+  LINK_FLAGS "-Wl,-soname,libOrthancPostgreSQLIndex.so"
-+  NO_SONAME ON)
- 
--set_target_properties(OrthancPostgreSQLIndex PROPERTIES 
--  VERSION ${ORTHANC_POSTGRESQL_VERSION} 
--  SOVERSION ${ORTHANC_POSTGRESQL_VERSION}
--  )
--
- install(
-   TARGETS OrthancPostgreSQLStorage OrthancPostgreSQLIndex
-   RUNTIME DESTINATION lib    # Destination for Windows
--  LIBRARY DESTINATION share/orthanc/plugins    # Destination for Linux
-+  LIBRARY DESTINATION libexec/orthanc/plugins    # Destination for Linux
-   )
- 
- if (BUILD_UNIT_TESTS)
Index: postgresql-plugin/patches/patch-Core_PostgreSQLConnection_cpp
===================================================================
RCS file: postgresql-plugin/patches/patch-Core_PostgreSQLConnection_cpp
diff -N postgresql-plugin/patches/patch-Core_PostgreSQLConnection_cpp
--- postgresql-plugin/patches/patch-Core_PostgreSQLConnection_cpp       11 Mar 
2022 19:22:59 -0000      1.4
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,36 +0,0 @@
-https://bitbucket.org/sjodogne/orthanc-postgresql/commits/11c4f0a4b64711dc8feefb22e8e73c28a639ffcc
-
-Fix build with PostgreSQL 11.
-
-Index: Core/PostgreSQLConnection.cpp
---- Core/PostgreSQLConnection.cpp.orig
-+++ Core/PostgreSQLConnection.cpp
-@@ -30,6 +30,7 @@
- // PostgreSQL includes
- #include <libpq-fe.h>
- #include <c.h>
-+#include <postgresql/server/postgres.h>
- #include <catalog/pg_type.h>
- 
- 
-@@ -79,8 +80,18 @@ namespace OrthancPlugins
-   {
-     if (uri_.empty())
-     {
--      return ("postgresql://" + username_ + ":" + password_ + "@" + 
--              host_ + ":" + boost::lexical_cast<std::string>(port_) + "/" + 
database_);
-+      std::string actualUri = "postgresql://" + username_;
-+      if (!password_.empty())
-+      {
-+        actualUri += ":" + password_;
-+      }
-+      actualUri += "@" + host_;
-+      if (port_ > 0)
-+      {
-+        actualUri += ":" + boost::lexical_cast<std::string>(port_);
-+      }
-+      actualUri += "/" + database_;
-+      return actualUri;
-     }
-     else
-     {
Index: postgresql-plugin/patches/patch-Core_PostgreSQLLargeObject_cpp
===================================================================
RCS file: postgresql-plugin/patches/patch-Core_PostgreSQLLargeObject_cpp
diff -N postgresql-plugin/patches/patch-Core_PostgreSQLLargeObject_cpp
--- postgresql-plugin/patches/patch-Core_PostgreSQLLargeObject_cpp      11 Mar 
2022 19:22:59 -0000      1.3
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,22 +0,0 @@
-https://bitbucket.org/sjodogne/orthanc-postgresql/commits/5ced32a226b1946fdb9cf832373107ae0ae7aa27
-
-Index: Core/PostgreSQLLargeObject.cpp
---- Core/PostgreSQLLargeObject.cpp.orig
-+++ Core/PostgreSQLLargeObject.cpp
-@@ -150,14 +150,14 @@ namespace OrthancPlugins
-       for (size_t position = 0; position < size_; )
-       {
-         size_t remaining = size_ - position;
--        size_t nbytes = lo_read(pg_, fd_, target + position, remaining);
-+        int nbytes = lo_read(pg_, fd_, target + position, remaining);
- 
-         if (nbytes < 0)
-         {
-           throw PostgreSQLException("Unable to read the large object in the 
database");
-         }
- 
--        position += nbytes;
-+        position += (size_t)nbytes;
-       }
-     }
-   };
Index: postgresql-plugin/patches/patch-Core_PostgreSQLResult_cpp
===================================================================
RCS file: postgresql-plugin/patches/patch-Core_PostgreSQLResult_cpp
diff -N postgresql-plugin/patches/patch-Core_PostgreSQLResult_cpp
--- postgresql-plugin/patches/patch-Core_PostgreSQLResult_cpp   11 Mar 2022 
19:22:59 -0000      1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,13 +0,0 @@
-Fix build with PostgreSQL 11.
-
-Index: Core/PostgreSQLResult.cpp
---- Core/PostgreSQLResult.cpp.orig
-+++ Core/PostgreSQLResult.cpp
-@@ -28,6 +28,7 @@
- // PostgreSQL includes
- #include <libpq-fe.h>
- #include <c.h>
-+#include <postgresql/server/postgres.h>
- #include <catalog/pg_type.h>
- 
- #if defined(__FreeBSD__)
Index: postgresql-plugin/patches/patch-Core_PostgreSQLStatement_cpp
===================================================================
RCS file: postgresql-plugin/patches/patch-Core_PostgreSQLStatement_cpp
diff -N postgresql-plugin/patches/patch-Core_PostgreSQLStatement_cpp
--- postgresql-plugin/patches/patch-Core_PostgreSQLStatement_cpp        11 Mar 
2022 19:22:59 -0000      1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,13 +0,0 @@
-Fix build with PostgreSQL 11.
-
-Index: Core/PostgreSQLStatement.cpp
---- Core/PostgreSQLStatement.cpp.orig
-+++ Core/PostgreSQLStatement.cpp
-@@ -28,6 +28,7 @@
- // PostgreSQL includes
- #include <libpq-fe.h>
- #include <c.h>
-+#include <postgresql/server/postgres.h>
- #include <catalog/pg_type.h>
- 
- #if defined(__APPLE__)
Index: postgresql-plugin/patches/patch-PostgreSQL_CMakeLists_txt
===================================================================
RCS file: postgresql-plugin/patches/patch-PostgreSQL_CMakeLists_txt
diff -N postgresql-plugin/patches/patch-PostgreSQL_CMakeLists_txt
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ postgresql-plugin/patches/patch-PostgreSQL_CMakeLists_txt   4 Jul 2022 
18:07:19 -0000
@@ -0,0 +1,44 @@
+Index: PostgreSQL/CMakeLists.txt
+--- PostgreSQL/CMakeLists.txt.orig
++++ PostgreSQL/CMakeLists.txt
+@@ -101,37 +101,17 @@ add_definitions(
+   )
+ 
+ set_target_properties(OrthancPostgreSQLStorage PROPERTIES 
+-  VERSION ${ORTHANC_PLUGIN_VERSION} 
+-  SOVERSION ${ORTHANC_PLUGIN_VERSION}
++  LINK_FLAGS "-Wl,-soname,libOrthancPostgreSQLStorage.so"
+   COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=1
+   )
+ 
+ set_target_properties(OrthancPostgreSQLIndex PROPERTIES 
+-  VERSION ${ORTHANC_PLUGIN_VERSION} 
+-  SOVERSION ${ORTHANC_PLUGIN_VERSION}
++  LINK_FLAGS "-Wl,-soname,libOrthancPostgreSQLIndex.so"
+   COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=1
+   )
+ 
+ install(
+   TARGETS OrthancPostgreSQLIndex OrthancPostgreSQLStorage
+   RUNTIME DESTINATION lib    # Destination for Windows
+-  LIBRARY DESTINATION share/orthanc/plugins    # Destination for Linux
+-  )
+-
+-
+-add_executable(UnitTests
+-  Plugins/PostgreSQLIndex.cpp
+-  Plugins/PostgreSQLStorageArea.cpp
+-  UnitTests/PostgreSQLTests.cpp
+-  UnitTests/UnitTestsMain.cpp
+-  ${DATABASES_SOURCES}
+-  ${GOOGLE_TEST_SOURCES}
+-  ${AUTOGENERATED_SOURCES}
+-  )
+-
+-add_dependencies(UnitTests AutogeneratedTarget)
+-
+-target_link_libraries(UnitTests ${GOOGLE_TEST_LIBRARIES})
+-set_target_properties(UnitTests PROPERTIES
+-  COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=0
++  LIBRARY DESTINATION libexec/orthanc/plugins    # Destination for Linux
+   )
Index: 
postgresql-plugin/patches/patch-PostgreSQL_ThirdPartyDownloads_Orthanc-1_11_1_OrthancFramework_Resources_ThirdParty_minizip_ioapi_h
===================================================================
RCS file: 
postgresql-plugin/patches/patch-PostgreSQL_ThirdPartyDownloads_Orthanc-1_11_1_OrthancFramework_Resources_ThirdParty_minizip_ioapi_h
diff -N 
postgresql-plugin/patches/patch-PostgreSQL_ThirdPartyDownloads_Orthanc-1_11_1_OrthancFramework_Resources_ThirdParty_minizip_ioapi_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ 
postgresql-plugin/patches/patch-PostgreSQL_ThirdPartyDownloads_Orthanc-1_11_1_OrthancFramework_Resources_ThirdParty_minizip_ioapi_h
 4 Jul 2022 18:07:19 -0000
@@ -0,0 +1,12 @@
+Index: 
PostgreSQL/ThirdPartyDownloads/Orthanc-1.11.1/OrthancFramework/Resources/ThirdParty/minizip/ioapi.h
+--- 
PostgreSQL/ThirdPartyDownloads/Orthanc-1.11.1/OrthancFramework/Resources/ThirdParty/minizip/ioapi.h.orig
++++ 
PostgreSQL/ThirdPartyDownloads/Orthanc-1.11.1/OrthancFramework/Resources/ThirdParty/minizip/ioapi.h
+@@ -50,7 +50,7 @@
+ #define ftello64 ftell
+ #define fseeko64 fseek
+ #else
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__OpenBSD__)
+ #define fopen64 fopen
+ #define ftello64 ftello
+ #define fseeko64 fseeko
Index: 
postgresql-plugin/patches/patch-PostgreSQL_ThirdPartyDownloads_Orthanc-1_11_1_OrthancFramework_Sources_SystemToolbox_cpp
===================================================================
RCS file: 
postgresql-plugin/patches/patch-PostgreSQL_ThirdPartyDownloads_Orthanc-1_11_1_OrthancFramework_Sources_SystemToolbox_cpp
diff -N 
postgresql-plugin/patches/patch-PostgreSQL_ThirdPartyDownloads_Orthanc-1_11_1_OrthancFramework_Sources_SystemToolbox_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ 
postgresql-plugin/patches/patch-PostgreSQL_ThirdPartyDownloads_Orthanc-1_11_1_OrthancFramework_Sources_SystemToolbox_cpp
    4 Jul 2022 18:07:19 -0000
@@ -0,0 +1,29 @@
+Index: 
PostgreSQL/ThirdPartyDownloads/Orthanc-1.11.1/OrthancFramework/Sources/SystemToolbox.cpp
+--- 
PostgreSQL/ThirdPartyDownloads/Orthanc-1.11.1/OrthancFramework/Sources/SystemToolbox.cpp.orig
++++ 
PostgreSQL/ThirdPartyDownloads/Orthanc-1.11.1/OrthancFramework/Sources/SystemToolbox.cpp
+@@ -47,14 +47,14 @@
+ #endif
+ 
+ 
+-#if (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD_kernel__) 
|| defined(__FreeBSD__)
++#if (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD_kernel__) 
|| defined(__FreeBSD__) || defined(__OpenBSD__)
+ #  include <net/if_dl.h>     // For GetMacAddresses()
+ #  include <net/if_types.h>  // For GetMacAddresses()
+ #  include <sys/sysctl.h>    // For GetMacAddresses()
+ #endif
+ 
+ 
+-#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
++#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__) 
|| defined(__OpenBSD__)
+ #  include <limits.h>        // PATH_MAX
+ #  include <signal.h>
+ #  include <unistd.h>
+@@ -1095,7 +1095,7 @@ namespace Orthanc
+ 
+       while (!interfaces.IsDone())
+       {
+-#if (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD_kernel__) 
|| defined(__FreeBSD__)
++#if (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD_kernel__) 
|| defined(__FreeBSD__) || defined(__OpenBSD__)
+         int mib[6];
+         mib[0] = CTL_NET;
+         mib[1] = AF_ROUTE;
Index: postgresql-plugin/pkg/PLIST
===================================================================
RCS file: /cvs/ports/graphics/orthanc/postgresql-plugin/pkg/PLIST,v
retrieving revision 1.2
diff -u -p -r1.2 PLIST
--- postgresql-plugin/pkg/PLIST 11 Mar 2022 19:22:59 -0000      1.2
+++ postgresql-plugin/pkg/PLIST 4 Jul 2022 18:07:19 -0000
@@ -1,2 +1,2 @@
-libexec/orthanc/plugins/libOrthancPostgreSQLIndex.so
-libexec/orthanc/plugins/libOrthancPostgreSQLStorage.so
+@so libexec/orthanc/plugins/libOrthancPostgreSQLIndex.so
+@so libexec/orthanc/plugins/libOrthancPostgreSQLStorage.so
Index: server/Makefile
===================================================================
RCS file: /cvs/ports/graphics/orthanc/server/Makefile,v
retrieving revision 1.16
diff -u -p -r1.16 Makefile
--- server/Makefile     28 May 2022 06:20:01 -0000      1.16
+++ server/Makefile     4 Jul 2022 18:07:19 -0000
@@ -1,25 +1,20 @@
 COMMENT =              RESTful DICOM server for healthcare and medical research
 
-DISTNAME =             Orthanc-1.3.0
+DISTNAME =             Orthanc-1.11.1
 PKGNAME =              ${DISTNAME:L}
-REVISION =             7
 
 HOMEPAGE =             https://www.orthanc-server.com/
 
-DISTFILES =            ${DISTNAME}${EXTRACT_SUFX}:0 \
-                       mongoose-3.8.tgz:1
-
-MASTER_SITES0 =                
https://www.orthanc-server.com/downloads/get.php?path=/orthanc/
-MASTER_SITES1 =                
https://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/
+MASTER_SITES =         
https://www.orthanc-server.com/downloads/get.php?path=/orthanc/
 
 WANTLIB += ${COMPILER_LIBCXX} boost_atomic-mt boost_chrono-mt
-WANTLIB += boost_date_time-mt boost_filesystem-mt boost_locale-mt
-WANTLIB += boost_regex-mt boost_system-mt boost_thread-mt c charls
-WANTLIB += charset cmr crypto curl dcmdata dcmdsig dcmfg dcmimage
-WANTLIB += dcmimgle dcmiod dcmjpeg dcmjpls dcmnet dcmpmap dcmpstat
-WANTLIB += dcmqrdb dcmrt dcmseg dcmsr dcmtls dcmtract dcmwlm gtest
-WANTLIB += i2d iconv ijg12 ijg16 ijg8 jpeg jsoncpp lua5.1 m oflog
-WANTLIB += ofstd png pugixml sqlite3 ssl tiff uuid xml2 z
+WANTLIB += boost_date_time-mt boost_filesystem-mt boost_iostreams-mt
+WANTLIB += boost_locale-mt boost_regex-mt boost_system-mt boost_thread-mt
+WANTLIB += c civetweb cmr crypto curl dcmdata dcmdsig dcmect dcmfg
+WANTLIB += dcmimage dcmimgle dcmiod dcmjpeg dcmjpls dcmnet dcmpmap
+WANTLIB += dcmpstat dcmqrdb dcmrt dcmseg dcmsr dcmtkcharls dcmtls
+WANTLIB += dcmtract dcmwlm i2d iconv ijg12 ijg16 ijg8 jpeg jsoncpp
+WANTLIB += lua5.1 m oflog ofstd png pugixml sqlite3 ssl uuid z
 
 # c++11
 COMPILER =             base-clang ports-clang ports-gcc
@@ -27,53 +22,57 @@ COMPILER =          base-clang ports-clang ports
 MODULES =              devel/cmake \
                        lang/lua \
                        lang/python
-MODPY_VERSION =        ${MODPY_DEFAULT_VERSION_2}
 
 MODPY_RUNDEP =         No
 
-BUILD_DEPENDS =                devel/doxygen
+BUILD_DEPENDS =                devel/doxygen \
+                       devel/gtest \
 
 LIB_DEPENDS =          databases/sqlite3 \
                        devel/boost \
-                       devel/gtest \
                        devel/jsoncpp \
-                       graphics/dcmtk>=3.6.2 \
+                       graphics/dcmtk \
                        net/curl \
                        sysutils/e2fsprogs \
-                       textproc/pugixml
+                       textproc/pugixml \
+                       www/civetweb
 
-CONFIGURE_ARGS +=      -DUSE_SYSTEM_MONGOOSE=Off \
-                       -DORTHANC_BUILD_UNIT_TESTS=Off
+TEST_DEPENDS =         devel/gtest
 
-# override these as otherwise the tests from Compiler.cmake won't pick them up 
yet
-CFLAGS=                        -I${LOCALBASE}/include -pthread
-CXXFLAGS=              -I${LOCALBASE}/include -pthread
-MODCMAKE_LDFLAGS=      -L${LOCALBASE}/lib -luuid
+CONFIGURE_ARGS +=      -DUSE_SYSTEM_BOOST=ON \
+                       -DUSE_SYSTEM_CIVETWEB=ON \
+                       -DUSE_SYSTEM_DCMTK=ON \
+                       -DUSE_SYSTEM_GOOGLE_TEST=ON \
+                       -DUSE_SYSTEM_JSONCPP=ON \
+                       -DUSE_SYSTEM_LIBICONV=ON \
+                       -DUSE_SYSTEM_LIBJPEG=ON \
+                       -DUSE_SYSTEM_LIBPNG=ON \
+                       -DUSE_SYSTEM_LUA=ON \
+                       -DUSE_SYSTEM_OPENSSL=ON \
+                       -DUSE_SYSTEM_PUGIXML=ON \
+                       -DUSE_SYSTEM_SQLITE=ON \
+                       -DUSE_SYSTEM_UUID=ON \
+                       -DUSE_SYSTEM_ZLIB=ON
+
+CONFIGURE_ARGS +=      -DBUILD_CONNECTIVITY_CHECKS=OFF \
+                       -DBUILD_DELAYED_DELETION=OFF \
+                       -DUNIT_TESTS_WITH_HTTP_CONNEXIONS=OFF
 
-# CMAKE_COMPILER_IS_GNUCXX isn't set for clang as we invoke the compiler
-# as 'c++' and not 'clang++' (ref: CMakeDetermineCXXCompiler.cmake)
-CONFIGURE_ARGS +=      -DCMAKE_COMPILER_IS_GNUCXX=Yes
 
-SUBST_VARS +=          VARBASE
-
-FIX_CRLF_FILES =       CMakeLists.txt
-
-# Drop mongoose 3.8 inplace:
-# https://www.mail-archive.com/mongoose-users@googlegroups.com/msg00625.html
-post-extract:
-       mkdir ${WRKSRC}/ThirdPartyDownloads/
-       cp ${DISTDIR}/mongoose-3.8.tgz ${WRKSRC}/ThirdPartyDownloads/
+WRKSRC =               ${WRKDIR}/${DISTNAME}/OrthancServer
 
 pre-configure:
        sed -i 's,share/orthanc/plugins,libexec/orthanc/plugins,g' \
                ${WRKSRC}/CMakeLists.txt \
                ${WRKSRC}/Plugins/Samples/ModalityWorklists/CMakeLists.txt \
                ${WRKSRC}/Plugins/Samples/ServeFolders/CMakeLists.txt
-       ${SUBST_CMD} ${WRKSRC}/Resources/CMake/Compiler.cmake
 
 post-install:
        ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/orthanc/
        ${SUBST_CMD} -c ${WRKSRC}/Resources/Configuration.json \
                ${PREFIX}/share/examples/orthanc/Configuration.json
+
+do-test:
+       cd ${WRKBUILD} && ./UnitTests
 
 .include <bsd.port.mk>
Index: server/distinfo
===================================================================
RCS file: /cvs/ports/graphics/orthanc/server/distinfo,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 distinfo
--- server/distinfo     9 Aug 2017 14:39:32 -0000       1.1.1.1
+++ server/distinfo     4 Jul 2022 18:07:19 -0000
@@ -1,4 +1,2 @@
-SHA256 (Orthanc-1.3.0.tar.gz) = pos8P9qOpc0GXTVrMUc3Y02AiNarI4DJzPpDPMj+Yd4=
-SHA256 (mongoose-3.8.tgz) = avwsN3YUoBokt4Vgpi0TFrKTcq/gjq43FbVsh3vnHG4=
-SIZE (Orthanc-1.3.0.tar.gz) = 1231636
-SIZE (mongoose-3.8.tgz) = 1577314
+SHA256 (Orthanc-1.11.1.tar.gz) = pjStyfbdCnTrrrQVZXtfPVGCK0+zR2QdxE87+LW1bbU=
+SIZE (Orthanc-1.11.1.tar.gz) = 1910916
Index: server/patches/patch-CMakeLists_txt
===================================================================
RCS file: server/patches/patch-CMakeLists_txt
diff -N server/patches/patch-CMakeLists_txt
--- server/patches/patch-CMakeLists_txt 11 Mar 2022 19:22:59 -0000      1.3
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,94 +0,0 @@
-- Forcibly disable tests which fail to compile at this time.
-- Install plugins in a more appropriate location
-
-Index: CMakeLists.txt
---- CMakeLists.txt.orig
-+++ CMakeLists.txt
-@@ -250,16 +250,12 @@ if (ENABLE_PLUGINS)
-     Plugins/Engine/SharedLibrary.cpp
-     )
- 
--  list(APPEND ORTHANC_UNIT_TESTS_SOURCES
--    UnitTestsSources/PluginsTests.cpp
--    )
- endif()
- 
- 
- set(ORTHANC_ALL_SOURCES
-   ${ORTHANC_CORE_SOURCES}
-   ${ORTHANC_SERVER_SOURCES}
--  ${ORTHANC_UNIT_TESTS_SOURCES}
-   Plugins/Samples/ServeFolders/Plugin.cpp
-   Plugins/Samples/ModalityWorklists/Plugin.cpp
-   OrthancServer/main.cpp
-@@ -410,7 +406,7 @@ include_directories(${CMAKE_SOURCE_DIR}/Plugins/Includ
- add_definitions(
-   -DORTHANC_VERSION="${ORTHANC_VERSION}"
-   -DORTHANC_DATABASE_VERSION=${ORTHANC_DATABASE_VERSION}
--  -DORTHANC_BUILD_UNIT_TESTS=1
-+  -DORTHANC_BUILD_UNIT_TESTS=0
-   -DORTHANC_ENABLE_BASE64=1
-   -DORTHANC_ENABLE_LOGGING=1
-   -DORTHANC_ENABLE_LOGGING_PLUGIN=0
-@@ -519,6 +515,7 @@ install(
- #####################################################################
- ## Build the unit tests
- #####################################################################
-+if (ORTHANC_BUILD_UNIT_TESTS)
- 
- add_executable(UnitTests
-   ${GTEST_SOURCES}
-@@ -530,6 +527,7 @@ target_link_libraries(UnitTests ServerLibrary CoreLibr
- if (${OPENSSL_SOURCES_LENGTH} GREATER 0)
-   target_link_libraries(UnitTests OpenSSL)
- endif()
-+endif()
- 
- 
- 
-@@ -562,16 +560,16 @@ if (ENABLE_PLUGINS AND BUILD_SERVE_FOLDERS)
-     ${SERVE_FOLDERS_RESOURCES}
-     )
- 
--  set_target_properties(
--    ServeFolders PROPERTIES 
--    VERSION ${ORTHANC_VERSION} 
--    SOVERSION ${ORTHANC_VERSION}
--    )
-+  set_target_properties(
-+    ServeFolders PROPERTIES
-+    LINK_FLAGS "-Wl,-soname,libServeFolders.so"
-+    NO_SONAME ON
-+  )
- 
-   install(
-     TARGETS ServeFolders
-     RUNTIME DESTINATION lib    # Destination for Windows
--    LIBRARY DESTINATION share/orthanc/plugins    # Destination for Linux
-+    LIBRARY DESTINATION libexec/orthanc/plugins    # Destination for Linux
-     )
- endif()
- 
-@@ -606,16 +604,16 @@ if (ENABLE_PLUGINS AND BUILD_MODALITY_WORKLISTS)
-     ${MODALITY_WORKLISTS_RESOURCES}
-     )
- 
--  set_target_properties(
--    ModalityWorklists PROPERTIES 
--    VERSION ${ORTHANC_VERSION} 
--    SOVERSION ${ORTHANC_VERSION}
--    )
-+  set_target_properties(
-+    ModalityWorklists PROPERTIES
-+    LINK_FLAGS "-Wl,-soname,libModalityWorklists.so"
-+    NO_SONAME ON
-+  )
- 
-   install(
-     TARGETS ModalityWorklists
-     RUNTIME DESTINATION lib    # Destination for Windows
--    LIBRARY DESTINATION share/orthanc/plugins    # Destination for Linux
-+    LIBRARY DESTINATION libexec/orthanc/plugins    # Destination for Linux
-     )
- endif()
- 
Index: server/patches/patch-Core_MultiThreading_Mutex_cpp
===================================================================
RCS file: server/patches/patch-Core_MultiThreading_Mutex_cpp
diff -N server/patches/patch-Core_MultiThreading_Mutex_cpp
--- server/patches/patch-Core_MultiThreading_Mutex_cpp  11 Mar 2022 19:22:59 
-0000      1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,23 +0,0 @@
-Index: Core/MultiThreading/Mutex.cpp
---- Core/MultiThreading/Mutex.cpp.orig
-+++ Core/MultiThreading/Mutex.cpp
-@@ -38,7 +38,8 @@
- 
- #if defined(_WIN32)
- #include <windows.h>
--#elif defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__APPLE__) 
|| defined(__FreeBSD__)
-+#elif defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__APPLE__) 
|| \
-+      defined(__FreeBSD__) || defined(__OpenBSD__)
- #include <pthread.h>
- #else
- #error Support your platform here
-@@ -76,7 +77,8 @@ namespace Orthanc
-   }
- 
- 
--#elif defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__APPLE__) 
|| defined(__FreeBSD__)
-+#elif defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__APPLE__) 
|| \
-+      defined(__FreeBSD__) || defined(__OpenBSD__)
- 
-   struct Mutex::PImpl
-   {
Index: server/patches/patch-Core_SystemToolbox_cpp
===================================================================
RCS file: server/patches/patch-Core_SystemToolbox_cpp
diff -N server/patches/patch-Core_SystemToolbox_cpp
--- server/patches/patch-Core_SystemToolbox_cpp 11 Mar 2022 19:22:59 -0000      
1.3
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,60 +0,0 @@
-Implement GetPathToExecutableInternal()
-
-Index: Core/SystemToolbox.cpp
---- Core/SystemToolbox.cpp.orig
-+++ Core/SystemToolbox.cpp
-@@ -55,12 +55,16 @@
- #endif
- 
- 
--#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
-+#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__) 
|| \
-+      defined(__OpenBSD__)
- #  include <limits.h>      /* PATH_MAX */
- #  include <signal.h>
- #  include <unistd.h>
- #endif
- 
-+#if defined(__OpenBSD__)
-+#  include <sys/sysctl.h>
-+#endif
- 
- // Inclusions for UUID
- // http://stackoverflow.com/a/1626302
-@@ -157,7 +161,8 @@ namespace Orthanc
-   {
- #if defined(_WIN32)
-     ::Sleep(static_cast<DWORD>(microSeconds / static_cast<uint64_t>(1000)));
--#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD_kernel__) 
|| defined(__FreeBSD__) || defined(__native_client__)
-+#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD_kernel__) 
|| \
-+  defined(__FreeBSD__) || defined(__native_client__) || defined(__OpenBSD__)
-     usleep(microSeconds);
- #else
- #error Support your platform here
-@@ -370,6 +375,26 @@ namespace Orthanc
-     return std::string(pathbuf);
-   }
- 
-+#elif defined(__OpenBSD__)
-+  static std::string GetPathToExecutableInternal()
-+  {
-+    size_t len;
-+    char **args;
-+    int mib[] = { CTL_KERN, KERN_PROC_ARGS, getpid(), KERN_PROC_ARGV };
-+
-+    if (sysctl(mib, 4, NULL, &len, NULL, 0) == -1) {
-+      throw OrthancException(ErrorCode_PathToExecutable);
-+    }
-+
-+    args = (char **)malloc(len);
-+
-+    if (sysctl(mib, 4, args, &len, NULL, 0) == -1) {
-+      free(args);
-+      throw OrthancException(ErrorCode_PathToExecutable);
-+    }
-+
-+    return std::string(args[0]);
-+  }
- #else
- #error Support your platform here
- #endif
Index: server/patches/patch-Core_Toolbox_cpp
===================================================================
RCS file: server/patches/patch-Core_Toolbox_cpp
diff -N server/patches/patch-Core_Toolbox_cpp
--- server/patches/patch-Core_Toolbox_cpp       11 Mar 2022 19:22:59 -0000      
1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,22 +0,0 @@
-Fix issue #114
-
-f49a6d934fd51dd57a8e91db45e36f77371b4042
-
-Index: Core/Toolbox.cpp
---- Core/Toolbox.cpp.orig
-+++ Core/Toolbox.cpp
-@@ -41,8 +41,13 @@
- #include <boost/algorithm/string/replace.hpp>
- #include <boost/lexical_cast.hpp>
- #include <boost/locale.hpp>
--#include <boost/uuid/sha1.hpp>
-  
-+#if BOOST_VERSION >= 106600
-+#  include <boost/uuid/detail/sha1.hpp>
-+#else
-+#  include <boost/uuid/sha1.hpp>
-+#endif
-+
- #include <string>
- #include <stdint.h>
- #include <string.h>
Index: 
server/patches/patch-OrthancFramework_Resources_CMake_CivetwebConfiguration_cmake
===================================================================
RCS file: 
server/patches/patch-OrthancFramework_Resources_CMake_CivetwebConfiguration_cmake
diff -N 
server/patches/patch-OrthancFramework_Resources_CMake_CivetwebConfiguration_cmake
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ 
server/patches/patch-OrthancFramework_Resources_CMake_CivetwebConfiguration_cmake
   4 Jul 2022 18:07:19 -0000
@@ -0,0 +1,61 @@
+Index: OrthancFramework/Resources/CMake/CivetwebConfiguration.cmake
+--- OrthancFramework/Resources/CMake/CivetwebConfiguration.cmake.orig
++++ OrthancFramework/Resources/CMake/CivetwebConfiguration.cmake
+@@ -110,32 +110,34 @@ else()
+ 
+   cmake_reset_check_state()
+   set(CMAKE_REQUIRED_LIBRARIES dl pthread)
+-  CHECK_LIBRARY_EXISTS(civetweb mg_start "" HAVE_CIVETWEB_LIB)
+-  if (NOT HAVE_CIVETWEB_LIB)
+-    message(FATAL_ERROR "Please install the libcivetweb-dev package")
+-  endif()
+ 
+-  link_libraries(civetweb)
++  find_library(CIVETWEB_LIB NAMES civetweb PATHS
++    /usr/lib
++    /usr/local/lib
++  )
+ 
+-  # Check whether the system distribution of civetweb contains the
+-  # patch "../Patches/civetweb-1.13.patch" that allows to disable
+-  # keep-alive on selected HTTP connections. This is useful to speed
+-  # up multipart transfers, as encountered in DICOMweb.
+-  CHECK_LIBRARY_EXISTS(civetweb mg_disable_keep_alive "" 
CIVETWEB_HAS_DISABLE_KEEP_ALIVE_1)  # From "../Patches/civetweb-1.13.patch"
+-  CHECK_LIBRARY_EXISTS(civetweb mg_disable_connection_keep_alive "" 
CIVETWEB_HAS_DISABLE_KEEP_ALIVE_2)  # From civetweb >= 1.14
+-  if (CIVETWEB_HAS_DISABLE_KEEP_ALIVE_1 OR
+-      CIVETWEB_HAS_DISABLE_KEEP_ALIVE_2)
+-    add_definitions(
+-      -DCIVETWEB_HAS_DISABLE_KEEP_ALIVE=1
+-      -DCIVETWEB_HAS_WEBDAV_WRITING=1
+-      )
+-    message("Performance: Your system-wide distribution of civetweb is 
configured for best performance")
++  if (CIVETWEB_LIB)
++
++    CHECK_LIBRARY_EXISTS(${CIVETWEB_LIB} mg_disable_connection_keep_alive "" 
CIVETWEB_HAS_DISABLE_KEEP_ALIVE)
++    if (CIVETWEB_HAS_DISABLE_KEEP_ALIVE)
++      add_definitions(
++        -DCIVETWEB_HAS_DISABLE_KEEP_ALIVE=1
++        -DCIVETWEB_HAS_WEBDAV_WRITING=1
++        )
++      message("Performance: Your system-wide distribution of civetweb is 
configured for best performance")
++    else()
++      message(WARNING "Performance: Your system-wide distribution of civetweb 
does not feature the mg_disable_connection_keep_alive() function, and WebDAV 
will only be available for read-only access")
++      add_definitions(
++        -DCIVETWEB_HAS_DISABLE_KEEP_ALIVE=0
++        -DCIVETWEB_HAS_WEBDAV_WRITING=0
++        )
++    endif()
++
++    get_filename_component(CIVETWEB_LIB_PATH ${CIVETWEB_LIB} DIRECTORY)
++    link_directories(${CIVETWEB_LIB_PATH})
++    link_libraries(civetweb)
+   else()
+-    message(WARNING "Performance: Your system-wide distribution of civetweb 
does not feature the mg_disable_keep_alive() function, and WebDAV will only be 
available for read-only access")
+-    add_definitions(
+-      -DCIVETWEB_HAS_DISABLE_KEEP_ALIVE=0
+-      -DCIVETWEB_HAS_WEBDAV_WRITING=0
+-      )
++    message(FATAL_ERROR "Unable to find the civetweb library")
+   endif()
+ 
+   unset(CMAKE_REQUIRED_LIBRARIES)  # This reset must be after 
"CHECK_LIBRARY_EXISTS"
Index: 
server/patches/patch-OrthancFramework_Resources_CMake_LibIconvConfiguration_cmake
===================================================================
RCS file: 
server/patches/patch-OrthancFramework_Resources_CMake_LibIconvConfiguration_cmake
diff -N 
server/patches/patch-OrthancFramework_Resources_CMake_LibIconvConfiguration_cmake
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ 
server/patches/patch-OrthancFramework_Resources_CMake_LibIconvConfiguration_cmake
   4 Jul 2022 18:07:19 -0000
@@ -0,0 +1,20 @@
+Index: OrthancFramework/Resources/CMake/LibIconvConfiguration.cmake
+--- OrthancFramework/Resources/CMake/LibIconvConfiguration.cmake.orig
++++ OrthancFramework/Resources/CMake/LibIconvConfiguration.cmake
+@@ -97,15 +97,10 @@ else() 
+ 
+   # Check whether the support for libiconv is bundled within the
+   # standard C library
+-  CHECK_FUNCTION_EXISTS(iconv_open HAVE_ICONV_LIB)
++  CHECK_FUNCTION_EXISTS(libiconv_open HAVE_ICONV_LIB)
+   if (NOT HAVE_ICONV_LIB)
+     # No builtin support for libiconv, try and find an external library.
+     # Open question: Does this make sense on any platform?
+-    CHECK_LIBRARY_EXISTS(iconv iconv_open "" HAVE_ICONV_LIB_2)
+-    if (NOT HAVE_ICONV_LIB_2)
+-      message(FATAL_ERROR "Please install the libiconv-dev package")
+-    else()
+       link_libraries(iconv)
+-    endif()
+   endif()
+ endif()
Index: 
server/patches/patch-OrthancFramework_Resources_ThirdParty_minizip_ioapi_h
===================================================================
RCS file: 
server/patches/patch-OrthancFramework_Resources_ThirdParty_minizip_ioapi_h
diff -N 
server/patches/patch-OrthancFramework_Resources_ThirdParty_minizip_ioapi_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ server/patches/patch-OrthancFramework_Resources_ThirdParty_minizip_ioapi_h  
4 Jul 2022 18:07:19 -0000
@@ -0,0 +1,12 @@
+Index: OrthancFramework/Resources/ThirdParty/minizip/ioapi.h
+--- OrthancFramework/Resources/ThirdParty/minizip/ioapi.h.orig
++++ OrthancFramework/Resources/ThirdParty/minizip/ioapi.h
+@@ -50,7 +50,7 @@
+ #define ftello64 ftell
+ #define fseeko64 fseek
+ #else
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__OpenBSD__)
+ #define fopen64 fopen
+ #define ftello64 ftello
+ #define fseeko64 fseeko
Index: server/patches/patch-OrthancFramework_Sources_SystemToolbox_cpp
===================================================================
RCS file: server/patches/patch-OrthancFramework_Sources_SystemToolbox_cpp
diff -N server/patches/patch-OrthancFramework_Sources_SystemToolbox_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ server/patches/patch-OrthancFramework_Sources_SystemToolbox_cpp     4 Jul 
2022 18:07:19 -0000
@@ -0,0 +1,29 @@
+Index: OrthancFramework/Sources/SystemToolbox.cpp
+--- OrthancFramework/Sources/SystemToolbox.cpp.orig
++++ OrthancFramework/Sources/SystemToolbox.cpp
+@@ -47,14 +47,14 @@
+ #endif
+ 
+ 
+-#if (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD_kernel__) 
|| defined(__FreeBSD__)
++#if (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD_kernel__) 
|| defined(__FreeBSD__) || defined(__OpenBSD__)
+ #  include <net/if_dl.h>     // For GetMacAddresses()
+ #  include <net/if_types.h>  // For GetMacAddresses()
+ #  include <sys/sysctl.h>    // For GetMacAddresses()
+ #endif
+ 
+ 
+-#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
++#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__) 
|| defined(__OpenBSD__)
+ #  include <limits.h>        // PATH_MAX
+ #  include <signal.h>
+ #  include <unistd.h>
+@@ -1095,7 +1095,7 @@ namespace Orthanc
+ 
+       while (!interfaces.IsDone())
+       {
+-#if (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD_kernel__) 
|| defined(__FreeBSD__)
++#if (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD_kernel__) 
|| defined(__FreeBSD__) || defined(__OpenBSD__)
+         int mib[6];
+         mib[0] = CTL_NET;
+         mib[1] = AF_ROUTE;
Index: server/patches/patch-OrthancServer_CMakeLists_txt
===================================================================
RCS file: server/patches/patch-OrthancServer_CMakeLists_txt
diff -N server/patches/patch-OrthancServer_CMakeLists_txt
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ server/patches/patch-OrthancServer_CMakeLists_txt   4 Jul 2022 18:07:19 
-0000
@@ -0,0 +1,33 @@
+Index: OrthancServer/CMakeLists.txt
+--- OrthancServer/CMakeLists.txt.orig
++++ OrthancServer/CMakeLists.txt
+@@ -482,8 +482,7 @@ if (ENABLE_PLUGINS AND BUILD_SERVE_FOLDERS)
+ 
+   set_target_properties(
+     ServeFolders PROPERTIES 
+-    VERSION ${ORTHANC_VERSION} 
+-    SOVERSION ${ORTHANC_VERSION}
++    LINK_FLAGS "-Wl,-soname,libServeFolders.so"
+     )
+ 
+   install(
+@@ -525,8 +524,7 @@ if (ENABLE_PLUGINS AND BUILD_MODALITY_WORKLISTS)
+ 
+   set_target_properties(
+     ModalityWorklists PROPERTIES 
+-    VERSION ${ORTHANC_VERSION} 
+-    SOVERSION ${ORTHANC_VERSION}
++    LINK_FLAGS "-Wl,-soname,libModalityWorklists.so"
+     )
+ 
+   install(
+@@ -715,8 +713,7 @@ if (ENABLE_PLUGINS AND BUILD_HOUSEKEEPER)
+   
+   set_target_properties(
+     Housekeeper PROPERTIES 
+-    VERSION ${ORTHANC_VERSION} 
+-    SOVERSION ${ORTHANC_VERSION}
++    LINK_FLAGS "-Wl,-soname,libHousekeeper.so"
+     )
+   
+   install(
Index: server/patches/patch-OrthancServer_FromDcmtkBridge_cpp
===================================================================
RCS file: server/patches/patch-OrthancServer_FromDcmtkBridge_cpp
diff -N server/patches/patch-OrthancServer_FromDcmtkBridge_cpp
--- server/patches/patch-OrthancServer_FromDcmtkBridge_cpp      11 Mar 2022 
19:22:59 -0000      1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,13 +0,0 @@
-Index: OrthancServer/FromDcmtkBridge.cpp
---- OrthancServer/FromDcmtkBridge.cpp.orig
-+++ OrthancServer/FromDcmtkBridge.cpp
-@@ -209,7 +209,8 @@ namespace Orthanc
-         LOG(INFO) << "The dictionary of private tags has not been loaded";
-       }
- 
--#elif defined(__linux__) || defined(__FreeBSD_kernel__) || 
defined(__FreeBSD__)
-+#elif defined(__linux__) || defined(__FreeBSD_kernel__) || 
defined(__FreeBSD__) || \
-+      defined(__OpenBSD__)
-       std::string path = DCMTK_DICTIONARY_DIR;
- 
-       const char* env = std::getenv(DCM_DICT_ENVIRONMENT_VARIABLE);
Index: 
server/patches/patch-OrthancServer_Plugins_Samples_ModalityWorklists_CMakeLists_txt
===================================================================
RCS file: 
server/patches/patch-OrthancServer_Plugins_Samples_ModalityWorklists_CMakeLists_txt
diff -N 
server/patches/patch-OrthancServer_Plugins_Samples_ModalityWorklists_CMakeLists_txt
Index: 
server/patches/patch-OrthancServer_Plugins_Samples_ServeFolders_CMakeLists_txt
===================================================================
RCS file: 
server/patches/patch-OrthancServer_Plugins_Samples_ServeFolders_CMakeLists_txt
diff -N 
server/patches/patch-OrthancServer_Plugins_Samples_ServeFolders_CMakeLists_txt
Index: server/patches/patch-Plugins_Engine_PluginsManager_cpp
===================================================================
RCS file: server/patches/patch-Plugins_Engine_PluginsManager_cpp
diff -N server/patches/patch-Plugins_Engine_PluginsManager_cpp
--- server/patches/patch-Plugins_Engine_PluginsManager_cpp      11 Mar 2022 
19:22:59 -0000      1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,13 +0,0 @@
-Index: Plugins/Engine/PluginsManager.cpp
---- Plugins/Engine/PluginsManager.cpp.orig
-+++ Plugins/Engine/PluginsManager.cpp
-@@ -49,7 +49,8 @@
- 
- #ifdef WIN32
- #define PLUGIN_EXTENSION ".dll"
--#elif defined(__linux__) || defined(__FreeBSD_kernel__) || 
defined(__FreeBSD__)
-+#elif defined(__linux__) || defined(__FreeBSD_kernel__) || 
defined(__FreeBSD__) || \
-+      defined(__OpenBSD__)
- #define PLUGIN_EXTENSION ".so"
- #elif defined(__APPLE__) && defined(__MACH__)
- #define PLUGIN_EXTENSION ".dylib"
Index: server/patches/patch-Plugins_Engine_SharedLibrary_cpp
===================================================================
RCS file: server/patches/patch-Plugins_Engine_SharedLibrary_cpp
diff -N server/patches/patch-Plugins_Engine_SharedLibrary_cpp
--- server/patches/patch-Plugins_Engine_SharedLibrary_cpp       11 Mar 2022 
19:22:59 -0000      1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,43 +0,0 @@
-Index: Plugins/Engine/SharedLibrary.cpp
---- Plugins/Engine/SharedLibrary.cpp.orig
-+++ Plugins/Engine/SharedLibrary.cpp
-@@ -46,7 +46,8 @@
- 
- #if defined(_WIN32)
- #include <windows.h>
--#elif defined(__linux__) || (defined(__APPLE__) && defined(__MACH__)) || 
defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
-+#elif defined(__linux__) || (defined(__APPLE__) && defined(__MACH__)) || \
-+      defined(__FreeBSD_kernel__) || defined(__FreeBSD__) || 
defined(__OpenBSD__)
- #include <dlfcn.h>
- #else
- #error Support your platform here
-@@ -66,7 +67,8 @@ namespace Orthanc
-       throw OrthancException(ErrorCode_SharedLibrary);
-     }
- 
--#elif defined(__linux__) || (defined(__APPLE__) && defined(__MACH__)) || 
defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
-+#elif defined(__linux__) || (defined(__APPLE__) && defined(__MACH__)) || \
-+      defined(__FreeBSD_kernel__) || defined(__FreeBSD__) || 
defined(__OpenBSD__)
-     handle_ = ::dlopen(path_.c_str(), RTLD_NOW);
-     if (handle_ == NULL) 
-     {
-@@ -92,7 +94,8 @@ namespace Orthanc
-     {
- #if defined(_WIN32)
-       ::FreeLibrary((HMODULE)handle_);
--#elif defined(__linux__) || (defined(__APPLE__) && defined(__MACH__)) || 
defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
-+#elif defined(__linux__) || (defined(__APPLE__) && defined(__MACH__)) || \
-+      defined(__FreeBSD_kernel__) || defined(__FreeBSD__) || 
defined(__OpenBSD__)
-       ::dlclose(handle_);
- #else
- #error Support your platform here
-@@ -110,7 +113,8 @@ namespace Orthanc
- 
- #if defined(_WIN32)
-     return ::GetProcAddress((HMODULE)handle_, name.c_str());
--#elif defined(__linux__) || (defined(__APPLE__) && defined(__MACH__)) || 
defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
-+#elif defined(__linux__) || (defined(__APPLE__) && defined(__MACH__)) || \
-+      defined(__FreeBSD_kernel__) || defined(__FreeBSD__) || 
defined(__OpenBSD__)
-     return ::dlsym(handle_, name.c_str());
- #else
- #error Support your platform here
Index: server/patches/patch-Resources_CMake_Compiler_cmake
===================================================================
RCS file: server/patches/patch-Resources_CMake_Compiler_cmake
diff -N server/patches/patch-Resources_CMake_Compiler_cmake
--- server/patches/patch-Resources_CMake_Compiler_cmake 11 Mar 2022 19:22:59 
-0000      1.3
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,45 +0,0 @@
-Index: Resources/CMake/Compiler.cmake
---- Resources/CMake/Compiler.cmake.orig
-+++ Resources/CMake/Compiler.cmake
-@@ -70,7 +70,10 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR
-   # Remove the "-rdynamic" option
-   # http://www.mail-archive.com/cmake@cmake.org/msg08837.html
-   set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
--  link_libraries(uuid pthread rt)
-+  if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
-+    link_libraries(rt)
-+  endif()
-+  link_libraries(uuid pthread)
- 
-   if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
-     set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed")
-@@ -80,7 +83,9 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR
-       -D_LARGEFILE64_SOURCE=1 
-       -D_FILE_OFFSET_BITS=64
-       )
--    link_libraries(dl)
-+    if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
-+      link_libraries(dl)
-+    endif()
-   endif()
- 
-   CHECK_INCLUDE_FILES(uuid/uuid.h HAVE_UUID_H)
-@@ -155,12 +160,13 @@ if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardB
- endif()
- 
- 
--if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
-+if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR
-+    ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
-   # In FreeBSD, the "/usr/local/" folder contains the ports and need to be 
imported
--  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I/usr/local/include")
--  SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -I/usr/local/include")
--  SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/usr/local/lib")
--  SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} 
-L/usr/local/lib")
-+  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I${LOCALBASE}/include")
-+  SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -I${LOCALBASE}/include")
-+  SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${LOCALBASE}/lib")
-+  SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} 
-L${LOCALBASE}/lib")
- endif()
- 
- 
Index: server/patches/patch-Resources_Configuration_json
===================================================================
RCS file: server/patches/patch-Resources_Configuration_json
diff -N server/patches/patch-Resources_Configuration_json
--- server/patches/patch-Resources_Configuration_json   11 Mar 2022 19:22:59 
-0000      1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,26 +0,0 @@
-Index: Resources/Configuration.json
---- Resources/Configuration.json.orig
-+++ Resources/Configuration.json
-@@ -10,12 +10,12 @@
-   // Path to the directory that holds the heavyweight files (i.e. the
-   // raw DICOM instances). Backslashes must be either escaped by
-   // doubling them, or replaced by forward slashes "/".
--  "StorageDirectory" : "OrthancStorage",
-+  "StorageDirectory" : "${VARBASE}/orthanc/",
- 
-   // Path to the directory that holds the SQLite index (if unset, the
-   // value of StorageDirectory is used). This index could be stored on
-   // a RAM-drive or a SSD device for performance reasons.
--  "IndexDirectory" : "OrthancStorage",
-+  "IndexDirectory" : "${VARBASE}/orthanc",
- 
-   // Enable the transparent compression of the DICOM instances
-   "StorageCompression" : false,
-@@ -41,6 +41,7 @@
-   // find shared libraries. Backslashes must be either escaped by
-   // doubling them, or replaced by forward slashes "/".
-   "Plugins" : [
-+    "${TRUEPREFIX}/libexec/orthanc/plugins/"
-   ],
- 
- 
Index: server/patches/patch-Resources_ThirdParty_minizip_ioapi_h
===================================================================
RCS file: server/patches/patch-Resources_ThirdParty_minizip_ioapi_h
diff -N server/patches/patch-Resources_ThirdParty_minizip_ioapi_h
--- server/patches/patch-Resources_ThirdParty_minizip_ioapi_h   11 Mar 2022 
19:22:59 -0000      1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,21 +0,0 @@
-/usr/obj/ports/orthanc-1.3.0/Orthanc-1.3.0/Resources/ThirdParty/minizip/ioapi.c:(.text+0x6f6):
-undefined reference to `fopen64'
-libCoreLibrary.a(ioapi.c.o): In function `ftell64_file_func':
-/usr/obj/ports/orthanc-1.3.0/Orthanc-1.3.0/Resources/ThirdParty/minizip/ioapi.c:(.text+0x72a):
-undefined reference to `ftello64'
-libCoreLibrary.a(ioapi.c.o): In function `fseek64_file_func':
-/usr/obj/ports/orthanc-1.3.0/Orthanc-1.3.0/Resources/ThirdParty/minizip/ioapi.c:(.text+0x7e3):
-undefined reference to `fseeko64'
-
-Index: Resources/ThirdParty/minizip/ioapi.h
---- Resources/ThirdParty/minizip/ioapi.h.orig
-+++ Resources/ThirdParty/minizip/ioapi.h
-@@ -45,7 +45,7 @@
- #include <stdlib.h>
- #include "zlib.h"
- 
--#if defined(USE_FILE32API)
-+#if defined(USE_FILE32API) || defined(__OpenBSD__)
- #define fopen64 fopen
- #define ftello64 ftell
- #define fseeko64 fseek
Index: server/patches/patch-UnitTestsSources_PluginsTests_cpp
===================================================================
RCS file: server/patches/patch-UnitTestsSources_PluginsTests_cpp
diff -N server/patches/patch-UnitTestsSources_PluginsTests_cpp
--- server/patches/patch-UnitTestsSources_PluginsTests_cpp      11 Mar 2022 
19:22:59 -0000      1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,12 +0,0 @@
-Index: UnitTestsSources/PluginsTests.cpp
---- UnitTestsSources/PluginsTests.cpp.orig
-+++ UnitTestsSources/PluginsTests.cpp
-@@ -65,7 +65,7 @@ TEST(SharedLibrary, Basic)
-   ASSERT_TRUE(l.HasFunction("dlclose"));
-   ASSERT_FALSE(l.HasFunction("world"));
- 
--#elif defined(__FreeBSD__)
-+#elif defined(__FreeBSD__) || defined(__OpenBSD__)
-   // dlopen() in FreeBSD is supplied by libc, libc.so is
-   // a ldscript, so we can't actually use it. Use thread
-   // library instead - if it works - dlopen() is good.
Index: server/patches/patch-UnitTestsSources_UnitTestsMain_cpp
===================================================================
RCS file: server/patches/patch-UnitTestsSources_UnitTestsMain_cpp
diff -N server/patches/patch-UnitTestsSources_UnitTestsMain_cpp
--- server/patches/patch-UnitTestsSources_UnitTestsMain_cpp     11 Mar 2022 
19:22:59 -0000      1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,25 +0,0 @@
-Index: UnitTestsSources/UnitTestsMain.cpp
---- UnitTestsSources/UnitTestsMain.cpp.orig
-+++ UnitTestsSources/UnitTestsMain.cpp
-@@ -658,7 +658,7 @@ TEST(Toolbox, Enumerations)
- 
- 
- 
--#if defined(__linux__)
-+#if defined(__linux__) || defined(__OpenBSD__)
- #include <endian.h>
- #elif defined(__FreeBSD__)
- #include <machine/endian.h>
-@@ -697,10 +697,10 @@ TEST(Toolbox, Endianness)
- 
-   
-   /**
--   * FreeBSD.
-+   * FreeBSD/OpenBSD
-    **/
-   
--#elif defined(__FreeBSD__)
-+#elif defined(__FreeBSD__) || defined(__OpenBSD__)
- #  if _BYTE_ORDER == _BIG_ENDIAN
-    ASSERT_EQ(Endianness_Big, Toolbox::DetectEndianness());
- #  else // _LITTLE_ENDIAN
Index: server/pkg/PLIST
===================================================================
RCS file: /cvs/ports/graphics/orthanc/server/pkg/PLIST,v
retrieving revision 1.5
diff -u -p -r1.5 PLIST
--- server/pkg/PLIST    11 Mar 2022 19:22:59 -0000      1.5
+++ server/pkg/PLIST    4 Jul 2022 18:07:19 -0000
@@ -5,9 +5,9 @@
 include/orthanc/
 include/orthanc/OrthancCDatabasePlugin.h
 include/orthanc/OrthancCPlugin.h
-include/orthanc/OrthancCppDatabasePlugin.h
 libexec/orthanc/
 libexec/orthanc/plugins/
+@so libexec/orthanc/plugins/libHousekeeper.so
 @so libexec/orthanc/plugins/libModalityWorklists.so
 @so libexec/orthanc/plugins/libServeFolders.so
 @bin sbin/Orthanc
@@ -15,28 +15,18 @@ share/doc/orthanc/
 share/doc/orthanc/OrthancPlugin/
 share/doc/orthanc/OrthancPlugin/OrthancCDatabasePlugin_8h_source.html
 share/doc/orthanc/OrthancPlugin/OrthancCPlugin_8h_source.html
-share/doc/orthanc/OrthancPlugin/OrthancCppDatabasePlugin_8h_source.html
 share/doc/orthanc/OrthancPlugin/OrthancLogoDocumentation.png
 share/doc/orthanc/OrthancPlugin/annotated.html
 share/doc/orthanc/OrthancPlugin/bc_s.png
 share/doc/orthanc/OrthancPlugin/bdwn.png
-share/doc/orthanc/OrthancPlugin/classOrthancPlugins_1_1DatabaseBackendAdapter-members.html
-share/doc/orthanc/OrthancPlugin/classOrthancPlugins_1_1DatabaseBackendAdapter.html
-share/doc/orthanc/OrthancPlugin/classOrthancPlugins_1_1DatabaseBackendOutput-members.html
-share/doc/orthanc/OrthancPlugin/classOrthancPlugins_1_1DatabaseBackendOutput.html
-share/doc/orthanc/OrthancPlugin/classOrthancPlugins_1_1DatabaseBackendOutput.png
-share/doc/orthanc/OrthancPlugin/classOrthancPlugins_1_1DatabaseException-members.html
-share/doc/orthanc/OrthancPlugin/classOrthancPlugins_1_1DatabaseException.html
-share/doc/orthanc/OrthancPlugin/classOrthancPlugins_1_1IDatabaseBackend-members.html
-share/doc/orthanc/OrthancPlugin/classOrthancPlugins_1_1IDatabaseBackend.html
-share/doc/orthanc/OrthancPlugin/classOrthancPlugins_1_1IDatabaseBackend.png
 share/doc/orthanc/OrthancPlugin/classes.html
 share/doc/orthanc/OrthancPlugin/closed.png
 share/doc/orthanc/OrthancPlugin/deprecated.html
-share/doc/orthanc/OrthancPlugin/dir_027bf64fe5984d5a409df67e6d81a46a.html
-share/doc/orthanc/OrthancPlugin/dir_102fbb84850d98ff4d15205d078556ec.html
-share/doc/orthanc/OrthancPlugin/dir_23920acd21d87f5dd4f311023f778748.html
-share/doc/orthanc/OrthancPlugin/dir_95a3b2b95bd26d983cc8fdeed39fa98b.html
+share/doc/orthanc/OrthancPlugin/dir_0489bdf01843387577ad1964c946a7c0.html
+share/doc/orthanc/OrthancPlugin/dir_782bcc12326a942b54bfb52f65417af2.html
+share/doc/orthanc/OrthancPlugin/dir_8a0d447fe7aaf723da4d36caa8de6b31.html
+share/doc/orthanc/OrthancPlugin/dir_ddde61eb52d2d712e5147ece0844b740.html
+share/doc/orthanc/OrthancPlugin/dir_e73b30f829e3152d8d094d6a99e83774.html
 share/doc/orthanc/OrthancPlugin/doc.png
 share/doc/orthanc/OrthancPlugin/doxygen.css
 share/doc/orthanc/OrthancPlugin/doxygen.svg
@@ -45,22 +35,19 @@ share/doc/orthanc/OrthancPlugin/files.ht
 share/doc/orthanc/OrthancPlugin/folderclosed.png
 share/doc/orthanc/OrthancPlugin/folderopen.png
 share/doc/orthanc/OrthancPlugin/functions.html
-share/doc/orthanc/OrthancPlugin/functions_func.html
 share/doc/orthanc/OrthancPlugin/functions_vars.html
 share/doc/orthanc/OrthancPlugin/group__Callbacks.html
-share/doc/orthanc/OrthancPlugin/group__DicomCallbaks.html
+share/doc/orthanc/OrthancPlugin/group__DicomCallbacks.html
+share/doc/orthanc/OrthancPlugin/group__DicomInstance.html
 share/doc/orthanc/OrthancPlugin/group__Images.html
 share/doc/orthanc/OrthancPlugin/group__Orthanc.html
 share/doc/orthanc/OrthancPlugin/group__REST.html
 share/doc/orthanc/OrthancPlugin/group__Toolbox.html
-share/doc/orthanc/OrthancPlugin/hierarchy.html
 share/doc/orthanc/OrthancPlugin/index.html
 share/doc/orthanc/OrthancPlugin/jquery.js
 share/doc/orthanc/OrthancPlugin/menu.js
 share/doc/orthanc/OrthancPlugin/menudata.js
 share/doc/orthanc/OrthancPlugin/modules.html
-share/doc/orthanc/OrthancPlugin/namespaceOrthancPlugins.html
-share/doc/orthanc/OrthancPlugin/namespaces.html
 share/doc/orthanc/OrthancPlugin/nav_f.png
 share/doc/orthanc/OrthancPlugin/nav_g.png
 share/doc/orthanc/OrthancPlugin/nav_h.png
@@ -73,6 +60,8 @@ share/doc/orthanc/OrthancPlugin/structOr
 share/doc/orthanc/OrthancPlugin/structOrthancPluginHttpRequest.html
 share/doc/orthanc/OrthancPlugin/structOrthancPluginMemoryBuffer-members.html
 share/doc/orthanc/OrthancPlugin/structOrthancPluginMemoryBuffer.html
+share/doc/orthanc/OrthancPlugin/structOrthancPluginMemoryBuffer64-members.html
+share/doc/orthanc/OrthancPlugin/structOrthancPluginMemoryBuffer64.html
 share/doc/orthanc/OrthancPlugin/sync_off.png
 share/doc/orthanc/OrthancPlugin/sync_on.png
 share/doc/orthanc/OrthancPlugin/tab_a.png
Index: webviewer-plugin/Makefile
===================================================================
RCS file: /cvs/ports/graphics/orthanc/webviewer-plugin/Makefile,v
retrieving revision 1.10
diff -u -p -r1.10 Makefile
--- webviewer-plugin/Makefile   28 May 2022 06:20:01 -0000      1.10
+++ webviewer-plugin/Makefile   4 Jul 2022 18:07:19 -0000
@@ -1,8 +1,8 @@
 COMMENT =              web viewer plugin for Orthanc
 
-VERSION =              2.3
+VERSION =              2.8
+
 PLUGIN =               WebViewer
-REVISION =             3
 
 PLUGIN_3RDPARTY =      cornerstone-0.11.0.zip \
                        jquery-ui-1.11.3.zip \
@@ -13,34 +13,45 @@ PLUGIN_3RDPARTY =   cornerstone-0.11.0.zip
 DISTNAME =             Orthanc${PLUGIN}-${VERSION}
 DISTFILES =            ${DISTNAME}${EXTRACT_SUFX}
 EXTRACT_ONLY =         ${DISTNAME}${EXTRACT_SUFX}
-DISTFILES +=           ${PLUGIN_3RDPARTY:C/$/:1/}
 
+DISTFILES +=           ${PLUGIN_3RDPARTY:C/$/:1/}
 MASTER_SITES1 =                
https://www.orthanc-server.com/downloads/third-party/WebViewer/
 
+DISTFILES +=           ${FRAMEWORK_DISTFILE:C/$/:2/}
+MASTER_SITES2 =                
https://www.orthanc-server.com/downloads/get.php?path=/orthanc/
+
 WANTLIB += ${COMPILER_LIBCXX} boost_atomic-mt boost_chrono-mt
-WANTLIB += boost_date_time-mt boost_filesystem-mt boost_locale-mt
-WANTLIB += boost_regex-mt boost_system-mt boost_thread-mt gdcmCommon
-WANTLIB += gdcmDICT gdcmDSED gdcmIOD gdcmMSFF gtest jsoncpp m
-WANTLIB += sqlite3
+WANTLIB += boost_date_time-mt boost_filesystem-mt boost_iostreams-mt
+WANTLIB += boost_regex-mt boost_system-mt boost_thread-mt jsoncpp
+WANTLIB += m sqlite3 uuid
 
 COMPILER =             base-clang ports-gcc base-gcc
 
-BUILD_DEPENDS =                graphics/orthanc/server
+BUILD_DEPENDS =                graphics/orthanc/server \
+                       devel/gtest
+
 RUN_DEPENDS =          graphics/orthanc/server
 LIB_DEPENDS =          databases/sqlite3 \
                        devel/boost \
-                       devel/gtest \
                        devel/jsoncpp \
-                       graphics/gdcm
+                       sysutils/e2fsprogs
+
+TEST_DEPENDS =         devel/gtest
 
-CFLAGS=                        -I${LOCALBASE}/include -pthread
-CXXFLAGS=              -I${LOCALBASE}/include -pthread
-MODCMAKE_LDFLAGS=      -L${LOCALBASE}/lib -luuid
+CONFIGURE_ARGS =       -DALLOW_DOWNLOADS=OFF \
+                       -DUSE_SYSTEM_UUID=ON
+
+CONFIGURE_ARGS +=      
-DORTHANC_FRAMEWORK_ROOT="${WRKSRC}/ThirdPartyDownloads/Orthanc-${FRAMEWORK_VERSION}/OrthancFramework/Sources"
 \
+                       -DORTHANC_FRAMEWORK_SOURCE=path
 
 post-extract:
        mkdir ${WRKSRC}/ThirdPartyDownloads/
 .for p in ${PLUGIN_3RDPARTY}
        cp ${DISTDIR}/$p ${WRKSRC}/ThirdPartyDownloads/
 .endfor
+       tar -xzf ${DISTDIR}/${FRAMEWORK_DISTFILE} -C 
${WRKSRC}/ThirdPartyDownloads/
+
+do-test:
+       cd ${WRKBUILD} && ./UnitTests
 
 .include <bsd.port.mk>
Index: webviewer-plugin/distinfo
===================================================================
RCS file: /cvs/ports/graphics/orthanc/webviewer-plugin/distinfo,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 distinfo
--- webviewer-plugin/distinfo   9 Aug 2017 14:41:22 -0000       1.1.1.1
+++ webviewer-plugin/distinfo   4 Jul 2022 18:07:19 -0000
@@ -1,10 +1,12 @@
-SHA256 (OrthancWebViewer-2.3.tar.gz) = 
6fi4n7KmM3PMzVUmdoCpU+xJBzhy27h0e8ZitNeVXF4=
+SHA256 (Orthanc-1.11.1.tar.gz) = pjStyfbdCnTrrrQVZXtfPVGCK0+zR2QdxE87+LW1bbU=
+SHA256 (OrthancWebViewer-2.8.tar.gz) = 
QeOhUEDXQzYETMkwRjQkas7o2SerhSMwdP+J3U0A8w8=
 SHA256 (cornerstone-0.11.0.zip) = G62p8fKYGWj3Lao1LnEqvqXKw+BBf+WRdvcKIyYfHak=
 SHA256 (jquery-ui-1.11.3.zip) = BFtS8pO/T3fGaJVpBkMnSV7dnmQ0g5t4pWKZxVUTAoI=
 SHA256 (js-url-1.8.6.zip) = 7yx/UJIbpkrENOrPAlZp8ebzm1WEEA/6gZSj7cCNQ9M=
 SHA256 (jsPanel-2.3.3-fixed.zip) = lYoVxwCe+7hl2mK1hQo6OWYcYmluOLFRx/mI9KxEVZU=
 SHA256 (pako-0.2.5.zip) = 5JMBDhsa9cFJYxmUNl7THhVyLu0tF8wdlb2a8VHyAF8=
-SIZE (OrthancWebViewer-2.3.tar.gz) = 162475
+SIZE (Orthanc-1.11.1.tar.gz) = 1910916
+SIZE (OrthancWebViewer-2.8.tar.gz) = 126872
 SIZE (cornerstone-0.11.0.zip) = 935277
 SIZE (jquery-ui-1.11.3.zip) = 400437
 SIZE (js-url-1.8.6.zip) = 54717
Index: webviewer-plugin/patches/patch-CMakeLists_txt
===================================================================
RCS file: 
/cvs/ports/graphics/orthanc/webviewer-plugin/patches/patch-CMakeLists_txt,v
retrieving revision 1.2
diff -u -p -r1.2 patch-CMakeLists_txt
--- webviewer-plugin/patches/patch-CMakeLists_txt       11 Mar 2022 19:22:59 
-0000      1.2
+++ webviewer-plugin/patches/patch-CMakeLists_txt       4 Jul 2022 18:07:19 
-0000
@@ -1,27 +1,15 @@
 Index: CMakeLists.txt
 --- CMakeLists.txt.orig
 +++ CMakeLists.txt
-@@ -187,19 +187,13 @@ message("Setting the version of the library to ${ORTHA
+@@ -182,8 +182,9 @@ message("Setting the version of the library to ${ORTHA
+ add_definitions(-DORTHANC_PLUGIN_VERSION="${ORTHANC_PLUGIN_VERSION}")
  
- add_definitions(-DORTHANC_WEBVIEWER_VERSION="${ORTHANC_WEBVIEWER_VERSION}")
- 
--set_target_properties(OrthancWebViewer PROPERTIES 
--  VERSION ${ORTHANC_WEBVIEWER_VERSION} 
--  SOVERSION ${ORTHANC_WEBVIEWER_VERSION})
-+set_target_properties(OrthancWebViewer PROPERTIES
+ set_target_properties(OrthancWebViewer PROPERTIES 
+-  VERSION ${ORTHANC_PLUGIN_VERSION} 
+-  SOVERSION ${ORTHANC_PLUGIN_VERSION})
 +  NO_SONAME ON
 +  LINK_FLAGS "-Wl,-soname,libOrthancWebViewer.so"
 +)
  
  install(
    TARGETS OrthancWebViewer
-   RUNTIME DESTINATION lib    # Destination for Windows
-   LIBRARY DESTINATION share/orthanc/plugins    # Destination for Linux
--  )
--
--add_executable(UnitTests
--  ${CORE_SOURCES}
--  ${GTEST_SOURCES}
--  ${JSONCPP_SOURCES}
--  UnitTestsSources/UnitTestsMain.cpp
-   )
Index: webviewer-plugin/patches/patch-Orthanc_Core_SystemToolbox_cpp
===================================================================
RCS file: webviewer-plugin/patches/patch-Orthanc_Core_SystemToolbox_cpp
diff -N webviewer-plugin/patches/patch-Orthanc_Core_SystemToolbox_cpp
--- webviewer-plugin/patches/patch-Orthanc_Core_SystemToolbox_cpp       11 Mar 
2022 19:22:59 -0000      1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,36 +0,0 @@
-Index: Orthanc/Core/SystemToolbox.cpp
---- Orthanc/Core/SystemToolbox.cpp.orig
-+++ Orthanc/Core/SystemToolbox.cpp
-@@ -55,7 +55,8 @@
- #endif
- 
- 
--#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
-+#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__) 
\
-+|| defined(__OpenBSD__)
- #  include <limits.h>      /* PATH_MAX */
- #  include <signal.h>
- #  include <unistd.h>
-@@ -157,7 +158,8 @@ namespace Orthanc
-   {
- #if defined(_WIN32)
-     ::Sleep(static_cast<DWORD>(microSeconds / static_cast<uint64_t>(1000)));
--#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD_kernel__) 
|| defined(__FreeBSD__) || defined(__native_client__)
-+#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD_kernel__) 
\
-+|| defined(__FreeBSD__) || defined(__native_client__) || defined(__OpenBSD__)
-     usleep(microSeconds);
- #else
- #error Support your platform here
-@@ -369,7 +371,11 @@ namespace Orthanc
- 
-     return std::string(pathbuf);
-   }
--
-+#elif defined(__OpenBSD__)
-+  static std::string GetPathToExecutableInternal()
-+  {
-+    return "/usr/local/sbin/Orthanc";
-+  }
- #else
- #error Support your platform here
- #endif
Index: webviewer-plugin/patches/patch-Orthanc_Core_Toolbox_cpp
===================================================================
RCS file: webviewer-plugin/patches/patch-Orthanc_Core_Toolbox_cpp
diff -N webviewer-plugin/patches/patch-Orthanc_Core_Toolbox_cpp
--- webviewer-plugin/patches/patch-Orthanc_Core_Toolbox_cpp     11 Mar 2022 
19:22:59 -0000      1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,21 +0,0 @@
-Fix issue #114
-
-f49a6d934fd51dd57a8e91db45e36f77371b4042
-
-Index: Orthanc/Core/Toolbox.cpp
---- Orthanc/Core/Toolbox.cpp.orig
-+++ Orthanc/Core/Toolbox.cpp
-@@ -40,7 +40,12 @@
- #include <boost/algorithm/string/replace.hpp>
- #include <boost/lexical_cast.hpp>
- #include <boost/locale.hpp>
--#include <boost/uuid/sha1.hpp>
-+
-+#if BOOST_VERSION >= 106600
-+#  include <boost/uuid/detail/sha1.hpp>
-+#else
-+#  include <boost/uuid/sha1.hpp>
-+#endif
- 
- #include <string>
- #include <stdint.h>
Index: webviewer-plugin/patches/patch-Plugin_Cache_CacheManager_h
===================================================================
RCS file: webviewer-plugin/patches/patch-Plugin_Cache_CacheManager_h
diff -N webviewer-plugin/patches/patch-Plugin_Cache_CacheManager_h
--- webviewer-plugin/patches/patch-Plugin_Cache_CacheManager_h  11 Mar 2022 
19:22:59 -0000      1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,14 +0,0 @@
-Fix build with newer Boost.
-
-Index: Plugin/Cache/CacheManager.h
---- Plugin/Cache/CacheManager.h.orig
-+++ Plugin/Cache/CacheManager.h
-@@ -26,6 +26,8 @@
- 
- #include <orthanc/OrthancCPlugin.h>
- 
-+#include <boost/shared_ptr.hpp>
-+
- namespace OrthancPlugins
- {
-   enum CacheProperty
Index: 
webviewer-plugin/patches/patch-ThirdPartyDownloads_Orthanc-1_11_1_OrthancFramework_Sources_SystemToolbox_cpp
===================================================================
RCS file: 
webviewer-plugin/patches/patch-ThirdPartyDownloads_Orthanc-1_11_1_OrthancFramework_Sources_SystemToolbox_cpp
diff -N 
webviewer-plugin/patches/patch-ThirdPartyDownloads_Orthanc-1_11_1_OrthancFramework_Sources_SystemToolbox_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ 
webviewer-plugin/patches/patch-ThirdPartyDownloads_Orthanc-1_11_1_OrthancFramework_Sources_SystemToolbox_cpp
        4 Jul 2022 18:07:19 -0000
@@ -0,0 +1,29 @@
+Index: 
ThirdPartyDownloads/Orthanc-1.11.1/OrthancFramework/Sources/SystemToolbox.cpp
+--- 
ThirdPartyDownloads/Orthanc-1.11.1/OrthancFramework/Sources/SystemToolbox.cpp.orig
++++ 
ThirdPartyDownloads/Orthanc-1.11.1/OrthancFramework/Sources/SystemToolbox.cpp
+@@ -47,14 +47,14 @@
+ #endif
+ 
+ 
+-#if (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD_kernel__) 
|| defined(__FreeBSD__)
++#if (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD_kernel__) 
|| defined(__FreeBSD__) || defined(__OpenBSD__)
+ #  include <net/if_dl.h>     // For GetMacAddresses()
+ #  include <net/if_types.h>  // For GetMacAddresses()
+ #  include <sys/sysctl.h>    // For GetMacAddresses()
+ #endif
+ 
+ 
+-#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
++#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__) 
|| defined(__OpenBSD__)
+ #  include <limits.h>        // PATH_MAX
+ #  include <signal.h>
+ #  include <unistd.h>
+@@ -1095,7 +1095,7 @@ namespace Orthanc
+ 
+       while (!interfaces.IsDone())
+       {
+-#if (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD_kernel__) 
|| defined(__FreeBSD__)
++#if (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD_kernel__) 
|| defined(__FreeBSD__) || defined(__OpenBSD__)
+         int mib[6];
+         mib[0] = CTL_NET;
+         mib[1] = AF_ROUTE;
Index: webviewer-plugin/pkg/PLIST
===================================================================
RCS file: /cvs/ports/graphics/orthanc/webviewer-plugin/pkg/PLIST,v
retrieving revision 1.2
diff -u -p -r1.2 PLIST
--- webviewer-plugin/pkg/PLIST  11 Mar 2022 19:23:00 -0000      1.2
+++ webviewer-plugin/pkg/PLIST  4 Jul 2022 18:07:19 -0000
@@ -1 +1 @@
-libexec/orthanc/plugins/libOrthancWebViewer.so
+@so libexec/orthanc/plugins/libOrthancWebViewer.so

Reply via email to