Tuesday, July 05, 2022

UPDATE: graphics/orthanc

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 @@
+

No comments:

Post a Comment