aboutsummaryrefslogtreecommitdiffstats
path: root/science
diff options
context:
space:
mode:
authoramdmi3 <amdmi3@FreeBSD.org>2015-06-04 22:07:31 +0800
committeramdmi3 <amdmi3@FreeBSD.org>2015-06-04 22:07:31 +0800
commit0eb1f1814a06a1390b5831d914dd4eeb10284bc9 (patch)
tree741be1486aa520ff9320104e02d7390d7ec50931 /science
parentd4d2933bf2f841515a25698d2eb69c30c838b5f9 (diff)
downloadfreebsd-ports-graphics-0eb1f1814a06a1390b5831d914dd4eeb10284bc9.tar.gz
freebsd-ports-graphics-0eb1f1814a06a1390b5831d914dd4eeb10284bc9.tar.zst
freebsd-ports-graphics-0eb1f1814a06a1390b5831d914dd4eeb10284bc9.zip
- Add science/orthanc
Orthanc aims at providing a simple, yet powerful standalone DICOM server. It is designed to improve the DICOM flows in hospitals and to support research about the automated analysis of medical images. Orthanc can turn any computer running Windows, Linux, FreeBSD or OS X into a DICOM store (in other words, a mini-PACS system). Its architecture is lightweight and standalone, meaning that no complex database administration is required, nor the installation of third-party dependencies. What makes Orthanc unique is the fact that it provides a RESTful API. Thanks to this major feature, it is possible to drive Orthanc from any computer language. The DICOM tags of the stored medical images can be downloaded in the JSON file format. Furthermore, standard PNG images can be generated on-the-fly from the DICOM instances by Orthanc. Orthanc lets its users focus on the content of the DICOM files, hiding the complexity of the DICOM format and of the DICOM protocol. WWW: http://www.orthanc-server.com/ PR: 199146 Submitted by: mp39590@gmail.com
Diffstat (limited to 'science')
-rw-r--r--science/Makefile1
-rw-r--r--science/orthanc/Makefile63
-rw-r--r--science/orthanc/distinfo4
-rw-r--r--science/orthanc/files/orthanc.in40
-rw-r--r--science/orthanc/files/patch-CMakeLists.txt61
-rw-r--r--science/orthanc/files/patch-Core_Compression_HierarchicalZipWriter.cpp11
-rw-r--r--science/orthanc/files/patch-Core_ImageFormats_ImageProcessing.cpp11
-rw-r--r--science/orthanc/files/patch-Core_MultiThreading_Mutex.cpp20
-rw-r--r--science/orthanc/files/patch-Core_MultiThreading_ThreadedCommandProcessor.cpp11
-rw-r--r--science/orthanc/files/patch-Core_Toolbox.cpp38
-rw-r--r--science/orthanc/files/patch-OrthancServer_Internals_StoreScp.cpp11
-rw-r--r--science/orthanc/files/patch-Plugins_Engine_PluginsManager.cpp11
-rw-r--r--science/orthanc/files/patch-Plugins_Engine_SharedLibrary.cpp38
-rw-r--r--science/orthanc/files/patch-Resources_CMake_AutoGeneratedCode.cmake19
-rw-r--r--science/orthanc/files/patch-Resources_CMake_BoostConfiguration.cmake10
-rw-r--r--science/orthanc/files/patch-Resources_CMake_Compiler.cmake21
-rw-r--r--science/orthanc/files/patch-Resources_CMake_SQLiteConfiguration.cmake15
-rw-r--r--science/orthanc/files/patch-Resources_Configuration.json25
-rw-r--r--science/orthanc/pkg-descr20
-rw-r--r--science/orthanc/pkg-plist12
20 files changed, 442 insertions, 0 deletions
diff --git a/science/Makefile b/science/Makefile
index f324649e6d0..fe428f9bc9f 100644
--- a/science/Makefile
+++ b/science/Makefile
@@ -97,6 +97,7 @@
SUBDIR += nifticlib
SUBDIR += openbabel
SUBDIR += openkim
+ SUBDIR += orthanc
SUBDIR += p5-Algorithm-SVMLight
SUBDIR += p5-Chemistry-3DBuilder
SUBDIR += p5-Chemistry-Bond-Find
diff --git a/science/orthanc/Makefile b/science/orthanc/Makefile
new file mode 100644
index 00000000000..6b672350fbf
--- /dev/null
+++ b/science/orthanc/Makefile
@@ -0,0 +1,63 @@
+# Created by: mp39590@gmail.com
+# $FreeBSD$
+
+PORTNAME= orthanc
+PORTVERSION= 0.8.6
+CATEGORIES= science graphics net
+MASTER_SITES= SF/orthancserver/:main \
+ http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/:mongoose
+DISTFILES= Orthanc-${PORTVERSION}.tar.gz:main \
+ mongoose-3.8.tgz:mongoose
+DIST_SUBDIR= ${PORTNAME}
+
+MAINTAINER= mp39590@gmail.com
+COMMENT= RESTful DICOM server for healthcare and medical research
+
+LICENSE= GPLv3
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+LIB_DEPENDS= libcurl.so:${PORTSDIR}/ftp/curl \
+ libjsoncpp.so:${PORTSDIR}/devel/jsoncpp \
+ libuuid.so:${PORTSDIR}/misc/e2fsprogs-libuuid \
+ libglog.so:${PORTSDIR}/devel/glog \
+ libboost_filesystem.so:${PORTSDIR}/devel/boost-libs \
+ libdcmimage.so:${PORTSDIR}/devel/dcmtk \
+ libsqlite3.so:${PORTSDIR}/databases/sqlite3 \
+ libpugixml.so:${PORTSDIR}/textproc/pugixml
+
+CMAKE_ARGS= -DDCMTK_LIBRARIES="dcmdsig;charls;dcmjpls" \
+ -DDCMTK_DICTIONARY_DIR="${LOCALBASE}/share/dcmtk" \
+ -DUSE_SYSTEM_MONGOOSE=OFF \
+ -DBUILD_UNIT_TESTS=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
+WRKSRC= ${WRKDIR}/Orthanc-${PORTVERSION}
+USERS= orthanc
+GROUPS= orthanc
+
+# This is mongoose sources, downloaded from Orthanc author homepage. Orthanc
+# requires mongoose webserver, but after version 3.8, mongoose developers has
+# changed the license from MIT to GPLv2 only. This action made illegal to
+# combine new mongoose versions with GPLv3 only Orthanc.
+# We download sources manually and pass USE_SYSTEM_MONGOOSE=OFF to Orthanc
+# cmake variables to tell that mongoose is not presented on the host OS and
+# should be build together with the software instead.
+# https://www.mail-archive.com/mongoose-users@googlegroups.com/msg00625.html
+post-extract:
+ ${MKDIR} ${WRKSRC}/ThirdPartyDownloads
+ ${CP} ${DISTDIR}/${DIST_SUBDIR}/mongoose-3.8.tgz ${WRKSRC}/ThirdPartyDownloads
+
+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
+
+.include <bsd.port.mk>
diff --git a/science/orthanc/distinfo b/science/orthanc/distinfo
new file mode 100644
index 00000000000..3b35ca1b6c0
--- /dev/null
+++ b/science/orthanc/distinfo
@@ -0,0 +1,4 @@
+SHA256 (orthanc/Orthanc-0.8.6.tar.gz) = 0668e23dbdf4aa12bf417cf22bfb7b50379797fc6b1132a582789289d1728e69
+SIZE (orthanc/Orthanc-0.8.6.tar.gz) = 716036
+SHA256 (orthanc/mongoose-3.8.tgz) = 6afc2c377614a01a24b78560a62d1316b29372afe08eae3715b56c877be71c6e
+SIZE (orthanc/mongoose-3.8.tgz) = 1577314
diff --git a/science/orthanc/files/orthanc.in b/science/orthanc/files/orthanc.in
new file mode 100644
index 00000000000..3dcf4cd38fe
--- /dev/null
+++ b/science/orthanc/files/orthanc.in
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: orthanc
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add these lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# orthanc_enable (bool): Set to NO by default.
+# Set it to YES to enable Orthanc.
+# orthanc_flags (str): Set to %%ETCDIR%%/orthanc.json
+# by default.
+
+. /etc/rc.subr
+
+name=orthanc
+rcvar=orthanc_enable
+desc="RESTful DICOM server for healthcare and medical research"
+
+load_rc_config $name
+
+: ${orthanc_enable:=NO}
+: ${orthanc_flags="%%ETCDIR%%/orthanc.json"}
+
+start_precmd=orthanc_prestart
+pidfile=/var/run/orthanc.pid
+procname=%%PREFIX%%/sbin/Orthanc
+command=/usr/sbin/daemon
+command_args=" -f -p ${pidfile} -u orthanc ${procname} ${orthanc_flags}"
+
+orthanc_prestart()
+{
+ # Have to empty rc_flags so they don't get passed to daemon(8)
+ rc_flags=""
+}
+
+run_rc_command "$1"
diff --git a/science/orthanc/files/patch-CMakeLists.txt b/science/orthanc/files/patch-CMakeLists.txt
new file mode 100644
index 00000000000..c5ccbf40e9f
--- /dev/null
+++ b/science/orthanc/files/patch-CMakeLists.txt
@@ -0,0 +1,61 @@
+--- 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)
+
diff --git a/science/orthanc/files/patch-Core_Compression_HierarchicalZipWriter.cpp b/science/orthanc/files/patch-Core_Compression_HierarchicalZipWriter.cpp
new file mode 100644
index 00000000000..7c6b5da15e6
--- /dev/null
+++ b/science/orthanc/files/patch-Core_Compression_HierarchicalZipWriter.cpp
@@ -0,0 +1,11 @@
+--- 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))
diff --git a/science/orthanc/files/patch-Core_ImageFormats_ImageProcessing.cpp b/science/orthanc/files/patch-Core_ImageFormats_ImageProcessing.cpp
new file mode 100644
index 00000000000..4b040c71289
--- /dev/null
+++ b/science/orthanc/files/patch-Core_ImageFormats_ImageProcessing.cpp
@@ -0,0 +1,11 @@
+--- 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;
+ }
diff --git a/science/orthanc/files/patch-Core_MultiThreading_Mutex.cpp b/science/orthanc/files/patch-Core_MultiThreading_Mutex.cpp
new file mode 100644
index 00000000000..3d4dc4f3899
--- /dev/null
+++ b/science/orthanc/files/patch-Core_MultiThreading_Mutex.cpp
@@ -0,0 +1,20 @@
+--- 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
+ {
diff --git a/science/orthanc/files/patch-Core_MultiThreading_ThreadedCommandProcessor.cpp b/science/orthanc/files/patch-Core_MultiThreading_ThreadedCommandProcessor.cpp
new file mode 100644
index 00000000000..8c3a15502d3
--- /dev/null
+++ b/science/orthanc/files/patch-Core_MultiThreading_ThreadedCommandProcessor.cpp
@@ -0,0 +1,11 @@
+--- 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);
+ }
diff --git a/science/orthanc/files/patch-Core_Toolbox.cpp b/science/orthanc/files/patch-Core_Toolbox.cpp
new file mode 100644
index 00000000000..43c0adf253e
--- /dev/null
+++ b/science/orthanc/files/patch-Core_Toolbox.cpp
@@ -0,0 +1,38 @@
+--- 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]);
+ }
diff --git a/science/orthanc/files/patch-OrthancServer_Internals_StoreScp.cpp b/science/orthanc/files/patch-OrthancServer_Internals_StoreScp.cpp
new file mode 100644
index 00000000000..2c0b0d8f3c0
--- /dev/null
+++ b/science/orthanc/files/patch-OrthancServer_Internals_StoreScp.cpp
@@ -0,0 +1,11 @@
+--- 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))
diff --git a/science/orthanc/files/patch-Plugins_Engine_PluginsManager.cpp b/science/orthanc/files/patch-Plugins_Engine_PluginsManager.cpp
new file mode 100644
index 00000000000..11fe4e6d064
--- /dev/null
+++ b/science/orthanc/files/patch-Plugins_Engine_PluginsManager.cpp
@@ -0,0 +1,11 @@
+--- 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"
diff --git a/science/orthanc/files/patch-Plugins_Engine_SharedLibrary.cpp b/science/orthanc/files/patch-Plugins_Engine_SharedLibrary.cpp
new file mode 100644
index 00000000000..f8fa8249313
--- /dev/null
+++ b/science/orthanc/files/patch-Plugins_Engine_SharedLibrary.cpp
@@ -0,0 +1,38 @@
+--- 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
diff --git a/science/orthanc/files/patch-Resources_CMake_AutoGeneratedCode.cmake b/science/orthanc/files/patch-Resources_CMake_AutoGeneratedCode.cmake
new file mode 100644
index 00000000000..3a2adc50c63
--- /dev/null
+++ b/science/orthanc/files/patch-Resources_CMake_AutoGeneratedCode.cmake
@@ -0,0 +1,19 @@
+--- 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}
diff --git a/science/orthanc/files/patch-Resources_CMake_BoostConfiguration.cmake b/science/orthanc/files/patch-Resources_CMake_BoostConfiguration.cmake
new file mode 100644
index 00000000000..41402c0adaa
--- /dev/null
+++ b/science/orthanc/files/patch-Resources_CMake_BoostConfiguration.cmake
@@ -0,0 +1,10 @@
+--- 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
diff --git a/science/orthanc/files/patch-Resources_CMake_Compiler.cmake b/science/orthanc/files/patch-Resources_CMake_Compiler.cmake
new file mode 100644
index 00000000000..75b895d68bb
--- /dev/null
+++ b/science/orthanc/files/patch-Resources_CMake_Compiler.cmake
@@ -0,0 +1,21 @@
+--- 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()
+
+
diff --git a/science/orthanc/files/patch-Resources_CMake_SQLiteConfiguration.cmake b/science/orthanc/files/patch-Resources_CMake_SQLiteConfiguration.cmake
new file mode 100644
index 00000000000..7d5887441e0
--- /dev/null
+++ b/science/orthanc/files/patch-Resources_CMake_SQLiteConfiguration.cmake
@@ -0,0 +1,15 @@
+--- 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}")
diff --git a/science/orthanc/files/patch-Resources_Configuration.json b/science/orthanc/files/patch-Resources_Configuration.json
new file mode 100644
index 00000000000..1cab6a60b0d
--- /dev/null
+++ b/science/orthanc/files/patch-Resources_Configuration.json
@@ -0,0 +1,25 @@
+--- Resources/Configuration.json.orig 2015-02-12 13:47:38 UTC
++++ Resources/Configuration.json
+@@ -9,12 +9,12 @@
+
+ // Path to the directory that holds the heavyweight files
+ // (i.e. the raw DICOM instances)
+- "StorageDirectory" : "OrthancStorage",
++ "StorageDirectory" : "/var/db/orthanc/db-v5",
+
+ // 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" : "/var/db/orthanc/db-v5",
+
+ // Enable the transparent compression of the DICOM instances
+ "StorageCompression" : false,
+@@ -39,6 +39,7 @@
+ // folders, in which case they will be scanned non-recursively to
+ // find shared libraries.
+ "Plugins" : [
++ "%%PREFIX%%/share/orthanc/plugins/"
+ ],
+
+
diff --git a/science/orthanc/pkg-descr b/science/orthanc/pkg-descr
new file mode 100644
index 00000000000..37e9b4d2806
--- /dev/null
+++ b/science/orthanc/pkg-descr
@@ -0,0 +1,20 @@
+Orthanc aims at providing a simple, yet powerful standalone DICOM
+server. It is designed to improve the DICOM flows in hospitals and to
+support research about the automated analysis of medical images.
+
+Orthanc can turn any computer running Windows, Linux, FreeBSD or OS X
+into a DICOM store (in other words, a mini-PACS system). Its
+architecture is lightweight and standalone, meaning that no complex
+database administration is required, nor the installation of third-party
+dependencies.
+
+What makes Orthanc unique is the fact that it provides a RESTful API.
+Thanks to this major feature, it is possible to drive Orthanc from any
+computer language. The DICOM tags of the stored medical images can be
+downloaded in the JSON file format. Furthermore, standard PNG images can
+be generated on-the-fly from the DICOM instances by Orthanc.
+
+Orthanc lets its users focus on the content of the DICOM files, hiding
+the complexity of the DICOM format and of the DICOM protocol.
+
+WWW: http://www.orthanc-server.com/
diff --git a/science/orthanc/pkg-plist b/science/orthanc/pkg-plist
new file mode 100644
index 00000000000..212eb95a20f
--- /dev/null
+++ b/science/orthanc/pkg-plist
@@ -0,0 +1,12 @@
+@dir(orthanc,orthanc,700) %%DATADIR%%/plugins
+@dir(orthanc,orthanc,700) /var/db/orthanc/db/db-v5
+@dir(orthanc,orthanc,700) /var/db/orthanc/db
+@dir(orthanc,orthanc,700) /var/db/orthanc
+@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
+sbin/Orthanc