Mercurial > hg > orthanc-python
changeset 22:04b8a44b2717
adding patch.exe command-line tool for MSVC
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 03 Apr 2020 10:47:01 +0200 |
parents | 67f48fc2fd69 |
children | 874a3fef26ff |
files | NEWS Resources/Orthanc/Resources/LinuxStandardBaseToolchain.cmake Resources/Orthanc/Resources/ThirdParty/patch/NOTES.txt Resources/Orthanc/Resources/ThirdParty/patch/msys-1.0.dll Resources/Orthanc/Resources/ThirdParty/patch/patch.exe Resources/Orthanc/Resources/ThirdParty/patch/patch.exe.manifest Resources/SyncOrthancFolder.py |
diffstat | 7 files changed, 104 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/NEWS Fri Apr 03 10:45:43 2020 +0200 +++ b/NEWS Fri Apr 03 10:47:01 2020 +0200 @@ -1,6 +1,8 @@ Pending changes in the mainline =============================== +* Fix compilation using Visual Studio + Version 1.0 (2020-04-01) ========================
--- a/Resources/Orthanc/Resources/LinuxStandardBaseToolchain.cmake Fri Apr 03 10:45:43 2020 +0200 +++ b/Resources/Orthanc/Resources/LinuxStandardBaseToolchain.cmake Fri Apr 03 10:47:01 2020 +0200 @@ -1,4 +1,12 @@ -# LSB_CC=gcc-4.8 LSB_CXX=g++-4.8 cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=../Resources/LinuxStandardBaseToolchain.cmake -DUSE_LEGACY_JSONCPP=ON -DUSE_LEGACY_LIBICU=ON -DBOOST_LOCALE_BACKEND=icu -G Ninja +# +# Full build, as used on the BuildBot CIS: +# +# $ LSB_CC=gcc-4.8 LSB_CXX=g++-4.8 cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=../Resources/LinuxStandardBaseToolchain.cmake -DUSE_LEGACY_JSONCPP=ON -DUSE_LEGACY_LIBICU=ON -DBOOST_LOCALE_BACKEND=icu -DENABLE_PKCS11=ON -G Ninja +# +# Or, more lightweight version (without libp11 and ICU): +# +# $ LSB_CC=gcc-4.8 LSB_CXX=g++-4.8 cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=../Resources/LinuxStandardBaseToolchain.cmake -DUSE_LEGACY_JSONCPP=ON -G Ninja +# INCLUDE(CMakeForceCompiler)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Resources/Orthanc/Resources/ThirdParty/patch/NOTES.txt Fri Apr 03 10:47:01 2020 +0200 @@ -0,0 +1,70 @@ +=========== +INFORMATION +=========== + +This is a precompiled version of the "patch" standard tool for +Windows. It was compiled using the MSYS framework. + +The binaries originate from the "Git for Windows 1.9.5" package +(https://msysgit.github.io/). The build instructions have been +provided on the discussion group of Git for Windows [1]. They are +copied/pasted below for reference. + + + +================ +UPSTREAM PROJECT +================ + +URL to the upstream project: +http://savannah.gnu.org/projects/patch/ + +License of patch: GPLv2 (GNU General Public License v2) + +Copyright (C) 1988 Larry Wall "with lots o' patches by Paul Eggert" +Copyright (C) 1997 Free Software Foundation, Inc. + + + +====================== +BUILD INSTRUCTIONS [1] +====================== + +The easiest way to find out about this is to install the Git SDK, then +run + + pacman -Qu $(which patch.exe) + +to find out which package contains the `patch.exe` binary. It so happens +to be patch.2.7.5-1 at the moment. Since this is an MSys2 package (not a +MinGW one, otherwise the patch utility would be in /mingw64/bin/, not +/usr/bin/), this package is built from the recipes in + + https://github.com/msys2/MSYS2-packages + +The `patch` package is obviously built from the subdirectory + + https://github.com/Alexpux/MSYS2-packages/tree/master/patch + +and the PKGBUILD file specifies that the source is fetched from +ftp://ftp.gnu.org/gnu/patch/patch-2.7.5.tar.xz: + +https://github.com/Alexpux/MSYS2-packages/blob/900744becd072f687029b0f830ab6fe95cf533d6/patch/PKGBUILD#L14 + +and then these two patches are applied before building: + +https://github.com/Alexpux/MSYS2-packages/blob/900744becd072f687029b0f830ab6fe95cf533d6/patch/msys2-patch-2.7.1.patch + +and + +https://github.com/Alexpux/MSYS2-packages/blob/900744becd072f687029b0f830ab6fe95cf533d6/patch/msys2-patch-manifest.patch + +As you can see, some light changes are applied, i.e. `patch.exe` will +always write in binary mode with MSys2, and the executable will have a +manifest embedded that allows it to run as non-administrator. + +Ciao, +Johannes Schindelin + + +[1] https://groups.google.com/d/msg/git-for-windows/xWyVr4z6Ri0/6RKeV028EAAJ
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Resources/Orthanc/Resources/ThirdParty/patch/patch.exe.manifest Fri Apr 03 10:47:01 2020 +0200 @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> + <assemblyIdentity version="7.95.0.0" + processorArchitecture="X86" + name="patch.exe" + type="win32"/> + + <!-- Identify the application security requirements. --> + <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> + <security> + <requestedPrivileges> + <requestedExecutionLevel + level="asInvoker" + uiAccess="false"/> + </requestedPrivileges> + </security> + </trustInfo> +</assembly> +
--- a/Resources/SyncOrthancFolder.py Fri Apr 03 10:45:43 2020 +0200 +++ b/Resources/SyncOrthancFolder.py Fri Apr 03 10:47:01 2020 +0200 @@ -30,6 +30,10 @@ 'Resources/MinGW-W64-Toolchain64.cmake', 'Resources/MinGWToolchain.cmake', 'Resources/Patches/boost-1.69.0-linux-standard-base.patch', + 'Resources/ThirdParty/patch/NOTES.txt', + 'Resources/ThirdParty/patch/msys-1.0.dll', + 'Resources/ThirdParty/patch/patch.exe', + 'Resources/ThirdParty/patch/patch.exe.manifest', 'Resources/WindowsResources.py', 'Resources/WindowsResources.rc', ]