Bug 199146

Summary: new port: science/orthanc: DICOM (medical imaging) service for hospitals
Product: Ports & Packages Reporter: mp39590
Component: Individual Port(s)Assignee: Dmitry Marakasov <amdmi3>
Status: Closed FIXED    
Severity: Affects Only Me CC: amdmi3, s.jodogne
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
shell archive
none
patch for new users/groups
none
poudriere build logs
none
shell archive v2 none

Description mp39590 2015-04-03 12:12:35 UTC
Created attachment 155156 [details]
shell archive

Orthanc is a service which allows hospitals easily save, exchange and analyze results of patient's tomography stored in DICOM imaging format. RESTful API provides ways to access this data with simple web browser and other tools which can talk http protocol (curl, for example).

This service drastically lower costs for hospitals in terms of paper work.
Comment 1 mp39590 2015-04-03 12:13:17 UTC
Created attachment 155157 [details]
patch for new users/groups
Comment 2 mp39590 2015-04-03 12:14:25 UTC
Created attachment 155158 [details]
poudriere build logs
Comment 3 Dmitry Marakasov freebsd_committer freebsd_triage 2015-05-30 00:37:44 UTC
- patch-Core_MultiThreading_ThreadedCommandProcessor.cpp seem to be incorrect. That should be while (!(remainingCommands_ == 0)) or while (remainingCommands_ != 0), see currenct source
- What does patch-OrthancServer_Internals_StoreScp.cpp do? Haven't checked, but judging from the code there should be no warning here
- You can't hardcode /usr/local (patch-Resources_CMake_Compiler.cmake, patch-Resources_CMake_DcmtkConfiguration.cmake, probably more cmake files), as it may be changed. Use ${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|' to fix that.
- You should use /var instead of ${PREFIX}/var
- You should use single post-install target, no need for post-stage:
- What does glog IGNORE mean? If it's glog problem, it should be fixed/marked broken in glog itself. For me glog builds fine on 8.4 and 9.3.

