From fe08ec25be92b0b6bde945a85d0c23be691c1130 Mon Sep 17 00:00:00 2001 From: Janez Zibert Date: Fri, 21 Feb 2025 08:44:34 +0100 Subject: [PATCH] Priprava za prevajanje plugina za LSB --- Resources/holy-build-box-compile.sh | 37 +++++++++++++ Resources/holy-build-box-internal.sh | 50 ++++++++++++++++++ WebApplication/index.html | 2 +- .../src/assets/images/orthanc-stata.png | Bin 0 -> 159091 bytes WebApplication/src/components/SideBar.vue | 4 +- .../orthanc/plugins/libOrthancExplorer2.so | 1 + .../plugins/libOrthancExplorer2.so.mainline | Bin 0 -> 52003456 bytes 7 files changed, 91 insertions(+), 3 deletions(-) create mode 100755 Resources/holy-build-box-compile.sh create mode 100644 Resources/holy-build-box-internal.sh create mode 100644 WebApplication/src/assets/images/orthanc-stata.png create mode 120000 holy-build-box/share/orthanc/plugins/libOrthancExplorer2.so create mode 100755 holy-build-box/share/orthanc/plugins/libOrthancExplorer2.so.mainline diff --git a/Resources/holy-build-box-compile.sh b/Resources/holy-build-box-compile.sh new file mode 100755 index 0000000..efaf0ad --- /dev/null +++ b/Resources/holy-build-box-compile.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +## +## This script compiles cross-distribution Linux binaries thanks to +## Holy Build Box: https://github.com/phusion/holy-build-box +## +## The ideal solution would be to use Linux Standard Base +## (LSB). Unfortunately, the LSB C++ compiler is a pre-4.8 gcc that +## does not feature full C++11 capabilities, which prevents compiling +## GDCM >= 3.0. +## + +set -ex + + +if [ "$1" != "Debug" -a "$1" != "Release" ]; then + echo "Please provide build type: Debug or Release" + exit -1 +fi + +if [ -t 1 ]; then + # TTY is available => use interactive mode + DOCKER_FLAGS='-i' +fi + +ROOT_DIR=`dirname $(readlink -f $0)`/.. + +mkdir -p ${ROOT_DIR}/holy-build-box + +docker run -t ${DOCKER_FLAGS} --rm \ + --user $(id -u):$(id -g) \ + -v ${ROOT_DIR}:/source:ro \ + -v ${ROOT_DIR}/holy-build-box:/target:rw \ + phusion/holy-build-box-64:3.0.5 \ + bash /source/Resources/holy-build-box-internal.sh $1 + +ls -lR ${ROOT_DIR}/holy-build-box/ diff --git a/Resources/holy-build-box-internal.sh b/Resources/holy-build-box-internal.sh new file mode 100644 index 0000000..0c3c83c --- /dev/null +++ b/Resources/holy-build-box-internal.sh @@ -0,0 +1,50 @@ +#!/bin/bash +set -e + +# Activate Holy Build Box environment. +source /hbb_exe/activate + +set -x + + +# Download Mercurial to use the mainline of Orthanc framework +MERCURIAL_VERSION=5.3 +curl https://www.mercurial-scm.org/release/mercurial-${MERCURIAL_VERSION}.tar.gz > /tmp/mercurial.tar.gz +cd /tmp +tar xvf mercurial.tar.gz +export PATH=$PATH:/tmp/mercurial-${MERCURIAL_VERSION} + + +mkdir /tmp/build +cd /tmp/build + +# Holy Build Box defines LDFLAGS as "-L/hbb_exe/lib +# -static-libstdc++". The "-L/hbb_exe/lib" option results in linking +# errors "undefined reference" to `std::__once_callable', +# 'std::__once_call' and '__once_proxy'. +export LDFLAGS=-static-libstdc++ +unset LDPATHFLAGS +unset SHLIB_LDFLAGS +unset LD_LIBRARY_PATH +unset LIBRARY_PATH + +mkdir /tmp/source-writeable + +cp -r /source/CMakeLists.txt /tmp/source-writeable/ +cp -r /source/Plugin /tmp/source-writeable/ + +cp -r /source/Resources /tmp/source-writeable/ +#cp -r /source/UnitTestsSources /tmp/source-writeable/ +cp -r /source/WebApplication /tmp/source-writeable/ + +cmake /tmp/source-writeable \ + -DCMAKE_BUILD_TYPE=$1 -DSTATIC_BUILD=ON \ + -DCMAKE_INSTALL_PREFIX=/target + +make -j`nproc` + +# if [ "$1" == "Release" ]; then +# strip ./libOrthancDicomWeb.so +# fi + +make install \ No newline at end of file diff --git a/WebApplication/index.html b/WebApplication/index.html index 624e575..a28a9f8 100644 --- a/WebApplication/index.html +++ b/WebApplication/index.html @@ -4,7 +4,7 @@ - ... + AI PACS