Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert Windows to use vckpg instead of nuget #277

Merged
merged 3 commits into from
Apr 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .jenkins-windows.ps1
Original file line number Diff line number Diff line change
@@ -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
20 changes: 0 additions & 20 deletions .jenkins-windows.sh

This file was deleted.

12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
41 changes: 3 additions & 38 deletions src/libgdiplus.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<RootNamespace>libgdiplus</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
Expand Down Expand Up @@ -87,28 +87,17 @@
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(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)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>HAVE_LIBGIF;HAVE_LIBJPEG;HAVE_LIBTIFF;HAVE_LIBPNG;HAVE_FCFINI;_WINDLL;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<!-- FIXME: To align with the GDI+ calling convention, this should be StdCall. Only relevant on x86 -->
<CallingConvention>Cdecl</CallingConvention>
<AdditionalIncludeDirectories>$(ProjectDir)..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<AdditionalDependencies>libpng16.lib;freetype.lib;fontconfig.lib;glib-2.0.lib;cairo.lib;shcore.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(ProjectDir)\..\gtk\$(Platform)\release\lib</AdditionalLibraryDirectories>
<AdditionalDependencies>shcore.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PreBuildEvent>
<Command>%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&gt;&amp;1</Command>
</PreBuildEvent>
<PostBuildEvent>
<Command>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)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="*.c" />
Expand All @@ -119,30 +108,6 @@ copy "$(ProjectDir)..\gtk\$(Platform)\release\bin\zlib1.*" "$(OutDir)"</Command>
</ItemGroup>
<ItemGroup>
<None Include="*.inc" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\packages\giflib.5.1.4\build\native\giflib.targets" Condition="Exists('..\packages\giflib.5.1.4\build\native\giflib.targets')" />
<Import Project="..\packages\giflib.redist.5.1.4\build\native\giflib.redist.targets" Condition="Exists('..\packages\giflib.redist.5.1.4\build\native\giflib.redist.targets')" />
<Import Project="..\packages\libjpeg.9.2.0.1\build\native\libjpeg.targets" Condition="Exists('..\packages\libjpeg.9.2.0.1\build\native\libjpeg.targets')" />
<Import Project="..\packages\libjpeg.redist.9.2.0.1\build\native\libjpeg.redist.targets" Condition="Exists('..\packages\libjpeg.redist.9.2.0.1\build\native\libjpeg.redist.targets')" />
<Import Project="..\packages\libtiff.4.0.6.2\build\native\libtiff.targets" Condition="Exists('..\packages\libtiff.4.0.6.2\build\native\libtiff.targets')" />
<Import Project="..\packages\libtiff.redist.4.0.6.2\build\native\libtiff.redist.targets" Condition="Exists('..\packages\libtiff.redist.4.0.6.2\build\native\libtiff.redist.targets')" />
<Import Project="..\packages\zlib.v120.windesktop.msvcstl.dyn.rt-dyn.1.2.8.8\build\native\zlib.v120.windesktop.msvcstl.dyn.rt-dyn.targets" Condition="Exists('..\packages\zlib.v120.windesktop.msvcstl.dyn.rt-dyn.1.2.8.8\build\native\zlib.v120.windesktop.msvcstl.dyn.rt-dyn.targets')" />
<Import Project="..\packages\zlib.v140.windesktop.msvcstl.dyn.rt-dyn.1.2.8.8\build\native\zlib.v140.windesktop.msvcstl.dyn.rt-dyn.targets" Condition="Exists('..\packages\zlib.v140.windesktop.msvcstl.dyn.rt-dyn.1.2.8.8\build\native\zlib.v140.windesktop.msvcstl.dyn.rt-dyn.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>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}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\giflib.5.1.4\build\native\giflib.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\giflib.5.1.4\build\native\giflib.targets'))" />
<Error Condition="!Exists('..\packages\giflib.redist.5.1.4\build\native\giflib.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\giflib.redist.5.1.4\build\native\giflib.redist.targets'))" />
<Error Condition="!Exists('..\packages\libjpeg.9.2.0.1\build\native\libjpeg.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\libjpeg.9.2.0.1\build\native\libjpeg.targets'))" />
<Error Condition="!Exists('..\packages\libjpeg.redist.9.2.0.1\build\native\libjpeg.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\libjpeg.redist.9.2.0.1\build\native\libjpeg.redist.targets'))" />
<Error Condition="!Exists('..\packages\libtiff.4.0.6.2\build\native\libtiff.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\libtiff.4.0.6.2\build\native\libtiff.targets'))" />
<Error Condition="!Exists('..\packages\libtiff.redist.4.0.6.2\build\native\libtiff.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\libtiff.redist.4.0.6.2\build\native\libtiff.redist.targets'))" />
<Error Condition="!Exists('..\packages\zlib.v120.windesktop.msvcstl.dyn.rt-dyn.1.2.8.8\build\native\zlib.v120.windesktop.msvcstl.dyn.rt-dyn.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\zlib.v120.windesktop.msvcstl.dyn.rt-dyn.1.2.8.8\build\native\zlib.v120.windesktop.msvcstl.dyn.rt-dyn.targets'))" />
<Error Condition="!Exists('..\packages\zlib.v140.windesktop.msvcstl.dyn.rt-dyn.1.2.8.8\build\native\zlib.v140.windesktop.msvcstl.dyn.rt-dyn.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\zlib.v140.windesktop.msvcstl.dyn.rt-dyn.1.2.8.8\build\native\zlib.v140.windesktop.msvcstl.dyn.rt-dyn.targets'))" />
</Target>
</Project>
12 changes: 0 additions & 12 deletions src/packages.config

This file was deleted.