From aca562168544175b3e4675a2c061fdf769666b07 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Wed, 26 Feb 2025 12:50:03 +0100 Subject: [PATCH] orthanc: init at 1.12.6 --- .../or/orthanc/add-missing-include.patch | 10 ++ pkgs/by-name/or/orthanc/package.nix | 115 ++++++++++++++++++ 2 files changed, 125 insertions(+) create mode 100644 pkgs/by-name/or/orthanc/add-missing-include.patch create mode 100644 pkgs/by-name/or/orthanc/package.nix diff --git a/pkgs/by-name/or/orthanc/add-missing-include.patch b/pkgs/by-name/or/orthanc/add-missing-include.patch new file mode 100644 index 000000000000..48ada55a9ece --- /dev/null +++ b/pkgs/by-name/or/orthanc/add-missing-include.patch @@ -0,0 +1,10 @@ +diff -r cba3e8ca3a87 OrthancServer/Sources/OrthancInitialization.cpp +--- a/Sources/OrthancInitialization.cpp Tue Mar 11 10:46:15 2025 +0100 ++++ b/Sources/OrthancInitialization.cpp Thu Mar 13 18:20:00 2025 +0100 +@@ -59,6 +59,7 @@ + # undef __FILE__ + # define __FILE__ __ORTHANC_FILE__ + # endif ++# include + # include + #endif diff --git a/pkgs/by-name/or/orthanc/package.nix b/pkgs/by-name/or/orthanc/package.nix new file mode 100644 index 000000000000..3f48c94beff9 --- /dev/null +++ b/pkgs/by-name/or/orthanc/package.nix @@ -0,0 +1,115 @@ +{ + lib, + stdenv, + fetchhg, + boost, + charls, + civetweb, + cmake, + curl, + dcmtk, + gtest, + jsoncpp, + libjpeg, + libpng, + libuuid, + log4cplus, + lua, + openssl, + protobuf, + pugixml, + python3, + sqlite, + unzip, + versionCheckHook, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "orthanc"; + version = "1.12.6"; + + src = fetchhg { + url = "https://orthanc.uclouvain.be/hg/orthanc/"; + rev = "Orthanc-${finalAttrs.version}"; + hash = "sha256-1ztA95PiCGL1oD6zVfsEhwrwGNID13/NcyZDD3eHYv0="; + }; + + patches = [ + # Without this patch, the build fails to find `GOOGLE_PROTOBUF_VERIFY_VERSION` + # The patch has been included upstream, it need to be removed in the next release. + ./add-missing-include.patch + ]; + + sourceRoot = "${finalAttrs.src.name}/OrthancServer"; + + nativeBuildInputs = [ + cmake + protobuf + python3 + unzip + ]; + + buildInputs = [ + protobuf + boost + charls + civetweb + curl + dcmtk + gtest + jsoncpp + libjpeg + libpng + libuuid + log4cplus + lua + openssl + pugixml + sqlite + ]; + + strictDeps = true; + + enableParallelBuilding = true; + + cmakeFlags = [ + (lib.cmakeFeature "DCMTK_DICTIONARY_DIR_AUTO" "${dcmtk}/share/dcmtk-${dcmtk.version}") + (lib.cmakeFeature "DCMTK_LIBRARIES" "dcmjpls;oflog;ofstd") + (lib.cmakeFeature "CMAKE_BUILD_TYPE" "Release") + + (lib.cmakeBool "BUILD_CONNECTIVITY_CHECKS" false) + (lib.cmakeBool "UNIT_TESTS_WITH_HTTP_CONNEXIONS" false) + (lib.cmakeBool "STANDALONE_BUILD" true) + (lib.cmakeBool "USE_SYSTEM_BOOST" true) + (lib.cmakeBool "USE_SYSTEM_CIVETWEB" true) + (lib.cmakeBool "USE_SYSTEM_DCMTK" true) + (lib.cmakeBool "USE_SYSTEM_GOOGLE_TEST" true) + (lib.cmakeBool "USE_SYSTEM_JSONCPP" true) + (lib.cmakeBool "USE_SYSTEM_LIBICONV" true) + (lib.cmakeBool "USE_SYSTEM_LIBJPEG" true) + (lib.cmakeBool "USE_SYSTEM_LIBPNG" true) + (lib.cmakeBool "USE_SYSTEM_LUA" true) + (lib.cmakeBool "USE_SYSTEM_OPENSSL" true) + (lib.cmakeBool "USE_SYSTEM_PROTOBUF" true) + (lib.cmakeBool "USE_SYSTEM_PUGIXML" true) + (lib.cmakeBool "USE_SYSTEM_SQLITE" true) + (lib.cmakeBool "USE_SYSTEM_UUID" true) + (lib.cmakeBool "USE_SYSTEM_ZLIB" true) + ]; + + nativeInstallCheckInputs = [ + versionCheckHook + ]; + versionCheckProgram = "${placeholder "out"}/bin/${finalAttrs.meta.mainProgram}"; + versionCheckProgramArg = "--version"; + doInstallCheck = true; + + meta = { + description = "Orthanc is a lightweight, RESTful DICOM server for healthcare and medical research"; + homepage = "https://www.orthanc-server.com/"; + license = lib.licenses.gpl3Plus; + mainProgram = "Orthanc"; + maintainers = with lib.maintainers; [ drupol ]; + platforms = lib.platforms.linux; + }; +})