# HG changeset patch # User Sebastien Jodogne # Date 1541417416 -3600 # Node ID ebd2c9ba66c49d4db2e47c50ebfdd2d8392fcc7b # Parent c226799724bf1a8a5eec5692950de182bfaeef8c patch for compatibility with Cocoa on OS X diff -r c226799724bf -r ebd2c9ba66c4 Resources/CMake/UuidConfiguration.cmake --- a/Resources/CMake/UuidConfiguration.cmake Mon Nov 05 11:57:16 2018 +0100 +++ b/Resources/CMake/UuidConfiguration.cmake Mon Nov 05 12:30:16 2018 +0100 @@ -5,8 +5,31 @@ SET(E2FSPROGS_URL "http://www.orthanc-server.com/downloads/third-party/e2fsprogs-1.43.8.tar.gz") SET(E2FSPROGS_MD5 "670b7a74a8ead5333acf21b9afc92b3c") + if (IS_DIRECTORY "${E2FSPROGS_SOURCES_DIR}") + set(FirstRun OFF) + else() + set(FirstRun ON) + endif() + DownloadPackage(${E2FSPROGS_MD5} ${E2FSPROGS_URL} "${E2FSPROGS_SOURCES_DIR}") + + ## + ## Patch for OS X, in order to be compatible with Cocoa (used in Stone) + ## + + execute_process( + COMMAND ${PATCH_EXECUTABLE} -p0 -N -i + ${ORTHANC_ROOT}/Resources/Patches/e2fsprogs-1.43.8-apple.patch + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + RESULT_VARIABLE Failure + ) + + if (FirstRun AND Failure) + message(FATAL_ERROR "Error while patching a file") + endif() + + include_directories( BEFORE ${E2FSPROGS_SOURCES_DIR}/lib ) diff -r c226799724bf -r ebd2c9ba66c4 Resources/Patches/e2fsprogs-1.43.8-apple.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Resources/Patches/e2fsprogs-1.43.8-apple.patch Mon Nov 05 12:30:16 2018 +0100 @@ -0,0 +1,24 @@ +diff -urEb e2fsprogs-1.43.8.orig/lib/uuid/uuid.h.in e2fsprogs-1.43.8/lib/uuid/uuid.h.in +--- e2fsprogs-1.43.8.orig/lib/uuid/uuid.h.in 2018-01-02 05:52:58.000000000 +0100 ++++ e2fsprogs-1.43.8/lib/uuid/uuid.h.in 2018-11-05 12:18:29.962235770 +0100 +@@ -35,6 +35,20 @@ + #ifndef _UUID_UUID_H + #define _UUID_UUID_H + ++ ++#if defined(__APPLE__) ++// This patch defines the "uuid_string_t" type on OS X, which is ++// required if linking against Cocoa (this occurs in Stone of Orthanc) ++#include ++#include ++ ++#ifndef _UUID_STRING_T ++#define _UUID_STRING_T ++typedef __darwin_uuid_string_t uuid_string_t; ++#endif /* _UUID_STRING_T */ ++#endif ++ ++ + #include + #ifndef _WIN32 + #include