From ff82af6a7aa3e7ccc9350e38e690f4ece2bafb0b Mon Sep 17 00:00:00 2001 From: TinoM Date: Mon, 4 Jan 2016 21:33:47 +0100 Subject: [PATCH] SDL2: Update to 2.0.4 --- mingw-w64-SDL2/PKGBUILD | 15 ++- .../SDL2-fix-gcc-compatibility.patch | 96 +++++++++---------- ...prevent-duplicate-d3d11-declarations.patch | 5 +- mingw-w64-SDL2/fix-linker-flags.patch | 22 ----- 4 files changed, 58 insertions(+), 80 deletions(-) delete mode 100644 mingw-w64-SDL2/fix-linker-flags.patch diff --git a/mingw-w64-SDL2/PKGBUILD b/mingw-w64-SDL2/PKGBUILD index 2b1462947d..3f4b1f8faa 100644 --- a/mingw-w64-SDL2/PKGBUILD +++ b/mingw-w64-SDL2/PKGBUILD @@ -2,8 +2,8 @@ _realname=SDL2 pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" -pkgver=2.0.3 -pkgrel=3 +pkgver=2.0.4 +pkgrel=1 pkgdesc="A library for portable low-level access to a video framebuffer, audio output, mouse, and keyboard (Version 2) (mingw-w64)" arch=('any') url="http://libsdl.org" @@ -12,19 +12,16 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" "${MINGW_PACKAGE_PREFIX}-pkg-config") depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs" "${MINGW_PACKAGE_PREFIX}-libiconv") options=('staticlibs' 'strip') source=("http://libsdl.org/release/SDL2-${pkgver}.tar.gz" - fix-linker-flags.patch SDL2-prevent-duplicate-d3d11-declarations.patch SDL2-fix-gcc-compatibility.patch) -md5sums=('fe6c61d2e9df9ef570e7e80c6e822537' - '932a4c42f068a9117c3c02efead14b29' - 'a70714d69deaea9e4f0cbfb17e9f4acf' - 'abbdbc90d737c8296b58d6af462b68b7') +md5sums=('44fc4a023349933e7f5d7a582f7b886e' + 'a2c2cd00ddf4ebe1d368fcace17a89de' + '9583b9e77e0c2caab6d7c80a67f53159') prepare() { cd "${srcdir}"/${_realname}-${pkgver} - patch -p1 -i ${srcdir}/fix-linker-flags.patch - patch -p1 -i ${srcdir}/SDL2-prevent-duplicate-d3d11-declarations.patch patch -p1 -i ${srcdir}/SDL2-fix-gcc-compatibility.patch + patch -p1 -i ${srcdir}/SDL2-prevent-duplicate-d3d11-declarations.patch ./autogen.sh } diff --git a/mingw-w64-SDL2/SDL2-fix-gcc-compatibility.patch b/mingw-w64-SDL2/SDL2-fix-gcc-compatibility.patch index a17e037e4a..76ff115c7e 100644 --- a/mingw-w64-SDL2/SDL2-fix-gcc-compatibility.patch +++ b/mingw-w64-SDL2/SDL2-fix-gcc-compatibility.patch @@ -1,6 +1,6 @@ ---- a/src/render/direct3d11/SDL_render_d3d11.c.orig 2015-03-21 20:17:57.816864185 +0100 -+++ b/src/render/direct3d11/SDL_render_d3d11.c 2015-03-21 22:21:30.123045735 +0100 -@@ -46,6 +46,9 @@ +--- a/src/render/direct3d11/SDL_render_d3d11.c.orig Sat Jan 02 20:56:31 2016 ++++ b/src/render/direct3d11/SDL_render_d3d11.c Mon Jan 04 20:25:44 2016 +@@ -51,6 +51,9 @@ #endif /* __WINRT__ */ @@ -10,7 +10,7 @@ #define SAFE_RELEASE(X) if ((X)) { IUnknown_Release(SDL_static_cast(IUnknown*, X)); X = NULL; } -@@ -910,7 +925,7 @@ +@@ -961,7 +964,7 @@ blendDesc.RenderTarget[0].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL; result = ID3D11Device_CreateBlendState(data->d3dDevice, &blendDesc, blendStateOutput); if (FAILED(result)) { @@ -19,7 +19,7 @@ return result; } -@@ -992,14 +1007,14 @@ +@@ -1043,14 +1046,14 @@ result = CreateDXGIFactoryFunc(&IID_IDXGIFactory2, &data->dxgiFactory); if (FAILED(result)) { @@ -36,7 +36,7 @@ goto done; } -@@ -1028,25 +1043,25 @@ +@@ -1079,25 +1082,25 @@ &d3dContext /* Returns the device immediate context. */ ); if (FAILED(result)) { @@ -66,7 +66,7 @@ goto done; } -@@ -1055,7 +1070,7 @@ +@@ -1106,7 +1109,7 @@ */ result = IDXGIDevice1_SetMaximumFrameLatency(dxgiDevice, 1); if (FAILED(result)) { @@ -75,7 +75,7 @@ goto done; } -@@ -1084,7 +1099,7 @@ +@@ -1135,7 +1138,7 @@ break; default: @@ -84,7 +84,7 @@ result = E_FAIL; goto done; } -@@ -1097,7 +1112,7 @@ +@@ -1148,7 +1151,7 @@ &data->vertexShader ); if (FAILED(result)) { @@ -93,7 +93,7 @@ goto done; } -@@ -1110,7 +1125,7 @@ +@@ -1161,7 +1164,7 @@ &data->inputLayout ); if (FAILED(result)) { @@ -102,7 +102,7 @@ goto done; } -@@ -1122,7 +1137,7 @@ +@@ -1173,7 +1176,7 @@ &data->colorPixelShader ); if (FAILED(result)) { @@ -111,7 +111,7 @@ goto done; } -@@ -1133,7 +1148,7 @@ +@@ -1184,7 +1187,7 @@ &data->texturePixelShader ); if (FAILED(result)) { @@ -120,7 +120,7 @@ goto done; } -@@ -1144,7 +1159,7 @@ +@@ -1195,7 +1198,7 @@ &data->yuvPixelShader ); if (FAILED(result)) { @@ -129,7 +129,7 @@ goto done; } -@@ -1159,7 +1174,7 @@ +@@ -1210,7 +1213,7 @@ &data->vertexShaderConstants ); if (FAILED(result)) { @@ -138,7 +138,7 @@ goto done; } -@@ -1179,7 +1194,7 @@ +@@ -1230,7 +1233,7 @@ &data->nearestPixelSampler ); if (FAILED(result)) { @@ -147,7 +147,7 @@ goto done; } -@@ -1189,7 +1204,7 @@ +@@ -1240,7 +1243,7 @@ &data->linearSampler ); if (FAILED(result)) { @@ -156,7 +156,7 @@ goto done; } -@@ -1207,14 +1222,14 @@ +@@ -1258,14 +1261,14 @@ rasterDesc.SlopeScaledDepthBias = 0.0f; result = ID3D11Device_CreateRasterizerState(data->d3dDevice, &rasterDesc, &data->mainRasterizer); if (FAILED(result)) { @@ -173,7 +173,7 @@ goto done; } -@@ -1374,7 +1389,7 @@ +@@ -1444,7 +1447,7 @@ &data->swapChain ); if (FAILED(result)) { @@ -182,7 +182,7 @@ goto done; } } else if (usingXAML) { -@@ -1384,18 +1399,18 @@ +@@ -1454,18 +1457,18 @@ NULL, &data->swapChain); if (FAILED(result)) { @@ -204,7 +204,7 @@ result = E_FAIL; goto done; #endif -@@ -1414,7 +1429,7 @@ +@@ -1484,7 +1487,7 @@ &data->swapChain ); if (FAILED(result)) { @@ -212,17 +212,17 @@ + WIN_SetErrorFromHRESULT(SDL_DEBUG(", IDXGIFactory2::CreateSwapChainForHwnd"), result); goto done; } - #else -@@ -1464,7 +1479,7 @@ - 0 - ); - if (FAILED(result)) { + +@@ -1545,7 +1548,7 @@ + */ + goto done; + } else if (FAILED(result)) { - WIN_SetErrorFromHRESULT(__FUNCTION__ ", IDXGISwapChain::ResizeBuffers", result); + WIN_SetErrorFromHRESULT(SDL_DEBUG(", IDXGISwapChain::ResizeBuffers"), result); goto done; } #endif -@@ -1485,7 +1500,7 @@ +@@ -1576,7 +1579,7 @@ if (data->swapEffect == DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL) { result = IDXGISwapChain1_SetRotation(data->swapChain, data->rotation); if (FAILED(result)) { @@ -231,7 +231,7 @@ goto done; } } -@@ -1497,7 +1512,7 @@ +@@ -1588,7 +1591,7 @@ &backBuffer ); if (FAILED(result)) { @@ -240,7 +240,7 @@ goto done; } -@@ -1508,7 +1523,7 @@ +@@ -1599,7 +1602,7 @@ &data->mainRenderTargetView ); if (FAILED(result)) { @@ -249,7 +249,7 @@ goto done; } -@@ -1628,7 +1643,7 @@ +@@ -1747,7 +1750,7 @@ ); if (FAILED(result)) { D3D11_DestroyTexture(renderer, texture); @@ -258,7 +258,7 @@ return -1; } -@@ -1646,7 +1661,7 @@ +@@ -1765,7 +1768,7 @@ ); if (FAILED(result)) { D3D11_DestroyTexture(renderer, texture); @@ -267,7 +267,7 @@ return -1; } -@@ -1657,7 +1672,7 @@ +@@ -1776,7 +1779,7 @@ ); if (FAILED(result)) { D3D11_DestroyTexture(renderer, texture); @@ -276,7 +276,7 @@ return -1; } } -@@ -1673,7 +1688,7 @@ +@@ -1792,7 +1795,7 @@ ); if (FAILED(result)) { D3D11_DestroyTexture(renderer, texture); @@ -285,7 +285,7 @@ return -1; } -@@ -1685,7 +1700,7 @@ +@@ -1804,7 +1807,7 @@ ); if (FAILED(result)) { D3D11_DestroyTexture(renderer, texture); @@ -294,7 +294,7 @@ return -1; } result = ID3D11Device_CreateShaderResourceView(rendererData->d3dDevice, -@@ -1695,7 +1710,7 @@ +@@ -1814,7 +1817,7 @@ ); if (FAILED(result)) { D3D11_DestroyTexture(renderer, texture); @@ -303,7 +303,7 @@ return -1; } } -@@ -1712,7 +1727,7 @@ +@@ -1831,7 +1834,7 @@ &textureData->mainTextureRenderTargetView); if (FAILED(result)) { D3D11_DestroyTexture(renderer, texture); @@ -312,7 +312,7 @@ return -1; } } -@@ -1768,7 +1783,7 @@ +@@ -1887,7 +1890,7 @@ NULL, &stagingTexture); if (FAILED(result)) { @@ -321,7 +321,7 @@ return -1; } -@@ -1781,7 +1796,7 @@ +@@ -1900,7 +1903,7 @@ &textureMemory ); if (FAILED(result)) { @@ -330,7 +330,7 @@ SAFE_RELEASE(stagingTexture); return -1; } -@@ -1943,7 +1958,7 @@ +@@ -2062,7 +2065,7 @@ NULL, &textureData->stagingTexture); if (FAILED(result)) { @@ -339,7 +339,7 @@ return -1; } -@@ -1956,7 +1971,7 @@ +@@ -2075,7 +2078,7 @@ &textureMemory ); if (FAILED(result)) { @@ -348,7 +348,7 @@ SAFE_RELEASE(textureData->stagingTexture); return -1; } -@@ -2238,7 +2253,7 @@ +@@ -2359,7 +2362,7 @@ &mappedResource ); if (FAILED(result)) { @@ -357,7 +357,7 @@ return -1; } SDL_memcpy(mappedResource.pData, vertexData, dataSizeInBytes); -@@ -2262,7 +2277,7 @@ +@@ -2383,7 +2386,7 @@ &rendererData->vertexBuffer ); if (FAILED(result)) { @@ -366,7 +366,7 @@ return -1; } -@@ -2732,7 +2747,7 @@ +@@ -2853,7 +2856,7 @@ &backBuffer ); if (FAILED(result)) { @@ -375,7 +375,7 @@ goto done; } -@@ -2749,7 +2764,7 @@ +@@ -2870,7 +2873,7 @@ NULL, &stagingTexture); if (FAILED(result)) { @@ -384,7 +384,7 @@ goto done; } -@@ -2781,7 +2796,7 @@ +@@ -2902,7 +2905,7 @@ 0, &textureMemory); if (FAILED(result)) { @@ -393,16 +393,16 @@ goto done; } -@@ -2800,7 +2815,7 @@ +@@ -2921,7 +2924,7 @@ * Get the error message, and attach some extra data to it. */ char errorMessage[1024]; - SDL_snprintf(errorMessage, sizeof(errorMessage), __FUNCTION__ ", Convert Pixels failed: %s", SDL_GetError()); -+ SDL_snprintf(errorMessage, sizeof(errorMessage), "%s, Convert Pixels failed: %s", __FUNCTION__, SDL_GetError()); - SDL_SetError(errorMessage); ++ SDL_snprintf(errorMessage, sizeof(errorMessage), "%s, Convert Pixels failed: %s", SDL_GetError()); + SDL_SetError("%s", errorMessage); goto done; } -@@ -2869,7 +2884,7 @@ +@@ -2991,7 +2994,7 @@ /* We probably went through a fullscreen <-> windowed transition */ D3D11_CreateWindowSizeDependentResources(renderer); } else { diff --git a/mingw-w64-SDL2/SDL2-prevent-duplicate-d3d11-declarations.patch b/mingw-w64-SDL2/SDL2-prevent-duplicate-d3d11-declarations.patch index 32670831d0..7555738194 100644 --- a/mingw-w64-SDL2/SDL2-prevent-duplicate-d3d11-declarations.patch +++ b/mingw-w64-SDL2/SDL2-prevent-duplicate-d3d11-declarations.patch @@ -1,6 +1,6 @@ --- a/src/render/direct3d11/SDL_render_d3d11.c.orig 2015-03-21 20:17:57.816864185 +0100 +++ b/src/render/direct3d11/SDL_render_d3d11.c 2015-03-21 22:16:38.285858676 +0100 -@@ -132,12 +132,24 @@ +@@ -140,12 +140,26 @@ /* Defined here so we don't have to include uuid.lib */ @@ -10,6 +10,9 @@ +#ifndef __IDXGIDevice1_INTERFACE_DEFINED__ static const GUID IID_IDXGIDevice1 = { 0x77db970f, 0x6276, 0x48ba, { 0xba, 0x28, 0x07, 0x01, 0x43, 0xb4, 0x39, 0x2c } }; +#endif ++#ifndef __IDXGIDevice3_INTERFACE_DEFINED__ + static const GUID IID_IDXGIDevice3 = { 0x6007896c, 0x3244, 0x4afd, { 0xbf, 0x18, 0xa6, 0xd3, 0xbe, 0xda, 0x50, 0x23 } }; ++#endif +#ifndef __ID3D11Texture2D_INTERFACE_DEFINED__ static const GUID IID_ID3D11Texture2D = { 0x6f15aaf2, 0xd208, 0x4e89, { 0x9a, 0xb4, 0x48, 0x95, 0x35, 0xd3, 0x4f, 0x9c } }; +#endif diff --git a/mingw-w64-SDL2/fix-linker-flags.patch b/mingw-w64-SDL2/fix-linker-flags.patch deleted file mode 100644 index efb05f9687..0000000000 --- a/mingw-w64-SDL2/fix-linker-flags.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- SDL2-2.0.3-orig/configure.in 2014-03-16 06:31:42.000000000 +0400 -+++ SDL2-2.0.3/configure.in 2014-06-10 08:37:51.605200000 +0400 -@@ -2859,12 +2859,15 @@ - have_loadso=yes - fi - # Set up the system libraries we need -- if test -f /lib/w32api/libuuid.a; then -+ case "$host" in -+ *-*-cygwin*) - LIBUUID=/lib/w32api/libuuid.a -- else -+ ;; -+ *-*-mingw32*) - LIBUUID=-luuid -- fi -- EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion $LIBUUID -XCClinker -static-libgcc" -+ ;; -+ esac -+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion $LIBUUID -static-libgcc" - # The Windows platform requires special setup - VERSION_SOURCES="$srcdir/src/main/windows/*.rc" - SDLMAIN_SOURCES="$srcdir/src/main/windows/*.c"