Commit b49b2351 authored by Pol Dellaiera's avatar Pol Dellaiera
Browse files

orthanc-plugin-dicomweb: init at 1.18

parent 1c5f4c04
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
diff -r ad41d16f36b1 Resources/Orthanc/CMake/DownloadOrthancFramework.cmake
--- a/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake	Fri Jan 17 12:24:54 2025 +0100
+++ b/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake	Thu Mar 20 17:45:59 2025 +0100
@@ -552,9 +552,10 @@
     set(ORTHANC_FRAMEWORK_INCLUDE_DIR ${ORTHANC_FRAMEWORK_ROOT})
   else()
     find_path(ORTHANC_FRAMEWORK_INCLUDE_DIR OrthancFramework.h
-      /usr/include/orthanc-framework
-      /usr/local/include/orthanc-framework
+      /usr/
+      /usr/local/
       ${ORTHANC_FRAMEWORK_ROOT}
+      PATH_SUFFIXES include include/orthanc-framework
       )
   endif()
 
+106 −0
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchhg,
  fetchurl,
  orthanc,
  cmake,
  python3,
  unzip,
  gtest,
  jsoncpp,
  boost,
  pugixml,
  libuuid,
  zlib,
  pkg-config,
}:

let
  bootstrap = fetchurl {
    url = "https://orthanc.uclouvain.be/downloads/third-party-downloads/bootstrap-5.3.3.zip";
    hash = "sha256-VdfxznlQQK+4MR3wnSnQ00ZIQAweqrstCi7SIWs9sF0=";
  };
  vuejs = fetchurl {
    url = "https://orthanc.uclouvain.be/downloads/third-party-downloads/dicom-web/vuejs-2.6.10.tar.gz";
    hash = "sha256-49kAzZJmtb7Zu21XX8mrZ4fnnnrSHAHuEne/9UUxIfI=";
  };
  axios = fetchurl {
    url = "https://orthanc.uclouvain.be/downloads/third-party-downloads/dicom-web/axios-0.19.0.tar.gz";
    hash = "sha256-KVd8YIWwkLTkqZOS/N1YL7a7y0myqvLMe3+jh0Ups4A=";
  };
  font-awesome = fetchurl {
    url = "https://orthanc.uclouvain.be/downloads/third-party-downloads/dicom-web/Font-Awesome-4.7.0.tar.gz";
    hash = "sha256-3lEroOHerTgrv843LN50s/GJcdh2//tjXukzPw2wXUM=";
  };
  babel-polyfill = fetchurl {
    url = "https://orthanc.uclouvain.be/downloads/third-party-downloads/dicom-web/babel-polyfill-6.26.0.min.js.gz";
    hash = "sha256-CH09LWISr7QY9QSRhY9/BVy1Te+2NR1sXQCPZioqlcI=";
  };
in
stdenv.mkDerivation (finalAttrs: {
  pname = "orthanc-plugin-dicomweb";
  version = "1.18";

  src = fetchhg {
    url = "https://orthanc.uclouvain.be/hg/orthanc-dicomweb/";
    rev = "OrthancDicomWeb-${finalAttrs.version}";
    hash = "sha256-ee271Fcu8yi1gZpTWrCuqhsBdFcPR/JK/fsnJg8PwIc=";
  };

  patches = [
    # Fix Orthanc Framework headers files detection
    ./fix-orthanc-framework-headers-detection.patch
  ];

  postPatch = ''
    mkdir -p ThirdPartyDownloads
    ln -s ${bootstrap} ThirdPartyDownloads/bootstrap-5.3.3.zip
    ln -s ${vuejs} ThirdPartyDownloads/vuejs-2.6.10.tar.gz
    ln -s ${axios} ThirdPartyDownloads/axios-0.19.0.tar.gz
    ln -s ${font-awesome} ThirdPartyDownloads/Font-Awesome-4.7.0.tar.gz
    ln -s ${babel-polyfill} ThirdPartyDownloads/babel-polyfill-6.26.0.min.js.gz
  '';

  SourceRoot = "${finalAttrs.src.name}/Build";

  nativeBuildInputs = [
    cmake
    python3
    unzip
  ];

  buildInputs = [
    orthanc
    orthanc.framework
    jsoncpp
    boost
    gtest
    libuuid
    pugixml
    zlib
  ];

  strictDeps = true;

  NIX_LDFLAGS = lib.strings.concatStringsSep " " [
    "-L${lib.getLib gtest}"
    "-lgtest"
  ];

  cmakeFlags = [
    "-DCMAKE_BUILD_TYPE=Release"
    "-DSTATIC_BUILD=OFF"
    "-DORTHANC_FRAMEWORK_SOURCE=system"
  ];

  meta = {
    description = "Plugin that extends Orthanc with support for the DICOMweb protocols";
    license = lib.licenses.gpl3Plus;
    maintainers = with lib.maintainers; [
      drupol
      dvcorreia
    ];
    platforms = lib.platforms.linux;
  };
})