From aecd5ceb0995affef18d6f78f932a38d92182265 Mon Sep 17 00:00:00 2001 From: Hugh Bellamy Date: Wed, 4 Apr 2018 15:11:38 +0100 Subject: [PATCH] Convert Windows to use vckpg instead of nuget (#277) This is better as we don't need to maintain our own dependency on hexchat's GTK and we can rely on the vcpkg community --- .jenkins-windows.ps1 | 17 +++++++++++++++++ .jenkins-windows.sh | 20 -------------------- README.md | 12 +++--------- src/libgdiplus.vcxproj | 41 +++-------------------------------------- src/packages.config | 12 ------------ 5 files changed, 23 insertions(+), 79 deletions(-) create mode 100755 .jenkins-windows.ps1 delete mode 100755 .jenkins-windows.sh delete mode 100644 src/packages.config diff --git a/.jenkins-windows.ps1 b/.jenkins-windows.ps1 new file mode 100755 index 000000000..c8f328f40 --- /dev/null +++ b/.jenkins-windows.ps1 @@ -0,0 +1,17 @@ +if (-not (Test-Path vcpkg)) { + git clone https://github.com/Microsoft/vcpkg.git + cd vcpkg + .\bootstrap-vcpkg.bat + .\vcpkg.exe integrate install + # NOTE: update README.md too when updating these packages + .\vcpkg.exe install giflib libjpeg-turbo libpng cairo glib tiff libexif glib pango + .\vcpkg.exe install giflib libjpeg-turbo libpng cairo glib tiff libexif glib pango --triplet x64-windows + cd .. +} + +& "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" -p:PlatformToolset=v140 -p:Platform=Win32 -p:Configuration=Debug libgdiplus.sln +& "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" -p:PlatformToolset=v140 -p:Platform=Win32 -p:Configuration=Release libgdiplus.sln +& "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" -p:PlatformToolset=v140 -p:Platform=x64 -p:Configuration=Debug libgdiplus.sln +& "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" -p:PlatformToolset=v140 -p:Platform=x64 -p:Configuration=Release libgdiplus.sln + +Compress-Archive -DestinationPath libgdiplus.zip -Path Win32,x64 diff --git a/.jenkins-windows.sh b/.jenkins-windows.sh deleted file mode 100755 index ec7ff2a2a..000000000 --- a/.jenkins-windows.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -xe - -export PATH=/usr/bin:/usr/local/bin:$PATH - -# NOTE: update README.md too when updating these urls -wget "https://dl.hexchat.net/gtk/gtk-win32-2018-03-13.7z" -O gtk-Win32.7z -wget "https://dl.hexchat.net/gtk/gtk-x64-2018-03-13.7z" -O gtk-x64.7z -wget "https://dist.nuget.org/win-x86-commandline/v4.1.0/nuget.exe" -O nuget.exe - -7z x gtk-Win32.7z -ogtk -7z x gtk-x64.7z -ogtk -chmod +x nuget.exe - -./nuget.exe restore -/cygdrive/c/Program\ Files\ \(x86\)/MSBuild/14.0/Bin/MSBuild.exe /p:PlatformToolset=v140 /p:Platform=Win32 /p:Configuration=Debug libgdiplus.sln -/cygdrive/c/Program\ Files\ \(x86\)/MSBuild/14.0/Bin/MSBuild.exe /p:PlatformToolset=v140 /p:Platform=Win32 /p:Configuration=Release libgdiplus.sln -/cygdrive/c/Program\ Files\ \(x86\)/MSBuild/14.0/Bin/MSBuild.exe /p:PlatformToolset=v140 /p:Platform=x64 /p:Configuration=Debug libgdiplus.sln -/cygdrive/c/Program\ Files\ \(x86\)/MSBuild/14.0/Bin/MSBuild.exe /p:PlatformToolset=v140 /p:Platform=x64 /p:Configuration=Release libgdiplus.sln - -7z a -tzip libgdiplus.zip Win32 x64 diff --git a/README.md b/README.md index d561b432d..26007a458 100644 --- a/README.md +++ b/README.md @@ -22,16 +22,10 @@ On **Debian-based Linux distributions** you can use `apt-get` to install the dep sudo apt-get install libgif-dev autoconf libtool automake build-essential gettext libglib2.0-dev libcairo2-dev libtiff-dev libexif-dev -On **Windows** you can use [Chocolatey](https://chocolatey.org) to install the dependencies. Run the following commands from the root of the repository from an admin command prompt: +On **Windows** you can use [Vckpg](https://github.com/Microsoft/vcpkg) to install the dependencies. Run the following commands from the root of the repository from an admin command prompt: - choco install wget 7zip nuget.commandline - wget "https://dl.hexchat.net/gtk/gtk-win32-2018-03-13.7z" -O gtk-Win32.7z - wget "https://dl.hexchat.net/gtk/gtk-x64-2018-03-13.7z" -O gtk-x64.7z - - 7z x gtk-Win32.7z -ogtk - 7z x gtk-x64.7z -ogtk - - nuget restore + vcpkg install giflib libjpeg-turbo libpng cairo glib tiff libexif glib + vcpkg install giflib libjpeg-turbo libpng cairo glib tiff libexif glib --triplet x64-windows ### Build instructions diff --git a/src/libgdiplus.vcxproj b/src/libgdiplus.vcxproj index bb81e3078..147917538 100644 --- a/src/libgdiplus.vcxproj +++ b/src/libgdiplus.vcxproj @@ -24,7 +24,7 @@ libgdiplus 8.1 DynamicLibrary - v140 + v141 MultiByte $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ @@ -87,28 +87,17 @@ - $(ProjectDir)\..;$(ProjectDir)\..\gtk\$(Platform)\release\include;$(ProjectDir)\..\gtk\$(Platform)\release\include\glib-2.0;$(ProjectDir)\..\gtk\$(Platform)\release\lib\glib-2.0\include;$(ProjectDir)\..\gtk\$(Platform)\release\include\cairo;%(AdditionalIncludeDirectories) HAVE_LIBGIF;HAVE_LIBJPEG;HAVE_LIBTIFF;HAVE_LIBPNG;HAVE_FCFINI;_WINDLL;WIN32;%(PreprocessorDefinitions) Cdecl + $(ProjectDir)..\;%(AdditionalIncludeDirectories) - libpng16.lib;freetype.lib;fontconfig.lib;glib-2.0.lib;cairo.lib;shcore.lib;%(AdditionalDependencies) - $(ProjectDir)\..\gtk\$(Platform)\release\lib + shcore.lib;%(AdditionalDependencies) %windir%\system32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -Command "(Get-Content \"$(ProjectDir)\..\winconfig.h.in\") -replace '#LIBGDIPLUS_VERSION#', (Select-String -path \"$(ProjectDir)\..\configure.ac\" -pattern 'AC_INIT\(libgdiplus, \[(.*)\]').Matches[0].Groups[1].Value | Set-Content \"$(ProjectDir)\..\config.h\"" 2>&1 - - copy "$(ProjectDir)..\gtk\$(Platform)\release\bin\cairo.*" "$(OutDir)" -copy "$(ProjectDir)..\gtk\$(Platform)\release\bin\fontconfig.*" "$(OutDir)" -copy "$(ProjectDir)..\gtk\$(Platform)\release\bin\glib-2.0.*" "$(OutDir)" -copy "$(ProjectDir)..\gtk\$(Platform)\release\bin\iconv.*" "$(OutDir)" -copy "$(ProjectDir)..\gtk\$(Platform)\release\bin\intl.*" "$(OutDir)" -copy "$(ProjectDir)..\gtk\$(Platform)\release\bin\libpng16.*" "$(OutDir)" -copy "$(ProjectDir)..\gtk\$(Platform)\release\bin\libxml2.*" "$(OutDir)" -copy "$(ProjectDir)..\gtk\$(Platform)\release\bin\zlib1.*" "$(OutDir)" - @@ -119,30 +108,6 @@ copy "$(ProjectDir)..\gtk\$(Platform)\release\bin\zlib1.*" "$(OutDir)" - - - - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - - - - \ No newline at end of file diff --git a/src/packages.config b/src/packages.config deleted file mode 100644 index 7a01f56a6..000000000 --- a/src/packages.config +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file