1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-30 10:19:20 +00:00

- Update from 0.8.6 to 0.9.0

- Mark as ignored for anything except 10.1
- Run unit tests during port build
- Fix config installation

PR:		200683
Submitted by:	mp39590@gmail.com(maintainer)
This commit is contained in:
Wen Heping 2015-06-19 02:24:08 +00:00
parent 1d507f080b
commit 1788bcde91
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=390100
16 changed files with 32 additions and 289 deletions

View File

@ -2,7 +2,7 @@
# $FreeBSD$
PORTNAME= orthanc
PORTVERSION= 0.8.6
PORTVERSION= 0.9.0
CATEGORIES= science graphics net
MASTER_SITES= SF/orthancserver/:main \
http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/:mongoose
@ -16,6 +16,7 @@ COMMENT= RESTful DICOM server for healthcare and medical research
LICENSE= GPLv3
LICENSE_FILE= ${WRKSRC}/COPYING
BUILD_DEPENDS= gtest-config:${PORTSDIR}/devel/googletest
LIB_DEPENDS= libcurl.so:${PORTSDIR}/ftp/curl \
libjsoncpp.so:${PORTSDIR}/devel/jsoncpp \
libuuid.so:${PORTSDIR}/misc/e2fsprogs-libuuid \
@ -28,12 +29,10 @@ LIB_DEPENDS= libcurl.so:${PORTSDIR}/ftp/curl \
CMAKE_ARGS= -DDCMTK_LIBRARIES="dcmdsig;charls;dcmjpls" \
-DDCMTK_DICTIONARY_DIR="${LOCALBASE}/share/dcmtk" \
-DUSE_SYSTEM_MONGOOSE=OFF \
-DBUILD_UNIT_TESTS=OFF
-DUNIT_TESTS_WITH_HTTP_CONNEXIONS=OFF
USES= cmake:outsource python:build lua:51 dos2unix
DOS2UNIX_FILES= CMakeLists.txt
CFLAGS+= -I${LOCALBASE}/include -I${LOCALBASE}/include/jsoncpp
LDFLAGS+= -L${LOCALBASE}/lib
USE_LDCONFIG= yes
USE_OPENSSL= yes
USE_RC_SUBR= orthanc
@ -52,12 +51,34 @@ GROUPS= orthanc
post-extract:
${MKDIR} ${WRKSRC}/ThirdPartyDownloads
${CP} ${DISTDIR}/${DIST_SUBDIR}/mongoose-3.8.tgz ${WRKSRC}/ThirdPartyDownloads
# Orthanc hardcodes /usr/local paths for libs and includes.
${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' ${WRKSRC}/CMakeLists.txt
# There is no way to disable building of test units without a patch, on other
# hand it brings only one build dependency (devel/googletest) and running it was
# helpful in early bug detection in Debian.
# Some tests require connections to be made to the outside world, this is
# definitely unsupported behaviour and therefor those tests are disabled with
# cmake variable above (-DUNIT_TESTS_WITH_HTTP_CONNEXIONS=OFF).
post-build:
@cd ${BUILD_WRKSRC} && ./UnitTests
post-install:
${MKDIR} ${STAGEDIR}/var/db/orthanc/db/db-v5
${MKDIR} ${STAGEDIR}${DATADIR}/plugins
${MKDIR} ${STAGEDIR}${ETCDIR}
${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' \
${WRKSRC}/Resources/Configuration.json > ${STAGEDIR}${ETCDIR}/orthanc.json.sample
${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' ${WRKSRC}/Resources/Configuration.json
${CP} ${WRKSRC}/Resources/Configuration.json ${STAGEDIR}${ETCDIR}/orthanc.json.sample
${STRIP_CMD} ${STAGEDIR}${DATADIR}/plugins/libServeFolders.so.0.9.0
.include <bsd.port.mk>
.include <bsd.port.pre.mk>
.if ${OSVERSION} < 1001000
IGNORE= supported only on 10.1 by upstream, not all unit tests are passed
.endif
.if ${OSVERSION} > 1100000
IGNORE= unit tests are crashing, bug 200544
.endif
.include <bsd.port.post.mk>

View File

@ -1,4 +1,4 @@
SHA256 (orthanc/Orthanc-0.8.6.tar.gz) = 0668e23dbdf4aa12bf417cf22bfb7b50379797fc6b1132a582789289d1728e69
SIZE (orthanc/Orthanc-0.8.6.tar.gz) = 716036
SHA256 (orthanc/Orthanc-0.9.0.tar.gz) = f75f76a2aaa79951c8ece2137046f2572a91e96e31efe9e0ce99b644e4320d0a
SIZE (orthanc/Orthanc-0.9.0.tar.gz) = 676749
SHA256 (orthanc/mongoose-3.8.tgz) = 6afc2c377614a01a24b78560a62d1316b29372afe08eae3715b56c877be71c6e
SIZE (orthanc/mongoose-3.8.tgz) = 1577314

View File

@ -1,61 +0,0 @@
--- CMakeLists.txt.orig 2015-02-12 13:47:38 UTC
+++ CMakeLists.txt
@@ -20,6 +20,7 @@ SET(ALLOW_DOWNLOADS OFF CACHE BOOL "Allo
SET(UNIT_TESTS_WITH_HTTP_CONNEXIONS ON CACHE BOOL "Allow unit tests to make HTTP requests")
SET(ENABLE_JPEG ON CACHE BOOL "Enable JPEG decompression")
SET(ENABLE_JPEG_LOSSLESS ON CACHE BOOL "Enable JPEG-LS (Lossless) decompression")
+SET(BUILD_UNIT_TESTS ON CACHE BOOL "Build UnitTests binary")
# Advanced parameters to fine-tune linking against system libraries
SET(USE_SYSTEM_JSONCPP ON CACHE BOOL "Use the system version of JsonCpp")
@@ -359,22 +360,24 @@ install(
## Build the unit tests
#####################################################################
-if (UNIT_TESTS_WITH_HTTP_CONNEXIONS)
- add_definitions(-DUNIT_TESTS_WITH_HTTP_CONNEXIONS=1)
-else()
- add_definitions(-DUNIT_TESTS_WITH_HTTP_CONNEXIONS=0)
-endif()
-
-add_definitions(-DORTHANC_BUILD_UNIT_TESTS=1)
-include(${CMAKE_SOURCE_DIR}/Resources/CMake/GoogleTestConfiguration.cmake)
-add_executable(UnitTests
- ${GTEST_SOURCES}
- ${ORTHANC_UNIT_TESTS_SOURCES}
- )
-target_link_libraries(UnitTests ServerLibrary CoreLibrary ${STATIC_LUA} ${STATIC_GOOGLE_LOG})
-
-if (${OPENSSL_SOURCES_LENGTH} GREATER 0)
- target_link_libraries(UnitTests OpenSSL)
+if (BUILD_UNIT_TESTS)
+ if (UNIT_TESTS_WITH_HTTP_CONNEXIONS)
+ add_definitions(-DUNIT_TESTS_WITH_HTTP_CONNEXIONS=1)
+ else()
+ add_definitions(-DUNIT_TESTS_WITH_HTTP_CONNEXIONS=0)
+ endif()
+
+ add_definitions(-DORTHANC_BUILD_UNIT_TESTS=1)
+ include(${CMAKE_SOURCE_DIR}/Resources/CMake/GoogleTestConfiguration.cmake)
+ add_executable(UnitTests
+ ${GTEST_SOURCES}
+ ${ORTHANC_UNIT_TESTS_SOURCES}
+ )
+ target_link_libraries(UnitTests ServerLibrary CoreLibrary ${STATIC_LUA} ${STATIC_GOOGLE_LOG})
+
+ if (${OPENSSL_SOURCES_LENGTH} GREATER 0)
+ target_link_libraries(UnitTests OpenSSL)
+ endif()
endif()
@@ -443,7 +446,8 @@ if (BUILD_CLIENT_LIBRARY)
)
endif()
- elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
+ elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" OR
+ ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
# TODO
target_link_libraries(OrthancClient pthread)

View File

@ -1,11 +0,0 @@
--- Core/Compression/HierarchicalZipWriter.cpp.orig 2015-02-12 13:47:38 UTC
+++ Core/Compression/HierarchicalZipWriter.cpp
@@ -53,7 +53,7 @@ namespace Orthanc
if (c == '^')
c = ' ';
- if (c < 128 &&
+ if (c <= 127 &&
c >= 0)
{
if (isspace(c))

View File

@ -1,11 +0,0 @@
--- Core/ImageFormats/ImageProcessing.cpp.orig 2015-02-12 13:47:38 UTC
+++ Core/ImageFormats/ImageProcessing.cpp
@@ -209,7 +209,7 @@ namespace Orthanc
void MultiplyConstantInternal(ImageAccessor& image,
float factor)
{
- if (abs(factor - 1.0f) <= std::numeric_limits<float>::epsilon())
+ if (std::abs(factor - 1.0f) <= std::numeric_limits<float>::epsilon())
{
return;
}

View File

@ -1,20 +0,0 @@
--- Core/MultiThreading/Mutex.cpp.orig 2015-02-12 13:47:38 UTC
+++ Core/MultiThreading/Mutex.cpp
@@ -37,7 +37,7 @@
#if defined(_WIN32)
#include <windows.h>
-#elif defined(__linux) || defined(__FreeBSD_kernel__) || defined(__APPLE__)
+#elif defined(__linux) || defined(__FreeBSD_kernel__) || defined(__APPLE__) || defined(__FreeBSD__)
#include <pthread.h>
#else
#error Support your platform here
@@ -75,7 +75,7 @@ namespace Orthanc
}
-#elif defined(__linux) || defined(__FreeBSD_kernel__) || defined(__APPLE__)
+#elif defined(__linux) || defined(__FreeBSD_kernel__) || defined(__APPLE__) || defined(__FreeBSD__)
struct Mutex::PImpl
{

View File

@ -1,11 +0,0 @@
--- Core/MultiThreading/ThreadedCommandProcessor.cpp.orig 2015-02-12 13:47:38 UTC
+++ Core/MultiThreading/ThreadedCommandProcessor.cpp
@@ -175,7 +175,7 @@ namespace Orthanc
{
boost::mutex::scoped_lock lock(mutex_);
- while (!remainingCommands_ == 0)
+ while (remainingCommands_ != 0)
{
processedCommand_.wait(lock);
}

View File

@ -1,38 +0,0 @@
--- Core/Toolbox.cpp.orig 2015-02-12 13:47:38 UTC
+++ Core/Toolbox.cpp
@@ -59,7 +59,7 @@
#include <limits.h> /* PATH_MAX */
#endif
-#if defined(__linux) || defined(__FreeBSD_kernel__)
+#if defined(__linux) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
#include <limits.h> /* PATH_MAX */
#include <signal.h>
#include <unistd.h>
@@ -116,7 +116,7 @@ namespace Orthanc
{
#if defined(_WIN32)
::Sleep(static_cast<DWORD>(microSeconds / static_cast<uint64_t>(1000)));
-#elif defined(__linux) || defined(__APPLE__) || defined(__FreeBSD_kernel__)
+#elif defined(__linux) || defined(__APPLE__) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
usleep(microSeconds);
#else
#error Support your platform here
@@ -503,7 +503,7 @@ namespace Orthanc
return std::string(&buffer[0]);
}
-#elif defined(__linux) || defined(__FreeBSD_kernel__)
+#elif defined(__linux) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
static std::string GetPathToExecutableInternal()
{
std::vector<char> buffer(PATH_MAX + 1);
@@ -633,7 +633,7 @@ namespace Orthanc
result.reserve(source.size() + 1);
for (size_t i = 0; i < source.size(); i++)
{
- if (source[i] < 128 && source[i] >= 0 && !iscntrl(source[i]))
+ if (source[i] <= 127 && source[i] >= 0 && !iscntrl(source[i]))
{
result.push_back(source[i]);
}

View File

@ -1,11 +0,0 @@
--- OrthancServer/Internals/StoreScp.cpp.orig 2015-02-12 13:47:38 UTC
+++ OrthancServer/Internals/StoreScp.cpp
@@ -182,7 +182,7 @@ namespace Orthanc
// check the image to make sure it is consistent, i.e. that its sopClass and sopInstance correspond
// to those mentioned in the request. If not, set the status in the response message variable.
- if ((rsp->DimseStatus == STATUS_Success))
+ if (rsp->DimseStatus == STATUS_Success)
{
// which SOP class and SOP instance ?
if (!DU_findSOPClassAndInstanceInDataSet(*imageDataSet, sopClass, sopInstance, /*opt_correctUIDPadding*/ OFFalse))

View File

@ -1,11 +0,0 @@
--- Plugins/Engine/PluginsManager.cpp.orig 2015-02-12 13:47:38 UTC
+++ Plugins/Engine/PluginsManager.cpp
@@ -42,7 +42,7 @@
#ifdef WIN32
#define PLUGIN_EXTENSION ".dll"
-#elif defined(__linux) || defined(__FreeBSD_kernel__)
+#elif defined(__linux) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
#define PLUGIN_EXTENSION ".so"
#elif defined(__APPLE__) && defined(__MACH__)
#define PLUGIN_EXTENSION ".dylib"

View File

@ -1,38 +0,0 @@
--- Plugins/Engine/SharedLibrary.cpp.orig 2015-02-12 13:47:38 UTC
+++ Plugins/Engine/SharedLibrary.cpp
@@ -36,7 +36,7 @@
#if defined(_WIN32)
#include <windows.h>
-#elif defined(__linux) || (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD_kernel__)
+#elif defined(__linux) || (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
#include <dlfcn.h>
#else
#error Support your platform here
@@ -58,7 +58,7 @@ namespace Orthanc
throw OrthancException(ErrorCode_SharedLibrary);
}
-#elif defined(__linux) || (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD_kernel__)
+#elif defined(__linux) || (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
handle_ = ::dlopen(path.c_str(), RTLD_NOW);
if (handle_ == NULL)
{
@@ -84,7 +84,7 @@ namespace Orthanc
{
#if defined(_WIN32)
::FreeLibrary((HMODULE)handle_);
-#elif defined(__linux) || (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD_kernel__)
+#elif defined(__linux) || (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
::dlclose(handle_);
#else
#error Support your platform here
@@ -102,7 +102,7 @@ namespace Orthanc
#if defined(_WIN32)
return ::GetProcAddress((HMODULE)handle_, name.c_str());
-#elif defined(__linux) || (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD_kernel__)
+#elif defined(__linux) || (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
return ::dlsym(handle_, name.c_str());
#else
#error Support your platform here

View File

@ -1,19 +0,0 @@
--- Resources/CMake/AutoGeneratedCode.cmake.orig 2015-02-12 13:47:38 UTC
+++ Resources/CMake/AutoGeneratedCode.cmake
@@ -3,6 +3,7 @@ set(AUTOGENERATED_SOURCES)
file(MAKE_DIRECTORY ${AUTOGENERATED_DIR})
include_directories(${AUTOGENERATED_DIR})
+include(FindPythonInterp)
macro(EmbedResources)
# Convert a semicolon separated list to a whitespace separated string
@@ -26,7 +27,7 @@ macro(EmbedResources)
"${TARGET_BASE}.h"
"${TARGET_BASE}.cpp"
COMMAND
- python
+ ${PYTHON_EXECUTABLE}
"${CMAKE_CURRENT_SOURCE_DIR}/Resources/EmbedResources.py"
"${AUTOGENERATED_DIR}/EmbeddedResources"
${SCRIPT_ARGUMENTS}

View File

@ -1,10 +0,0 @@
--- Resources/CMake/BoostConfiguration.cmake.orig 2015-02-12 13:47:38 UTC
+++ Resources/CMake/BoostConfiguration.cmake
@@ -56,6 +56,7 @@ if (BOOST_STATIC)
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR
${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" OR
+ ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR
${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD")
list(APPEND BOOST_SOURCES
${BOOST_SOURCES_DIR}/libs/thread/src/pthread/once.cpp

View File

@ -1,21 +0,0 @@
--- Resources/CMake/Compiler.cmake.orig 2015-02-12 13:47:38 UTC
+++ Resources/CMake/Compiler.cmake
@@ -4,7 +4,8 @@ if (${CMAKE_COMPILER_IS_GNUCXX})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-long-long -Wno-implicit-function-declaration")
# --std=c99 makes libcurl not to compile
# -pedantic gives a lot of warnings on OpenSSL
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wno-long-long -Wno-variadic-macros")
+ # with -pedantic we failing to build headers from boost, which have comma at the end of enum's
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-long-long -Wno-variadic-macros")
if (CMAKE_CROSSCOMPILING)
# http://stackoverflow.com/a/3543845/881731
@@ -79,6 +80,8 @@ elseif (${CMAKE_SYSTEM_NAME} STREQUAL "D
)
link_libraries(iconv)
+elseif (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
+ link_libraries(uuid pthread)
endif()

View File

@ -1,15 +0,0 @@
--- Resources/CMake/SQLiteConfiguration.cmake.orig 2015-02-12 13:47:38 UTC
+++ Resources/CMake/SQLiteConfiguration.cmake
@@ -28,8 +28,11 @@ else()
message(FATAL_ERROR "Please install the libsqlite3-dev package")
endif()
+ find_path(SQLITE_INCLUDE_DIR sqlite3.h)
+ message("SQLite include dir: ${SQLITE_INCLUDE_DIR}")
+
# Autodetection of the version of SQLite
- file(STRINGS "/usr/include/sqlite3.h" SQLITE_VERSION_NUMBER1 REGEX "#define SQLITE_VERSION_NUMBER.*$")
+ file(STRINGS "${SQLITE_INCLUDE_DIR}/sqlite3.h" SQLITE_VERSION_NUMBER1 REGEX "#define SQLITE_VERSION_NUMBER.*$")
string(REGEX REPLACE "#define SQLITE_VERSION_NUMBER(.*)$" "\\1" SQLITE_VERSION_NUMBER ${SQLITE_VERSION_NUMBER1})
message("Detected version of SQLite: ${SQLITE_VERSION_NUMBER}")

View File

@ -5,8 +5,7 @@
@sample(orthanc,orthanc,600) %%ETCDIR%%/orthanc.json.sample
include/orthanc/OrthancCDatabasePlugin.h
include/orthanc/OrthancCPlugin.h
include/orthanc/OrthancCppClient.h
include/orthanc/OrthancCppDatabasePlugin.h
lib/libOrthancClient.so
lib/libOrthancClient.so.0.8
%%DATADIR%%/plugins/%%LUA_LIBDIR%%ServeFolders.so
%%DATADIR%%/plugins/%%LUA_LIBDIR%%ServeFolders.so.0.9.0
sbin/Orthanc