It's nice that most patches were merged upstream.
Comment 4 mp39590 2015-05-30 21:24:21 UTC
jk(In reply to Dmitry Marakasov from comment #3)
> - patch-Core_MultiThreading_ThreadedCommandProcessor.cpp seem to be
> incorrect. That should be while (!(remainingCommands_ == 0)) or while
> (remainingCommands_ != 0), see currenct source
Originally my patch was fixing a warning, and it didn't change the logic of the loop, looking at the change in repo, it seem that the logic really has been changed[1].
I've sync'ed the chunk with upstream, but would like to ask Sébastien's opinion on it - is everything safe with the linked change?

> - What does patch-OrthancServer_Internals_StoreScp.cpp do? Haven't checked,
> but judging from the code there should be no warning here
If you do == operation and use double parenthesis clang gives a warning, double parenthesis are for the case when you do assignment (=) inside an expression.

> - You can't hardcode /usr/local (patch-Resources_CMake_Compiler.cmake,
> patch-Resources_CMake_DcmtkConfiguration.cmake, probably more cmake files),
> as it may be changed. Use ${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|'
> to fix that.
I've worked around this with passing proper CFLAGS and LDFLAGS, another /usr/local usage was in dcmtk dictionary detection - worked around with CMAKE_ARGS var addition. Offending chunks are removed.

> - You should use /var instead of ${PREFIX}/var
Fixed. %%PREFIX%%/var/lib/orthanc/db-v5 -> /var/db/orthanc/db-v5. Original intention was to be close to debian port, but seem hier(7) don't have /var/lib entry, so /var/db is used.

> - You should use single post-install target, no need for post-stage:
Fixed.

> - What does glog IGNORE mean? If it's glog problem, it should be
> fixed/marked broken in glog itself. For me glog builds fine on 8.4 and 9.3.
At the time of submission of the shar I wasn't able to build glog on anything <10.1, also, no packages of glog were presented in pkg.freebsd.org for aforementioned releases, it looks like it has been fixed now. IGNORE removed.
 
> It's nice that most patches were merged upstream.

Few problem arose though:
1. GCC [not clang => 8.4, 9.3] compilation of Orthanc uses -pedantic, it doesn't like enum's with commas after last element, and those are presented in boost-lib, workarounded this with removing of -pedantic.

2. It looks like because of debugging features which are enabled on -current Orthanc, when being stopped (service orthanc stop), exits with SIGBUS signal, after investigation it looks like it's a fault of dcmtk lib, I've submitted bug 200544 about it, but I don't think it's a show-stopper.

[1] - https://code.google.com/p/orthanc/source/detail?r=7f0aa3c0f659b1e0c531bfc7284ad7766a202bb7
Comment 5 mp39590 2015-05-30 21:24:46 UTC
Created attachment 157294 [details]
shell archive v2
Comment 6 Dmitry Marakasov freebsd_committer freebsd_triage 2015-06-04 14:07:00 UTC
(In reply to mp39590 from comment #4)
> If you do == operation and use double parenthesis clang gives a warning, double parenthesis are for the case when you do assignment (=) inside an expression.

Ok, I misunderstood the patch, I though it did the opposite.

> Fixed. %%PREFIX%%/var/lib/orthanc/db-v5 -> /var/db/orthanc/db-v5. Original intention was to be close to debian port, but seem hier(7) don't have /var/lib entry, so /var/db is used.

You could actually use /var/lib, but /var/db is preferred on FreeBSD.

> At the time of submission of the shar I wasn't able to build glog on anything <10.1, also, no packages of glog were presented in pkg.freebsd.org for aforementioned releases, it looks like it has been fixed now. IGNORE removed.

IGNORE was illegal regardless. Ports should not handle other ports' problems.

> 1. GCC [not clang => 8.4, 9.3] compilation of Orthanc uses -pedantic, it doesn't like enum's with commas after last element, and those are presented in boost-lib, workarounded this with removing of -pedantic.

This could probably be fixed in orthanc cmake: include_directories() supports SYSTEM argument which should be used for boost and other dependencies' includes. This should make warnings in these headers ignored.
Comment 7 commit-hook freebsd_committer freebsd_triage 2015-06-04 14:07:51 UTC
A commit references this bug:

Author: amdmi3
Date: Thu Jun  4 14:07:38 UTC 2015
New revision: 388534
URL: https://svnweb.freebsd.org/changeset/ports/388534

Log:
  - 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

Changes:
  head/GIDs
  head/UIDs
  head/science/Makefile
  head/science/orthanc/
  head/science/orthanc/Makefile
  head/science/orthanc/distinfo
  head/science/orthanc/files/
  head/science/orthanc/files/orthanc.in
  head/science/orthanc/files/patch-CMakeLists.txt
  head/science/orthanc/files/patch-Core_Compression_HierarchicalZipWriter.cpp
  head/science/orthanc/files/patch-Core_ImageFormats_ImageProcessing.cpp
  head/science/orthanc/files/patch-Core_MultiThreading_Mutex.cpp
  head/science/orthanc/files/patch-Core_MultiThreading_ThreadedCommandProcessor.cpp
  head/science/orthanc/files/patch-Core_Toolbox.cpp
  head/science/orthanc/files/patch-OrthancServer_Internals_StoreScp.cpp
  head/science/orthanc/files/patch-Plugins_Engine_PluginsManager.cpp
  head/science/orthanc/files/patch-Plugins_Engine_SharedLibrary.cpp
  head/science/orthanc/files/patch-Resources_CMake_AutoGeneratedCode.cmake
  head/science/orthanc/files/patch-Resources_CMake_BoostConfiguration.cmake
  head/science/orthanc/files/patch-Resources_CMake_Compiler.cmake
  head/science/orthanc/files/patch-Resources_CMake_SQLiteConfiguration.cmake
  head/science/orthanc/files/patch-Resources_Configuration.json
  head/science/orthanc/pkg-descr
  head/science/orthanc/pkg-plist