From 2a8d1510b47e0214000653b311c2836ef33d2595 Mon Sep 17 00:00:00 2001 From: Adam Martin Date: Sun, 1 Jan 2017 10:08:03 -0600 Subject: [PATCH 01/48] [glew] Renames the glew debug output files The FindGlew.cmake that is official as well as several found in a quick search don't look for the debug post-fix variant of the library. This was causing vcpkg to not copy the DLL over on build as it was looking for glew32.dll not glew32d.dll. --- ports/glew/portfile.cmake | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ports/glew/portfile.cmake b/ports/glew/portfile.cmake index e7cf16cf2..6392633be 100644 --- a/ports/glew/portfile.cmake +++ b/ports/glew/portfile.cmake @@ -57,8 +57,11 @@ message(STATUS "Installing") if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(INSTALL ${SOURCE_PATH}/bin/Debug/${BUILD_ARCH}/glew32d.dll + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin RENAME glew32.dll + ) + file(INSTALL ${SOURCE_PATH}/bin/Debug/${BUILD_ARCH}/glew32d.pdb - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin RENAME glew32.pdb ) file(INSTALL ${SOURCE_PATH}/bin/Release/${BUILD_ARCH}/glew32.dll @@ -67,7 +70,7 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) ) file(INSTALL ${SOURCE_PATH}/lib/Debug/${BUILD_ARCH}/glew32d.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib RENAME glew32.lib ) file(INSTALL ${SOURCE_PATH}/lib/Release/${BUILD_ARCH}/glew32.lib @@ -76,13 +79,11 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) else() file(INSTALL ${SOURCE_PATH}/lib/Debug/${BUILD_ARCH}/glew32sd.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib - RENAME glew32d.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib RENAME glew32.lib ) file(INSTALL ${SOURCE_PATH}/lib/Release/${BUILD_ARCH}/glew32s.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/lib - RENAME glew32.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib RENAME glew32.lib ) endif() From 59c34be2526059ebd3e485ee03f2f3d3c86c05b0 Mon Sep 17 00:00:00 2001 From: Christian Ullrich Date: Tue, 3 Jan 2017 14:06:10 +0100 Subject: [PATCH 02/48] Disable Boost auto-link. Fixes #483. vcpkg always links all installed libraries for the target triplet; Boost's own auto-link feature is therefore redundant. --- ports/boost/CONTROL | 2 +- ports/boost/portfile.cmake | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/ports/boost/CONTROL b/ports/boost/CONTROL index 9e2afdf8a..01d6e9858 100644 --- a/ports/boost/CONTROL +++ b/ports/boost/CONTROL @@ -1,4 +1,4 @@ Source: boost -Version: 1.62-9 +Version: 1.62-10 Description: Peer-reviewed portable C++ source libraries Build-Depends: zlib diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake index 6cc21a091..3fbd06982 100644 --- a/ports/boost/portfile.cmake +++ b/ports/boost/portfile.cmake @@ -108,11 +108,10 @@ file( DESTINATION ${CURRENT_PACKAGES_DIR}/include ) -if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - file(APPEND ${CURRENT_PACKAGES_DIR}/include/boost/config/user.hpp - "\n#define BOOST_ALL_DYN_LINK\n" - ) -endif() +# Disable Boost auto-link. +file(APPEND ${CURRENT_PACKAGES_DIR}/include/boost/config/user.hpp + "\n#define BOOST_ALL_NO_LIB\n" +) file(INSTALL ${SOURCE_PATH}/LICENSE_1_0.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/boost RENAME copyright) message(STATUS "Packaging headers done") From 0db465cec2c12ea762b8b756ab92515c466db01b Mon Sep 17 00:00:00 2001 From: Patrick Bader Date: Wed, 4 Jan 2017 14:30:23 +0100 Subject: [PATCH 03/48] updated zlib port to version 1.2.10 --- ports/zlib/CONTROL | 2 +- ports/zlib/portfile.cmake | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/zlib/CONTROL b/ports/zlib/CONTROL index 482873480..b12fe9e67 100644 --- a/ports/zlib/CONTROL +++ b/ports/zlib/CONTROL @@ -1,3 +1,3 @@ Source: zlib -Version: 1.2.8 +Version: 1.2.10 Description: A compression library \ No newline at end of file diff --git a/ports/zlib/portfile.cmake b/ports/zlib/portfile.cmake index ef891f685..c49f35a00 100644 --- a/ports/zlib/portfile.cmake +++ b/ports/zlib/portfile.cmake @@ -1,9 +1,9 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/zlib-1.2.8) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/zlib-1.2.10) vcpkg_download_distfile(ARCHIVE_FILE - URLS "http://zlib.net/zlib128.zip" - FILENAME "zlib128.zip" - SHA512 b0d7e71eca9032910c56fc1de6adbdc4f915bdeafd9a114591fc05701893004ef3363add8ad0e576c956b6be158f2fc339ab393f2dd40e8cc8c2885d641d807b + URLS "http://zlib.net/zlib1210.zip" + FILENAME "zlib1210.zip" + SHA512 e1f0ffaa1d6d9c322d6fd30dc8fba202272205943b719e5d6525323e6773b4fcdd82885928c3f59b4bf7ca55babda9f379e174632bf3b25dc9067adb89f58409 ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) From f8210aa32b5029b7b04742b949311f12336141b0 Mon Sep 17 00:00:00 2001 From: Patrick Bader Date: Wed, 4 Jan 2017 15:17:22 +0100 Subject: [PATCH 04/48] [zlib] fixed wrong FILENAME --- ports/zlib/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/zlib/portfile.cmake b/ports/zlib/portfile.cmake index 6deff6c0c..81d54fb4b 100644 --- a/ports/zlib/portfile.cmake +++ b/ports/zlib/portfile.cmake @@ -2,7 +2,7 @@ include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/zlib-1.2.10) vcpkg_download_distfile(ARCHIVE_FILE URLS "http://www.zlib.net/zlib-1.2.10.tar.gz" - FILENAME "zlib1210.zip" + FILENAME "zlib1210.tar.gz" SHA512 5fa71052a418a0f2b345fce28af9941bbd1c6ee276ce506ab3092157f15776ee41f96bb1799657227513b852913f96ac52dae8122a437f34b43933ee48d63ee0 ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) From 29aedfad6cd82cc2c071dc99fa5d6aac74af8d49 Mon Sep 17 00:00:00 2001 From: Patrick Bader Date: Thu, 5 Jan 2017 16:42:52 +0100 Subject: [PATCH 05/48] added first version of SDL2_image library which currently does not link to any external libraries. --- ports/sdl2-image/CMakeLists.txt | 44 +++++++++++++++++++ ports/sdl2-image/CONTROL | 3 ++ .../sdl2-image/correct-sdl-headers-dir.patch | 25 +++++++++++ ports/sdl2-image/portfile.cmake | 36 +++++++++++++++ 4 files changed, 108 insertions(+) create mode 100644 ports/sdl2-image/CMakeLists.txt create mode 100644 ports/sdl2-image/CONTROL create mode 100644 ports/sdl2-image/correct-sdl-headers-dir.patch create mode 100644 ports/sdl2-image/portfile.cmake diff --git a/ports/sdl2-image/CMakeLists.txt b/ports/sdl2-image/CMakeLists.txt new file mode 100644 index 000000000..3167294d3 --- /dev/null +++ b/ports/sdl2-image/CMakeLists.txt @@ -0,0 +1,44 @@ +cmake_minimum_required(VERSION 2.6) +project(SDL2_image) + +find_path(SDL_INCLUDE_DIR SDL2/SDL.h) +find_library(SDL_LIBRARY SDL2) + +include_directories(${SDL_INCLUDE_DIR}) +include_directories(${SDL_INCLUDE_DIR}/SDL2) +include_directories(${CMAKE_SOURCE_DIR}) + +#add_definitions(-DNOCONTROLS -DTHREADED_AUDIO) + +# some c++ code just assumes memset is available + +add_library(SDL2_image + IMG.c + IMG_bmp.c + IMG_gif.c + IMG_jpg.c + IMG_lbm.c + IMG_pcx.c + IMG_png.c + IMG_pnm.c + IMG_tga.c + IMG_tif.c + IMG_webp.c + IMG_xcf.c + IMG_xpm.c + IMG_xv.c + IMG_xxx.c + ) + +target_link_libraries(SDL2_image ${SDL_LIBRARY}) + +install(TARGETS SDL2_image + RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib) + +install(FILES SDL_image.h DESTINATION include CONFIGURATIONS Release) + + +message(STATUS "Link-time dependencies:") +message(STATUS " " ${SDL_LIBRARY}) diff --git a/ports/sdl2-image/CONTROL b/ports/sdl2-image/CONTROL new file mode 100644 index 000000000..591550cdc --- /dev/null +++ b/ports/sdl2-image/CONTROL @@ -0,0 +1,3 @@ +Source: sdl2-image +Version: +Description: diff --git a/ports/sdl2-image/correct-sdl-headers-dir.patch b/ports/sdl2-image/correct-sdl-headers-dir.patch new file mode 100644 index 000000000..4addc155d --- /dev/null +++ b/ports/sdl2-image/correct-sdl-headers-dir.patch @@ -0,0 +1,25 @@ +diff --git "a/SDL_image.h" "b/SDL_image.h" +index f654483..1bd4f62 100644 +--- "a/SDL_image.h" ++++ "b/SDL_image.h" +@@ -24,9 +24,9 @@ + #ifndef _SDL_IMAGE_H + #define _SDL_IMAGE_H + +-#include "SDL.h" +-#include "SDL_version.h" +-#include "begin_code.h" ++#include ++#include ++#include + + /* Set up for C function definitions, even when using C++ */ + #ifdef __cplusplus +@@ -140,6 +140,6 @@ extern DECLSPEC int SDLCALL IMG_SavePNG_RW(SDL_Surface *surface, SDL_RWops *dst, + #ifdef __cplusplus + } + #endif +-#include "close_code.h" ++#include + + #endif /* _SDL_IMAGE_H */ diff --git a/ports/sdl2-image/portfile.cmake b/ports/sdl2-image/portfile.cmake new file mode 100644 index 000000000..f70d237c2 --- /dev/null +++ b/ports/sdl2-image/portfile.cmake @@ -0,0 +1,36 @@ +# Common Ambient Variables: +# VCPKG_ROOT_DIR = +# TARGET_TRIPLET is the current triplet (x86-windows, etc) +# PORT is the current port name (zlib, etc) +# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} +# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} +# + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/SDL2_image-2.0.1) +vcpkg_download_distfile(ARCHIVE + URLS "https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.1.zip" + FILENAME "SDL2_image-2.0.1.zip" + SHA512 37d12f4fae71c586bec73262bddb9207ab2f9a2ca6001d2cbfde646e268a950ba5cd4cff53d75e2da8959ae6da6e9cadc6eca88fa7bd9aa2758395d64c84a307 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/correct-sdl-headers-dir.patch) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 + # OPTIONS_RELEASE -DOPTIMIZE=1 + # OPTIONS_DEBUG -DDEBUGGABLE=1 +) + +vcpkg_install_cmake() + +# Handle copyright +file(COPY ${SOURCE_PATH}/COPYING.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/sdl2-image) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/sdl2-image/COPYING.txt ${CURRENT_PACKAGES_DIR}/share/sdl2-image/copyright) From d62dda3b030e31f322aaa47b4aeaa0a12fa3201b Mon Sep 17 00:00:00 2001 From: Patrick Bader Date: Thu, 5 Jan 2017 16:48:04 +0100 Subject: [PATCH 06/48] forces CMake use zlib version which is installed by vcpkg. --- ports/libpng/portfile.cmake | 6 +++++- ports/libpng/set_zlib_root.patch | 12 ++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 ports/libpng/set_zlib_root.patch diff --git a/ports/libpng/portfile.cmake b/ports/libpng/portfile.cmake index f7be6cca1..55cbb4bda 100644 --- a/ports/libpng/portfile.cmake +++ b/ports/libpng/portfile.cmake @@ -9,7 +9,9 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} - PATCHES "${CMAKE_CURRENT_LIST_DIR}/use-abort-on-all-platforms.patch" + PATCHES + "${CMAKE_CURRENT_LIST_DIR}/use-abort-on-all-platforms.patch" + "${CMAKE_CURRENT_LIST_DIR}/set_zlib_root.patch" ) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) @@ -19,6 +21,7 @@ else() set(PNG_STATIC_LIBS ON) set(PNG_SHARED_LIBS OFF) endif() +#message(STATUS ${CURRENT_INSTALL_DIR}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} @@ -29,6 +32,7 @@ vcpkg_configure_cmake( -DSKIP_INSTALL_PROGRAMS=ON -DSKIP_INSTALL_EXECUTABLES=ON -DSKIP_INSTALL_FILES=ON + -DINSTALLED_DIR:PATH=${CURRENT_INSTALLED_DIR} OPTIONS_DEBUG -DSKIP_INSTALL_HEADERS=ON ) diff --git a/ports/libpng/set_zlib_root.patch b/ports/libpng/set_zlib_root.patch new file mode 100644 index 000000000..8fb029635 --- /dev/null +++ b/ports/libpng/set_zlib_root.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 186b65a..e485fd9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -40,6 +40,7 @@ set(PNGLIB_NAME libpng${PNGLIB_MAJOR}${PNGLIB_MINOR}) + set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE}) + + # needed packages ++set(ZLIB_ROOT ${INSTALLED_DIR}) + find_package(ZLIB REQUIRED) + include_directories(${ZLIB_INCLUDE_DIR}) + From 44c86f56db351da15e5a2b2fcca62656ab8cccbf Mon Sep 17 00:00:00 2001 From: Patrick Bader Date: Thu, 5 Jan 2017 19:39:14 +0100 Subject: [PATCH 07/48] Revert "forces CMake use zlib version which is installed by vcpkg." This reverts commit d62dda3b030e31f322aaa47b4aeaa0a12fa3201b. --- ports/libpng/portfile.cmake | 6 +----- ports/libpng/set_zlib_root.patch | 12 ------------ 2 files changed, 1 insertion(+), 17 deletions(-) delete mode 100644 ports/libpng/set_zlib_root.patch diff --git a/ports/libpng/portfile.cmake b/ports/libpng/portfile.cmake index 55cbb4bda..f7be6cca1 100644 --- a/ports/libpng/portfile.cmake +++ b/ports/libpng/portfile.cmake @@ -9,9 +9,7 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} - PATCHES - "${CMAKE_CURRENT_LIST_DIR}/use-abort-on-all-platforms.patch" - "${CMAKE_CURRENT_LIST_DIR}/set_zlib_root.patch" + PATCHES "${CMAKE_CURRENT_LIST_DIR}/use-abort-on-all-platforms.patch" ) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) @@ -21,7 +19,6 @@ else() set(PNG_STATIC_LIBS ON) set(PNG_SHARED_LIBS OFF) endif() -#message(STATUS ${CURRENT_INSTALL_DIR}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} @@ -32,7 +29,6 @@ vcpkg_configure_cmake( -DSKIP_INSTALL_PROGRAMS=ON -DSKIP_INSTALL_EXECUTABLES=ON -DSKIP_INSTALL_FILES=ON - -DINSTALLED_DIR:PATH=${CURRENT_INSTALLED_DIR} OPTIONS_DEBUG -DSKIP_INSTALL_HEADERS=ON ) diff --git a/ports/libpng/set_zlib_root.patch b/ports/libpng/set_zlib_root.patch deleted file mode 100644 index 8fb029635..000000000 --- a/ports/libpng/set_zlib_root.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 186b65a..e485fd9 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -40,6 +40,7 @@ set(PNGLIB_NAME libpng${PNGLIB_MAJOR}${PNGLIB_MINOR}) - set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE}) - - # needed packages -+set(ZLIB_ROOT ${INSTALLED_DIR}) - find_package(ZLIB REQUIRED) - include_directories(${ZLIB_INCLUDE_DIR}) - From 37a5504855a83e24eb06ca1b5dd16b3dabd68313 Mon Sep 17 00:00:00 2001 From: Patrick Bader Date: Fri, 6 Jan 2017 19:08:31 +0100 Subject: [PATCH 08/48] finished port of sdl2_image - optional dependencies which are installed in vcpkg are automatically linked - unavailable dependencies are marked as dynamically linked and dlls have to be copied manually if respective file formats are used --- ports/sdl2-image/CMakeLists.txt | 81 +++++++++++++++++++++++++++++---- ports/sdl2-image/CONTROL | 6 ++- ports/sdl2-image/FindWEBP.cmake | 51 +++++++++++++++++++++ ports/sdl2-image/portfile.cmake | 5 +- 4 files changed, 132 insertions(+), 11 deletions(-) create mode 100644 ports/sdl2-image/FindWEBP.cmake diff --git a/ports/sdl2-image/CMakeLists.txt b/ports/sdl2-image/CMakeLists.txt index 3167294d3..a77662c0e 100644 --- a/ports/sdl2-image/CMakeLists.txt +++ b/ports/sdl2-image/CMakeLists.txt @@ -1,16 +1,29 @@ cmake_minimum_required(VERSION 2.6) project(SDL2_image) -find_path(SDL_INCLUDE_DIR SDL2/SDL.h) -find_library(SDL_LIBRARY SDL2) +### configuration ### -include_directories(${SDL_INCLUDE_DIR}) -include_directories(${SDL_INCLUDE_DIR}/SDL2) -include_directories(${CMAKE_SOURCE_DIR}) +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") +# enable all file formats which are supported natively +set(SUPPORTED_FORMATS BMP GIF LBM PCX PNM TGA XPM XCF XV) -#add_definitions(-DNOCONTROLS -DTHREADED_AUDIO) +# enable all file formats which are supported through external dependencies +# first try to load them statically (lib file in vcpkg installation) +# if this fails try to make them a dynamic dependency (dll will be loaded at runtime) if possible. vcpkg cannot resolve these dependencies! +# else do not support this file format at all +set(DEPENDENCIES PNG JPEG TIFF WEBP) -# some c++ code just assumes memset is available +# patch library names for preprocessor flags +set(JPEG_FLAG JPG) +set(TIFF_FLAG TIF) + +# names of potentially dynamically loaded libraries +set(JPEG_DYNAMIC \"libjpeg-9.dll\") +set(PNG_DYNAMIC \"libpng16-16.dll\") +set(TIFF_DYNAMIC \"libtiff-5.dll\") +set(WEBP_DYNAMIC \"libwebp-4.dll\") + +### implementation ### add_library(SDL2_image IMG.c @@ -30,15 +43,67 @@ add_library(SDL2_image IMG_xxx.c ) +foreach(FORMAT ${SUPPORTED_FORMATS}) + add_definitions(-DLOAD_${FORMAT}) +endforeach(FORMAT) + +# SDL +find_path(SDL_INCLUDE_DIR SDL2/SDL.h) +find_library(SDL_LIBRARY SDL2) + +include_directories(${SDL_INCLUDE_DIR}) +include_directories(${SDL_INCLUDE_DIR}/SDL2) +include_directories(${CMAKE_SOURCE_DIR}) + target_link_libraries(SDL2_image ${SDL_LIBRARY}) +# external dependencies +foreach(DEPENDENCY ${DEPENDENCIES}) + find_package(${DEPENDENCY}) + + if(NOT DEFINED ${DEPENDENCY}_FLAG) + set(${DEPENDENCY}_FLAG ${DEPENDENCY}) + endif() + + add_definitions(-DLOAD_${${DEPENDENCY}_FLAG}) + if(${DEPENDENCY}_FOUND) + message(STATUS " --> linking statically.") + target_link_libraries(SDL2_image ${${DEPENDENCY}_LIBRARIES}) + elseif(DEFINED ${DEPENDENCY}_DYNAMIC) + message(STATUS " --> linking dynamically.") + add_definitions(-DLOAD_${${DEPENDENCY}_FLAG}_DYNAMIC=${${DEPENDENCY}_DYNAMIC}) + set(RUNTIME_DEPENDENCIES ON) + else() + message(STATUS " --> skipping.") + endif() +endforeach(DEPENDENCY) + +if(DEFINED RUNTIME_DEPENDENCIES) + include_directories(VisualC/external/include) +endif() + + install(TARGETS SDL2_image RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) -install(FILES SDL_image.h DESTINATION include CONFIGURATIONS Release) +install(FILES SDL_image.h DESTINATION include/SDL2_image CONFIGURATIONS Release) message(STATUS "Link-time dependencies:") message(STATUS " " ${SDL_LIBRARY}) +foreach(DEPENDENCY ${DEPENDENCIES}) + if(${DEPENDENCY}_FOUND) + message(STATUS " " ${DEPENDENCY}) + endif() +endforeach(DEPENDENCY) + +if(DEFINED RUNTIME_DEPENDENCIES) + message(STATUS "Run-time dependencies:") + foreach(DEPENDENCY ${DEPENDENCIES}) + if(NOT ${DEPENDENCY}_FOUND AND DEFINED ${DEPENDENCY}_DYNAMIC) + message(STATUS " " ${${DEPENDENCY}_DYNAMIC}) + endif() + endforeach(DEPENDENCY) +endif() \ No newline at end of file diff --git a/ports/sdl2-image/CONTROL b/ports/sdl2-image/CONTROL index 591550cdc..f9785ba22 100644 --- a/ports/sdl2-image/CONTROL +++ b/ports/sdl2-image/CONTROL @@ -1,3 +1,5 @@ Source: sdl2-image -Version: -Description: +Version: 2.0.1 +Build-Depends: sdl2 +Description: SDL_image is an image file loading library. It loads images as SDL surfaces and textures, and supports the following formats: BMP, GIF, JPEG, LBM, PCX, PNG, PNM, TGA, TIFF, WEBP, XCF, XPM, XV + diff --git a/ports/sdl2-image/FindWEBP.cmake b/ports/sdl2-image/FindWEBP.cmake new file mode 100644 index 000000000..ddabe71fe --- /dev/null +++ b/ports/sdl2-image/FindWEBP.cmake @@ -0,0 +1,51 @@ +# - Try to find WebP. +# Once done, this will define +# +# WEBP_FOUND - system has WebP. +# WEBP_INCLUDE_DIRS - the WebP. include directories +# WEBP_LIBRARIES - link these to use WebP. +# +# Copyright (C) 2012 Raphael Kubo da Costa +# Copyright (C) 2013 Igalia S.L. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS +# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +find_package(PkgConfig) +pkg_check_modules(PC_WEBP QUIET libwebp) + +# Look for the header file. +find_path(WEBP_INCLUDE_DIRS + NAMES webp/decode.h + HINTS ${PC_WEBP_INCLUDEDIR} ${PC_WEBP_INCLUDE_DIRS} +) +mark_as_advanced(WEBP_INCLUDE_DIRS) + +# Look for the library. +find_library( + WEBP_LIBRARIES + NAMES webp + HINTS ${PC_WEBP_LIBDIR} ${PC_WEBP_LIBRARY_DIRS} +) +mark_as_advanced(WEBP_LIBRARIES) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(WEBP DEFAULT_MSG WEBP_INCLUDE_DIRS WEBP_LIBRARIES) \ No newline at end of file diff --git a/ports/sdl2-image/portfile.cmake b/ports/sdl2-image/portfile.cmake index f70d237c2..4cc6ce74a 100644 --- a/ports/sdl2-image/portfile.cmake +++ b/ports/sdl2-image/portfile.cmake @@ -21,10 +21,11 @@ vcpkg_apply_patches( ${CMAKE_CURRENT_LIST_DIR}/correct-sdl-headers-dir.patch) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindWEBP.cmake DESTINATION ${SOURCE_PATH}/cmake) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} - # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 + # OPTIONS # OPTIONS_RELEASE -DOPTIMIZE=1 # OPTIONS_DEBUG -DDEBUGGABLE=1 ) @@ -34,3 +35,5 @@ vcpkg_install_cmake() # Handle copyright file(COPY ${SOURCE_PATH}/COPYING.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/sdl2-image) file(RENAME ${CURRENT_PACKAGES_DIR}/share/sdl2-image/COPYING.txt ${CURRENT_PACKAGES_DIR}/share/sdl2-image/copyright) + +vcpkg_copy_pdbs() \ No newline at end of file From 937c4e26b074d7ddb603e16186e4efe271e8c230 Mon Sep 17 00:00:00 2001 From: Patrick Bader Date: Fri, 6 Jan 2017 22:05:22 +0100 Subject: [PATCH 09/48] fixed findWEBP.cmake to select debug version of webp for debug builds. --- ports/sdl2-image/FindWEBP.cmake | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/ports/sdl2-image/FindWEBP.cmake b/ports/sdl2-image/FindWEBP.cmake index ddabe71fe..a74814026 100644 --- a/ports/sdl2-image/FindWEBP.cmake +++ b/ports/sdl2-image/FindWEBP.cmake @@ -7,6 +7,7 @@ # # Copyright (C) 2012 Raphael Kubo da Costa # Copyright (C) 2013 Igalia S.L. +# Copyright (C) 2017 Patrick Bader # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -39,12 +40,16 @@ find_path(WEBP_INCLUDE_DIRS ) mark_as_advanced(WEBP_INCLUDE_DIRS) +if(CMAKE_BUILD_TYPE MATCHES DEBUG) + message("debug mode") +endif(CMAKE_BUILD_TYPE MATCHES DEBUG) + # Look for the library. -find_library( - WEBP_LIBRARIES - NAMES webp - HINTS ${PC_WEBP_LIBDIR} ${PC_WEBP_LIBRARY_DIRS} -) +find_library(WEBP_LIBRARY_RELEASE NAMES webp HINTS ${PC_WEBP_LIBDIR} ${PC_WEBP_LIBRARY_DIRS}) +find_library(WEBP_LIBRARY_DEBUG NAMES webpd HINTS ${PC_WEBP_LIBDIR} ${PC_WEBP_LIBRARY_DIRS}) + +select_library_configurations(WEBP) + mark_as_advanced(WEBP_LIBRARIES) include(FindPackageHandleStandardArgs) From 2bb72e6637ab016a1fa8625b0a673d5ecd74ae4f Mon Sep 17 00:00:00 2001 From: Patrick Bader Date: Fri, 6 Jan 2017 23:20:57 +0100 Subject: [PATCH 10/48] [sdl2-image] added dependencies to CONTROL so they will always be statically linked Replaced FindWEBP.cmake with version from freeimage port --- ports/sdl2-image/CONTROL | 2 +- ports/sdl2-image/FindWEBP.cmake | 56 +++++++-------------------------- 2 files changed, 13 insertions(+), 45 deletions(-) diff --git a/ports/sdl2-image/CONTROL b/ports/sdl2-image/CONTROL index f9785ba22..04c9f77bb 100644 --- a/ports/sdl2-image/CONTROL +++ b/ports/sdl2-image/CONTROL @@ -1,5 +1,5 @@ Source: sdl2-image Version: 2.0.1 -Build-Depends: sdl2 +Build-Depends: sdl2, libpng, libjpeg-turbo, tiff, libwebp Description: SDL_image is an image file loading library. It loads images as SDL surfaces and textures, and supports the following formats: BMP, GIF, JPEG, LBM, PCX, PNG, PNM, TGA, TIFF, WEBP, XCF, XPM, XV diff --git a/ports/sdl2-image/FindWEBP.cmake b/ports/sdl2-image/FindWEBP.cmake index a74814026..fb3f9caa1 100644 --- a/ports/sdl2-image/FindWEBP.cmake +++ b/ports/sdl2-image/FindWEBP.cmake @@ -1,56 +1,24 @@ -# - Try to find WebP. -# Once done, this will define +# - Find WEBP +# Find the WEBP library +# This module defines +# WEBP_INCLUDE_DIRS, where to find webp/decode.h +# WEBP_LIBRARIES, the libraries needed to use WEBP # -# WEBP_FOUND - system has WebP. -# WEBP_INCLUDE_DIRS - the WebP. include directories -# WEBP_LIBRARIES - link these to use WebP. -# -# Copyright (C) 2012 Raphael Kubo da Costa -# Copyright (C) 2013 Igalia S.L. -# Copyright (C) 2017 Patrick Bader -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS -# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -find_package(PkgConfig) -pkg_check_modules(PC_WEBP QUIET libwebp) - -# Look for the header file. find_path(WEBP_INCLUDE_DIRS NAMES webp/decode.h - HINTS ${PC_WEBP_INCLUDEDIR} ${PC_WEBP_INCLUDE_DIRS} ) mark_as_advanced(WEBP_INCLUDE_DIRS) -if(CMAKE_BUILD_TYPE MATCHES DEBUG) - message("debug mode") -endif(CMAKE_BUILD_TYPE MATCHES DEBUG) - -# Look for the library. -find_library(WEBP_LIBRARY_RELEASE NAMES webp HINTS ${PC_WEBP_LIBDIR} ${PC_WEBP_LIBRARY_DIRS}) -find_library(WEBP_LIBRARY_DEBUG NAMES webpd HINTS ${PC_WEBP_LIBDIR} ${PC_WEBP_LIBRARY_DIRS}) +find_library( + WEBP_LIBRARIES + NAMES webp +) +find_library(WEBP_LIBRARY_RELEASE NAMES webp PATH_SUFFIXES lib) +find_library(WEBP_LIBRARY_DEBUG NAMES webpd PATH_SUFFIXES lib) +include(SelectLibraryConfigurations) select_library_configurations(WEBP) -mark_as_advanced(WEBP_LIBRARIES) - include(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(WEBP DEFAULT_MSG WEBP_INCLUDE_DIRS WEBP_LIBRARIES) \ No newline at end of file From 07fb014193d725da008742d38dd94362de30afde Mon Sep 17 00:00:00 2001 From: Patrick Bader Date: Sat, 7 Jan 2017 11:51:07 +0100 Subject: [PATCH 11/48] [sdl2-image] changed include directory to SDL2 include directory --- ports/sdl2-image/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/sdl2-image/CMakeLists.txt b/ports/sdl2-image/CMakeLists.txt index a77662c0e..e742a408d 100644 --- a/ports/sdl2-image/CMakeLists.txt +++ b/ports/sdl2-image/CMakeLists.txt @@ -88,7 +88,7 @@ install(TARGETS SDL2_image ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) -install(FILES SDL_image.h DESTINATION include/SDL2_image CONFIGURATIONS Release) +install(FILES SDL_image.h DESTINATION include/SDL2 CONFIGURATIONS Release) message(STATUS "Link-time dependencies:") From 860344120371cb51150dbe587a3364b6587b6b17 Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Mon, 9 Jan 2017 15:54:05 -0800 Subject: [PATCH 12/48] added patch to enable uwp builds --- ports/tiff/fix-uwp.patch | 25 +++++++++++++++++++++++++ ports/tiff/portfile.cmake | 1 + 2 files changed, 26 insertions(+) create mode 100644 ports/tiff/fix-uwp.patch diff --git a/ports/tiff/fix-uwp.patch b/ports/tiff/fix-uwp.patch new file mode 100644 index 000000000..6fce8d573 --- /dev/null +++ b/ports/tiff/fix-uwp.patch @@ -0,0 +1,25 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 439e26a..05416d8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -187,6 +187,7 @@ endforeach(flag ${test_flags}) + + if(MSVC) + set(CMAKE_DEBUG_POSTFIX "d") ++ add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE) + endif() + + option(ld-version-script "Enable linker version script" ON) +diff --git a/libtiff/tif_dirread.c b/libtiff/tif_dirread.c +index a0dc68b..3c4e101 100644 +--- a/libtiff/tif_dirread.c ++++ b/libtiff/tif_dirread.c +@@ -3690,7 +3690,7 @@ TIFFReadDirectory(TIFF* tif) + case TIFFTAG_SMAXSAMPLEVALUE: + { + +- double *data; ++ double *data = NULL; + enum TIFFReadDirEntryErr err; + uint32 saved_flags; + int m; diff --git a/ports/tiff/portfile.cmake b/ports/tiff/portfile.cmake index 345024fe0..281d681b9 100644 --- a/ports/tiff/portfile.cmake +++ b/ports/tiff/portfile.cmake @@ -10,6 +10,7 @@ vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES ${CMAKE_CURRENT_LIST_DIR}/add-component-options.patch + ${CMAKE_CURRENT_LIST_DIR}/fix-uwp.patch ) vcpkg_configure_cmake( From 02964007d6f74dd10db2cb0e05676f03a53c8451 Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Mon, 9 Jan 2017 19:57:31 -0800 Subject: [PATCH 13/48] added support for uwp builds --- ports/freetype/0003-Fix-UWP.patch | 63 +++++++++++++++++++++++++++++++ ports/freetype/portfile.cmake | 1 + 2 files changed, 64 insertions(+) create mode 100644 ports/freetype/0003-Fix-UWP.patch diff --git a/ports/freetype/0003-Fix-UWP.patch b/ports/freetype/0003-Fix-UWP.patch new file mode 100644 index 000000000..253f91e6a --- /dev/null +++ b/ports/freetype/0003-Fix-UWP.patch @@ -0,0 +1,63 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 744b2d5..d114b9b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -312,6 +312,9 @@ else () + set(BASE_SRCS ${BASE_SRCS} src/base/ftdebug.c) + endif () + ++if(MSVC) ++ add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS) ++endif() + + if (BUILD_FRAMEWORK) + set(BASE_SRCS +diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h +index 4666d48..382a915 100644 +--- a/include/freetype/freetype.h ++++ b/include/freetype/freetype.h +@@ -845,6 +845,9 @@ FT_BEGIN_HEADER + /*************************************************************************/ + /*************************************************************************/ + ++#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) ++#define generic GenericFromFreeTypeLibrary ++#endif + + /*************************************************************************/ + /* */ +@@ -1777,6 +1780,10 @@ FT_BEGIN_HEADER + + } FT_GlyphSlotRec; + ++#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) ++#undef generic ++#endif ++ + + /*************************************************************************/ + /*************************************************************************/ +diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c +index fa05347..ae2754b 100644 +--- a/src/base/ftobjs.c ++++ b/src/base/ftobjs.c +@@ -457,6 +457,9 @@ + return error; + } + ++#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) ++#define generic GenericFromFreeTypeLibrary ++#endif + + /* documentation is in ftobjs.h */ + +@@ -971,6 +974,9 @@ + FT_FREE( face ); + } + ++#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) ++#undef generic ++#endif + + static void + Destroy_Driver( FT_Driver driver ) diff --git a/ports/freetype/portfile.cmake b/ports/freetype/portfile.cmake index 2e5e30c78..360345f1c 100644 --- a/ports/freetype/portfile.cmake +++ b/ports/freetype/portfile.cmake @@ -11,6 +11,7 @@ vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001-Support-Windows-DLLs-via-CMAKE_WINDOWS_EXPORT_ALL_SY.patch ${CMAKE_CURRENT_LIST_DIR}/0002-Add-CONFIG_INSTALL_PATH-option.patch + ${CMAKE_CURRENT_LIST_DIR}/0003-Fix-UWP.patch ) vcpkg_configure_cmake( From 07a46c8f49f86d0dd3cd312e1447ba22e79197d6 Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Tue, 10 Jan 2017 17:39:13 -0800 Subject: [PATCH 14/48] added support for uwp builds --- ports/libssh2/0001-Fix-UWP.patch | 48 ++++++++++++++++++++++++++++++++ ports/libssh2/portfile.cmake | 4 +++ 2 files changed, 52 insertions(+) create mode 100644 ports/libssh2/0001-Fix-UWP.patch diff --git a/ports/libssh2/0001-Fix-UWP.patch b/ports/libssh2/0001-Fix-UWP.patch new file mode 100644 index 000000000..270dd7b90 --- /dev/null +++ b/ports/libssh2/0001-Fix-UWP.patch @@ -0,0 +1,48 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 6401acf..64de3e9 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -349,7 +349,7 @@ target_include_directories(libssh2 PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) + # Check for the OS. + # Daniel's note: this should not be necessary and we need to work to + # get this removed. +-if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") ++if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows" OR ${CMAKE_SYSTEM_NAME} STREQUAL "WindowsStore") + target_compile_definitions(libssh2 PRIVATE LIBSSH2_WIN32) + elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + target_compile_definitions(libssh2 PRIVATE LIBSSH2_DARWIN) +diff --git a/src/agent.c b/src/agent.c +index c2ba422..f1799f8 100644 +--- a/src/agent.c ++++ b/src/agent.c +@@ -51,6 +51,10 @@ + #include "userauth.h" + #include "session.h" + ++#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) ++#define IS_UWP 1 ++#endif /* #if defined(WINAPI_FAMILY) */ ++ + /* Requests from client to agent for protocol 1 key operations */ + #define SSH_AGENTC_REQUEST_RSA_IDENTITIES 1 + #define SSH_AGENTC_RSA_CHALLENGE 3 +@@ -254,7 +258,7 @@ struct agent_ops agent_ops_unix = { + }; + #endif /* PF_UNIX */ + +-#ifdef WIN32 ++#if defined(WIN32) && !defined(IS_UWP) + /* Code to talk to Pageant was taken from PuTTY. + * + * Portions copyright Robert de Bath, Joris van Rantwijk, Delian +@@ -362,8 +366,8 @@ static struct { + const char *name; + struct agent_ops *ops; + } supported_backends[] = { +-#ifdef WIN32 +- {"Pageant", &agent_ops_pageant}, ++#if defined(WIN32) && !defined(IS_UWP) ++ {"Pageant", &agent_ops_pageant}, + #endif /* WIN32 */ + #ifdef PF_UNIX + {"Unix", &agent_ops_unix}, diff --git a/ports/libssh2/portfile.cmake b/ports/libssh2/portfile.cmake index 9b4cc77dd..2e3ee5009 100644 --- a/ports/libssh2/portfile.cmake +++ b/ports/libssh2/portfile.cmake @@ -7,6 +7,10 @@ vcpkg_download_distfile(ARCHIVE_FILE ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001-Fix-UWP.patch +) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS From 1911fa818225ac02affefd6e85a0626628fcf3e3 Mon Sep 17 00:00:00 2001 From: Albert Ziegenhagel Date: Wed, 11 Jan 2017 11:37:19 +0100 Subject: [PATCH 15/48] Acquire 7z Since 7zip is distribute as installer only (no archive) we use msiexec to extract the installer without installing it. msiexec should be available on all windows computers (located in C:/Windows/system32) --- .../cmake/vcpkg_find_acquire_program.cmake | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 83e41fe3b..df2f30af5 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -57,6 +57,12 @@ function(vcpkg_find_acquire_program VAR) set(URL "http://download.qt.io/official_releases/jom/jom_1_1_1.zip") set(ARCHIVE "jom_1_1_1.zip") set(HASH 23a26dc7e29979bec5dcd3bfcabf76397b93ace64f5d46f2254d6420158bac5eff1c1a8454e3427e7a2fe2c233c5f2cffc87b376772399e12e40b51be2c065f4) + elseif(VAR MATCHES "7Z") + set(PROGNAME 7z) + set(PATHS ${DOWNLOADS}/tools/7z/Files/7-Zip) + set(URL "http://7-zip.org/a/7z1604.msi") + set(ARCHIVE "7z1604.msi") + set(HASH 556f95f7566fe23704d136239e4cf5e2a26f939ab43b44145c91b70d031a088d553e5c21301f1242a2295dcde3143b356211f0108c68e65eef8572407618326d) else() message(FATAL "unknown tool ${VAR} -- unable to acquire.") endif() @@ -71,10 +77,21 @@ function(vcpkg_find_acquire_program VAR) if(DEFINED NOEXTRACT) file(COPY ${DOWNLOADS}/${ARCHIVE} DESTINATION ${DOWNLOADS}/tools/${PROGNAME}) else() - execute_process( - COMMAND ${CMAKE_COMMAND} -E tar xzf ${DOWNLOADS}/${ARCHIVE} - WORKING_DIRECTORY ${DOWNLOADS}/tools/${PROGNAME} - ) + get_filename_component(ARCHIVE_EXTENSION ${ARCHIVE} EXT) + string(TOLOWER "${ARCHIVE_EXTENSION}" ARCHIVE_EXTENSION) + if(${ARCHIVE_EXTENSION} STREQUAL ".msi") + file(TO_NATIVE_PATH "${DOWNLOADS}/${ARCHIVE}" ARCHIVE_NATIVE_PATH) + file(TO_NATIVE_PATH "${DOWNLOADS}/tools/${PROGNAME}" DESTINATION_NATIVE_PATH) + execute_process( + COMMAND msiexec /a ${ARCHIVE_NATIVE_PATH} /qn TARGETDIR=${DESTINATION_NATIVE_PATH} + WORKING_DIRECTORY ${DOWNLOADS} + ) + else() + execute_process( + COMMAND ${CMAKE_COMMAND} -E tar xzf ${DOWNLOADS}/${ARCHIVE} + WORKING_DIRECTORY ${DOWNLOADS}/tools/${PROGNAME} + ) + endif() endif() find_program(${VAR} ${PROGNAME} PATHS ${PATHS}) From 4bf2b196bff38decfacc921a61b8ff4f0a9d5efd Mon Sep 17 00:00:00 2001 From: Albert Ziegenhagel Date: Wed, 11 Jan 2017 12:01:37 +0100 Subject: [PATCH 16/48] Add port for metis --- ports/metis/CONTROL | 3 ++ ports/metis/disable-programs.patch | 8 ++++ ports/metis/enable-install.patch | 15 ++++++ ports/metis/fix-gklib-vs14-math.patch | 11 +++++ ports/metis/fix-metis-vs14-math.patch | 11 +++++ .../fix-runtime-install-destination.patch | 10 ++++ ports/metis/portfile.cmake | 47 +++++++++++++++++++ 7 files changed, 105 insertions(+) create mode 100644 ports/metis/CONTROL create mode 100644 ports/metis/disable-programs.patch create mode 100644 ports/metis/enable-install.patch create mode 100644 ports/metis/fix-gklib-vs14-math.patch create mode 100644 ports/metis/fix-metis-vs14-math.patch create mode 100644 ports/metis/fix-runtime-install-destination.patch create mode 100644 ports/metis/portfile.cmake diff --git a/ports/metis/CONTROL b/ports/metis/CONTROL new file mode 100644 index 000000000..cc604ce8f --- /dev/null +++ b/ports/metis/CONTROL @@ -0,0 +1,3 @@ +Source: metis +Version: 5.1.0 +Description: Serial Graph Partitioning and Fill-reducing Matrix Ordering diff --git a/ports/metis/disable-programs.patch b/ports/metis/disable-programs.patch new file mode 100644 index 000000000..0c23be553 --- /dev/null +++ b/ports/metis/disable-programs.patch @@ -0,0 +1,8 @@ +--- a/CMakeLists.txt Wed Dec 21 18:24:22 2016 ++++ b/CMakeLists.txt Wed Dec 21 18:24:26 2016 +@@ -20,4 +20,4 @@ + # Recursively look for CMakeLists.txt in subdirs. + add_subdirectory("include") + add_subdirectory("libmetis") +-add_subdirectory("programs") ++# add_subdirectory("programs") diff --git a/ports/metis/enable-install.patch b/ports/metis/enable-install.patch new file mode 100644 index 000000000..9f36623ad --- /dev/null +++ b/ports/metis/enable-install.patch @@ -0,0 +1,15 @@ +--- a/CMakeLists.txt Sat Mar 30 17:24:45 2013 ++++ b/CMakeLists.txt Wed Dec 21 18:23:43 2016 +@@ -4,11 +4,7 @@ + set(GKLIB_PATH "GKlib" CACHE PATH "path to GKlib") + set(SHARED FALSE CACHE BOOL "build a shared library") + +-if(MSVC) +- set(METIS_INSTALL FALSE) +-else() +- set(METIS_INSTALL TRUE) +-endif() ++set(METIS_INSTALL TRUE) + + # Configure libmetis library. + if(SHARED) diff --git a/ports/metis/fix-gklib-vs14-math.patch b/ports/metis/fix-gklib-vs14-math.patch new file mode 100644 index 000000000..e83a68230 --- /dev/null +++ b/ports/metis/fix-gklib-vs14-math.patch @@ -0,0 +1,11 @@ +--- a/GKlib/gk_arch.h Wed Dec 21 18:34:18 2016 ++++ b/GKlib/gk_arch.h Wed Dec 21 18:30:49 2016 +@@ -58,7 +58,7 @@ + #define PTRDIFF_MAX INT64_MAX + #endif + +-#ifdef __MSC__ ++#if defined(__MSC__) && (_MSC_VER < 1900) + /* MSC does not have rint() function */ + #define rint(x) ((int)((x)+0.5)) + diff --git a/ports/metis/fix-metis-vs14-math.patch b/ports/metis/fix-metis-vs14-math.patch new file mode 100644 index 000000000..a296213e8 --- /dev/null +++ b/ports/metis/fix-metis-vs14-math.patch @@ -0,0 +1,11 @@ +--- a/libmetis/metislib.h Sat Mar 30 17:24:45 2013 ++++ b/libmetis/metislib.h Wed Dec 21 18:30:59 2016 +@@ -31,7 +31,7 @@ + #include + + +-#if defined(COMPILER_MSC) ++#if defined(COMPILER_MSC) && (_MSC_VER < 1900) + #if defined(rint) + #undef rint + #endif diff --git a/ports/metis/fix-runtime-install-destination.patch b/ports/metis/fix-runtime-install-destination.patch new file mode 100644 index 000000000..8d9147e5f --- /dev/null +++ b/ports/metis/fix-runtime-install-destination.patch @@ -0,0 +1,10 @@ +--- a/libmetis/CMakeLists.txt Sat Mar 30 17:24:45 2013 ++++ b/libmetis/CMakeLists.txt Wed Dec 21 17:41:37 2016 +@@ -11,6 +11,6 @@ + if(METIS_INSTALL) + install(TARGETS metis + LIBRARY DESTINATION lib +- RUNTIME DESTINATION lib ++ RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib) + endif() diff --git a/ports/metis/portfile.cmake b/ports/metis/portfile.cmake new file mode 100644 index 000000000..c53adde4e --- /dev/null +++ b/ports/metis/portfile.cmake @@ -0,0 +1,47 @@ +# Common Ambient Variables: +# VCPKG_ROOT_DIR = +# TARGET_TRIPLET is the current triplet (x86-windows, etc) +# PORT is the current port name (zlib, etc) +# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} +# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} +# + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/metis-5.1.0) +vcpkg_download_distfile(ARCHIVE + URLS "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-5.1.0.tar.gz" + FILENAME "metis-5.1.0.tar.gz" + SHA512 deea47749d13bd06fbeaf98a53c6c0b61603ddc17a43dae81d72c8015576f6495fd83c11b0ef68d024879ed5415c14ebdbd87ce49c181bdac680573bea8bdb25 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/enable-install.patch + ${CMAKE_CURRENT_LIST_DIR}/disable-programs.patch + ${CMAKE_CURRENT_LIST_DIR}/fix-runtime-install-destination.patch + ${CMAKE_CURRENT_LIST_DIR}/fix-metis-vs14-math.patch + ${CMAKE_CURRENT_LIST_DIR}/fix-gklib-vs14-math.patch +) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(OPTIONS -DSHARED=ON -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON) +else() + set(OPTIONS -DSHARED=OFF) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + ${OPTIONS} +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/metis) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/metis/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/metis/copyright) From 86b117028b292f9577c160443601e589151cf550 Mon Sep 17 00:00:00 2001 From: Albert Ziegenhagel Date: Wed, 11 Jan 2017 12:13:19 +0100 Subject: [PATCH 17/48] Add port for szip --- ports/szip/CONTROL | 3 +++ ports/szip/portfile.cmake | 42 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 ports/szip/CONTROL create mode 100644 ports/szip/portfile.cmake diff --git a/ports/szip/CONTROL b/ports/szip/CONTROL new file mode 100644 index 000000000..cabcb582b --- /dev/null +++ b/ports/szip/CONTROL @@ -0,0 +1,3 @@ +Source: szip +Version: 2.1 +Description: Szip compression software, providing lossless compression of scientific data diff --git a/ports/szip/portfile.cmake b/ports/szip/portfile.cmake new file mode 100644 index 000000000..9204771c7 --- /dev/null +++ b/ports/szip/portfile.cmake @@ -0,0 +1,42 @@ +include(vcpkg_common_functions) + +# set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/szip-2.1) +# vcpkg_download_distfile(ARCHIVE +# URLS "https://support.hdfgroup.org/ftp/lib-external/szip/2.1/src/szip-2.1.tar.gz" +# FILENAME "szip-2.1.tar.gz" +# SHA512 ea91b877bb061fe6c96988a3c4b705e101a6950e34e9be53d6a57455c6a625be0afa60f4a3cfdd09649205b9f8586cc25ea60fe07a8131579acf3826b35fb749 +# ) +# vcpkg_extract_source_archive(${ARCHIVE}) + +# NOTE: We use Szip from the HDF5 cmake package dir, because it includes a lot of fixes for the CMake build files + +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/CMake-hdf5-1.10.0-patch1) +vcpkg_download_distfile(ARCHIVE + URLS "http://hdf4.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.0-patch1/src/CMake-hdf5-1.10.0-patch1.zip" + FILENAME "CMake-hdf5-1.10.0-patch1.zip" + SHA512 ec2edb43438661323be5998ecf64c4dd537ddc7451e31f89390260d16883e60a1ccc1bf745bcb809af22f2bf7157d50331a33910b8ebf5c59cd50693dfb2ef8f +) +vcpkg_extract_source_archive(${ARCHIVE}) +set(ARCHIVE ${SOURCE_PATH}/SZip.tar.gz) +vcpkg_extract_source_archive(${ARCHIVE}) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/Szip) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=1 + -DSZIP_INSTALL_DATA_DIR=share/szip/data + -DSZIP_INSTALL_CMAKE_DIR=share/szip +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +file(RENAME ${CURRENT_PACKAGES_DIR}/share/szip/data/COPYING ${CURRENT_PACKAGES_DIR}/share/szip/copyright) + +file(READ ${CURRENT_PACKAGES_DIR}/debug/share/szip/szip-targets-debug.cmake SZIP_TARGETS_DEBUG_MODULE) +string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" SZIP_TARGETS_DEBUG_MODULE "${SZIP_TARGETS_DEBUG_MODULE}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/szip/szip-targets-debug.cmake "${SZIP_TARGETS_DEBUG_MODULE}") + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) From f88b7d667cc9760f3506dbcf0d985d58165afc5a Mon Sep 17 00:00:00 2001 From: flysha Date: Wed, 11 Jan 2017 22:15:08 +0800 Subject: [PATCH 18/48] add DirectXTex --- ports/directxtex/CONTROL | 3 ++ ports/directxtex/portfile.cmake | 59 +++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 ports/directxtex/CONTROL create mode 100644 ports/directxtex/portfile.cmake diff --git a/ports/directxtex/CONTROL b/ports/directxtex/CONTROL new file mode 100644 index 000000000..b11daa8d4 --- /dev/null +++ b/ports/directxtex/CONTROL @@ -0,0 +1,3 @@ +Source: directxtex +Version: dec2016 +Description: DirectXTex texture processing library \ No newline at end of file diff --git a/ports/directxtex/portfile.cmake b/ports/directxtex/portfile.cmake new file mode 100644 index 000000000..befee008c --- /dev/null +++ b/ports/directxtex/portfile.cmake @@ -0,0 +1,59 @@ +# Common Ambient Variables: +# VCPKG_ROOT_DIR = +# TARGET_TRIPLET is the current triplet (x86-windows, etc) +# PORT is the current port name (zlib, etc) +# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} +# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} +# +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + message(STATUS "Warning: Dynamic building not supported yet. Building static.") + set(VCPKG_LIBRARY_LINKAGE static) +endif() + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/directxtex-dec2016) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/Microsoft/DirectXTex/archive/dec2016.tar.gz" + FILENAME "directxtex-dec2016.tar.gz" + SHA512 87797340c40a98a7b11b6eb7da17d0b93bc01ba48deed50e99ce74e0e33387cac2ec18f2f14d0148c2a79f97ca98d6b2a228dad2f16010b6dcf03c0d24a79d20 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +IF (TRIPLET_SYSTEM_ARCH MATCHES "x86") + SET(BUILD_ARCH "Win32") +ELSE() + SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH}) +ENDIF() + +vcpkg_build_msbuild( + PROJECT_PATH ${SOURCE_PATH}/DirectXTex_Desktop_2015.sln + PLATFORM ${BUILD_ARCH} +) + +file(INSTALL + ${SOURCE_PATH}/DirectXTex/DirectXTex.h + ${SOURCE_PATH}/DirectXTex/DirectXTex.inl + DESTINATION ${CURRENT_PACKAGES_DIR}/include +) +file(INSTALL + ${SOURCE_PATH}/DirectXTex/Bin/Desktop_2015/${BUILD_ARCH}/Debug/DirectXTex.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) +file(INSTALL + ${SOURCE_PATH}/DirectXTex/Bin/Desktop_2015/${BUILD_ARCH}/Release/DirectXTex.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + +set(TOOL_PATH ${CURRENT_PACKAGES_DIR}/tools) +file(MAKE_DIRECTORY ${TOOL_PATH}) +file(INSTALL + ${SOURCE_PATH}/Texdiag/Bin/Desktop_2015/${BUILD_ARCH}/Release/texdiag.exe + DESTINATION ${TOOL_PATH}) +file(INSTALL + ${SOURCE_PATH}/Texconv/Bin/Desktop_2015/${BUILD_ARCH}/Release/Texconv.exe + DESTINATION ${TOOL_PATH}) +file(INSTALL + ${SOURCE_PATH}/Texassemble/Bin/Desktop_2015/${BUILD_ARCH}/Release/Texassemble.exe + DESTINATION ${TOOL_PATH}) + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/DirectXTex) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/DirectXTex/LICENSE ${CURRENT_PACKAGES_DIR}/share/DirectXTex/copyright) From 09c8abf7abd669ebd330660a50186e41a1839214 Mon Sep 17 00:00:00 2001 From: flysha Date: Wed, 11 Jan 2017 22:42:37 +0800 Subject: [PATCH 19/48] add DirectXMesh --- ports/directxmesh/CONTROL | 3 ++ ports/directxmesh/portfile.cmake | 48 ++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 ports/directxmesh/CONTROL create mode 100644 ports/directxmesh/portfile.cmake diff --git a/ports/directxmesh/CONTROL b/ports/directxmesh/CONTROL new file mode 100644 index 000000000..13401f80d --- /dev/null +++ b/ports/directxmesh/CONTROL @@ -0,0 +1,3 @@ +Source: directxmesh +Version: oct2016 +Description: DirectXMesh geometry processing library \ No newline at end of file diff --git a/ports/directxmesh/portfile.cmake b/ports/directxmesh/portfile.cmake new file mode 100644 index 000000000..45ed111ee --- /dev/null +++ b/ports/directxmesh/portfile.cmake @@ -0,0 +1,48 @@ +# Common Ambient Variables: +# VCPKG_ROOT_DIR = +# TARGET_TRIPLET is the current triplet (x86-windows, etc) +# PORT is the current port name (zlib, etc) +# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} +# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} +# + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/DirectXMesh-oct2016) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/Microsoft/DirectXMesh/archive/oct2016.tar.gz" + FILENAME "DirectXMesh-oct2016.tar.gz" + SHA512 8aaf9749766afd23709ce6c6f8d74b008fe9f96789e4d97cb387633dad34b4132ef28dfe028d13c779ea366428d53076a881c0d63c4f0c2c74d552293c8d6bf1 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +IF (TRIPLET_SYSTEM_ARCH MATCHES "x86") + SET(BUILD_ARCH "Win32") +ELSE() + SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH}) +ENDIF() + +vcpkg_build_msbuild( + PROJECT_PATH ${SOURCE_PATH}/DirectXMesh_Desktop_2015.sln + PLATFORM ${BUILD_ARCH} +) + +file(INSTALL + ${SOURCE_PATH}/DirectXMesh/DirectXMesh.h + ${SOURCE_PATH}/DirectXMesh/DirectXMesh.inl + DESTINATION ${CURRENT_PACKAGES_DIR}/include +) +file(INSTALL + ${SOURCE_PATH}/DirectXMesh/Bin/Desktop_2015/${BUILD_ARCH}/Debug/DirectXMesh.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) +file(INSTALL + ${SOURCE_PATH}/DirectXMesh/Bin/Desktop_2015/${BUILD_ARCH}/Release/DirectXMesh.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + +set(TOOL_PATH ${CURRENT_PACKAGES_DIR}/tools) +file(INSTALL + ${SOURCE_PATH}/Meshconvert/Bin/Desktop_2015/${BUILD_ARCH}/Release/Meshconvert.exe + DESTINATION ${TOOL_PATH}) + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/directxmesh) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/directxmesh/LICENSE ${CURRENT_PACKAGES_DIR}/share/directxmesh/copyright) From 2eadcd75add69718b9e63779b0701b5bc8e05ffe Mon Sep 17 00:00:00 2001 From: flysha Date: Wed, 11 Jan 2017 22:50:55 +0800 Subject: [PATCH 20/48] [directxtk] upgrade to dec2016 --- ports/directxtk/CONTROL | 2 +- ports/directxtk/portfile.cmake | 8 ++++---- ports/directxtk12/CONTROL | 2 +- ports/directxtk12/portfile.cmake | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ports/directxtk/CONTROL b/ports/directxtk/CONTROL index b5e0bcb7d..8a3da81a6 100644 --- a/ports/directxtk/CONTROL +++ b/ports/directxtk/CONTROL @@ -1,3 +1,3 @@ Source: directxtk -Version: oct2016-1 +Version: dec2016 Description: A collection of helper classes for writing DirectX 11.x code in C++. diff --git a/ports/directxtk/portfile.cmake b/ports/directxtk/portfile.cmake index c14b7c6aa..08f8a4537 100644 --- a/ports/directxtk/portfile.cmake +++ b/ports/directxtk/portfile.cmake @@ -4,11 +4,11 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) endif() include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/DirectXTK-oct2016) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/DirectXTK-dec2016) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/Microsoft/DirectXTK/archive/oct2016.tar.gz" - FILENAME "oct2016.tar.gz" - SHA512 b44ee28518ca65d38a3c915881ef79533b48b07d3738b616f1935d7c00a26d5e48b2292cde6acc34e933f85ba2a6362c585c60b2bbc704745d43cef53769a112 + URLS "https://github.com/Microsoft/DirectXTK/archive/dec2016.tar.gz" + FILENAME "DirectXTK-dec2016.tar.gz" + SHA512 efb8a98d0872bf1835b274ba88615e88c4a58ab753c5ebef5a407c54d5f9a2197d1521f14651c60ea16c047918db6f54bf2ac58a6eb7330490b9bae619e8dad3 ) vcpkg_extract_source_archive(${ARCHIVE}) diff --git a/ports/directxtk12/CONTROL b/ports/directxtk12/CONTROL index dd9ca5620..60393a1d9 100644 --- a/ports/directxtk12/CONTROL +++ b/ports/directxtk12/CONTROL @@ -1,3 +1,3 @@ Source: directxtk12 -Version: oct2016 +Version: dec2016 Description: A collection of helper classes for writing DirectX 12 code in C++. diff --git a/ports/directxtk12/portfile.cmake b/ports/directxtk12/portfile.cmake index 19372a3b1..e6f2fb4d8 100644 --- a/ports/directxtk12/portfile.cmake +++ b/ports/directxtk12/portfile.cmake @@ -4,11 +4,11 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) endif() include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/DirectXTK12-oct2016) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/DirectXTK12-dec2016) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/Microsoft/DirectXTK12/archive/oct2016.tar.gz" - FILENAME "DirectXTK12-oct2016.tar.gz" - SHA512 f33af80dc018c1fda117eeef66bd08046b48572806d879651187cbed9d5ceb402b1798ecc0e1089b54ddb879e5355b45f2b67e3be99fbe270c5216a945a9924b + URLS "https://github.com/Microsoft/DirectXTK12/archive/dec2016.tar.gz" + FILENAME "DirectXTK12-dec2016.tar.gz" + SHA512 7c98fbf1d7ef96807a38d396a87dacdc60fdcd7e461210d246cc424789c4c5c5fb1390db958c1bd1f77da8af756a9eae36813e5da6bbb0ea1432ff4004f1d010 ) vcpkg_extract_source_archive(${ARCHIVE}) From 719e9c7446a3fb40974c8686e5def4d5e544babc Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Wed, 11 Jan 2017 07:42:54 -0800 Subject: [PATCH 21/48] added missing store parameter to vcvarsall for uwp builds --- ports/openssl/setVSvars.bat | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/openssl/setVSvars.bat b/ports/openssl/setVSvars.bat index 23259821e..e6ebc0a7d 100644 --- a/ports/openssl/setVSvars.bat +++ b/ports/openssl/setVSvars.bat @@ -3,7 +3,7 @@ call:set_%1 exit /b :set_universal10.0Win32 call:setVar _VS14VC VisualStudio14VC - call "%_VS14VC%vcvarsall" x86 + call "%_VS14VC%vcvarsall" x86 store set _VCPlatform=x86 set _VCLibPlat= call:setEnv @@ -11,7 +11,7 @@ exit /b :set_universal10.0x64 call:setVar _VS14VC VisualStudio14VC - call "%_VS14VC%vcvarsall" x64 + call "%_VS14VC%vcvarsall" x64 store set _VCPlatform=x64 set _VCLibPlat=amd64 call:setEnv @@ -19,7 +19,7 @@ exit /b :set_universal10.0arm call:setVar _VS14VC VisualStudio14VC - call "%_VS14VC%vcvarsall" x86_arm + call "%_VS14VC%vcvarsall" x86_arm store set _VCPlatform=ARM set _VCLibPlat=ARM call:setEnv @@ -27,7 +27,7 @@ exit /b :set_universal10.0arm64 call:setVar _VS14VC VisualStudio14VC - call "%_VS14VC%vcvarsall" x86_arm64 + call "%_VS14VC%vcvarsall" x86_arm64 store set _VCPlatform=ARM64 set _VCLibPlat=ARM64 call:setEnv From 00679b66e3d9fd49afd19a88418426fb50c39b08 Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Wed, 11 Jan 2017 10:59:45 -0800 Subject: [PATCH 22/48] added support for building uwp versions --- ports/curl/0002_fix_uwp.patch | 92 +++++++++++++++++++++++++++++++++++ ports/curl/portfile.cmake | 46 ++++++++++++++---- 2 files changed, 128 insertions(+), 10 deletions(-) create mode 100644 ports/curl/0002_fix_uwp.patch diff --git a/ports/curl/0002_fix_uwp.patch b/ports/curl/0002_fix_uwp.patch new file mode 100644 index 000000000..a96f67838 --- /dev/null +++ b/ports/curl/0002_fix_uwp.patch @@ -0,0 +1,92 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ed3f38a..d6480b7 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1010,7 +1010,9 @@ include(CMake/OtherTests.cmake) + add_definitions(-DHAVE_CONFIG_H) + + # For windows, do not allow the compiler to use default target (Vista). +-if(WIN32) ++if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") ++ add_definitions(-D_WIN32_WINNT=0x0A00 -DHAVE_STRUCT_POLLFD -D_WINSOCK_DEPRECATED_NO_WARNINGS) ++elseif(WIN32) + add_definitions(-D_WIN32_WINNT=0x0501) + endif(WIN32) + +diff --git a/lib/curl_gethostname.c b/lib/curl_gethostname.c +index 2591fd8..4380b7c 100644 +--- a/lib/curl_gethostname.c ++++ b/lib/curl_gethostname.c +@@ -21,6 +21,7 @@ + ***************************************************************************/ + + #include "curl_setup.h" ++#include "curl/curl.h" + + #include "curl_gethostname.h" + +@@ -64,7 +65,7 @@ int Curl_gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen) { + #ifdef DEBUGBUILD + + /* Override host name when environment variable CURL_GETHOSTNAME is set */ +- const char *force_hostname = getenv("CURL_GETHOSTNAME"); ++ const char *force_hostname = curl_getenv("CURL_GETHOSTNAME"); + if(force_hostname) { + strncpy(name, force_hostname, namelen); + err = 0; +diff --git a/lib/curl_ntlm_core.c b/lib/curl_ntlm_core.c +index 812a073..3c322ed 100644 +--- a/lib/curl_ntlm_core.c ++++ b/lib/curl_ntlm_core.c +@@ -696,7 +696,7 @@ CURLcode Curl_ntlm_core_mk_ntlmv2_resp(unsigned char *ntlmv2hash, + + /* Calculate the timestamp */ + #ifdef DEBUGBUILD +- char *force_timestamp = getenv("CURL_FORCETIME"); ++ char *force_timestamp = curl_getenv("CURL_FORCETIME"); + if(force_timestamp) + tw = CURL_OFF_T_C(11644473600) * 10000000; + else +diff --git a/lib/ftp.c b/lib/ftp.c +index b231731..d50779f 100644 +--- a/lib/ftp.c ++++ b/lib/ftp.c +@@ -3250,7 +3250,7 @@ static CURLcode ftp_done(struct connectdata *conn, CURLcode status, + ssize_t nread; + int ftpcode; + CURLcode result = CURLE_OK; +- char *path; ++ char *path = NULL; + const char *path_to_use = data->state.path; + + if(!ftp) +diff --git a/lib/smb.c b/lib/smb.c +index 7cb0c96..2f43d3c 100644 +--- a/lib/smb.c ++++ b/lib/smb.c +@@ -32,8 +32,12 @@ + + #ifdef HAVE_PROCESS_H + #include ++#if defined(CURL_WINDOWS_APP) ++#define getpid GetCurrentProcessId ++#else + #define getpid _getpid + #endif ++#endif + + #include "smb.h" + #include "urldata.h" +diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c +index 56a8823..4032e7e 100644 +--- a/lib/vtls/vtls.c ++++ b/lib/vtls/vtls.c +@@ -197,7 +197,7 @@ unsigned int Curl_rand(struct Curl_easy *data) + static bool seeded = FALSE; + + #ifdef CURLDEBUG +- char *force_entropy = getenv("CURL_ENTROPY"); ++ char *force_entropy = curl_getenv("CURL_ENTROPY"); + if(force_entropy) { + if(!seeded) { + size_t elen = strlen(force_entropy); diff --git a/ports/curl/portfile.cmake b/ports/curl/portfile.cmake index 01c76718b..e8fc658c0 100644 --- a/ports/curl/portfile.cmake +++ b/ports/curl/portfile.cmake @@ -13,22 +13,48 @@ vcpkg_apply_patches( ${CMAKE_CURRENT_LIST_DIR}/0001_cmake.patch ) +if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/0002_fix_uwp.patch +) +endif() + if (VCPKG_CRT_LINKAGE STREQUAL dynamic) SET(CURL_STATICLIB OFF) else() SET(CURL_STATICLIB ON) endif() -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - OPTIONS - -DBUILD_TESTING=OFF - -DBUILD_CURL_EXE=OFF - -DENABLE_MANUAL=OFF - -DCURL_STATICLIB=${CURL_STATICLIB} - OPTIONS_DEBUG - -DENABLE_DEBUG=ON -) +if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DBUILD_TESTING=OFF + -DBUILD_CURL_EXE=OFF + -DENABLE_MANUAL=OFF + -DUSE_WIN32_LDAP=OFF + -DCURL_DISABLE_TELNET=ON + -DENABLE_IPV6=OFF + -DENABLE_UNIX_SOCKETS=OFF + -DCMAKE_USE_OPENSSL=ON + -DCURL_STATICLIB=${CURL_STATICLIB} + OPTIONS_DEBUG + -DENABLE_DEBUG=ON + ) +else() + vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DBUILD_TESTING=OFF + -DBUILD_CURL_EXE=OFF + -DENABLE_MANUAL=OFF + -DCURL_STATICLIB=${CURL_STATICLIB} + OPTIONS_DEBUG + -DENABLE_DEBUG=ON + ) +endif() vcpkg_install_cmake() From f4622dce99378894b71c07e7fe989480981b5d56 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 11 Jan 2017 20:54:25 -0800 Subject: [PATCH 23/48] [7zip] Also consider the system version, if available --- scripts/cmake/vcpkg_find_acquire_program.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index df2f30af5..ab0cf1587 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -59,7 +59,7 @@ function(vcpkg_find_acquire_program VAR) set(HASH 23a26dc7e29979bec5dcd3bfcabf76397b93ace64f5d46f2254d6420158bac5eff1c1a8454e3427e7a2fe2c233c5f2cffc87b376772399e12e40b51be2c065f4) elseif(VAR MATCHES "7Z") set(PROGNAME 7z) - set(PATHS ${DOWNLOADS}/tools/7z/Files/7-Zip) + set(PATHS "C:/Program Files/7-Zip" ${DOWNLOADS}/tools/7z/Files/7-Zip) set(URL "http://7-zip.org/a/7z1604.msi") set(ARCHIVE "7z1604.msi") set(HASH 556f95f7566fe23704d136239e4cf5e2a26f939ab43b44145c91b70d031a088d553e5c21301f1242a2295dcde3143b356211f0108c68e65eef8572407618326d) From 8e57be16161fca1da94cc9faacb3d4bfaef2c6ec Mon Sep 17 00:00:00 2001 From: ab Date: Thu, 12 Jan 2017 12:28:08 +0100 Subject: [PATCH 24/48] On release set HTTP_PARSER_STRICT to zero. This was done to match the http-parser makefile i.e. building in release mode strict parse is disabled (which is faster) else (in debug) strict parser is used. --- ports/http-parser/CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ports/http-parser/CMakeLists.txt b/ports/http-parser/CMakeLists.txt index 6e9067a04..d959fff79 100644 --- a/ports/http-parser/CMakeLists.txt +++ b/ports/http-parser/CMakeLists.txt @@ -5,13 +5,17 @@ if (BUILD_SHARED_LIBS) SET(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) endif() +if(CMAKE_BUILD_TYPE MATCHES "Release") + add_definitions(-DHTTP_PARSER_STRICT=0) +endif() + add_library(http_parser http_parser.c http_parser.h) install(TARGETS http_parser - RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" - ARCHIVE DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" + RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" + ARCHIVE DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" ) if (NOT SKIP_INSTALL_HEADERS) - install(FILES http_parser.h DESTINATION "${CMAKE_INSTALL_PREFIX}/include") + install(FILES http_parser.h DESTINATION "${CMAKE_INSTALL_PREFIX}/include") endif() \ No newline at end of file From 2f92128e7fa4a56ed0f0e84ed55c344a9b193ab0 Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Thu, 12 Jan 2017 09:20:32 -0800 Subject: [PATCH 25/48] added support to build uwp versions --- ports/libwebsockets/0001-Fix-UWP.patch | 91 ++++++++++++++++++++++++++ ports/libwebsockets/portfile.cmake | 8 +++ 2 files changed, 99 insertions(+) create mode 100644 ports/libwebsockets/0001-Fix-UWP.patch diff --git a/ports/libwebsockets/0001-Fix-UWP.patch b/ports/libwebsockets/0001-Fix-UWP.patch new file mode 100644 index 000000000..8996c4e0e --- /dev/null +++ b/ports/libwebsockets/0001-Fix-UWP.patch @@ -0,0 +1,91 @@ +diff --git a/lib/lws-plat-win.c b/lib/lws-plat-win.c +index dd3e95a..eb1690a 100644 +--- a/lib/lws-plat-win.c ++++ b/lib/lws-plat-win.c +@@ -155,7 +155,7 @@ lws_plat_service_tsi(struct lws_context *context, int timeout_ms, int tsi) + { + struct lws_context_per_thread *pt = &context->pt[tsi]; + WSANETWORKEVENTS networkevents; +- struct lws_pollfd *pfd; ++ struct lws_pollfd *pfd = NULL; + struct lws *wsi; + unsigned int i; + DWORD ev; +@@ -493,6 +493,7 @@ lws_plat_inet_ntop(int af, const void *src, char *dst, int cnt) + return ok ? dst : NULL; + } + ++#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP) + static lws_filefd_type + _lws_plat_file_open(struct lws *wsi, const char *filename, + unsigned long *filelen, int flags) +@@ -516,6 +517,35 @@ _lws_plat_file_open(struct lws *wsi, const char *filename, + + return ret; + } ++#else ++static lws_filefd_type ++_lws_plat_file_open(struct lws *wsi, const char *filename, ++ unsigned long *filelen, int flags) ++{ ++ HANDLE ret; ++ WCHAR buf[MAX_PATH]; ++ ++ (void)wsi; ++ MultiByteToWideChar(CP_UTF8, 0, filename, -1, buf, ARRAY_SIZE(buf)); ++ if ((flags & 7) == _O_RDONLY) { ++ ret = CreateFile2(buf, GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING, NULL); ++ } ++ else { ++ lwsl_err("%s: open for write not implemented\n", __func__); ++ *filelen = 0; ++ return LWS_INVALID_FILE; ++ } ++ ++ if (ret != LWS_INVALID_FILE) ++ { ++ struct stat info; ++ int result = stat(filename, &info); ++ *filelen = result != 0 ? -1 : (long)(info.st_size); ++ } ++ ++ return ret; ++} ++#endif + + static int + _lws_plat_file_close(struct lws *wsi, lws_filefd_type fd) +diff --git a/lib/private-libwebsockets.h b/lib/private-libwebsockets.h +index 23f8f4d..bc32aef 100644 +--- a/lib/private-libwebsockets.h ++++ b/lib/private-libwebsockets.h +@@ -48,12 +48,25 @@ + #endif + + #if defined(WIN32) || defined(_WIN32) ++ ++#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) ++ #ifndef WINVER ++ #define WINVER 0x0602 ++ #define _WIN32_WINNT WINVER ++ #endif ++ ++ #define getenv(x) NULL ++ #define _WINSOCK_DEPRECATED_NO_WARNINGS ++#else ++ + #if (WINVER < 0x0501) +-#undef WINVER +-#undef _WIN32_WINNT +-#define WINVER 0x0501 +-#define _WIN32_WINNT WINVER ++ #undef WINVER ++ #undef _WIN32_WINNT ++ #define WINVER 0x0501 ++ #define _WIN32_WINNT WINVER ++ #endif + #endif ++ + #define LWS_NO_DAEMONIZE + #define LWS_ERRNO WSAGetLastError() + #define LWS_EAGAIN WSAEWOULDBLOCK diff --git a/ports/libwebsockets/portfile.cmake b/ports/libwebsockets/portfile.cmake index 27088bf87..370350d56 100644 --- a/ports/libwebsockets/portfile.cmake +++ b/ports/libwebsockets/portfile.cmake @@ -11,6 +11,14 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) +if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/0001-Fix-UWP.patch +) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS From e4b1551988487059fcc0081bd86aaf7353044312 Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Thu, 12 Jan 2017 12:12:45 -0800 Subject: [PATCH 26/48] apply patch to all builds, not just uwp --- ports/libwebsockets/portfile.cmake | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ports/libwebsockets/portfile.cmake b/ports/libwebsockets/portfile.cmake index 370350d56..43502a52a 100644 --- a/ports/libwebsockets/portfile.cmake +++ b/ports/libwebsockets/portfile.cmake @@ -11,13 +11,11 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - vcpkg_apply_patches( - SOURCE_PATH ${SOURCE_PATH} - PATCHES - ${CMAKE_CURRENT_LIST_DIR}/0001-Fix-UWP.patch +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/0001-Fix-UWP.patch ) -endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} From 30429e68db721f542abf153293b49822c107870e Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Thu, 12 Jan 2017 12:35:24 -0800 Subject: [PATCH 27/48] apply uwp patch to all builds --- ports/curl/portfile.cmake | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/ports/curl/portfile.cmake b/ports/curl/portfile.cmake index e8fc658c0..35bfbd592 100644 --- a/ports/curl/portfile.cmake +++ b/ports/curl/portfile.cmake @@ -11,16 +11,9 @@ vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001_cmake.patch + ${CMAKE_CURRENT_LIST_DIR}/0002_fix_uwp.patch ) -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - vcpkg_apply_patches( - SOURCE_PATH ${SOURCE_PATH} - PATCHES - ${CMAKE_CURRENT_LIST_DIR}/0002_fix_uwp.patch -) -endif() - if (VCPKG_CRT_LINKAGE STREQUAL dynamic) SET(CURL_STATICLIB OFF) else() From 41eba85b32193ed3e75d9c6b48c5fdccfdf000a7 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 12 Jan 2017 16:48:51 -0800 Subject: [PATCH 28/48] [tiff] Bump version for change due to UWP support. --- ports/tiff/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/tiff/CONTROL b/ports/tiff/CONTROL index 65e3d37da..0c82029fb 100644 --- a/ports/tiff/CONTROL +++ b/ports/tiff/CONTROL @@ -1,4 +1,4 @@ Source: tiff -Version: 4.0.6-1 +Version: 4.0.6-2 Build-Depends: zlib Description: A library that supports the manipulation of TIFF image files \ No newline at end of file From 5082ea5464f6f816be4fd96270a6faa142b10fb0 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 12 Jan 2017 17:09:45 -0800 Subject: [PATCH 29/48] [freetype] Bump version to match source changes for uwp --- ports/freetype/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/freetype/CONTROL b/ports/freetype/CONTROL index 74f7e4986..866033e3c 100644 --- a/ports/freetype/CONTROL +++ b/ports/freetype/CONTROL @@ -1,4 +1,4 @@ Source: freetype -Version: 2.6.3-3 +Version: 2.6.3-4 Build-Depends: zlib, bzip2, libpng Description: A library to render fonts. \ No newline at end of file From 963cc56a8cec42a6ed185d78d6a5585272ba2d63 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 12 Jan 2017 17:26:04 -0800 Subject: [PATCH 30/48] [libssh2] Bump version to match source code change for uwp support --- ports/libssh2/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/libssh2/CONTROL b/ports/libssh2/CONTROL index d66030b71..715ffa0bd 100644 --- a/ports/libssh2/CONTROL +++ b/ports/libssh2/CONTROL @@ -1,4 +1,4 @@ Source: libssh2 -Version: 1.8.0 +Version: 1.8.0-1 Build-Depends: zlib, openssl Description: The SSH library \ No newline at end of file From 6a4ec92a90849e7cc343bbc8673ce0f063ffd939 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 12 Jan 2017 17:03:21 -0800 Subject: [PATCH 31/48] Place build & build_external commands into separate files --- toolsrc/include/vcpkg_Commands.h | 6 + toolsrc/src/commands_build.cpp | 130 ++++++++++++++++++++++ toolsrc/src/commands_build_external.cpp | 32 ++++++ toolsrc/src/commands_edit.cpp | 2 +- toolsrc/src/commands_installation.cpp | 141 +----------------------- toolsrc/vcpkg/vcpkg.vcxproj | 2 + toolsrc/vcpkg/vcpkg.vcxproj.filters | 6 + 7 files changed, 178 insertions(+), 141 deletions(-) create mode 100644 toolsrc/src/commands_build.cpp create mode 100644 toolsrc/src/commands_build_external.cpp diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index fd427fd40..213d31ada 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -5,6 +5,12 @@ namespace vcpkg { + // + namespace Commands::details + { + void build_internal(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir); + } + extern const char*const INTEGRATE_COMMAND_HELPSTRING; void print_usage(); diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp new file mode 100644 index 000000000..9f37e25f9 --- /dev/null +++ b/toolsrc/src/commands_build.cpp @@ -0,0 +1,130 @@ +#include "vcpkg_Commands.h" +#include "StatusParagraphs.h" +#include "vcpkg.h" +#include "vcpkg_Input.h" +#include "post_build_lint.h" +#include "vcpkg_Dependencies.h" +#include "vcpkg_System.h" +#include "vcpkg_Environment.h" +#include "metrics.h" +#include "vcpkg_info.h" +#include + +namespace vcpkg +{ + using Dependencies::package_spec_with_install_plan; + using Dependencies::install_plan_type; + + static const std::string OPTION_CHECKS_ONLY = "--checks-only"; + + static void create_binary_control_file(const vcpkg_paths& paths, const SourceParagraph& source_paragraph, const triplet& target_triplet) + { + const BinaryParagraph bpgh = BinaryParagraph(source_paragraph, target_triplet); + const fs::path binary_control_file = paths.packages / bpgh.dir() / "CONTROL"; + std::ofstream(binary_control_file) << bpgh; + } + + namespace Commands::details + { + void build_internal(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir) + { + Checks::check_exit(spec.name() == source_paragraph.name, "inconsistent arguments to build_internal()"); + const triplet& target_triplet = spec.target_triplet(); + + const fs::path ports_cmake_script_path = paths.ports_cmake; + const std::wstring command = Strings::wformat(LR"("%%VS140COMNTOOLS%%..\..\VC\vcvarsall.bat" %s && cmake -DCMD=BUILD -DPORT=%s -DTARGET_TRIPLET=%s "-DCURRENT_PORT_DIR=%s/." -P "%s")", + Strings::utf8_to_utf16(target_triplet.architecture()), + Strings::utf8_to_utf16(source_paragraph.name), + Strings::utf8_to_utf16(target_triplet.canonical_name()), + port_dir.generic_wstring(), + ports_cmake_script_path.generic_wstring()); + + System::Stopwatch2 timer; + timer.start(); + int return_code = System::cmd_execute(command); + timer.stop(); + TrackMetric("buildtimeus-" + to_string(spec), timer.microseconds()); + + if (return_code != 0) + { + System::println(System::color::error, "Error: building package %s failed", to_string(spec)); + System::println("Please ensure sure you're using the latest portfiles with `vcpkg update`, then\n" + "submit an issue at https://github.com/Microsoft/vcpkg/issues including:\n" + " Package: %s\n" + " Vcpkg version: %s\n" + "\n" + "Additionally, attach any relevant sections from the log files above." + , to_string(spec), Info::version()); + TrackProperty("error", "build failed"); + TrackProperty("build_error", to_string(spec)); + exit(EXIT_FAILURE); + } + + PostBuildLint::perform_all_checks(spec, paths); + + create_binary_control_file(paths, source_paragraph, target_triplet); + + // const fs::path port_buildtrees_dir = paths.buildtrees / spec.name; + // delete_directory(port_buildtrees_dir); + } + } + void build_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) + { + static const std::string example = create_example_string("build zlib:x64-windows"); + + // Installing multiple packages leads to unintuitive behavior if one of them depends on another. + // Allowing only 1 package for now. + + args.check_exact_arg_count(1, example); + + StatusParagraphs status_db = database_load_check(paths); + + const package_spec spec = Input::check_and_get_package_spec(args.command_arguments.at(0), default_target_triplet, example); + Input::check_triplet(spec.target_triplet(), paths); + + const std::unordered_set options = args.check_and_get_optional_command_arguments({OPTION_CHECKS_ONLY}); + if (options.find(OPTION_CHECKS_ONLY) != options.end()) + { + PostBuildLint::perform_all_checks(spec, paths); + exit(EXIT_SUCCESS); + } + + // Explicitly load and use the portfile's build dependencies when resolving the build command (instead of a cached package's dependencies). + const expected maybe_spgh = try_load_port(paths, spec.name()); + Checks::check_exit(!maybe_spgh.error_code(), "Could not find package named %s: %s", spec, maybe_spgh.error_code().message()); + const SourceParagraph& spgh = *maybe_spgh.get(); + + const std::vector first_level_deps = filter_dependencies(spgh.depends, spec.target_triplet()); + + std::vector first_level_deps_specs; + for (const std::string& dep : first_level_deps) + { + first_level_deps_specs.push_back(package_spec::from_name_and_triplet(dep, spec.target_triplet()).get_or_throw()); + } + + std::vector unmet_dependencies = Dependencies::create_install_plan(paths, first_level_deps_specs, status_db); + unmet_dependencies.erase( + std::remove_if(unmet_dependencies.begin(), unmet_dependencies.end(), [](const package_spec_with_install_plan& p) + { + return p.plan.type == install_plan_type::ALREADY_INSTALLED; + }), + unmet_dependencies.end()); + + if (!unmet_dependencies.empty()) + { + System::println(System::color::error, "The build command requires all dependencies to be already installed."); + System::println("The following dependencies are missing:"); + System::println(""); + for (const package_spec_with_install_plan& p : unmet_dependencies) + { + System::println(" %s", to_string(p.spec)); + } + System::println(""); + exit(EXIT_FAILURE); + } + + Environment::ensure_utilities_on_path(paths); + Commands::details::build_internal(spgh, spec, paths, paths.port_dir(spec)); + exit(EXIT_SUCCESS); + } +} diff --git a/toolsrc/src/commands_build_external.cpp b/toolsrc/src/commands_build_external.cpp new file mode 100644 index 000000000..d34981e04 --- /dev/null +++ b/toolsrc/src/commands_build_external.cpp @@ -0,0 +1,32 @@ +#include "vcpkg_Commands.h" +#include "vcpkg_System.h" +#include "vcpkg_Environment.h" +#include "vcpkg_Input.h" +#include "vcpkg.h" + +namespace vcpkg +{ + void build_external_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) + { + static const std::string example = create_example_string(R"(build_external zlib2 C:\path\to\dir\with\controlfile\)"); + args.check_exact_arg_count(2, example); + + expected maybe_current_spec = package_spec::from_string(args.command_arguments[0], default_target_triplet); + if (auto spec = maybe_current_spec.get()) + { + Input::check_triplet(spec->target_triplet(), paths); + Environment::ensure_utilities_on_path(paths); + const fs::path port_dir = args.command_arguments.at(1); + const expected maybe_spgh = try_load_port(port_dir); + if (auto spgh = maybe_spgh.get()) + { + Commands::details::build_internal(*spgh, *spec, paths, port_dir); + exit(EXIT_SUCCESS); + } + } + + System::println(System::color::error, "Error: %s: %s", maybe_current_spec.error_code().message(), args.command_arguments[0]); + print_example(Strings::format("%s zlib:x64-windows", args.command)); + exit(EXIT_FAILURE); + } +} diff --git a/toolsrc/src/commands_edit.cpp b/toolsrc/src/commands_edit.cpp index fbf4eab62..f7c489f2b 100644 --- a/toolsrc/src/commands_edit.cpp +++ b/toolsrc/src/commands_edit.cpp @@ -27,7 +27,7 @@ namespace vcpkg } } - std::wstring cmdLine = Strings::wformat(LR"("%s" "%s" "%s")", env_EDITOR, portpath.native(), (portpath / "portfile.cmake").native()); + std::wstring cmdLine = Strings::wformat(LR"("%s" "%s" "%s" -n)", env_EDITOR, portpath.native(), (portpath / "portfile.cmake").native()); exit(System::cmd_execute(cmdLine)); } } diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_installation.cpp index c239bf06c..f44852930 100644 --- a/toolsrc/src/commands_installation.cpp +++ b/toolsrc/src/commands_installation.cpp @@ -1,72 +1,17 @@ #include "vcpkg_Commands.h" #include "vcpkg.h" -#include #include "vcpkg_Environment.h" #include "metrics.h" #include "vcpkg_Files.h" -#include "post_build_lint.h" #include "vcpkg_System.h" #include "vcpkg_Dependencies.h" #include "vcpkg_Input.h" -#include "vcpkg_Maps.h" -#include "vcpkg_info.h" namespace vcpkg { using Dependencies::package_spec_with_install_plan; using Dependencies::install_plan_type; - static const std::string OPTION_CHECKS_ONLY = "--checks-only"; - - static void create_binary_control_file(const vcpkg_paths& paths, const SourceParagraph& source_paragraph, const triplet& target_triplet) - { - const BinaryParagraph bpgh = BinaryParagraph(source_paragraph, target_triplet); - const fs::path binary_control_file = paths.packages / bpgh.dir() / "CONTROL"; - std::ofstream(binary_control_file) << bpgh; - } - - static void build_internal(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir) - { - Checks::check_exit(spec.name() == source_paragraph.name, "inconsistent arguments to build_internal()"); - const triplet& target_triplet = spec.target_triplet(); - - const fs::path ports_cmake_script_path = paths.ports_cmake; - const std::wstring command = Strings::wformat(LR"("%%VS140COMNTOOLS%%..\..\VC\vcvarsall.bat" %s && cmake -DCMD=BUILD -DPORT=%s -DTARGET_TRIPLET=%s "-DCURRENT_PORT_DIR=%s/." -P "%s")", - Strings::utf8_to_utf16(target_triplet.architecture()), - Strings::utf8_to_utf16(source_paragraph.name), - Strings::utf8_to_utf16(target_triplet.canonical_name()), - port_dir.generic_wstring(), - ports_cmake_script_path.generic_wstring()); - - System::Stopwatch2 timer; - timer.start(); - int return_code = System::cmd_execute(command); - timer.stop(); - TrackMetric("buildtimeus-" + to_string(spec), timer.microseconds()); - - if (return_code != 0) - { - System::println(System::color::error, "Error: building package %s failed", to_string(spec)); - System::println("Please ensure sure you're using the latest portfiles with `vcpkg update`, then\n" - "submit an issue at https://github.com/Microsoft/vcpkg/issues including:\n" - " Package: %s\n" - " Vcpkg version: %s\n" - "\n" - "Additionally, attach any relevant sections from the log files above." - , to_string(spec), Info::version()); - TrackProperty("error", "build failed"); - TrackProperty("build_error", to_string(spec)); - exit(EXIT_FAILURE); - } - - PostBuildLint::perform_all_checks(spec, paths); - - create_binary_control_file(paths, source_paragraph, target_triplet); - - // const fs::path port_buildtrees_dir = paths.buildtrees / spec.name; - // delete_directory(port_buildtrees_dir); - } - static void install_and_write_listfile(const vcpkg_paths& paths, const BinaryParagraph& bpgh) { std::vector output; @@ -271,7 +216,7 @@ namespace vcpkg } else if (action.plan.type == install_plan_type::BUILD_AND_INSTALL) { - build_internal(*action.plan.spgh, action.spec, paths, paths.port_dir(action.spec)); + Commands::details::build_internal(*action.plan.spgh, action.spec, paths, paths.port_dir(action.spec)); const BinaryParagraph bpgh = try_load_cached_package(paths, action.spec).get_or_throw(); install_package(paths, bpgh, status_db); System::println(System::color::success, "Package %s is installed", action.spec); @@ -293,88 +238,4 @@ namespace vcpkg exit(EXIT_SUCCESS); } - - void build_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) - { - static const std::string example = create_example_string("build zlib:x64-windows"); - - // Installing multiple packages leads to unintuitive behavior if one of them depends on another. - // Allowing only 1 package for now. - - args.check_exact_arg_count(1, example); - - StatusParagraphs status_db = database_load_check(paths); - - const package_spec spec = Input::check_and_get_package_spec(args.command_arguments.at(0), default_target_triplet, example); - Input::check_triplet(spec.target_triplet(), paths); - - const std::unordered_set options = args.check_and_get_optional_command_arguments({OPTION_CHECKS_ONLY}); - if (options.find(OPTION_CHECKS_ONLY) != options.end()) - { - PostBuildLint::perform_all_checks(spec, paths); - exit(EXIT_SUCCESS); - } - - // Explicitly load and use the portfile's build dependencies when resolving the build command (instead of a cached package's dependencies). - const expected maybe_spgh = try_load_port(paths, spec.name()); - Checks::check_exit(!maybe_spgh.error_code(), "Could not find package named %s: %s", spec, maybe_spgh.error_code().message()); - const SourceParagraph& spgh = *maybe_spgh.get(); - - const std::vector first_level_deps = filter_dependencies(spgh.depends, spec.target_triplet()); - - std::vector first_level_deps_specs; - for (const std::string& dep : first_level_deps) - { - first_level_deps_specs.push_back(package_spec::from_name_and_triplet(dep, spec.target_triplet()).get_or_throw()); - } - - std::vector unmet_dependencies = Dependencies::create_install_plan(paths, first_level_deps_specs, status_db); - unmet_dependencies.erase( - std::remove_if(unmet_dependencies.begin(), unmet_dependencies.end(), [](const package_spec_with_install_plan& p) - { - return p.plan.type == install_plan_type::ALREADY_INSTALLED; - }), - unmet_dependencies.end()); - - if (!unmet_dependencies.empty()) - { - System::println(System::color::error, "The build command requires all dependencies to be already installed."); - System::println("The following dependencies are missing:"); - System::println(""); - for (const package_spec_with_install_plan& p : unmet_dependencies) - { - System::println(" %s", to_string(p.spec)); - } - System::println(""); - exit(EXIT_FAILURE); - } - - Environment::ensure_utilities_on_path(paths); - build_internal(spgh, spec, paths, paths.port_dir(spec)); - exit(EXIT_SUCCESS); - } - - void build_external_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) - { - static const std::string example = create_example_string(R"(build_external zlib2 C:\path\to\dir\with\controlfile\)"); - args.check_exact_arg_count(2, example); - - expected maybe_current_spec = package_spec::from_string(args.command_arguments[0], default_target_triplet); - if (auto spec = maybe_current_spec.get()) - { - Input::check_triplet(spec->target_triplet(), paths); - Environment::ensure_utilities_on_path(paths); - const fs::path port_dir = args.command_arguments.at(1); - const expected maybe_spgh = try_load_port(port_dir); - if (auto spgh = maybe_spgh.get()) - { - build_internal(*spgh, *spec, paths, port_dir); - exit(EXIT_SUCCESS); - } - } - - System::println(System::color::error, "Error: %s: %s", maybe_current_spec.error_code().message(), args.command_arguments[0]); - print_example(Strings::format("%s zlib:x64-windows", args.command)); - exit(EXIT_FAILURE); - } } diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/vcpkg/vcpkg.vcxproj index 7fab309d3..3b1ae0934 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj +++ b/toolsrc/vcpkg/vcpkg.vcxproj @@ -130,6 +130,8 @@ + + diff --git a/toolsrc/vcpkg/vcpkg.vcxproj.filters b/toolsrc/vcpkg/vcpkg.vcxproj.filters index cfbb17a22..16b813244 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj.filters +++ b/toolsrc/vcpkg/vcpkg.vcxproj.filters @@ -84,6 +84,12 @@ Source Files + + Source Files + + + Source Files + From 30587111d362bc8c2e0b700549d0fe7d62b9193d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 12 Jan 2017 17:04:32 -0800 Subject: [PATCH 32/48] Rename commands_installation to commands_install Names should match the command --- .../src/{commands_installation.cpp => commands_install.cpp} | 0 toolsrc/vcpkg/vcpkg.vcxproj | 2 +- toolsrc/vcpkg/vcpkg.vcxproj.filters | 6 +++--- 3 files changed, 4 insertions(+), 4 deletions(-) rename toolsrc/src/{commands_installation.cpp => commands_install.cpp} (100%) diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_install.cpp similarity index 100% rename from toolsrc/src/commands_installation.cpp rename to toolsrc/src/commands_install.cpp diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/vcpkg/vcpkg.vcxproj index 3b1ae0934..7179e38ed 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj +++ b/toolsrc/vcpkg/vcpkg.vcxproj @@ -147,7 +147,7 @@ - + diff --git a/toolsrc/vcpkg/vcpkg.vcxproj.filters b/toolsrc/vcpkg/vcpkg.vcxproj.filters index 16b813244..16d2f209d 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj.filters +++ b/toolsrc/vcpkg/vcpkg.vcxproj.filters @@ -27,9 +27,6 @@ Source Files - - Source Files - Source Files @@ -90,6 +87,9 @@ Source Files + + Source Files + From 4c51e65d5004311c7c7ba0687e7dba934ba986c1 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 12 Jan 2017 17:05:20 -0800 Subject: [PATCH 33/48] Rename commands_integration.cpp to commands_integrate.cpp Filename should match the command name --- .../{commands_integration.cpp => commands_integrate.cpp} | 0 toolsrc/vcpkg/vcpkg.vcxproj | 2 +- toolsrc/vcpkg/vcpkg.vcxproj.filters | 6 +++--- 3 files changed, 4 insertions(+), 4 deletions(-) rename toolsrc/src/{commands_integration.cpp => commands_integrate.cpp} (100%) diff --git a/toolsrc/src/commands_integration.cpp b/toolsrc/src/commands_integrate.cpp similarity index 100% rename from toolsrc/src/commands_integration.cpp rename to toolsrc/src/commands_integrate.cpp diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/vcpkg/vcpkg.vcxproj index 7179e38ed..0179852ef 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj +++ b/toolsrc/vcpkg/vcpkg.vcxproj @@ -148,7 +148,7 @@ - + diff --git a/toolsrc/vcpkg/vcpkg.vcxproj.filters b/toolsrc/vcpkg/vcpkg.vcxproj.filters index 16d2f209d..4a9bd4028 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj.filters +++ b/toolsrc/vcpkg/vcpkg.vcxproj.filters @@ -24,9 +24,6 @@ Source Files - - Source Files - Source Files @@ -90,6 +87,9 @@ Source Files + + Source Files + From df2a05e8546281135c6ea12430734d74371bcf46 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 12 Jan 2017 17:35:33 -0800 Subject: [PATCH 34/48] Introduce Command namespace. Refactoring --- toolsrc/include/vcpkg_Commands.h | 32 +++---- toolsrc/src/commands_available_commands.cpp | 44 ++++++++++ toolsrc/src/commands_build.cpp | 84 +++++++++---------- toolsrc/src/commands_build_external.cpp | 8 +- toolsrc/src/commands_cache.cpp | 4 +- toolsrc/src/commands_create.cpp | 4 +- toolsrc/src/commands_edit.cpp | 4 +- toolsrc/src/commands_hash.cpp | 4 +- toolsrc/src/commands_help.cpp | 8 +- ...ommands_other.cpp => commands_helpers.cpp} | 50 +---------- toolsrc/src/commands_import.cpp | 4 +- toolsrc/src/commands_install.cpp | 6 +- toolsrc/src/commands_integrate.cpp | 2 +- toolsrc/src/commands_list.cpp | 4 +- toolsrc/src/commands_owns.cpp | 4 +- toolsrc/src/commands_portsdiff.cpp | 4 +- toolsrc/src/commands_remove.cpp | 4 +- toolsrc/src/commands_search.cpp | 5 +- toolsrc/src/commands_update.cpp | 2 +- toolsrc/src/main.cpp | 10 +-- toolsrc/src/vcpkg_Input.cpp | 2 +- toolsrc/src/vcpkg_cmd_arguments.cpp | 6 +- toolsrc/vcpkg/vcpkg.vcxproj | 3 +- toolsrc/vcpkg/vcpkg.vcxproj.filters | 9 +- 24 files changed, 153 insertions(+), 154 deletions(-) create mode 100644 toolsrc/src/commands_available_commands.cpp rename toolsrc/src/{commands_other.cpp => commands_helpers.cpp} (60%) diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index 213d31ada..6b4941cc1 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -3,21 +3,17 @@ #include "vcpkg_cmd_arguments.h" #include "vcpkg_paths.h" -namespace vcpkg +namespace vcpkg::Commands { - // - namespace Commands::details - { - void build_internal(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir); - } - extern const char*const INTEGRATE_COMMAND_HELPSTRING; - void print_usage(); - void print_example(const std::string& command_and_arguments); - std::string create_example_string(const std::string& command_and_arguments); + using command_type_a = void(*)(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); + using command_type_b = void(*)(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + using command_type_c = void(*)(const vcpkg_cmd_arguments& args); + void update_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + void build_internal(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir); void build_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); void build_external_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); void install_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); @@ -30,7 +26,6 @@ namespace vcpkg void list_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); void import_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); void owns_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); - void internal_test_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); void cache_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); @@ -45,10 +40,6 @@ namespace vcpkg void contact_command(const vcpkg_cmd_arguments& args); void hash_command(const vcpkg_cmd_arguments& args); - using command_type_a = void(*)(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); - using command_type_b = void(*)(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); - using command_type_c = void(*)(const vcpkg_cmd_arguments& args); - template struct package_name_and_function { @@ -61,7 +52,7 @@ namespace vcpkg const std::vector>& get_available_commands_type_c(); template - T find_command(const std::string& command_name, const std::vector> available_commands) + T find(const std::string& command_name, const std::vector> available_commands) { for (const package_name_and_function& cmd : available_commands) { @@ -75,3 +66,12 @@ namespace vcpkg return nullptr; } } + +namespace vcpkg::Commands::Helpers +{ + void print_usage(); + + void print_example(const std::string& command_and_arguments); + + std::string create_example_string(const std::string& command_and_arguments); +} diff --git a/toolsrc/src/commands_available_commands.cpp b/toolsrc/src/commands_available_commands.cpp new file mode 100644 index 000000000..f78416aed --- /dev/null +++ b/toolsrc/src/commands_available_commands.cpp @@ -0,0 +1,44 @@ +#include "vcpkg_Commands.h" + +namespace vcpkg::Commands +{ + const std::vector>& get_available_commands_type_a() + { + static std::vector> t = { + {"install", install_command}, + {"remove", remove_command}, + {"build", build_command}, + {"build_external", build_external_command} + }; + return t; + } + + const std::vector>& get_available_commands_type_b() + { + static std::vector> t = { + {"/?", help_command}, + {"help", help_command}, + {"search", search_command}, + {"list", list_command}, + {"integrate", integrate_command}, + {"owns", owns_command}, + {"update", update_command}, + {"edit", edit_command}, + {"create", create_command}, + {"import", import_command}, + {"cache", cache_command}, + {"portsdiff", portsdiff_command} + }; + return t; + } + + const std::vector>& get_available_commands_type_c() + { + static std::vector> t = { + {"version", &version_command}, + {"contact", &contact_command}, + {"hash", &hash_command}, + }; + return t; + } +} diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index 9f37e25f9..178643d8e 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -10,7 +10,7 @@ #include "vcpkg_info.h" #include -namespace vcpkg +namespace vcpkg::Commands { using Dependencies::package_spec_with_install_plan; using Dependencies::install_plan_type; @@ -24,53 +24,51 @@ namespace vcpkg std::ofstream(binary_control_file) << bpgh; } - namespace Commands::details + void build_internal(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir) { - void build_internal(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir) + Checks::check_exit(spec.name() == source_paragraph.name, "inconsistent arguments to build_internal()"); + const triplet& target_triplet = spec.target_triplet(); + + const fs::path ports_cmake_script_path = paths.ports_cmake; + const std::wstring command = Strings::wformat(LR"("%%VS140COMNTOOLS%%..\..\VC\vcvarsall.bat" %s && cmake -DCMD=BUILD -DPORT=%s -DTARGET_TRIPLET=%s "-DCURRENT_PORT_DIR=%s/." -P "%s")", + Strings::utf8_to_utf16(target_triplet.architecture()), + Strings::utf8_to_utf16(source_paragraph.name), + Strings::utf8_to_utf16(target_triplet.canonical_name()), + port_dir.generic_wstring(), + ports_cmake_script_path.generic_wstring()); + + System::Stopwatch2 timer; + timer.start(); + int return_code = System::cmd_execute(command); + timer.stop(); + TrackMetric("buildtimeus-" + to_string(spec), timer.microseconds()); + + if (return_code != 0) { - Checks::check_exit(spec.name() == source_paragraph.name, "inconsistent arguments to build_internal()"); - const triplet& target_triplet = spec.target_triplet(); - - const fs::path ports_cmake_script_path = paths.ports_cmake; - const std::wstring command = Strings::wformat(LR"("%%VS140COMNTOOLS%%..\..\VC\vcvarsall.bat" %s && cmake -DCMD=BUILD -DPORT=%s -DTARGET_TRIPLET=%s "-DCURRENT_PORT_DIR=%s/." -P "%s")", - Strings::utf8_to_utf16(target_triplet.architecture()), - Strings::utf8_to_utf16(source_paragraph.name), - Strings::utf8_to_utf16(target_triplet.canonical_name()), - port_dir.generic_wstring(), - ports_cmake_script_path.generic_wstring()); - - System::Stopwatch2 timer; - timer.start(); - int return_code = System::cmd_execute(command); - timer.stop(); - TrackMetric("buildtimeus-" + to_string(spec), timer.microseconds()); - - if (return_code != 0) - { - System::println(System::color::error, "Error: building package %s failed", to_string(spec)); - System::println("Please ensure sure you're using the latest portfiles with `vcpkg update`, then\n" - "submit an issue at https://github.com/Microsoft/vcpkg/issues including:\n" - " Package: %s\n" - " Vcpkg version: %s\n" - "\n" - "Additionally, attach any relevant sections from the log files above." - , to_string(spec), Info::version()); - TrackProperty("error", "build failed"); - TrackProperty("build_error", to_string(spec)); - exit(EXIT_FAILURE); - } - - PostBuildLint::perform_all_checks(spec, paths); - - create_binary_control_file(paths, source_paragraph, target_triplet); - - // const fs::path port_buildtrees_dir = paths.buildtrees / spec.name; - // delete_directory(port_buildtrees_dir); + System::println(System::color::error, "Error: building package %s failed", to_string(spec)); + System::println("Please ensure sure you're using the latest portfiles with `vcpkg update`, then\n" + "submit an issue at https://github.com/Microsoft/vcpkg/issues including:\n" + " Package: %s\n" + " Vcpkg version: %s\n" + "\n" + "Additionally, attach any relevant sections from the log files above." + , to_string(spec), Info::version()); + TrackProperty("error", "build failed"); + TrackProperty("build_error", to_string(spec)); + exit(EXIT_FAILURE); } + + PostBuildLint::perform_all_checks(spec, paths); + + create_binary_control_file(paths, source_paragraph, target_triplet); + + // const fs::path port_buildtrees_dir = paths.buildtrees / spec.name; + // delete_directory(port_buildtrees_dir); } + void build_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) { - static const std::string example = create_example_string("build zlib:x64-windows"); + static const std::string example = Helpers::create_example_string("build zlib:x64-windows"); // Installing multiple packages leads to unintuitive behavior if one of them depends on another. // Allowing only 1 package for now. @@ -124,7 +122,7 @@ namespace vcpkg } Environment::ensure_utilities_on_path(paths); - Commands::details::build_internal(spgh, spec, paths, paths.port_dir(spec)); + Commands::build_internal(spgh, spec, paths, paths.port_dir(spec)); exit(EXIT_SUCCESS); } } diff --git a/toolsrc/src/commands_build_external.cpp b/toolsrc/src/commands_build_external.cpp index d34981e04..5ed52ad97 100644 --- a/toolsrc/src/commands_build_external.cpp +++ b/toolsrc/src/commands_build_external.cpp @@ -4,11 +4,11 @@ #include "vcpkg_Input.h" #include "vcpkg.h" -namespace vcpkg +namespace vcpkg::Commands { void build_external_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) { - static const std::string example = create_example_string(R"(build_external zlib2 C:\path\to\dir\with\controlfile\)"); + static const std::string example = Commands::Helpers::create_example_string(R"(build_external zlib2 C:\path\to\dir\with\controlfile\)"); args.check_exact_arg_count(2, example); expected maybe_current_spec = package_spec::from_string(args.command_arguments[0], default_target_triplet); @@ -20,13 +20,13 @@ namespace vcpkg const expected maybe_spgh = try_load_port(port_dir); if (auto spgh = maybe_spgh.get()) { - Commands::details::build_internal(*spgh, *spec, paths, port_dir); + Commands::build_internal(*spgh, *spec, paths, port_dir); exit(EXIT_SUCCESS); } } System::println(System::color::error, "Error: %s: %s", maybe_current_spec.error_code().message(), args.command_arguments[0]); - print_example(Strings::format("%s zlib:x64-windows", args.command)); + Commands::Helpers::print_example(Strings::format("%s zlib:x64-windows", args.command)); exit(EXIT_FAILURE); } } diff --git a/toolsrc/src/commands_cache.cpp b/toolsrc/src/commands_cache.cpp index 1a10b93cf..3d2916418 100644 --- a/toolsrc/src/commands_cache.cpp +++ b/toolsrc/src/commands_cache.cpp @@ -4,7 +4,7 @@ #include "Paragraphs.h" #include "BinaryParagraph.h" -namespace vcpkg +namespace vcpkg::Commands { static std::vector read_all_binary_paragraphs(const vcpkg_paths& paths) { @@ -37,7 +37,7 @@ namespace vcpkg void cache_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { static const std::string example = Strings::format( - "The argument should be a substring to search for, or no argument to display all cached libraries.\n%s", create_example_string("cache png")); + "The argument should be a substring to search for, or no argument to display all cached libraries.\n%s", Commands::Helpers::create_example_string("cache png")); args.check_max_arg_count(1, example); const std::vector binary_paragraphs = read_all_binary_paragraphs(paths); diff --git a/toolsrc/src/commands_create.cpp b/toolsrc/src/commands_create.cpp index ad00cd676..2fcd85dba 100644 --- a/toolsrc/src/commands_create.cpp +++ b/toolsrc/src/commands_create.cpp @@ -4,11 +4,11 @@ #include "vcpkg_Files.h" #include "vcpkg_Input.h" -namespace vcpkg +namespace vcpkg::Commands { void create_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { - static const std::string example = create_example_string(R"###(create zlib2 http://zlib.net/zlib128.zip "zlib128-2.zip")###"); + static const std::string example = Commands::Helpers::create_example_string(R"###(create zlib2 http://zlib.net/zlib128.zip "zlib128-2.zip")###"); args.check_max_arg_count(3, example); args.check_min_arg_count(2, example); diff --git a/toolsrc/src/commands_edit.cpp b/toolsrc/src/commands_edit.cpp index f7c489f2b..090837a19 100644 --- a/toolsrc/src/commands_edit.cpp +++ b/toolsrc/src/commands_edit.cpp @@ -2,11 +2,11 @@ #include "vcpkg_System.h" #include "vcpkg_Input.h" -namespace vcpkg +namespace vcpkg::Commands { void edit_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { - static const std::string example = create_example_string("edit zlib"); + static const std::string example = Commands::Helpers::create_example_string("edit zlib"); args.check_exact_arg_count(1, example); const std::string port_name = args.command_arguments.at(0); diff --git a/toolsrc/src/commands_hash.cpp b/toolsrc/src/commands_hash.cpp index 0e3e8a77c..c6827e07a 100644 --- a/toolsrc/src/commands_hash.cpp +++ b/toolsrc/src/commands_hash.cpp @@ -1,7 +1,7 @@ #include "vcpkg_Commands.h" #include "vcpkg_System.h" -namespace vcpkg +namespace vcpkg::Commands { static void do_file_hash(fs::path const& path, std::wstring const& hashType) { @@ -26,7 +26,7 @@ namespace vcpkg void hash_command(const vcpkg_cmd_arguments& args) { static const std::string example = Strings::format( - "The argument should be a file path\n%s", create_example_string("hash boost_1_62_0.tar.bz2")); + "The argument should be a file path\n%s", Commands::Helpers::create_example_string("hash boost_1_62_0.tar.bz2")); args.check_min_arg_count(1, example); args.check_max_arg_count(2, example); diff --git a/toolsrc/src/commands_help.cpp b/toolsrc/src/commands_help.cpp index fd02d948e..5baec62c7 100644 --- a/toolsrc/src/commands_help.cpp +++ b/toolsrc/src/commands_help.cpp @@ -2,7 +2,7 @@ #include "vcpkg_System.h" #include "vcpkg_info.h" -namespace vcpkg +namespace vcpkg::Commands { void version_command(const vcpkg_cmd_arguments& args) { @@ -19,18 +19,18 @@ namespace vcpkg args.check_max_arg_count(1); if (args.command_arguments.empty()) { - print_usage(); + Commands::Helpers::print_usage(); exit(EXIT_SUCCESS); } const auto& topic = args.command_arguments[0]; if (topic == "triplet") { - help_topic_valid_triplet(paths); + Commands::help_topic_valid_triplet(paths); } else { System::println(System::color::error, "Error: unknown topic %s", topic); - print_usage(); + Commands::Helpers::print_usage(); exit(EXIT_FAILURE); } exit(EXIT_SUCCESS); diff --git a/toolsrc/src/commands_other.cpp b/toolsrc/src/commands_helpers.cpp similarity index 60% rename from toolsrc/src/commands_other.cpp rename to toolsrc/src/commands_helpers.cpp index 6df325100..5d6e519ab 100644 --- a/toolsrc/src/commands_other.cpp +++ b/toolsrc/src/commands_helpers.cpp @@ -1,7 +1,7 @@ #include "vcpkg_Commands.h" #include "vcpkg_System.h" -namespace vcpkg +namespace vcpkg::Commands::Helpers { void print_usage() { @@ -52,52 +52,4 @@ namespace vcpkg { System::println(create_example_string(command_and_arguments)); } - - void internal_test_command(const vcpkg_cmd_arguments& /*args*/, const vcpkg_paths& /*paths*/) - { - // auto data = FormatEventData("test"); - // Track(data); - exit(EXIT_SUCCESS); - } - - const std::vector>& get_available_commands_type_a() - { - static std::vector> t = { - {"install", install_command}, - {"remove", remove_command}, - {"build", build_command}, - {"build_external", build_external_command} - }; - return t; - } - - const std::vector>& get_available_commands_type_b() - { - static std::vector> t = { - {"/?", help_command}, - {"help", help_command}, - {"search", search_command}, - {"list", list_command}, - {"integrate", integrate_command}, - {"owns", owns_command}, - {"update", update_command}, - {"edit", edit_command}, - {"create", create_command}, - {"import", import_command}, - {"cache", cache_command}, - {"internal_test", internal_test_command}, - {"portsdiff", portsdiff_command} - }; - return t; - } - - const std::vector>& get_available_commands_type_c() - { - static std::vector> t = { - {"version", &version_command}, - {"contact", &contact_command}, - {"hash", &hash_command}, - }; - return t; - } } diff --git a/toolsrc/src/commands_import.cpp b/toolsrc/src/commands_import.cpp index 3832f0e7b..c2c871414 100644 --- a/toolsrc/src/commands_import.cpp +++ b/toolsrc/src/commands_import.cpp @@ -4,7 +4,7 @@ #include "vcpkg_Files.h" #include -namespace vcpkg +namespace vcpkg::Commands { struct Binaries { @@ -77,7 +77,7 @@ namespace vcpkg void import_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { - static const std::string example = create_example_string(R"(import C:\path\to\CONTROLfile C:\path\to\includedir C:\path\to\projectdir)"); + static const std::string example = Commands::Helpers::create_example_string(R"(import C:\path\to\CONTROLfile C:\path\to\includedir C:\path\to\projectdir)"); args.check_exact_arg_count(3, example); const fs::path control_file_path(args.command_arguments[0]); diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index f44852930..ff5ddb0e7 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -7,7 +7,7 @@ #include "vcpkg_Dependencies.h" #include "vcpkg_Input.h" -namespace vcpkg +namespace vcpkg::Commands { using Dependencies::package_spec_with_install_plan; using Dependencies::install_plan_type; @@ -185,7 +185,7 @@ namespace vcpkg void install_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) { - static const std::string example = create_example_string("install zlib zlib:x64-windows curl boost"); + static const std::string example = Commands::Helpers::create_example_string("install zlib zlib:x64-windows curl boost"); args.check_min_arg_count(1, example); StatusParagraphs status_db = database_load_check(paths); @@ -216,7 +216,7 @@ namespace vcpkg } else if (action.plan.type == install_plan_type::BUILD_AND_INSTALL) { - Commands::details::build_internal(*action.plan.spgh, action.spec, paths, paths.port_dir(action.spec)); + Commands::build_internal(*action.plan.spgh, action.spec, paths, paths.port_dir(action.spec)); const BinaryParagraph bpgh = try_load_cached_package(paths, action.spec).get_or_throw(); install_package(paths, bpgh, status_db); System::println(System::color::success, "Package %s is installed", action.spec); diff --git a/toolsrc/src/commands_integrate.cpp b/toolsrc/src/commands_integrate.cpp index e7e5b2d8d..323735f6d 100644 --- a/toolsrc/src/commands_integrate.cpp +++ b/toolsrc/src/commands_integrate.cpp @@ -10,7 +10,7 @@ #include "vcpkg_System.h" #include "vcpkg_Files.h" -namespace vcpkg +namespace vcpkg::Commands { static const std::array old_system_target_files = { "C:/Program Files (x86)/MSBuild/14.0/Microsoft.Common.Targets/ImportBefore/vcpkg.nuget.targets", diff --git a/toolsrc/src/commands_list.cpp b/toolsrc/src/commands_list.cpp index cc51232e9..3e71f9c92 100644 --- a/toolsrc/src/commands_list.cpp +++ b/toolsrc/src/commands_list.cpp @@ -3,7 +3,7 @@ #include "vcpkg_System.h" #include "vcpkglib_helpers.h" -namespace vcpkg +namespace vcpkg::Commands { static void do_print(const StatusParagraph& pgh) { @@ -16,7 +16,7 @@ namespace vcpkg void list_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { static const std::string example = Strings::format( - "The argument should be a substring to search for, or no argument to display all installed libraries.\n%s", create_example_string("list png")); + "The argument should be a substring to search for, or no argument to display all installed libraries.\n%s", Commands::Helpers::create_example_string("list png")); args.check_max_arg_count(1, example); const StatusParagraphs status_paragraphs = database_load_check(paths); diff --git a/toolsrc/src/commands_owns.cpp b/toolsrc/src/commands_owns.cpp index 62dac57eb..e7719fe68 100644 --- a/toolsrc/src/commands_owns.cpp +++ b/toolsrc/src/commands_owns.cpp @@ -2,7 +2,7 @@ #include "vcpkg_System.h" #include "vcpkg.h" -namespace vcpkg +namespace vcpkg::Commands { static void search_file(const vcpkg_paths& paths, const std::string& file_substr, const StatusParagraphs& status_db) { @@ -23,7 +23,7 @@ namespace vcpkg void owns_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { - static const std::string example = Strings::format("The argument should be a pattern to search for. %s", create_example_string("owns zlib.dll")); + static const std::string example = Strings::format("The argument should be a pattern to search for. %s", Commands::Helpers::create_example_string("owns zlib.dll")); args.check_exact_arg_count(1, example); StatusParagraphs status_db = database_load_check(paths); diff --git a/toolsrc/src/commands_portsdiff.cpp b/toolsrc/src/commands_portsdiff.cpp index 46c6c90c7..4794dee2b 100644 --- a/toolsrc/src/commands_portsdiff.cpp +++ b/toolsrc/src/commands_portsdiff.cpp @@ -10,7 +10,7 @@ #include "SourceParagraph.h" #include "vcpkg_Environment.h" -namespace vcpkg +namespace vcpkg::Commands { static void do_print_name_and_version(const std::vector& ports_to_print, const std::map& names_and_versions) { @@ -99,7 +99,7 @@ namespace vcpkg void portsdiff_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { - static const std::string example = Strings::format("The argument should be a branch/tag/hash to checkout.\n%s", create_example_string("portsdiff mybranchname")); + static const std::string example = Strings::format("The argument should be a branch/tag/hash to checkout.\n%s", Commands::Helpers::create_example_string("portsdiff mybranchname")); args.check_min_arg_count(1, example); args.check_max_arg_count(2, example); diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index 445213fc2..16e8687e7 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -4,7 +4,7 @@ #include "vcpkg_Input.h" #include -namespace vcpkg +namespace vcpkg::Commands { static const std::string OPTION_PURGE = "--purge"; @@ -168,7 +168,7 @@ namespace vcpkg void remove_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) { - static const std::string example = create_example_string("remove zlib zlib:x64-windows curl boost"); + static const std::string example = Commands::Helpers::create_example_string("remove zlib zlib:x64-windows curl boost"); args.check_min_arg_count(1, example); const std::unordered_set options = args.check_and_get_optional_command_arguments({OPTION_PURGE}); diff --git a/toolsrc/src/commands_search.cpp b/toolsrc/src/commands_search.cpp index a4714477e..cc3e3fe26 100644 --- a/toolsrc/src/commands_search.cpp +++ b/toolsrc/src/commands_search.cpp @@ -4,7 +4,7 @@ #include "vcpkglib_helpers.h" #include "SourceParagraph.h" -namespace vcpkg +namespace vcpkg::Commands { static std::vector read_all_source_paragraphs(const vcpkg_paths& paths) { @@ -42,7 +42,8 @@ namespace vcpkg void search_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { - static const std::string example = Strings::format("The argument should be a substring to search for, or no argument to display all libraries.\n%s", create_example_string("search png")); + static const std::string example = Strings::format("The argument should be a substring to search for, or no argument to display all libraries.\n%s", + Commands::Helpers::create_example_string("search png")); args.check_max_arg_count(1, example); const std::vector source_paragraphs = read_all_source_paragraphs(paths); diff --git a/toolsrc/src/commands_update.cpp b/toolsrc/src/commands_update.cpp index a4ab7c6e7..9a480f3f5 100644 --- a/toolsrc/src/commands_update.cpp +++ b/toolsrc/src/commands_update.cpp @@ -5,7 +5,7 @@ #include "Paragraphs.h" #include "vcpkg_info.h" -namespace vcpkg +namespace vcpkg::Commands { void update_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { diff --git a/toolsrc/src/main.cpp b/toolsrc/src/main.cpp index 7703c541f..8490dc81b 100644 --- a/toolsrc/src/main.cpp +++ b/toolsrc/src/main.cpp @@ -21,7 +21,7 @@ bool g_debugging = false; void invalid_command(const std::string& cmd) { System::println(System::color::error, "invalid command: %s", cmd); - print_usage(); + Commands::Helpers::print_usage(); exit(EXIT_FAILURE); } @@ -30,11 +30,11 @@ static void inner(const vcpkg_cmd_arguments& args) TrackProperty("command", args.command); if (args.command.empty()) { - print_usage(); + Commands::Helpers::print_usage(); exit(EXIT_FAILURE); } - if (auto command_function = find_command(args.command, get_available_commands_type_c())) + if (auto command_function = Commands::find(args.command, Commands::get_available_commands_type_c())) { return command_function(args); } @@ -66,7 +66,7 @@ static void inner(const vcpkg_cmd_arguments& args) int exit_code = _wchdir(paths.root.c_str()); Checks::check_exit(exit_code == 0, "Changing the working dir failed"); - if (auto command_function = find_command(args.command, get_available_commands_type_b())) + if (auto command_function = Commands::find(args.command, Commands::get_available_commands_type_b())) { return command_function(args, paths); } @@ -91,7 +91,7 @@ static void inner(const vcpkg_cmd_arguments& args) Input::check_triplet(default_target_triplet, paths); - if (auto command_function = find_command(args.command, get_available_commands_type_a())) + if (auto command_function = Commands::find(args.command, Commands::get_available_commands_type_a())) { return command_function(args, paths, default_target_triplet); } diff --git a/toolsrc/src/vcpkg_Input.cpp b/toolsrc/src/vcpkg_Input.cpp index 365f28cdb..0c36291b4 100644 --- a/toolsrc/src/vcpkg_Input.cpp +++ b/toolsrc/src/vcpkg_Input.cpp @@ -37,7 +37,7 @@ namespace vcpkg::Input { System::println(System::color::error, "Error: invalid triplet: %s", t.canonical_name()); TrackProperty("error", "invalid triplet: " + t.canonical_name()); - help_topic_valid_triplet(paths); + Commands::help_topic_valid_triplet(paths); exit(EXIT_FAILURE); } } diff --git a/toolsrc/src/vcpkg_cmd_arguments.cpp b/toolsrc/src/vcpkg_cmd_arguments.cpp index a3648668f..ac55e931a 100644 --- a/toolsrc/src/vcpkg_cmd_arguments.cpp +++ b/toolsrc/src/vcpkg_cmd_arguments.cpp @@ -18,7 +18,7 @@ namespace vcpkg { System::println(System::color::error, "Error: expected value after %s", option_name); TrackProperty("error", "error option name"); - print_usage(); + Commands::Helpers::print_usage(); exit(EXIT_FAILURE); } @@ -26,7 +26,7 @@ namespace vcpkg { System::println(System::color::error, "Error: %s specified multiple times", option_name); TrackProperty("error", "error option specified multiple times"); - print_usage(); + Commands::Helpers::print_usage(); exit(EXIT_FAILURE); } @@ -42,7 +42,7 @@ namespace vcpkg { System::println(System::color::error, "Error: conflicting values specified for --%s", option_name); TrackProperty("error", "error conflicting switches"); - print_usage(); + Commands::Helpers::print_usage(); exit(EXIT_FAILURE); } option_field = new_setting; diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/vcpkg/vcpkg.vcxproj index 0179852ef..0b6e2b752 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj +++ b/toolsrc/vcpkg/vcpkg.vcxproj @@ -130,6 +130,7 @@ + @@ -144,7 +145,7 @@ - + diff --git a/toolsrc/vcpkg/vcpkg.vcxproj.filters b/toolsrc/vcpkg/vcpkg.vcxproj.filters index 4a9bd4028..df8c48f8b 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj.filters +++ b/toolsrc/vcpkg/vcpkg.vcxproj.filters @@ -18,9 +18,6 @@ Source Files - - Source Files - Source Files @@ -90,6 +87,12 @@ Source Files + + Source Files + + + Source Files + From 8e1ed2c9a95fa5b9e0bb0a9849a6e20878696f8c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 12 Jan 2017 17:41:50 -0800 Subject: [PATCH 35/48] Place contact and version commands in different cpp files --- toolsrc/src/commands_contact.cpp | 13 +++++++++++++ toolsrc/src/commands_help.cpp | 18 ------------------ toolsrc/src/commands_version.cpp | 16 ++++++++++++++++ toolsrc/vcpkg/vcpkg.vcxproj | 2 ++ toolsrc/vcpkg/vcpkg.vcxproj.filters | 6 ++++++ 5 files changed, 37 insertions(+), 18 deletions(-) create mode 100644 toolsrc/src/commands_contact.cpp create mode 100644 toolsrc/src/commands_version.cpp diff --git a/toolsrc/src/commands_contact.cpp b/toolsrc/src/commands_contact.cpp new file mode 100644 index 000000000..5bd1c1a67 --- /dev/null +++ b/toolsrc/src/commands_contact.cpp @@ -0,0 +1,13 @@ +#include "vcpkg_Commands.h" +#include "vcpkg_System.h" +#include "vcpkg_info.h" + +namespace vcpkg::Commands +{ + void contact_command(const vcpkg_cmd_arguments& args) + { + args.check_exact_arg_count(0); + System::println("Send an email to %s with any feedback.", Info::email()); + exit(EXIT_SUCCESS); + } +} diff --git a/toolsrc/src/commands_help.cpp b/toolsrc/src/commands_help.cpp index 5baec62c7..a0881e64d 100644 --- a/toolsrc/src/commands_help.cpp +++ b/toolsrc/src/commands_help.cpp @@ -1,19 +1,8 @@ #include "vcpkg_Commands.h" #include "vcpkg_System.h" -#include "vcpkg_info.h" namespace vcpkg::Commands { - void version_command(const vcpkg_cmd_arguments& args) - { - args.check_exact_arg_count(0); - System::println("Vcpkg package management program version %s\n" - "\n" - "See LICENSE.txt for license information.", Info::version() - ); - exit(EXIT_SUCCESS); - } - void help_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { args.check_max_arg_count(1); @@ -36,13 +25,6 @@ namespace vcpkg::Commands exit(EXIT_SUCCESS); } - void contact_command(const vcpkg_cmd_arguments& args) - { - args.check_exact_arg_count(0); - System::println("Send an email to %s with any feedback.", Info::email()); - exit(EXIT_SUCCESS); - } - void help_topic_valid_triplet(const vcpkg_paths& paths) { System::println("Available architecture triplets:"); diff --git a/toolsrc/src/commands_version.cpp b/toolsrc/src/commands_version.cpp new file mode 100644 index 000000000..03cce32d4 --- /dev/null +++ b/toolsrc/src/commands_version.cpp @@ -0,0 +1,16 @@ +#include "vcpkg_Commands.h" +#include "vcpkg_System.h" +#include "vcpkg_info.h" + +namespace vcpkg::Commands +{ + void version_command(const vcpkg_cmd_arguments& args) + { + args.check_exact_arg_count(0); + System::println("Vcpkg package management program version %s\n" + "\n" + "See LICENSE.txt for license information.", Info::version() + ); + exit(EXIT_SUCCESS); + } +} diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/vcpkg/vcpkg.vcxproj index 0b6e2b752..79d348910 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj +++ b/toolsrc/vcpkg/vcpkg.vcxproj @@ -134,6 +134,7 @@ + @@ -144,6 +145,7 @@ + diff --git a/toolsrc/vcpkg/vcpkg.vcxproj.filters b/toolsrc/vcpkg/vcpkg.vcxproj.filters index df8c48f8b..71b0635ab 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj.filters +++ b/toolsrc/vcpkg/vcpkg.vcxproj.filters @@ -93,6 +93,12 @@ Source Files + + Source Files + + + Source Files + From 678721b9a8efc550aee9e5293f1c39a4522428fa Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Thu, 12 Jan 2017 21:25:10 -0800 Subject: [PATCH 36/48] added missing free calls after curl_getenv --- ports/curl/0002_fix_uwp.patch | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/ports/curl/0002_fix_uwp.patch b/ports/curl/0002_fix_uwp.patch index a96f67838..5cd0678cf 100644 --- a/ports/curl/0002_fix_uwp.patch +++ b/ports/curl/0002_fix_uwp.patch @@ -14,7 +14,7 @@ index ed3f38a..d6480b7 100644 endif(WIN32) diff --git a/lib/curl_gethostname.c b/lib/curl_gethostname.c -index 2591fd8..4380b7c 100644 +index 2591fd8..cef38ac 100644 --- a/lib/curl_gethostname.c +++ b/lib/curl_gethostname.c @@ -21,6 +21,7 @@ @@ -25,28 +25,37 @@ index 2591fd8..4380b7c 100644 #include "curl_gethostname.h" -@@ -64,7 +65,7 @@ int Curl_gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen) { +@@ -64,9 +65,10 @@ int Curl_gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen) { #ifdef DEBUGBUILD /* Override host name when environment variable CURL_GETHOSTNAME is set */ - const char *force_hostname = getenv("CURL_GETHOSTNAME"); -+ const char *force_hostname = curl_getenv("CURL_GETHOSTNAME"); ++ char *force_hostname = curl_getenv("CURL_GETHOSTNAME"); if(force_hostname) { strncpy(name, force_hostname, namelen); ++ free(force_hostname); err = 0; + } + else { diff --git a/lib/curl_ntlm_core.c b/lib/curl_ntlm_core.c -index 812a073..3c322ed 100644 +index 812a073..02c8416 100644 --- a/lib/curl_ntlm_core.c +++ b/lib/curl_ntlm_core.c -@@ -696,7 +696,7 @@ CURLcode Curl_ntlm_core_mk_ntlmv2_resp(unsigned char *ntlmv2hash, +@@ -696,9 +696,12 @@ CURLcode Curl_ntlm_core_mk_ntlmv2_resp(unsigned char *ntlmv2hash, /* Calculate the timestamp */ #ifdef DEBUGBUILD - char *force_timestamp = getenv("CURL_FORCETIME"); +- if(force_timestamp) + char *force_timestamp = curl_getenv("CURL_FORCETIME"); - if(force_timestamp) ++ if (force_timestamp) ++ { tw = CURL_OFF_T_C(11644473600) * 10000000; ++ free(force_timestamp); ++ } else + #endif + tw = ((curl_off_t)time(NULL) + CURL_OFF_T_C(11644473600)) * 10000000; diff --git a/lib/ftp.c b/lib/ftp.c index b231731..d50779f 100644 --- a/lib/ftp.c @@ -78,7 +87,7 @@ index 7cb0c96..2f43d3c 100644 #include "smb.h" #include "urldata.h" diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c -index 56a8823..4032e7e 100644 +index 56a8823..5a895ed 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -197,7 +197,7 @@ unsigned int Curl_rand(struct Curl_easy *data) @@ -90,3 +99,11 @@ index 56a8823..4032e7e 100644 if(force_entropy) { if(!seeded) { size_t elen = strlen(force_entropy); +@@ -208,6 +208,7 @@ unsigned int Curl_rand(struct Curl_easy *data) + } + else + randseed++; ++ free(force_entropy); + return randseed; + } + #endif From 04bd4b305c3ad306af38811ac464d26941e02b77 Mon Sep 17 00:00:00 2001 From: sdflysha Date: Fri, 13 Jan 2017 13:53:37 +0800 Subject: [PATCH 37/48] [directxmesh] specify static only library --- ports/directxmesh/portfile.cmake | 40 ++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/ports/directxmesh/portfile.cmake b/ports/directxmesh/portfile.cmake index 45ed111ee..925111ca1 100644 --- a/ports/directxmesh/portfile.cmake +++ b/ports/directxmesh/portfile.cmake @@ -5,6 +5,10 @@ # CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} # CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} # +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + message(STATUS "Warning: Dynamic building not supported yet. Building static.") + set(VCPKG_LIBRARY_LINKAGE static) +endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/DirectXMesh-oct2016) @@ -15,32 +19,32 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) -IF (TRIPLET_SYSTEM_ARCH MATCHES "x86") - SET(BUILD_ARCH "Win32") -ELSE() - SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH}) +IF (TRIPLET_SYSTEM_ARCH MATCHES "x86") + SET(BUILD_ARCH "Win32") +ELSE() + SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH}) ENDIF() -vcpkg_build_msbuild( - PROJECT_PATH ${SOURCE_PATH}/DirectXMesh_Desktop_2015.sln - PLATFORM ${BUILD_ARCH} +vcpkg_build_msbuild( + PROJECT_PATH ${SOURCE_PATH}/DirectXMesh_Desktop_2015.sln + PLATFORM ${BUILD_ARCH} ) -file(INSTALL - ${SOURCE_PATH}/DirectXMesh/DirectXMesh.h - ${SOURCE_PATH}/DirectXMesh/DirectXMesh.inl - DESTINATION ${CURRENT_PACKAGES_DIR}/include +file(INSTALL + ${SOURCE_PATH}/DirectXMesh/DirectXMesh.h + ${SOURCE_PATH}/DirectXMesh/DirectXMesh.inl + DESTINATION ${CURRENT_PACKAGES_DIR}/include ) -file(INSTALL - ${SOURCE_PATH}/DirectXMesh/Bin/Desktop_2015/${BUILD_ARCH}/Debug/DirectXMesh.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) -file(INSTALL - ${SOURCE_PATH}/DirectXMesh/Bin/Desktop_2015/${BUILD_ARCH}/Release/DirectXMesh.lib +file(INSTALL + ${SOURCE_PATH}/DirectXMesh/Bin/Desktop_2015/${BUILD_ARCH}/Debug/DirectXMesh.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) +file(INSTALL + ${SOURCE_PATH}/DirectXMesh/Bin/Desktop_2015/${BUILD_ARCH}/Release/DirectXMesh.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) set(TOOL_PATH ${CURRENT_PACKAGES_DIR}/tools) -file(INSTALL - ${SOURCE_PATH}/Meshconvert/Bin/Desktop_2015/${BUILD_ARCH}/Release/Meshconvert.exe +file(INSTALL + ${SOURCE_PATH}/Meshconvert/Bin/Desktop_2015/${BUILD_ARCH}/Release/Meshconvert.exe DESTINATION ${TOOL_PATH}) # Handle copyright From cc8851144a871931b93d84bd962364159ad1c424 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 12 Jan 2017 22:03:57 -0800 Subject: [PATCH 38/48] Reorganize commands, each in its own namespace Additionally, functions related to a command can now live in the same namespace --- toolsrc/include/vcpkg_Commands.h | 123 +++++++++++++++----- toolsrc/src/commands_available_commands.cpp | 38 +++--- toolsrc/src/commands_build.cpp | 10 +- toolsrc/src/commands_build_external.cpp | 10 +- toolsrc/src/commands_cache.cpp | 6 +- toolsrc/src/commands_contact.cpp | 4 +- toolsrc/src/commands_create.cpp | 6 +- toolsrc/src/commands_edit.cpp | 6 +- toolsrc/src/commands_hash.cpp | 6 +- toolsrc/src/commands_help.cpp | 96 +++++++++++---- toolsrc/src/commands_helpers.cpp | 48 -------- toolsrc/src/commands_import.cpp | 6 +- toolsrc/src/commands_install.cpp | 8 +- toolsrc/src/commands_integrate.cpp | 4 +- toolsrc/src/commands_list.cpp | 6 +- toolsrc/src/commands_owns.cpp | 6 +- toolsrc/src/commands_portsdiff.cpp | 6 +- toolsrc/src/commands_remove.cpp | 6 +- toolsrc/src/commands_search.cpp | 6 +- toolsrc/src/commands_update.cpp | 4 +- toolsrc/src/commands_version.cpp | 4 +- toolsrc/src/main.cpp | 4 +- toolsrc/src/vcpkg_Input.cpp | 2 +- toolsrc/src/vcpkg_cmd_arguments.cpp | 6 +- toolsrc/vcpkg/vcpkg.vcxproj | 1 - toolsrc/vcpkg/vcpkg.vcxproj.filters | 3 - 26 files changed, 242 insertions(+), 183 deletions(-) diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index 6b4941cc1..8d772b255 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -5,40 +5,110 @@ namespace vcpkg::Commands { - extern const char*const INTEGRATE_COMMAND_HELPSTRING; - using command_type_a = void(*)(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); using command_type_b = void(*)(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); using command_type_c = void(*)(const vcpkg_cmd_arguments& args); - void update_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + namespace Build + { + void build_package(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir); + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); + } - void build_internal(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir); - void build_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); - void build_external_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); - void install_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); - void remove_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); + namespace BuildExternal + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); + } - void edit_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); - void create_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + namespace Install + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); + } - void search_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); - void list_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); - void import_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); - void owns_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + namespace Remove + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); + } - void cache_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + namespace Update + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + } - void integrate_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + namespace Create + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + } - void portsdiff_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + namespace Edit + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + } - void help_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); - void help_topic_valid_triplet(const vcpkg_paths& paths); + namespace Search + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + } - void version_command(const vcpkg_cmd_arguments& args); - void contact_command(const vcpkg_cmd_arguments& args); - void hash_command(const vcpkg_cmd_arguments& args); + namespace List + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + } + + namespace Import + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + } + + namespace Owns + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + } + + namespace Cache + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + } + + namespace Integrate + { + extern const char*const INTEGRATE_COMMAND_HELPSTRING; + + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + } + + namespace PortsDiff + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + } + + namespace Help + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + + void help_topic_valid_triplet(const vcpkg_paths& paths); + + void print_usage(); + + void print_example(const std::string& command_and_arguments); + + std::string create_example_string(const std::string& command_and_arguments); + } + + namespace Version + { + void perform_and_exit(const vcpkg_cmd_arguments& args); + } + + namespace Contact + { + void perform_and_exit(const vcpkg_cmd_arguments& args); + } + + namespace Hash + { + void perform_and_exit(const vcpkg_cmd_arguments& args); + } template struct package_name_and_function @@ -66,12 +136,3 @@ namespace vcpkg::Commands return nullptr; } } - -namespace vcpkg::Commands::Helpers -{ - void print_usage(); - - void print_example(const std::string& command_and_arguments); - - std::string create_example_string(const std::string& command_and_arguments); -} diff --git a/toolsrc/src/commands_available_commands.cpp b/toolsrc/src/commands_available_commands.cpp index f78416aed..48239587d 100644 --- a/toolsrc/src/commands_available_commands.cpp +++ b/toolsrc/src/commands_available_commands.cpp @@ -5,10 +5,10 @@ namespace vcpkg::Commands const std::vector>& get_available_commands_type_a() { static std::vector> t = { - {"install", install_command}, - {"remove", remove_command}, - {"build", build_command}, - {"build_external", build_external_command} + {"install", &Install::perform_and_exit}, + {"remove", &Remove::perform_and_exit}, + {"build", &Build::perform_and_exit}, + {"build_external", &BuildExternal::perform_and_exit} }; return t; } @@ -16,18 +16,18 @@ namespace vcpkg::Commands const std::vector>& get_available_commands_type_b() { static std::vector> t = { - {"/?", help_command}, - {"help", help_command}, - {"search", search_command}, - {"list", list_command}, - {"integrate", integrate_command}, - {"owns", owns_command}, - {"update", update_command}, - {"edit", edit_command}, - {"create", create_command}, - {"import", import_command}, - {"cache", cache_command}, - {"portsdiff", portsdiff_command} + {"/?", &Help::perform_and_exit}, + {"help", &Help::perform_and_exit}, + {"search", &Search::perform_and_exit}, + {"list", &List::perform_and_exit}, + {"integrate", &Integrate::perform_and_exit}, + {"owns", &Owns::perform_and_exit}, + {"update", &Update::perform_and_exit}, + {"edit", &Edit::perform_and_exit}, + {"create", &Create::perform_and_exit}, + {"import", &Import::perform_and_exit}, + {"cache", &Cache::perform_and_exit}, + {"portsdiff", &PortsDiff::perform_and_exit} }; return t; } @@ -35,9 +35,9 @@ namespace vcpkg::Commands const std::vector>& get_available_commands_type_c() { static std::vector> t = { - {"version", &version_command}, - {"contact", &contact_command}, - {"hash", &hash_command}, + {"version", &Version::perform_and_exit}, + {"contact", &Contact::perform_and_exit}, + {"hash", &Hash::perform_and_exit}, }; return t; } diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index 178643d8e..72ebb264b 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -10,7 +10,7 @@ #include "vcpkg_info.h" #include -namespace vcpkg::Commands +namespace vcpkg::Commands::Build { using Dependencies::package_spec_with_install_plan; using Dependencies::install_plan_type; @@ -24,7 +24,7 @@ namespace vcpkg::Commands std::ofstream(binary_control_file) << bpgh; } - void build_internal(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir) + void build_package(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir) { Checks::check_exit(spec.name() == source_paragraph.name, "inconsistent arguments to build_internal()"); const triplet& target_triplet = spec.target_triplet(); @@ -66,9 +66,9 @@ namespace vcpkg::Commands // delete_directory(port_buildtrees_dir); } - void build_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) { - static const std::string example = Helpers::create_example_string("build zlib:x64-windows"); + static const std::string example = Commands::Help::create_example_string("build zlib:x64-windows"); // Installing multiple packages leads to unintuitive behavior if one of them depends on another. // Allowing only 1 package for now. @@ -122,7 +122,7 @@ namespace vcpkg::Commands } Environment::ensure_utilities_on_path(paths); - Commands::build_internal(spgh, spec, paths, paths.port_dir(spec)); + build_package(spgh, spec, paths, paths.port_dir(spec)); exit(EXIT_SUCCESS); } } diff --git a/toolsrc/src/commands_build_external.cpp b/toolsrc/src/commands_build_external.cpp index 5ed52ad97..09a9256d7 100644 --- a/toolsrc/src/commands_build_external.cpp +++ b/toolsrc/src/commands_build_external.cpp @@ -4,11 +4,11 @@ #include "vcpkg_Input.h" #include "vcpkg.h" -namespace vcpkg::Commands +namespace vcpkg::Commands::BuildExternal { - void build_external_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) { - static const std::string example = Commands::Helpers::create_example_string(R"(build_external zlib2 C:\path\to\dir\with\controlfile\)"); + static const std::string example = Commands::Help::create_example_string(R"(build_external zlib2 C:\path\to\dir\with\controlfile\)"); args.check_exact_arg_count(2, example); expected maybe_current_spec = package_spec::from_string(args.command_arguments[0], default_target_triplet); @@ -20,13 +20,13 @@ namespace vcpkg::Commands const expected maybe_spgh = try_load_port(port_dir); if (auto spgh = maybe_spgh.get()) { - Commands::build_internal(*spgh, *spec, paths, port_dir); + Commands::Build::build_package(*spgh, *spec, paths, port_dir); exit(EXIT_SUCCESS); } } System::println(System::color::error, "Error: %s: %s", maybe_current_spec.error_code().message(), args.command_arguments[0]); - Commands::Helpers::print_example(Strings::format("%s zlib:x64-windows", args.command)); + Commands::Help::print_example(Strings::format("%s zlib:x64-windows", args.command)); exit(EXIT_FAILURE); } } diff --git a/toolsrc/src/commands_cache.cpp b/toolsrc/src/commands_cache.cpp index 3d2916418..63bf32260 100644 --- a/toolsrc/src/commands_cache.cpp +++ b/toolsrc/src/commands_cache.cpp @@ -4,7 +4,7 @@ #include "Paragraphs.h" #include "BinaryParagraph.h" -namespace vcpkg::Commands +namespace vcpkg::Commands::Cache { static std::vector read_all_binary_paragraphs(const vcpkg_paths& paths) { @@ -34,10 +34,10 @@ namespace vcpkg::Commands return output; } - void cache_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { static const std::string example = Strings::format( - "The argument should be a substring to search for, or no argument to display all cached libraries.\n%s", Commands::Helpers::create_example_string("cache png")); + "The argument should be a substring to search for, or no argument to display all cached libraries.\n%s", Commands::Help::create_example_string("cache png")); args.check_max_arg_count(1, example); const std::vector binary_paragraphs = read_all_binary_paragraphs(paths); diff --git a/toolsrc/src/commands_contact.cpp b/toolsrc/src/commands_contact.cpp index 5bd1c1a67..3e3ebc2b4 100644 --- a/toolsrc/src/commands_contact.cpp +++ b/toolsrc/src/commands_contact.cpp @@ -2,9 +2,9 @@ #include "vcpkg_System.h" #include "vcpkg_info.h" -namespace vcpkg::Commands +namespace vcpkg::Commands::Contact { - void contact_command(const vcpkg_cmd_arguments& args) + void perform_and_exit(const vcpkg_cmd_arguments& args) { args.check_exact_arg_count(0); System::println("Send an email to %s with any feedback.", Info::email()); diff --git a/toolsrc/src/commands_create.cpp b/toolsrc/src/commands_create.cpp index 2fcd85dba..d842d3fab 100644 --- a/toolsrc/src/commands_create.cpp +++ b/toolsrc/src/commands_create.cpp @@ -4,11 +4,11 @@ #include "vcpkg_Files.h" #include "vcpkg_Input.h" -namespace vcpkg::Commands +namespace vcpkg::Commands::Create { - void create_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { - static const std::string example = Commands::Helpers::create_example_string(R"###(create zlib2 http://zlib.net/zlib128.zip "zlib128-2.zip")###"); + static const std::string example = Commands::Help::create_example_string(R"###(create zlib2 http://zlib.net/zlib128.zip "zlib128-2.zip")###"); args.check_max_arg_count(3, example); args.check_min_arg_count(2, example); diff --git a/toolsrc/src/commands_edit.cpp b/toolsrc/src/commands_edit.cpp index 090837a19..a4981cf80 100644 --- a/toolsrc/src/commands_edit.cpp +++ b/toolsrc/src/commands_edit.cpp @@ -2,11 +2,11 @@ #include "vcpkg_System.h" #include "vcpkg_Input.h" -namespace vcpkg::Commands +namespace vcpkg::Commands::Edit { - void edit_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { - static const std::string example = Commands::Helpers::create_example_string("edit zlib"); + static const std::string example = Commands::Help::create_example_string("edit zlib"); args.check_exact_arg_count(1, example); const std::string port_name = args.command_arguments.at(0); diff --git a/toolsrc/src/commands_hash.cpp b/toolsrc/src/commands_hash.cpp index c6827e07a..7048fb0d9 100644 --- a/toolsrc/src/commands_hash.cpp +++ b/toolsrc/src/commands_hash.cpp @@ -1,7 +1,7 @@ #include "vcpkg_Commands.h" #include "vcpkg_System.h" -namespace vcpkg::Commands +namespace vcpkg::Commands::Hash { static void do_file_hash(fs::path const& path, std::wstring const& hashType) { @@ -23,10 +23,10 @@ namespace vcpkg::Commands System::println(hash); } - void hash_command(const vcpkg_cmd_arguments& args) + void perform_and_exit(const vcpkg_cmd_arguments& args) { static const std::string example = Strings::format( - "The argument should be a file path\n%s", Commands::Helpers::create_example_string("hash boost_1_62_0.tar.bz2")); + "The argument should be a file path\n%s", Commands::Help::create_example_string("hash boost_1_62_0.tar.bz2")); args.check_min_arg_count(1, example); args.check_max_arg_count(2, example); diff --git a/toolsrc/src/commands_help.cpp b/toolsrc/src/commands_help.cpp index a0881e64d..e4769752c 100644 --- a/toolsrc/src/commands_help.cpp +++ b/toolsrc/src/commands_help.cpp @@ -1,30 +1,8 @@ #include "vcpkg_Commands.h" #include "vcpkg_System.h" -namespace vcpkg::Commands +namespace vcpkg::Commands::Help { - void help_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) - { - args.check_max_arg_count(1); - if (args.command_arguments.empty()) - { - Commands::Helpers::print_usage(); - exit(EXIT_SUCCESS); - } - const auto& topic = args.command_arguments[0]; - if (topic == "triplet") - { - Commands::help_topic_valid_triplet(paths); - } - else - { - System::println(System::color::error, "Error: unknown topic %s", topic); - Commands::Helpers::print_usage(); - exit(EXIT_FAILURE); - } - exit(EXIT_SUCCESS); - } - void help_topic_valid_triplet(const vcpkg_paths& paths) { System::println("Available architecture triplets:"); @@ -34,4 +12,76 @@ namespace vcpkg::Commands System::println(" %s", it->path().stem().filename().string()); } } + + void print_usage() + { + System::println( + "Commands:\n" + " vcpkg search [pat] Search for packages available to be built\n" + " vcpkg install Install a package\n" + " vcpkg remove Uninstall a package. \n" + " vcpkg remove --purge Uninstall and delete a package. \n" + " vcpkg list List installed packages\n" + " vcpkg update Display list of packages for updating\n" + " vcpkg hash [alg] Hash a file by specific algorithm, default SHA512\n" + "\n" + "%s" // Integration help + "\n" + " vcpkg edit Open up a port for editing (uses %%EDITOR%%, default 'code')\n" + " vcpkg import Import a pre-built library\n" + " vcpkg create \n" + " [archivename] Create a new package\n" + " vcpkg owns Search for files in installed packages\n" + " vcpkg cache List cached compiled packages\n" + " vcpkg version Display version information\n" + " vcpkg contact Display contact information to send feedback\n" + "\n" + //"internal commands:\n" + //" --check-build-deps \n" + //" --create-binary-control \n" + //"\n" + "Options:\n" + " --triplet Specify the target architecture triplet.\n" + " (default: %%VCPKG_DEFAULT_TRIPLET%%, see 'vcpkg help triplet')\n" + "\n" + " --vcpkg-root Specify the vcpkg root directory\n" + " (default: %%VCPKG_ROOT%%)\n" + "\n" + "For more help (including examples) see the accompanying README.md." + , Integrate::INTEGRATE_COMMAND_HELPSTRING); + } + + std::string create_example_string(const std::string& command_and_arguments) + { + std::string cs = Strings::format("Example:\n" + " vcpkg %s", command_and_arguments); + return cs; + } + + void print_example(const std::string& command_and_arguments) + { + System::println(create_example_string(command_and_arguments)); + } + + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) + { + args.check_max_arg_count(1); + if (args.command_arguments.empty()) + { + print_usage(); + exit(EXIT_SUCCESS); + } + const auto& topic = args.command_arguments[0]; + if (topic == "triplet") + { + help_topic_valid_triplet(paths); + } + else + { + System::println(System::color::error, "Error: unknown topic %s", topic); + print_usage(); + exit(EXIT_FAILURE); + } + exit(EXIT_SUCCESS); + } } diff --git a/toolsrc/src/commands_helpers.cpp b/toolsrc/src/commands_helpers.cpp index 5d6e519ab..0c7ce15bb 100644 --- a/toolsrc/src/commands_helpers.cpp +++ b/toolsrc/src/commands_helpers.cpp @@ -3,53 +3,5 @@ namespace vcpkg::Commands::Helpers { - void print_usage() - { - System::println( - "Commands:\n" - " vcpkg search [pat] Search for packages available to be built\n" - " vcpkg install Install a package\n" - " vcpkg remove Uninstall a package. \n" - " vcpkg remove --purge Uninstall and delete a package. \n" - " vcpkg list List installed packages\n" - " vcpkg update Display list of packages for updating\n" - " vcpkg hash [alg] Hash a file by specific algorithm, default SHA512\n" - "\n" - "%s" // Integration help - "\n" - " vcpkg edit Open up a port for editing (uses %%EDITOR%%, default 'code')\n" - " vcpkg import Import a pre-built library\n" - " vcpkg create \n" - " [archivename] Create a new package\n" - " vcpkg owns Search for files in installed packages\n" - " vcpkg cache List cached compiled packages\n" - " vcpkg version Display version information\n" - " vcpkg contact Display contact information to send feedback\n" - "\n" - //"internal commands:\n" - //" --check-build-deps \n" - //" --create-binary-control \n" - //"\n" - "Options:\n" - " --triplet Specify the target architecture triplet.\n" - " (default: %%VCPKG_DEFAULT_TRIPLET%%, see 'vcpkg help triplet')\n" - "\n" - " --vcpkg-root Specify the vcpkg root directory\n" - " (default: %%VCPKG_ROOT%%)\n" - "\n" - "For more help (including examples) see the accompanying README.md." - , INTEGRATE_COMMAND_HELPSTRING); - } - std::string create_example_string(const std::string& command_and_arguments) - { - std::string cs = Strings::format("Example:\n" - " vcpkg %s", command_and_arguments); - return cs; - } - - void print_example(const std::string& command_and_arguments) - { - System::println(create_example_string(command_and_arguments)); - } } diff --git a/toolsrc/src/commands_import.cpp b/toolsrc/src/commands_import.cpp index c2c871414..14e83e75f 100644 --- a/toolsrc/src/commands_import.cpp +++ b/toolsrc/src/commands_import.cpp @@ -4,7 +4,7 @@ #include "vcpkg_Files.h" #include -namespace vcpkg::Commands +namespace vcpkg::Commands::Import { struct Binaries { @@ -75,9 +75,9 @@ namespace vcpkg::Commands std::ofstream(control_file_path) << control_file_data; } - void import_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { - static const std::string example = Commands::Helpers::create_example_string(R"(import C:\path\to\CONTROLfile C:\path\to\includedir C:\path\to\projectdir)"); + static const std::string example = Commands::Help::create_example_string(R"(import C:\path\to\CONTROLfile C:\path\to\includedir C:\path\to\projectdir)"); args.check_exact_arg_count(3, example); const fs::path control_file_path(args.command_arguments[0]); diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index ff5ddb0e7..ff517d9b1 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -7,7 +7,7 @@ #include "vcpkg_Dependencies.h" #include "vcpkg_Input.h" -namespace vcpkg::Commands +namespace vcpkg::Commands::Install { using Dependencies::package_spec_with_install_plan; using Dependencies::install_plan_type; @@ -183,9 +183,9 @@ namespace vcpkg::Commands status_db.insert(std::make_unique(spgh)); } - void install_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) { - static const std::string example = Commands::Helpers::create_example_string("install zlib zlib:x64-windows curl boost"); + static const std::string example = Commands::Help::create_example_string("install zlib zlib:x64-windows curl boost"); args.check_min_arg_count(1, example); StatusParagraphs status_db = database_load_check(paths); @@ -216,7 +216,7 @@ namespace vcpkg::Commands } else if (action.plan.type == install_plan_type::BUILD_AND_INSTALL) { - Commands::build_internal(*action.plan.spgh, action.spec, paths, paths.port_dir(action.spec)); + Commands::Build::build_package(*action.plan.spgh, action.spec, paths, paths.port_dir(action.spec)); const BinaryParagraph bpgh = try_load_cached_package(paths, action.spec).get_or_throw(); install_package(paths, bpgh, status_db); System::println(System::color::success, "Package %s is installed", action.spec); diff --git a/toolsrc/src/commands_integrate.cpp b/toolsrc/src/commands_integrate.cpp index 323735f6d..2bd5027ec 100644 --- a/toolsrc/src/commands_integrate.cpp +++ b/toolsrc/src/commands_integrate.cpp @@ -10,7 +10,7 @@ #include "vcpkg_System.h" #include "vcpkg_Files.h" -namespace vcpkg::Commands +namespace vcpkg::Commands::Integrate { static const std::array old_system_target_files = { "C:/Program Files (x86)/MSBuild/14.0/Microsoft.Common.Targets/ImportBefore/vcpkg.nuget.targets", @@ -293,7 +293,7 @@ With a project open, go to Tools->NuGet Package Manager->Package Manager Console " vcpkg integrate remove Remove user-wide integration\n" " vcpkg integrate project Generate a referencing nuget package for individual VS project use\n"; - void integrate_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { static const std::string example = Strings::format("Commands:\n" "%s", INTEGRATE_COMMAND_HELPSTRING); diff --git a/toolsrc/src/commands_list.cpp b/toolsrc/src/commands_list.cpp index 3e71f9c92..d9c4a52f2 100644 --- a/toolsrc/src/commands_list.cpp +++ b/toolsrc/src/commands_list.cpp @@ -3,7 +3,7 @@ #include "vcpkg_System.h" #include "vcpkglib_helpers.h" -namespace vcpkg::Commands +namespace vcpkg::Commands::List { static void do_print(const StatusParagraph& pgh) { @@ -13,10 +13,10 @@ namespace vcpkg::Commands details::shorten_description(pgh.package.description)); } - void list_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { static const std::string example = Strings::format( - "The argument should be a substring to search for, or no argument to display all installed libraries.\n%s", Commands::Helpers::create_example_string("list png")); + "The argument should be a substring to search for, or no argument to display all installed libraries.\n%s", Commands::Help::create_example_string("list png")); args.check_max_arg_count(1, example); const StatusParagraphs status_paragraphs = database_load_check(paths); diff --git a/toolsrc/src/commands_owns.cpp b/toolsrc/src/commands_owns.cpp index e7719fe68..bb1a7eb9f 100644 --- a/toolsrc/src/commands_owns.cpp +++ b/toolsrc/src/commands_owns.cpp @@ -2,7 +2,7 @@ #include "vcpkg_System.h" #include "vcpkg.h" -namespace vcpkg::Commands +namespace vcpkg::Commands::Owns { static void search_file(const vcpkg_paths& paths, const std::string& file_substr, const StatusParagraphs& status_db) { @@ -21,9 +21,9 @@ namespace vcpkg::Commands } } - void owns_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { - static const std::string example = Strings::format("The argument should be a pattern to search for. %s", Commands::Helpers::create_example_string("owns zlib.dll")); + static const std::string example = Strings::format("The argument should be a pattern to search for. %s", Commands::Help::create_example_string("owns zlib.dll")); args.check_exact_arg_count(1, example); StatusParagraphs status_db = database_load_check(paths); diff --git a/toolsrc/src/commands_portsdiff.cpp b/toolsrc/src/commands_portsdiff.cpp index 4794dee2b..1665d7c47 100644 --- a/toolsrc/src/commands_portsdiff.cpp +++ b/toolsrc/src/commands_portsdiff.cpp @@ -10,7 +10,7 @@ #include "SourceParagraph.h" #include "vcpkg_Environment.h" -namespace vcpkg::Commands +namespace vcpkg::Commands::PortsDiff { static void do_print_name_and_version(const std::vector& ports_to_print, const std::map& names_and_versions) { @@ -97,9 +97,9 @@ namespace vcpkg::Commands Checks::check_exit(output.output == VALID_COMMIT_OUTPUT, "Invalid commit id %s", Strings::utf16_to_utf8(git_commit_id)); } - void portsdiff_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { - static const std::string example = Strings::format("The argument should be a branch/tag/hash to checkout.\n%s", Commands::Helpers::create_example_string("portsdiff mybranchname")); + static const std::string example = Strings::format("The argument should be a branch/tag/hash to checkout.\n%s", Commands::Help::create_example_string("portsdiff mybranchname")); args.check_min_arg_count(1, example); args.check_max_arg_count(2, example); diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index 16e8687e7..23d981fc1 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -4,7 +4,7 @@ #include "vcpkg_Input.h" #include -namespace vcpkg::Commands +namespace vcpkg::Commands::Remove { static const std::string OPTION_PURGE = "--purge"; @@ -166,9 +166,9 @@ namespace vcpkg::Commands System::println(System::color::success, "Package %s was successfully removed", pkg.package.displayname()); } - void remove_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) { - static const std::string example = Commands::Helpers::create_example_string("remove zlib zlib:x64-windows curl boost"); + static const std::string example = Commands::Help::create_example_string("remove zlib zlib:x64-windows curl boost"); args.check_min_arg_count(1, example); const std::unordered_set options = args.check_and_get_optional_command_arguments({OPTION_PURGE}); diff --git a/toolsrc/src/commands_search.cpp b/toolsrc/src/commands_search.cpp index cc3e3fe26..3f197b06b 100644 --- a/toolsrc/src/commands_search.cpp +++ b/toolsrc/src/commands_search.cpp @@ -4,7 +4,7 @@ #include "vcpkglib_helpers.h" #include "SourceParagraph.h" -namespace vcpkg::Commands +namespace vcpkg::Commands::Search { static std::vector read_all_source_paragraphs(const vcpkg_paths& paths) { @@ -40,10 +40,10 @@ namespace vcpkg::Commands details::shorten_description(source_paragraph.description)); } - void search_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { static const std::string example = Strings::format("The argument should be a substring to search for, or no argument to display all libraries.\n%s", - Commands::Helpers::create_example_string("search png")); + Commands::Help::create_example_string("search png")); args.check_max_arg_count(1, example); const std::vector source_paragraphs = read_all_source_paragraphs(paths); diff --git a/toolsrc/src/commands_update.cpp b/toolsrc/src/commands_update.cpp index 9a480f3f5..12b4dad50 100644 --- a/toolsrc/src/commands_update.cpp +++ b/toolsrc/src/commands_update.cpp @@ -5,9 +5,9 @@ #include "Paragraphs.h" #include "vcpkg_info.h" -namespace vcpkg::Commands +namespace vcpkg::Commands::Update { - void update_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { args.check_exact_arg_count(0); System::println("Using local portfile versions. To update the local portfiles, use `git pull`."); diff --git a/toolsrc/src/commands_version.cpp b/toolsrc/src/commands_version.cpp index 03cce32d4..e98251601 100644 --- a/toolsrc/src/commands_version.cpp +++ b/toolsrc/src/commands_version.cpp @@ -2,9 +2,9 @@ #include "vcpkg_System.h" #include "vcpkg_info.h" -namespace vcpkg::Commands +namespace vcpkg::Commands::Version { - void version_command(const vcpkg_cmd_arguments& args) + void perform_and_exit(const vcpkg_cmd_arguments& args) { args.check_exact_arg_count(0); System::println("Vcpkg package management program version %s\n" diff --git a/toolsrc/src/main.cpp b/toolsrc/src/main.cpp index 8490dc81b..08e65391f 100644 --- a/toolsrc/src/main.cpp +++ b/toolsrc/src/main.cpp @@ -21,7 +21,7 @@ bool g_debugging = false; void invalid_command(const std::string& cmd) { System::println(System::color::error, "invalid command: %s", cmd); - Commands::Helpers::print_usage(); + Commands::Help::print_usage(); exit(EXIT_FAILURE); } @@ -30,7 +30,7 @@ static void inner(const vcpkg_cmd_arguments& args) TrackProperty("command", args.command); if (args.command.empty()) { - Commands::Helpers::print_usage(); + Commands::Help::print_usage(); exit(EXIT_FAILURE); } diff --git a/toolsrc/src/vcpkg_Input.cpp b/toolsrc/src/vcpkg_Input.cpp index 0c36291b4..bf7ccd346 100644 --- a/toolsrc/src/vcpkg_Input.cpp +++ b/toolsrc/src/vcpkg_Input.cpp @@ -37,7 +37,7 @@ namespace vcpkg::Input { System::println(System::color::error, "Error: invalid triplet: %s", t.canonical_name()); TrackProperty("error", "invalid triplet: " + t.canonical_name()); - Commands::help_topic_valid_triplet(paths); + Commands::Help::help_topic_valid_triplet(paths); exit(EXIT_FAILURE); } } diff --git a/toolsrc/src/vcpkg_cmd_arguments.cpp b/toolsrc/src/vcpkg_cmd_arguments.cpp index ac55e931a..aa1c35965 100644 --- a/toolsrc/src/vcpkg_cmd_arguments.cpp +++ b/toolsrc/src/vcpkg_cmd_arguments.cpp @@ -18,7 +18,7 @@ namespace vcpkg { System::println(System::color::error, "Error: expected value after %s", option_name); TrackProperty("error", "error option name"); - Commands::Helpers::print_usage(); + Commands::Help::print_usage(); exit(EXIT_FAILURE); } @@ -26,7 +26,7 @@ namespace vcpkg { System::println(System::color::error, "Error: %s specified multiple times", option_name); TrackProperty("error", "error option specified multiple times"); - Commands::Helpers::print_usage(); + Commands::Help::print_usage(); exit(EXIT_FAILURE); } @@ -42,7 +42,7 @@ namespace vcpkg { System::println(System::color::error, "Error: conflicting values specified for --%s", option_name); TrackProperty("error", "error conflicting switches"); - Commands::Helpers::print_usage(); + Commands::Help::print_usage(); exit(EXIT_FAILURE); } option_field = new_setting; diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/vcpkg/vcpkg.vcxproj index 79d348910..bcec048f5 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj +++ b/toolsrc/vcpkg/vcpkg.vcxproj @@ -147,7 +147,6 @@ - diff --git a/toolsrc/vcpkg/vcpkg.vcxproj.filters b/toolsrc/vcpkg/vcpkg.vcxproj.filters index 71b0635ab..1f43777b8 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj.filters +++ b/toolsrc/vcpkg/vcpkg.vcxproj.filters @@ -87,9 +87,6 @@ Source Files - - Source Files - Source Files From bad99afb013e852199d1daa52733a23b34cb2f63 Mon Sep 17 00:00:00 2001 From: Albert Ziegenhagel Date: Fri, 13 Jan 2017 09:49:09 +0100 Subject: [PATCH 39/48] Added patch to disable building the static library when BUILD_SHARED_LIB is enabled --- .../disable-static-lib-in-shared-build.patch | 39 +++++++++++++++++++ ports/szip/portfile.cmake | 6 +++ 2 files changed, 45 insertions(+) create mode 100644 ports/szip/disable-static-lib-in-shared-build.patch diff --git a/ports/szip/disable-static-lib-in-shared-build.patch b/ports/szip/disable-static-lib-in-shared-build.patch new file mode 100644 index 000000000..f06e6dcf6 --- /dev/null +++ b/ports/szip/disable-static-lib-in-shared-build.patch @@ -0,0 +1,39 @@ +--- a/src/CMakeLists.txt Mon Aug 03 17:10:33 2015 ++++ b/src/CMakeLists.txt Fri Jan 13 09:38:07 2017 +@@ -22,20 +22,22 @@ + ${SZIP_SRC_SOURCE_DIR}/szlib.h + ) + +-add_library (${SZIP_LIB_TARGET} STATIC ${SZIP_SRCS} ${SZIP_PUBLIC_HEADERS}) +-#set_target_properties (${SZIP_LIB_TARGET} +-# PROPERTIES +-# LINK_FLAGS "-version-info 2:0:0" +-#) +-TARGET_C_PROPERTIES (${SZIP_LIB_TARGET} STATIC " " " ") +-target_link_libraries (${SZIP_LIB_TARGET} ${LINK_LIBS}) +-set_target_properties(${SZIP_LIB_TARGET} PROPERTIES +- PUBLIC_HEADER "${SZIP_PUBLIC_HEADERS}" +- INTERFACE_INCLUDE_DIRECTORIES "$/include>" +-) +-set_global_variable (SZIP_LIBRARIES_TO_EXPORT ${SZIP_LIB_TARGET}) +-SZIP_SET_LIB_OPTIONS (${SZIP_LIB_TARGET} ${SZIP_LIB_NAME} STATIC) +-set (install_targets ${SZIP_LIB_TARGET}) ++if (NOT BUILD_SHARED_LIBS) ++ add_library (${SZIP_LIB_TARGET} STATIC ${SZIP_SRCS} ${SZIP_PUBLIC_HEADERS}) ++ #set_target_properties (${SZIP_LIB_TARGET} ++ # PROPERTIES ++ # LINK_FLAGS "-version-info 2:0:0" ++ #) ++ TARGET_C_PROPERTIES (${SZIP_LIB_TARGET} STATIC " " " ") ++ target_link_libraries (${SZIP_LIB_TARGET} ${LINK_LIBS}) ++ set_target_properties(${SZIP_LIB_TARGET} PROPERTIES ++ PUBLIC_HEADER "${SZIP_PUBLIC_HEADERS}" ++ INTERFACE_INCLUDE_DIRECTORIES "$/include>" ++ ) ++ set_global_variable (SZIP_LIBRARIES_TO_EXPORT ${SZIP_LIB_TARGET}) ++ SZIP_SET_LIB_OPTIONS (${SZIP_LIB_TARGET} ${SZIP_LIB_NAME} STATIC) ++ set (install_targets ${SZIP_LIB_TARGET}) ++endif() + + if (BUILD_SHARED_LIBS) + add_library (${SZIP_LIBSH_TARGET} SHARED ${SZIP_SRCS} ${SZIP_PUBLIC_HEADERS}) diff --git a/ports/szip/portfile.cmake b/ports/szip/portfile.cmake index 9204771c7..06040cedc 100644 --- a/ports/szip/portfile.cmake +++ b/ports/szip/portfile.cmake @@ -21,6 +21,12 @@ set(ARCHIVE ${SOURCE_PATH}/SZip.tar.gz) vcpkg_extract_source_archive(${ARCHIVE}) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/Szip) +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/disable-static-lib-in-shared-build.patch +) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS From fe2c0a3a78f4904288ce958ded767160d1de260c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 13 Jan 2017 02:09:08 -0800 Subject: [PATCH 40/48] [edit command] Now checks that port exists before opening --- toolsrc/src/commands_edit.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/toolsrc/src/commands_edit.cpp b/toolsrc/src/commands_edit.cpp index a4981cf80..3297b5295 100644 --- a/toolsrc/src/commands_edit.cpp +++ b/toolsrc/src/commands_edit.cpp @@ -11,6 +11,7 @@ namespace vcpkg::Commands::Edit const std::string port_name = args.command_arguments.at(0); const fs::path portpath = paths.ports / port_name; + Checks::check_exit(fs::is_directory(portpath), "Could not find port named %s", port_name); // Find editor std::wstring env_EDITOR = System::wdupenv_str(L"EDITOR"); From e11e62e8f38783efd5be55e890b78f7c47dc3c94 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 13 Jan 2017 02:21:16 -0800 Subject: [PATCH 41/48] Identation consistency --- ports/directxmesh/portfile.cmake | 22 +++++++++++----------- ports/directxtex/portfile.cmake | 30 +++++++++++++++--------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/ports/directxmesh/portfile.cmake b/ports/directxmesh/portfile.cmake index 925111ca1..184784d48 100644 --- a/ports/directxmesh/portfile.cmake +++ b/ports/directxmesh/portfile.cmake @@ -20,32 +20,32 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive(${ARCHIVE}) IF (TRIPLET_SYSTEM_ARCH MATCHES "x86") - SET(BUILD_ARCH "Win32") + SET(BUILD_ARCH "Win32") ELSE() - SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH}) + SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH}) ENDIF() vcpkg_build_msbuild( PROJECT_PATH ${SOURCE_PATH}/DirectXMesh_Desktop_2015.sln - PLATFORM ${BUILD_ARCH} + PLATFORM ${BUILD_ARCH} ) file(INSTALL - ${SOURCE_PATH}/DirectXMesh/DirectXMesh.h - ${SOURCE_PATH}/DirectXMesh/DirectXMesh.inl + ${SOURCE_PATH}/DirectXMesh/DirectXMesh.h + ${SOURCE_PATH}/DirectXMesh/DirectXMesh.inl DESTINATION ${CURRENT_PACKAGES_DIR}/include ) file(INSTALL - ${SOURCE_PATH}/DirectXMesh/Bin/Desktop_2015/${BUILD_ARCH}/Debug/DirectXMesh.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + ${SOURCE_PATH}/DirectXMesh/Bin/Desktop_2015/${BUILD_ARCH}/Debug/DirectXMesh.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) file(INSTALL - ${SOURCE_PATH}/DirectXMesh/Bin/Desktop_2015/${BUILD_ARCH}/Release/DirectXMesh.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + ${SOURCE_PATH}/DirectXMesh/Bin/Desktop_2015/${BUILD_ARCH}/Release/DirectXMesh.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib) set(TOOL_PATH ${CURRENT_PACKAGES_DIR}/tools) file(INSTALL - ${SOURCE_PATH}/Meshconvert/Bin/Desktop_2015/${BUILD_ARCH}/Release/Meshconvert.exe - DESTINATION ${TOOL_PATH}) + ${SOURCE_PATH}/Meshconvert/Bin/Desktop_2015/${BUILD_ARCH}/Release/Meshconvert.exe + DESTINATION ${TOOL_PATH}) # Handle copyright file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/directxmesh) diff --git a/ports/directxtex/portfile.cmake b/ports/directxtex/portfile.cmake index befee008c..70bb16658 100644 --- a/ports/directxtex/portfile.cmake +++ b/ports/directxtex/portfile.cmake @@ -20,39 +20,39 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive(${ARCHIVE}) IF (TRIPLET_SYSTEM_ARCH MATCHES "x86") - SET(BUILD_ARCH "Win32") + SET(BUILD_ARCH "Win32") ELSE() - SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH}) + SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH}) ENDIF() vcpkg_build_msbuild( PROJECT_PATH ${SOURCE_PATH}/DirectXTex_Desktop_2015.sln - PLATFORM ${BUILD_ARCH} + PLATFORM ${BUILD_ARCH} ) file(INSTALL - ${SOURCE_PATH}/DirectXTex/DirectXTex.h - ${SOURCE_PATH}/DirectXTex/DirectXTex.inl + ${SOURCE_PATH}/DirectXTex/DirectXTex.h + ${SOURCE_PATH}/DirectXTex/DirectXTex.inl DESTINATION ${CURRENT_PACKAGES_DIR}/include ) file(INSTALL - ${SOURCE_PATH}/DirectXTex/Bin/Desktop_2015/${BUILD_ARCH}/Debug/DirectXTex.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + ${SOURCE_PATH}/DirectXTex/Bin/Desktop_2015/${BUILD_ARCH}/Debug/DirectXTex.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) file(INSTALL - ${SOURCE_PATH}/DirectXTex/Bin/Desktop_2015/${BUILD_ARCH}/Release/DirectXTex.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + ${SOURCE_PATH}/DirectXTex/Bin/Desktop_2015/${BUILD_ARCH}/Release/DirectXTex.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib) set(TOOL_PATH ${CURRENT_PACKAGES_DIR}/tools) file(MAKE_DIRECTORY ${TOOL_PATH}) file(INSTALL - ${SOURCE_PATH}/Texdiag/Bin/Desktop_2015/${BUILD_ARCH}/Release/texdiag.exe - DESTINATION ${TOOL_PATH}) + ${SOURCE_PATH}/Texdiag/Bin/Desktop_2015/${BUILD_ARCH}/Release/texdiag.exe + DESTINATION ${TOOL_PATH}) file(INSTALL - ${SOURCE_PATH}/Texconv/Bin/Desktop_2015/${BUILD_ARCH}/Release/Texconv.exe - DESTINATION ${TOOL_PATH}) + ${SOURCE_PATH}/Texconv/Bin/Desktop_2015/${BUILD_ARCH}/Release/Texconv.exe + DESTINATION ${TOOL_PATH}) file(INSTALL - ${SOURCE_PATH}/Texassemble/Bin/Desktop_2015/${BUILD_ARCH}/Release/Texassemble.exe - DESTINATION ${TOOL_PATH}) + ${SOURCE_PATH}/Texassemble/Bin/Desktop_2015/${BUILD_ARCH}/Release/Texassemble.exe + DESTINATION ${TOOL_PATH}) # Handle copyright file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/DirectXTex) From f7d192c20697eba44aac11c6992efe61698c534b Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 13 Jan 2017 15:07:30 -0800 Subject: [PATCH 42/48] [openssl] Bump version to correspond with source change for uwp support --- ports/openssl/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/openssl/CONTROL b/ports/openssl/CONTROL index cb7bc7493..ca4aae2e6 100644 --- a/ports/openssl/CONTROL +++ b/ports/openssl/CONTROL @@ -1,3 +1,3 @@ Source: openssl -Version: 1.0.2j-1 +Version: 1.0.2j-2 Description: OpenSSL is an open source project that provides a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It is also a general-purpose cryptography library. \ No newline at end of file From 278e6b9ad1443673ef47a104cb5aa73ff4350866 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 13 Jan 2017 15:38:14 -0800 Subject: [PATCH 43/48] [curl] Bump version to correspond with source code change for uwp support. --- ports/curl/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/curl/CONTROL b/ports/curl/CONTROL index e18ea2f67..9ae7e7e52 100644 --- a/ports/curl/CONTROL +++ b/ports/curl/CONTROL @@ -1,4 +1,4 @@ Source: curl -Version: 7.51.0-2 +Version: 7.51.0-3 Build-Depends: zlib, openssl, libssh2 Description: A library for transferring data with URLs From bf47d0d386d5490936917ab5bf37d801f6681cc1 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 13 Jan 2017 16:01:52 -0800 Subject: [PATCH 44/48] [http-parser] Bump version to reflect build change adding HTTP_PARSER_STRICT=0 --- ports/http-parser/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/http-parser/CONTROL b/ports/http-parser/CONTROL index 41d234d26..605f3354c 100644 --- a/ports/http-parser/CONTROL +++ b/ports/http-parser/CONTROL @@ -1,3 +1,3 @@ Source: http-parser -Version: 2.7.1 +Version: 2.7.1-1 Description: HTTP Parser. \ No newline at end of file From b415c1377976884d7ed9ac6f54630f4ec7921918 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 13 Jan 2017 16:06:30 -0800 Subject: [PATCH 45/48] [libwebsockets] Bump version to correspond to source code change for uwp support. --- ports/libwebsockets/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/libwebsockets/CONTROL b/ports/libwebsockets/CONTROL index 866c0ccbc..61a9cc449 100644 --- a/ports/libwebsockets/CONTROL +++ b/ports/libwebsockets/CONTROL @@ -1,4 +1,4 @@ Source: libwebsockets -Version: 2.0.0 +Version: 2.0.0-1 Build-Depends: zlib, openssl Description: Libwebsockets is a lightweight pure C library built to use minimal CPU and memory resources, and provide fast throughput in both directions as client or server. \ No newline at end of file From 2bc4064b1e99b31bd550982011e251f97d5a0aef Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 13 Jan 2017 17:30:48 -0800 Subject: [PATCH 46/48] [vcpkg_build_cmake] Add option to specify the 64-bit toolset --- scripts/cmake/vcpkg_build_cmake.cmake | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/cmake/vcpkg_build_cmake.cmake b/scripts/cmake/vcpkg_build_cmake.cmake index 8ba4b9fae..eb50222ba 100644 --- a/scripts/cmake/vcpkg_build_cmake.cmake +++ b/scripts/cmake/vcpkg_build_cmake.cmake @@ -1,7 +1,16 @@ function(vcpkg_build_cmake) + cmake_parse_arguments(_bc "MSVC_64_TOOLSET" "" "" ${ARGN}) + + set(MSVC_EXTRA_ARGS) + + # Specifies the architecture of the toolset, NOT the architecture of the produced binary + if (_bc_MSVC_64_TOOLSET) + list(APPEND MSVC_EXTRA_ARGS "/p:PreferredToolArchitecture=x64") + endif() + message(STATUS "Build ${TARGET_TRIPLET}-rel") vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} --build . --config Release -- /p:VCPkgLocalAppDataDisabled=true /m + COMMAND ${CMAKE_COMMAND} --build . --config Release -- /p:VCPkgLocalAppDataDisabled=true /m ${MSVC_EXTRA_ARGS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel LOGNAME build-${TARGET_TRIPLET}-rel ) @@ -9,7 +18,7 @@ function(vcpkg_build_cmake) message(STATUS "Build ${TARGET_TRIPLET}-dbg") vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} --build . --config Debug -- /p:VCPkgLocalAppDataDisabled=true /m + COMMAND ${CMAKE_COMMAND} --build . --config Debug -- /p:VCPkgLocalAppDataDisabled=true /m ${MSVC_EXTRA_ARGS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg LOGNAME build-${TARGET_TRIPLET}-dbg ) From da09df713fe7b68d432108802447eb534a7dd555 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 13 Jan 2017 17:39:12 -0800 Subject: [PATCH 47/48] [vcpkg integration] Explicitly skip empty entries instead of recursing. Fixes #460. --- scripts/buildsystems/msbuild/applocal.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/buildsystems/msbuild/applocal.ps1 b/scripts/buildsystems/msbuild/applocal.ps1 index ddb4a07f9..46981fad5 100644 --- a/scripts/buildsystems/msbuild/applocal.ps1 +++ b/scripts/buildsystems/msbuild/applocal.ps1 @@ -7,6 +7,9 @@ function resolve($targetBinary) { $a = $(dumpbin /DEPENDENTS $targetBinary | ? { $_ -match "^ [^ ].*\.dll" } | % { $_ -replace "^ ","" }) $a | % { + if ([string]::IsNullOrEmpty($_)) { + continue + } if (Test-Path "$installedDir\$_") { if (Test-Path "$targetBinaryDir\$_") { Write-Verbose "$_ is already present" From c5636c4692f1e4f257bf5e6fbcf89a93d4cd60a0 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 13 Jan 2017 17:54:13 -0800 Subject: [PATCH 48/48] [glew] Avoid renaming DLLs, because LIBs reference them by name. Prefer using vcpkg_copy_pdbs(). --- ports/glew/CONTROL | 2 +- ports/glew/portfile.cmake | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/ports/glew/CONTROL b/ports/glew/CONTROL index 13eb3262e..21051a475 100644 --- a/ports/glew/CONTROL +++ b/ports/glew/CONTROL @@ -1,3 +1,3 @@ Source: glew -Version: 2.0.0 +Version: 2.0.0-1 Description: The OpenGL Extension Wrangler Library (GLEW) is a cross-platform open-source C/C++ extension loading library. \ No newline at end of file diff --git a/ports/glew/portfile.cmake b/ports/glew/portfile.cmake index 6392633be..c975ca099 100644 --- a/ports/glew/portfile.cmake +++ b/ports/glew/portfile.cmake @@ -57,15 +57,10 @@ message(STATUS "Installing") if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(INSTALL ${SOURCE_PATH}/bin/Debug/${BUILD_ARCH}/glew32d.dll - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin RENAME glew32.dll - ) - file(INSTALL - ${SOURCE_PATH}/bin/Debug/${BUILD_ARCH}/glew32d.pdb - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin RENAME glew32.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin ) file(INSTALL ${SOURCE_PATH}/bin/Release/${BUILD_ARCH}/glew32.dll - ${SOURCE_PATH}/bin/Release/${BUILD_ARCH}/glew32.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/bin ) file(INSTALL