From f3b9053def5bb51a61dcbc1164c6420cc3cc1396 Mon Sep 17 00:00:00 2001 From: charlie barto Date: Wed, 5 Oct 2016 18:00:15 -0400 Subject: added glbinding port --- ports/glbinding/CONTROL | 3 +++ ports/glbinding/portfile.cmake | 46 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 ports/glbinding/CONTROL create mode 100644 ports/glbinding/portfile.cmake diff --git a/ports/glbinding/CONTROL b/ports/glbinding/CONTROL new file mode 100644 index 000000000..bc04bf5f6 --- /dev/null +++ b/ports/glbinding/CONTROL @@ -0,0 +1,3 @@ +Source: glbinding +Version: 2.1.1 +Description: glbinding is an MIT licensed, cross-platform C++ binding for the OpenGL API diff --git a/ports/glbinding/portfile.cmake b/ports/glbinding/portfile.cmake new file mode 100644 index 000000000..e63007aac --- /dev/null +++ b/ports/glbinding/portfile.cmake @@ -0,0 +1,46 @@ +# 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(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/cginternals/glbinding/archive/v2.1.1.zip" + FILENAME "glbinding-2.1.1.zip" + SHA512 66b21853a4f4760b7b22cafd5211958769c513e83be999018fe79cf56a9271e0e28566caaa2286393f54ac2154d564a68d12159598d03c965adf6756f3753f11 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_configure_cmake( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/glbinding-2.1.1 + # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 + # OPTIONS_RELEASE -DOPTIMIZE=1 + # OPTIONS_DEBUG -DDEBUGGABLE=1 +) + +vcpkg_build_cmake() +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) +file(RENAME ${CURRENT_PACKAGES_DIR}/cmake/glbinding ${CURRENT_PACKAGES_DIR}/share/glbinding) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/cmake) + +file(READ ${CURRENT_PACKAGES_DIR}/debug/cmake/glbinding/glbinding-export-debug.cmake GLBINDING_DEBUG_MODULE) +string(REPLACE "\${IMPORT_PREFIX}" "\${IMPORT_PREFIX}/debug" GLBINDING_DEBUG_MODULE "${GLBINDING_DEBUG_MODULE}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/glbinding/glbinding-export-debug.cmake "${GLBINDING_DEBUG_MODULE}") +file(RENAME ${CURRENT_PACKAGES_DIR}/glbinding-config.cmake ${CURRENT_PACKAGES_DIR}/share/glbinding/glbinding-config.cmake) +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin) +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) +file(RENAME ${CURRENT_PACKAGES_DIR}/glbinding.dll ${CURRENT_PACKAGES_DIR}/bin/glbinding.dll) +file(RENAME ${CURRENT_PACKAGES_DIR}/debug/glbindingd.dll ${CURRENT_PACKAGES_DIR}/debug/bin/glbindingd.dll) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/cmake) +file(RENAME ${CURRENT_PACKAGES_DIR}/data ${CURRENT_PACKAGES_DIR}/share/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/data) +# Handle copyright +file(COPY ${CURRENT_BUILDTREES_DIR}/src/glbinding-2.1.1/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/glbinding) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/glbinding/LICENSE ${CURRENT_PACKAGES_DIR}/share/glbinding/copyright) -- cgit v1.2.3 From 1794a18fd35cbfec535aca6889879a93dc53b588 Mon Sep 17 00:00:00 2001 From: flysha Date: Sun, 16 Oct 2016 08:39:21 +0800 Subject: Add libmariadb. --- ports/libmariadb/CONTROL | 3 ++ ports/libmariadb/portfile.cmake | 74 +++++++++++++++++++++++++++++++++++++++++ ports/libmysql/portfile.cmake | 4 +++ 3 files changed, 81 insertions(+) create mode 100644 ports/libmariadb/CONTROL create mode 100644 ports/libmariadb/portfile.cmake diff --git a/ports/libmariadb/CONTROL b/ports/libmariadb/CONTROL new file mode 100644 index 000000000..b91da0740 --- /dev/null +++ b/ports/libmariadb/CONTROL @@ -0,0 +1,3 @@ +Source: libmariadb +Version: 2.3.1 +Description: The MariaDB Connector/C is used to connect applications developed in C/C++ to MariaDB and MySQL databases. \ No newline at end of file diff --git a/ports/libmariadb/portfile.cmake b/ports/libmariadb/portfile.cmake new file mode 100644 index 000000000..ef1d85cae --- /dev/null +++ b/ports/libmariadb/portfile.cmake @@ -0,0 +1,74 @@ +include(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mariadb-connector-c-2.3.1) + +if (EXISTS "${CURRENT_INSTALLED_DIR}/include/mysql.h") + message(FATAL_ERROR "FATAL ERROR: libmysql and libmariadb are incompatible.") +endif() + +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/MariaDB/mariadb-connector-c/archive/v2.3.1.tar.gz" + FILENAME "mariadb-connector-c-2.3.1.tar.gz" + SHA512 d82f8348201d41dce6820c952a0503a5154c4e9c06feb471fe451a6fb968e5cff04423a64183cbb8e159a1b4e7265c12b5b7aef912f633395d9f1b0436fbfd2d +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} +) + +vcpkg_install_cmake() + +# remove debug header +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# fix libmariadb lib & dll directory. +file(MAKE_DIRECTORY + ${CURRENT_PACKAGES_DIR}/bin + ${CURRENT_PACKAGES_DIR}/debug/bin) +file(RENAME + ${CURRENT_PACKAGES_DIR}/lib/mariadb/libmariadb.dll + ${CURRENT_PACKAGES_DIR}/bin/libmariadb.dll) +file(RENAME + ${CURRENT_PACKAGES_DIR}/debug/lib/mariadb/libmariadb.dll + ${CURRENT_PACKAGES_DIR}/debug/bin/libmariadb.dll) +file(RENAME + ${CURRENT_PACKAGES_DIR}/lib/mariadb/libmariadb.lib + ${CURRENT_PACKAGES_DIR}/lib/libmariadb.lib) +file(RENAME + ${CURRENT_PACKAGES_DIR}/debug/lib/mariadb/libmariadb.lib + ${CURRENT_PACKAGES_DIR}/debug/lib/libmariadb.lib) +file(REMOVE + ${CURRENT_PACKAGES_DIR}/lib/mariadb/mariadbclient.lib + ${CURRENT_PACKAGES_DIR}/debug/lib/mariadb/mariadbclient.lib) + +# remove plugin folder +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/lib/plugin + ${CURRENT_PACKAGES_DIR}/debug/lib/plugin + ${CURRENT_PACKAGES_DIR}/lib/mariadb + ${CURRENT_PACKAGES_DIR}/debug/lib/mariadb) + +# copy & remove header files +file(GLOB HEADER_FILES ${CURRENT_PACKAGES_DIR}/include/mariadb/*) +file(COPY ${HEADER_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/mariadb) +file(REMOVE + ${CURRENT_PACKAGES_DIR}/include/config-win.h + ${CURRENT_PACKAGES_DIR}/include/dbug.h + ${CURRENT_PACKAGES_DIR}/include/errmsg.h + ${CURRENT_PACKAGES_DIR}/include/getopt.h + ${CURRENT_PACKAGES_DIR}/include/hash.h + ${CURRENT_PACKAGES_DIR}/include/ma_common.h + ${CURRENT_PACKAGES_DIR}/include/ma_dyncol.h + ${CURRENT_PACKAGES_DIR}/include/sha1.h + ${CURRENT_PACKAGES_DIR}/include/thr_alarm.h + ${CURRENT_PACKAGES_DIR}/include/violite.h + ${CURRENT_PACKAGES_DIR}/include/mysql_version.h.in + ${CURRENT_PACKAGES_DIR}/include/my_config.h.in + ${CURRENT_PACKAGES_DIR}/include/CMakeLists.txt + ${CURRENT_PACKAGES_DIR}/include/Makefile.am) + +# copy license file +file(COPY ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/libmariadb) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/libmariadb/COPYING.LIB ${CURRENT_PACKAGES_DIR}/share/libmariadb/copyright) \ No newline at end of file diff --git a/ports/libmysql/portfile.cmake b/ports/libmysql/portfile.cmake index ae2550f34..c0c8ee4c4 100644 --- a/ports/libmysql/portfile.cmake +++ b/ports/libmysql/portfile.cmake @@ -2,6 +2,10 @@ include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mysql-server-mysql-5.7.16) +if (EXISTS "${CURRENT_INSTALLED_DIR}/include/mysql.h") + message(FATAL_ERROR "FATAL ERROR: libmysql and libmariadb are incompatible.") +endif() + vcpkg_download_distfile(ARCHIVE URLS "https://github.com/mysql/mysql-server/archive/mysql-5.7.16.tar.gz" FILENAME "mysql-server-mysql-5.7.16.tar.gz" -- cgit v1.2.3 From c402d53080ad507dd81b0cb7ca8ddfb71a502c8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=BCller?= Date: Sat, 15 Oct 2016 20:52:05 +0200 Subject: Add libxml2 --- ports/libxml2/0001-Fix-makefile-imports.patch | 27 +++++ ports/libxml2/CONTROL | 4 + ports/libxml2/portfile.cmake | 145 ++++++++++++++++++++++++++ 3 files changed, 176 insertions(+) create mode 100644 ports/libxml2/0001-Fix-makefile-imports.patch create mode 100644 ports/libxml2/CONTROL create mode 100644 ports/libxml2/portfile.cmake diff --git a/ports/libxml2/0001-Fix-makefile-imports.patch b/ports/libxml2/0001-Fix-makefile-imports.patch new file mode 100644 index 000000000..ae40648b9 --- /dev/null +++ b/ports/libxml2/0001-Fix-makefile-imports.patch @@ -0,0 +1,27 @@ +diff --git "a/win32/Makefile.msvc" "b/win32/Makefile.msvc" +index d16c1a2..09d2291 100644 +--- "a/win32/Makefile.msvc" ++++ "b/win32/Makefile.msvc" +@@ -72,7 +72,7 @@ LIBS = + LIBS = $(LIBS) wsock32.lib ws2_32.lib + !endif + !if "$(WITH_ICONV)" == "1" +-LIBS = $(LIBS) iconv.lib ++LIBS = $(LIBS) libiconv.lib libcharset.lib + !endif + !if "$(WITH_ICU)" == "1" + LIBS = $(LIBS) icu.lib +@@ -80,7 +80,11 @@ LIBS = $(LIBS) icu.lib + !if "$(WITH_ZLIB)" == "1" + # could be named differently zdll or zlib + # LIBS = $(LIBS) zdll.lib +-LIBS = $(LIBS) zlib.lib ++!if "$(DEBUG)" == "1" ++LIBS = $(LIBS) zlibd.lib ++!else ++LIBS = $(LIBS) zlib.lib ++!endif + !endif + !if "$(WITH_LZMA)" == "1" + LIBS = $(LIBS) liblzma.lib + \ No newline at end of file diff --git a/ports/libxml2/CONTROL b/ports/libxml2/CONTROL new file mode 100644 index 000000000..538060dae --- /dev/null +++ b/ports/libxml2/CONTROL @@ -0,0 +1,4 @@ +Source: libxml2 +Version: 2.9.4 +Description: Libxml2 is the XML C parser and toolkit developed for the Gnome project (but usable outside of the Gnome platform) +Build-Depends: zlib, libiconv diff --git a/ports/libxml2/portfile.cmake b/ports/libxml2/portfile.cmake new file mode 100644 index 000000000..11682c3bd --- /dev/null +++ b/ports/libxml2/portfile.cmake @@ -0,0 +1,145 @@ +# 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(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libxml2-2.9.4) +vcpkg_download_distfile(ARCHIVE + URLS "ftp://xmlsoft.org/libxml2/libxml2-2.9.4.tar.gz" + FILENAME "libxml2-2.9.4.tar.gz" + SHA512 f5174ab1a3a0ec0037a47f47aa47def36674e02bfb42b57f609563f84c6247c585dbbb133c056953a5adb968d328f18cbc102eb0d00d48eb7c95478389e5daf9 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +find_program(NMAKE nmake) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH}/ + PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001-Fix-makefile-imports.patch +) + +set(SCRIPTS_DIR ${SOURCE_PATH}/win32) + +set(CONFIGURE_COMMAND_TEMPLATE cscript configure.js + zlib=yes + cruntime=@CRUNTIME@ + debug=@DEBUGMODE@ + prefix=@INSTALL_DIR@ + include=@INCLUDE_DIR@ + lib=@LIB_DIR@ + bindir=@INSTALL_BIN_DIR@ +) + + +# +# Release +# + +message(STATUS "Configuring ${TARGET_TRIPLET}-rel") + +set(CRUNTIME /MD) +set(DEBUGMODE no) +set(LIB_DIR ${CURRENT_INSTALLED_DIR}/lib) +set(INCLUDE_DIR ${CURRENT_INSTALLED_DIR}/include) +set(INSTALL_DIR ${CURRENT_PACKAGES_DIR}) +set(INSTALL_BIN_DIR "$(PREFIX)/tools") +file(TO_NATIVE_PATH "${LIB_DIR}" LIB_DIR) +file(TO_NATIVE_PATH "${INCLUDE_DIR}" INCLUDE_DIR) +file(TO_NATIVE_PATH "${INSTALL_DIR}" INSTALL_DIR) +file(TO_NATIVE_PATH "${INSTALL_BIN_DIR}" INSTALL_BIN_DIR) +string(CONFIGURE "${CONFIGURE_COMMAND_TEMPLATE}" CONFIGURE_COMMAND) +vcpkg_execute_required_process( + COMMAND ${CONFIGURE_COMMAND} + WORKING_DIRECTORY ${SCRIPTS_DIR} + LOGNAME config-${TARGET_TRIPLET}-rel +) +message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") + +message(STATUS "Building ${TARGET_TRIPLET}-rel") +vcpkg_execute_required_process( + COMMAND ${NMAKE} /f Makefile.msvc rebuild + WORKING_DIRECTORY ${SCRIPTS_DIR} + LOGNAME build-${TARGET_TRIPLET}-rel +) +message(STATUS "Building ${TARGET_TRIPLET}-rel done") + +message(STATUS "Installing ${TARGET_TRIPLET}-rel") +vcpkg_execute_required_process( + COMMAND ${NMAKE} /f Makefile.msvc install + WORKING_DIRECTORY ${SCRIPTS_DIR} + LOGNAME install-${TARGET_TRIPLET}-rel +) +message(STATUS "Installing ${TARGET_TRIPLET}-rel done") + + +# +# Debug +# + +message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") + +set(CRUNTIME /MDd) +set(DEBUGMODE yes) +set(LIB_DIR ${CURRENT_INSTALLED_DIR}/debug/lib) +set(INSTALL_DIR ${CURRENT_PACKAGES_DIR}/debug) +file(TO_NATIVE_PATH "${LIB_DIR}" LIB_DIR) +file(TO_NATIVE_PATH "${INSTALL_DIR}" INSTALL_DIR) +string(CONFIGURE "${CONFIGURE_COMMAND_TEMPLATE}" CONFIGURE_COMMAND) + +vcpkg_execute_required_process( + COMMAND ${CONFIGURE_COMMAND} + WORKING_DIRECTORY ${SCRIPTS_DIR} + LOGNAME config-${TARGET_TRIPLET}-dbg +) +message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") + +message(STATUS "Building ${TARGET_TRIPLET}-dbg") +vcpkg_execute_required_process( + COMMAND ${NMAKE} /f Makefile.msvc rebuild + WORKING_DIRECTORY ${SCRIPTS_DIR} + LOGNAME build-${TARGET_TRIPLET}-dbg +) +message(STATUS "Building ${TARGET_TRIPLET}-dbg done") + +message(STATUS "Installing ${TARGET_TRIPLET}-dbg") +vcpkg_execute_required_process( + COMMAND ${NMAKE} /f Makefile.msvc install + WORKING_DIRECTORY ${SCRIPTS_DIR} + LOGNAME install-${TARGET_TRIPLET}-dbg +) +message(STATUS "Installing ${TARGET_TRIPLET}-dbg done") + +# +# Cleanup +# + +# Remove tools and debug include directories +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/tools) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/tools) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# Move includes to the expected directory +file(RENAME ${CURRENT_PACKAGES_DIR}/include/libxml2/libxml ${CURRENT_PACKAGES_DIR}/include/libxml) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/libxml2) + +# The makefile builds both static and dynamic libraries, so remove the ones we don't want +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/libxml2_a.lib ${CURRENT_PACKAGES_DIR}/lib/libxml2_a_dll.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/libxml2_a.lib ${CURRENT_PACKAGES_DIR}/debug/lib/libxml2_a_dll.lib) +else() + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/libxml2.lib ${CURRENT_PACKAGES_DIR}/lib/libxml2_a_dll.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/libxml2.lib ${CURRENT_PACKAGES_DIR}/debug/lib/libxml2_a_dll.lib) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) + # Rename the libs to match the dynamic lib names + file(RENAME ${CURRENT_PACKAGES_DIR}/lib/libxml2_a.lib ${CURRENT_PACKAGES_DIR}/lib/libxml2.lib) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libxml2_a.lib ${CURRENT_PACKAGES_DIR}/debug/lib/libxml2.lib) +endif() + +# Handle copyright +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libxml2) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/libxml2/COPYING ${CURRENT_PACKAGES_DIR}/share/libxml2/copyright) -- cgit v1.2.3 From be03c5dd4e0ec3f09fc65f7b5ec5f89707929b00 Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Sun, 16 Oct 2016 18:49:12 -0400 Subject: modified assimp portfile --- ports/assimp/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/assimp/portfile.cmake b/ports/assimp/portfile.cmake index dd57392be..369d0782e 100644 --- a/ports/assimp/portfile.cmake +++ b/ports/assimp/portfile.cmake @@ -37,3 +37,4 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright file(COPY ${CURRENT_BUILDTREES_DIR}/src/assimp-3.3.1/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/assimp) file(RENAME ${CURRENT_PACKAGES_DIR}/share/assimp/LICENSE ${CURRENT_PACKAGES_DIR}/share/assimp/copyright) +vcpkg_copy_pdbs() \ No newline at end of file -- cgit v1.2.3 From 73d248f91da7c6bfebba06419edb54045c9c34ca Mon Sep 17 00:00:00 2001 From: charlie barto Date: Wed, 5 Oct 2016 18:00:15 -0400 Subject: added glbinding port --- ports/glbinding/CONTROL | 3 +++ ports/glbinding/portfile.cmake | 46 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 ports/glbinding/CONTROL create mode 100644 ports/glbinding/portfile.cmake diff --git a/ports/glbinding/CONTROL b/ports/glbinding/CONTROL new file mode 100644 index 000000000..bc04bf5f6 --- /dev/null +++ b/ports/glbinding/CONTROL @@ -0,0 +1,3 @@ +Source: glbinding +Version: 2.1.1 +Description: glbinding is an MIT licensed, cross-platform C++ binding for the OpenGL API diff --git a/ports/glbinding/portfile.cmake b/ports/glbinding/portfile.cmake new file mode 100644 index 000000000..e63007aac --- /dev/null +++ b/ports/glbinding/portfile.cmake @@ -0,0 +1,46 @@ +# 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(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/cginternals/glbinding/archive/v2.1.1.zip" + FILENAME "glbinding-2.1.1.zip" + SHA512 66b21853a4f4760b7b22cafd5211958769c513e83be999018fe79cf56a9271e0e28566caaa2286393f54ac2154d564a68d12159598d03c965adf6756f3753f11 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_configure_cmake( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/glbinding-2.1.1 + # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 + # OPTIONS_RELEASE -DOPTIMIZE=1 + # OPTIONS_DEBUG -DDEBUGGABLE=1 +) + +vcpkg_build_cmake() +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) +file(RENAME ${CURRENT_PACKAGES_DIR}/cmake/glbinding ${CURRENT_PACKAGES_DIR}/share/glbinding) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/cmake) + +file(READ ${CURRENT_PACKAGES_DIR}/debug/cmake/glbinding/glbinding-export-debug.cmake GLBINDING_DEBUG_MODULE) +string(REPLACE "\${IMPORT_PREFIX}" "\${IMPORT_PREFIX}/debug" GLBINDING_DEBUG_MODULE "${GLBINDING_DEBUG_MODULE}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/glbinding/glbinding-export-debug.cmake "${GLBINDING_DEBUG_MODULE}") +file(RENAME ${CURRENT_PACKAGES_DIR}/glbinding-config.cmake ${CURRENT_PACKAGES_DIR}/share/glbinding/glbinding-config.cmake) +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin) +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) +file(RENAME ${CURRENT_PACKAGES_DIR}/glbinding.dll ${CURRENT_PACKAGES_DIR}/bin/glbinding.dll) +file(RENAME ${CURRENT_PACKAGES_DIR}/debug/glbindingd.dll ${CURRENT_PACKAGES_DIR}/debug/bin/glbindingd.dll) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/cmake) +file(RENAME ${CURRENT_PACKAGES_DIR}/data ${CURRENT_PACKAGES_DIR}/share/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/data) +# Handle copyright +file(COPY ${CURRENT_BUILDTREES_DIR}/src/glbinding-2.1.1/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/glbinding) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/glbinding/LICENSE ${CURRENT_PACKAGES_DIR}/share/glbinding/copyright) -- cgit v1.2.3 From a5178a553cc99f263f34da751c9fd793a30897cf Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Sun, 16 Oct 2016 18:56:17 -0400 Subject: copy pdbs --- ports/glbinding/portfile.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/glbinding/portfile.cmake b/ports/glbinding/portfile.cmake index e63007aac..442717dd0 100644 --- a/ports/glbinding/portfile.cmake +++ b/ports/glbinding/portfile.cmake @@ -44,3 +44,5 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/data) # Handle copyright file(COPY ${CURRENT_BUILDTREES_DIR}/src/glbinding-2.1.1/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/glbinding) file(RENAME ${CURRENT_PACKAGES_DIR}/share/glbinding/LICENSE ${CURRENT_PACKAGES_DIR}/share/glbinding/copyright) + +vcpkg_copy_pdbs() \ No newline at end of file -- cgit v1.2.3 From 8d1d8df80eb99e9bddfde38ff5951602583d5859 Mon Sep 17 00:00:00 2001 From: Chris Bond Date: Sun, 16 Oct 2016 17:18:11 -0700 Subject: updated control and cmake files for latest version of sqlite --- ports/sqlite3/CONTROL | 2 +- ports/sqlite3/portfile.cmake | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/sqlite3/CONTROL b/ports/sqlite3/CONTROL index 886051482..53b0c5934 100644 --- a/ports/sqlite3/CONTROL +++ b/ports/sqlite3/CONTROL @@ -1,3 +1,3 @@ Source: sqlite3 -Version: 3120200 +Version: 3.15.0 (3150000) Description: SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. \ No newline at end of file diff --git a/ports/sqlite3/portfile.cmake b/ports/sqlite3/portfile.cmake index 114a7186f..36387eb43 100644 --- a/ports/sqlite3/portfile.cmake +++ b/ports/sqlite3/portfile.cmake @@ -1,16 +1,16 @@ include(vcpkg_common_functions) set(SOURCE_PATH ${CMAKE_CURRENT_LIST_DIR}) vcpkg_download_distfile(ARCHIVE - URLS "http://www.sqlite.org/2016/sqlite-amalgamation-3120200.zip" - FILENAME "sqlite-amalgamation-3120200.zip" - SHA512 92e1cc09dc4d4e9dd4c189e4a5061664f11971eb3e14c4c59e1f489f201411b08a31dae9e6fc50fffd49bb72f88ac3d99b7c7cd5e334b3079c165ee1c4f5a16e + URLS "https://sqlite.org/2016/sqlite-amalgamation-3150000.zip" + FILENAME "sqlite-amalgamation-3150000.zip" + SHA512 82fea23b2158c448cbe2b80121eb32652df49eb85357edbaeef0c343ef478433706ebc4cd8add1985763db223d9268d0f7e74fc8db59353c15267cbc3d2078a8 ) vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS - -DSOURCE=${CURRENT_BUILDTREES_DIR}/src/sqlite-amalgamation-3120200 + -DSOURCE=${CURRENT_BUILDTREES_DIR}/src/sqlite-amalgamation-3150000 ) vcpkg_install_cmake() -- cgit v1.2.3 From 7fdeeacc8fd59c1ff266fa9d6ca19ff1936507cc Mon Sep 17 00:00:00 2001 From: vlj Date: Fri, 14 Oct 2016 19:21:35 +0200 Subject: Add physfs. --- ports/physfs/CONTROL | 3 +++ ports/physfs/portfile.cmake | 30 ++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 ports/physfs/CONTROL create mode 100644 ports/physfs/portfile.cmake diff --git a/ports/physfs/CONTROL b/ports/physfs/CONTROL new file mode 100644 index 000000000..e279928ae --- /dev/null +++ b/ports/physfs/CONTROL @@ -0,0 +1,3 @@ +Source: physfs +Version: +Description: diff --git a/ports/physfs/portfile.cmake b/ports/physfs/portfile.cmake new file mode 100644 index 000000000..463d1b8a7 --- /dev/null +++ b/ports/physfs/portfile.cmake @@ -0,0 +1,30 @@ +# 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(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/physfs-2.0.3) +vcpkg_download_distfile(ARCHIVE + URLS "https://icculus.org/physfs/downloads/physfs-2.0.3.tar.bz2" + FILENAME "physfs-2.0.3.tar.bz2" + SHA512 47eff0c81b8dc3bb526766b0a8ad2437d2951867880116d6e6e8f2ec1490e263541fb741867fed6517cc3fa8a9c5651b36e3e02a499f19cfdc5c7261c9707e80 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} +) + +vcpkg_install_cmake() +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/test_physfs.exe) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/test_physfs.exe) + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/physfs) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/physfs/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/physfs/copyright) -- cgit v1.2.3 From f48d05a25a2b6310b1c6852fa2add4820288aad4 Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Sun, 16 Oct 2016 20:22:00 -0400 Subject: added geos --- ports/geos/CONTROL | 3 +++ ports/geos/portfile.cmake | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 ports/geos/CONTROL create mode 100644 ports/geos/portfile.cmake diff --git a/ports/geos/CONTROL b/ports/geos/CONTROL new file mode 100644 index 000000000..c0ec7b134 --- /dev/null +++ b/ports/geos/CONTROL @@ -0,0 +1,3 @@ +Source: geos +Version: 3.5.0 +Description: Geometry Engine Open Source diff --git a/ports/geos/portfile.cmake b/ports/geos/portfile.cmake new file mode 100644 index 000000000..554015937 --- /dev/null +++ b/ports/geos/portfile.cmake @@ -0,0 +1,45 @@ +# 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(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) +#downloading 3.5 from their SVN repo and not the release tarball +#because the 3.5 release did not build on windows, and fixes were backported +#without generating a new release tarball (I don't think very many GIS people use win) +vcpkg_download_distfile(ARCHIVE + URLS "https://trac.osgeo.org/geos/browser/branches/3.5?rev=4261&format=zip" + FILENAME "geos-3.5.0.zip" + SHA512 3b91e8992f60b99a3f01069d955b71bce425ae5e5c599252fa26a337494e1a5a8ea796be124766d054710d6c03806f56dc1c63539b4660e2bb894d7ef779d4b9 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +#we need to do this because GOES deploy process is totally broken for cmake +#file(DOWNLOAD http://svn.osgeo.org/geos/tags/3.5.0/cmake/modules/GenerateSourceGroups.cmake +# ${CURRENT_BUILDTREES_DIR}/src/geos-3.5.0/cmake/modules/GenerateSourceGroups.cmake) +file(WRITE ${CURRENT_BUILDTREES_DIR}/src/3.5/geos_svn_revision.h "#define GEOS_SVN_REVISION 4261") +vcpkg_configure_cmake( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/3.5 + OPTIONS -DGEOS_ENABLE_TESTS=False + -DBUILD_TESTING=False +) + +vcpkg_build_cmake() +vcpkg_install_cmake() +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +# Handle copyright +file(COPY ${CURRENT_BUILDTREES_DIR}/src/3.5/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/geos) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/geos/COPYING ${CURRENT_PACKAGES_DIR}/share/geos/copyright) +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/libgeos.lib ${CURRENT_PACKAGES_DIR}/debug/lib/libgeos.lib) + vcpkg_copy_pdbs() +else() + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/geos.lib ${CURRENT_PACKAGES_DIR}/debug/lib/geos.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/geos_c.lib ${CURRENT_PACKAGES_DIR}/debug/lib/geos_c.lib) + +endif() \ No newline at end of file -- cgit v1.2.3 From c9594c587b062e27487ab95631e2f7b603642627 Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Mon, 17 Oct 2016 14:43:51 -0400 Subject: updated eigen version --- ports/eigen3/CONTROL | 2 +- ports/eigen3/portfile.cmake | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/eigen3/CONTROL b/ports/eigen3/CONTROL index cbbb0bcdd..436414df1 100644 --- a/ports/eigen3/CONTROL +++ b/ports/eigen3/CONTROL @@ -1,3 +1,3 @@ Source: eigen3 -Version: 3.2.9 +Version: 3.2.10 Description: C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms. diff --git a/ports/eigen3/portfile.cmake b/ports/eigen3/portfile.cmake index fd62466a5..a1e51beb0 100644 --- a/ports/eigen3/portfile.cmake +++ b/ports/eigen3/portfile.cmake @@ -1,9 +1,9 @@ include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/eigen-eigen-dc6cfdf9bcec) vcpkg_download_distfile(ARCHIVE - URLS "http://bitbucket.org/eigen/eigen/get/3.2.9.tar.bz2" - FILENAME "eigen-3.2.9.tar.bz2" - SHA512 2734ce70e0b04dc5839715a3cc9b8f90e05b341cfca42a7d586df213a9a14fe5642c76ccf36c16d020ae167c0d6e4d5cc306f0b3bf1f519c58372b0736ca7e63 + URLS "http://bitbucket.org/eigen/eigen/get/3.2.10.tar.bz2" + FILENAME "eigen-3.2.10.tar.bz2" + SHA512 413c01a5b1b5d2e4366bc9289b1d613b21157e702b1c0d544e41ba5726acfbe0b60921ded37926010e9ce3642939e3ad39038e053d392b90a7a6302955ec5058 ) vcpkg_extract_source_archive(${ARCHIVE}) -- cgit v1.2.3 From 56f8c6a462b234def8eda554c4af88aaa0c0f992 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 17 Oct 2016 12:27:07 -0700 Subject: [sqlite3] Use SOURCE_PATH in a similar manner as other portfiles --- ports/sqlite3/portfile.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ports/sqlite3/portfile.cmake b/ports/sqlite3/portfile.cmake index 36387eb43..6918a0788 100644 --- a/ports/sqlite3/portfile.cmake +++ b/ports/sqlite3/portfile.cmake @@ -1,5 +1,5 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CMAKE_CURRENT_LIST_DIR}) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/sqlite-amalgamation-3150000) vcpkg_download_distfile(ARCHIVE URLS "https://sqlite.org/2016/sqlite-amalgamation-3150000.zip" FILENAME "sqlite-amalgamation-3150000.zip" @@ -7,10 +7,12 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS - -DSOURCE=${CURRENT_BUILDTREES_DIR}/src/sqlite-amalgamation-3150000 + -DSOURCE=${SOURCE_PATH} ) vcpkg_install_cmake() -- cgit v1.2.3 From 5158d842e0368f6e008b1e8104636356d70b6726 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 17 Oct 2016 12:30:09 -0700 Subject: [libiconv] Define and use SOURCE_PATH variable --- ports/libiconv/portfile.cmake | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ports/libiconv/portfile.cmake b/ports/libiconv/portfile.cmake index dc1e1a3a3..15d324d23 100644 --- a/ports/libiconv/portfile.cmake +++ b/ports/libiconv/portfile.cmake @@ -1,5 +1,6 @@ include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libiconv-1.14) vcpkg_download_distfile(ARCHIVE URLS "https://ftp.gnu.org/gnu/libiconv/libiconv-1.14.tar.gz" FILENAME "libiconv-1.14.tar.gz" @@ -8,22 +9,22 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive(${ARCHIVE}) #Since libiconv uses automake, make and configure, we use a custom CMake file -file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${CURRENT_BUILDTREES_DIR}/src/libiconv-1.14/) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) vcpkg_apply_patches( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libiconv-1.14/ + SOURCE_PATH ${SOURCE_PATH} PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001-Add-export-definitions.patch ${CMAKE_CURRENT_LIST_DIR}/0002-Config-for-MSVC.patch ) vcpkg_configure_cmake( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libiconv-1.14 + SOURCE_PATH ${SOURCE_PATH} ) vcpkg_install_cmake() # Handle copyright -file(COPY ${CURRENT_BUILDTREES_DIR}/src/libiconv-1.14/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/libiconv) +file(COPY ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/libiconv) file(RENAME ${CURRENT_PACKAGES_DIR}/share/libiconv/COPYING.LIB ${CURRENT_PACKAGES_DIR}/share/libiconv/copyright) # clean out the debug include -- cgit v1.2.3 From daf6405ad1d4bba8490c60413078fb9e25e10119 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 17 Oct 2016 13:11:53 -0700 Subject: [physfs] Added version and description --- ports/physfs/CONTROL | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/physfs/CONTROL b/ports/physfs/CONTROL index e279928ae..3e502435f 100644 --- a/ports/physfs/CONTROL +++ b/ports/physfs/CONTROL @@ -1,3 +1,3 @@ Source: physfs -Version: -Description: +Version: 2.0.3 +Description: a library to provide abstract access to various archives -- cgit v1.2.3 From 66772470ec6a30bf81063440cddc42c5f81944bf Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 17 Oct 2016 13:32:55 -0700 Subject: [glbidning] Exit early if trying to build it statically --- ports/glbinding/portfile.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ports/glbinding/portfile.cmake b/ports/glbinding/portfile.cmake index 442717dd0..5b928445f 100644 --- a/ports/glbinding/portfile.cmake +++ b/ports/glbinding/portfile.cmake @@ -8,6 +8,10 @@ include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(FATAL_ERROR "Portfile not yet modified for building glbinding statically") +endif() + vcpkg_download_distfile(ARCHIVE URLS "https://github.com/cginternals/glbinding/archive/v2.1.1.zip" FILENAME "glbinding-2.1.1.zip" @@ -25,6 +29,7 @@ vcpkg_configure_cmake( vcpkg_build_cmake() vcpkg_install_cmake() + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) file(RENAME ${CURRENT_PACKAGES_DIR}/cmake/glbinding ${CURRENT_PACKAGES_DIR}/share/glbinding) -- cgit v1.2.3 From 99623d66c8ec2c833d9662547f479a3cd8dfab39 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 17 Oct 2016 13:33:47 -0700 Subject: Fix usage of message(FATAL_ERROR,"blah") to message(FATAL_ERROR "blah") --- ports/ace/portfile.cmake | 3 +-- ports/glew/portfile.cmake | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ports/ace/portfile.cmake b/ports/ace/portfile.cmake index 301354cae..d72e92923 100644 --- a/ports/ace/portfile.cmake +++ b/ports/ace/portfile.cmake @@ -8,8 +8,7 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive(${ARCHIVE}) if (TRIPLET_SYSTEM_ARCH MATCHES "arm") - message(FATAL_ERROR, "ARM is currently not supported.") - return() + message(FATAL_ERROR "ARM is currently not supported.") elseif (TRIPLET_SYSTEM_ARCH MATCHES "x86") set(MSBUILD_PLATFORM "Win32") else () diff --git a/ports/glew/portfile.cmake b/ports/glew/portfile.cmake index 3b35830f6..416de51e5 100644 --- a/ports/glew/portfile.cmake +++ b/ports/glew/portfile.cmake @@ -10,8 +10,7 @@ vcpkg_extract_source_archive(${ARCHIVE_FILE}) IF (TRIPLET_SYSTEM_ARCH MATCHES "x86") SET(BUILD_ARCH "Win32") ELSEIF(TRIPLET_SYSTEM_ARCH MATCHES "arm") - MESSAGE(FATAL_ERROR, " ARM is currently not supported.") - RETURN() + MESSAGE(FATAL_ERROR " ARM is currently not supported.") ELSE() SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH}) ENDIF() -- cgit v1.2.3 From 796e65ea73e883e275a7908c4214913d32d5327a Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 17 Oct 2016 17:08:22 -0700 Subject: [sqlite3] Remove parentheses from version field --- ports/sqlite3/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/sqlite3/CONTROL b/ports/sqlite3/CONTROL index 53b0c5934..e382a6f85 100644 --- a/ports/sqlite3/CONTROL +++ b/ports/sqlite3/CONTROL @@ -1,3 +1,3 @@ Source: sqlite3 -Version: 3.15.0 (3150000) +Version: 3.15.0 Description: SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. \ No newline at end of file -- cgit v1.2.3 From 6fb82365f49901fee330ae00ba0be7a0f85be06d Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Mon, 17 Oct 2016 17:11:42 -0700 Subject: range-v3 builds from 2 distinct pieces: * Upstream sources from the fork point (https://github.com/ericniebler/range-v3/commit/6eb5c831ffe12cd5cb96390dbe917ca1b248772d) * Separate patch that applies MSVC workarounds from https://github.com/Microsoft/Range-V3-VS2015 --- ports/range-v3/CONTROL | 2 +- ports/range-v3/portfile.cmake | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ports/range-v3/CONTROL b/ports/range-v3/CONTROL index a04b8d3b7..712e295d7 100644 --- a/ports/range-v3/CONTROL +++ b/ports/range-v3/CONTROL @@ -1,3 +1,3 @@ Source: range-v3 -Version: 0.0.0-1 +Version: 0.0.0-2 Description: Range library for C++11/14/17. diff --git a/ports/range-v3/portfile.cmake b/ports/range-v3/portfile.cmake index 692adf347..5d2d89783 100644 --- a/ports/range-v3/portfile.cmake +++ b/ports/range-v3/portfile.cmake @@ -1,12 +1,19 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/Range-V3-VS2015-ede9ad367fd5ec764fecb039c874614bd908e6b6) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/range-v3-6eb5c831ffe12cd5cb96390dbe917ca1b248772d) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/Microsoft/Range-V3-VS2015/archive/ede9ad367fd5ec764fecb039c874614bd908e6b6.zip" - FILENAME "range-v3-ede9ad367fd5ec764fecb039c874614bd908e6b6.zip" - SHA512 e978c7694471d8616c248647b77689f377b3e2517347abde8629b140e5994de8bf686565a24cdd7dd222f325d43b775f5e478c91220dce75313985499b134637 + URLS "https://github.com/ericniebler/range-v3/archive/6eb5c831ffe12cd5cb96390dbe917ca1b248772d.zip" + FILENAME "range-v3-6eb5c831ffe12cd5cb96390dbe917ca1b248772d.zip" + SHA512 2605af46c2c049f66dc982b1c4e506a8f115d47cc6c61a80f08921c667e52ad3097c485280ee43711c84b84a1490929e085b89cf9ad4c83b93222315210e92aa +) +vcpkg_download_distfile(DIFF + URLS "https://github.com/Microsoft/Range-V3-VS2015/compare/fork_base...2cb66781c8ac72a55fff1436e8fc8170a2ce8509.diff" + FILENAME "range-v3-fork_base_to_2cb66781c8ac72a55fff1436e8fc8170a2ce8509.diff" + SHA512 5c1728387967a5c14596d6d71e7c28f0206c22b652f4c96955711bcb805816eb106b62fcfde0a7d514eeed28fe6ce1f8c593fa3ef7df70f8da3b88b6d79c1515 ) vcpkg_extract_source_archive(${ARCHIVE}) +vcpkg_apply_patches(SOURCE_PATH ${SOURCE_PATH} PATCHES ${DIFF}) + file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/range-v3) file(RENAME ${CURRENT_PACKAGES_DIR}/share/range-v3/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/range-v3/copyright) file(INSTALL ${SOURCE_PATH}/include DESTINATION ${CURRENT_PACKAGES_DIR} FILES_MATCHING PATTERN "*.hpp") -- cgit v1.2.3 From 550881b955388d53fe8b8221ea5fca5f5c940219 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 17 Oct 2016 23:23:37 -0700 Subject: [boost] Enable static building --- ports/boost/portfile.cmake | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake index 03404b531..43dde456a 100644 --- a/ports/boost/portfile.cmake +++ b/ports/boost/portfile.cmake @@ -1,3 +1,4 @@ +include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/boost_1_62_0) @@ -24,10 +25,21 @@ set(B2_OPTIONS -q --without-python threading=multi - link=shared - runtime-link=shared --debug-configuration ) + +if (VCPKG_CRT_LINKAGE STREQUAL dynamic) + list(APPEND B2_OPTIONS runtime-link=shared) +elseif() + list(APPEND B2_OPTIONS runtime-link=static) +endif() + +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + list(APPEND B2_OPTIONS link=shared) +elseif() + list(APPEND B2_OPTIONS link=static) +endif() + if(TRIPLET_SYSTEM_ARCH MATCHES "x64") list(APPEND B2_OPTIONS address-model=64) endif() @@ -82,18 +94,26 @@ message(STATUS "Packaging ${TARGET_TRIPLET}-rel") file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/stage/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/lib FILES_MATCHING PATTERN "*.lib") -file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/stage/lib/ - DESTINATION ${CURRENT_PACKAGES_DIR}/bin - FILES_MATCHING PATTERN "*.dll") +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/stage/lib/ + DESTINATION ${CURRENT_PACKAGES_DIR}/bin + FILES_MATCHING PATTERN "*.dll") +elseif() + message(STATUS ${VCPKG_LIBRARY_LINKAGE}) +endif() message(STATUS "Packaging ${TARGET_TRIPLET}-rel done") message(STATUS "Packaging ${TARGET_TRIPLET}-dbg") file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/stage/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib FILES_MATCHING PATTERN "*.lib") -file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/stage/lib/ - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin - FILES_MATCHING PATTERN "*.dll") +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/stage/lib/ + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin + FILES_MATCHING PATTERN "*.dll") +elseif() + message(STATUS ${VCPKG_LIBRARY_LINKAGE}) +endif() message(STATUS "Packaging ${TARGET_TRIPLET}-dbg done") vcpkg_copy_pdbs() \ No newline at end of file -- cgit v1.2.3 From 8fd12fed6cbe6ea563eb709b34a86967d562c78e Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 18 Oct 2016 12:33:12 -0700 Subject: [eigen3] Fix source path for 3.2.10 update --- ports/eigen3/CONTROL | 2 +- ports/eigen3/portfile.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/eigen3/CONTROL b/ports/eigen3/CONTROL index 436414df1..d5d8e074d 100644 --- a/ports/eigen3/CONTROL +++ b/ports/eigen3/CONTROL @@ -1,3 +1,3 @@ Source: eigen3 -Version: 3.2.10 +Version: 3.2.10-1 Description: C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms. diff --git a/ports/eigen3/portfile.cmake b/ports/eigen3/portfile.cmake index a1e51beb0..5453f8dbc 100644 --- a/ports/eigen3/portfile.cmake +++ b/ports/eigen3/portfile.cmake @@ -1,5 +1,5 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/eigen-eigen-dc6cfdf9bcec) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/eigen-eigen-b9cd8366d4e8) vcpkg_download_distfile(ARCHIVE URLS "http://bitbucket.org/eigen/eigen/get/3.2.10.tar.bz2" FILENAME "eigen-3.2.10.tar.bz2" -- cgit v1.2.3 From a670993b7b9b18a51e76ad0bcd2c5e86e8d56834 Mon Sep 17 00:00:00 2001 From: ZeroCrunch Date: Tue, 18 Oct 2016 22:53:41 +0100 Subject: Support for Intel's Threading Building Blocks (2016/09/16) --- ports/tbb-20160916/CONTROL | 3 +++ ports/tbb-20160916/portfile.cmake | 41 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 ports/tbb-20160916/CONTROL create mode 100644 ports/tbb-20160916/portfile.cmake diff --git a/ports/tbb-20160916/CONTROL b/ports/tbb-20160916/CONTROL new file mode 100644 index 000000000..c0abc0a25 --- /dev/null +++ b/ports/tbb-20160916/CONTROL @@ -0,0 +1,3 @@ +Source: tbb-20160916 +Version: 2016/09/16 +Description: Intel's Threading Building Blocks. diff --git a/ports/tbb-20160916/portfile.cmake b/ports/tbb-20160916/portfile.cmake new file mode 100644 index 000000000..315010ba1 --- /dev/null +++ b/ports/tbb-20160916/portfile.cmake @@ -0,0 +1,41 @@ +# 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(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) + +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/tbb2017_20160916oss) +vcpkg_download_distfile(ARCHIVE + URLS "https://www.threadingbuildingblocks.org/sites/default/files/software_releases/windows/tbb2017_20160916oss_win_1.zip" + FILENAME "tbb2017_20160916oss_win_1.zip" + SHA512 14bbc54aa0c4506bab6e6fdb7e9e562cbc88881cb683a8bd690e3101177e55433f25a2143e7af1ed52edacb44dc92fab354e1f2101bc13b33b3ea137def8bdd1 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +# Installation +message(STATUS "Installing") +file(COPY ${SOURCE_PATH}/bin DESTINATION ${CURRENT_PACKAGES_DIR}/bin) +file(COPY ${SOURCE_PATH}/include DESTINATION ${CURRENT_PACKAGES_DIR}/include) +file(COPY ${SOURCE_PATH}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + +# Remove artefacts for other architectures +if(VCPKG_TARGET_ARCHITECTURE STREQUAL x64) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/bin/ia32) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/lib/ia32) +else() + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/bin/intel64) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/lib/intel64) +endif() + +vcpkg_copy_pdbs() + +message(STATUS "Installing done") + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/tbb-20160916) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/tbb-20160916/LICENSE ${CURRENT_PACKAGES_DIR}/share/tbb-20160916/copyright) -- cgit v1.2.3 From eba9f6a812edb48f14b5ad931d4f909e48f5b70d Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Tue, 18 Oct 2016 15:55:37 -0400 Subject: added static support to glbinding changed glbinding to support new configure --- ports/glbinding/portfile.cmake | 23 ++++++++--------------- scripts/cmake/vcpkg_configure_cmake.cmake | 25 ++++++++++++++++++++++--- 2 files changed, 30 insertions(+), 18 deletions(-) diff --git a/ports/glbinding/portfile.cmake b/ports/glbinding/portfile.cmake index 5b928445f..ada070089 100644 --- a/ports/glbinding/portfile.cmake +++ b/ports/glbinding/portfile.cmake @@ -8,9 +8,6 @@ include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Portfile not yet modified for building glbinding statically") -endif() vcpkg_download_distfile(ARCHIVE URLS "https://github.com/cginternals/glbinding/archive/v2.1.1.zip" @@ -18,14 +15,7 @@ vcpkg_download_distfile(ARCHIVE SHA512 66b21853a4f4760b7b22cafd5211958769c513e83be999018fe79cf56a9271e0e28566caaa2286393f54ac2154d564a68d12159598d03c965adf6756f3753f11 ) vcpkg_extract_source_archive(${ARCHIVE}) - -vcpkg_configure_cmake( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/glbinding-2.1.1 - # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 - # OPTIONS_RELEASE -DOPTIMIZE=1 - # OPTIONS_DEBUG -DDEBUGGABLE=1 -) - +vcpkg_configure_cmake(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/glbinding-2.1.1) vcpkg_build_cmake() vcpkg_install_cmake() @@ -39,10 +29,13 @@ file(READ ${CURRENT_PACKAGES_DIR}/debug/cmake/glbinding/glbinding-export-debug.c string(REPLACE "\${IMPORT_PREFIX}" "\${IMPORT_PREFIX}/debug" GLBINDING_DEBUG_MODULE "${GLBINDING_DEBUG_MODULE}") file(WRITE ${CURRENT_PACKAGES_DIR}/share/glbinding/glbinding-export-debug.cmake "${GLBINDING_DEBUG_MODULE}") file(RENAME ${CURRENT_PACKAGES_DIR}/glbinding-config.cmake ${CURRENT_PACKAGES_DIR}/share/glbinding/glbinding-config.cmake) -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin) -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) -file(RENAME ${CURRENT_PACKAGES_DIR}/glbinding.dll ${CURRENT_PACKAGES_DIR}/bin/glbinding.dll) -file(RENAME ${CURRENT_PACKAGES_DIR}/debug/glbindingd.dll ${CURRENT_PACKAGES_DIR}/debug/bin/glbindingd.dll) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/glbinding-config.cmake) +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin) + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) + file(RENAME ${CURRENT_PACKAGES_DIR}/glbinding.dll ${CURRENT_PACKAGES_DIR}/bin/glbinding.dll) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/glbindingd.dll ${CURRENT_PACKAGES_DIR}/debug/bin/glbindingd.dll) +endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/cmake) file(RENAME ${CURRENT_PACKAGES_DIR}/data ${CURRENT_PACKAGES_DIR}/share/data) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/data) diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 03b69e510..f956bc8da 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -30,16 +30,35 @@ function(vcpkg_configure_cmake) endif() if(DEFINED VCPKG_LIBRARY_LINKAGE AND VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) list(APPEND _csc_OPTIONS -DBUILD_SHARED_LIBS=ON) + elseif(DEFINED VCPKG_LIBRARY_LINKAGE AND VCPKG_LIBRARY_LINKAGE STREQUAL static) + list(APPEND _csc_OPTIONS -DBUILD_SHARED_LIBS=OFF) endif() + list(APPEND _csc_OPTIONS "-DCMAKE_CXX_FLAGS= /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc" "-DCMAKE_C_FLAGS= /DWIN32 /D_WINDOWS /W3 /utf-8" ) - + if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL dynamic) + list(APPEND _csc_OPTIONS_DEBUG + "-DCMAKE_CXX_FLAGS_DEBUG=/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1" + "-DCMAKE_C_FLAGS_RELEASE=/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1" + ) + list(APPEND _csc_OPTIONS_RELEASE + "-DCMAKE_CXX_FLAGS_RELEASE=/MD /O2 /Oi /Gy /DNDEBUG /Zi" + "-DCMAKE_C_FLAGS_RELEASE=/MD /O2 /Oi /Gy /DNDEBUG /Zi" + ) + elseif(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL static) + list(APPEND _csc_OPTIONS_DEBUG + "-DCMAKE_CXX_FLAGS_DEBUG=/D_DEBUG /MTd /Zi /Ob0 /Od /RTC1" + "-DCMAKE_C_FLAGS_RELEASE=/D_DEBUG /MTd /Zi /Ob0 /Od /RTC1" + ) + list(APPEND _csc_OPTIONS_RELEASE + "-DCMAKE_CXX_FLAGS_RELEASE=/MT /O2 /Oi /Gy /DNDEBUG /Zi" + "-DCMAKE_C_FLAGS_RELEASE=/MT /O2 /Oi /Gy /DNDEBUG /Zi" + ) + endif() list(APPEND _csc_OPTIONS_RELEASE - "-DCMAKE_CXX_FLAGS_RELEASE=/MD /O2 /Oi /Gy /DNDEBUG /Zi" - "-DCMAKE_C_FLAGS_RELEASE=/MD /O2 /Oi /Gy /DNDEBUG /Zi" "-DCMAKE_SHARED_LINKER_FLAGS_RELEASE=/DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF" "-DCMAKE_EXE_LINKER_FLAGS_RELEASE=/DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF" ) -- cgit v1.2.3 From fe1b146eecc23f6a609e541bbf7bbbdc231e75bc Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Tue, 18 Oct 2016 15:52:55 -0700 Subject: Change version to "20150729-vcpkg2" ...to reflect this is based on the upstream sources as of 20150729, and the second release of the patch based on that same upstream. --- ports/range-v3/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/range-v3/CONTROL b/ports/range-v3/CONTROL index 712e295d7..aa8ad164d 100644 --- a/ports/range-v3/CONTROL +++ b/ports/range-v3/CONTROL @@ -1,3 +1,3 @@ Source: range-v3 -Version: 0.0.0-2 +Version: 20150729-vcpkg2 Description: Range library for C++11/14/17. -- cgit v1.2.3 From 4488064f81d58c34d329bb2ebdd589c3349cdd91 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 18 Oct 2016 16:17:47 -0700 Subject: [vcpkg_apply_patches] Check if patch was properly applied --- scripts/cmake/vcpkg_apply_patches.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/cmake/vcpkg_apply_patches.cmake b/scripts/cmake/vcpkg_apply_patches.cmake index 939edbd14..42f7a84f9 100644 --- a/scripts/cmake/vcpkg_apply_patches.cmake +++ b/scripts/cmake/vcpkg_apply_patches.cmake @@ -13,6 +13,15 @@ function(vcpkg_apply_patches) WORKING_DIRECTORY ${_ap_SOURCE_PATH} RESULT_VARIABLE error_code ) + + if(error_code) + message(FATAL_ERROR + "Applying patch failed: ${GIT} --work-tree=. apply \"${PATCH}\" --ignore-whitespace --whitespace=nowarn --verbose\n" + "See logs for more information:\n" + " ${CURRENT_BUILDTREES_DIR}/${LOGNAME}-out.log\n" + " ${CURRENT_BUILDTREES_DIR}/${LOGNAME}-err.log\n") + endif() + message(STATUS "Applying patch ${PATCH} done") math(EXPR PATCHNUM "${PATCHNUM}+1") endforeach() -- cgit v1.2.3 From 6059b2bf2fbe0ca9ddfa266d48a8829228365ff0 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 18 Oct 2016 16:54:48 -0700 Subject: [vcpkg_apply_patches] Also print working dir --- scripts/cmake/vcpkg_apply_patches.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/cmake/vcpkg_apply_patches.cmake b/scripts/cmake/vcpkg_apply_patches.cmake index 42f7a84f9..ad906f2a9 100644 --- a/scripts/cmake/vcpkg_apply_patches.cmake +++ b/scripts/cmake/vcpkg_apply_patches.cmake @@ -17,6 +17,7 @@ function(vcpkg_apply_patches) if(error_code) message(FATAL_ERROR "Applying patch failed: ${GIT} --work-tree=. apply \"${PATCH}\" --ignore-whitespace --whitespace=nowarn --verbose\n" + "Working Directory: ${_ap_SOURCE_PATH}\n" "See logs for more information:\n" " ${CURRENT_BUILDTREES_DIR}/${LOGNAME}-out.log\n" " ${CURRENT_BUILDTREES_DIR}/${LOGNAME}-err.log\n") -- cgit v1.2.3 From 20a9bb8acbf75036229db25504f9c7cc0f9900e0 Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Tue, 18 Oct 2016 16:01:48 -0400 Subject: added rtree and unlock_notify support to builds of sqlite (odb needs this) --- ports/sqlite3/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ports/sqlite3/CMakeLists.txt b/ports/sqlite3/CMakeLists.txt index 3d5f73a4a..3afc61f4c 100644 --- a/ports/sqlite3/CMakeLists.txt +++ b/ports/sqlite3/CMakeLists.txt @@ -3,7 +3,11 @@ project(sqlite3 C) include_directories(${SOURCE}) add_library(sqlite3 SHARED ${SOURCE}/sqlite3.c) -target_compile_definitions(sqlite3 PRIVATE $<$:-DSQLITE_DEBUG> "-DSQLITE_API=__declspec(dllexport)") +target_compile_definitions(sqlite3 PRIVATE + $<$:-DSQLITE_DEBUG> "-DSQLITE_API=__declspec(dllexport)" + -DSQLITE_ENABLE_RTREE + -DSQLITE_ENABLE_UNLOCK_NOTIFY + ) if(TRIPLET_SYSTEM_NAME MATCHES "WindowsStore") target_compile_definitions(sqlite3 PRIVATE -DSQLITE_OS_WINRT=1) endif() -- cgit v1.2.3 From 30caaacb51630ebbb79b1609d11f79ca34cd1e9e Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 18 Oct 2016 17:05:14 -0700 Subject: [tbb] Rename package to 'tbb' --- ports/tbb-20160916/CONTROL | 3 --- ports/tbb-20160916/portfile.cmake | 41 --------------------------------------- ports/tbb/CONTROL | 3 +++ ports/tbb/portfile.cmake | 41 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 44 insertions(+), 44 deletions(-) delete mode 100644 ports/tbb-20160916/CONTROL delete mode 100644 ports/tbb-20160916/portfile.cmake create mode 100644 ports/tbb/CONTROL create mode 100644 ports/tbb/portfile.cmake diff --git a/ports/tbb-20160916/CONTROL b/ports/tbb-20160916/CONTROL deleted file mode 100644 index c0abc0a25..000000000 --- a/ports/tbb-20160916/CONTROL +++ /dev/null @@ -1,3 +0,0 @@ -Source: tbb-20160916 -Version: 2016/09/16 -Description: Intel's Threading Building Blocks. diff --git a/ports/tbb-20160916/portfile.cmake b/ports/tbb-20160916/portfile.cmake deleted file mode 100644 index 315010ba1..000000000 --- a/ports/tbb-20160916/portfile.cmake +++ /dev/null @@ -1,41 +0,0 @@ -# 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(${CMAKE_TRIPLET_FILE}) -include(vcpkg_common_functions) - -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/tbb2017_20160916oss) -vcpkg_download_distfile(ARCHIVE - URLS "https://www.threadingbuildingblocks.org/sites/default/files/software_releases/windows/tbb2017_20160916oss_win_1.zip" - FILENAME "tbb2017_20160916oss_win_1.zip" - SHA512 14bbc54aa0c4506bab6e6fdb7e9e562cbc88881cb683a8bd690e3101177e55433f25a2143e7af1ed52edacb44dc92fab354e1f2101bc13b33b3ea137def8bdd1 -) -vcpkg_extract_source_archive(${ARCHIVE}) - -# Installation -message(STATUS "Installing") -file(COPY ${SOURCE_PATH}/bin DESTINATION ${CURRENT_PACKAGES_DIR}/bin) -file(COPY ${SOURCE_PATH}/include DESTINATION ${CURRENT_PACKAGES_DIR}/include) -file(COPY ${SOURCE_PATH}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) - -# Remove artefacts for other architectures -if(VCPKG_TARGET_ARCHITECTURE STREQUAL x64) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/bin/ia32) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/lib/ia32) -else() - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/bin/intel64) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/lib/intel64) -endif() - -vcpkg_copy_pdbs() - -message(STATUS "Installing done") - -# Handle copyright -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/tbb-20160916) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/tbb-20160916/LICENSE ${CURRENT_PACKAGES_DIR}/share/tbb-20160916/copyright) diff --git a/ports/tbb/CONTROL b/ports/tbb/CONTROL new file mode 100644 index 000000000..b82b70555 --- /dev/null +++ b/ports/tbb/CONTROL @@ -0,0 +1,3 @@ +Source: tbb +Version: 20160916 +Description: Intel's Threading Building Blocks. diff --git a/ports/tbb/portfile.cmake b/ports/tbb/portfile.cmake new file mode 100644 index 000000000..315010ba1 --- /dev/null +++ b/ports/tbb/portfile.cmake @@ -0,0 +1,41 @@ +# 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(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) + +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/tbb2017_20160916oss) +vcpkg_download_distfile(ARCHIVE + URLS "https://www.threadingbuildingblocks.org/sites/default/files/software_releases/windows/tbb2017_20160916oss_win_1.zip" + FILENAME "tbb2017_20160916oss_win_1.zip" + SHA512 14bbc54aa0c4506bab6e6fdb7e9e562cbc88881cb683a8bd690e3101177e55433f25a2143e7af1ed52edacb44dc92fab354e1f2101bc13b33b3ea137def8bdd1 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +# Installation +message(STATUS "Installing") +file(COPY ${SOURCE_PATH}/bin DESTINATION ${CURRENT_PACKAGES_DIR}/bin) +file(COPY ${SOURCE_PATH}/include DESTINATION ${CURRENT_PACKAGES_DIR}/include) +file(COPY ${SOURCE_PATH}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + +# Remove artefacts for other architectures +if(VCPKG_TARGET_ARCHITECTURE STREQUAL x64) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/bin/ia32) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/lib/ia32) +else() + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/bin/intel64) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/lib/intel64) +endif() + +vcpkg_copy_pdbs() + +message(STATUS "Installing done") + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/tbb-20160916) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/tbb-20160916/LICENSE ${CURRENT_PACKAGES_DIR}/share/tbb-20160916/copyright) -- cgit v1.2.3 From cb9a50cd8767191daf08dbc4ddb26277378bd4e8 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 18 Oct 2016 17:14:54 -0700 Subject: [tbb] Correct install paths --- ports/tbb/portfile.cmake | 64 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 51 insertions(+), 13 deletions(-) diff --git a/ports/tbb/portfile.cmake b/ports/tbb/portfile.cmake index 315010ba1..80b6bff3f 100644 --- a/ports/tbb/portfile.cmake +++ b/ports/tbb/portfile.cmake @@ -19,23 +19,61 @@ vcpkg_extract_source_archive(${ARCHIVE}) # Installation message(STATUS "Installing") -file(COPY ${SOURCE_PATH}/bin DESTINATION ${CURRENT_PACKAGES_DIR}/bin) -file(COPY ${SOURCE_PATH}/include DESTINATION ${CURRENT_PACKAGES_DIR}/include) -file(COPY ${SOURCE_PATH}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) - -# Remove artefacts for other architectures -if(VCPKG_TARGET_ARCHITECTURE STREQUAL x64) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/bin/ia32) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/lib/ia32) +file(COPY + ${SOURCE_PATH}/include/tbb + ${SOURCE_PATH}/include/serial + DESTINATION ${CURRENT_PACKAGES_DIR}/include) + +if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") + set(BIN_PATH ${SOURCE_PATH}/bin/intel64/vc14) + set(LIB_PATH ${SOURCE_PATH}/lib/intel64/vc14) +elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") + set(BIN_PATH ${SOURCE_PATH}/bin/ia32/vc14) + set(LIB_PATH ${SOURCE_PATH}/lib/ia32/vc14) else() - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/bin/intel64) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/lib/intel64) + message(FATAL_ERROR "Unsupported architecture") endif() -vcpkg_copy_pdbs() +file(COPY + ${LIB_PATH}/tbb.lib + ${LIB_PATH}/tbb_preview.lib + ${LIB_PATH}/tbbmalloc.lib + ${LIB_PATH}/tbbmalloc_proxy.lib + ${LIB_PATH}/tbbproxy.lib + ${LIB_PATH}/tbbproxy.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/lib) +file(COPY + ${LIB_PATH}/tbb_debug.lib + ${LIB_PATH}/tbb_preview_debug.lib + ${LIB_PATH}/tbbmalloc_debug.lib + ${LIB_PATH}/tbbmalloc_proxy_debug.lib + ${LIB_PATH}/tbbproxy_debug.lib + ${LIB_PATH}/tbbproxy_debug.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + +file(COPY + ${BIN_PATH}/tbb.dll + ${BIN_PATH}/tbb_preview.dll + ${BIN_PATH}/tbbmalloc.dll + ${BIN_PATH}/tbbmalloc_proxy.dll + ${BIN_PATH}/tbb.pdb + ${BIN_PATH}/tbb_preview.pdb + ${BIN_PATH}/tbbmalloc.pdb + ${BIN_PATH}/tbbmalloc_proxy.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/bin) +file(COPY + ${BIN_PATH}/tbb_debug.dll + ${BIN_PATH}/tbb_preview_debug.dll + ${BIN_PATH}/tbbmalloc_debug.dll + ${BIN_PATH}/tbbmalloc_proxy_debug.dll + ${BIN_PATH}/tbb_debug.pdb + ${BIN_PATH}/tbb_preview_debug.pdb + ${BIN_PATH}/tbbmalloc_debug.pdb + ${BIN_PATH}/tbbmalloc_proxy_debug.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) message(STATUS "Installing done") # Handle copyright -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/tbb-20160916) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/tbb-20160916/LICENSE ${CURRENT_PACKAGES_DIR}/share/tbb-20160916/copyright) +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/tbb) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/tbb/LICENSE ${CURRENT_PACKAGES_DIR}/share/tbb/copyright) -- cgit v1.2.3 From 7dea245b9ce2c8d1902c3905c925e4b2f0a4d38b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 18 Oct 2016 18:25:45 -0700 Subject: [vcpkg_apply_patches] Print that patch applying failed instead of FATAL_ERROR --- scripts/cmake/vcpkg_apply_patches.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cmake/vcpkg_apply_patches.cmake b/scripts/cmake/vcpkg_apply_patches.cmake index ad906f2a9..f5d4d75f1 100644 --- a/scripts/cmake/vcpkg_apply_patches.cmake +++ b/scripts/cmake/vcpkg_apply_patches.cmake @@ -15,7 +15,7 @@ function(vcpkg_apply_patches) ) if(error_code) - message(FATAL_ERROR + message(STATUS "Applying patch failed: ${GIT} --work-tree=. apply \"${PATCH}\" --ignore-whitespace --whitespace=nowarn --verbose\n" "Working Directory: ${_ap_SOURCE_PATH}\n" "See logs for more information:\n" -- cgit v1.2.3 From 035952b2424e0115908821489495b0e8e501f83a Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Tue, 18 Oct 2016 16:09:04 -0400 Subject: added static build support to sqlite more static support more sqlite changes finally done with sqlite static --- ports/sqlite3/CMakeLists.txt | 12 ++++++++++-- ports/sqlite3/portfile.cmake | 3 ++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ports/sqlite3/CMakeLists.txt b/ports/sqlite3/CMakeLists.txt index 3afc61f4c..7dc7920e4 100644 --- a/ports/sqlite3/CMakeLists.txt +++ b/ports/sqlite3/CMakeLists.txt @@ -2,9 +2,17 @@ cmake_minimum_required(VERSION 3.0) project(sqlite3 C) include_directories(${SOURCE}) -add_library(sqlite3 SHARED ${SOURCE}/sqlite3.c) +if(BUILD_SHARED_LIBS) + set(API "-DSQLITE_API=__declspec(dllexport)") +else() + set(API "-DSQLITE_API=extern") +endif() +add_library(sqlite3 ${SOURCE}/sqlite3.c) + + target_compile_definitions(sqlite3 PRIVATE - $<$:-DSQLITE_DEBUG> "-DSQLITE_API=__declspec(dllexport)" + $<$:-DSQLITE_DEBUG> + ${API} -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_UNLOCK_NOTIFY ) diff --git a/ports/sqlite3/portfile.cmake b/ports/sqlite3/portfile.cmake index 6918a0788..ac3e6646b 100644 --- a/ports/sqlite3/portfile.cmake +++ b/ports/sqlite3/portfile.cmake @@ -1,3 +1,4 @@ +include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/sqlite-amalgamation-3150000) vcpkg_download_distfile(ARCHIVE @@ -14,7 +15,7 @@ vcpkg_configure_cmake( OPTIONS -DSOURCE=${SOURCE_PATH} ) - +vcpkg_build_cmake() vcpkg_install_cmake() file(WRITE ${CURRENT_PACKAGES_DIR}/share/sqlite3/copyright "SQLite is in the Public Domain.\nhttp://www.sqlite.org/copyright.html\n") -- cgit v1.2.3 From 2dede88deb85ef7a5f24b5e4e608069553d36a8c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 18 Oct 2016 21:20:16 -0700 Subject: [openssl] Patches to allow building when path includes spaces --- ports/openssl/CMakeLists.txt | 21 +++++++++++----- ports/openssl/ConfigureIncludeQuotesFix.patch | 13 ++++++++++ ports/openssl/PerlScriptSpaceInPathFixes.patch | 35 ++++++++++++++++++++++++++ ports/openssl/STRINGIFYPatch.patch | 23 +++++++++++++++++ ports/openssl/portfile.cmake | 7 +++++- 5 files changed, 92 insertions(+), 7 deletions(-) create mode 100644 ports/openssl/ConfigureIncludeQuotesFix.patch create mode 100644 ports/openssl/PerlScriptSpaceInPathFixes.patch create mode 100644 ports/openssl/STRINGIFYPatch.patch diff --git a/ports/openssl/CMakeLists.txt b/ports/openssl/CMakeLists.txt index ff034bb9a..4ec875968 100644 --- a/ports/openssl/CMakeLists.txt +++ b/ports/openssl/CMakeLists.txt @@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.0) project(openssl NONE) include(vcpkg_execute_required_process) +include(vcpkg_apply_patches) +set(SOURCE_PATH ${CMAKE_CURRENT_BINARY_DIR}/openssl-1.0.2h) find_package(ZLIB REQUIRED) find_program(PERL perl) @@ -9,18 +11,25 @@ find_program(NMAKE nmake) message(STATUS "Extracting source ${OPENSSL_SOURCE_ARCHIVE}") vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} -E tar xjf ${OPENSSL_SOURCE_ARCHIVE} + COMMAND ${CMAKE_COMMAND} -E tar xjf "${OPENSSL_SOURCE_ARCHIVE}" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} LOGNAME extract-${TARGET_TRIPLET}-rel ) +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES ${CMAKE_CURRENT_LIST_DIR}/PerlScriptSpaceInPathFixes.patch + ${CMAKE_CURRENT_LIST_DIR}/ConfigureIncludeQuotesFix.patch + ${CMAKE_CURRENT_LIST_DIR}/STRINGIFYPatch.patch +) + set(CONFIGURE_COMMAND ${PERL} Configure no-idea no-mdc2 no-rc5 no-asm zlib-dynamic - --with-zlib-include=${ZLIB_INCLUDE_DIRS} + "--with-zlib-include=${ZLIB_INCLUDE_DIRS}" ) if(TARGET_TRIPLET MATCHES "x86-windows") @@ -38,15 +47,15 @@ if(CMAKE_BUILD_TYPE MATCHES "Debug") list(GET ZLIB_LIBRARIES -1 ZLIB_DEBUG_LIBRARY) list(APPEND CONFIGURE_COMMAND debug-${OPENSSL_ARCH} - --openssldir=${OPENSSLDIR} - --with-zlib-lib=${ZLIB_DEBUG_LIBRARY} + "--openssldir=${OPENSSLDIR}" + "--with-zlib-lib=${ZLIB_DEBUG_LIBRARY}" ) else() set(OPENSSLDIR ${CURRENT_PACKAGES_DIR}) list(APPEND CONFIGURE_COMMAND ${OPENSSL_ARCH} - --openssldir=${OPENSSLDIR} - --with-zlib-lib=${ZLIB_LIBRARIES} + "--openssldir=${OPENSSLDIR}" + "--with-zlib-lib=${ZLIB_LIBRARIES}" ) endif() diff --git a/ports/openssl/ConfigureIncludeQuotesFix.patch b/ports/openssl/ConfigureIncludeQuotesFix.patch new file mode 100644 index 000000000..1689ec4e0 --- /dev/null +++ b/ports/openssl/ConfigureIncludeQuotesFix.patch @@ -0,0 +1,13 @@ +diff --git a/Configure b/Configure +index c98107a..77ad9d3 100644 +--- a/Configure ++++ b/Configure +@@ -970,7 +970,7 @@ PROCESS_ARGS: + } + elsif (/^--with-zlib-include=(.*)$/) + { +- $withargs{"zlib-include"}="-I$1"; ++ $withargs{"zlib-include"}="-I\"$1\""; + } + elsif (/^--with-fipsdir=(.*)$/) + { diff --git a/ports/openssl/PerlScriptSpaceInPathFixes.patch b/ports/openssl/PerlScriptSpaceInPathFixes.patch new file mode 100644 index 000000000..b3a52fc97 --- /dev/null +++ b/ports/openssl/PerlScriptSpaceInPathFixes.patch @@ -0,0 +1,35 @@ +diff --git a/util/copy.pl b/util/copy.pl +index eba6d58..5d971a2 100644 +--- a/util/copy.pl ++++ b/util/copy.pl +@@ -19,7 +19,7 @@ foreach $arg (@ARGV) { + next; + } + $arg =~ s|\\|/|g; # compensate for bug/feature in cygwin glob... +- foreach (glob $arg) ++ foreach (glob "\"$arg\"") + { + push @filelist, $_; + } +diff --git a/util/mk1mf.pl b/util/mk1mf.pl +index 128a405..fd853da 100644 +--- a/util/mk1mf.pl ++++ b/util/mk1mf.pl +@@ -427,7 +427,7 @@ EOF + { + $extra_install .= <<"EOF" + \$(MKDIR) \"\$(INSTALLTOP)${o}lib${o}engines\" +- \$(CP) \"\$(E_SHLIB)\" \"\$(INSTALLTOP)${o}lib${o}engines\" ++ \$(CP) \$(E_SHLIB) \"\$(INSTALLTOP)${o}lib${o}engines\" + EOF + } + } +@@ -607,7 +607,7 @@ install: all + \$(MKDIR) \"\$(INSTALLTOP)${o}include${o}openssl\" + \$(MKDIR) \"\$(INSTALLTOP)${o}lib\" + \$(CP) \"\$(INCO_D)${o}*.\[ch\]\" \"\$(INSTALLTOP)${o}include${o}openssl\" +- \$(CP) \"\$(BIN_D)$o\$(E_EXE)$exep \$(INSTALLTOP)${o}bin\" ++ \$(CP) \"\$(BIN_D)$o\$(E_EXE)$exep\" \"\$(INSTALLTOP)${o}bin\" + \$(MKDIR) \"\$(OPENSSLDIR)\" + \$(CP) apps${o}openssl.cnf \"\$(OPENSSLDIR)\" + $extra_install diff --git a/ports/openssl/STRINGIFYPatch.patch b/ports/openssl/STRINGIFYPatch.patch new file mode 100644 index 000000000..dd8f9c297 --- /dev/null +++ b/ports/openssl/STRINGIFYPatch.patch @@ -0,0 +1,23 @@ +diff --git a/crypto/cversion.c b/crypto/cversion.c +index bfff699..17b7912 100644 +--- a/crypto/cversion.c ++++ b/crypto/cversion.c +@@ -56,6 +56,9 @@ + * [including the GNU Public Licence.] + */ + ++#define STRINGIFY2(x) #x ++#define STRINGIFY(x) STRINGIFY2(x) ++ + #include "cryptlib.h" + + #ifndef NO_WINDOWS_BRAINDEATH +@@ -79,7 +82,7 @@ const char *SSLeay_version(int t) + } + if (t == SSLEAY_CFLAGS) { + #ifdef CFLAGS +- return (CFLAGS); ++ return STRINGIFY(CFLAGS); + #else + return ("compiler: information not available"); + #endif diff --git a/ports/openssl/portfile.cmake b/ports/openssl/portfile.cmake index 9f45f0ce4..b6085cada 100644 --- a/ports/openssl/portfile.cmake +++ b/ports/openssl/portfile.cmake @@ -12,7 +12,12 @@ vcpkg_download_distfile(OPENSSL_SOURCE_ARCHIVE SHA512 780601f6f3f32f42b6d7bbc4c593db39a3575f9db80294a10a68b2b0bb79448d9bd529ca700b9977354cbdfc65887c76af0aa7b90d3ee421f74ab53e6f15c303 ) -file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +file(COPY +${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt +${CMAKE_CURRENT_LIST_DIR}/PerlScriptSpaceInPathFixes.patch +${CMAKE_CURRENT_LIST_DIR}/ConfigureIncludeQuotesFix.patch +${CMAKE_CURRENT_LIST_DIR}/STRINGIFYPatch.patch +DESTINATION ${SOURCE_PATH}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} -- cgit v1.2.3 From 284d50c186dceb788a32e74e486521d7e2bbb1f6 Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Wed, 19 Oct 2016 00:37:33 -0400 Subject: added a config file for sqlite --- ports/sqlite3/CMakeLists.txt | 4 +++- ports/sqlite3/portfile.cmake | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ports/sqlite3/CMakeLists.txt b/ports/sqlite3/CMakeLists.txt index 7dc7920e4..8c1e7e787 100644 --- a/ports/sqlite3/CMakeLists.txt +++ b/ports/sqlite3/CMakeLists.txt @@ -16,13 +16,15 @@ target_compile_definitions(sqlite3 PRIVATE -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_UNLOCK_NOTIFY ) +target_include_directories(sqlite3 INTERFACE $:include>) if(TRIPLET_SYSTEM_NAME MATCHES "WindowsStore") target_compile_definitions(sqlite3 PRIVATE -DSQLITE_OS_WINRT=1) endif() -install(TARGETS sqlite3 +install(TARGETS sqlite3 EXPORT sqlite3Config RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib ) install(FILES ${SOURCE}/sqlite3.h ${SOURCE}/sqlite3ext.h DESTINATION include CONFIGURATIONS Release) +install(EXPORT sqlite3Config DESTINATION share/sqlite3) \ No newline at end of file diff --git a/ports/sqlite3/portfile.cmake b/ports/sqlite3/portfile.cmake index ac3e6646b..a7999b68c 100644 --- a/ports/sqlite3/portfile.cmake +++ b/ports/sqlite3/portfile.cmake @@ -18,5 +18,11 @@ vcpkg_configure_cmake( vcpkg_build_cmake() vcpkg_install_cmake() +file(READ ${CURRENT_PACKAGES_DIR}/debug/share/sqlite3/sqlite3Config-debug.cmake SQLITE3_DEBUG_CONFIG) +string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" SQLITE3_DEBUG_CONFIG "${SQLITE3_DEBUG_CONFIG}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/sqlite3/sqlite3Config-debug.cmake "${SQLITE3_DEBUG_CONFIG}") + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + file(WRITE ${CURRENT_PACKAGES_DIR}/share/sqlite3/copyright "SQLite is in the Public Domain.\nhttp://www.sqlite.org/copyright.html\n") vcpkg_copy_pdbs() -- cgit v1.2.3 From 2dad2a8b94d5cad2354794eefaffaea3928dec1f Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Wed, 19 Oct 2016 00:42:21 -0400 Subject: fixed typo in sqlite3 config file --- ports/sqlite3/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/sqlite3/CMakeLists.txt b/ports/sqlite3/CMakeLists.txt index 8c1e7e787..760684493 100644 --- a/ports/sqlite3/CMakeLists.txt +++ b/ports/sqlite3/CMakeLists.txt @@ -16,7 +16,7 @@ target_compile_definitions(sqlite3 PRIVATE -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_UNLOCK_NOTIFY ) -target_include_directories(sqlite3 INTERFACE $:include>) +target_include_directories(sqlite3 INTERFACE $) if(TRIPLET_SYSTEM_NAME MATCHES "WindowsStore") target_compile_definitions(sqlite3 PRIVATE -DSQLITE_OS_WINRT=1) endif() -- cgit v1.2.3 From 413dcf6b917ee9d2893946ed0253917746f969af Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Tue, 18 Oct 2016 14:34:02 -0400 Subject: add odb --- ports/libodb-sqlite/CONTROL | 4 +++ ports/libodb-sqlite/portfile.cmake | 28 +++++++++++++++++++++ ports/libodb/CONTROL | 3 +++ ports/libodb/portfile.cmake | 50 ++++++++++++++++++++++++++++++++++++++ ports/odb/CONTROL | 3 +++ ports/odb/portfile.cmake | 22 +++++++++++++++++ 6 files changed, 110 insertions(+) create mode 100644 ports/libodb-sqlite/CONTROL create mode 100644 ports/libodb-sqlite/portfile.cmake create mode 100644 ports/libodb/CONTROL create mode 100644 ports/libodb/portfile.cmake create mode 100644 ports/odb/CONTROL create mode 100644 ports/odb/portfile.cmake diff --git a/ports/libodb-sqlite/CONTROL b/ports/libodb-sqlite/CONTROL new file mode 100644 index 000000000..03b8ec2f3 --- /dev/null +++ b/ports/libodb-sqlite/CONTROL @@ -0,0 +1,4 @@ +Source: libodb-sqlite +Version: +Description: +Build-Depends: libodb, sqlite3 diff --git a/ports/libodb-sqlite/portfile.cmake b/ports/libodb-sqlite/portfile.cmake new file mode 100644 index 000000000..3c8876c29 --- /dev/null +++ b/ports/libodb-sqlite/portfile.cmake @@ -0,0 +1,28 @@ +# 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(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libodb-sqlite-2.4.0) +vcpkg_download_distfile(ARCHIVE + URLS "http://www.codesynthesis.com/download/odb/2.4/libodb-sqlite-2.4.0.tar.gz" + FILENAME "libodb-sqlite-2.4.0.tar.gz" + SHA512 af16da7c82cf8845ca3b393fbd8957a92b05ebc925a5191f20d414ab558345850073cd9c46457d0ef0edfb12ebcb27f267b934c9c69ef598380242fe920c8577 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_execute_required_process(COMMAND devenv libodb-sqlite-vc12.sln /upgrade WORKING_DIRECTORY ${SOURCE_PATH} LOGNAME devenv_upgrade.log) +set(ENV{INCLUDE} "$ENV{INCLUDE};${CURRENT_INSTALLED_DIR}/include") +set(ENV{LIB} "$ENV{LIB};${CURRENT_INSTALLED_DIR}/lib;${CURRENT_INSTALLED_DIR}/debug/lib") +if(${TRIPLET_SYSTEM_ARCH} STREQUAL "x86") + set(MSBUILD_PLATFORM "Win32") +else() + set(MSBUILD_PLATFORM "x64") +endif() +vcpkg_build_msbuild(PROJECT_PATH "${SOURCE_PATH}\\libodb-sqlite-vc12.sln" PLATFORM ${MSBUILD_PLATFORM} + OPTIONS "/p:useenv=true") diff --git a/ports/libodb/CONTROL b/ports/libodb/CONTROL new file mode 100644 index 000000000..f9645d098 --- /dev/null +++ b/ports/libodb/CONTROL @@ -0,0 +1,3 @@ +Source: libodb +Version: 2.4.0 +Description: ODB library, base runtime for the ODB ORM solution diff --git a/ports/libodb/portfile.cmake b/ports/libodb/portfile.cmake new file mode 100644 index 000000000..fdb5f9467 --- /dev/null +++ b/ports/libodb/portfile.cmake @@ -0,0 +1,50 @@ +# 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(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libodb-2.4.0) +vcpkg_download_distfile(ARCHIVE + URLS "http://www.codesynthesis.com/download/odb/2.4/libodb-2.4.0.tar.gz" + FILENAME "libodb-2.4.0.tar.gz" + SHA512 f1311458634695eb6ba307ebfd492e3b260e7beb06db1c5c46df58c339756be4006322cdc4e42d055bf5b2ad14ce4656ddcafcc4e16c282034db8a77d255c3eb +) +vcpkg_extract_source_archive(${ARCHIVE}) +vcpkg_execute_required_process(COMMAND devenv libodb-vc12.sln /upgrade WORKING_DIRECTORY ${SOURCE_PATH} LOGNAME devenv_upgrade.log) +if(${TRIPLET_SYSTEM_ARCH} STREQUAL "x86") + set(MSBUILD_PLATFORM "Win32") +else() + set(MSBUILD_PLATFORM "x64") +endif() +vcpkg_build_msbuild(PROJECT_PATH "${SOURCE_PATH}\\libodb-vc12.sln" PLATFORM ${MSBUILD_PLATFORM}) + +if(${TRIPLET_SYSTEM_ARCH} STREQUAL "x86") +file(INSTALL ${SOURCE_PATH}/bin/odb-2.4-vc12.dll DESTINATION ${CURRENT_PACKAGES_DIR}/bin/odb-2.4-vc14.dll) +file(INSTALL ${SOURCE_PATH}/bin/odb-2.4-vc12.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/bin/odb-2.4-vc14.pdb) +file(INSTALL ${SOURCE_PATH}/bin/odb-d-2.4-vc12.dll DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin/odb-2.4-vc14.dll) +file(INSTALL ${SOURCE_PATH}/bin/odb-d-2.4-vc12.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin/odb-d-2.4-vc14.pdb) +file(INSTALL ${SOURCE_PATH}/lib/odb.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) +file(INSTALL ${SOURCE_PATH}/lib/odb-d.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) +elseif(${TRIPLET_SYSTEM_ARCH} STREQUAL "x64") +file(INSTALL ${SOURCE_PATH}/bin64/odb-2.4-vc12.dll DESTINATION ${CURRENT_PACKAGES_DIR}/bin/odb-2.4-vc14.dll) +file(INSTALL ${SOURCE_PATH}/bin64/odb-2.4-vc12.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/bin/odb-2.4-vc14.pdb) +file(INSTALL ${SOURCE_PATH}/bin64/odb-d-2.4-vc12.dll DESTINATION ${CURRENT_PACKAGES_DIR}/bin/odb-2.4-vc14.dll) +file(INSTALL ${SOURCE_PATH}/bin64/odb-d-2.4-vc12.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/bin/odb-d-2.4-vc14.pdb) +file(INSTALL ${SOURCE_PATH}/lib64/odb.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) +file(INSTALL ${SOURCE_PATH}/lib64/odb-d.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) +endif() + +#file(GLOB_RECURSE INCLUDE_FILES LIST_DIRECTORIES false RELATIVE ${SOURCE_DIR}) +file(INSTALL ${SOURCE_PATH}/odb DESTINATION ${CURRENT_PACKAGES_DIR}/include FILES_MATCHING + PATTERN "*.h" + PATTERN "*.hxx" + PATTERN "*.ixx" + PATTERN "*.txx") +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libodb) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/libodb/LICENSE ${CURRENT_PACKAGES_DIR}/share/libodb/copyright) diff --git a/ports/odb/CONTROL b/ports/odb/CONTROL new file mode 100644 index 000000000..3806377c0 --- /dev/null +++ b/ports/odb/CONTROL @@ -0,0 +1,3 @@ +Source: odb +Version: +Description: diff --git a/ports/odb/portfile.cmake b/ports/odb/portfile.cmake new file mode 100644 index 000000000..28325eacb --- /dev/null +++ b/ports/odb/portfile.cmake @@ -0,0 +1,22 @@ +# 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(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/odb-2.4.0) +vcpkg_download_distfile(TOOL_ARCHIVE_FILE + URLS "http://www.codesynthesis.com/download/odb/2.4/odb-2.4.0-i686-windows.zip" + FILENAME "odb-2.4.0.zip" +) +vcpkg_extract_source_archive(${TOOL_ARCHIVE_FILE}) + + + +# Handle copyright +#file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/odb) +#file(RENAME ${CURRENT_PACKAGES_DIR}/share/odb/LICENSE ${CURRENT_PACKAGES_DIR}/share/odb/copyright) -- cgit v1.2.3 From f6fcd77e21215133ded2c3b6e7559d99ffcb70e4 Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Tue, 18 Oct 2016 17:57:53 -0400 Subject: cmake port for libodb --- ports/libodb-sqlite/portfile.cmake | 3 +++ ports/libodb/CMakeLists.txt | 34 ++++++++++++++++++++++++++++++++++ ports/libodb/portfile.cmake | 36 ++++++------------------------------ 3 files changed, 43 insertions(+), 30 deletions(-) create mode 100644 ports/libodb/CMakeLists.txt diff --git a/ports/libodb-sqlite/portfile.cmake b/ports/libodb-sqlite/portfile.cmake index 3c8876c29..2a471a034 100644 --- a/ports/libodb-sqlite/portfile.cmake +++ b/ports/libodb-sqlite/portfile.cmake @@ -26,3 +26,6 @@ else() endif() vcpkg_build_msbuild(PROJECT_PATH "${SOURCE_PATH}\\libodb-sqlite-vc12.sln" PLATFORM ${MSBUILD_PLATFORM} OPTIONS "/p:useenv=true") + +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libodb) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/libodb/LICENSE ${CURRENT_PACKAGES_DIR}/share/libodb/copyright) \ No newline at end of file diff --git a/ports/libodb/CMakeLists.txt b/ports/libodb/CMakeLists.txt new file mode 100644 index 000000000..d5d14baa2 --- /dev/null +++ b/ports/libodb/CMakeLists.txt @@ -0,0 +1,34 @@ +cmake_minimum_required(VERSION 3.0) +project(libodb VERSION 2.4.0 LANGUAGES CXX) +set(LIBODB_INSTALL_HEADERS:BOOL CACHE OFF) +file(GLOB_RECURSE libodb_src LIST_DIRECTORIES False + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + *.cxx) +list(FILTER libodb_src EXCLUDE REGEX /posix/.*) +add_library(libodb ${libodb_src}) +target_include_directories(libodb + PUBLIC $ +) +if(BUILD_SHARED_LIBS) + target_compile_definitions(libodb PRIVATE + -DLIBODB_DYNAMIC_LIB) +else() + target_compile_definitions(libodb PRIVATE + -DLIBODB_STATIC_LIB) +endif() +install(TARGETS libodb EXPORT libodbConfig + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) +if(LIBODB_INSTALL_HEADERS) +install(DIRECTORY odb DESTINATION include/ + FILES_MATCHING + PATTERN "*.h" + PATTERN "*.hxx" + PATTERN "*.ixx" + PATTERN "*.txx" +) +endif() +install(EXPORT libodbConfig DESTINATION share/libodb) +export(TARGETS libodb NAMESPACE libodb FILE libodbConfig.cmake) diff --git a/ports/libodb/portfile.cmake b/ports/libodb/portfile.cmake index fdb5f9467..b389d6ff0 100644 --- a/ports/libodb/portfile.cmake +++ b/ports/libodb/portfile.cmake @@ -15,36 +15,12 @@ vcpkg_download_distfile(ARCHIVE SHA512 f1311458634695eb6ba307ebfd492e3b260e7beb06db1c5c46df58c339756be4006322cdc4e42d055bf5b2ad14ce4656ddcafcc4e16c282034db8a77d255c3eb ) vcpkg_extract_source_archive(${ARCHIVE}) -vcpkg_execute_required_process(COMMAND devenv libodb-vc12.sln /upgrade WORKING_DIRECTORY ${SOURCE_PATH} LOGNAME devenv_upgrade.log) -if(${TRIPLET_SYSTEM_ARCH} STREQUAL "x86") - set(MSBUILD_PLATFORM "Win32") -else() - set(MSBUILD_PLATFORM "x64") -endif() -vcpkg_build_msbuild(PROJECT_PATH "${SOURCE_PATH}\\libodb-vc12.sln" PLATFORM ${MSBUILD_PLATFORM}) - -if(${TRIPLET_SYSTEM_ARCH} STREQUAL "x86") -file(INSTALL ${SOURCE_PATH}/bin/odb-2.4-vc12.dll DESTINATION ${CURRENT_PACKAGES_DIR}/bin/odb-2.4-vc14.dll) -file(INSTALL ${SOURCE_PATH}/bin/odb-2.4-vc12.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/bin/odb-2.4-vc14.pdb) -file(INSTALL ${SOURCE_PATH}/bin/odb-d-2.4-vc12.dll DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin/odb-2.4-vc14.dll) -file(INSTALL ${SOURCE_PATH}/bin/odb-d-2.4-vc12.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin/odb-d-2.4-vc14.pdb) -file(INSTALL ${SOURCE_PATH}/lib/odb.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) -file(INSTALL ${SOURCE_PATH}/lib/odb-d.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) -elseif(${TRIPLET_SYSTEM_ARCH} STREQUAL "x64") -file(INSTALL ${SOURCE_PATH}/bin64/odb-2.4-vc12.dll DESTINATION ${CURRENT_PACKAGES_DIR}/bin/odb-2.4-vc14.dll) -file(INSTALL ${SOURCE_PATH}/bin64/odb-2.4-vc12.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/bin/odb-2.4-vc14.pdb) -file(INSTALL ${SOURCE_PATH}/bin64/odb-d-2.4-vc12.dll DESTINATION ${CURRENT_PACKAGES_DIR}/bin/odb-2.4-vc14.dll) -file(INSTALL ${SOURCE_PATH}/bin64/odb-d-2.4-vc12.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/bin/odb-d-2.4-vc14.pdb) -file(INSTALL ${SOURCE_PATH}/lib64/odb.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) -file(INSTALL ${SOURCE_PATH}/lib64/odb-d.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) -endif() - -#file(GLOB_RECURSE INCLUDE_FILES LIST_DIRECTORIES false RELATIVE ${SOURCE_DIR}) -file(INSTALL ${SOURCE_PATH}/odb DESTINATION ${CURRENT_PACKAGES_DIR}/include FILES_MATCHING - PATTERN "*.h" - PATTERN "*.hxx" - PATTERN "*.ixx" - PATTERN "*.txx") +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS_DEBUG + -DLIBODB_INSTALL_HEADERS=OFF +) # Handle copyright file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libodb) file(RENAME ${CURRENT_PACKAGES_DIR}/share/libodb/LICENSE ${CURRENT_PACKAGES_DIR}/share/libodb/copyright) -- cgit v1.2.3 From cc6fdbeb8baf7882fc701c9778e9b2f8ba6afd4c Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Tue, 18 Oct 2016 19:53:43 -0400 Subject: more work on libodb --- ports/libodb-sqlite/CMakeLists.txt | 43 ++++++++++++++++++++++++++++++++++++++ ports/libodb-sqlite/portfile.cmake | 18 +++++++--------- ports/libodb/CMakeLists.txt | 11 ++++++---- ports/libodb/portfile.cmake | 8 +++++++ 4 files changed, 66 insertions(+), 14 deletions(-) create mode 100644 ports/libodb-sqlite/CMakeLists.txt diff --git a/ports/libodb-sqlite/CMakeLists.txt b/ports/libodb-sqlite/CMakeLists.txt new file mode 100644 index 000000000..89b99f529 --- /dev/null +++ b/ports/libodb-sqlite/CMakeLists.txt @@ -0,0 +1,43 @@ +cmake_minimum_required(VERSION 3.0) +project(libodb-sqlite VERSION 2.4.0 LANGUAGES CXX) +find_package(libodb REQUIRED VERSION 2.4.0) +set(LIBODB_INSTALL_HEADERS ON CACHE BOOL "Install the header files (a debug install)") +file(GLOB_RECURSE libodb_src LIST_DIRECTORIES False + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + *.cxx) +list(FILTER libodb_src EXCLUDE REGEX /posix/.*) +add_library(sqlite ${libodb_src}) +target_include_directories(sqlite + PUBLIC + $ + $ + +) +target_link_libraries(sqlite libodb::libodb) +if(BUILD_SHARED_LIBS) + target_compile_definitions(sqlite PRIVATE + -DLIBODB_SQLITE_DYNAMIC_LIB + -DLIBODB_SQLITE_HAVE_UNLOCK_NOTIFY) +else() + target_compile_definitions(sqlite PRIVATE + -DLIBODB_SQLITE_STATIC_LIB + -DLIBODB_SQLITE_HAVE_UNLOCK_NOTIFY) +endif() +install(TARGETS sqlite EXPORT libodb_sqliteConfig + COMPONENT sqlite + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) +if(LIBODB_INSTALL_HEADERS) +install(DIRECTORY odb DESTINATION include/ + COMPONENT sqlite + FILES_MATCHING + PATTERN "*.h" + PATTERN "*.hxx" + PATTERN "*.ixx" + PATTERN "*.txx" +) +endif() +install(EXPORT libodb_sqliteConfig DESTINATION share/libodb) +export(TARGETS sqlite NAMESPACE libodb FILE libodb_sqliteConfig.cmake) diff --git a/ports/libodb-sqlite/portfile.cmake b/ports/libodb-sqlite/portfile.cmake index 2a471a034..0c536066a 100644 --- a/ports/libodb-sqlite/portfile.cmake +++ b/ports/libodb-sqlite/portfile.cmake @@ -16,16 +16,14 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) -vcpkg_execute_required_process(COMMAND devenv libodb-sqlite-vc12.sln /upgrade WORKING_DIRECTORY ${SOURCE_PATH} LOGNAME devenv_upgrade.log) -set(ENV{INCLUDE} "$ENV{INCLUDE};${CURRENT_INSTALLED_DIR}/include") -set(ENV{LIB} "$ENV{LIB};${CURRENT_INSTALLED_DIR}/lib;${CURRENT_INSTALLED_DIR}/debug/lib") -if(${TRIPLET_SYSTEM_ARCH} STREQUAL "x86") - set(MSBUILD_PLATFORM "Win32") -else() - set(MSBUILD_PLATFORM "x64") -endif() -vcpkg_build_msbuild(PROJECT_PATH "${SOURCE_PATH}\\libodb-sqlite-vc12.sln" PLATFORM ${MSBUILD_PLATFORM} - OPTIONS "/p:useenv=true") +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS_DEBUG + -DLIBODB_INSTALL_HEADERS=OFF +) +vcpkg_build_cmake() +vcpkg_install_cmake() file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libodb) file(RENAME ${CURRENT_PACKAGES_DIR}/share/libodb/LICENSE ${CURRENT_PACKAGES_DIR}/share/libodb/copyright) \ No newline at end of file diff --git a/ports/libodb/CMakeLists.txt b/ports/libodb/CMakeLists.txt index d5d14baa2..0d13ecefd 100644 --- a/ports/libodb/CMakeLists.txt +++ b/ports/libodb/CMakeLists.txt @@ -1,13 +1,16 @@ cmake_minimum_required(VERSION 3.0) project(libodb VERSION 2.4.0 LANGUAGES CXX) -set(LIBODB_INSTALL_HEADERS:BOOL CACHE OFF) +set(LIBODB_INSTALL_HEADERS ON CACHE BOOL "Install the header files (a debug install)") file(GLOB_RECURSE libodb_src LIST_DIRECTORIES False RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cxx) list(FILTER libodb_src EXCLUDE REGEX /posix/.*) add_library(libodb ${libodb_src}) target_include_directories(libodb - PUBLIC $ + PUBLIC + $ + $ + ) if(BUILD_SHARED_LIBS) target_compile_definitions(libodb PRIVATE @@ -30,5 +33,5 @@ install(DIRECTORY odb DESTINATION include/ PATTERN "*.txx" ) endif() -install(EXPORT libodbConfig DESTINATION share/libodb) -export(TARGETS libodb NAMESPACE libodb FILE libodbConfig.cmake) +install(EXPORT libodbConfig NAMESPACE libodb:: DESTINATION share/libodb) +export(TARGETS libodb NAMESPACE libodb:: FILE libodbConfig.cmake) diff --git a/ports/libodb/portfile.cmake b/ports/libodb/portfile.cmake index b389d6ff0..493bcc438 100644 --- a/ports/libodb/portfile.cmake +++ b/ports/libodb/portfile.cmake @@ -21,6 +21,14 @@ vcpkg_configure_cmake( OPTIONS_DEBUG -DLIBODB_INSTALL_HEADERS=OFF ) +vcpkg_build_cmake() +vcpkg_install_cmake() +file(READ ${CURRENT_PACKAGES_DIR}/debug/share/libodb/libodbConfig-debug.cmake LIBODB_DEBUG_TARGETS) +string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" LIBODB_DEBUG_TARGETS "${LIBODB_DEBUG_TARGETS}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/libodb/libodbConfig-debug.cmake "${LIBODB_DEBUG_TARGETS}") +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) # Handle copyright file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libodb) file(RENAME ${CURRENT_PACKAGES_DIR}/share/libodb/LICENSE ${CURRENT_PACKAGES_DIR}/share/libodb/copyright) + +vcpkg_copy_pdbs() -- cgit v1.2.3 From c879ba6d362876be57bdb378ce4d0a9de64fc6c2 Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Wed, 19 Oct 2016 00:30:28 -0400 Subject: add overall odb config --- ports/libodb-sqlite/CMakeLists.txt | 12 +++++++----- ports/libodb-sqlite/CONTROL | 4 ++-- ports/libodb/CMakeLists.txt | 8 +++++--- ports/libodb/odbConfig.cmake | 10 ++++++++++ ports/libodb/portfile.cmake | 10 ++++++++-- 5 files changed, 32 insertions(+), 12 deletions(-) create mode 100644 ports/libodb/odbConfig.cmake diff --git a/ports/libodb-sqlite/CMakeLists.txt b/ports/libodb-sqlite/CMakeLists.txt index 89b99f529..44f368537 100644 --- a/ports/libodb-sqlite/CMakeLists.txt +++ b/ports/libodb-sqlite/CMakeLists.txt @@ -1,6 +1,7 @@ cmake_minimum_required(VERSION 3.0) project(libodb-sqlite VERSION 2.4.0 LANGUAGES CXX) -find_package(libodb REQUIRED VERSION 2.4.0) +find_package(odb 2.4.0 REQUIRED COMPONENTS libodb) +find_library(SQLITE3_LIBRARY names sqlite sqlite3) set(LIBODB_INSTALL_HEADERS ON CACHE BOOL "Install the header files (a debug install)") file(GLOB_RECURSE libodb_src LIST_DIRECTORIES False RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} @@ -13,7 +14,8 @@ target_include_directories(sqlite $ ) -target_link_libraries(sqlite libodb::libodb) + +target_link_libraries(sqlite PRIVATE odb::libodb ${SQLITE3_LIBRARY}) if(BUILD_SHARED_LIBS) target_compile_definitions(sqlite PRIVATE -DLIBODB_SQLITE_DYNAMIC_LIB @@ -23,7 +25,7 @@ else() -DLIBODB_SQLITE_STATIC_LIB -DLIBODB_SQLITE_HAVE_UNLOCK_NOTIFY) endif() -install(TARGETS sqlite EXPORT libodb_sqliteConfig +install(TARGETS sqlite EXPORT odb_sqliteConfig COMPONENT sqlite ARCHIVE DESTINATION lib LIBRARY DESTINATION lib @@ -39,5 +41,5 @@ install(DIRECTORY odb DESTINATION include/ PATTERN "*.txx" ) endif() -install(EXPORT libodb_sqliteConfig DESTINATION share/libodb) -export(TARGETS sqlite NAMESPACE libodb FILE libodb_sqliteConfig.cmake) +install(EXPORT odb_sqliteConfig NAMESPACE odb:: COMPONENT sqlite DESTINATION share/odb) +export(TARGETS sqlite NAMESPACE odb:: FILE odb_sqliteConfig.cmake) diff --git a/ports/libodb-sqlite/CONTROL b/ports/libodb-sqlite/CONTROL index 03b8ec2f3..5a87fb847 100644 --- a/ports/libodb-sqlite/CONTROL +++ b/ports/libodb-sqlite/CONTROL @@ -1,4 +1,4 @@ Source: libodb-sqlite -Version: -Description: +Version: 2.4.0 +Description: Sqlite support for the ODB ORM library Build-Depends: libodb, sqlite3 diff --git a/ports/libodb/CMakeLists.txt b/ports/libodb/CMakeLists.txt index 0d13ecefd..b4aef5817 100644 --- a/ports/libodb/CMakeLists.txt +++ b/ports/libodb/CMakeLists.txt @@ -19,13 +19,15 @@ else() target_compile_definitions(libodb PRIVATE -DLIBODB_STATIC_LIB) endif() -install(TARGETS libodb EXPORT libodbConfig +install(TARGETS libodb EXPORT odb_libodbConfig + COMPONENT libodb ARCHIVE DESTINATION lib LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) if(LIBODB_INSTALL_HEADERS) install(DIRECTORY odb DESTINATION include/ + COMPONENT libodb FILES_MATCHING PATTERN "*.h" PATTERN "*.hxx" @@ -33,5 +35,5 @@ install(DIRECTORY odb DESTINATION include/ PATTERN "*.txx" ) endif() -install(EXPORT libodbConfig NAMESPACE libodb:: DESTINATION share/libodb) -export(TARGETS libodb NAMESPACE libodb:: FILE libodbConfig.cmake) +install(EXPORT odb_libodbConfig NAMESPACE odb:: COMPONENT libodb DESTINATION share/odb) +export(TARGETS libodb NAMESPACE odb:: FILE odb_libodbConfig.cmake) diff --git a/ports/libodb/odbConfig.cmake b/ports/libodb/odbConfig.cmake new file mode 100644 index 000000000..21631fadf --- /dev/null +++ b/ports/libodb/odbConfig.cmake @@ -0,0 +1,10 @@ +set(_supported_components libodb sqlite) + +foreach(_comp ${odb_FIND_COMPONENTS}) + if(NOT ";${_supported_components};" MATCHES _comp) + set(odb_FOUND False) + set(odb_NOTFOUND_MESSAGE "Unsupported component: ${_comp}") + endif() + include("${CMAKE_CURRENT_LIST_DIR}/odb_${_comp}Config.cmake") +endforeach() +set(odb_FOUND True) \ No newline at end of file diff --git a/ports/libodb/portfile.cmake b/ports/libodb/portfile.cmake index 493bcc438..770cc0948 100644 --- a/ports/libodb/portfile.cmake +++ b/ports/libodb/portfile.cmake @@ -8,6 +8,7 @@ include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) +include(CMakePackageConfigHelpers) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libodb-2.4.0) vcpkg_download_distfile(ARCHIVE URLS "http://www.codesynthesis.com/download/odb/2.4/libodb-2.4.0.tar.gz" @@ -23,10 +24,15 @@ vcpkg_configure_cmake( ) vcpkg_build_cmake() vcpkg_install_cmake() -file(READ ${CURRENT_PACKAGES_DIR}/debug/share/libodb/libodbConfig-debug.cmake LIBODB_DEBUG_TARGETS) +file(READ ${CURRENT_PACKAGES_DIR}/debug/share/odb/odb_libodbConfig-debug.cmake LIBODB_DEBUG_TARGETS) string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" LIBODB_DEBUG_TARGETS "${LIBODB_DEBUG_TARGETS}") -file(WRITE ${CURRENT_PACKAGES_DIR}/share/libodb/libodbConfig-debug.cmake "${LIBODB_DEBUG_TARGETS}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/odb/odb_libodbConfig-debug.cmake "${LIBODB_DEBUG_TARGETS}") file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/odbConfig.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/odb) +write_basic_package_version_file(${CURRENT_PACKAGES_DIR}/share/odb/odbConfigVersion.cmake + VERSION 2.4.0 + COMPATIBILITY SameMajorVersion +) # Handle copyright file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libodb) file(RENAME ${CURRENT_PACKAGES_DIR}/share/libodb/LICENSE ${CURRENT_PACKAGES_DIR}/share/libodb/copyright) -- cgit v1.2.3 From 2aa034bf47b9c16d9874d794ef9fabf5321ac8f7 Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Wed, 19 Oct 2016 00:39:26 -0400 Subject: more random changes --- ports/libodb-sqlite/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/libodb-sqlite/CMakeLists.txt b/ports/libodb-sqlite/CMakeLists.txt index 44f368537..43a2e7a56 100644 --- a/ports/libodb-sqlite/CMakeLists.txt +++ b/ports/libodb-sqlite/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.0) project(libodb-sqlite VERSION 2.4.0 LANGUAGES CXX) find_package(odb 2.4.0 REQUIRED COMPONENTS libodb) -find_library(SQLITE3_LIBRARY names sqlite sqlite3) +find_package(sqlite3 REQUIRED) set(LIBODB_INSTALL_HEADERS ON CACHE BOOL "Install the header files (a debug install)") file(GLOB_RECURSE libodb_src LIST_DIRECTORIES False RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} @@ -15,7 +15,7 @@ target_include_directories(sqlite ) -target_link_libraries(sqlite PRIVATE odb::libodb ${SQLITE3_LIBRARY}) +target_link_libraries(sqlite PRIVATE odb::libodb sqlite3) if(BUILD_SHARED_LIBS) target_compile_definitions(sqlite PRIVATE -DLIBODB_SQLITE_DYNAMIC_LIB -- cgit v1.2.3 From 8de99463fa8f5b54d120e14eb233411101c69ab3 Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Wed, 19 Oct 2016 01:28:50 -0400 Subject: more odb-sqlite --- ports/libodb-sqlite/CMakeLists.txt | 14 +++++++------- ports/libodb-sqlite/portfile.cmake | 9 +++++++-- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/ports/libodb-sqlite/CMakeLists.txt b/ports/libodb-sqlite/CMakeLists.txt index 43a2e7a56..bd1717899 100644 --- a/ports/libodb-sqlite/CMakeLists.txt +++ b/ports/libodb-sqlite/CMakeLists.txt @@ -7,25 +7,25 @@ file(GLOB_RECURSE libodb_src LIST_DIRECTORIES False RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cxx) list(FILTER libodb_src EXCLUDE REGEX /posix/.*) -add_library(sqlite ${libodb_src}) -target_include_directories(sqlite +add_library(libodb-sqlite ${libodb_src}) +target_include_directories(libodb-sqlite PUBLIC $ $ ) -target_link_libraries(sqlite PRIVATE odb::libodb sqlite3) +target_link_libraries(libodb-sqlite PRIVATE odb::libodb sqlite3) if(BUILD_SHARED_LIBS) - target_compile_definitions(sqlite PRIVATE + target_compile_definitions(libodb-sqlite PRIVATE -DLIBODB_SQLITE_DYNAMIC_LIB -DLIBODB_SQLITE_HAVE_UNLOCK_NOTIFY) else() - target_compile_definitions(sqlite PRIVATE + target_compile_definitions(libodb-sqlite PRIVATE -DLIBODB_SQLITE_STATIC_LIB -DLIBODB_SQLITE_HAVE_UNLOCK_NOTIFY) endif() -install(TARGETS sqlite EXPORT odb_sqliteConfig +install(TARGETS libodb-sqlite EXPORT odb_sqliteConfig COMPONENT sqlite ARCHIVE DESTINATION lib LIBRARY DESTINATION lib @@ -42,4 +42,4 @@ install(DIRECTORY odb DESTINATION include/ ) endif() install(EXPORT odb_sqliteConfig NAMESPACE odb:: COMPONENT sqlite DESTINATION share/odb) -export(TARGETS sqlite NAMESPACE odb:: FILE odb_sqliteConfig.cmake) +export(TARGETS libodb-sqlite NAMESPACE odb:: FILE odb_sqliteConfig.cmake) \ No newline at end of file diff --git a/ports/libodb-sqlite/portfile.cmake b/ports/libodb-sqlite/portfile.cmake index 0c536066a..27d157bf5 100644 --- a/ports/libodb-sqlite/portfile.cmake +++ b/ports/libodb-sqlite/portfile.cmake @@ -25,5 +25,10 @@ vcpkg_configure_cmake( vcpkg_build_cmake() vcpkg_install_cmake() -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libodb) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/libodb/LICENSE ${CURRENT_PACKAGES_DIR}/share/libodb/copyright) \ No newline at end of file +file(READ ${CURRENT_PACKAGES_DIR}/debug/share/odb/odb_sqliteConfig-debug.cmake LIBODB_DEBUG_TARGETS) +string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" LIBODB_DEBUG_TARGETS "${LIBODB_DEBUG_TARGETS}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/odb/odb_sqliteConfig-debug.cmake "${LIBODB_DEBUG_TARGETS}") +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libodb-sqlite) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/libodb-sqlite/LICENSE ${CURRENT_PACKAGES_DIR}/share/libodb-sqlite/copyright) +vcpkg_copy_pdbs() \ No newline at end of file -- cgit v1.2.3 From 31e1fe5007b57d176a8213db7b2a1ced3b3b9979 Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Wed, 19 Oct 2016 15:11:40 -0400 Subject: fixed glbinding config --- ports/glbinding/portfile.cmake | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ports/glbinding/portfile.cmake b/ports/glbinding/portfile.cmake index ada070089..38cc21542 100644 --- a/ports/glbinding/portfile.cmake +++ b/ports/glbinding/portfile.cmake @@ -16,7 +16,7 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_configure_cmake(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/glbinding-2.1.1) -vcpkg_build_cmake() +#vcpkg_build_cmake() vcpkg_install_cmake() @@ -26,10 +26,15 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/cmake/glbinding ${CURRENT_PACKAGES_DIR}/shar file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/cmake) file(READ ${CURRENT_PACKAGES_DIR}/debug/cmake/glbinding/glbinding-export-debug.cmake GLBINDING_DEBUG_MODULE) -string(REPLACE "\${IMPORT_PREFIX}" "\${IMPORT_PREFIX}/debug" GLBINDING_DEBUG_MODULE "${GLBINDING_DEBUG_MODULE}") +string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" GLBINDING_DEBUG_MODULE "${GLBINDING_DEBUG_MODULE}") +string(REPLACE "glbindingd.dll" "bin/glbindingd.dll" GLBINDING_DEBUG_MODULE "${GLBINDING_DEBUG_MODULE}") file(WRITE ${CURRENT_PACKAGES_DIR}/share/glbinding/glbinding-export-debug.cmake "${GLBINDING_DEBUG_MODULE}") -file(RENAME ${CURRENT_PACKAGES_DIR}/glbinding-config.cmake ${CURRENT_PACKAGES_DIR}/share/glbinding/glbinding-config.cmake) +file(READ ${CURRENT_PACKAGES_DIR}/share/glbinding/glbinding-export-release.cmake RELEASE_CONF) +string(REPLACE "glbinding.dll" "bin/glbinding.dll" RELEASE_CONF "${RELEASE_CONF}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/glbinding/glbinding-export-release.cmake "${RELEASE_CONF}") +file(REMOVE ${CURRENT_PACKAGES_DIR}/glbinding-config.cmake) file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/glbinding-config.cmake) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/glbinding/glbinding-export.cmake ${CURRENT_PACKAGES_DIR}/share/glbinding/glbinding-config.cmake) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin) file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) -- cgit v1.2.3 From a779bbe8ca42d5e253cf6803763c8d108b12c6e7 Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Wed, 19 Oct 2016 15:13:05 -0400 Subject: removed odb binary package --- ports/odb/CONTROL | 3 --- ports/odb/portfile.cmake | 22 ---------------------- 2 files changed, 25 deletions(-) delete mode 100644 ports/odb/CONTROL delete mode 100644 ports/odb/portfile.cmake diff --git a/ports/odb/CONTROL b/ports/odb/CONTROL deleted file mode 100644 index 3806377c0..000000000 --- a/ports/odb/CONTROL +++ /dev/null @@ -1,3 +0,0 @@ -Source: odb -Version: -Description: diff --git a/ports/odb/portfile.cmake b/ports/odb/portfile.cmake deleted file mode 100644 index 28325eacb..000000000 --- a/ports/odb/portfile.cmake +++ /dev/null @@ -1,22 +0,0 @@ -# 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(${CMAKE_TRIPLET_FILE}) -include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/odb-2.4.0) -vcpkg_download_distfile(TOOL_ARCHIVE_FILE - URLS "http://www.codesynthesis.com/download/odb/2.4/odb-2.4.0-i686-windows.zip" - FILENAME "odb-2.4.0.zip" -) -vcpkg_extract_source_archive(${TOOL_ARCHIVE_FILE}) - - - -# Handle copyright -#file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/odb) -#file(RENAME ${CURRENT_PACKAGES_DIR}/share/odb/LICENSE ${CURRENT_PACKAGES_DIR}/share/odb/copyright) -- cgit v1.2.3 From 63e1b7ea92424bfd46bfe2bfe89a19c9654cf679 Mon Sep 17 00:00:00 2001 From: Arkadiy Shapkin Date: Wed, 19 Oct 2016 21:35:24 +0300 Subject: [utfcpp] Initial addition --- ports/utfcpp/CONTROL | 3 +++ ports/utfcpp/portfile.cmake | 14 ++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 ports/utfcpp/CONTROL create mode 100644 ports/utfcpp/portfile.cmake diff --git a/ports/utfcpp/CONTROL b/ports/utfcpp/CONTROL new file mode 100644 index 000000000..619e8b2b3 --- /dev/null +++ b/ports/utfcpp/CONTROL @@ -0,0 +1,3 @@ +Source: utfcpp +Version: 2.3.4 +Description: UTF-8 with C++ in a Portable Way diff --git a/ports/utfcpp/portfile.cmake b/ports/utfcpp/portfile.cmake new file mode 100644 index 000000000..760d4107c --- /dev/null +++ b/ports/utfcpp/portfile.cmake @@ -0,0 +1,14 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/utfcpp-2.3.4) +vcpkg_download_distfile(ARCHIVE_FILE + URLS "https://github.com/nemtrif/utfcpp/archive/v2.3.4.tar.gz" + FILENAME "utfcpp-2.3.4.tar.gz" + SHA512 1baa67c4efb926bba97dfbc869ac057d5d6cf67e94879fc0854ec3d75a5bae7c47cb3e9fd9cbc7bed9ca5daf40f173c0349bce2f6aa34a400bdf77d01522ff2f +) +vcpkg_extract_source_archive(${ARCHIVE_FILE}) + +# Put the licence file where vcpkg expects it +file(INSTALL ${SOURCE_PATH}/source/utf8.h DESTINATION ${CURRENT_PACKAGES_DIR}/share/utfcpp RENAME copyright) + +# Copy the utf8-cpp header files +file(COPY ${SOURCE_PATH}/source/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) -- cgit v1.2.3 From 581c8ed3190e7852c292f84439e57f56bc7ce611 Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Wed, 19 Oct 2016 20:08:48 -0400 Subject: added pcre --- ports/pcre/CONTROL | 4 ++++ ports/pcre/portfile.cmake | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 ports/pcre/CONTROL create mode 100644 ports/pcre/portfile.cmake diff --git a/ports/pcre/CONTROL b/ports/pcre/CONTROL new file mode 100644 index 000000000..eb6863b38 --- /dev/null +++ b/ports/pcre/CONTROL @@ -0,0 +1,4 @@ +Source: pcre +Version: 8.38 +Description: Perl Compatible Regular Expresions +Build-Depends: zlib diff --git a/ports/pcre/portfile.cmake b/ports/pcre/portfile.cmake new file mode 100644 index 000000000..273042487 --- /dev/null +++ b/ports/pcre/portfile.cmake @@ -0,0 +1,37 @@ +# 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(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/pcre-8.38) +vcpkg_download_distfile(ARCHIVE + URLS "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.zip" + FILENAME "pcre-8.38.zip" + SHA512 82f1c2bdd0a6cc086e3734621ac7a2773cb28f42cf5e400b9bbe8c16655465d9367bce82c6db69577c40ec137b30f1b2443a8d91998a514f81e1c2210828a113 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS -DPCRE_BUILD_TESTS=NO + -DPCRE_BUILD_PCREGREP=NO + # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 + # OPTIONS_RELEASE -DOPTIMIZE=1 + # OPTIONS_DEBUG -DDEBUGGABLE=1 +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + +# Handle copyright +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/pcre) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/pcre/COPYING ${CURRENT_PACKAGES_DIR}/share/pcre/copyright) + +vcpkg_copy_pdbs() \ No newline at end of file -- cgit v1.2.3 From 8ad5300c7543ba5315519609fc94820ed4ee14de Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Wed, 19 Oct 2016 20:16:08 -0400 Subject: build UTF32 and UTF8 versions --- ports/pcre/portfile.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/pcre/portfile.cmake b/ports/pcre/portfile.cmake index 273042487..15c61142c 100644 --- a/ports/pcre/portfile.cmake +++ b/ports/pcre/portfile.cmake @@ -20,6 +20,8 @@ vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS -DPCRE_BUILD_TESTS=NO -DPCRE_BUILD_PCREGREP=NO + -DPCRE_BUILD_PCRE32=YES + -DPCRE_BUILD_PCRE16=YES # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 # OPTIONS_RELEASE -DOPTIMIZE=1 # OPTIONS_DEBUG -DDEBUGGABLE=1 -- cgit v1.2.3 From 6701e72885458f6b0f65b8f063ac9bd1483d8d45 Mon Sep 17 00:00:00 2001 From: sdcb Date: Thu, 20 Oct 2016 10:27:11 +0800 Subject: Add boost-di. --- ports/boost-di/CONTROL | 3 +++ ports/boost-di/portfile.cmake | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 ports/boost-di/CONTROL create mode 100644 ports/boost-di/portfile.cmake diff --git a/ports/boost-di/CONTROL b/ports/boost-di/CONTROL new file mode 100644 index 000000000..60ac13ceb --- /dev/null +++ b/ports/boost-di/CONTROL @@ -0,0 +1,3 @@ +Source: boost-di +Version: 1.0.1 +Description: C++14 Dependency Injection Library. \ No newline at end of file diff --git a/ports/boost-di/portfile.cmake b/ports/boost-di/portfile.cmake new file mode 100644 index 000000000..e09c813c2 --- /dev/null +++ b/ports/boost-di/portfile.cmake @@ -0,0 +1,17 @@ +include(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/di-1.0.1) + +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/boost-experimental/di/archive/v1.0.1.tar.gz" + FILENAME "di-1.0.1.tar.gz" + SHA512 4e7270be51e7c8d0dcb6e0ba4bcf8e12904016086bdd59667954815f4acb03fc62447775885594a8403f5067a20b2520717fe979926d740dff0efa0c97ebf20c +) +vcpkg_extract_source_archive(${ARCHIVE}) + +file(INSTALL ${SOURCE_PATH}/include/boost + DESTINATION ${CURRENT_PACKAGES_DIR}/include) + +# boost-di license does not exist in source folder. +# it shares the boost license. +file(DOWNLOAD http://www.boost.org/LICENSE_1_0.txt ${CURRENT_PACKAGES_DIR}/share/boost-di/copyright) \ No newline at end of file -- cgit v1.2.3 From 38e152cb2993b198ea77c26ce28687f506f5e3fb Mon Sep 17 00:00:00 2001 From: John Camp Date: Thu, 20 Oct 2016 00:29:38 -0400 Subject: Added package for PDCurses --- ports/pdcurses/CONTROL | 3 +++ ports/pdcurses/LICENSE | 7 +++++++ ports/pdcurses/portfile.cmake | 26 ++++++++++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 ports/pdcurses/CONTROL create mode 100644 ports/pdcurses/LICENSE create mode 100644 ports/pdcurses/portfile.cmake diff --git a/ports/pdcurses/CONTROL b/ports/pdcurses/CONTROL new file mode 100644 index 000000000..66f0f4535 --- /dev/null +++ b/ports/pdcurses/CONTROL @@ -0,0 +1,3 @@ +Source: pdcurses +Version: 3.4 +Description: Public Domain Curses - a curses library for environments that don't fit the termcap/terminfo model. diff --git a/ports/pdcurses/LICENSE b/ports/pdcurses/LICENSE new file mode 100644 index 000000000..ec633d8f2 --- /dev/null +++ b/ports/pdcurses/LICENSE @@ -0,0 +1,7 @@ +The core package is in the public domain, but small portions of PDCurses are subject to copyright under various licenses. + +The win32 files are released to the public domain. + +If you use PDCurses in an application, an acknowledgement would be appreciated, but is not mandatory. If you make corrections or enhancements to PDCurses, please forward them to the current maintainer for the benefit of other users. + +This software is provided AS IS with NO WARRANTY whatsoever. \ No newline at end of file diff --git a/ports/pdcurses/portfile.cmake b/ports/pdcurses/portfile.cmake new file mode 100644 index 000000000..c9fdb7fbc --- /dev/null +++ b/ports/pdcurses/portfile.cmake @@ -0,0 +1,26 @@ +include(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/PDCurses-3.4) +find_program(NMAKE nmake) + +vcpkg_download_distfile(ARCHIVE + URLS "https://sourceforge.net/projects/pdcurses/files/latest/download?source=files" + FILENAME "pdcurs34.zip" + SHA512 cf2144359935ea553954e60e74318168d4c6fcee48648dfec74325742a61786b285c59ad0a014cc1f4039a332c3dbf2031c64865025a0cd25ef8faacc5827d05 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +message(STATUS "Build ${TARGET_TRIPLET}") +vcpkg_execute_required_process( + COMMAND ${NMAKE} -f vcwin32.mak WIDE=Y UTF8=Y PDCLIBS + WORKING_DIRECTORY ${SOURCE_PATH}/win32 + LOGNAME build-${TARGET_TRIPLET} +) +message(STATUS "Build ${TARGET_TRIPLET} done") + +file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/pdcurses RENAME copyright) +file(COPY ${SOURCE_PATH}/win32/pdcurses.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) +file(COPY ${SOURCE_PATH}/win32/panel.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) +file(COPY ${SOURCE_PATH}/curses.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) +file(COPY ${SOURCE_PATH}/panel.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) +file(COPY ${SOURCE_PATH}/term.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) -- cgit v1.2.3 From 2b8bdeb0441c9fb83fc79bf10a761d1bf11cd287 Mon Sep 17 00:00:00 2001 From: sdcb Date: Thu, 20 Oct 2016 13:03:58 +0800 Subject: Add hash file support. --- toolsrc/include/vcpkg_Commands.h | 1 + toolsrc/src/commands_hash.cpp | 40 +++++++++++++++++++++++++++++++++++++ toolsrc/src/commands_other.cpp | 4 +++- toolsrc/vcpkg/commands_hash.cpp | 40 +++++++++++++++++++++++++++++++++++++ toolsrc/vcpkg/vcpkg.vcxproj | 1 + toolsrc/vcpkg/vcpkg.vcxproj.filters | 3 +++ 6 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 toolsrc/src/commands_hash.cpp create mode 100644 toolsrc/vcpkg/commands_hash.cpp diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index 978519820..dc4699dc0 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -35,6 +35,7 @@ namespace vcpkg void version_command(const vcpkg_cmd_arguments& args); 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); diff --git a/toolsrc/src/commands_hash.cpp b/toolsrc/src/commands_hash.cpp new file mode 100644 index 000000000..672e24a24 --- /dev/null +++ b/toolsrc/src/commands_hash.cpp @@ -0,0 +1,40 @@ +#include "vcpkg_Commands.h" +#include "vcpkg_System.h" +#include "vcpkg.h" +#include +#include +#include + +namespace fs = std::tr2::sys; + +namespace vcpkg +{ + void file_hash_sha512(fs::path const & path, char const * hash) + { + auto cmd_line = Strings::format("Powershell -Command (Get-FileHash %s -Algorithm %s).Hash.ToLower()", + Strings::utf16_to_utf8(path.c_str()), + hash); + auto ec_data = System::cmd_execute_and_capture_output(Strings::utf8_to_utf16(cmd_line)); + Checks::check_exit(ec_data.exit_code == 0, "Running command:\n %s\n failed", cmd_line); + System::print(ec_data.output.c_str()); + } + + 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")); + args.check_min_arg_count(1, example.c_str()); + args.check_max_arg_count(2, example.c_str()); + + if (args.command_arguments.size() == 1) + { + file_hash_sha512(args.command_arguments[0], "SHA512"); + } + if (args.command_arguments.size() == 2) + { + file_hash_sha512(args.command_arguments[0], args.command_arguments[1].c_str()); + } + + exit(EXIT_SUCCESS); + } +} diff --git a/toolsrc/src/commands_other.cpp b/toolsrc/src/commands_other.cpp index 07549a437..53d6f2506 100644 --- a/toolsrc/src/commands_other.cpp +++ b/toolsrc/src/commands_other.cpp @@ -14,6 +14,7 @@ namespace vcpkg " 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" @@ -93,7 +94,8 @@ namespace vcpkg { static std::vector> t = { {"version", &version_command}, - {"contact", &contact_command} + {"contact", &contact_command}, + {"hash", &hash_command }, }; return t; } diff --git a/toolsrc/vcpkg/commands_hash.cpp b/toolsrc/vcpkg/commands_hash.cpp new file mode 100644 index 000000000..e4e0e1747 --- /dev/null +++ b/toolsrc/vcpkg/commands_hash.cpp @@ -0,0 +1,40 @@ +#include "vcpkg_Commands.h" +#include "vcpkg_System.h" +#include "vcpkg.h" +#include +#include +#include + +namespace fs = std::tr2::sys; + +namespace vcpkg +{ + void file_hash_sha512(fs::path const & path, char const * hash) + { + auto cmd_line = Strings::format("Powershell -Command (Get-FileHash %s -Algorithm %s).Hash.ToLower()", + Strings::utf16_to_utf8(path.c_str()), + hash); + auto ec_data = System::cmd_execute_and_capture_output(Strings::utf8_to_utf16(cmd_line)); + Checks::check_exit(ec_data.exit_code == 0, "Running command:\n %s\n failed", cmd_line); + System::print(ec_data.output.c_str()); + } + + 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 ")); + args.check_min_arg_count(1, example.c_str()); + args.check_max_arg_count(2, example.c_str()); + + if (args.command_arguments.size() == 1) + { + file_hash_sha512(args.command_arguments[0], "SHA512"); + } + if (args.command_arguments.size() == 2) + { + file_hash_sha512(args.command_arguments[0], args.command_arguments[1].c_str()); + } + + exit(EXIT_SUCCESS); + } +} diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/vcpkg/vcpkg.vcxproj index 82d3e2163..ec877d09c 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj +++ b/toolsrc/vcpkg/vcpkg.vcxproj @@ -133,6 +133,7 @@ + diff --git a/toolsrc/vcpkg/vcpkg.vcxproj.filters b/toolsrc/vcpkg/vcpkg.vcxproj.filters index 96a11162f..e46652d90 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj.filters +++ b/toolsrc/vcpkg/vcpkg.vcxproj.filters @@ -78,6 +78,9 @@ Source Files + + Source Files + -- cgit v1.2.3 From c5d487ecd75a4e474c91fa6114470c9ce1adf67c Mon Sep 17 00:00:00 2001 From: sdcb Date: Thu, 20 Oct 2016 16:50:35 +0800 Subject: Add dxut --- ports/dxut/CONTROL | 3 + ports/dxut/dll.patch | 834 ++++++++++++++++++++++++++++++++++++++++++++++ ports/dxut/portfile.cmake | 56 ++++ 3 files changed, 893 insertions(+) create mode 100644 ports/dxut/CONTROL create mode 100644 ports/dxut/dll.patch create mode 100644 ports/dxut/portfile.cmake diff --git a/ports/dxut/CONTROL b/ports/dxut/CONTROL new file mode 100644 index 000000000..ee632dfab --- /dev/null +++ b/ports/dxut/CONTROL @@ -0,0 +1,3 @@ +Source: dxut +Version: 11.14 +Description: A "GLUT"-like framework for Direct3D 11.x Win32 desktop applications \ No newline at end of file diff --git a/ports/dxut/dll.patch b/ports/dxut/dll.patch new file mode 100644 index 000000000..4557ab88a --- /dev/null +++ b/ports/dxut/dll.patch @@ -0,0 +1,834 @@ +diff --git a/Core/DDSTextureLoader.h b/Core/DDSTextureLoader.h +index 122df9f..8af6c62 100644 +--- a/Core/DDSTextureLoader.h ++++ b/Core/DDSTextureLoader.h +@@ -23,6 +23,11 @@ + #include + #include + ++#ifdef DXUT_EXPORT ++ #define DXUT_API __declspec(dllexport) ++#else ++ #define DXUT_API __declspec(dllimport) ++#endif + + namespace DirectX + { +@@ -34,9 +39,9 @@ namespace DirectX + DDS_ALPHA_MODE_OPAQUE = 3, + DDS_ALPHA_MODE_CUSTOM = 4, + }; +- ++ + // Standard version +- HRESULT CreateDDSTextureFromMemory( _In_ ID3D11Device* d3dDevice, ++ HRESULT DXUT_API CreateDDSTextureFromMemory( _In_ ID3D11Device* d3dDevice, + _In_reads_bytes_(ddsDataSize) const uint8_t* ddsData, + _In_ size_t ddsDataSize, + _Outptr_opt_ ID3D11Resource** texture, +@@ -45,7 +50,7 @@ namespace DirectX + _Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr + ); + +- HRESULT CreateDDSTextureFromFile( _In_ ID3D11Device* d3dDevice, ++ HRESULT DXUT_API CreateDDSTextureFromFile( _In_ ID3D11Device* d3dDevice, + _In_z_ const wchar_t* szFileName, + _Outptr_opt_ ID3D11Resource** texture, + _Outptr_opt_ ID3D11ShaderResourceView** textureView, +@@ -54,7 +59,7 @@ namespace DirectX + ); + + // Standard version with optional auto-gen mipmap support +- HRESULT CreateDDSTextureFromMemory( _In_ ID3D11Device* d3dDevice, ++ HRESULT DXUT_API CreateDDSTextureFromMemory( _In_ ID3D11Device* d3dDevice, + _In_opt_ ID3D11DeviceContext* d3dContext, + _In_reads_bytes_(ddsDataSize) const uint8_t* ddsData, + _In_ size_t ddsDataSize, +@@ -64,7 +69,7 @@ namespace DirectX + _Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr + ); + +- HRESULT CreateDDSTextureFromFile( _In_ ID3D11Device* d3dDevice, ++ HRESULT DXUT_API CreateDDSTextureFromFile( _In_ ID3D11Device* d3dDevice, + _In_opt_ ID3D11DeviceContext* d3dContext, + _In_z_ const wchar_t* szFileName, + _Outptr_opt_ ID3D11Resource** texture, +@@ -74,7 +79,7 @@ namespace DirectX + ); + + // Extended version +- HRESULT CreateDDSTextureFromMemoryEx( _In_ ID3D11Device* d3dDevice, ++ HRESULT DXUT_API CreateDDSTextureFromMemoryEx( _In_ ID3D11Device* d3dDevice, + _In_reads_bytes_(ddsDataSize) const uint8_t* ddsData, + _In_ size_t ddsDataSize, + _In_ size_t maxsize, +@@ -88,7 +93,7 @@ namespace DirectX + _Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr + ); + +- HRESULT CreateDDSTextureFromFileEx( _In_ ID3D11Device* d3dDevice, ++ HRESULT DXUT_API CreateDDSTextureFromFileEx( _In_ ID3D11Device* d3dDevice, + _In_z_ const wchar_t* szFileName, + _In_ size_t maxsize, + _In_ D3D11_USAGE usage, +@@ -102,7 +107,7 @@ namespace DirectX + ); + + // Extended version with optional auto-gen mipmap support +- HRESULT CreateDDSTextureFromMemoryEx( _In_ ID3D11Device* d3dDevice, ++ HRESULT DXUT_API CreateDDSTextureFromMemoryEx( _In_ ID3D11Device* d3dDevice, + _In_opt_ ID3D11DeviceContext* d3dContext, + _In_reads_bytes_(ddsDataSize) const uint8_t* ddsData, + _In_ size_t ddsDataSize, +@@ -117,7 +122,7 @@ namespace DirectX + _Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr + ); + +- HRESULT CreateDDSTextureFromFileEx( _In_ ID3D11Device* d3dDevice, ++ HRESULT DXUT_API CreateDDSTextureFromFileEx( _In_ ID3D11Device* d3dDevice, + _In_opt_ ID3D11DeviceContext* d3dContext, + _In_z_ const wchar_t* szFileName, + _In_ size_t maxsize, +diff --git a/Core/DXUT.h b/Core/DXUT.h +index fc6247e..a0e06fa 100644 +--- a/Core/DXUT.h ++++ b/Core/DXUT.h +@@ -12,6 +12,12 @@ + //-------------------------------------------------------------------------------------- + #pragma once + ++#ifdef DXUT_EXPORT ++ #define DXUT_API __declspec(dllexport) ++#else ++ #define DXUT_API __declspec(dllimport) ++#endif ++ + #ifndef UNICODE + #error "DXUT requires a Unicode build." + #endif +@@ -207,68 +213,68 @@ typedef void (CALLBACK *LPDXUTCALLBACKD3D11SWAPCHAINRELEASING)( _In_opt_ void + typedef void (CALLBACK *LPDXUTCALLBACKD3D11DEVICEDESTROYED)( _In_opt_ void* pUserContext ); + + // General callbacks +-void WINAPI DXUTSetCallbackFrameMove( _In_ LPDXUTCALLBACKFRAMEMOVE pCallback, _In_opt_ void* pUserContext = nullptr ); +-void WINAPI DXUTSetCallbackKeyboard( _In_ LPDXUTCALLBACKKEYBOARD pCallback, _In_opt_ void* pUserContext = nullptr ); +-void WINAPI DXUTSetCallbackMouse( _In_ LPDXUTCALLBACKMOUSE pCallback, bool bIncludeMouseMove = false, _In_opt_ void* pUserContext = nullptr ); +-void WINAPI DXUTSetCallbackMsgProc( _In_ LPDXUTCALLBACKMSGPROC pCallback, _In_opt_ void* pUserContext = nullptr ); +-void WINAPI DXUTSetCallbackDeviceChanging( _In_ LPDXUTCALLBACKMODIFYDEVICESETTINGS pCallback, _In_opt_ void* pUserContext = nullptr ); +-void WINAPI DXUTSetCallbackDeviceRemoved( _In_ LPDXUTCALLBACKDEVICEREMOVED pCallback, _In_opt_ void* pUserContext = nullptr ); ++void DXUT_API WINAPI DXUTSetCallbackFrameMove( _In_ LPDXUTCALLBACKFRAMEMOVE pCallback, _In_opt_ void* pUserContext = nullptr ); ++void DXUT_API WINAPI DXUTSetCallbackKeyboard( _In_ LPDXUTCALLBACKKEYBOARD pCallback, _In_opt_ void* pUserContext = nullptr ); ++void DXUT_API WINAPI DXUTSetCallbackMouse( _In_ LPDXUTCALLBACKMOUSE pCallback, bool bIncludeMouseMove = false, _In_opt_ void* pUserContext = nullptr ); ++void DXUT_API WINAPI DXUTSetCallbackMsgProc( _In_ LPDXUTCALLBACKMSGPROC pCallback, _In_opt_ void* pUserContext = nullptr ); ++void DXUT_API WINAPI DXUTSetCallbackDeviceChanging( _In_ LPDXUTCALLBACKMODIFYDEVICESETTINGS pCallback, _In_opt_ void* pUserContext = nullptr ); ++void DXUT_API WINAPI DXUTSetCallbackDeviceRemoved( _In_ LPDXUTCALLBACKDEVICEREMOVED pCallback, _In_opt_ void* pUserContext = nullptr ); + + // Direct3D 11 callbacks +-void WINAPI DXUTSetCallbackD3D11DeviceAcceptable( _In_ LPDXUTCALLBACKISD3D11DEVICEACCEPTABLE pCallback, _In_opt_ void* pUserContext = nullptr ); +-void WINAPI DXUTSetCallbackD3D11DeviceCreated( _In_ LPDXUTCALLBACKD3D11DEVICECREATED pCallback, _In_opt_ void* pUserContext = nullptr ); +-void WINAPI DXUTSetCallbackD3D11SwapChainResized( _In_ LPDXUTCALLBACKD3D11SWAPCHAINRESIZED pCallback, _In_opt_ void* pUserContext = nullptr ); +-void WINAPI DXUTSetCallbackD3D11FrameRender( _In_ LPDXUTCALLBACKD3D11FRAMERENDER pCallback, _In_opt_ void* pUserContext = nullptr ); +-void WINAPI DXUTSetCallbackD3D11SwapChainReleasing( _In_ LPDXUTCALLBACKD3D11SWAPCHAINRELEASING pCallback, _In_opt_ void* pUserContext = nullptr ); +-void WINAPI DXUTSetCallbackD3D11DeviceDestroyed( _In_ LPDXUTCALLBACKD3D11DEVICEDESTROYED pCallback, _In_opt_ void* pUserContext = nullptr ); ++void DXUT_API WINAPI DXUTSetCallbackD3D11DeviceAcceptable( _In_ LPDXUTCALLBACKISD3D11DEVICEACCEPTABLE pCallback, _In_opt_ void* pUserContext = nullptr ); ++void DXUT_API WINAPI DXUTSetCallbackD3D11DeviceCreated( _In_ LPDXUTCALLBACKD3D11DEVICECREATED pCallback, _In_opt_ void* pUserContext = nullptr ); ++void DXUT_API WINAPI DXUTSetCallbackD3D11SwapChainResized( _In_ LPDXUTCALLBACKD3D11SWAPCHAINRESIZED pCallback, _In_opt_ void* pUserContext = nullptr ); ++void DXUT_API WINAPI DXUTSetCallbackD3D11FrameRender( _In_ LPDXUTCALLBACKD3D11FRAMERENDER pCallback, _In_opt_ void* pUserContext = nullptr ); ++void DXUT_API WINAPI DXUTSetCallbackD3D11SwapChainReleasing( _In_ LPDXUTCALLBACKD3D11SWAPCHAINRELEASING pCallback, _In_opt_ void* pUserContext = nullptr ); ++void DXUT_API WINAPI DXUTSetCallbackD3D11DeviceDestroyed( _In_ LPDXUTCALLBACKD3D11DEVICEDESTROYED pCallback, _In_opt_ void* pUserContext = nullptr ); + + + //-------------------------------------------------------------------------------------- + // Initialization + //-------------------------------------------------------------------------------------- +-HRESULT WINAPI DXUTInit( _In_ bool bParseCommandLine = true, ++HRESULT DXUT_API WINAPI DXUTInit( _In_ bool bParseCommandLine = true, + _In_ bool bShowMsgBoxOnError = true, + _In_opt_ WCHAR* strExtraCommandLineParams = nullptr, + _In_ bool bThreadSafeDXUT = false ); + + // Choose either DXUTCreateWindow or DXUTSetWindow. If using DXUTSetWindow, consider using DXUTStaticWndProc +-HRESULT WINAPI DXUTCreateWindow( _In_z_ const WCHAR* strWindowTitle = L"Direct3D Window", ++HRESULT DXUT_API WINAPI DXUTCreateWindow( _In_z_ const WCHAR* strWindowTitle = L"Direct3D Window", + _In_opt_ HINSTANCE hInstance = nullptr, _In_opt_ HICON hIcon = nullptr, _In_opt_ HMENU hMenu = nullptr, + _In_ int x = CW_USEDEFAULT, _In_ int y = CW_USEDEFAULT ); +-HRESULT WINAPI DXUTSetWindow( _In_ HWND hWndFocus, _In_ HWND hWndDeviceFullScreen, _In_ HWND hWndDeviceWindowed, _In_ bool bHandleMessages = true ); +-LRESULT CALLBACK DXUTStaticWndProc( _In_ HWND hWnd, _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam ); ++HRESULT DXUT_API WINAPI DXUTSetWindow( _In_ HWND hWndFocus, _In_ HWND hWndDeviceFullScreen, _In_ HWND hWndDeviceWindowed, _In_ bool bHandleMessages = true ); ++LRESULT DXUT_API CALLBACK DXUTStaticWndProc( _In_ HWND hWnd, _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam ); + + // Choose either DXUTCreateDevice or DXUTCreateD3DDeviceFromSettings + +-HRESULT WINAPI DXUTCreateDevice(_In_ D3D_FEATURE_LEVEL reqFL, _In_ bool bWindowed= true, _In_ int nSuggestedWidth =0,_In_ int nSuggestedHeight =0 ); +-HRESULT WINAPI DXUTCreateDeviceFromSettings( _In_ DXUTDeviceSettings* pDeviceSettings, _In_ bool bClipWindowToSingleAdapter = true ); ++HRESULT DXUT_API WINAPI DXUTCreateDevice(_In_ D3D_FEATURE_LEVEL reqFL, _In_ bool bWindowed= true, _In_ int nSuggestedWidth =0,_In_ int nSuggestedHeight =0 ); ++HRESULT DXUT_API WINAPI DXUTCreateDeviceFromSettings( _In_ DXUTDeviceSettings* pDeviceSettings, _In_ bool bClipWindowToSingleAdapter = true ); + + // Choose either DXUTMainLoop or implement your own main loop +-HRESULT WINAPI DXUTMainLoop( _In_opt_ HACCEL hAccel = nullptr ); ++HRESULT DXUT_API WINAPI DXUTMainLoop( _In_opt_ HACCEL hAccel = nullptr ); + + // If not using DXUTMainLoop consider using DXUTRender3DEnvironment +-void WINAPI DXUTRender3DEnvironment(); ++void DXUT_API WINAPI DXUTRender3DEnvironment(); + + + //-------------------------------------------------------------------------------------- + // Common Tasks + //-------------------------------------------------------------------------------------- +-HRESULT WINAPI DXUTToggleFullScreen(); +-HRESULT WINAPI DXUTToggleREF(); +-HRESULT WINAPI DXUTToggleWARP(); +-void WINAPI DXUTPause( _In_ bool bPauseTime, _In_ bool bPauseRendering ); +-void WINAPI DXUTSetConstantFrameTime( _In_ bool bConstantFrameTime, _In_ float fTimePerFrame = 0.0333f ); +-void WINAPI DXUTSetCursorSettings( _In_ bool bShowCursorWhenFullScreen = false, _In_ bool bClipCursorWhenFullScreen = false ); +-void WINAPI DXUTSetHotkeyHandling( _In_ bool bAltEnterToToggleFullscreen = true, _In_ bool bEscapeToQuit = true, _In_ bool bPauseToToggleTimePause = true ); +-void WINAPI DXUTSetMultimonSettings( _In_ bool bAutoChangeAdapter = true ); +-void WINAPI DXUTSetShortcutKeySettings( _In_ bool bAllowWhenFullscreen = false, _In_ bool bAllowWhenWindowed = true ); // Controls the Windows key, and accessibility shortcut keys +-void WINAPI DXUTSetWindowSettings( _In_ bool bCallDefWindowProc = true ); +-HRESULT WINAPI DXUTSetTimer( _In_ LPDXUTCALLBACKTIMER pCallbackTimer, _In_ float fTimeoutInSecs = 1.0f, _Out_opt_ UINT* pnIDEvent = nullptr, _In_opt_ void* pCallbackUserContext = nullptr ); +-HRESULT WINAPI DXUTKillTimer( _In_ UINT nIDEvent ); +-void WINAPI DXUTResetFrameworkState(); +-void WINAPI DXUTShutdown( _In_ int nExitCode = 0 ); +-void WINAPI DXUTSetIsInGammaCorrectMode( _In_ bool bGammaCorrect ); +-bool WINAPI DXUTGetMSAASwapChainCreated(); ++HRESULT DXUT_API WINAPI DXUTToggleFullScreen(); ++HRESULT DXUT_API WINAPI DXUTToggleREF(); ++HRESULT DXUT_API WINAPI DXUTToggleWARP(); ++void DXUT_API WINAPI DXUTPause( _In_ bool bPauseTime, _In_ bool bPauseRendering ); ++void DXUT_API WINAPI DXUTSetConstantFrameTime( _In_ bool bConstantFrameTime, _In_ float fTimePerFrame = 0.0333f ); ++void DXUT_API WINAPI DXUTSetCursorSettings( _In_ bool bShowCursorWhenFullScreen = false, _In_ bool bClipCursorWhenFullScreen = false ); ++void DXUT_API WINAPI DXUTSetHotkeyHandling( _In_ bool bAltEnterToToggleFullscreen = true, _In_ bool bEscapeToQuit = true, _In_ bool bPauseToToggleTimePause = true ); ++void DXUT_API WINAPI DXUTSetMultimonSettings( _In_ bool bAutoChangeAdapter = true ); ++void DXUT_API WINAPI DXUTSetShortcutKeySettings( _In_ bool bAllowWhenFullscreen = false, _In_ bool bAllowWhenWindowed = true ); // Controls the Windows key, and accessibility shortcut keys ++void DXUT_API WINAPI DXUTSetWindowSettings( _In_ bool bCallDefWindowProc = true ); ++HRESULT DXUT_API WINAPI DXUTSetTimer( _In_ LPDXUTCALLBACKTIMER pCallbackTimer, _In_ float fTimeoutInSecs = 1.0f, _Out_opt_ UINT* pnIDEvent = nullptr, _In_opt_ void* pCallbackUserContext = nullptr ); ++HRESULT DXUT_API WINAPI DXUTKillTimer( _In_ UINT nIDEvent ); ++void DXUT_API WINAPI DXUTResetFrameworkState(); ++void DXUT_API WINAPI DXUTShutdown( _In_ int nExitCode = 0 ); ++void DXUT_API WINAPI DXUTSetIsInGammaCorrectMode( _In_ bool bGammaCorrect ); ++bool DXUT_API WINAPI DXUTGetMSAASwapChainCreated(); + + + //-------------------------------------------------------------------------------------- +@@ -276,63 +282,63 @@ bool WINAPI DXUTGetMSAASwapChainCreated(); + //-------------------------------------------------------------------------------------- + + // Direct3D 11.x (These do not addref unlike typical Get* APIs) +-IDXGIFactory1* WINAPI DXUTGetDXGIFactory(); +-IDXGISwapChain* WINAPI DXUTGetDXGISwapChain(); +-const DXGI_SURFACE_DESC* WINAPI DXUTGetDXGIBackBufferSurfaceDesc(); +-HRESULT WINAPI DXUTSetupD3D11Views( _In_ ID3D11DeviceContext* pd3dDeviceContext ); // Supports immediate or deferred context +-D3D_FEATURE_LEVEL WINAPI DXUTGetD3D11DeviceFeatureLevel(); // Returns the D3D11 devices current feature level +-ID3D11RenderTargetView* WINAPI DXUTGetD3D11RenderTargetView(); +-ID3D11DepthStencilView* WINAPI DXUTGetD3D11DepthStencilView(); ++DXUT_API IDXGIFactory1* WINAPI DXUTGetDXGIFactory(); ++DXUT_API IDXGISwapChain* WINAPI DXUTGetDXGISwapChain(); ++DXUT_API const DXGI_SURFACE_DESC* WINAPI DXUTGetDXGIBackBufferSurfaceDesc(); ++DXUT_API HRESULT WINAPI DXUTSetupD3D11Views(_In_ ID3D11DeviceContext* pd3dDeviceContext); // Supports immediate or deferred context ++DXUT_API D3D_FEATURE_LEVEL WINAPI DXUTGetD3D11DeviceFeatureLevel(); // Returns the D3D11 devices current feature level ++DXUT_API ID3D11RenderTargetView* WINAPI DXUTGetD3D11RenderTargetView(); ++DXUT_API ID3D11DepthStencilView* WINAPI DXUTGetD3D11DepthStencilView(); + +-ID3D11Device* WINAPI DXUTGetD3D11Device(); +-ID3D11DeviceContext* WINAPI DXUTGetD3D11DeviceContext(); ++DXUT_API ID3D11Device* WINAPI DXUTGetD3D11Device(); ++DXUT_API ID3D11DeviceContext* WINAPI DXUTGetD3D11DeviceContext(); + +-ID3D11Device1* WINAPI DXUTGetD3D11Device1(); +-ID3D11DeviceContext1* WINAPI DXUTGetD3D11DeviceContext1(); ++DXUT_API ID3D11Device1* WINAPI DXUTGetD3D11Device1(); ++DXUT_API ID3D11DeviceContext1* WINAPI DXUTGetD3D11DeviceContext1(); + + #ifdef USE_DIRECT3D11_2 +-ID3D11Device2* WINAPI DXUTGetD3D11Device2(); +-ID3D11DeviceContext2* WINAPI DXUTGetD3D11DeviceContext2(); ++DXUT_API ID3D11Device2* WINAPI DXUTGetD3D11Device2(); ++DXUT_API ID3D11DeviceContext2* WINAPI DXUTGetD3D11DeviceContext2(); + #endif + + #ifdef USE_DIRECT3D11_3 +-ID3D11Device3* WINAPI DXUTGetD3D11Device3(); +-ID3D11DeviceContext3* WINAPI DXUTGetD3D11DeviceContext3(); ++DXUT_API ID3D11Device3* WINAPI DXUTGetD3D11Device3(); ++DXUT_API ID3D11DeviceContext3* WINAPI DXUTGetD3D11DeviceContext3(); + #endif + + // General +-DXUTDeviceSettings WINAPI DXUTGetDeviceSettings(); +-HINSTANCE WINAPI DXUTGetHINSTANCE(); +-HWND WINAPI DXUTGetHWND(); +-HWND WINAPI DXUTGetHWNDFocus(); +-HWND WINAPI DXUTGetHWNDDeviceFullScreen(); +-HWND WINAPI DXUTGetHWNDDeviceWindowed(); +-RECT WINAPI DXUTGetWindowClientRect(); +-LONG WINAPI DXUTGetWindowWidth(); +-LONG WINAPI DXUTGetWindowHeight(); +-RECT WINAPI DXUTGetWindowClientRectAtModeChange(); // Useful for returning to windowed mode with the same resolution as before toggle to full screen mode +-RECT WINAPI DXUTGetFullsceenClientRectAtModeChange(); // Useful for returning to full screen mode with the same resolution as before toggle to windowed mode +-double WINAPI DXUTGetTime(); +-float WINAPI DXUTGetElapsedTime(); +-bool WINAPI DXUTIsWindowed(); +-bool WINAPI DXUTIsInGammaCorrectMode(); +-float WINAPI DXUTGetFPS(); +-LPCWSTR WINAPI DXUTGetWindowTitle(); +-LPCWSTR WINAPI DXUTGetFrameStats( _In_ bool bIncludeFPS = false ); +-LPCWSTR WINAPI DXUTGetDeviceStats(); +- +-bool WINAPI DXUTIsVsyncEnabled(); +-bool WINAPI DXUTIsRenderingPaused(); +-bool WINAPI DXUTIsTimePaused(); +-bool WINAPI DXUTIsActive(); +-int WINAPI DXUTGetExitCode(); +-bool WINAPI DXUTGetShowMsgBoxOnError(); +-bool WINAPI DXUTGetAutomation(); // Returns true if -automation parameter is used to launch the app +-bool WINAPI DXUTIsKeyDown( _In_ BYTE vKey ); // Pass a virtual-key code, ex. VK_F1, 'A', VK_RETURN, VK_LSHIFT, etc +-bool WINAPI DXUTWasKeyPressed( _In_ BYTE vKey ); // Like DXUTIsKeyDown() but return true only if the key was just pressed +-bool WINAPI DXUTIsMouseButtonDown( _In_ BYTE vButton ); // Pass a virtual-key code: VK_LBUTTON, VK_RBUTTON, VK_MBUTTON, VK_XBUTTON1, VK_XBUTTON2 +-HRESULT WINAPI DXUTCreateState(); // Optional method to create DXUT's memory. If its not called by the application it will be automatically called when needed +-void WINAPI DXUTDestroyState(); // Optional method to destroy DXUT's memory. If its not called by the application it will be automatically called after the application exits WinMain ++DXUTDeviceSettings DXUT_API WINAPI DXUTGetDeviceSettings(); ++HINSTANCE DXUT_API WINAPI DXUTGetHINSTANCE(); ++HWND DXUT_API WINAPI DXUTGetHWND(); ++HWND DXUT_API WINAPI DXUTGetHWNDFocus(); ++HWND DXUT_API WINAPI DXUTGetHWNDDeviceFullScreen(); ++HWND DXUT_API WINAPI DXUTGetHWNDDeviceWindowed(); ++RECT DXUT_API WINAPI DXUTGetWindowClientRect(); ++LONG DXUT_API WINAPI DXUTGetWindowWidth(); ++LONG DXUT_API WINAPI DXUTGetWindowHeight(); ++RECT DXUT_API WINAPI DXUTGetWindowClientRectAtModeChange(); // Useful for returning to windowed mode with the same resolution as before toggle to full screen mode ++RECT DXUT_API WINAPI DXUTGetFullsceenClientRectAtModeChange(); // Useful for returning to full screen mode with the same resolution as before toggle to windowed mode ++double DXUT_API WINAPI DXUTGetTime(); ++float DXUT_API WINAPI DXUTGetElapsedTime(); ++bool DXUT_API WINAPI DXUTIsWindowed(); ++bool DXUT_API WINAPI DXUTIsInGammaCorrectMode(); ++float DXUT_API WINAPI DXUTGetFPS(); ++LPCWSTR DXUT_API WINAPI DXUTGetWindowTitle(); ++LPCWSTR DXUT_API WINAPI DXUTGetFrameStats( _In_ bool bIncludeFPS = false ); ++LPCWSTR DXUT_API WINAPI DXUTGetDeviceStats(); ++ ++bool DXUT_API WINAPI DXUTIsVsyncEnabled(); ++bool DXUT_API WINAPI DXUTIsRenderingPaused(); ++bool DXUT_API WINAPI DXUTIsTimePaused(); ++bool DXUT_API WINAPI DXUTIsActive(); ++int DXUT_API WINAPI DXUTGetExitCode(); ++bool DXUT_API WINAPI DXUTGetShowMsgBoxOnError(); ++bool DXUT_API WINAPI DXUTGetAutomation(); // Returns true if -automation parameter is used to launch the app ++bool DXUT_API WINAPI DXUTIsKeyDown( _In_ BYTE vKey ); // Pass a virtual-key code, ex. VK_F1, 'A', VK_RETURN, VK_LSHIFT, etc ++bool DXUT_API WINAPI DXUTWasKeyPressed( _In_ BYTE vKey ); // Like DXUTIsKeyDown() but return true only if the key was just pressed ++bool DXUT_API WINAPI DXUTIsMouseButtonDown( _In_ BYTE vButton ); // Pass a virtual-key code: VK_LBUTTON, VK_RBUTTON, VK_MBUTTON, VK_XBUTTON1, VK_XBUTTON2 ++HRESULT DXUT_API WINAPI DXUTCreateState(); // Optional method to create DXUT's memory. If its not called by the application it will be automatically called when needed ++void DXUT_API WINAPI DXUTDestroyState(); // Optional method to destroy DXUT's memory. If its not called by the application it will be automatically called after the application exits WinMain + + //-------------------------------------------------------------------------------------- + // DXUT core layer includes +diff --git a/Core/DXUTDevice11.h b/Core/DXUTDevice11.h +index 1e38a63..e607463 100644 +--- a/Core/DXUTDevice11.h ++++ b/Core/DXUTDevice11.h +@@ -14,12 +14,14 @@ + //-------------------------------------------------------------------------------------- + #pragma once + +-void DXUTApplyDefaultDeviceSettings(DXUTDeviceSettings *modifySettings); ++#pragma warning(disable: 4251) ++ ++DXUT_API void DXUTApplyDefaultDeviceSettings(DXUTDeviceSettings *modifySettings); + + //-------------------------------------------------------------------------------------- + // Functions to get bit depth from formats + //-------------------------------------------------------------------------------------- +-HRESULT WINAPI DXUTGetD3D11AdapterDisplayMode( _In_ UINT AdapterOrdinal, _In_ UINT Output, _Out_ DXGI_MODE_DESC* pModeDesc ); ++DXUT_API HRESULT WINAPI DXUTGetD3D11AdapterDisplayMode( _In_ UINT AdapterOrdinal, _In_ UINT Output, _Out_ DXGI_MODE_DESC* pModeDesc ); + + + +@@ -28,7 +30,7 @@ HRESULT WINAPI DXUTGetD3D11AdapterDisplayMode( _In_ UINT AdapterOrdinal, _In_ UI + // Optional memory create/destory functions. If not call, these will be called automatically + //-------------------------------------------------------------------------------------- + HRESULT WINAPI DXUTCreateD3D11Enumeration(); +-void WINAPI DXUTDestroyD3D11Enumeration(); ++DXUT_API void WINAPI DXUTDestroyD3D11Enumeration(); + + + +@@ -46,7 +48,7 @@ struct CD3D11EnumDeviceSettingsCombo; + //-------------------------------------------------------------------------------------- + // Enumerates available Direct3D11 adapters, devices, modes, etc. + //-------------------------------------------------------------------------------------- +-class CD3D11Enumeration ++class DXUT_API CD3D11Enumeration + { + public: + // These should be called before Enumerate(). +@@ -106,7 +108,7 @@ private: + void ClearAdapterInfoList(); + }; + +-CD3D11Enumeration* WINAPI DXUTGetD3D11Enumeration(_In_ bool bForceEnumerate = false, _In_ bool EnumerateAllAdapterFormats = true, _In_ D3D_FEATURE_LEVEL forceFL = ((D3D_FEATURE_LEVEL )0) ); ++DXUT_API CD3D11Enumeration* WINAPI DXUTGetD3D11Enumeration(_In_ bool bForceEnumerate = false, _In_ bool EnumerateAllAdapterFormats = true, _In_ D3D_FEATURE_LEVEL forceFL = ((D3D_FEATURE_LEVEL )0) ); + + + #define DXGI_MAX_DEVICE_IDENTIFIER_STRING 128 +@@ -115,7 +117,7 @@ CD3D11Enumeration* WINAPI DXUTGetD3D11Enumeration(_In_ bool bForceEnumerate = fa + // A class describing an adapter which contains a unique adapter ordinal + // that is installed on the system + //-------------------------------------------------------------------------------------- +-class CD3D11EnumAdapterInfo ++class DXUT_API CD3D11EnumAdapterInfo + { + const CD3D11EnumAdapterInfo &operator = ( const CD3D11EnumAdapterInfo &rhs ); + +@@ -144,7 +146,7 @@ public: + }; + + +-class CD3D11EnumOutputInfo ++class DXUT_API CD3D11EnumOutputInfo + { + const CD3D11EnumOutputInfo &operator = ( const CD3D11EnumOutputInfo &rhs ); + +@@ -167,7 +169,7 @@ public: + //-------------------------------------------------------------------------------------- + // A class describing a Direct3D11 device that contains a unique supported driver type + //-------------------------------------------------------------------------------------- +-class CD3D11EnumDeviceInfo ++class DXUT_API CD3D11EnumDeviceInfo + { + const CD3D11EnumDeviceInfo& operator =( const CD3D11EnumDeviceInfo& rhs ); + +@@ -187,7 +189,7 @@ public: + // adapter format, back buffer format, and windowed that is compatible with a + // particular Direct3D device and the app. + //-------------------------------------------------------------------------------------- +-struct CD3D11EnumDeviceSettingsCombo ++struct DXUT_API CD3D11EnumDeviceSettingsCombo + { + UINT AdapterOrdinal; + D3D_DRIVER_TYPE DeviceType; +@@ -203,7 +205,7 @@ struct CD3D11EnumDeviceSettingsCombo + CD3D11EnumOutputInfo* pOutputInfo; + }; + +-float DXUTRankD3D11DeviceCombo( _In_ CD3D11EnumDeviceSettingsCombo* pDeviceSettingsCombo, ++float DXUT_API DXUTRankD3D11DeviceCombo( _In_ CD3D11EnumDeviceSettingsCombo* pDeviceSettingsCombo, + _In_ DXUTD3D11DeviceSettings* pOptimalDeviceSettings, + _Out_ int &bestModeIndex, + _Out_ int &bestMSAAIndex +diff --git a/Core/DXUT_2015.vcxproj b/Core/DXUT_2015.vcxproj +index 6d6c522..62b0708 100644 +--- a/Core/DXUT_2015.vcxproj ++++ b/Core/DXUT_2015.vcxproj +@@ -34,35 +34,35 @@ + + + +- StaticLibrary ++ DynamicLibrary + Unicode + v140 + + +- StaticLibrary ++ DynamicLibrary + Unicode + v140 + + +- StaticLibrary ++ DynamicLibrary + true + Unicode + v140 + + +- StaticLibrary ++ DynamicLibrary + true + Unicode + v140 + + +- StaticLibrary ++ DynamicLibrary + true + Unicode + v140 + + +- StaticLibrary ++ DynamicLibrary + true + Unicode + v140 +@@ -147,7 +147,7 @@ + StreamingSIMDExtensions2 + Sync + %(AdditionalOptions) +- WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_LIB;USE_DIRECT3D11_2;_WIN32_WINNT=0x0600;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) ++ DXUT_EXPORT;WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_LIB;USE_DIRECT3D11_2;_WIN32_WINNT=0x0600;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) + EditAndContinue + EnableFastChecks + $(IntDir)$(TargetName).pdb +@@ -156,7 +156,7 @@ + + + %(AdditionalOptions) +- %(AdditionalDependencies) ++ comctl32.lib;%(AdditionalDependencies) + Windows + true + true +@@ -188,7 +188,7 @@ + Fast + Sync + %(AdditionalOptions) +- WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_LIB;USE_DIRECT3D11_2;_WIN32_WINNT=0x0600;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) ++ DXUT_EXPORT;WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_LIB;USE_DIRECT3D11_2;_WIN32_WINNT=0x0600;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) + EnableFastChecks + $(IntDir)$(TargetName).pdb + Use +@@ -196,7 +196,7 @@ + + + %(AdditionalOptions) +- %(AdditionalDependencies) ++ comctl32.lib;%(AdditionalDependencies) + Windows + true + true +@@ -230,14 +230,14 @@ + StreamingSIMDExtensions2 + Sync + %(AdditionalOptions) +- WIN32;NDEBUG;_WINDOWS;_LIB;USE_DIRECT3D11_2;_WIN32_WINNT=0x0600;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) ++ DXUT_EXPORT;WIN32;NDEBUG;_WINDOWS;_LIB;USE_DIRECT3D11_2;_WIN32_WINNT=0x0600;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) + $(IntDir)$(TargetName).pdb + Use + DXUT.h + + + %(AdditionalOptions) +- %(AdditionalDependencies) ++ comctl32.lib;%(AdditionalDependencies) + true + Windows + true +@@ -272,14 +272,14 @@ + Fast + Sync + %(AdditionalOptions) +- WIN32;NDEBUG;_WINDOWS;_LIB;USE_DIRECT3D11_2;_WIN32_WINNT=0x0600;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) ++ DXUT_EXPORT;WIN32;NDEBUG;_WINDOWS;_LIB;USE_DIRECT3D11_2;_WIN32_WINNT=0x0600;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) + $(IntDir)$(TargetName).pdb + Use + DXUT.h + + + %(AdditionalOptions) +- %(AdditionalDependencies) ++ comctl32.lib;%(AdditionalDependencies) + true + Windows + true +@@ -315,14 +315,14 @@ + StreamingSIMDExtensions2 + Sync + %(AdditionalOptions) +- WIN32;NDEBUG;PROFILE;_WINDOWS;_LIB;USE_DIRECT3D11_2;_WIN32_WINNT=0x0600;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) ++ DXUT_EXPORT;WIN32;NDEBUG;PROFILE;_WINDOWS;_LIB;USE_DIRECT3D11_2;_WIN32_WINNT=0x0600;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) + $(IntDir)$(TargetName).pdb + Use + DXUT.h + + + %(AdditionalOptions) +- %(AdditionalDependencies) ++ comctl32.lib;%(AdditionalDependencies) + true + Windows + true +@@ -357,14 +357,14 @@ + Fast + Sync + %(AdditionalOptions) +- WIN32;NDEBUG;PROFILE;_WINDOWS;_LIB;USE_DIRECT3D11_2;_WIN32_WINNT=0x0600;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) ++ DXUT_EXPORT;WIN32;NDEBUG;PROFILE;_WINDOWS;_LIB;USE_DIRECT3D11_2;_WIN32_WINNT=0x0600;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) + $(IntDir)$(TargetName).pdb + Use + DXUT.h + + + %(AdditionalOptions) +- %(AdditionalDependencies) ++ comctl32.lib;%(AdditionalDependencies) + true + Windows + true +diff --git a/Core/DXUTmisc.h b/Core/DXUTmisc.h +index 9706ccc..74ab666 100644 +--- a/Core/DXUTmisc.h ++++ b/Core/DXUTmisc.h +@@ -62,23 +62,23 @@ struct DXUT_GAMEPAD + bool bLastRightTrigger; + }; + +-HRESULT DXUTGetGamepadState( _In_ DWORD dwPort, _In_ DXUT_GAMEPAD* pGamePad, _In_ bool bThumbstickDeadZone = true, ++HRESULT DXUT_API DXUTGetGamepadState( _In_ DWORD dwPort, _In_ DXUT_GAMEPAD* pGamePad, _In_ bool bThumbstickDeadZone = true, + _In_ bool bSnapThumbstickToCardinals = true ); +-HRESULT DXUTStopRumbleOnAllControllers(); +-void DXUTEnableXInput( _In_ bool bEnable ); ++HRESULT DXUT_API DXUTStopRumbleOnAllControllers(); ++void DXUT_API DXUTEnableXInput( _In_ bool bEnable ); + + + //-------------------------------------------------------------------------------------- + // Takes a screen shot of a 32bit D3D11 back buffer and saves the images to a BMP or DDS file + //-------------------------------------------------------------------------------------- + +-HRESULT DXUTSnapD3D11Screenshot( _In_z_ LPCWSTR szFileName, _In_ bool usedds = true ); ++HRESULT DXUT_API DXUTSnapD3D11Screenshot( _In_z_ LPCWSTR szFileName, _In_ bool usedds = true ); + + //-------------------------------------------------------------------------------------- + // Performs timer operations + // Use DXUTGetGlobalTimer() to get the global instance + //-------------------------------------------------------------------------------------- +-class CDXUTTimer ++class DXUT_API CDXUTTimer + { + public: + CDXUTTimer(); +@@ -109,24 +109,24 @@ protected: + LONGLONG m_llBaseTime; + }; + +-CDXUTTimer* WINAPI DXUTGetGlobalTimer(); ++DXUT_API CDXUTTimer* WINAPI DXUTGetGlobalTimer(); + + + //-------------------------------------------------------------------------------------- + // Returns the string for the given DXGI_FORMAT. + // bWithPrefix determines whether the string should include the "DXGI_FORMAT_" + //-------------------------------------------------------------------------------------- +-LPCWSTR WINAPI DXUTDXGIFormatToString( _In_ DXGI_FORMAT format, _In_ bool bWithPrefix ); ++DXUT_API LPCWSTR WINAPI DXUTDXGIFormatToString( _In_ DXGI_FORMAT format, _In_ bool bWithPrefix ); + + + //-------------------------------------------------------------------------------------- + // Debug printing support + // See dxerr.h for more debug printing support + //-------------------------------------------------------------------------------------- +-void WINAPI DXUTOutputDebugStringW( _In_z_ LPCWSTR strMsg, ... ); +-void WINAPI DXUTOutputDebugStringA( _In_z_ LPCSTR strMsg, ... ); +-HRESULT WINAPI DXUTTrace( _In_z_ const CHAR* strFile, _In_ DWORD dwLine, _In_ HRESULT hr, _In_z_ const WCHAR* strMsg, _In_ bool bPopMsgBox ); +-const WCHAR* WINAPI DXUTTraceWindowsMessage( _In_ UINT uMsg ); ++DXUT_API void WINAPI DXUTOutputDebugStringW( _In_z_ LPCWSTR strMsg, ... ); ++DXUT_API void WINAPI DXUTOutputDebugStringA( _In_z_ LPCSTR strMsg, ... ); ++DXUT_API HRESULT WINAPI DXUTTrace( _In_z_ const CHAR* strFile, _In_ DWORD dwLine, _In_ HRESULT hr, _In_z_ const WCHAR* strMsg, _In_ bool bPopMsgBox ); ++DXUT_API const WCHAR* WINAPI DXUTTraceWindowsMessage( _In_ UINT uMsg ); + + #ifdef UNICODE + #define DXUTOutputDebugString DXUTOutputDebugStringW +@@ -152,17 +152,17 @@ const WCHAR* WINAPI DXUTTraceWindowsMessage( _In_ UINT uMsg ); + // failure if APIs are not present. + //-------------------------------------------------------------------------------------- + +-int WINAPI DXUT_Dynamic_D3DPERF_BeginEvent( _In_ DWORD col, _In_z_ LPCWSTR wszName ); +-int WINAPI DXUT_Dynamic_D3DPERF_EndEvent( void ); +-void WINAPI DXUT_Dynamic_D3DPERF_SetMarker( _In_ DWORD col, _In_z_ LPCWSTR wszName ); +-void WINAPI DXUT_Dynamic_D3DPERF_SetRegion( _In_ DWORD col, _In_z_ LPCWSTR wszName ); +-BOOL WINAPI DXUT_Dynamic_D3DPERF_QueryRepeatFrame( void ); +-void WINAPI DXUT_Dynamic_D3DPERF_SetOptions( _In_ DWORD dwOptions ); +-DWORD WINAPI DXUT_Dynamic_D3DPERF_GetStatus(); +-HRESULT WINAPI DXUT_Dynamic_CreateDXGIFactory1( _In_ REFIID rInterface, _Out_ void** ppOut ); +-HRESULT WINAPI DXUT_Dynamic_DXGIGetDebugInterface( _In_ REFIID rInterface, _Out_ void** ppOut ); +- +-HRESULT WINAPI DXUT_Dynamic_D3D11CreateDevice( _In_opt_ IDXGIAdapter* pAdapter, ++DXUT_API int WINAPI DXUT_Dynamic_D3DPERF_BeginEvent( _In_ DWORD col, _In_z_ LPCWSTR wszName ); ++DXUT_API int WINAPI DXUT_Dynamic_D3DPERF_EndEvent( void ); ++DXUT_API void WINAPI DXUT_Dynamic_D3DPERF_SetMarker( _In_ DWORD col, _In_z_ LPCWSTR wszName ); ++DXUT_API void WINAPI DXUT_Dynamic_D3DPERF_SetRegion( _In_ DWORD col, _In_z_ LPCWSTR wszName ); ++DXUT_API BOOL WINAPI DXUT_Dynamic_D3DPERF_QueryRepeatFrame( void ); ++DXUT_API void WINAPI DXUT_Dynamic_D3DPERF_SetOptions( _In_ DWORD dwOptions ); ++DXUT_API DWORD WINAPI DXUT_Dynamic_D3DPERF_GetStatus(); ++DXUT_API HRESULT WINAPI DXUT_Dynamic_CreateDXGIFactory1( _In_ REFIID rInterface, _Out_ void** ppOut ); ++DXUT_API HRESULT WINAPI DXUT_Dynamic_DXGIGetDebugInterface( _In_ REFIID rInterface, _Out_ void** ppOut ); ++ ++DXUT_API HRESULT WINAPI DXUT_Dynamic_D3D11CreateDevice( _In_opt_ IDXGIAdapter* pAdapter, + _In_ D3D_DRIVER_TYPE DriverType, + _In_opt_ HMODULE Software, + _In_ UINT32 Flags, +@@ -173,7 +173,7 @@ HRESULT WINAPI DXUT_Dynamic_D3D11CreateDevice( _In_opt_ IDXGIAdapter* pAdapter, + _Out_opt_ D3D_FEATURE_LEVEL* pFeatureLevel, + _Out_opt_ ID3D11DeviceContext** ppImmediateContext ); + +-bool DXUT_EnsureD3D11APIs(); ++DXUT_API bool DXUT_EnsureD3D11APIs(); + + + //-------------------------------------------------------------------------------------- +@@ -285,14 +285,14 @@ typedef MONITORINFOEXW MONITORINFOEX; + typedef LPMONITORINFOEXW LPMONITORINFOEX; + #endif + +-HMONITOR WINAPI DXUTMonitorFromWindow( _In_ HWND hWnd, _In_ DWORD dwFlags ); +-HMONITOR WINAPI DXUTMonitorFromRect( _In_ LPCRECT lprcScreenCoords, _In_ DWORD dwFlags ); +-BOOL WINAPI DXUTGetMonitorInfo( _In_ HMONITOR hMonitor, _Out_ LPMONITORINFO lpMonitorInfo ); +-void WINAPI DXUTGetDesktopResolution( _In_ UINT AdapterOrdinal, _Out_ UINT* pWidth, _Out_ UINT* pHeight ); ++DXUT_API HMONITOR WINAPI DXUTMonitorFromWindow( _In_ HWND hWnd, _In_ DWORD dwFlags ); ++DXUT_API HMONITOR WINAPI DXUTMonitorFromRect( _In_ LPCRECT lprcScreenCoords, _In_ DWORD dwFlags ); ++DXUT_API BOOL WINAPI DXUTGetMonitorInfo( _In_ HMONITOR hMonitor, _Out_ LPMONITORINFO lpMonitorInfo ); ++DXUT_API void WINAPI DXUTGetDesktopResolution( _In_ UINT AdapterOrdinal, _Out_ UINT* pWidth, _Out_ UINT* pHeight ); + + + //-------------------------------------------------------------------------------------- + // Helper functions to create SRGB formats from typeless formats and vice versa + //-------------------------------------------------------------------------------------- +-DXGI_FORMAT MAKE_SRGB( _In_ DXGI_FORMAT format ); +-DXGI_FORMAT MAKE_TYPELESS( _In_ DXGI_FORMAT format ); ++DXUT_API DXGI_FORMAT MAKE_SRGB( _In_ DXGI_FORMAT format ); ++DXUT_API DXGI_FORMAT MAKE_TYPELESS( _In_ DXGI_FORMAT format ); +diff --git a/Core/ScreenGrab.h b/Core/ScreenGrab.h +index d643073..cf4eba6 100644 +--- a/Core/ScreenGrab.h ++++ b/Core/ScreenGrab.h +@@ -27,14 +27,20 @@ + #include + #include + ++#ifdef DXUT_EXPORT ++ #define DXUT_API __declspec(dllexport) ++#else ++ #define DXUT_API __declspec(dllimport) ++#endif ++ + + namespace DirectX + { +- HRESULT SaveDDSTextureToFile( _In_ ID3D11DeviceContext* pContext, ++ DXUT_API HRESULT SaveDDSTextureToFile( _In_ ID3D11DeviceContext* pContext, + _In_ ID3D11Resource* pSource, + _In_z_ LPCWSTR fileName ); + +- HRESULT SaveWICTextureToFile( _In_ ID3D11DeviceContext* pContext, ++ DXUT_API HRESULT SaveWICTextureToFile( _In_ ID3D11DeviceContext* pContext, + _In_ ID3D11Resource* pSource, + _In_ REFGUID guidContainerFormat, + _In_z_ LPCWSTR fileName, +diff --git a/Core/WICTextureLoader.h b/Core/WICTextureLoader.h +index 2b0340c..f2edacf 100644 +--- a/Core/WICTextureLoader.h ++++ b/Core/WICTextureLoader.h +@@ -30,11 +30,17 @@ + #include + #include + ++#ifdef DXUT_EXPORT ++ #define DXUT_API __declspec(dllexport) ++#else ++ #define DXUT_API __declspec(dllimport) ++#endif ++ + + namespace DirectX + { + // Standard version +- HRESULT CreateWICTextureFromMemory( _In_ ID3D11Device* d3dDevice, ++ DXUT_API HRESULT CreateWICTextureFromMemory( _In_ ID3D11Device* d3dDevice, + _In_reads_bytes_(wicDataSize) const uint8_t* wicData, + _In_ size_t wicDataSize, + _Out_opt_ ID3D11Resource** texture, +@@ -42,7 +48,7 @@ namespace DirectX + _In_ size_t maxsize = 0 + ); + +- HRESULT CreateWICTextureFromFile( _In_ ID3D11Device* d3dDevice, ++ DXUT_API HRESULT CreateWICTextureFromFile( _In_ ID3D11Device* d3dDevice, + _In_z_ const wchar_t* szFileName, + _Out_opt_ ID3D11Resource** texture, + _Out_opt_ ID3D11ShaderResourceView** textureView, +@@ -50,7 +56,7 @@ namespace DirectX + ); + + // Standard version with optional auto-gen mipmap support +- HRESULT CreateWICTextureFromMemory( _In_ ID3D11Device* d3dDevice, ++ DXUT_API HRESULT CreateWICTextureFromMemory( _In_ ID3D11Device* d3dDevice, + _In_opt_ ID3D11DeviceContext* d3dContext, + _In_reads_bytes_(wicDataSize) const uint8_t* wicData, + _In_ size_t wicDataSize, +@@ -59,7 +65,7 @@ namespace DirectX + _In_ size_t maxsize = 0 + ); + +- HRESULT CreateWICTextureFromFile( _In_ ID3D11Device* d3dDevice, ++ DXUT_API HRESULT CreateWICTextureFromFile( _In_ ID3D11Device* d3dDevice, + _In_opt_ ID3D11DeviceContext* d3dContext, + _In_z_ const wchar_t* szFileName, + _Out_opt_ ID3D11Resource** texture, +@@ -68,7 +74,7 @@ namespace DirectX + ); + + // Extended version +- HRESULT CreateWICTextureFromMemoryEx( _In_ ID3D11Device* d3dDevice, ++ DXUT_API HRESULT CreateWICTextureFromMemoryEx( _In_ ID3D11Device* d3dDevice, + _In_reads_bytes_(wicDataSize) const uint8_t* wicData, + _In_ size_t wicDataSize, + _In_ size_t maxsize, +@@ -81,7 +87,7 @@ namespace DirectX + _Out_opt_ ID3D11ShaderResourceView** textureView + ); + +- HRESULT CreateWICTextureFromFileEx( _In_ ID3D11Device* d3dDevice, ++ DXUT_API HRESULT CreateWICTextureFromFileEx( _In_ ID3D11Device* d3dDevice, + _In_z_ const wchar_t* szFileName, + _In_ size_t maxsize, + _In_ D3D11_USAGE usage, +@@ -94,7 +100,7 @@ namespace DirectX + ); + + // Extended version with optional auto-gen mipmap support +- HRESULT CreateWICTextureFromMemoryEx( _In_ ID3D11Device* d3dDevice, ++ DXUT_API HRESULT CreateWICTextureFromMemoryEx( _In_ ID3D11Device* d3dDevice, + _In_opt_ ID3D11DeviceContext* d3dContext, + _In_reads_bytes_(wicDataSize) const uint8_t* wicData, + _In_ size_t wicDataSize, +@@ -108,7 +114,7 @@ namespace DirectX + _Out_opt_ ID3D11ShaderResourceView** textureView + ); + +- HRESULT CreateWICTextureFromFileEx( _In_ ID3D11Device* d3dDevice, ++ DXUT_API HRESULT CreateWICTextureFromFileEx( _In_ ID3D11Device* d3dDevice, + _In_opt_ ID3D11DeviceContext* d3dContext, + _In_z_ const wchar_t* szFileName, + _In_ size_t maxsize, +diff --git a/Core/dxerr.h b/Core/dxerr.h +index 39e348d..9616dea 100644 +--- a/Core/dxerr.h ++++ b/Core/dxerr.h +@@ -25,7 +25,7 @@ extern "C" { + //-------------------------------------------------------------------------------------- + // DXGetErrorString + //-------------------------------------------------------------------------------------- +-const WCHAR* WINAPI DXGetErrorStringW( _In_ HRESULT hr ); ++DXUT_API const WCHAR* WINAPI DXGetErrorStringW( _In_ HRESULT hr ); + + #define DXGetErrorString DXGetErrorStringW + +@@ -33,7 +33,7 @@ const WCHAR* WINAPI DXGetErrorStringW( _In_ HRESULT hr ); + // DXGetErrorDescription has to be modified to return a copy in a buffer rather than + // the original static string. + //-------------------------------------------------------------------------------------- +-void WINAPI DXGetErrorDescriptionW( _In_ HRESULT hr, _Out_cap_(count) WCHAR* desc, _In_ size_t count ); ++void DXUT_API WINAPI DXGetErrorDescriptionW( _In_ HRESULT hr, _Out_cap_(count) WCHAR* desc, _In_ size_t count ); + + #define DXGetErrorDescription DXGetErrorDescriptionW + +@@ -52,7 +52,7 @@ void WINAPI DXGetErrorDescriptionW( _In_ HRESULT hr, _Out_cap_(count) WCHAR* des + // + // Return: The hr that was passed in. + //-------------------------------------------------------------------------------------- +-HRESULT WINAPI DXTraceW( _In_z_ const WCHAR* strFile, _In_ DWORD dwLine, _In_ HRESULT hr, _In_opt_ const WCHAR* strMsg, _In_ bool bPopMsgBox ); ++HRESULT DXUT_API WINAPI DXTraceW( _In_z_ const WCHAR* strFile, _In_ DWORD dwLine, _In_ HRESULT hr, _In_opt_ const WCHAR* strMsg, _In_ bool bPopMsgBox ); + + #define DXTrace DXTraceW + diff --git a/ports/dxut/portfile.cmake b/ports/dxut/portfile.cmake new file mode 100644 index 000000000..d69a6e147 --- /dev/null +++ b/ports/dxut/portfile.cmake @@ -0,0 +1,56 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/DXUT-sept2016) +vcpkg_download_distfile(ARCHIVE_FILE + URLS "https://github.com/Microsoft/DXUT/archive/sept2016.tar.gz" + FILENAME "DXUT-sept2016.tar.gz" + SHA512 190006c194284a1f5d614477896b0469a59ece05dff37477dadbe98808a5c33e274c0c1bb1390f22d1b5e06c9f534f4b50d6002157b2a391e01c2192b8e08869 +) +vcpkg_extract_source_archive(${ARCHIVE_FILE}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES ${CMAKE_CURRENT_LIST_DIR}/dll.patch +) + +vcpkg_build_msbuild( + PROJECT_PATH ${SOURCE_PATH}/Core/DXUT_2015.vcxproj +) + +IF (TRIPLET_SYSTEM_ARCH MATCHES "x86") + SET(BUILD_ARCH "Win32") +ELSE() + SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH}) +ENDIF() + +file(INSTALL + ${SOURCE_PATH}/Core/DDSTextureLoader.h + ${SOURCE_PATH}/Core/DXErr.h + ${SOURCE_PATH}/Core/DXUT.h + ${SOURCE_PATH}/Core/DXUTDevice11.h + ${SOURCE_PATH}/Core/DXUTmisc.h + ${SOURCE_PATH}/Core/Screengrab.h + ${SOURCE_PATH}/Core/WICTextureLoader.h + DESTINATION ${CURRENT_PACKAGES_DIR}/include +) + +file(INSTALL + ${SOURCE_PATH}/Core/Bin/Desktop_2015/${BUILD_ARCH}/Release/DXUT.dll + DESTINATION ${CURRENT_PACKAGES_DIR}/bin) + +file(INSTALL + ${SOURCE_PATH}/Core/Bin/Desktop_2015/${BUILD_ARCH}/Release/DXUT.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + +file(INSTALL + ${SOURCE_PATH}/Core/Bin/Desktop_2015/${BUILD_ARCH}/Debug/DXUT.dll + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) + +file(INSTALL + ${SOURCE_PATH}/Core/Bin/Desktop_2015/${BUILD_ARCH}/Debug/DXUT.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + +vcpkg_copy_pdbs() + +file(INSTALL ${SOURCE_PATH}/MIT.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/dxut RENAME copyright) + +message(STATUS "Installing done") -- cgit v1.2.3 From f2f018271f98960dd0343633042759eeafea2e20 Mon Sep 17 00:00:00 2001 From: Adam Martin Date: Thu, 20 Oct 2016 15:25:10 -0500 Subject: [fastlz] Added fastlz library Also did minor formating to the bullet3 portfile while using it for comparisson. The version was uncertain so I just used 1.0. --- ports/bullet3/portfile.cmake | 20 ++++++++++---------- ports/fastlz/CMakeLists.txt | 16 ++++++++++++++++ ports/fastlz/CONTROL | 3 +++ ports/fastlz/portfile.cmake | 26 ++++++++++++++++++++++++++ 4 files changed, 55 insertions(+), 10 deletions(-) create mode 100644 ports/fastlz/CMakeLists.txt create mode 100644 ports/fastlz/CONTROL create mode 100644 ports/fastlz/portfile.cmake diff --git a/ports/bullet3/portfile.cmake b/ports/bullet3/portfile.cmake index 171b70bc6..dbc206f5f 100644 --- a/ports/bullet3/portfile.cmake +++ b/ports/bullet3/portfile.cmake @@ -11,16 +11,16 @@ vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS - -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON - -DUSE_MSVC_RUNTIME_LIBRARY_DLL=ON - -DBUILD_DEMOS=OFF - -DBUILD_CPU_DEMOS=OFF - -DBUILD_BULLET2_DEMOS=OFF - -DBUILD_BULLET3=OFF - -DBUILD_EXTRAS=OFF - -DBUILD_UNIT_TESTS=OFF - -DBUILD_SHARED_LIBS=ON - -DINSTALL_LIBS=ON + -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON + -DUSE_MSVC_RUNTIME_LIBRARY_DLL=ON + -DBUILD_DEMOS=OFF + -DBUILD_CPU_DEMOS=OFF + -DBUILD_BULLET2_DEMOS=OFF + -DBUILD_BULLET3=OFF + -DBUILD_EXTRAS=OFF + -DBUILD_UNIT_TESTS=OFF + -DBUILD_SHARED_LIBS=ON + -DINSTALL_LIBS=ON ) vcpkg_build_cmake() diff --git a/ports/fastlz/CMakeLists.txt b/ports/fastlz/CMakeLists.txt new file mode 100644 index 000000000..a517c0d4b --- /dev/null +++ b/ports/fastlz/CMakeLists.txt @@ -0,0 +1,16 @@ +CMAKE_MINIMUM_REQUIRED ( VERSION 2.6) + +add_library (fastlz SHARED fastlz.c ) + +install (TARGETS fastlz DESTINATION + RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin + LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib + ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib +) +IF (NOT DEFINED SKIP_INSTALL_HEADERS) + INSTALL( + FILES + fastlz.h + DESTINATION include + ) +ENDIF () \ No newline at end of file diff --git a/ports/fastlz/CONTROL b/ports/fastlz/CONTROL new file mode 100644 index 000000000..089ba333e --- /dev/null +++ b/ports/fastlz/CONTROL @@ -0,0 +1,3 @@ +Source: fastlz +Version: 1.0 +Description: A lightning-fast lossless compression library diff --git a/ports/fastlz/portfile.cmake b/ports/fastlz/portfile.cmake new file mode 100644 index 000000000..f6252fb58 --- /dev/null +++ b/ports/fastlz/portfile.cmake @@ -0,0 +1,26 @@ +include(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/FastLZ-master) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/ariya/FastLZ/archive/master.zip" + FILENAME "fastlz.zip" + SHA512 2e7928a08b00c80b3a19936db1b2c7030b021e143db4811299b2548846499c735280e77fb101cb060031415c19028722add4c6ed86c1ddde3cd0d0de3f45d522 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/fastlz) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/fastlz/LICENSE ${CURRENT_PACKAGES_DIR}/share/fastlz/copyright) +vcpkg_copy_pdbs() -- cgit v1.2.3 From 2153670c51e530f403ff3d53c81635231861c78a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 20 Oct 2016 13:39:40 -0700 Subject: [fastlz] Point to specific hash instead of `master` --- ports/fastlz/portfile.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/fastlz/portfile.cmake b/ports/fastlz/portfile.cmake index f6252fb58..33161b56a 100644 --- a/ports/fastlz/portfile.cmake +++ b/ports/fastlz/portfile.cmake @@ -2,9 +2,9 @@ include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/FastLZ-master) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/ariya/FastLZ/archive/master.zip" + URLS "https://github.com/ariya/FastLZ/archive/f1217348a868bdb9ee0730244475aee05ab329c5.zip" FILENAME "fastlz.zip" - SHA512 2e7928a08b00c80b3a19936db1b2c7030b021e143db4811299b2548846499c735280e77fb101cb060031415c19028722add4c6ed86c1ddde3cd0d0de3f45d522 + SHA512 edfefbf4151e7ea6451a6fbb6d464a2a0f48ab50622f936634ec3ea4542ad3e1f075892a422e0fc5a23f2092be4ec890e6f91c4622bcd0d195fed84d4044d5df ) vcpkg_extract_source_archive(${ARCHIVE}) @@ -12,7 +12,7 @@ file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} - OPTIONS + OPTIONS -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON ) -- cgit v1.2.3 From 412a44c8f17aecb6f4a21844d0bff2ee5bc332d7 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 20 Oct 2016 13:48:13 -0700 Subject: [fastlz] Remove SHARED keyword to also allow building STATIC --- ports/fastlz/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/fastlz/CMakeLists.txt b/ports/fastlz/CMakeLists.txt index a517c0d4b..79a7a2a73 100644 --- a/ports/fastlz/CMakeLists.txt +++ b/ports/fastlz/CMakeLists.txt @@ -1,8 +1,8 @@ CMAKE_MINIMUM_REQUIRED ( VERSION 2.6) -add_library (fastlz SHARED fastlz.c ) +add_library (fastlz fastlz.c) -install (TARGETS fastlz DESTINATION +install (TARGETS fastlz DESTINATION RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib -- cgit v1.2.3 From 64ae9efffa71468835bcf9ee5b8c2026b86774b0 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 20 Oct 2016 14:09:02 -0700 Subject: [boost-di] Use vcpkg_download_distfile --- ports/boost-di/portfile.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ports/boost-di/portfile.cmake b/ports/boost-di/portfile.cmake index e09c813c2..83ea6afe9 100644 --- a/ports/boost-di/portfile.cmake +++ b/ports/boost-di/portfile.cmake @@ -14,4 +14,9 @@ file(INSTALL ${SOURCE_PATH}/include/boost # boost-di license does not exist in source folder. # it shares the boost license. -file(DOWNLOAD http://www.boost.org/LICENSE_1_0.txt ${CURRENT_PACKAGES_DIR}/share/boost-di/copyright) \ No newline at end of file +vcpkg_download_distfile(LICENSE + URLS http://www.boost.org/LICENSE_1_0.txt + FILENAME "boost-di-copyright" + SHA512 d6078467835dba8932314c1c1e945569a64b065474d7aced27c9a7acc391d52e9f234138ed9f1aa9cd576f25f12f557e0b733c14891d42c16ecdc4a7bd4d60b8 +) +file(INSTALL ${LICENSE} DESTINATION ${CURRENT_PACKAGES_DIR}/share/boost-di/copyright) \ No newline at end of file -- cgit v1.2.3 From 84f2975a581edc3bee6b3fffc6a8cc3ccf3d4ef6 Mon Sep 17 00:00:00 2001 From: sol-prog Date: Thu, 20 Oct 2016 14:13:40 -0700 Subject: Updated Glew to version 2.0.0 --- ports/glew/CONTROL | 2 +- ports/glew/portfile.cmake | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/glew/CONTROL b/ports/glew/CONTROL index f38f2dc40..13eb3262e 100644 --- a/ports/glew/CONTROL +++ b/ports/glew/CONTROL @@ -1,3 +1,3 @@ Source: glew -Version: 1.13.0 +Version: 2.0.0 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 416de51e5..93cd537c0 100644 --- a/ports/glew/portfile.cmake +++ b/ports/glew/portfile.cmake @@ -1,9 +1,9 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/glew-1.13.0) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/glew-2.0.0) vcpkg_download_distfile(ARCHIVE_FILE - URLS "http://downloads.sourceforge.net/project/glew/glew/1.13.0/glew-1.13.0.tgz" - FILENAME "glew-1.13.0.tgz" - SHA512 8fc8d7c0d2cd9235ea51db9972f492701827bff40642fdb3cc54c10b0737dba8e6d8d0dcd8c5aa5bfaaae39c6198ba3d4292cd1662fbe1977eb9a5d187ba635f + URLS "https://sourceforge.net/projects/glew/files/glew/2.0.0/glew-2.0.0.tgz" + FILENAME "glew-2.2.0.tgz" + SHA512 e9bcd5f19a4495ce6511dfd76e64b4e4d958603c513ee9063eb9fe24fc6e0413f168620661230f1baef558f2f907cef7fe7ab2bdf957a6f7bda5fe96e9319c6a ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) -- cgit v1.2.3 From 37d6623ea59cb85d524b184c8deb720732497a79 Mon Sep 17 00:00:00 2001 From: Eric Mittelette Date: Thu, 20 Oct 2016 14:17:28 -0700 Subject: adding catch --- ports/catch/CONTROL | 3 +++ ports/catch/portfile.cmake | 29 +++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 ports/catch/CONTROL create mode 100644 ports/catch/portfile.cmake diff --git a/ports/catch/CONTROL b/ports/catch/CONTROL new file mode 100644 index 000000000..893563e15 --- /dev/null +++ b/ports/catch/CONTROL @@ -0,0 +1,3 @@ +Source: catch +Version: 1.5.7 +Description: C++ Automated Test Cases in Headers diff --git a/ports/catch/portfile.cmake b/ports/catch/portfile.cmake new file mode 100644 index 000000000..bd55bb9ca --- /dev/null +++ b/ports/catch/portfile.cmake @@ -0,0 +1,29 @@ +# 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(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) + +vcpkg_download_distfile(HEADER + URLS "https://raw.githubusercontent.com/philsquared/Catch/master/single_include/catch.hpp" + #https://raw.githubusercontent.com/philsquared/Catch/master/LICENSE_1_0.txt + FILENAME "catch.hpp" + SHA512 64eec1c291826ef235433729dc18f150e47d2a761f80ec47264be08b3f756b310c6e3aa2c6c3c7b5e2f345f86489d561d9a694506654823077d0f6c7c22df7cd +) + +vcpkg_download_distfile(LICENSE + URLS "https://raw.githubusercontent.com/philsquared/Catch/master/LICENSE_1_0.txt" + FILENAME "License_1_0.txt" + SHA512 d6078467835dba8932314c1c1e945569a64b065474d7aced27c9a7acc391d52e9f234138ed9f1aa9cd576f25f12f557e0b733c14891d42c16ecdc4a7bd4d60b8 +) + +file(COPY ${HEADER} DESTINATION ${CURRENT_PACKAGES_DIR}/include ) +file(COPY ${LICENSE} DESTINATION ${CURRENT_PACKAGES_DIR}/share/catch ) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/catch/LICENSE_1_0.txt ${CURRENT_PACKAGES_DIR}/share/catch/copyright) + + -- cgit v1.2.3 From b9143c7180670f62aa59528488e28f166cc22a49 Mon Sep 17 00:00:00 2001 From: Eric Mittelette Date: Thu, 20 Oct 2016 14:24:50 -0700 Subject: adding a description to Ragel --- ports/ragel/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/ragel/CONTROL b/ports/ragel/CONTROL index 086159ab3..78aaf1679 100644 --- a/ports/ragel/CONTROL +++ b/ports/ragel/CONTROL @@ -1,3 +1,3 @@ Source: ragel Version: 6.9 -Description: +Description:Ragel State Machine Compiler -- cgit v1.2.3 From 4d06bfd30fef932a023436d11878edb6fe7225e6 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 20 Oct 2016 14:27:22 -0700 Subject: [glew] Fix download file typo --- ports/glew/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/glew/portfile.cmake b/ports/glew/portfile.cmake index 93cd537c0..5d4ce387f 100644 --- a/ports/glew/portfile.cmake +++ b/ports/glew/portfile.cmake @@ -2,7 +2,7 @@ include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/glew-2.0.0) vcpkg_download_distfile(ARCHIVE_FILE URLS "https://sourceforge.net/projects/glew/files/glew/2.0.0/glew-2.0.0.tgz" - FILENAME "glew-2.2.0.tgz" + FILENAME "glew-2.0.0.tgz" SHA512 e9bcd5f19a4495ce6511dfd76e64b4e4d958603c513ee9063eb9fe24fc6e0413f168620661230f1baef558f2f907cef7fe7ab2bdf957a6f7bda5fe96e9319c6a ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) -- cgit v1.2.3 From bcfe15ce2b29a2a31c9166bb2ee151582122d9c4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 20 Oct 2016 15:46:32 -0700 Subject: Add two spaces in front of message() to fix formatting In Warning or Error, indented text is considered preformatted. Otherwise CMake tries to format it itself, and there are issues with whitespace in the path --- scripts/cmake/vcpkg_execute_required_process.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/cmake/vcpkg_execute_required_process.cmake b/scripts/cmake/vcpkg_execute_required_process.cmake index bd6e56f7b..7feff08b2 100644 --- a/scripts/cmake/vcpkg_execute_required_process.cmake +++ b/scripts/cmake/vcpkg_execute_required_process.cmake @@ -12,9 +12,9 @@ function(vcpkg_execute_required_process) file(TO_NATIVE_PATH "${CURRENT_BUILDTREES_DIR}" NATIVE_BUILDTREES_DIR) if(error_code) message(FATAL_ERROR - "Command failed: ${vcpkg_execute_required_process_COMMAND}\n" - "Working Directory: ${vcpkg_execute_required_process_WORKING_DIRECTORY}\n" - "See logs for more information:\n" + " Command failed: ${vcpkg_execute_required_process_COMMAND}\n" + " Working Directory: ${vcpkg_execute_required_process_WORKING_DIRECTORY}\n" + " See logs for more information:\n" " ${NATIVE_BUILDTREES_DIR}\\${vcpkg_execute_required_process_LOGNAME}-out.log\n" " ${NATIVE_BUILDTREES_DIR}\\${vcpkg_execute_required_process_LOGNAME}-err.log\n") endif() -- cgit v1.2.3 From 337c96fc067ae5908d4cf5c8a188aa37588044ac Mon Sep 17 00:00:00 2001 From: flysha Date: Fri, 21 Oct 2016 07:44:00 +0800 Subject: Switch to using CertUtil to generate hash. --- toolsrc/src/commands_hash.cpp | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/toolsrc/src/commands_hash.cpp b/toolsrc/src/commands_hash.cpp index 672e24a24..20e960d02 100644 --- a/toolsrc/src/commands_hash.cpp +++ b/toolsrc/src/commands_hash.cpp @@ -9,14 +9,24 @@ namespace fs = std::tr2::sys; namespace vcpkg { - void file_hash_sha512(fs::path const & path, char const * hash) + void file_hash_sha512(fs::path const & path, std::wstring const & hashType) { - auto cmd_line = Strings::format("Powershell -Command (Get-FileHash %s -Algorithm %s).Hash.ToLower()", - Strings::utf16_to_utf8(path.c_str()), - hash); - auto ec_data = System::cmd_execute_and_capture_output(Strings::utf8_to_utf16(cmd_line)); - Checks::check_exit(ec_data.exit_code == 0, "Running command:\n %s\n failed", cmd_line); - System::print(ec_data.output.c_str()); + auto cmd_line = Strings::wformat(LR"(CertUtil.exe -hashfile "%s" %s)", + path.c_str(), hashType.c_str()); + auto ec_data = System::cmd_execute_and_capture_output(cmd_line); + Checks::check_exit(ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line)); + + std::string const & output = ec_data.output; + + auto start = output.find_first_of("\r\n"); + Checks::check_exit(start != std::string::npos, "Unexpected output format from command: %s", Strings::utf16_to_utf8(cmd_line)); + + auto end = output.find_first_of("\r\n", start + 1); + Checks::check_exit(end != std::string::npos, "Unexpected output format from command: %s", Strings::utf16_to_utf8(cmd_line)); + + auto hash = output.substr(start, end - start); + hash.erase(std::remove_if(hash.begin(), hash.end(), isspace), hash.end()); + System::println(hash.c_str()); } void hash_command(const vcpkg_cmd_arguments& args) @@ -28,11 +38,11 @@ namespace vcpkg if (args.command_arguments.size() == 1) { - file_hash_sha512(args.command_arguments[0], "SHA512"); + file_hash_sha512(args.command_arguments[0], L"SHA512"); } if (args.command_arguments.size() == 2) { - file_hash_sha512(args.command_arguments[0], args.command_arguments[1].c_str()); + file_hash_sha512(args.command_arguments[0], Strings::utf8_to_utf16(args.command_arguments[1])); } exit(EXIT_SUCCESS); -- cgit v1.2.3 From c12c3d90bee810abaec479c49d889957b52151db Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 20 Oct 2016 18:05:52 -0700 Subject: src Formatting --- toolsrc/include/vcpkg_Commands.h | 2 +- toolsrc/src/commands_hash.cpp | 76 ++++++++++++++++++++-------------------- toolsrc/src/commands_other.cpp | 6 ++-- 3 files changed, 42 insertions(+), 42 deletions(-) diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index dc4699dc0..3cc48ac89 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -35,7 +35,7 @@ namespace vcpkg void version_command(const vcpkg_cmd_arguments& args); void contact_command(const vcpkg_cmd_arguments& args); - void hash_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); diff --git a/toolsrc/src/commands_hash.cpp b/toolsrc/src/commands_hash.cpp index 20e960d02..07ce9d6e7 100644 --- a/toolsrc/src/commands_hash.cpp +++ b/toolsrc/src/commands_hash.cpp @@ -9,42 +9,42 @@ namespace fs = std::tr2::sys; namespace vcpkg { - void file_hash_sha512(fs::path const & path, std::wstring const & hashType) - { - auto cmd_line = Strings::wformat(LR"(CertUtil.exe -hashfile "%s" %s)", - path.c_str(), hashType.c_str()); - auto ec_data = System::cmd_execute_and_capture_output(cmd_line); - Checks::check_exit(ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line)); - - std::string const & output = ec_data.output; - - auto start = output.find_first_of("\r\n"); - Checks::check_exit(start != std::string::npos, "Unexpected output format from command: %s", Strings::utf16_to_utf8(cmd_line)); - - auto end = output.find_first_of("\r\n", start + 1); - Checks::check_exit(end != std::string::npos, "Unexpected output format from command: %s", Strings::utf16_to_utf8(cmd_line)); - - auto hash = output.substr(start, end - start); - hash.erase(std::remove_if(hash.begin(), hash.end(), isspace), hash.end()); - System::println(hash.c_str()); - } - - 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")); - args.check_min_arg_count(1, example.c_str()); - args.check_max_arg_count(2, example.c_str()); - - if (args.command_arguments.size() == 1) - { - file_hash_sha512(args.command_arguments[0], L"SHA512"); - } - if (args.command_arguments.size() == 2) - { - file_hash_sha512(args.command_arguments[0], Strings::utf8_to_utf16(args.command_arguments[1])); - } - - exit(EXIT_SUCCESS); - } + void file_hash_sha512(fs::path const& path, std::wstring const& hashType) + { + auto cmd_line = Strings::wformat(LR"(CertUtil.exe -hashfile "%s" %s)", + path.c_str(), hashType.c_str()); + auto ec_data = System::cmd_execute_and_capture_output(cmd_line); + Checks::check_exit(ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line)); + + std::string const& output = ec_data.output; + + auto start = output.find_first_of("\r\n"); + Checks::check_exit(start != std::string::npos, "Unexpected output format from command: %s", Strings::utf16_to_utf8(cmd_line)); + + auto end = output.find_first_of("\r\n", start + 1); + Checks::check_exit(end != std::string::npos, "Unexpected output format from command: %s", Strings::utf16_to_utf8(cmd_line)); + + auto hash = output.substr(start, end - start); + hash.erase(std::remove_if(hash.begin(), hash.end(), isspace), hash.end()); + System::println(hash.c_str()); + } + + 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")); + args.check_min_arg_count(1, example.c_str()); + args.check_max_arg_count(2, example.c_str()); + + if (args.command_arguments.size() == 1) + { + file_hash_sha512(args.command_arguments[0], L"SHA512"); + } + if (args.command_arguments.size() == 2) + { + file_hash_sha512(args.command_arguments[0], Strings::utf8_to_utf16(args.command_arguments[1])); + } + + exit(EXIT_SUCCESS); + } } diff --git a/toolsrc/src/commands_other.cpp b/toolsrc/src/commands_other.cpp index 53d6f2506..148673afe 100644 --- a/toolsrc/src/commands_other.cpp +++ b/toolsrc/src/commands_other.cpp @@ -14,7 +14,7 @@ namespace vcpkg " 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" + " vcpkg hash [alg] Hash a file by specific algorithm, default SHA512\n" "\n" "%s" // Integration help "\n" @@ -94,8 +94,8 @@ namespace vcpkg { static std::vector> t = { {"version", &version_command}, - {"contact", &contact_command}, - {"hash", &hash_command }, + {"contact", &contact_command}, + {"hash", &hash_command}, }; return t; } -- cgit v1.2.3 From e118c157198ee4218492cafb7ef3aaa1e3442c78 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 20 Oct 2016 18:06:26 -0700 Subject: Remove accidental copy of file --- toolsrc/vcpkg/commands_hash.cpp | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 toolsrc/vcpkg/commands_hash.cpp diff --git a/toolsrc/vcpkg/commands_hash.cpp b/toolsrc/vcpkg/commands_hash.cpp deleted file mode 100644 index e4e0e1747..000000000 --- a/toolsrc/vcpkg/commands_hash.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#include "vcpkg_Commands.h" -#include "vcpkg_System.h" -#include "vcpkg.h" -#include -#include -#include - -namespace fs = std::tr2::sys; - -namespace vcpkg -{ - void file_hash_sha512(fs::path const & path, char const * hash) - { - auto cmd_line = Strings::format("Powershell -Command (Get-FileHash %s -Algorithm %s).Hash.ToLower()", - Strings::utf16_to_utf8(path.c_str()), - hash); - auto ec_data = System::cmd_execute_and_capture_output(Strings::utf8_to_utf16(cmd_line)); - Checks::check_exit(ec_data.exit_code == 0, "Running command:\n %s\n failed", cmd_line); - System::print(ec_data.output.c_str()); - } - - 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 ")); - args.check_min_arg_count(1, example.c_str()); - args.check_max_arg_count(2, example.c_str()); - - if (args.command_arguments.size() == 1) - { - file_hash_sha512(args.command_arguments[0], "SHA512"); - } - if (args.command_arguments.size() == 2) - { - file_hash_sha512(args.command_arguments[0], args.command_arguments[1].c_str()); - } - - exit(EXIT_SUCCESS); - } -} -- cgit v1.2.3 From 251b3f03693a2001c0c4e8a5fdca2432e4a037a8 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 20 Oct 2016 18:11:50 -0700 Subject: Rename function and make it static --- toolsrc/src/commands_hash.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/toolsrc/src/commands_hash.cpp b/toolsrc/src/commands_hash.cpp index 07ce9d6e7..43e9456a7 100644 --- a/toolsrc/src/commands_hash.cpp +++ b/toolsrc/src/commands_hash.cpp @@ -9,7 +9,7 @@ namespace fs = std::tr2::sys; namespace vcpkg { - void file_hash_sha512(fs::path const& path, std::wstring const& hashType) + static void do_file_hash(fs::path const& path, std::wstring const& hashType) { auto cmd_line = Strings::wformat(LR"(CertUtil.exe -hashfile "%s" %s)", path.c_str(), hashType.c_str()); @@ -38,11 +38,11 @@ namespace vcpkg if (args.command_arguments.size() == 1) { - file_hash_sha512(args.command_arguments[0], L"SHA512"); + do_file_hash(args.command_arguments[0], L"SHA512"); } if (args.command_arguments.size() == 2) { - file_hash_sha512(args.command_arguments[0], Strings::utf8_to_utf16(args.command_arguments[1])); + do_file_hash(args.command_arguments[0], Strings::utf8_to_utf16(args.command_arguments[1])); } exit(EXIT_SUCCESS); -- cgit v1.2.3 From 1c37f9981d7f751d67d377bafc209d007a9be4b4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 20 Oct 2016 18:12:19 -0700 Subject: Remove unused include directives --- toolsrc/src/commands_hash.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/toolsrc/src/commands_hash.cpp b/toolsrc/src/commands_hash.cpp index 43e9456a7..4b89f2894 100644 --- a/toolsrc/src/commands_hash.cpp +++ b/toolsrc/src/commands_hash.cpp @@ -1,9 +1,5 @@ #include "vcpkg_Commands.h" #include "vcpkg_System.h" -#include "vcpkg.h" -#include -#include -#include namespace fs = std::tr2::sys; -- cgit v1.2.3 From d226583ed168013d5bf9200a28978f1cbfa2800e Mon Sep 17 00:00:00 2001 From: John Camp Date: Fri, 21 Oct 2016 00:32:17 -0400 Subject: Changed the download link to a static link. The different download link packaged the zip slightly differently, changing the hash as well as the src path. --- ports/pdcurses/portfile.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/pdcurses/portfile.cmake b/ports/pdcurses/portfile.cmake index c9fdb7fbc..be2f1fc4f 100644 --- a/ports/pdcurses/portfile.cmake +++ b/ports/pdcurses/portfile.cmake @@ -1,18 +1,18 @@ include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/PDCurses-3.4) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src) find_program(NMAKE nmake) vcpkg_download_distfile(ARCHIVE - URLS "https://sourceforge.net/projects/pdcurses/files/latest/download?source=files" + URLS "http://downloads.sourceforge.net/project/pdcurses/pdcurses/3.4/pdcurs34.zip" FILENAME "pdcurs34.zip" - SHA512 cf2144359935ea553954e60e74318168d4c6fcee48648dfec74325742a61786b285c59ad0a014cc1f4039a332c3dbf2031c64865025a0cd25ef8faacc5827d05 + SHA512 0b916bfe37517abb80df7313608cc4e1ed7659a41ce82763000dfdfa5b8311ffd439193c74fc84a591f343147212bf1caf89e7db71f1f7e4fa70f534834cb039 ) vcpkg_extract_source_archive(${ARCHIVE}) message(STATUS "Build ${TARGET_TRIPLET}") vcpkg_execute_required_process( - COMMAND ${NMAKE} -f vcwin32.mak WIDE=Y UTF8=Y PDCLIBS + COMMAND ${NMAKE} -f vcwin32.mak WIDE=Y UTF8=Y WORKING_DIRECTORY ${SOURCE_PATH}/win32 LOGNAME build-${TARGET_TRIPLET} ) -- cgit v1.2.3 From 5493eb4296b84e53e8036d4084deee2b596512a4 Mon Sep 17 00:00:00 2001 From: sdcb Date: Fri, 21 Oct 2016 17:12:48 +0800 Subject: Upgrade cpprestsdk to 2.9.0 --- ...ckage-on-Windows.-Enable-install-target-f.patch | 107 --------------------- ports/cpprestsdk/0001_cmake.patch | 96 ++++++++++++++++++ ports/cpprestsdk/CONTROL | 2 +- ports/cpprestsdk/portfile.cmake | 59 +++++------- 4 files changed, 120 insertions(+), 144 deletions(-) delete mode 100644 ports/cpprestsdk/0001-Use-find_package-on-Windows.-Enable-install-target-f.patch create mode 100644 ports/cpprestsdk/0001_cmake.patch diff --git a/ports/cpprestsdk/0001-Use-find_package-on-Windows.-Enable-install-target-f.patch b/ports/cpprestsdk/0001-Use-find_package-on-Windows.-Enable-install-target-f.patch deleted file mode 100644 index 40e6a5ce3..000000000 --- a/ports/cpprestsdk/0001-Use-find_package-on-Windows.-Enable-install-target-f.patch +++ /dev/null @@ -1,107 +0,0 @@ -From cc9d3ca4d1d16134a1976b89b58b11372a2798d5 Mon Sep 17 00:00:00 2001 -From: Robert Schumacher -Date: Wed, 4 May 2016 21:37:23 -0700 -Subject: [PATCH] Use find_package on Windows. Enable 'install' target for all - systems. - ---- - Release/CMakeLists.txt | 48 ++++++++++++++-------------------------------- - Release/src/CMakeLists.txt | 13 +++++++------ - 2 files changed, 21 insertions(+), 40 deletions(-) - -diff --git a/Release/CMakeLists.txt b/Release/CMakeLists.txt -index cbe840b..3045948 100644 ---- a/Release/CMakeLists.txt -+++ b/Release/CMakeLists.txt -@@ -89,15 +89,6 @@ elseif(UNIX) # This includes OSX - - option(BUILD_SHARED_LIBS "Build shared Libraries." ON) - option(BUILD_SAMPLES "Build samples." ON) -- option(CASA_INSTALL_HEADERS "Install header files." ON) -- if(CASA_INSTALL_HEADERS) -- file(GLOB CASA_HEADERS_CPPREST include/cpprest/*.hpp include/cpprest/*.h include/cpprest/*.dat) -- install(FILES ${CASA_HEADERS_CPPREST} DESTINATION include/cpprest) -- file(GLOB CASA_HEADERS_PPLX include/pplx/*.hpp include/pplx/*.h) -- install(FILES ${CASA_HEADERS_PPLX} DESTINATION include/pplx) -- file(GLOB CASA_HEADERS_DETAILS include/cpprest/details/*.hpp include/cpprest/details/*.h include/cpprest/details/*.dat) -- install(FILES ${CASA_HEADERS_DETAILS} DESTINATION include/cpprest/details) -- endif() - elseif(WIN32) - option(BUILD_SHARED_LIBS "Build shared Libraries." ON) - option(BUILD_SAMPLES "Build samples." ON) -@@ -114,36 +105,25 @@ elseif(WIN32) - endif() - add_definitions(${Casablanca_DEFINITIONS} -D_WINSOCK_DEPRECATED_NO_WARNINGS -DWIN32) - -- if (NOT CPPREST_EXCLUDE_WEBSOCKETS) -- set(NUGET_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../packages") -- set(PACKAGE_PATHS) -- list(APPEND PACKAGE_PATHS "${NUGET_PATH}/boost.1.58.0.0/") -- list(APPEND PACKAGE_PATHS "${NUGET_PATH}/boost_system-vc140.1.58.0-vs140rc/") -- list(APPEND PACKAGE_PATHS "${NUGET_PATH}/boost_date_time-vc140.1.58.0-vs140rc/") -- list(APPEND PACKAGE_PATHS "${NUGET_PATH}/boost_regex-vc140.1.58.0-vs140rc/") -- list(APPEND PACKAGE_PATHS "${NUGET_PATH}/openssl.v140.windesktop.msvcstl.static.rt-dyn.x64.1.0.2.1/") -- list(APPEND PACKAGE_PATHS "${NUGET_PATH}/zlib.v140.windesktop.msvcstl.static.rt-dyn.1.2.8.8/") -- -- if (NOT WINDOWS_STORE AND NOT WINDOWS_PHONE) -- find_library(Boost_SYSTEM_LIBRARY libboost_system-vc140-mt-gd-1_58.lib PATHS ${PACKAGE_PATHS} PATH_SUFFIXES lib/native/address-model-64/lib) -- find_library(Boost_DATE_TIME_LIBRARY libboost_date_time-vc140-mt-gd-1_58.lib PATHS ${PACKAGE_PATHS} PATH_SUFFIXES lib/native/address-model-64/lib) -- find_library(Boost_REGEX_LIBRARY libboost_regex-vc140-mt-gd-1_58.lib PATHS ${PACKAGE_PATHS} PATH_SUFFIXES lib/native/address-model-64/lib) -- set(Boost_LIBRARIES ${Boost_REGEX_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_DATE_TIME_LIBRARY}) -- -- find_library(OpenSSL_libeay_LIBRARY libeay32.lib PATHS ${PACKAGE_PATHS} PATH_SUFFIXES lib/native/v140/windesktop/msvcstl/static/rt-dyn/x64/debug) -- find_library(OpenSSL_ssleay_LIBRARY ssleay32.lib PATHS ${PACKAGE_PATHS} PATH_SUFFIXES lib/native/v140/windesktop/msvcstl/static/rt-dyn/x64/debug) -- find_library(ZLIB_LIBRARY zlibstaticd.lib PATHS ${PACKAGE_PATHS} PATH_SUFFIXES lib/native/v140/windesktop/msvcstl/static/rt-dyn/x64/debug) -- set(OPENSSL_LIBRARIES ${OpenSSL_ssleay_LIBRARY} ${OpenSSL_libeay_LIBRARY} ${ZLIB_LIBRARY}) -- -- set(OPENSSL_INCLUDE_DIR "${NUGET_PATH}/openssl.v140.windesktop.msvcstl.static.rt-dyn.x64.1.0.2.1/build/native/include") -- endif() -- -- set(Boost_INCLUDE_DIR "${NUGET_PATH}/boost.1.58.0.0/lib/native/include") -+ if (NOT CPPREST_EXCLUDE_WEBSOCKETS AND NOT WINDOWS_STORE) -+ find_package(ZLIB REQUIRED) -+ find_package(OpenSSL REQUIRED) -+ find_package(Boost REQUIRED COMPONENTS regex system date_time) - endif() - else() - message(FATAL_ERROR "-- Unsupported Build Platform.") - endif() - -+option(CASA_INSTALL_HEADERS "Install header files." ON) -+if(CASA_INSTALL_HEADERS) -+ file(GLOB CASA_HEADERS_CPPREST include/cpprest/*.hpp include/cpprest/*.h include/cpprest/*.dat) -+ install(FILES ${CASA_HEADERS_CPPREST} DESTINATION include/cpprest) -+ file(GLOB CASA_HEADERS_PPLX include/pplx/*.hpp include/pplx/*.h) -+ install(FILES ${CASA_HEADERS_PPLX} DESTINATION include/pplx) -+ file(GLOB CASA_HEADERS_DETAILS include/cpprest/details/*.hpp include/cpprest/details/*.h include/cpprest/details/*.dat) -+ install(FILES ${CASA_HEADERS_DETAILS} DESTINATION include/cpprest/details) -+endif() -+ - # Compiler (not platform) specific settings - if(ANDROID) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-strict-aliasing") -diff --git a/Release/src/CMakeLists.txt b/Release/src/CMakeLists.txt -index cf086ed..3e5fffa 100644 ---- a/Release/src/CMakeLists.txt -+++ b/Release/src/CMakeLists.txt -@@ -144,10 +144,11 @@ elseif(ANDROID) - else() - set_target_properties(cpprest PROPERTIES - SOVERSION ${CPPREST_VERSION_MAJOR}.${CPPREST_VERSION_MINOR}) -- -- install( -- TARGETS cpprest -- LIBRARY DESTINATION lib -- ARCHIVE DESTINATION lib -- ) - endif() -+ -+install( -+ TARGETS cpprest -+ RUNTIME DESTINATION bin -+ LIBRARY DESTINATION lib -+ ARCHIVE DESTINATION lib -+ ) --- -2.8.1.windows.1 - diff --git a/ports/cpprestsdk/0001_cmake.patch b/ports/cpprestsdk/0001_cmake.patch new file mode 100644 index 000000000..be8f2cff7 --- /dev/null +++ b/ports/cpprestsdk/0001_cmake.patch @@ -0,0 +1,96 @@ +diff --git a/Release/CMakeLists.txt b/Release/CMakeLists.txt +index 1274102..fe245e6 100644 +--- a/Release/CMakeLists.txt ++++ b/Release/CMakeLists.txt +@@ -89,15 +89,6 @@ elseif(UNIX) # This includes OSX + + option(BUILD_SHARED_LIBS "Build shared Libraries." ON) + option(BUILD_SAMPLES "Build samples." ON) +- option(CASA_INSTALL_HEADERS "Install header files." ON) +- if(CASA_INSTALL_HEADERS) +- file(GLOB CASA_HEADERS_CPPREST include/cpprest/*.hpp include/cpprest/*.h include/cpprest/*.dat) +- install(FILES ${CASA_HEADERS_CPPREST} DESTINATION include/cpprest) +- file(GLOB CASA_HEADERS_PPLX include/pplx/*.hpp include/pplx/*.h) +- install(FILES ${CASA_HEADERS_PPLX} DESTINATION include/pplx) +- file(GLOB CASA_HEADERS_DETAILS include/cpprest/details/*.hpp include/cpprest/details/*.h include/cpprest/details/*.dat) +- install(FILES ${CASA_HEADERS_DETAILS} DESTINATION include/cpprest/details) +- endif() + elseif(WIN32) + option(BUILD_SHARED_LIBS "Build shared Libraries." ON) + option(BUILD_SAMPLES "Build samples." ON) +@@ -113,37 +104,25 @@ elseif(WIN32) + set(Casablanca_DEFINITIONS "" CACHE INTERNAL "Definitions for consume casablanca library") + endif() + add_definitions(${Casablanca_DEFINITIONS} -D_WINSOCK_DEPRECATED_NO_WARNINGS -DWIN32) +- +- if (NOT CPPREST_EXCLUDE_WEBSOCKETS) +- set(NUGET_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../packages") +- set(PACKAGE_PATHS) +- list(APPEND PACKAGE_PATHS "${NUGET_PATH}/boost.1.58.0.0/") +- list(APPEND PACKAGE_PATHS "${NUGET_PATH}/boost_system-vc140.1.58.0-vs140rc/") +- list(APPEND PACKAGE_PATHS "${NUGET_PATH}/boost_date_time-vc140.1.58.0-vs140rc/") +- list(APPEND PACKAGE_PATHS "${NUGET_PATH}/boost_regex-vc140.1.58.0-vs140rc/") +- list(APPEND PACKAGE_PATHS "${NUGET_PATH}/openssl.v140.windesktop.msvcstl.static.rt-dyn.x64.1.0.2.1/") +- list(APPEND PACKAGE_PATHS "${NUGET_PATH}/zlib.v140.windesktop.msvcstl.static.rt-dyn.1.2.8.8/") +- +- if (NOT WINDOWS_STORE AND NOT WINDOWS_PHONE) +- find_library(Boost_SYSTEM_LIBRARY libboost_system-vc140-mt-gd-1_58.lib PATHS ${PACKAGE_PATHS} PATH_SUFFIXES lib/native/address-model-64/lib) +- find_library(Boost_DATE_TIME_LIBRARY libboost_date_time-vc140-mt-gd-1_58.lib PATHS ${PACKAGE_PATHS} PATH_SUFFIXES lib/native/address-model-64/lib) +- find_library(Boost_REGEX_LIBRARY libboost_regex-vc140-mt-gd-1_58.lib PATHS ${PACKAGE_PATHS} PATH_SUFFIXES lib/native/address-model-64/lib) +- set(Boost_LIBRARIES ${Boost_REGEX_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_DATE_TIME_LIBRARY}) +- +- find_library(OpenSSL_libeay_LIBRARY libeay32.lib PATHS ${PACKAGE_PATHS} PATH_SUFFIXES lib/native/v140/windesktop/msvcstl/static/rt-dyn/x64/debug) +- find_library(OpenSSL_ssleay_LIBRARY ssleay32.lib PATHS ${PACKAGE_PATHS} PATH_SUFFIXES lib/native/v140/windesktop/msvcstl/static/rt-dyn/x64/debug) +- find_library(ZLIB_LIBRARY zlibstaticd.lib PATHS ${PACKAGE_PATHS} PATH_SUFFIXES lib/native/v140/windesktop/msvcstl/static/rt-dyn/x64/debug) +- set(OPENSSL_LIBRARIES ${OpenSSL_ssleay_LIBRARY} ${OpenSSL_libeay_LIBRARY} ${ZLIB_LIBRARY}) +- +- set(OPENSSL_INCLUDE_DIR "${NUGET_PATH}/openssl.v140.windesktop.msvcstl.static.rt-dyn.x64.1.0.2.1/build/native/include") +- endif() +- +- set(Boost_INCLUDE_DIR "${NUGET_PATH}/boost.1.58.0.0/lib/native/include") +- endif() ++ if (NOT CPPREST_EXCLUDE_WEBSOCKETS AND NOT WINDOWS_STORE) ++ find_package(ZLIB REQUIRED) ++ find_package(OpenSSL REQUIRED) ++ find_package(Boost REQUIRED COMPONENTS regex system date_time) ++ endif() + else() + message(FATAL_ERROR "-- Unsupported Build Platform.") + endif() + ++option(CASA_INSTALL_HEADERS "Install header files." ON) ++if(CASA_INSTALL_HEADERS) ++ file(GLOB CASA_HEADERS_CPPREST include/cpprest/*.hpp include/cpprest/*.h include/cpprest/*.dat) ++ install(FILES ${CASA_HEADERS_CPPREST} DESTINATION include/cpprest) ++ file(GLOB CASA_HEADERS_PPLX include/pplx/*.hpp include/pplx/*.h) ++ install(FILES ${CASA_HEADERS_PPLX} DESTINATION include/pplx) ++ file(GLOB CASA_HEADERS_DETAILS include/cpprest/details/*.hpp include/cpprest/details/*.h include/cpprest/details/*.dat) ++ install(FILES ${CASA_HEADERS_DETAILS} DESTINATION include/cpprest/details) ++endif() ++ + # Compiler (not platform) specific settings + if(ANDROID) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-strict-aliasing") +diff --git a/Release/src/CMakeLists.txt b/Release/src/CMakeLists.txt +index 4074905..da907e5 100644 +--- a/Release/src/CMakeLists.txt ++++ b/Release/src/CMakeLists.txt +@@ -144,10 +144,11 @@ elseif(ANDROID) + else() + set_target_properties(cpprest PROPERTIES + SOVERSION ${CPPREST_VERSION_MAJOR}.${CPPREST_VERSION_MINOR}) +- +- install( +- TARGETS cpprest +- LIBRARY DESTINATION lib +- ARCHIVE DESTINATION lib +- ) + endif() ++ ++install( ++ TARGETS cpprest ++ RUNTIME DESTINATION bin ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib ++ ) +\ No newline at end of file diff --git a/ports/cpprestsdk/CONTROL b/ports/cpprestsdk/CONTROL index eca83755b..4c55c7060 100644 --- a/ports/cpprestsdk/CONTROL +++ b/ports/cpprestsdk/CONTROL @@ -1,4 +1,4 @@ Source: cpprestsdk -Version: 2.8 +Version: 2.9.0 Description: C++11 JSON, REST, and OAuth library The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services. \ No newline at end of file diff --git a/ports/cpprestsdk/portfile.cmake b/ports/cpprestsdk/portfile.cmake index 11db7c379..3fb63ae80 100644 --- a/ports/cpprestsdk/portfile.cmake +++ b/ports/cpprestsdk/portfile.cmake @@ -1,49 +1,36 @@ +include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) -find_program(GIT git) - -set(GIT_URL "https://github.com/Microsoft/cpprestsdk") -set(GIT_REF "3542f07") - -if(NOT EXISTS "${DOWNLOADS}/cpprestsdk.git") - message(STATUS "Cloning") - vcpkg_execute_required_process( - COMMAND ${GIT} clone --bare ${GIT_URL} ${DOWNLOADS}/cpprestsdk.git - WORKING_DIRECTORY ${DOWNLOADS} - LOGNAME clone - ) -endif() -message(STATUS "Cloning done") - -if(NOT EXISTS "${CURRENT_BUILDTREES_DIR}/src/.git") - message(STATUS "Adding worktree and patching") - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}) - vcpkg_execute_required_process( - COMMAND ${GIT} worktree add -f --detach ${CURRENT_BUILDTREES_DIR}/src ${GIT_REF} - WORKING_DIRECTORY ${DOWNLOADS}/cpprestsdk.git - LOGNAME worktree - ) - message(STATUS "Patching") - vcpkg_execute_required_process( - COMMAND ${GIT} apply ${CMAKE_CURRENT_LIST_DIR}/0001-Use-find_package-on-Windows.-Enable-install-target-f.patch --ignore-whitespace --whitespace=fix - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/src - LOGNAME patch - ) -endif() -message(STATUS "Adding worktree and patching done") +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/cpprestsdk-2.9.0) + +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/Microsoft/cpprestsdk/archive/v2.9.0.tar.gz" + FILENAME "cpprestsdk-2.9.0.tar.gz" + SHA512 c75de6ad33b3e8d2c6ba7c0955ed851d557f78652fb38a565de0cfbc99e7db89cb6fa405857512e5149df80356c51ae9335abd914c3c593fa6658ac50adf4e29 +) +vcpkg_extract_source_archive(${ARCHIVE}) + + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/0001_cmake.patch +) vcpkg_configure_cmake( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/Release + SOURCE_PATH ${SOURCE_PATH}/Release OPTIONS -DBUILD_TESTS=OFF -DBUILD_SAMPLES=OFF -DCPPREST_EXCLUDE_WEBSOCKETS=ON - OPTIONS_DEBUG - -DCASA_INSTALL_HEADERS=OFF ) vcpkg_install_cmake() -file(COPY ${CURRENT_BUILDTREES_DIR}/src/license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/cpprestsdk) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/cpprestsdk/license.txt ${CURRENT_PACKAGES_DIR}/share/cpprestsdk/copyright) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +file(INSTALL + ${SOURCE_PATH}/license.txt + DESTINATION ${CURRENT_PACKAGES_DIR}/share/cpprestsdk RENAME copyright) + vcpkg_copy_pdbs() -- cgit v1.2.3 From 4bf9b4db060b1dcd499c40fcba4edd0008d29679 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Fri, 21 Oct 2016 08:28:28 -0400 Subject: [libccd] Add libccd 2.0.0 (tip commit of current master) --- ports/libccd/CONTROL | 3 +++ ports/libccd/portfile.cmake | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 ports/libccd/CONTROL create mode 100644 ports/libccd/portfile.cmake diff --git a/ports/libccd/CONTROL b/ports/libccd/CONTROL new file mode 100644 index 000000000..3a3a0252d --- /dev/null +++ b/ports/libccd/CONTROL @@ -0,0 +1,3 @@ +Source: libccd +Version: 2.0.0 +Description: Library for collision detection between two convex shapes diff --git a/ports/libccd/portfile.cmake b/ports/libccd/portfile.cmake new file mode 100644 index 000000000..8417689fd --- /dev/null +++ b/ports/libccd/portfile.cmake @@ -0,0 +1,33 @@ +# 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(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libccd-16b9379fb6e8610566fe5e1396166daf7106f165) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/danfis/libccd/archive/16b9379fb6e8610566fe5e1396166daf7106f165.zip" + FILENAME "libccd-16b9379fb6e8610566fe5e1396166daf7106f165.zip" + SHA512 6cb3ea713f1b1ac1bf48c9ee7e14cb85b3ec5c822ce239330913edc00cb84c846b49ec090cbfa226ef8de70bac97199eb2bf4c651225e3cfc6f6a9dd441aa7db +) +vcpkg_extract_source_archive(${ARCHIVE}) + +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() + +# Avoid a copy of file in debug +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug) + +# Handle copyright +file(COPY ${SOURCE_PATH}/BSD-LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libccd) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/libccd/BSD-LICENSE ${CURRENT_PACKAGES_DIR}/share/libccd/copyright) -- cgit v1.2.3 From eae7c5a75b472fd89ad73c5484167bac75c32755 Mon Sep 17 00:00:00 2001 From: Silvio Date: Fri, 21 Oct 2016 22:45:44 +0200 Subject: Add zziplib port To facilitate support of VS2015 in all the different configurations, a CMake-based build system based on the one found in https://sourceforge.net/p/zziplib/patches/17/ is used. --- ports/zziplib/CMakeLists.txt | 70 ++++++++++++++++++++++++++++++++++++++++++++ ports/zziplib/CONTROL | 4 +++ ports/zziplib/portfile.cmake | 23 +++++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 ports/zziplib/CMakeLists.txt create mode 100644 ports/zziplib/CONTROL create mode 100644 ports/zziplib/portfile.cmake diff --git a/ports/zziplib/CMakeLists.txt b/ports/zziplib/CMakeLists.txt new file mode 100644 index 000000000..7f46079e9 --- /dev/null +++ b/ports/zziplib/CMakeLists.txt @@ -0,0 +1,70 @@ +cmake_minimum_required(VERSION 3.0) + +include(GNUInstallDirs) + +project(zziplib C) + +find_package(zlib) + +include_directories(${ZLIB_INCLUDE_DIRS}) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) + +if(MSVC) + set(CMAKE_DEBUG_POSTFIX "d") + add_definitions(-D_CRT_SECURE_NO_DEPRECATE) + add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) +endif() + +option(BUILD_SHARED_LIBS "Build shared libraries" ON) + +# List the header files +set(HEADERS zzip/__debug.h + zzip/__dirent.h + zzip/__fnmatch.h + zzip/__hints.h + zzip/__mmap.h + zzip/_config.h + zzip/_msvc.h + zzip/autoconf.h + zzip/conf.h + zzip/fetch.h + zzip/file.h + zzip/format.h + zzip/fseeko.h + zzip/info.h + zzip/lib.h + zzip/memdisk.h + zzip/mmapped.h + zzip/plugin.h + zzip/stdint.h + zzip/types.h + zzip/write.h + zzip/zzip.h +) + +# List the source files +set(SRCS zzip/dir.c + zzip/err.c + zzip/fetch.c + zzip/file.c + zzip/info.c + zzip/plugin.c + zzip/stat.c + zzip/zip.c +) + +add_library(zziplib ${SRCS} ${HEADERS}) + +if(${BUILD_SHARED_LIBS}) + target_compile_definitions(zziplib PRIVATE -DZZIPLIB_EXPORTS) +endif() + +target_link_libraries(zziplib ${ZLIB_LIBRARIES}) + +install(TARGETS zziplib + COMPONENT runtime + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT lib) + +install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/zzip) \ No newline at end of file diff --git a/ports/zziplib/CONTROL b/ports/zziplib/CONTROL new file mode 100644 index 000000000..235b72c63 --- /dev/null +++ b/ports/zziplib/CONTROL @@ -0,0 +1,4 @@ +Source: zziplib +Version: 0.13.62 +Build-Depends: zlib +Description: library providing read access on ZIP-archives diff --git a/ports/zziplib/portfile.cmake b/ports/zziplib/portfile.cmake new file mode 100644 index 000000000..3e21be80b --- /dev/null +++ b/ports/zziplib/portfile.cmake @@ -0,0 +1,23 @@ +include(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/zziplib-0.13.62) +vcpkg_download_distfile(ARCHIVE + URLS "https://sourceforge.net/projects/zziplib/files/zziplib13/0.13.62/zziplib-0.13.62.tar.bz2/download" + FILENAME "zziplib-0.13.62.tar.bz2" + SHA512 fd3b9e9015ba7603bdebd8f6a2ac6d11003705bfab22f3a0025f75455042664aea69440845b59e6f389417dff5ac777f49541d8cbacb2a220e67d20bb6973e25 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# Handle copyright +file(COPY ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/zziplib) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/zziplib/COPYING.LIB ${CURRENT_PACKAGES_DIR}/share/zziplib/copyright) -- cgit v1.2.3 From ff10906a4b1f08f813592699c5e2734cda252845 Mon Sep 17 00:00:00 2001 From: Jens Frederich Date: Sat, 22 Oct 2016 21:35:24 +0200 Subject: [think-cell-range] Adding think-cell's range library https://www.think-cell.com/en/career/talks/ranges/#1 Signed-off-by: Jens Frederich --- ports/think-cell-range/CONTROL | 5 +++++ ports/think-cell-range/portfile.cmake | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 ports/think-cell-range/CONTROL create mode 100644 ports/think-cell-range/portfile.cmake diff --git a/ports/think-cell-range/CONTROL b/ports/think-cell-range/CONTROL new file mode 100644 index 000000000..8c7ff0db9 --- /dev/null +++ b/ports/think-cell-range/CONTROL @@ -0,0 +1,5 @@ +Source: think-cell-range +Maintainer: jfrederich@gmail.com +Version: 61e184a +Description: think-cell's range library (https://www.think-cell.com/en/career/talks/ranges/#1) +Build-Depends: boost diff --git a/ports/think-cell-range/portfile.cmake b/ports/think-cell-range/portfile.cmake new file mode 100644 index 000000000..cc0614e4c --- /dev/null +++ b/ports/think-cell-range/portfile.cmake @@ -0,0 +1,20 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/range-61e184a102d7818fd18f293c9ef99e6ebb59c222) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/think-cell/range/archive/61e184a102d7818fd18f293c9ef99e6ebb59c222.zip" + FILENAME "think-cell_range-61e184a.zip" + SHA512 1d27039918954624f98638636d107b4f8a997bee264552437f6229da4bce7fda31e67ac6f7b3b92a6dfa8d466b4ca6c05c1e516f3e7b37e0853d7d4153ef9587 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +file(INSTALL ${SOURCE_PATH}/range DESTINATION ${CURRENT_PACKAGES_DIR}/include/think-cell FILES_MATCHING PATTERN "*.h") + +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/think-cell-range) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/think-cell-range/COPYING ${CURRENT_PACKAGES_DIR}/share/think-cell-range/copyright) + +file(COPY ${SOURCE_PATH}/range/range.example.cpp DESTINATION ${CURRENT_PACKAGES_DIR}/share/think-cell-range) + +vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_INSTALLED_DIR}/include + PATCHES "${SOURCE_PATH}/boost_patches/has_range_iterator.patch" +) -- cgit v1.2.3 From 7ed2525767f1e7c79f8439d3bc7092ecfaa4f581 Mon Sep 17 00:00:00 2001 From: Jens Frederich Date: Sat, 22 Oct 2016 23:21:19 +0200 Subject: copy README.md to save important notes, precise description Signed-off-by: Jens Frederich --- ports/think-cell-range/CONTROL | 2 +- ports/think-cell-range/portfile.cmake | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ports/think-cell-range/CONTROL b/ports/think-cell-range/CONTROL index 8c7ff0db9..0311dd1ae 100644 --- a/ports/think-cell-range/CONTROL +++ b/ports/think-cell-range/CONTROL @@ -1,5 +1,5 @@ Source: think-cell-range Maintainer: jfrederich@gmail.com Version: 61e184a -Description: think-cell's range library (https://www.think-cell.com/en/career/talks/ranges/#1) +Description: think-cell's range library , , Build-Depends: boost diff --git a/ports/think-cell-range/portfile.cmake b/ports/think-cell-range/portfile.cmake index cc0614e4c..c5537546e 100644 --- a/ports/think-cell-range/portfile.cmake +++ b/ports/think-cell-range/portfile.cmake @@ -11,6 +11,7 @@ file(INSTALL ${SOURCE_PATH}/range DESTINATION ${CURRENT_PACKAGES_DIR}/include/th file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/think-cell-range) file(RENAME ${CURRENT_PACKAGES_DIR}/share/think-cell-range/COPYING ${CURRENT_PACKAGES_DIR}/share/think-cell-range/copyright) +file(COPY ${SOURCE_PATH}/README.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/think-cell-range) file(COPY ${SOURCE_PATH}/range/range.example.cpp DESTINATION ${CURRENT_PACKAGES_DIR}/share/think-cell-range) -- cgit v1.2.3 From 7db7ea5ceb48d255ecc5d4822e45f24cb67ccf0b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sat, 22 Oct 2016 19:24:09 -0700 Subject: Use pointer instead of reference for output parameter --- toolsrc/src/post_build_lint.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index c68148fb2..33f1160f8 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -31,12 +31,12 @@ namespace vcpkg } template - void recursive_find_matching_paths_in_dir(const fs::path& dir, const Pred predicate, std::vector& output) + void recursive_find_matching_paths_in_dir(const fs::path& dir, const Pred predicate, std::vector* output) { - std::copy_if(fs::recursive_directory_iterator(dir), fs::recursive_directory_iterator(), std::back_inserter(output), predicate); + std::copy_if(fs::recursive_directory_iterator(dir), fs::recursive_directory_iterator(), std::back_inserter(*output), predicate); } - void recursive_find_files_with_extension_in_dir(const fs::path& dir, const std::string& extension, std::vector& output) + void recursive_find_files_with_extension_in_dir(const fs::path& dir, const std::string& extension, std::vector* output) { recursive_find_matching_paths_in_dir(dir, [&extension](const fs::path& current) { @@ -65,7 +65,7 @@ namespace vcpkg recursive_find_matching_paths_in_dir(debug_include_dir, [&](const fs::path& current) { return !fs::is_directory(current) && current.extension() != ".ifc"; - }, files_found); + }, &files_found); if (!files_found.empty()) { @@ -107,10 +107,10 @@ namespace vcpkg { const fs::path current_packages_dir = paths.packages / spec.dir(); std::vector misplaced_cmake_files; - recursive_find_files_with_extension_in_dir(current_packages_dir / "cmake", ".cmake", misplaced_cmake_files); - recursive_find_files_with_extension_in_dir(current_packages_dir / "debug" / "cmake", ".cmake", misplaced_cmake_files); - recursive_find_files_with_extension_in_dir(current_packages_dir / "lib" / "cmake", ".cmake", misplaced_cmake_files); - recursive_find_files_with_extension_in_dir(current_packages_dir / "debug" / "lib" / "cmake", ".cmake", misplaced_cmake_files); + recursive_find_files_with_extension_in_dir(current_packages_dir / "cmake", ".cmake", &misplaced_cmake_files); + recursive_find_files_with_extension_in_dir(current_packages_dir / "debug" / "cmake", ".cmake", &misplaced_cmake_files); + recursive_find_files_with_extension_in_dir(current_packages_dir / "lib" / "cmake", ".cmake", &misplaced_cmake_files); + recursive_find_files_with_extension_in_dir(current_packages_dir / "debug" / "lib" / "cmake", ".cmake", &misplaced_cmake_files); if (!misplaced_cmake_files.empty()) { @@ -137,8 +137,8 @@ namespace vcpkg static lint_status check_for_dlls_in_lib_dirs(const package_spec& spec, const vcpkg_paths& paths) { std::vector dlls; - recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "lib", ".dll", dlls); - recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "debug" / "lib", ".dll", dlls); + recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "lib", ".dll", &dlls); + recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "debug" / "lib", ".dll", &dlls); if (!dlls.empty()) { @@ -202,8 +202,8 @@ namespace vcpkg static lint_status check_for_exes(const package_spec& spec, const vcpkg_paths& paths) { std::vector exes; - recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "bin", ".exe", exes); - recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "debug" / "bin", ".exe", exes); + recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "bin", ".exe", &exes); + recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "debug" / "bin", ".exe", &exes); if (!exes.empty()) { @@ -395,8 +395,8 @@ namespace vcpkg case triplet::BuildType::DYNAMIC: { std::vector dlls; - recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "bin", ".dll", dlls); - recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "debug" / "bin", ".dll", dlls); + recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "bin", ".dll", &dlls); + recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "debug" / "bin", ".dll", &dlls); error_count += check_exports_of_dlls(dlls); error_count += check_uwp_bit_of_dlls(spec.target_triplet().system(), dlls); @@ -406,7 +406,7 @@ namespace vcpkg case triplet::BuildType::STATIC: { std::vector dlls; - recursive_find_files_with_extension_in_dir(paths.packages / spec.dir(), ".dll", dlls); + recursive_find_files_with_extension_in_dir(paths.packages / spec.dir(), ".dll", &dlls); error_count += check_no_dlls_present(dlls); break; @@ -417,8 +417,8 @@ namespace vcpkg } std::vector libs; - recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "lib", ".lib", libs); - recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "debug" / "lib", ".lib", libs); + recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "lib", ".lib", &libs); + recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "debug" / "lib", ".lib", &libs); error_count += check_lib_architecture(spec.target_triplet().architecture(), libs); if (error_count != 0) -- cgit v1.2.3 From 4fcdf15651690673e61c30f3b3a8b393569d9144 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sat, 22 Oct 2016 20:00:59 -0700 Subject: [post-build-checks] Add check for mismatching number of debug/release binaries --- toolsrc/src/post_build_lint.cpp | 56 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 4 deletions(-) diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index 33f1160f8..532b189cd 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -43,6 +43,13 @@ namespace vcpkg return !fs::is_directory(current) && current.extension() == extension; }, output); } + + std::vector recursive_find_files_with_extension_in_dir(const fs::path& dir, const std::string& extension) + { + std::vector v; + recursive_find_files_with_extension_in_dir(dir, extension, &v); + return v; + } } static lint_status check_for_files_in_include_directory(const package_spec& spec, const vcpkg_paths& paths) @@ -370,6 +377,36 @@ namespace vcpkg return lint_status::ERROR_DETECTED; } + static lint_status check_matching_debug_and_release_binaries(const std::vector& debug_binaries, const std::vector& release_binaries) + { + const size_t debug_count = debug_binaries.size(); + const size_t release_count = release_binaries.size(); + if (debug_count == release_count) + { + return lint_status::SUCCESS; + } + + System::println(System::color::warning, "Mismatching number of debug and release binaries. Found %d for debug but %d for release.", debug_count, release_count); + System::println("Debug binaries"); + print_vector_of_files(debug_binaries); + + System::println("Release binaries"); + print_vector_of_files(release_binaries); + + if (debug_count == 0) + { + System::println(System::color::warning, "Debug binaries were not built"); + } + if (release_count == 0) + { + System::println(System::color::warning, "Release binaries were not built"); + } + + System::println(""); + + return lint_status::ERROR_DETECTED; + } + static void operator +=(size_t& left, const lint_status& right) { left += static_cast(right); @@ -394,9 +431,14 @@ namespace vcpkg { case triplet::BuildType::DYNAMIC: { + const std::vector debug_dlls = recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "bin", ".dll"); + const std::vector release_dlls = recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "debug" / "bin", ".dll"); + + error_count += check_matching_debug_and_release_binaries(debug_dlls, release_dlls); + std::vector dlls; - recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "bin", ".dll", &dlls); - recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "debug" / "bin", ".dll", &dlls); + dlls.insert(dlls.cend(), debug_dlls.cbegin(), debug_dlls.cend()); + dlls.insert(dlls.cend(), release_dlls.cbegin(), release_dlls.cend()); error_count += check_exports_of_dlls(dlls); error_count += check_uwp_bit_of_dlls(spec.target_triplet().system(), dlls); @@ -416,9 +458,15 @@ namespace vcpkg Checks::unreachable(); } + const std::vector debug_libs = recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "lib", ".lib"); + const std::vector release_libs = recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "debug" / "lib", ".lib"); + + error_count += check_matching_debug_and_release_binaries(debug_libs, release_libs); + std::vector libs; - recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "lib", ".lib", &libs); - recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "debug" / "lib", ".lib", &libs); + libs.insert(libs.cend(), debug_libs.cbegin(), debug_libs.cend()); + libs.insert(libs.cend(), release_libs.cbegin(), release_libs.cend()); + error_count += check_lib_architecture(spec.target_triplet().architecture(), libs); if (error_count != 0) -- cgit v1.2.3 From 5671a12eef744e81dd33b8314f8b55c48235071d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sat, 22 Oct 2016 20:29:36 -0700 Subject: [post-build-checks] Add checks about subdirectories in lib/ --- toolsrc/src/post_build_lint.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index 532b189cd..75a57edc4 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -36,6 +36,14 @@ namespace vcpkg std::copy_if(fs::recursive_directory_iterator(dir), fs::recursive_directory_iterator(), std::back_inserter(*output), predicate); } + template + std::vector recursive_find_matching_paths_in_dir(const fs::path& dir, const Pred predicate) + { + std::vector v; + recursive_find_matching_paths_in_dir(dir, predicate, &v); + return v; + } + void recursive_find_files_with_extension_in_dir(const fs::path& dir, const std::string& extension, std::vector* output) { recursive_find_matching_paths_in_dir(dir, [&extension](const fs::path& current) @@ -407,6 +415,24 @@ namespace vcpkg return lint_status::ERROR_DETECTED; } + static lint_status check_no_subdirectories(const fs::path& dir) + { + const std::vector subdirectories = recursive_find_matching_paths_in_dir(dir, [&](const fs::path& current) + { + return fs::is_directory(current); + }); + + if (!subdirectories.empty()) + { + System::println("Directory %s should have no subdirectories", dir.generic_string()); + System::println("The following subdirectories were found: "); + print_vector_of_files(subdirectories); + return lint_status::ERROR_DETECTED; + } + + return lint_status::SUCCESS; + } + static void operator +=(size_t& left, const lint_status& right) { left += static_cast(right); @@ -458,6 +484,8 @@ namespace vcpkg Checks::unreachable(); } + error_count += check_no_subdirectories(paths.packages / spec.dir() / "lib"); + error_count += check_no_subdirectories(paths.packages / spec.dir() / "debug" / "lib"); const std::vector debug_libs = recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "lib", ".lib"); const std::vector release_libs = recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "debug" / "lib", ".lib"); -- cgit v1.2.3 From 16ecddf94d222baa6dbe10b32310a9292913be7c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sat, 22 Oct 2016 20:33:21 -0700 Subject: [post-build] Convert message to warning --- toolsrc/src/post_build_lint.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index 75a57edc4..4bcf5b008 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -424,7 +424,7 @@ namespace vcpkg if (!subdirectories.empty()) { - System::println("Directory %s should have no subdirectories", dir.generic_string()); + System::println(System::color::warning, "Directory %s should have no subdirectories", dir.generic_string()); System::println("The following subdirectories were found: "); print_vector_of_files(subdirectories); return lint_status::ERROR_DETECTED; -- cgit v1.2.3 From b420f8ef46156b028f4aea39d0df520f715e236e Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sat, 22 Oct 2016 20:34:19 -0700 Subject: [libccd] Remove debug/include/ and debug/share/ instead of debug/ --- ports/libccd/portfile.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ports/libccd/portfile.cmake b/ports/libccd/portfile.cmake index 8417689fd..77ac87f04 100644 --- a/ports/libccd/portfile.cmake +++ b/ports/libccd/portfile.cmake @@ -26,7 +26,8 @@ vcpkg_configure_cmake( vcpkg_install_cmake() # Avoid a copy of file in debug -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) # Handle copyright file(COPY ${SOURCE_PATH}/BSD-LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libccd) -- cgit v1.2.3 From 23e1fa80ae3604fc77924e21c0258ed6dc02d9b7 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sat, 22 Oct 2016 20:35:20 -0700 Subject: [libccd] copy_pdbs() --- ports/libccd/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/libccd/portfile.cmake b/ports/libccd/portfile.cmake index 77ac87f04..34a7e31d6 100644 --- a/ports/libccd/portfile.cmake +++ b/ports/libccd/portfile.cmake @@ -25,6 +25,10 @@ vcpkg_configure_cmake( vcpkg_install_cmake() +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + vcpkg_copy_pdbs() +endif() + # Avoid a copy of file in debug file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -- cgit v1.2.3 From 2c43f32f18ee073aa735ae2344e6a8b4d2f605da Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sat, 22 Oct 2016 20:43:13 -0700 Subject: [libccd] Handle copyright cleanly --- ports/libccd/portfile.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/libccd/portfile.cmake b/ports/libccd/portfile.cmake index 34a7e31d6..74b250c4e 100644 --- a/ports/libccd/portfile.cmake +++ b/ports/libccd/portfile.cmake @@ -34,5 +34,5 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) # Handle copyright -file(COPY ${SOURCE_PATH}/BSD-LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libccd) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/libccd/BSD-LICENSE ${CURRENT_PACKAGES_DIR}/share/libccd/copyright) +file(INSTALL ${SOURCE_PATH}/BSD-LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libccd RENAME copyright) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/doc) -- cgit v1.2.3 From 91be9db1210fec892eeef176ff6035a6b574386a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sat, 22 Oct 2016 20:44:55 -0700 Subject: [libccd] Remove other misc files that are getting copied --- ports/libccd/portfile.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ports/libccd/portfile.cmake b/ports/libccd/portfile.cmake index 74b250c4e..5b99d6c42 100644 --- a/ports/libccd/portfile.cmake +++ b/ports/libccd/portfile.cmake @@ -36,3 +36,9 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) # Handle copyright file(INSTALL ${SOURCE_PATH}/BSD-LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libccd RENAME copyright) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/doc) + +# Miscellaneous cleanup +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/ccd) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/pkgconfig) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/ccd) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig) \ No newline at end of file -- cgit v1.2.3 From dade1c7637191113fd48726ac145ce2a7dc143cc Mon Sep 17 00:00:00 2001 From: Stephan Kaiser Date: Sun, 23 Oct 2016 16:45:01 +0200 Subject: Add Wt port --- ports/wt/CONTROL | 4 ++++ ports/wt/portfile.cmake | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 ports/wt/CONTROL create mode 100644 ports/wt/portfile.cmake diff --git a/ports/wt/CONTROL b/ports/wt/CONTROL new file mode 100644 index 000000000..fc71d9aaf --- /dev/null +++ b/ports/wt/CONTROL @@ -0,0 +1,4 @@ +Source: wt +Version: 3.3.6 +Description: Wt is a C++ library for developing web applications +Build-Depends: boost, openssl diff --git a/ports/wt/portfile.cmake b/ports/wt/portfile.cmake new file mode 100644 index 000000000..3d9360e04 --- /dev/null +++ b/ports/wt/portfile.cmake @@ -0,0 +1,32 @@ +include(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/wt-3.3.6) + +vcpkg_download_distfile(ARCHIVE_FILE + URLS "https://github.com/kdeforche/wt/archive/3.3.6.tar.gz" + FILENAME "3.3.6.tar.gz" + SHA512 d6135713d300bcd3956a4fd673af73be0561eb5d6aa91c47255b966950ddb411217e6a826c1d11c0d941dbb6d006c9926231d7334b21de6256cca331066e18a6 +) +vcpkg_extract_source_archive(${ARCHIVE_FILE}) + +file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}) +vcpkg_configure_cmake( +SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DSHARED_LIBS=ON + -DENABLE_SSL=ON + -DBUILD_EXAMPLES=OFF + -DENABLE_POSTGRES=OFF + -DENABLE_FIREBIRD=OFF + -DENABLE_MYSQL=OFF + -DENABLE_QT4=OFF + -DBOOST_DYNAMIC=ON +) +vcpkg_install_cmake() + +# There is no way to suppress installation of the headers and resource files in debug build. +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/wt RENAME copyright) +vcpkg_copy_pdbs() -- cgit v1.2.3 From 502d02ff4b00e4fde88544b78a96528aaeeca27e Mon Sep 17 00:00:00 2001 From: Adam Martin Date: Sun, 23 Oct 2016 11:32:12 -0500 Subject: [zeromq] Added zeromq library --- ports/zeromq/CONTROL | 3 +++ ports/zeromq/portfile.cmake | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 ports/zeromq/CONTROL create mode 100644 ports/zeromq/portfile.cmake diff --git a/ports/zeromq/CONTROL b/ports/zeromq/CONTROL new file mode 100644 index 000000000..9ea585232 --- /dev/null +++ b/ports/zeromq/CONTROL @@ -0,0 +1,3 @@ +Source: zeromq +Version: 4.2.x.1a02b1b3f2 +Description: The ZeroMQ lightweight messaging kernel is a library which extends the standard socket interfaces with features traditionally provided by specialised messaging middleware products diff --git a/ports/zeromq/portfile.cmake b/ports/zeromq/portfile.cmake new file mode 100644 index 000000000..0b6692c89 --- /dev/null +++ b/ports/zeromq/portfile.cmake @@ -0,0 +1,44 @@ +include(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libzmq-1a02b1b3f2fde6288579cbb0ff9a0b1f195e1812) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/zeromq/libzmq/archive/1a02b1b3f2fde6288579cbb0ff9a0b1f195e1812.zip" + FILENAME "zeromq-1a02b1b3f2fde6288579cbb0ff9a0b1f195e1812.tar.gz" + SHA512 64a5cfb23dd2daa99c9c5a5e2b0693458658e34102b07169a43c63c159af88181ec36caaaa2c780303c4ceba3c4b901e409baebaf12106bdf6a14c5832dfa219 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_build_msbuild( + PROJECT_PATH ${SOURCE_PATH}/builds/msvc/vs2015/libzmq/libzmq.vcxproj + RELEASE_CONFIGURATION ReleaseDLL + DEBUG_CONFIGURATION DebugDLL +) + +file(INSTALL + ${SOURCE_PATH}/bin/Win32/Debug/v140/dynamic/libzmq.dll + ${SOURCE_PATH}/bin/Win32/Debug/v140/dynamic/libzmq.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin +) +file(INSTALL + ${SOURCE_PATH}/bin/Win32/Release/v140/dynamic/libzmq.dll + ${SOURCE_PATH}/bin/Win32/Release/v140/dynamic/libzmq.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/bin +) +file(INSTALL + ${SOURCE_PATH}/bin/Win32/Debug/v140/dynamic/libzmq.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib +) +file(INSTALL + ${SOURCE_PATH}/bin/Win32/Release/v140/dynamic/libzmq.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib +) +file(INSTALL + ${SOURCE_PATH}/include/ + DESTINATION ${CURRENT_PACKAGES_DIR}/include +) + +# Handle copyright +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/zeromq) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/zeromq/COPYING ${CURRENT_PACKAGES_DIR}/share/zeromq/copyright) + +vcpkg_copy_pdbs() -- cgit v1.2.3 From efc25d21d500e2a20d2fb1a98787e8ebce82f23a Mon Sep 17 00:00:00 2001 From: Silvio Date: Sun, 23 Oct 2016 22:23:03 +0200 Subject: Add jxrlib port --- ports/jxrlib/CMakeLists.txt | 99 +++++++++++++++++++++++++++++++++++++++++++++ ports/jxrlib/CONTROL | 3 ++ ports/jxrlib/LICENSE | 23 +++++++++++ ports/jxrlib/portfile.cmake | 24 +++++++++++ 4 files changed, 149 insertions(+) create mode 100644 ports/jxrlib/CMakeLists.txt create mode 100644 ports/jxrlib/CONTROL create mode 100644 ports/jxrlib/LICENSE create mode 100644 ports/jxrlib/portfile.cmake diff --git a/ports/jxrlib/CMakeLists.txt b/ports/jxrlib/CMakeLists.txt new file mode 100644 index 000000000..e1df20dad --- /dev/null +++ b/ports/jxrlib/CMakeLists.txt @@ -0,0 +1,99 @@ +# Copyright Mathieu Malaterre +# BSD (Same as jxrlib) +# Based on https://jxrlib.codeplex.com/discussions/440294 +# and modified for vcpkg packaging +cmake_minimum_required(VERSION 2.8) +project(jxrlib C) + +# Need shared libs for ABI +option(BUILD_SHARED_LIBS "Build shared libraries" ON) + +# helper macro to preserve original Makefile convention +macro(JXR_MAKE_OBJ SET_NAME) + foreach(src ${SRC_${SET_NAME}}) + list(APPEND OBJ_${SET_NAME} ${DIR_${SET_NAME}}/${src}) + endforeach() +endmacro() + +include(TestBigEndian) +test_big_endian(ISBIGENDIAN) +if(ISBIGENDIAN) + set(DEF_ENDIAN _BIG__ENDIAN_) +endif() + +set(DIR_SYS image/sys) +set(DIR_DEC image/decode) +set(DIR_ENC image/encode) + +set(DIR_GLUE jxrgluelib) +set(DIR_TEST jxrtestlib) +set(DIR_EXEC jxrencoderdecoder) + +if(NOT JXRLIB_INSTALL_BIN_DIR) + set(JXRLIB_INSTALL_BIN_DIR "bin") +endif() + +if(NOT JXRLIB_INSTALL_LIB_DIR) + set(JXRLIB_INSTALL_LIB_DIR "lib") +endif() + +if(NOT JXRLIB_INSTALL_INCLUDE_DIR) + set(JXRLIB_INSTALL_INCLUDE_DIR "include/jxrlib") +endif() + +include_directories( + common/include + ${DIR_SYS} + ${DIR_GLUE} + ${DIR_TEST} +) + + +# JPEG-XR +set(SRC_SYS adapthuff.c image.c strcodec.c strPredQuant.c strTransform.c perfTimerANSI.c) +JXR_MAKE_OBJ(SYS) +set(SRC_DEC decode.c postprocess.c segdec.c strdec.c strInvTransform.c strPredQuantDec.c JXRTranscode.c) +JXR_MAKE_OBJ(DEC) +set(SRC_ENC encode.c segenc.c strenc.c strFwdTransform.c strPredQuantEnc.c) +JXR_MAKE_OBJ(ENC) + +add_library(jpegxr ${OBJ_ENC} ${OBJ_DEC} ${OBJ_SYS}) +set_property(TARGET jpegxr + PROPERTY COMPILE_DEFINITIONS __ANSI__ DISABLE_PERF_MEASUREMENT ${DEF_ENDIAN} +) +set_property(TARGET jpegxr PROPERTY LINK_INTERFACE_LIBRARIES "") +install(TARGETS jpegxr + EXPORT JXRLibTargets + RUNTIME DESTINATION ${JXRLIB_INSTALL_BIN_DIR} + LIBRARY DESTINATION ${JXRLIB_INSTALL_LIB_DIR} + ARCHIVE DESTINATION ${JXRLIB_INSTALL_LIB_DIR} +) + +# JXR-GLUE +set(SRC_GLUE JXRGlue.c JXRMeta.c JXRGluePFC.c JXRGlueJxr.c) +JXR_MAKE_OBJ(GLUE) +set(SRC_TEST JXRTest.c JXRTestBmp.c JXRTestHdr.c JXRTestPnm.c JXRTestTif.c JXRTestYUV.c) +JXR_MAKE_OBJ(TEST) + +add_library(jxrglue ${OBJ_GLUE} ${OBJ_TEST}) +set_property(TARGET jxrglue + PROPERTY COMPILE_DEFINITIONS __ANSI__ DISABLE_PERF_MEASUREMENT ${DEF_ENDIAN} +) +set_property(TARGET jxrglue PROPERTY LINK_INTERFACE_LIBRARIES "") +install(TARGETS jxrglue + EXPORT JXRLibTargets + RUNTIME DESTINATION ${JXRLIB_INSTALL_BIN_DIR} + LIBRARY DESTINATION ${JXRLIB_INSTALL_LIB_DIR} + ARCHIVE DESTINATION ${JXRLIB_INSTALL_LIB_DIR} +) + +target_link_libraries(jxrglue jpegxr) + +# install rules +install(FILES jxrgluelib/JXRGlue.h jxrgluelib/JXRMeta.h jxrtestlib/JXRTest.h + image/sys/windowsmediaphoto.h + DESTINATION ${JXRLIB_INSTALL_INCLUDE_DIR} COMPONENT Headers +) +install(DIRECTORY common/include/ DESTINATION ${JXRLIB_INSTALL_INCLUDE_DIR} + FILES_MATCHING PATTERN "*.h" +) \ No newline at end of file diff --git a/ports/jxrlib/CONTROL b/ports/jxrlib/CONTROL new file mode 100644 index 000000000..f579d783e --- /dev/null +++ b/ports/jxrlib/CONTROL @@ -0,0 +1,3 @@ +Source: jxrlib +Version: 1.1 +Description: Open source implementation of the jpegxr image format standard. diff --git a/ports/jxrlib/LICENSE b/ports/jxrlib/LICENSE new file mode 100644 index 000000000..2b6f03f6c --- /dev/null +++ b/ports/jxrlib/LICENSE @@ -0,0 +1,23 @@ +Copyright © Microsoft Corp. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + • Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + • 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 HOLDERS AND 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 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. \ No newline at end of file diff --git a/ports/jxrlib/portfile.cmake b/ports/jxrlib/portfile.cmake new file mode 100644 index 000000000..40c29c0b0 --- /dev/null +++ b/ports/jxrlib/portfile.cmake @@ -0,0 +1,24 @@ +include(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src) +vcpkg_download_distfile(ARCHIVE + URLS "http://download-codeplex.sec.s-msft.com/Download/SourceControlFileDownload.ashx?ProjectName=jxrlib&changeSetId=e922fa50cdf9a58f40cad07553bcaa2883d3c5bf" + FILENAME "jxrlib_1_1.zip" + SHA512 6e8b579108444e9bea8d01f57e2ac3b63963c084adb8e265cfd82bb1199b8bd168b8aa41319cf34b87e97db1d72d0f3cc2d3dac881fcd1a6f398fe808d55772d +) +vcpkg_extract_source_archive(${ARCHIVE}) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS:BOOL=ON +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# Handle copyright +file(COPY ${CMAKE_CURRENT_LIST_DIR}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/jxrlib) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/jxrlib/LICENSE ${CURRENT_PACKAGES_DIR}/share/jxrlib/copyright) -- cgit v1.2.3 From fa06da137afb89b568423a57fa4001713909915e Mon Sep 17 00:00:00 2001 From: Silvio Date: Sun, 23 Oct 2016 22:25:31 +0200 Subject: Add openjpeg port --- ports/openjpeg/CONTROL | 3 +++ ports/openjpeg/portfile.cmake | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 ports/openjpeg/CONTROL create mode 100644 ports/openjpeg/portfile.cmake diff --git a/ports/openjpeg/CONTROL b/ports/openjpeg/CONTROL new file mode 100644 index 000000000..e8ce7cdf4 --- /dev/null +++ b/ports/openjpeg/CONTROL @@ -0,0 +1,3 @@ +Source: openjpeg +Version: +Description: diff --git a/ports/openjpeg/portfile.cmake b/ports/openjpeg/portfile.cmake new file mode 100644 index 000000000..f03e4ce13 --- /dev/null +++ b/ports/openjpeg/portfile.cmake @@ -0,0 +1,27 @@ +include(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/openjpeg-2.1.2) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/uclouvain/openjpeg/archive/v2.1.2.zip" + FILENAME "openjpeg-2.1.2.zip" + SHA512 45518b92b2a8e7218ab3efdebe1acf0437c01ab2e4d5769da17103a76ba38a7305fb36d0ceeca0576d53c071a3482d2d3f01d6e48a569191290bfba9274ef7b4 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS -DBUILD_CODEC:BOOL=OFF +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# Handle debug cmake config files (see https://github.com/Microsoft/vcpkg/issues/77) +file(READ ${CURRENT_PACKAGES_DIR}/debug/lib/openjpeg-2.1/OpenJPEGTargets-debug.cmake OPENJPEG_DEBUG_MODULE) +string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" OPENJPEG_DEBUG_MODULE "${OPENJPEG_DEBUG_MODULE}") +file(WRITE ${CURRENT_PACKAGES_DIR}/lib/openjpeg-2.1/OpenJPEGTargets-debug.cmake "${OPENJPEG_DEBUG_MODULE}") + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/openjpeg) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/openjpeg/LICENSE ${CURRENT_PACKAGES_DIR}/share/openjpeg/copyright) -- cgit v1.2.3 From 3e6fe1f965e3af5d1e674ec3572903c6fe873b3d Mon Sep 17 00:00:00 2001 From: Silvio Date: Sun, 23 Oct 2016 22:26:15 +0200 Subject: Add libwebp port --- ports/libwebp/0001-add-install-to-cmake.patch | 21 ++++++++++++++++++++ ports/libwebp/CONTROL | 3 +++ ports/libwebp/portfile.cmake | 28 +++++++++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 ports/libwebp/0001-add-install-to-cmake.patch create mode 100644 ports/libwebp/CONTROL create mode 100644 ports/libwebp/portfile.cmake diff --git a/ports/libwebp/0001-add-install-to-cmake.patch b/ports/libwebp/0001-add-install-to-cmake.patch new file mode 100644 index 000000000..3f9cfc0c5 --- /dev/null +++ b/ports/libwebp/0001-add-install-to-cmake.patch @@ -0,0 +1,21 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3cb9c3b..f05800d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -276,6 +276,16 @@ foreach(I_FILE RANGE ${WEBP_SIMD_FILES_TO_INCLUDE_RANGE}) + ) + endforeach() + ++# Install the headers ++file(GLOB PUBLIC_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/webp/*.h) ++install(FILES ${PUBLIC_HEADERS} DESTINATION include/webp) ++ ++# Install the library ++install(TARGETS webp ++ RUNTIME DESTINATION bin ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib) ++ + # Build the executables if asked for. + if(WEBP_BUILD_CWEBP OR WEBP_BUILD_DWEBP) + # Example utility library. diff --git a/ports/libwebp/CONTROL b/ports/libwebp/CONTROL new file mode 100644 index 000000000..43840c45b --- /dev/null +++ b/ports/libwebp/CONTROL @@ -0,0 +1,3 @@ +Source: libwebp +Version: 0.5.1 +Description: Lossy compression of digital photographic images. diff --git a/ports/libwebp/portfile.cmake b/ports/libwebp/portfile.cmake new file mode 100644 index 000000000..d11e90966 --- /dev/null +++ b/ports/libwebp/portfile.cmake @@ -0,0 +1,28 @@ +include(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libwebp-0.5.1) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/webmproject/libwebp/archive/v0.5.1.zip" + FILENAME "libwebp-0.5.1.zip" + SHA512 1d9b218e3b6df50e7bc71b1338619b142a9dcd6cb7cbde2e7a4182b12a353f4f1d830b94dbeb7e6e8aac6e6613ec1aa368ce00a6945cdb7686eb94b287b9fd4e +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001-add-install-to-cmake.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + # dllexport support seem to be broken + OPTIONS -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS:BOOL=ON +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# Handle copyright +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libwebp) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/libwebp/COPYING ${CURRENT_PACKAGES_DIR}/share/libwebp/copyright) -- cgit v1.2.3 From f6b7c7da82586ec59afda8201f301af9780f8a9e Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Sun, 23 Oct 2016 22:32:22 +0200 Subject: Update CONTROL --- ports/openjpeg/CONTROL | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/openjpeg/CONTROL b/ports/openjpeg/CONTROL index e8ce7cdf4..f137d0ebc 100644 --- a/ports/openjpeg/CONTROL +++ b/ports/openjpeg/CONTROL @@ -1,3 +1,3 @@ Source: openjpeg -Version: -Description: +Version: 2.1.2 +Description: JPEG 2000 image library -- cgit v1.2.3 From 7625d837d52aa218526d02a98d1748e479b994a1 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sun, 23 Oct 2016 14:09:30 -0700 Subject: [vcpkg] Revert 5671a12. Fixes #206, we should reapply these checks once all existing ports have been fixed. --- toolsrc/src/post_build_lint.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index 4bcf5b008..9b23013de 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -483,9 +483,10 @@ namespace vcpkg default: Checks::unreachable(); } - +#if 0 error_count += check_no_subdirectories(paths.packages / spec.dir() / "lib"); error_count += check_no_subdirectories(paths.packages / spec.dir() / "debug" / "lib"); +#endif const std::vector debug_libs = recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "lib", ".lib"); const std::vector release_libs = recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "debug" / "lib", ".lib"); -- cgit v1.2.3 From 0af6ca8123b280f082ce6286700ee1a6e5b9a0f2 Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Tue, 25 Oct 2016 02:06:27 +1100 Subject: add qt5 support, working install but static linkage with RT needs to be implemented --- ports/qt5/CONTROL | 4 + ports/qt5/portfile.cmake | 107 +++++++++++++++++++++++++ scripts/cmake/vcpkg_find_acquire_program.cmake | 6 ++ 3 files changed, 117 insertions(+) create mode 100644 ports/qt5/CONTROL create mode 100644 ports/qt5/portfile.cmake diff --git a/ports/qt5/CONTROL b/ports/qt5/CONTROL new file mode 100644 index 000000000..6afd3e5c5 --- /dev/null +++ b/ports/qt5/CONTROL @@ -0,0 +1,4 @@ +Source: qt5 +Version: 5.7 +Build-Depends: +Description: Qt5 base components. diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake new file mode 100644 index 000000000..53abe8e02 --- /dev/null +++ b/ports/qt5/portfile.cmake @@ -0,0 +1,107 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/qt-5.7.0) +set(ENV{QMAKESPEC} win32-msvc2015) +set(OUTPUT_PATH ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) +set(ENV{QTDIR} ${OUTPUT_PATH}/qtbase) +set(ENV{PATH} "${OUTPUT_PATH}/qtbase/bin;$ENV{PATH}") + +find_program(NMAKE nmake) +vcpkg_find_acquire_program(JOM) +get_filename_component(JOM_EXE_PATH ${JOM} DIRECTORY) +set(ENV{PATH} "${JOM_EXE_PATH};$ENV{PATH}") + +vcpkg_download_distfile(ARCHIVE_FILE + URLS "http://download.qt.io/official_releases/qt/5.7/5.7.0/single/qt-everywhere-opensource-src-5.7.0.7z" + FILENAME "qt-5.7.0.7z" + SHA512 96f0b6bd221be0ed819bc9b52eefcee1774945e25b89169fa927148c1c4a2d85faf63b1d09ef5067573bda9bbf1270fce5f181d086bfe585ddbad4cd77f7f418 +) +vcpkg_extract_source_archive(${ARCHIVE_FILE}) +if (EXISTS ${CURRENT_BUILDTREES_DIR}/src/qt-everywhere-opensource-src-5.7.0) + file(RENAME ${CURRENT_BUILDTREES_DIR}/src/qt-everywhere-opensource-src-5.7.0 ${CURRENT_BUILDTREES_DIR}/src/qt-5.7.0) +endif() + +file(MAKE_DIRECTORY ${OUTPUT_PATH}) +message(STATUS "Configuring ${TARGET_TRIPLET}") +vcpkg_execute_required_process( + COMMAND "${SOURCE_PATH}/configure.bat" + -confirm-license -opensource + -debug-and-release -force-debug-info + -nomake examples -nomake tests -skip webengine + -prefix "${CURRENT_PACKAGES_DIR}" + WORKING_DIRECTORY ${OUTPUT_PATH} + LOGNAME configure-${TARGET_TRIPLET} +) +message(STATUS "Configure ${TARGET_TRIPLET} done") + +message(STATUS "Building ${TARGET_TRIPLET}") +vcpkg_execute_required_process( + COMMAND ${JOM} + WORKING_DIRECTORY ${OUTPUT_PATH} + LOGNAME build-${TARGET_TRIPLET} +) +message(STATUS "Build ${TARGET_TRIPLET} done") + +message(STATUS "Installing ${TARGET_TRIPLET}") +vcpkg_execute_required_process( + COMMAND ${NMAKE} install + WORKING_DIRECTORY ${OUTPUT_PATH} + LOGNAME install-${TARGET_TRIPLET} +) +message(STATUS "Install ${TARGET_TRIPLET} done") + +message(STATUS "Packaging ${TARGET_TRIPLET}") +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug) +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib) +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) +file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) + +file(INSTALL ${CURRENT_PACKAGES_DIR}/bin + DESTINATION ${CURRENT_PACKAGES_DIR}/debug + FILES_MATCHING PATTERN "*d.dll" +) +file(INSTALL ${CURRENT_PACKAGES_DIR}/bin + DESTINATION ${CURRENT_PACKAGES_DIR}/debug + FILES_MATCHING PATTERN "*d.pdb" +) +file(GLOB DEBUG_BIN_FILES "${CURRENT_PACKAGES_DIR}/bin/*d.dll") +file(REMOVE ${DEBUG_BIN_FILES}) +file(GLOB DEBUG_BIN_FILES "${CURRENT_PACKAGES_DIR}/bin/*d.pdb") +file(REMOVE ${DEBUG_BIN_FILES}) +file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/Qt5Gamepad.dll ${CURRENT_PACKAGES_DIR}/bin/Qt5Gamepad.dll) + +file(INSTALL ${CURRENT_PACKAGES_DIR}/lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug + FILES_MATCHING PATTERN "*d.lib" +) +file(INSTALL ${CURRENT_PACKAGES_DIR}/lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug + FILES_MATCHING PATTERN "*d.prl" +) +file(INSTALL ${CURRENT_PACKAGES_DIR}/lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug + FILES_MATCHING PATTERN "*d.pdb" +) +file(GLOB DEBUG_LIB_FILES "${CURRENT_PACKAGES_DIR}/lib/*d.lib") +file(REMOVE ${DEBUG_LIB_FILES}) +file(GLOB DEBUG_LIB_FILES "${CURRENT_PACKAGES_DIR}/lib/*d.prl") +file(REMOVE ${DEBUG_LIB_FILES}) +file(GLOB DEBUG_LIB_FILES "${CURRENT_PACKAGES_DIR}/lib/*d.pdb") +file(REMOVE ${DEBUG_LIB_FILES}) +file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Gamepad.lib ${CURRENT_PACKAGES_DIR}/lib/Qt5Gamepad.lib) +file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Gamepad.prl ${CURRENT_PACKAGES_DIR}/lib/Qt5Gamepad.prl) +file(GLOB BINARY_TOOLS "${CURRENT_PACKAGES_DIR}/bin/*.exe") +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools) +file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools) +FILE(REMOVE ${BINARY_TOOLS}) + +set(SHARE_PATH ${CURRENT_PACKAGES_DIR}/share/qt5) +file(MAKE_DIRECTORY ${SHARE_PATH}) +file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${SHARE_PATH} RENAME copyright) +file(RENAME ${CURRENT_PACKAGES_DIR}/doc ${SHARE_PATH}/doc) +file(RENAME ${CURRENT_PACKAGES_DIR}/mkspecs ${SHARE_PATH}/mkspecs) +file(RENAME ${CURRENT_PACKAGES_DIR}/phrasebooks ${SHARE_PATH}/phrasebooks) +file(RENAME ${CURRENT_PACKAGES_DIR}/plugins ${SHARE_PATH}/plugins) +file(RENAME ${CURRENT_PACKAGES_DIR}/qml ${SHARE_PATH}/qml) +file(RENAME ${CURRENT_PACKAGES_DIR}/translations ${SHARE_PATH}/translations) +vcpkg_copy_pdbs() diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 8f974240f..230c4b1e7 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -24,6 +24,12 @@ function(vcpkg_find_acquire_program VAR) set(ARCHIVE "yasm.exe") set(NOEXTRACT ON) set(HASH 850b26be5bbbdaeaf45ac39dd27f69f1a85e600c35afbd16b9f621396b3c7a19863ea3ff316b025b578fce0a8280eef2203306a2b3e46ee1389abb65313fb720) +elseif(VAR MATCHES "JOM") +set(PROGNAME jom) +set(PATHS ${DOWNLOADS}/tools/jom/jom-1.1.1) +set(URL "http://download.qt.io/official_releases/jom/jom_1_1_1.zip") +set(ARCHIVE "jom_1_1_1.zip") +set(HASH 850b26be5bbbdaeaf45ac39dd27f69f1a85e600c35afbd16b9f621396b3c7a19863ea3ff316b025b578fce0a8280eef2203306a2b3e46ee1389abb65313fb720) else() message(FATAL "unknown tool ${VAR} -- unable to acquire.") endif() -- cgit v1.2.3 From 3e4ccad0f982aff729987e77514f6cbade9ebb1a Mon Sep 17 00:00:00 2001 From: Silvio Date: Mon, 24 Oct 2016 23:04:00 +0200 Subject: [openjpeg] Fix location of cmake config files --- ports/openjpeg/portfile.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ports/openjpeg/portfile.cmake b/ports/openjpeg/portfile.cmake index f03e4ce13..496a22542 100644 --- a/ports/openjpeg/portfile.cmake +++ b/ports/openjpeg/portfile.cmake @@ -11,6 +11,7 @@ vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS -DBUILD_CODEC:BOOL=OFF + -DOPENJPEG_INSTALL_PACKAGE_DIR=share/openjpeg ) vcpkg_install_cmake() @@ -18,9 +19,11 @@ vcpkg_install_cmake() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle debug cmake config files (see https://github.com/Microsoft/vcpkg/issues/77) -file(READ ${CURRENT_PACKAGES_DIR}/debug/lib/openjpeg-2.1/OpenJPEGTargets-debug.cmake OPENJPEG_DEBUG_MODULE) +file(READ ${CURRENT_PACKAGES_DIR}/debug/share/openjpeg/OpenJPEGTargets-debug.cmake OPENJPEG_DEBUG_MODULE) string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" OPENJPEG_DEBUG_MODULE "${OPENJPEG_DEBUG_MODULE}") -file(WRITE ${CURRENT_PACKAGES_DIR}/lib/openjpeg-2.1/OpenJPEGTargets-debug.cmake "${OPENJPEG_DEBUG_MODULE}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/openjpeg/OpenJPEGTargets-debug.cmake "${OPENJPEG_DEBUG_MODULE}") +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + # Handle copyright file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/openjpeg) -- cgit v1.2.3 From 7658d318366ac149285617d41cf97d63a2cb9adc Mon Sep 17 00:00:00 2001 From: Silvio Date: Mon, 24 Oct 2016 23:22:11 +0200 Subject: Cleanup Visual C++ Redistributable runtime --- ports/openjpeg/portfile.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ports/openjpeg/portfile.cmake b/ports/openjpeg/portfile.cmake index 496a22542..70700ed9d 100644 --- a/ports/openjpeg/portfile.cmake +++ b/ports/openjpeg/portfile.cmake @@ -24,6 +24,11 @@ string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" OPENJPEG_DEBUG_MO file(WRITE ${CURRENT_PACKAGES_DIR}/share/openjpeg/OpenJPEGTargets-debug.cmake "${OPENJPEG_DEBUG_MODULE}") file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +# Cleanup Visual C++ Redistributable runtime +file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/msvcp140.dll) +file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/vcruntime140.dll) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/msvcp140.dll) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/vcruntime140.dll) # Handle copyright file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/openjpeg) -- cgit v1.2.3 From cd0d0a0c240474089176e053eeffc19c88dbf01f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 24 Oct 2016 14:33:18 -0700 Subject: [zeromq] Fix extension of downloaded file --- ports/zeromq/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/zeromq/portfile.cmake b/ports/zeromq/portfile.cmake index 0b6692c89..e0828f6c0 100644 --- a/ports/zeromq/portfile.cmake +++ b/ports/zeromq/portfile.cmake @@ -3,7 +3,7 @@ include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libzmq-1a02b1b3f2fde6288579cbb0ff9a0b1f195e1812) vcpkg_download_distfile(ARCHIVE URLS "https://github.com/zeromq/libzmq/archive/1a02b1b3f2fde6288579cbb0ff9a0b1f195e1812.zip" - FILENAME "zeromq-1a02b1b3f2fde6288579cbb0ff9a0b1f195e1812.tar.gz" + FILENAME "zeromq-1a02b1b3f2fde6288579cbb0ff9a0b1f195e1812.zip" SHA512 64a5cfb23dd2daa99c9c5a5e2b0693458658e34102b07169a43c63c159af88181ec36caaaa2c780303c4ceba3c4b901e409baebaf12106bdf6a14c5832dfa219 ) vcpkg_extract_source_archive(${ARCHIVE}) -- cgit v1.2.3 From caa340f91c169192457d26c1327a133a9eb775fa Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 24 Oct 2016 14:35:12 -0700 Subject: [zeromq] No need to copy pdbs manually, vcpkg_copy_pdbs() handles it --- ports/zeromq/portfile.cmake | 2 -- 1 file changed, 2 deletions(-) diff --git a/ports/zeromq/portfile.cmake b/ports/zeromq/portfile.cmake index e0828f6c0..72306b692 100644 --- a/ports/zeromq/portfile.cmake +++ b/ports/zeromq/portfile.cmake @@ -16,12 +16,10 @@ vcpkg_build_msbuild( file(INSTALL ${SOURCE_PATH}/bin/Win32/Debug/v140/dynamic/libzmq.dll - ${SOURCE_PATH}/bin/Win32/Debug/v140/dynamic/libzmq.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin ) file(INSTALL ${SOURCE_PATH}/bin/Win32/Release/v140/dynamic/libzmq.dll - ${SOURCE_PATH}/bin/Win32/Release/v140/dynamic/libzmq.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/bin ) file(INSTALL -- cgit v1.2.3 From f69ccf63952a8b27a06eeb95fa9e605cd5fc2b54 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 24 Oct 2016 14:42:16 -0700 Subject: [zeromq] Enable building statically --- ports/zeromq/portfile.cmake | 62 +++++++++++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 22 deletions(-) diff --git a/ports/zeromq/portfile.cmake b/ports/zeromq/portfile.cmake index 72306b692..d4cd3e1c9 100644 --- a/ports/zeromq/portfile.cmake +++ b/ports/zeromq/portfile.cmake @@ -8,28 +8,47 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) -vcpkg_build_msbuild( - PROJECT_PATH ${SOURCE_PATH}/builds/msvc/vs2015/libzmq/libzmq.vcxproj - RELEASE_CONFIGURATION ReleaseDLL - DEBUG_CONFIGURATION DebugDLL -) +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + vcpkg_build_msbuild( + PROJECT_PATH ${SOURCE_PATH}/builds/msvc/vs2015/libzmq/libzmq.vcxproj + RELEASE_CONFIGURATION ReleaseDLL + DEBUG_CONFIGURATION DebugDLL + ) + file(INSTALL + ${SOURCE_PATH}/bin/Win32/Debug/v140/dynamic/libzmq.dll + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin + ) + file(INSTALL + ${SOURCE_PATH}/bin/Win32/Release/v140/dynamic/libzmq.dll + DESTINATION ${CURRENT_PACKAGES_DIR}/bin + ) + file(INSTALL + ${SOURCE_PATH}/bin/Win32/Debug/v140/dynamic/libzmq.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib + ) + file(INSTALL + ${SOURCE_PATH}/bin/Win32/Release/v140/dynamic/libzmq.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib + ) + vcpkg_copy_pdbs() + +else() + vcpkg_build_msbuild( + PROJECT_PATH ${SOURCE_PATH}/builds/msvc/vs2015/libzmq/libzmq.vcxproj + RELEASE_CONFIGURATION ReleaseLIB + DEBUG_CONFIGURATION DebugLIB + ) + file(INSTALL + ${SOURCE_PATH}/bin/Win32/Debug/v140/static/libzmq.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib + ) + file(INSTALL + ${SOURCE_PATH}/bin/Win32/Release/v140/static/libzmq.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib + ) +endif() + -file(INSTALL - ${SOURCE_PATH}/bin/Win32/Debug/v140/dynamic/libzmq.dll - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin -) -file(INSTALL - ${SOURCE_PATH}/bin/Win32/Release/v140/dynamic/libzmq.dll - DESTINATION ${CURRENT_PACKAGES_DIR}/bin -) -file(INSTALL - ${SOURCE_PATH}/bin/Win32/Debug/v140/dynamic/libzmq.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib -) -file(INSTALL - ${SOURCE_PATH}/bin/Win32/Release/v140/dynamic/libzmq.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/lib -) file(INSTALL ${SOURCE_PATH}/include/ DESTINATION ${CURRENT_PACKAGES_DIR}/include @@ -39,4 +58,3 @@ file(INSTALL file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/zeromq) file(RENAME ${CURRENT_PACKAGES_DIR}/share/zeromq/COPYING ${CURRENT_PACKAGES_DIR}/share/zeromq/copyright) -vcpkg_copy_pdbs() -- cgit v1.2.3 From d7859b89cb584cc1631b9b2d2976037de64fca6e Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 24 Oct 2016 14:53:00 -0700 Subject: [openjpeg] vcpkg_copy_pdbs() --- ports/openjpeg/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/openjpeg/portfile.cmake b/ports/openjpeg/portfile.cmake index 70700ed9d..80f18cd86 100644 --- a/ports/openjpeg/portfile.cmake +++ b/ports/openjpeg/portfile.cmake @@ -30,6 +30,10 @@ file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/vcruntime140.dll) file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/msvcp140.dll) file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/vcruntime140.dll) +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + vcpkg_copy_pdbs() +endif() + # Handle copyright file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/openjpeg) file(RENAME ${CURRENT_PACKAGES_DIR}/share/openjpeg/LICENSE ${CURRENT_PACKAGES_DIR}/share/openjpeg/copyright) -- cgit v1.2.3 From 39521b4d2edc3860af783b3f9ccc1af734c5c65f Mon Sep 17 00:00:00 2001 From: vlj Date: Fri, 14 Oct 2016 20:02:46 +0200 Subject: Add libogg. --- ports/libogg/CONTROL | 3 +++ ports/libogg/portfile.cmake | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 ports/libogg/CONTROL create mode 100644 ports/libogg/portfile.cmake diff --git a/ports/libogg/CONTROL b/ports/libogg/CONTROL new file mode 100644 index 000000000..266cf4c2b --- /dev/null +++ b/ports/libogg/CONTROL @@ -0,0 +1,3 @@ +Source: libogg +Version: 1.3.2 +Description: Ogg is a multimedia container format, and the native file and stream format for the Xiph.org multimedia codecs. diff --git a/ports/libogg/portfile.cmake b/ports/libogg/portfile.cmake new file mode 100644 index 000000000..8cd5a7a38 --- /dev/null +++ b/ports/libogg/portfile.cmake @@ -0,0 +1,43 @@ +# 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(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) +find_program(GIT git) + +set(GIT_URL "https://git.xiph.org/ogg.git") +set(GIT_REF "cab46b19847eb1d38aeda73ab4708716e5776366") + +if(NOT EXISTS "${DOWNLOADS}/ogg.git") + message(STATUS "Cloning") + vcpkg_execute_required_process( + COMMAND ${GIT} clone --bare ${GIT_URL} ${DOWNLOADS}/ogg.git + WORKING_DIRECTORY ${DOWNLOADS} + LOGNAME clone + ) +endif() + +if(NOT EXISTS "${CURRENT_BUILDTREES_DIR}/src/.git") + message(STATUS "Adding worktree") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}) + vcpkg_execute_required_process( + COMMAND ${GIT} worktree add -f --detach ${CURRENT_BUILDTREES_DIR}/src ${GIT_REF} + WORKING_DIRECTORY ${DOWNLOADS}/ogg.git + LOGNAME worktree + ) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src +) + +vcpkg_install_cmake() +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +# Handle copyright +file(COPY ${CURRENT_BUILDTREES_DIR}/src/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libogg) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/libogg/COPYING ${CURRENT_PACKAGES_DIR}/share/libogg/copyright) -- cgit v1.2.3 From cb948e8c5c46b437f8998e60fa69acee7c393e9d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 24 Oct 2016 15:02:19 -0700 Subject: [libwebp] Add call to vcpkg_copy_pdbs() --- ports/libwebp/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/libwebp/portfile.cmake b/ports/libwebp/portfile.cmake index d11e90966..71262f1ba 100644 --- a/ports/libwebp/portfile.cmake +++ b/ports/libwebp/portfile.cmake @@ -23,6 +23,10 @@ vcpkg_install_cmake() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + vcpkg_copy_pdbs() +endif() + # Handle copyright file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libwebp) file(RENAME ${CURRENT_PACKAGES_DIR}/share/libwebp/COPYING ${CURRENT_PACKAGES_DIR}/share/libwebp/copyright) -- cgit v1.2.3 From c22ceaf2b3e9b86dfe9699f708077646681e23d6 Mon Sep 17 00:00:00 2001 From: vlj Date: Sun, 16 Oct 2016 23:48:11 +0200 Subject: Add libvorbis. --- .../0001-Add-vorbisenc.c-to-vorbis-library.patch | 25 ++++++++++ ports/libvorbis/CONTROL | 4 ++ ports/libvorbis/portfile.cmake | 58 ++++++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 ports/libvorbis/0001-Add-vorbisenc.c-to-vorbis-library.patch create mode 100644 ports/libvorbis/CONTROL create mode 100644 ports/libvorbis/portfile.cmake diff --git a/ports/libvorbis/0001-Add-vorbisenc.c-to-vorbis-library.patch b/ports/libvorbis/0001-Add-vorbisenc.c-to-vorbis-library.patch new file mode 100644 index 000000000..0f713029d --- /dev/null +++ b/ports/libvorbis/0001-Add-vorbisenc.c-to-vorbis-library.patch @@ -0,0 +1,25 @@ +From 0046f290a31b603a4caa9b728b54447b95ee5aa1 Mon Sep 17 00:00:00 2001 +From: vlj +Date: Mon, 24 Oct 2016 23:59:55 +0200 +Subject: [PATCH] Add vorbisenc.c to vorbis library. + +--- + lib/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt +index a682ed4..2043294 100644 +--- a/lib/CMakeLists.txt ++++ b/lib/CMakeLists.txt +@@ -68,7 +68,7 @@ include_directories(.) + include_directories(${OGG_INCLUDE_DIRS}) + + if (NOT BUILD_FRAMEWORK) +- add_library(vorbis ${VORBIS_HEADERS} ${VORBIS_SOURCES}) ++ add_library(vorbis ${VORBIS_HEADERS} ${VORBIS_SOURCES} ${VORBISENC_SOURCES}) + add_library(vorbisenc ${VORBISENC_SOURCES}) + add_library(vorbisfile ${VORBISFILE_SOURCES}) + +-- +2.10.0.windows.1 + diff --git a/ports/libvorbis/CONTROL b/ports/libvorbis/CONTROL new file mode 100644 index 000000000..64721181e --- /dev/null +++ b/ports/libvorbis/CONTROL @@ -0,0 +1,4 @@ +Source: libvorbis +Version: +Description: Ogg Vorbis is a fully open, non-proprietary, patent-and-royalty-free, general-purpose compressed audio format. +Build-depends: libogg diff --git a/ports/libvorbis/portfile.cmake b/ports/libvorbis/portfile.cmake new file mode 100644 index 000000000..675a35b60 --- /dev/null +++ b/ports/libvorbis/portfile.cmake @@ -0,0 +1,58 @@ +# 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(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) +find_program(GIT git) + +set(GIT_URL "https://git.xiph.org/vorbis.git") +set(GIT_REF "143caf4023a90c09a5eb685fdd46fb9b9c36b1ee") + +if(NOT EXISTS "${DOWNLOADS}/vorbis.git") + message(STATUS "Cloning") + vcpkg_execute_required_process( + COMMAND ${GIT} clone --bare ${GIT_URL} ${DOWNLOADS}/vorbis.git + WORKING_DIRECTORY ${DOWNLOADS} + LOGNAME clone + ) +endif() + +if(NOT EXISTS "${CURRENT_BUILDTREES_DIR}/src/.git") + message(STATUS "Adding worktree and patching") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}) + vcpkg_execute_required_process( + COMMAND ${GIT} worktree add -f --detach ${CURRENT_BUILDTREES_DIR}/src ${GIT_REF} + WORKING_DIRECTORY ${DOWNLOADS}/vorbis.git + LOGNAME worktree + ) + message(STATUS "Patching") + vcpkg_execute_required_process( + COMMAND ${GIT} apply ${CMAKE_CURRENT_LIST_DIR}/0001-Add-vorbisenc.c-to-vorbis-library.patch --ignore-whitespace --whitespace=fix + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/src + LOGNAME patch + ) +endif() + +file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/include" OGG_INCLUDE) +file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/lib/ogg.lib" OGG_LIB_REL) +file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/debug/lib/ogg.lib" OGG_LIB_DBG) + +vcpkg_configure_cmake( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src + OPTIONS -DOGG_INCLUDE_DIRS=${OGG_INCLUDE} + OPTIONS_RELEASE -DOGG_LIBRARIES=${OGG_LIB_REL} + OPTIONS_DEBUG -DOGG_LIBRARIES=${OGG_LIB_DBG} +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# Handle copyright +file(COPY ${CURRENT_BUILDTREES_DIR}/src/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libvorbis) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/libvorbis/COPYING ${CURRENT_PACKAGES_DIR}/share/libvorbis/copyright) -- cgit v1.2.3 From d2c3ad8b57a82b016ebf5fe8f621294ad7497ddc Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 24 Oct 2016 15:36:33 -0700 Subject: [libogg] [libvorbis] Add vcpkg_copy_pdbs() --- ports/libogg/portfile.cmake | 2 ++ ports/libvorbis/portfile.cmake | 2 ++ 2 files changed, 4 insertions(+) diff --git a/ports/libogg/portfile.cmake b/ports/libogg/portfile.cmake index 8cd5a7a38..d19bee8f7 100644 --- a/ports/libogg/portfile.cmake +++ b/ports/libogg/portfile.cmake @@ -41,3 +41,5 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright file(COPY ${CURRENT_BUILDTREES_DIR}/src/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libogg) file(RENAME ${CURRENT_PACKAGES_DIR}/share/libogg/COPYING ${CURRENT_PACKAGES_DIR}/share/libogg/copyright) + +vcpkg_copy_pdbs() diff --git a/ports/libvorbis/portfile.cmake b/ports/libvorbis/portfile.cmake index 675a35b60..6e50efd93 100644 --- a/ports/libvorbis/portfile.cmake +++ b/ports/libvorbis/portfile.cmake @@ -56,3 +56,5 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright file(COPY ${CURRENT_BUILDTREES_DIR}/src/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libvorbis) file(RENAME ${CURRENT_PACKAGES_DIR}/share/libvorbis/COPYING ${CURRENT_PACKAGES_DIR}/share/libvorbis/copyright) + +vcpkg_copy_pdbs() -- cgit v1.2.3 From 7028baa07f344c2aad237902ce27edb174e760fa Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 24 Oct 2016 16:32:04 -0700 Subject: [jxrlib] Add call to vcpkg_copy_pdbs() --- ports/jxrlib/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/jxrlib/portfile.cmake b/ports/jxrlib/portfile.cmake index 40c29c0b0..0fce5b9ba 100644 --- a/ports/jxrlib/portfile.cmake +++ b/ports/jxrlib/portfile.cmake @@ -19,6 +19,10 @@ vcpkg_install_cmake() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + vcpkg_copy_pdbs() +endif() + # Handle copyright file(COPY ${CMAKE_CURRENT_LIST_DIR}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/jxrlib) file(RENAME ${CURRENT_PACKAGES_DIR}/share/jxrlib/LICENSE ${CURRENT_PACKAGES_DIR}/share/jxrlib/copyright) -- cgit v1.2.3 From 51443effab0889645282a07c584afdec441e287a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 24 Oct 2016 16:43:24 -0700 Subject: [cpprestsdk] Enable static building --- ports/cpprestsdk/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/cpprestsdk/portfile.cmake b/ports/cpprestsdk/portfile.cmake index 11db7c379..4bb062867 100644 --- a/ports/cpprestsdk/portfile.cmake +++ b/ports/cpprestsdk/portfile.cmake @@ -1,3 +1,4 @@ +include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) find_program(GIT git) -- cgit v1.2.3 From 0f0c0b7ad9e712473bde78b7ebf9700a667b3027 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 24 Oct 2016 17:06:33 -0700 Subject: [vcpkg_apply_patches] Specify git-dir to avoid errors due to invalid git repo --- scripts/cmake/vcpkg_apply_patches.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cmake/vcpkg_apply_patches.cmake b/scripts/cmake/vcpkg_apply_patches.cmake index f5d4d75f1..731909834 100644 --- a/scripts/cmake/vcpkg_apply_patches.cmake +++ b/scripts/cmake/vcpkg_apply_patches.cmake @@ -7,7 +7,7 @@ function(vcpkg_apply_patches) message(STATUS "Applying patch ${PATCH}") set(LOGNAME patch-${TARGET_TRIPLET}-${PATCHNUM}) execute_process( - COMMAND ${GIT} --work-tree=. apply "${PATCH}" --ignore-whitespace --whitespace=nowarn --verbose + COMMAND ${GIT} --work-tree=. --git-dir=. apply "${PATCH}" --ignore-whitespace --whitespace=nowarn --verbose OUTPUT_FILE ${CURRENT_BUILDTREES_DIR}/${LOGNAME}-out.log ERROR_FILE ${CURRENT_BUILDTREES_DIR}/${LOGNAME}-err.log WORKING_DIRECTORY ${_ap_SOURCE_PATH} -- cgit v1.2.3 From c725dda5db2a284aa070278da5a7cc1061e57f1a Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 24 Oct 2016 17:07:03 -0700 Subject: [cpprestsdk] Revert removal of CASA_INSTALL_HEADERS --- ports/cpprestsdk/portfile.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/cpprestsdk/portfile.cmake b/ports/cpprestsdk/portfile.cmake index 3fb63ae80..db052a9e3 100644 --- a/ports/cpprestsdk/portfile.cmake +++ b/ports/cpprestsdk/portfile.cmake @@ -13,7 +13,7 @@ vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES - ${CMAKE_CURRENT_LIST_DIR}/0001_cmake.patch + ${CMAKE_CURRENT_LIST_DIR}/0001_cmake.patch ) vcpkg_configure_cmake( @@ -22,15 +22,15 @@ vcpkg_configure_cmake( -DBUILD_TESTS=OFF -DBUILD_SAMPLES=OFF -DCPPREST_EXCLUDE_WEBSOCKETS=ON + OPTIONS_DEBUG + -DCASA_INSTALL_HEADERS=OFF ) vcpkg_install_cmake() -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) - file(INSTALL - ${SOURCE_PATH}/license.txt - DESTINATION ${CURRENT_PACKAGES_DIR}/share/cpprestsdk RENAME copyright) + ${SOURCE_PATH}/license.txt + DESTINATION ${CURRENT_PACKAGES_DIR}/share/cpprestsdk RENAME copyright) vcpkg_copy_pdbs() -- cgit v1.2.3 From 65a49cf85f98fe9ead5092fbacf5b6b5ff6147c9 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 24 Oct 2016 17:45:01 -0700 Subject: [cpprestsdk] Only run vcpkg_copy_pdbs() when building dynamically --- ports/cpprestsdk/portfile.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ports/cpprestsdk/portfile.cmake b/ports/cpprestsdk/portfile.cmake index db052a9e3..98d45d857 100644 --- a/ports/cpprestsdk/portfile.cmake +++ b/ports/cpprestsdk/portfile.cmake @@ -32,5 +32,7 @@ file(INSTALL ${SOURCE_PATH}/license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/cpprestsdk RENAME copyright) -vcpkg_copy_pdbs() +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + vcpkg_copy_pdbs() +endif() -- cgit v1.2.3 From 8dbeacd5ad5d9a1d5719f9e84c1f91ee93a2d37d Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Tue, 25 Oct 2016 12:39:50 +1100 Subject: static linkage and jom fixes --- ports/qt5/CONTROL | 2 +- ports/qt5/portfile.cmake | 25 +++++++++++++++++++++++-- scripts/cmake/vcpkg_find_acquire_program.cmake | 10 +++++----- 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/ports/qt5/CONTROL b/ports/qt5/CONTROL index 6afd3e5c5..acdfd4ec8 100644 --- a/ports/qt5/CONTROL +++ b/ports/qt5/CONTROL @@ -1,4 +1,4 @@ Source: qt5 Version: 5.7 Build-Depends: -Description: Qt5 base components. +Description: Qt5 application framework base components. Webengine, examples and tests not included. diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake index 53abe8e02..c7358dec6 100644 --- a/ports/qt5/portfile.cmake +++ b/ports/qt5/portfile.cmake @@ -1,7 +1,8 @@ +include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/qt-5.7.0) -set(ENV{QMAKESPEC} win32-msvc2015) set(OUTPUT_PATH ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) +set(ENV{QMAKESPEC} win32-msvc2015) set(ENV{QTDIR} ${OUTPUT_PATH}/qtbase) set(ENV{PATH} "${OUTPUT_PATH}/qtbase/bin;$ENV{PATH}") @@ -22,10 +23,16 @@ endif() file(MAKE_DIRECTORY ${OUTPUT_PATH}) message(STATUS "Configuring ${TARGET_TRIPLET}") + +#if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL static) +# list(APPEND QT_RUNTIME_LINKAGE "-static") +# list(APPEND QT_RUNTIME_LINKAGE "-static-runtime") +#endif() + vcpkg_execute_required_process( COMMAND "${SOURCE_PATH}/configure.bat" -confirm-license -opensource - -debug-and-release -force-debug-info + -debug-and-release -force-debug-info ${QT_RUNTIME_LINKAGE} -nomake examples -nomake tests -skip webengine -prefix "${CURRENT_PACKAGES_DIR}" WORKING_DIRECTORY ${OUTPUT_PATH} @@ -92,6 +99,20 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Gamepad.lib ${CURRENT_PACKAGES_ file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Gamepad.prl ${CURRENT_PACKAGES_DIR}/lib/Qt5Gamepad.prl) file(GLOB BINARY_TOOLS "${CURRENT_PACKAGES_DIR}/bin/*.exe") file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools) +foreach(BINARY ${BINARY_TOOLS}) + execute_process(COMMAND dumpbin /PDBPATH ${BINARY} + COMMAND findstr PDB + OUTPUT_VARIABLE PDB_LINE + ERROR_QUIET + RESULT_VARIABLE error_code + ) + if(NOT error_code AND PDB_LINE MATCHES "PDB file found at") + string(REGEX MATCH '.*' PDB_PATH ${PDB_LINE}) # Extract the path which is in single quotes + string(REPLACE ' "" PDB_PATH ${PDB_PATH}) # Remove single quotes + file(INSTALL ${PDB_PATH} DESTINATION ${CURRENT_PACKAGES_DIR}/tools) + file(REMOVE ${PDB_PATH}) + endif() +endforeach() file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools) FILE(REMOVE ${BINARY_TOOLS}) diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 230c4b1e7..0e993b78b 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -25,11 +25,11 @@ function(vcpkg_find_acquire_program VAR) set(NOEXTRACT ON) set(HASH 850b26be5bbbdaeaf45ac39dd27f69f1a85e600c35afbd16b9f621396b3c7a19863ea3ff316b025b578fce0a8280eef2203306a2b3e46ee1389abb65313fb720) elseif(VAR MATCHES "JOM") -set(PROGNAME jom) -set(PATHS ${DOWNLOADS}/tools/jom/jom-1.1.1) -set(URL "http://download.qt.io/official_releases/jom/jom_1_1_1.zip") -set(ARCHIVE "jom_1_1_1.zip") -set(HASH 850b26be5bbbdaeaf45ac39dd27f69f1a85e600c35afbd16b9f621396b3c7a19863ea3ff316b025b578fce0a8280eef2203306a2b3e46ee1389abb65313fb720) + set(PROGNAME jom) + set(PATHS ${DOWNLOADS}/tools/jom) + set(URL "http://download.qt.io/official_releases/jom/jom_1_1_1.zip") + set(ARCHIVE "jom_1_1_1.zip") + set(HASH 23a26dc7e29979bec5dcd3bfcabf76397b93ace64f5d46f2254d6420158bac5eff1c1a8454e3427e7a2fe2c233c5f2cffc87b376772399e12e40b51be2c065f4) else() message(FATAL "unknown tool ${VAR} -- unable to acquire.") endif() -- cgit v1.2.3 From 3e22b5164b8694b62cff85da05476a989c2f0413 Mon Sep 17 00:00:00 2001 From: sdcb Date: Tue, 25 Oct 2016 09:55:25 +0800 Subject: [cpprestsdk] Add websocket support. --- ports/cpprestsdk/CONTROL | 1 + ports/cpprestsdk/portfile.cmake | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ports/cpprestsdk/CONTROL b/ports/cpprestsdk/CONTROL index 4c55c7060..9ed939516 100644 --- a/ports/cpprestsdk/CONTROL +++ b/ports/cpprestsdk/CONTROL @@ -1,4 +1,5 @@ Source: cpprestsdk Version: 2.9.0 +Build-Depends: zlib, openssl, boost Description: C++11 JSON, REST, and OAuth library The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services. \ No newline at end of file diff --git a/ports/cpprestsdk/portfile.cmake b/ports/cpprestsdk/portfile.cmake index 98d45d857..c10f2b065 100644 --- a/ports/cpprestsdk/portfile.cmake +++ b/ports/cpprestsdk/portfile.cmake @@ -21,7 +21,7 @@ vcpkg_configure_cmake( OPTIONS -DBUILD_TESTS=OFF -DBUILD_SAMPLES=OFF - -DCPPREST_EXCLUDE_WEBSOCKETS=ON + -DCPPREST_EXCLUDE_WEBSOCKETS=OFF OPTIONS_DEBUG -DCASA_INSTALL_HEADERS=OFF ) -- cgit v1.2.3 From d1849efe943ffc05c8b49c44e59e138a46ac4684 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 24 Oct 2016 20:31:16 -0700 Subject: [cpprestsdk] Bump version to 2.9.0-1 to indicate change in configuration --- ports/cpprestsdk/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/cpprestsdk/CONTROL b/ports/cpprestsdk/CONTROL index 9ed939516..db1c9038e 100644 --- a/ports/cpprestsdk/CONTROL +++ b/ports/cpprestsdk/CONTROL @@ -1,5 +1,5 @@ Source: cpprestsdk -Version: 2.9.0 +Version: 2.9.0-1 Build-Depends: zlib, openssl, boost Description: C++11 JSON, REST, and OAuth library The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services. \ No newline at end of file -- cgit v1.2.3 From b01b2c8467042d4313d916208c26a7b382292a52 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 24 Oct 2016 21:00:23 -0700 Subject: [EXAMPLES.md] Switch base example to Sqlite. This demonstrates cmake's integration better with find_package(), as well as keeps the initial user impression very sleek with short build times. --- docs/EXAMPLES.md | 81 ++++++++++++++++++++++++-------------------------------- 1 file changed, 35 insertions(+), 46 deletions(-) diff --git a/docs/EXAMPLES.md b/docs/EXAMPLES.md index d991d87f9..7862ba354 100644 --- a/docs/EXAMPLES.md +++ b/docs/EXAMPLES.md @@ -6,7 +6,7 @@ Vcpkg helps you get C and C++ libraries on Windows. For short description of available commands, run `vcpkg help`. ## Table of Contents -- Example 1: Using the C++ REST SDK +- Example 1: Using Sqlite - Step 1: Build - Step 2: Use - Option A: VS Project (User-wide integration) @@ -17,49 +17,35 @@ For short description of available commands, run `vcpkg help`. - Example 3: Patching libpng to work for uwp-x86 -## Example 1: C++ REST SDK +## Example 1: Using Sqlite ### Step 1: Build -First, we need to know what name C++ REST SDK goes by in the ports tree. To do that, we'll run the `search` command and inspect the output: +First, we need to know what name [Sqlite](https://sqlite.org) goes by in the ports tree. To do that, we'll run the `search` command and inspect the output: ``` -PS D:\src\vcpkg> .\vcpkg search -boost 1.60 Peer-reviewed portable C++ source libraries -cpprestsdk 2.8 C++11 JSON, REST, and OAuth library The C++ RES... -curl 7.48.0 A library for transferring data with URLs -expat 2.1.1 XML parser library written in C -freetype 2.6.3 A library to render fonts. -glew 1.13.0 The OpenGL Extension Wrangler Library (GLEW) is a... -glfw3 3.1.2 GLFW is a free, Open Source, multi-platform libra... -libjpeg-turbo 1.4.90-1 libjpeg-turbo is a JPEG image codec that uses SIM... -libpng 1.6.24-1 libpng is a library implementing an interface for... -libuv 1.9.1 libuv is a multi-platform support library with a ... -libwebsockets 2.0.0 Libwebsockets is a lightweight pure C library bui... -mpg123 1.23.3 mpg123 is a real time MPEG 1.0/2.0/2.5 audio play... -openal-soft 1.17.2 OpenAL Soft is an LGPL-licensed, cross-platform, ... -opencv 3.1.0 computer vision library -opengl 10.0.10240.0 Open Graphics Library (OpenGL)[3][4][5] is a cros... -openssl 1.0.2h OpenSSL is an open source project that provides a... -range-v3 0.0.0-1 Range library for C++11/14/17. -rapidjson 1.0.2-1 A fast JSON parser/generator for C++ with both SA... -sdl2 2.0.4 Simple DirectMedia Layer is a cross-platform deve... -sqlite3 3120200 SQLite is a software library that implements a se... -tiff 4.0.6 A library that supports the manipulation of TIFF ... -tinyxml2 3.0.0 A simple, small, efficient, C++ XML parser -zlib 1.2.8 A compression library +PS D:\src\vcpkg> .\vcpkg search sqlite +libodb-sqlite 2.4.0 Sqlite support for the ODB ORM library +sqlite3 3.15.0 SQLite is a software library that implements a se... + +If your library is not listed, please open an issue at: + https://github.com/Microsoft/vcpkg/issues ``` -Looking at the list, we can see that the port is named "cpprestsdk". +Looking at the list, we can see that the port is named "sqlite3". You can also run the `search` command without arguments to see the full list of packages. -Installing is then as simple as using the `install` command. Since we haven't built this library before, we'll first see an error message indicating that the control file failed to load, then the port will automatically begin building (and install when completed). +Installing is then as simple as using the `install` command. ``` -PS D:\src\vcpkg> .\vcpkg install cpprestsdk +PS D:\src\vcpkg> .\vcpkg install sqlite3 -- CURRENT_INSTALLED_DIR=D:/src/vcpkg/installed/x86-windows -- DOWNLOADS=D:/src/vcpkg/downloads --- CURRENT_PACKAGES_DIR=D:/src/vcpkg/packages/cpprestsdk_x86-windows --- CURRENT_BUILDTREES_DIR=D:/src/vcpkg/buildtrees/cpprestsdk --- CURRENT_PORT_DIR=D:/src/vcpkg/ports/cpprestsdk/. --- Cloning done --- Adding worktree and patching done +-- CURRENT_PACKAGES_DIR=D:/src/vcpkg/packages/sqlite3_x86-windows +-- CURRENT_BUILDTREES_DIR=D:/src/vcpkg/buildtrees/sqlite3 +-- CURRENT_PORT_DIR=D:/src/vcpkg/ports/sqlite3/. +-- Downloading https://sqlite.org/2016/sqlite-amalgamation-3150000.zip... +-- Downloading https://sqlite.org/2016/sqlite-amalgamation-3150000.zip... OK +-- Testing integrity of downloaded file... +-- Testing integrity of downloaded file... OK +-- Extracting source D:/src/vcpkg/downloads/sqlite-amalgamation-3150000.zip +-- Extracting done -- Configuring x86-windows-rel -- Configuring x86-windows-rel done -- Configuring x86-windows-dbg @@ -72,14 +58,16 @@ PS D:\src\vcpkg> .\vcpkg install cpprestsdk -- Package x86-windows-rel done -- Package x86-windows-dbg -- Package x86-windows-dbg done -Package cpprestsdk:x86-windows is installed +-- Performing post-build validation +-- Performing post-build validation done +Package sqlite3:x86-windows is installed ``` -In addition to installing, `vcpkg` caches a pristine copy of the built library inside the `packages\` directory (in this case, `packages\cpprestsdk_x86-windows`). This allows you to quickly uninstall and reinstall the library in the future using the `remove` and `install` commands. +In addition to installing, `vcpkg` caches a pristine copy of the built library inside the `packages\` directory -- in this case, `packages\sqlite3_x86-windows`. This allows you to quickly uninstall and reinstall the library in the future using the `remove` and `install` commands. We can check that cpprestsdk was successfully installed for x86 windows desktop by running the `list` command. ``` PS D:\src\vcpkg> .\vcpkg list -cpprestsdk:x86-windows 2.8 A modern C++11 library to connect with web servic... +sqlite3:x86-windows 3.15.0 SQLite is a software library that implements a se... ``` To install for other architectures and platforms such as Universal Windows Platform or x64 Desktop, you can suffix the package name with `:`. @@ -105,6 +93,8 @@ Installing new libraries will make them instantly available. ``` *Note: You will need to restart Visual Studio or perform a Build to update intellisense with the changes.* +You can now simply use File -> New Project in Visual Studio 2015 or Visual Studio "15" Preview and the library will be automatically available. For Sqlite, you can try out their [C/C++ sample](https://sqlite.org/quickstart.html). + To remove the integration for your user, you can use `vcpkg integrate remove`. @@ -118,22 +108,19 @@ Let's first make a simple CMake project with a main file. cmake_minimum_required(VERSION 3.0) project(test) -find_library(CPPREST_LIBRARY cpprest_2_8) -find_path(CPPREST_INCLUDE_DIR cpprest/version.h) +find_package(Sqlite3 REQUIRED) -include_directories(${CPPREST_INCLUDE_DIR}) -link_libraries(${CPPREST_LIBRARY}) +link_libraries(sqlite3) add_executable(main main.cpp) ``` ```cpp // main.cpp -#include +#include #include int main() { - auto v = web::json::value::parse(U("[1,2,3,4]")); - printf("Success\n"); + printf("%s\n", sqlite3_libversion()); return 0; } ``` @@ -153,9 +140,11 @@ Build succeeded. Time Elapsed 00:00:02.38 PS D:\src\cmake-test\build> .\Debug\main.exe -Success +3.15.0 ``` +*Note: The correct sqlite3.dll is automatically copied to the output folder when building for x86-windows. You will need to distribute this along with your application.* + #### Option C: Other buildsystems -- cgit v1.2.3 From dffedfaa320a0e73f2f4e455d0ef8fba7e72d75c Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 24 Oct 2016 21:13:30 -0700 Subject: [vcpkg_apply_patches] Improve error message from failed patch apply. --- scripts/cmake/vcpkg_apply_patches.cmake | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/cmake/vcpkg_apply_patches.cmake b/scripts/cmake/vcpkg_apply_patches.cmake index 731909834..2ebf4266e 100644 --- a/scripts/cmake/vcpkg_apply_patches.cmake +++ b/scripts/cmake/vcpkg_apply_patches.cmake @@ -16,11 +16,10 @@ function(vcpkg_apply_patches) if(error_code) message(STATUS - "Applying patch failed: ${GIT} --work-tree=. apply \"${PATCH}\" --ignore-whitespace --whitespace=nowarn --verbose\n" - "Working Directory: ${_ap_SOURCE_PATH}\n" - "See logs for more information:\n" - " ${CURRENT_BUILDTREES_DIR}/${LOGNAME}-out.log\n" - " ${CURRENT_BUILDTREES_DIR}/${LOGNAME}-err.log\n") + "Applying patch failed: ${GIT} --work-tree=. --git-dir=. apply \"${PATCH}\" --ignore-whitespace --whitespace=nowarn --verbose\n" + "-- Working Directory: ${_ap_SOURCE_PATH}\n" + "-- This is expected if this patch was previously applied.\n" + "-- See logs for more information: ${CURRENT_BUILDTREES_DIR}/${LOGNAME}-out.log ${CURRENT_BUILDTREES_DIR}/${LOGNAME}-err.log") endif() message(STATUS "Applying patch ${PATCH} done") -- cgit v1.2.3 From 7e19b17a07c45b3b4b5ab3972e84bac90c0b64f9 Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Tue, 25 Oct 2016 16:14:21 +1100 Subject: static installation fixes --- ports/qt5/CONTROL | 2 +- ports/qt5/portfile.cmake | 20 ++++++++++++++------ ports/qt5/set-shared-qmakespec.patch | 18 ++++++++++++++++++ ports/qt5/set-static-qmakespec.patch | 18 ++++++++++++++++++ 4 files changed, 51 insertions(+), 7 deletions(-) create mode 100644 ports/qt5/set-shared-qmakespec.patch create mode 100644 ports/qt5/set-static-qmakespec.patch diff --git a/ports/qt5/CONTROL b/ports/qt5/CONTROL index acdfd4ec8..1629819e8 100644 --- a/ports/qt5/CONTROL +++ b/ports/qt5/CONTROL @@ -1,4 +1,4 @@ Source: qt5 Version: 5.7 Build-Depends: -Description: Qt5 application framework base components. Webengine, examples and tests not included. +Description: Qt5 application framework main components. Webengine, examples and tests not included. diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake index c7358dec6..9a5d7ff03 100644 --- a/ports/qt5/portfile.cmake +++ b/ports/qt5/portfile.cmake @@ -2,7 +2,6 @@ include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/qt-5.7.0) set(OUTPUT_PATH ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) -set(ENV{QMAKESPEC} win32-msvc2015) set(ENV{QTDIR} ${OUTPUT_PATH}/qtbase) set(ENV{PATH} "${OUTPUT_PATH}/qtbase/bin;$ENV{PATH}") @@ -24,14 +23,23 @@ endif() file(MAKE_DIRECTORY ${OUTPUT_PATH}) message(STATUS "Configuring ${TARGET_TRIPLET}") -#if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL static) -# list(APPEND QT_RUNTIME_LINKAGE "-static") -# list(APPEND QT_RUNTIME_LINKAGE "-static-runtime") -#endif() +if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL static) + list(APPEND QT_RUNTIME_LINKAGE "-static") + list(APPEND QT_RUNTIME_LINKAGE "-static-runtime") + vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES "${CMAKE_CURRENT_LIST_DIR}/set-static-qmakespec.patch" + ) +else() + vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES "${CMAKE_CURRENT_LIST_DIR}/set-shared-qmakespec.patch" + ) +endif() vcpkg_execute_required_process( COMMAND "${SOURCE_PATH}/configure.bat" - -confirm-license -opensource + -confirm-license -opensource -developer-build -platform win32-msvc2015 -debug-and-release -force-debug-info ${QT_RUNTIME_LINKAGE} -nomake examples -nomake tests -skip webengine -prefix "${CURRENT_PACKAGES_DIR}" diff --git a/ports/qt5/set-shared-qmakespec.patch b/ports/qt5/set-shared-qmakespec.patch new file mode 100644 index 000000000..d4b7c2a82 --- /dev/null +++ b/ports/qt5/set-shared-qmakespec.patch @@ -0,0 +1,18 @@ +diff --git a/qtbase/mkspecs/common/msvc-desktop.conf b/qtbase/mkspecs/common/msvc-desktop.conf +index 80fcd9b..1b9d57b 100644 +--- a/qtbase/mkspecs/common/msvc-desktop.conf ++++ b/qtbase/mkspecs/common/msvc-desktop.conf +@@ -29,9 +29,9 @@ + QMAKE_YACCFLAGS = -d + QMAKE_CFLAGS = -nologo -Zc:wchar_t + QMAKE_CFLAGS_WARN_ON = -W3 + QMAKE_CFLAGS_WARN_OFF = -W0 +-QMAKE_CFLAGS_RELEASE = -O2 -MT +-QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MT -Zi +-QMAKE_CFLAGS_DEBUG = -Zi -MTd ++QMAKE_CFLAGS_RELEASE = -O2 -MD ++QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MD -Zi ++QMAKE_CFLAGS_DEBUG = -Zi -MDd + QMAKE_CFLAGS_YACC = + QMAKE_CFLAGS_LTCG = -GL + \ No newline at end of file diff --git a/ports/qt5/set-static-qmakespec.patch b/ports/qt5/set-static-qmakespec.patch new file mode 100644 index 000000000..26b312f2f --- /dev/null +++ b/ports/qt5/set-static-qmakespec.patch @@ -0,0 +1,18 @@ +diff --git a/qtbase/mkspecs/common/msvc-desktop.conf b/qtbase/mkspecs/common/msvc-desktop.conf +index 1b9d57b..80fcd9b 100644 +--- a/qtbase/mkspecs/common/msvc-desktop.conf ++++ b/qtbase/mkspecs/common/msvc-desktop.conf +@@ -29,9 +29,9 @@ + QMAKE_YACCFLAGS = -d + QMAKE_CFLAGS = -nologo -Zc:wchar_t + QMAKE_CFLAGS_WARN_ON = -W3 + QMAKE_CFLAGS_WARN_OFF = -W0 +-QMAKE_CFLAGS_RELEASE = -O2 -MD +-QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MD -Zi +-QMAKE_CFLAGS_DEBUG = -Zi -MDd ++QMAKE_CFLAGS_RELEASE = -O2 -MT ++QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MT -Zi ++QMAKE_CFLAGS_DEBUG = -Zi -MTd + QMAKE_CFLAGS_YACC = + QMAKE_CFLAGS_LTCG = -GL + \ No newline at end of file -- cgit v1.2.3 From b9495bab4ba42fda7c4957fc646ea13ab6d98c74 Mon Sep 17 00:00:00 2001 From: Stephan Kaiser Date: Sun, 23 Oct 2016 22:44:46 +0200 Subject: add port for Crypto++ --- ports/cryptopp/CONTROL | 3 +++ ports/cryptopp/portfile.cmake | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 ports/cryptopp/CONTROL create mode 100644 ports/cryptopp/portfile.cmake diff --git a/ports/cryptopp/CONTROL b/ports/cryptopp/CONTROL new file mode 100644 index 000000000..2a38d8910 --- /dev/null +++ b/ports/cryptopp/CONTROL @@ -0,0 +1,3 @@ +Source: cryptopp +Version: 5.6.5 +Description: Crypto++ is a free C++ class library of cryptographic schemes. diff --git a/ports/cryptopp/portfile.cmake b/ports/cryptopp/portfile.cmake new file mode 100644 index 000000000..e80c541b7 --- /dev/null +++ b/ports/cryptopp/portfile.cmake @@ -0,0 +1,42 @@ +include(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/cryptopp-CRYPTOPP_5_6_5) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/weidai11/cryptopp/archive/CRYPTOPP_5_6_5.zip" + FILENAME "CRYPTOPP_5_6_5.zip" + SHA512 abca8089e2d587f59c503d2d6412b3128d061784349c735f3ee46be1cb9e3d0d0fed9a9173765fa033eb2dc744e03810de45b8cc2f8ca1672a36e4123648ea44 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +# Dynamic linking should be avoided for Crypto++ to reduce the attack surface, +# so generate a static lib for both dynamic and static vcpkg targets. +# See also: +# https://www.cryptopp.com/wiki/Visual_Studio#Dynamic_Runtime_Linking +# https://www.cryptopp.com/wiki/Visual_Studio#The_DLL + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DBUILD_SHARED=OFF + -DBUILD_STATIC=ON + -DBUILD_TESTING=OFF + -DBUILD_DOCUMENTATION=OFF +) + +vcpkg_install_cmake() + +# There is no way to suppress installation of the headers and resource files in debug build. +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + +# Remove executables +file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/cryptest.exe) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/cryptest.exe) + +# Remove other files not required in package +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/cmake) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) + +# Handle copyright +file(COPY ${SOURCE_PATH}/License.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/cryptopp) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/cryptopp/License.txt ${CURRENT_PACKAGES_DIR}/share/cryptopp/copyright) -- cgit v1.2.3 From 162ba52f43d2463150bbf81d65ae218a1df11814 Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Tue, 25 Oct 2016 20:56:02 +1100 Subject: need a function to repeatedly build up to a number of failures, since qt builds are so flaky --- ports/qt5/portfile.cmake | 37 ++++++++++++---------- scripts/cmake/vcpkg_common_functions.cmake | 3 +- .../vcpkg_execute_required_process_repeat.cmake | 28 ++++++++++++++++ scripts/cmake/vcpkg_find_acquire_program.cmake | 2 +- 4 files changed, 51 insertions(+), 19 deletions(-) create mode 100644 scripts/cmake/vcpkg_execute_required_process_repeat.cmake diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake index 9a5d7ff03..d4f8c84ff 100644 --- a/ports/qt5/portfile.cmake +++ b/ports/qt5/portfile.cmake @@ -21,8 +21,6 @@ if (EXISTS ${CURRENT_BUILDTREES_DIR}/src/qt-everywhere-opensource-src-5.7.0) endif() file(MAKE_DIRECTORY ${OUTPUT_PATH}) -message(STATUS "Configuring ${TARGET_TRIPLET}") - if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL static) list(APPEND QT_RUNTIME_LINKAGE "-static") list(APPEND QT_RUNTIME_LINKAGE "-static-runtime") @@ -37,9 +35,10 @@ else() ) endif() +message(STATUS "Configuring ${TARGET_TRIPLET}") vcpkg_execute_required_process( COMMAND "${SOURCE_PATH}/configure.bat" - -confirm-license -opensource -developer-build -platform win32-msvc2015 + -confirm-license -opensource -platform win32-msvc2015 -debug-and-release -force-debug-info ${QT_RUNTIME_LINKAGE} -nomake examples -nomake tests -skip webengine -prefix "${CURRENT_PACKAGES_DIR}" @@ -49,7 +48,8 @@ vcpkg_execute_required_process( message(STATUS "Configure ${TARGET_TRIPLET} done") message(STATUS "Building ${TARGET_TRIPLET}") -vcpkg_execute_required_process( +vcpkg_execute_required_process_repeat( + COUNT 5 COMMAND ${JOM} WORKING_DIRECTORY ${OUTPUT_PATH} LOGNAME build-${TARGET_TRIPLET} @@ -71,19 +71,21 @@ file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) -file(INSTALL ${CURRENT_PACKAGES_DIR}/bin - DESTINATION ${CURRENT_PACKAGES_DIR}/debug - FILES_MATCHING PATTERN "*d.dll" -) -file(INSTALL ${CURRENT_PACKAGES_DIR}/bin - DESTINATION ${CURRENT_PACKAGES_DIR}/debug - FILES_MATCHING PATTERN "*d.pdb" -) -file(GLOB DEBUG_BIN_FILES "${CURRENT_PACKAGES_DIR}/bin/*d.dll") -file(REMOVE ${DEBUG_BIN_FILES}) -file(GLOB DEBUG_BIN_FILES "${CURRENT_PACKAGES_DIR}/bin/*d.pdb") -file(REMOVE ${DEBUG_BIN_FILES}) -file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/Qt5Gamepad.dll ${CURRENT_PACKAGES_DIR}/bin/Qt5Gamepad.dll) +if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL dynamic) + file(INSTALL ${CURRENT_PACKAGES_DIR}/bin + DESTINATION ${CURRENT_PACKAGES_DIR}/debug + FILES_MATCHING PATTERN "*d.dll" + ) + file(INSTALL ${CURRENT_PACKAGES_DIR}/bin + DESTINATION ${CURRENT_PACKAGES_DIR}/debug + FILES_MATCHING PATTERN "*d.pdb" + ) + file(GLOB DEBUG_BIN_FILES "${CURRENT_PACKAGES_DIR}/bin/*d.dll") + file(REMOVE ${DEBUG_BIN_FILES}) + file(GLOB DEBUG_BIN_FILES "${CURRENT_PACKAGES_DIR}/bin/*d.pdb") + file(REMOVE ${DEBUG_BIN_FILES}) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/Qt5Gamepad.dll ${CURRENT_PACKAGES_DIR}/bin/Qt5Gamepad.dll) +endif() file(INSTALL ${CURRENT_PACKAGES_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug @@ -133,4 +135,5 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/phrasebooks ${SHARE_PATH}/phrasebooks) file(RENAME ${CURRENT_PACKAGES_DIR}/plugins ${SHARE_PATH}/plugins) file(RENAME ${CURRENT_PACKAGES_DIR}/qml ${SHARE_PATH}/qml) file(RENAME ${CURRENT_PACKAGES_DIR}/translations ${SHARE_PATH}/translations) +file(RENAME ${CURRENT_PACKAGES_DIR}/qtvirtualkeyboard ${SHARE_PATH}/qtvirtualkeyboard) vcpkg_copy_pdbs() diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake index 59824eb17..f1bbdb9e3 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -1,10 +1,11 @@ include(vcpkg_download_distfile) include(vcpkg_extract_source_archive) include(vcpkg_execute_required_process) +include(vcpkg_execute_required_process_repeat) include(vcpkg_find_acquire_program) include(vcpkg_build_cmake) include(vcpkg_build_msbuild) include(vcpkg_install_cmake) include(vcpkg_configure_cmake) include(vcpkg_apply_patches) -include(vcpkg_copy_pdbs) \ No newline at end of file +include(vcpkg_copy_pdbs) diff --git a/scripts/cmake/vcpkg_execute_required_process_repeat.cmake b/scripts/cmake/vcpkg_execute_required_process_repeat.cmake new file mode 100644 index 000000000..562265ee2 --- /dev/null +++ b/scripts/cmake/vcpkg_execute_required_process_repeat.cmake @@ -0,0 +1,28 @@ +# Usage: vcpkg_execute_required_process_repeat(COUNT COMMAND [...] WORKING_DIRECTORY LOGNAME ) +function(vcpkg_execute_required_process_repeat) + cmake_parse_arguments(vcpkg_execute_required_process_repeat "" "COUNT;WORKING_DIRECTORY;LOGNAME" "COMMAND" ${ARGN}) + #debug_message("vcpkg_execute_required_process_repeat(${vcpkg_execute_required_process_repeat_COMMAND})") + foreach(loop_count RANGE ${vcpkg_execute_required_process_repeat_COUNT}) + execute_process( + COMMAND ${vcpkg_execute_required_process_repeat_COMMAND} + OUTPUT_FILE ${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_repeat_LOGNAME}-out.log + ERROR_FILE ${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process__repeat_LOGNAME}-err.log + RESULT_VARIABLE error_code + WORKING_DIRECTORY ${vcpkg_execute_required_process_repeat_WORKING_DIRECTORY}) + #debug_message("error_code=${error_code}") + file(TO_NATIVE_PATH "${CURRENT_BUILDTREES_DIR}" NATIVE_BUILDTREES_DIR) + if(NOT error_code) + set(SUCCESSFUL_EXECUTION TRUE) + break() + endif() + endforeach(loop_count) + if (NOT ${SUCCESSFUL_EXECUTION}) + message(FATAL_ERROR + " Command failed: ${vcpkg_execute_required_process_repeat_COMMAND}\n" + " Working Directory: ${vcpkg_execute_required_process_repeat_WORKING_DIRECTORY}\n" + " See logs for more information:\n" + " ${NATIVE_BUILDTREES_DIR}\\${vcpkg_execute_required_process_repeat_LOGNAME}-out.log\n" + " ${NATIVE_BUILDTREES_DIR}\\${vcpkg_execute_required_process_repeat_LOGNAME}-err.log\n" + ) + endif() +endfunction() diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 0e993b78b..337cc04a5 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -24,7 +24,7 @@ function(vcpkg_find_acquire_program VAR) set(ARCHIVE "yasm.exe") set(NOEXTRACT ON) set(HASH 850b26be5bbbdaeaf45ac39dd27f69f1a85e600c35afbd16b9f621396b3c7a19863ea3ff316b025b578fce0a8280eef2203306a2b3e46ee1389abb65313fb720) -elseif(VAR MATCHES "JOM") + elseif(VAR MATCHES "JOM") set(PROGNAME jom) set(PATHS ${DOWNLOADS}/tools/jom) set(URL "http://download.qt.io/official_releases/jom/jom_1_1_1.zip") -- cgit v1.2.3 From d0f23cf5f3fbcca4d53cd4192a99cbb4da4aa592 Mon Sep 17 00:00:00 2001 From: Stephan Kaiser Date: Tue, 25 Oct 2016 12:27:21 +0200 Subject: Fixed installation for x64 architecture. --- ports/zeromq/portfile.cmake | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/ports/zeromq/portfile.cmake b/ports/zeromq/portfile.cmake index d4cd3e1c9..0f75902cc 100644 --- a/ports/zeromq/portfile.cmake +++ b/ports/zeromq/portfile.cmake @@ -8,6 +8,13 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) +# Map from triplet "x86" to "win32" as used in the vcxproj file. +if (TRIPLET_SYSTEM_ARCH MATCHES "x86") + set(MSBUILD_PLATFORM "Win32") +else () + set(MSBUILD_PLATFORM ${TRIPLET_SYSTEM_ARCH}) +endif() + if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) vcpkg_build_msbuild( PROJECT_PATH ${SOURCE_PATH}/builds/msvc/vs2015/libzmq/libzmq.vcxproj @@ -15,19 +22,19 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) DEBUG_CONFIGURATION DebugDLL ) file(INSTALL - ${SOURCE_PATH}/bin/Win32/Debug/v140/dynamic/libzmq.dll + ${SOURCE_PATH}/bin/${MSBUILD_PLATFORM}/Debug/v140/dynamic/libzmq.dll DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin ) file(INSTALL - ${SOURCE_PATH}/bin/Win32/Release/v140/dynamic/libzmq.dll + ${SOURCE_PATH}/bin/${MSBUILD_PLATFORM}/Release/v140/dynamic/libzmq.dll DESTINATION ${CURRENT_PACKAGES_DIR}/bin ) file(INSTALL - ${SOURCE_PATH}/bin/Win32/Debug/v140/dynamic/libzmq.lib + ${SOURCE_PATH}/bin/${MSBUILD_PLATFORM}/Debug/v140/dynamic/libzmq.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib ) file(INSTALL - ${SOURCE_PATH}/bin/Win32/Release/v140/dynamic/libzmq.lib + ${SOURCE_PATH}/bin/${MSBUILD_PLATFORM}/Release/v140/dynamic/libzmq.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib ) vcpkg_copy_pdbs() @@ -39,11 +46,11 @@ else() DEBUG_CONFIGURATION DebugLIB ) file(INSTALL - ${SOURCE_PATH}/bin/Win32/Debug/v140/static/libzmq.lib + ${SOURCE_PATH}/bin/${MSBUILD_PLATFORM}/Debug/v140/static/libzmq.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib ) file(INSTALL - ${SOURCE_PATH}/bin/Win32/Release/v140/static/libzmq.lib + ${SOURCE_PATH}/bin/${MSBUILD_PLATFORM}/Release/v140/static/libzmq.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib ) endif() -- cgit v1.2.3 From ab4aa274c15f792f98a0f6ada3dfc61e444e0011 Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Tue, 25 Oct 2016 22:27:51 +1100 Subject: virtual keyboard directory isn't created in static builds, no rename required --- ports/qt5/portfile.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake index d4f8c84ff..357f7bdff 100644 --- a/ports/qt5/portfile.cmake +++ b/ports/qt5/portfile.cmake @@ -135,5 +135,7 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/phrasebooks ${SHARE_PATH}/phrasebooks) file(RENAME ${CURRENT_PACKAGES_DIR}/plugins ${SHARE_PATH}/plugins) file(RENAME ${CURRENT_PACKAGES_DIR}/qml ${SHARE_PATH}/qml) file(RENAME ${CURRENT_PACKAGES_DIR}/translations ${SHARE_PATH}/translations) -file(RENAME ${CURRENT_PACKAGES_DIR}/qtvirtualkeyboard ${SHARE_PATH}/qtvirtualkeyboard) +if (EXISTS ${CURRENT_PACKAGES_DIR}/qtvirtualkeyboard) + file(RENAME ${CURRENT_PACKAGES_DIR}/qtvirtualkeyboard ${SHARE_PATH}/qtvirtualkeyboard) +endif() vcpkg_copy_pdbs() -- cgit v1.2.3 From 095afa2ff154f67dee28420b0cb5abd426801734 Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Tue, 25 Oct 2016 22:31:27 +1100 Subject: incorrect error file variable --- scripts/cmake/vcpkg_execute_required_process_repeat.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cmake/vcpkg_execute_required_process_repeat.cmake b/scripts/cmake/vcpkg_execute_required_process_repeat.cmake index 562265ee2..d6fba132d 100644 --- a/scripts/cmake/vcpkg_execute_required_process_repeat.cmake +++ b/scripts/cmake/vcpkg_execute_required_process_repeat.cmake @@ -6,7 +6,7 @@ function(vcpkg_execute_required_process_repeat) execute_process( COMMAND ${vcpkg_execute_required_process_repeat_COMMAND} OUTPUT_FILE ${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_repeat_LOGNAME}-out.log - ERROR_FILE ${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process__repeat_LOGNAME}-err.log + ERROR_FILE ${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_repeat_LOGNAME}-err.log RESULT_VARIABLE error_code WORKING_DIRECTORY ${vcpkg_execute_required_process_repeat_WORKING_DIRECTORY}) #debug_message("error_code=${error_code}") -- cgit v1.2.3 From 4681f3de604f6b4af5c34e0ef9b8119574e3549b Mon Sep 17 00:00:00 2001 From: Jens Frederich Date: Tue, 25 Oct 2016 14:07:12 +0200 Subject: [think-cell-range] move boost range hotfix to boost portfile Signed-off-by: Jens Frederich --- ports/boost/CONTROL | 2 +- ports/boost/portfile.cmake | 13 ++++++++++++- ports/think-cell-range/portfile.cmake | 5 ----- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/ports/boost/CONTROL b/ports/boost/CONTROL index fc0f3cef7..4c4942752 100644 --- a/ports/boost/CONTROL +++ b/ports/boost/CONTROL @@ -1,3 +1,3 @@ Source: boost -Version: 1.62 +Version: 1.62-1 Description: Peer-reviewed portable C++ source libraries diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake index 43dde456a..783606f72 100644 --- a/ports/boost/portfile.cmake +++ b/ports/boost/portfile.cmake @@ -9,6 +9,17 @@ vcpkg_download_distfile(ARCHIVE_FILE ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) +# apply boost range hotfix +vcpkg_download_distfile(DIFF + URLS "https://github.com/boostorg/range/commit/e7ebe14707130cda7b72e0ae5e93b17157fdb6a2.diff" + FILENAME "boost-range-has_range_interator-hotfix_e7ebe14707130cda7b72e0ae5e93b17157fdb6a2.diff" + SHA512 77dad42bfd9bbab2bbddf361d5b7ad3dd6f812f4294c6dd1a677bb4d0191a4fff43bca32fdd4fce05d428562abb6e38afd0fd33ca6a8b5f28481d70cd2f3dd67 +) +FILE(READ "${DIFF}" content) +STRING(REGEX REPLACE "include/" "" content "${content}") +FILE(WRITE ${DIFF} "${content}") +vcpkg_apply_patches(SOURCE_PATH ${SOURCE_PATH} PATCHES ${DIFF}) + if(NOT EXISTS ${SOURCE_PATH}/b2.exe) message(STATUS "Bootstrapping") vcpkg_execute_required_process( @@ -116,4 +127,4 @@ elseif() endif() message(STATUS "Packaging ${TARGET_TRIPLET}-dbg done") -vcpkg_copy_pdbs() \ No newline at end of file +vcpkg_copy_pdbs() diff --git a/ports/think-cell-range/portfile.cmake b/ports/think-cell-range/portfile.cmake index c5537546e..81dc0eea4 100644 --- a/ports/think-cell-range/portfile.cmake +++ b/ports/think-cell-range/portfile.cmake @@ -14,8 +14,3 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/share/think-cell-range/COPYING ${CURRENT_PAC file(COPY ${SOURCE_PATH}/README.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/think-cell-range) file(COPY ${SOURCE_PATH}/range/range.example.cpp DESTINATION ${CURRENT_PACKAGES_DIR}/share/think-cell-range) - -vcpkg_apply_patches( - SOURCE_PATH ${CURRENT_INSTALLED_DIR}/include - PATCHES "${SOURCE_PATH}/boost_patches/has_range_iterator.patch" -) -- cgit v1.2.3 From 16bc1590b6d2a1a636b05515a94a46e134ea323c Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Tue, 25 Oct 2016 14:07:57 -0400 Subject: added some flags to pcre --- ports/pcre/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/pcre/portfile.cmake b/ports/pcre/portfile.cmake index 15c61142c..75d4275d2 100644 --- a/ports/pcre/portfile.cmake +++ b/ports/pcre/portfile.cmake @@ -22,6 +22,10 @@ vcpkg_configure_cmake( -DPCRE_BUILD_PCREGREP=NO -DPCRE_BUILD_PCRE32=YES -DPCRE_BUILD_PCRE16=YES + -DPCRE_BUILD_PCRE8=YES + -DPCRE_SUPPORT_JIT=YES + -DPCRE_SUPPORT_UTF=YES + -DPCRE_SUPPORT_UNICODE_PROPERTIES=YES # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 # OPTIONS_RELEASE -DOPTIMIZE=1 # OPTIONS_DEBUG -DDEBUGGABLE=1 -- cgit v1.2.3 From 516a1680aa48fc36ebea7a8ca1b082d65b4edc5f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 25 Oct 2016 14:02:04 -0700 Subject: [wt] Rename downloaded file to include wt in the name --- ports/wt/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/wt/portfile.cmake b/ports/wt/portfile.cmake index 3d9360e04..bacb09dda 100644 --- a/ports/wt/portfile.cmake +++ b/ports/wt/portfile.cmake @@ -4,7 +4,7 @@ set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/wt-3.3.6) vcpkg_download_distfile(ARCHIVE_FILE URLS "https://github.com/kdeforche/wt/archive/3.3.6.tar.gz" - FILENAME "3.3.6.tar.gz" + FILENAME "wt-3.3.6.tar.gz" SHA512 d6135713d300bcd3956a4fd673af73be0561eb5d6aa91c47255b966950ddb411217e6a826c1d11c0d941dbb6d006c9926231d7334b21de6256cca331066e18a6 ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) -- cgit v1.2.3 From b6a31ab430fbe618aa41595d54be977186d7fac2 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 25 Oct 2016 16:10:43 -0700 Subject: [openssl] Enable building statically. Also remove zlib dependency --- ports/openssl/CMakeLists.txt | 33 +++++++++++++++++++-------------- ports/openssl/CONTROL | 3 +-- ports/openssl/portfile.cmake | 17 ++++++++++------- 3 files changed, 30 insertions(+), 23 deletions(-) diff --git a/ports/openssl/CMakeLists.txt b/ports/openssl/CMakeLists.txt index 4ec875968..acb9bc7a5 100644 --- a/ports/openssl/CMakeLists.txt +++ b/ports/openssl/CMakeLists.txt @@ -5,7 +5,6 @@ include(vcpkg_execute_required_process) include(vcpkg_apply_patches) set(SOURCE_PATH ${CMAKE_CURRENT_BINARY_DIR}/openssl-1.0.2h) -find_package(ZLIB REQUIRED) find_program(PERL perl) find_program(NMAKE nmake) @@ -24,12 +23,10 @@ vcpkg_apply_patches( ) set(CONFIGURE_COMMAND ${PERL} Configure - no-idea - no-mdc2 - no-rc5 + enable-static-engine + enable-capieng no-asm - zlib-dynamic - "--with-zlib-include=${ZLIB_INCLUDE_DIRS}" + no-ssl2 ) if(TARGET_TRIPLET MATCHES "x86-windows") @@ -44,18 +41,18 @@ endif() if(CMAKE_BUILD_TYPE MATCHES "Debug") set(OPENSSLDIR ${CURRENT_PACKAGES_DIR}/debug) - list(GET ZLIB_LIBRARIES -1 ZLIB_DEBUG_LIBRARY) list(APPEND CONFIGURE_COMMAND debug-${OPENSSL_ARCH} + "--prefix=${OPENSSLDIR}" "--openssldir=${OPENSSLDIR}" - "--with-zlib-lib=${ZLIB_DEBUG_LIBRARY}" + ) else() set(OPENSSLDIR ${CURRENT_PACKAGES_DIR}) list(APPEND CONFIGURE_COMMAND ${OPENSSL_ARCH} + "--prefix=${OPENSSLDIR}" "--openssldir=${OPENSSLDIR}" - "--with-zlib-lib=${ZLIB_LIBRARIES}" ) endif() @@ -70,8 +67,16 @@ vcpkg_execute_required_process( LOGNAME configure-do-${TARGET_TRIPLET}-${CMAKE_BUILD_TYPE} ) -add_custom_command(OUTPUT ${OPENSSLDIR}/bin/ssleay32.dll ${OPENSSLDIR}/bin/libeay32.dll - COMMAND ${NMAKE} -f ms\\ntdll.mak install - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/openssl-${VERSION} -) -add_custom_target(openssl ALL DEPENDS ${OPENSSLDIR}/bin/ssleay32.dll ${OPENSSLDIR}/bin/libeay32.dll) \ No newline at end of file +if(BUILD_SHARED_LIBS) + add_custom_command(OUTPUT ${OPENSSLDIR}/bin/ssleay32.dll ${OPENSSLDIR}/bin/libeay32.dll + COMMAND ${NMAKE} -f ms\\ntdll.mak install + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/openssl-${VERSION} + ) + add_custom_target(openssl ALL DEPENDS ${OPENSSLDIR}/bin/ssleay32.dll ${OPENSSLDIR}/bin/libeay32.dll) +else() + add_custom_command(OUTPUT ${OPENSSLDIR}/bin/ssleay32.lib ${OPENSSLDIR}/bin/libeay32.lib + COMMAND ${NMAKE} -f ms\\nt.mak install + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/openssl-${VERSION} + ) + add_custom_target(openssl ALL DEPENDS ${OPENSSLDIR}/bin/ssleay32.lib ${OPENSSLDIR}/bin/libeay32.lib) +endif() diff --git a/ports/openssl/CONTROL b/ports/openssl/CONTROL index cc539a03e..9ee9ef163 100644 --- a/ports/openssl/CONTROL +++ b/ports/openssl/CONTROL @@ -1,4 +1,3 @@ Source: openssl -Version: 1.0.2h -Build-Depends: zlib +Version: 1.0.2h-1 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 diff --git a/ports/openssl/portfile.cmake b/ports/openssl/portfile.cmake index b6085cada..7d693cb59 100644 --- a/ports/openssl/portfile.cmake +++ b/ports/openssl/portfile.cmake @@ -1,3 +1,4 @@ +include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/openssl-1.0.2h) vcpkg_find_acquire_program(PERL) @@ -56,11 +57,13 @@ file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/openssl.cnf ${CURRENT_PACKAGES_DIR}/openssl.cnf ) -if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/engines) - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/engines ${CURRENT_PACKAGES_DIR}/bin/engines) -endif() -if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/engines) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/engines ${CURRENT_PACKAGES_DIR}/debug/bin/engines) -endif() + file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/openssl RENAME copyright) -vcpkg_copy_pdbs() + +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + vcpkg_copy_pdbs() +else() + # They should be empty, only the exes deleted above were in these directories + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/) +endif() -- cgit v1.2.3 From 9467c1bd81c655b060aa9df5aeb0047b87e93058 Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Wed, 26 Oct 2016 12:30:58 +1100 Subject: jom the install, dynamic linkage means tools need the dlls --- ports/qt5/portfile.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake index 357f7bdff..e2949892b 100644 --- a/ports/qt5/portfile.cmake +++ b/ports/qt5/portfile.cmake @@ -58,7 +58,7 @@ message(STATUS "Build ${TARGET_TRIPLET} done") message(STATUS "Installing ${TARGET_TRIPLET}") vcpkg_execute_required_process( - COMMAND ${NMAKE} install + COMMAND ${JOM} install WORKING_DIRECTORY ${OUTPUT_PATH} LOGNAME install-${TARGET_TRIPLET} ) @@ -126,6 +126,12 @@ endforeach() file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools) FILE(REMOVE ${BINARY_TOOLS}) +#if we are using dynamic linkage, the tools also require the dlls and platforms directory to run correctly +if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL dynamic) + file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/bin/*.dll") + file(INSTALL ${RELEASE_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools) + file(INSTALL ${CURRENT_PACKAGES_DIR}/plugins/platforms DESTINATION ${CURRENT_PACKAGES_DIR}/tools) +endif() set(SHARE_PATH ${CURRENT_PACKAGES_DIR}/share/qt5) file(MAKE_DIRECTORY ${SHARE_PATH}) file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${SHARE_PATH} RENAME copyright) -- cgit v1.2.3 From 71bb6b158a094a085d777d62722b2d0c1f8440be Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 25 Oct 2016 18:49:31 -0700 Subject: [ace] Fix portfile: URL->URLS --- ports/ace/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/ace/portfile.cmake b/ports/ace/portfile.cmake index d72e92923..40becf8aa 100644 --- a/ports/ace/portfile.cmake +++ b/ports/ace/portfile.cmake @@ -1,7 +1,7 @@ include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ACE_wrappers/ace) vcpkg_download_distfile(ARCHIVE - URL "http://download.dre.vanderbilt.edu/previous_versions/ACE-6.4.0.zip" + URLS "http://download.dre.vanderbilt.edu/previous_versions/ACE-6.4.0.zip" FILENAME "ACE-6.4.0.zip" SHA512 3543291332b96cf06a966dedda617169e8db051cebbbc4f05cdc2c2c9e7908174f8ed67bc152bbcd57541279d3addb1138f1fc092468e856c2bb04ee6ad2b95a ) -- cgit v1.2.3 From 1de1cec3729846a7d7e599ba1ac82d4eba441180 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 25 Oct 2016 19:04:07 -0700 Subject: [ace] Add check for static building --- ports/ace/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/ace/portfile.cmake b/ports/ace/portfile.cmake index 40becf8aa..4838afc42 100644 --- a/ports/ace/portfile.cmake +++ b/ports/ace/portfile.cmake @@ -1,3 +1,7 @@ +include(${CMAKE_TRIPLET_FILE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(FATAL_ERROR "Static building not supported yet") +endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ACE_wrappers/ace) vcpkg_download_distfile(ARCHIVE -- cgit v1.2.3 From 9e72812557560469a531353c6a4928ffcfc853f4 Mon Sep 17 00:00:00 2001 From: Jens Frederich Date: Wed, 26 Oct 2016 09:52:58 +0200 Subject: [wtl] Adding Windows Template Library Signed-off-by: Jens Frederich --- ports/wtl/CONTROL | 5 +++++ ports/wtl/portfile.cmake | 14 ++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 ports/wtl/CONTROL create mode 100644 ports/wtl/portfile.cmake diff --git a/ports/wtl/CONTROL b/ports/wtl/CONTROL new file mode 100644 index 000000000..6f8b6208e --- /dev/null +++ b/ports/wtl/CONTROL @@ -0,0 +1,5 @@ +Source: wtl +Maintainer: jfrederich@gmail.com +Version: 9.1 +Description: Windows Template Library (WTL) is a C++ library for developing Windows applications and UI components. +Build-Depends: diff --git a/ports/wtl/portfile.cmake b/ports/wtl/portfile.cmake new file mode 100644 index 000000000..c28019383 --- /dev/null +++ b/ports/wtl/portfile.cmake @@ -0,0 +1,14 @@ +include(vcpkg_common_functions) +vcpkg_download_distfile(ARCHIVE + URLS "http://downloads.sourceforge.net/project/wtl/WTL%209.1/WTL%209.1.5321%20Final/WTL91_5321_Final.zip?r=&ts=1477467616&use_mirror=netix" + FILENAME "WTL91_5321_Final.zip" + SHA512 52c583f6773839f7ad7fccf0ecba44ad00f41af4ae97d217619cc380ea9b71b90638ae35a5995f9eb08854db423896fec5f06b5cbd853f118eeddd05238a460a +) +vcpkg_extract_source_archive(${ARCHIVE}) + +file(INSTALL ${CURRENT_BUILDTREES_DIR}/src/include/ DESTINATION ${CURRENT_PACKAGES_DIR}/include/wtl FILES_MATCHING PATTERN "*.h") + +file(COPY ${CURRENT_BUILDTREES_DIR}/src/MS-PL.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/wtl) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/wtl/MS-PL.txt ${CURRENT_PACKAGES_DIR}/share/wtl/copyright) + +file(COPY ${CURRENT_BUILDTREES_DIR}/src/samples DESTINATION ${CURRENT_PACKAGES_DIR}/share/wtl) -- cgit v1.2.3 From bea1fe1ec6b5c6149bf0ea9b6bb8d192e88693f3 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 11:49:01 -0700 Subject: [asio] Mark as header-only library --- ports/asio/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/asio/portfile.cmake b/ports/asio/portfile.cmake index 8c28b951b..9c53f2995 100644 --- a/ports/asio/portfile.cmake +++ b/ports/asio/portfile.cmake @@ -1,4 +1,5 @@ include(vcpkg_common_functions) +#header-only library SET(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/asio-asio-1-10-6/asio/) vcpkg_download_distfile(ARCHIVE URLS "https://github.com/chriskohlhoff/asio/archive/asio-1-10-6.zip" -- cgit v1.2.3 From 727ddf9d0ef437c53ec7312d0863cd2e805ed1e7 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 11:49:55 -0700 Subject: Remove cocos2d incomplete port --- ports/cocos2d/portfile.cmake | 47 -------------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 ports/cocos2d/portfile.cmake diff --git a/ports/cocos2d/portfile.cmake b/ports/cocos2d/portfile.cmake deleted file mode 100644 index a4048090b..000000000 --- a/ports/cocos2d/portfile.cmake +++ /dev/null @@ -1,47 +0,0 @@ -include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/cocos2d-x-cocos2d-x-3.10) -vcpkg_download_distfile(ARCHIVE_FILE - URLS "https://github.com/cocos2d/cocos2d-x/archive/cocos2d-x-3.10.tar.gz" - FILENAME "cocos2d-x-3.10.tar.gz" - MD5 7c67068675ad28374448e844b0e463ff -) -vcpkg_download_distfile(DEPS_ARCHIVE_FILE - URLS "https://github.com/cocos2d/cocos2d-x-3rd-party-libs-bin/archive/v3-deps-79.zip" - FILENAME "cocos2d-x-v3-deps-79.zip" - MD5 5d88ff867205080b9ee8da532437e891 -) - -vcpkg_extract_source_archive(${ARCHIVE_FILE}) - -if(NOT EXISTS ${SOURCE_PATH}/external/unzip) - message(STATUS "Extracting dependencies ${DEPS_ARCHIVE_FILE}") - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/deps) - vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} -E tar xjf ${DEPS_ARCHIVE_FILE} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/deps - LOGNAME extract-deps - ) - file(REMOVE_RECURSE ${SOURCE_PATH}/external) - file(RENAME ${CURRENT_BUILDTREES_DIR}/deps/cocos2d-x-3rd-party-libs-bin-3-deps-79 ${SOURCE_PATH}/external) -endif() -message(STATUS "Extracting dependencies done") - -file(REMOVE ${SOURCE_PATH}/cmake/Modules/FindGLFW3.cmake) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - OPTIONS - -DUSE_CHIPMUNK=OFF - -DUSE_BOX2D=OFF - -DUSE_BULLET=OFF - -DUSE_RECAST=OFF - -DUSE_WEBP=OFF - -DBUILD_SHARED_LIBS=ON - -DUSE_PREBUILT_LIBS=OFF -) - -vcpkg_install_cmake() - -file(INSTALL ${SOURCE_PATH}/licenses/LICENSE_cocos2d-x.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/cocos2d-x RENAME copyright) -vcpkg_copy_pdbs() - -- cgit v1.2.3 From a3fba9b43f4316032e1016ffe8dd1a84c3835f22 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 11:50:30 -0700 Subject: Remove tcl incomplete port --- ports/tcl/portfile.cmake | 63 ------------------------------------------------ 1 file changed, 63 deletions(-) delete mode 100644 ports/tcl/portfile.cmake diff --git a/ports/tcl/portfile.cmake b/ports/tcl/portfile.cmake deleted file mode 100644 index d8b19097a..000000000 --- a/ports/tcl/portfile.cmake +++ /dev/null @@ -1,63 +0,0 @@ -include(vcpkg_common_functions) -vcpkg_download_distfile(ARCHIVE - URLS "http://prdownloads.sourceforge.net/tcl/tcl8.6.5-src.tar.gz" - FILENAME "tcl8.6.5-src.tar.gz" - MD5 0e6426a4ca9401825fbc6ecf3d89a326 -) - -find_program(NMAKE nmake) - -if(NOT EXISTS ${CURRENT_BUILDTREES_DIR}/x86-windows-rel) - message(STATUS "Extracting source ${ARCHIVE} for Release") - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/x86-windows-rel) - vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} -E tar xjf ${ARCHIVE} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/x86-windows-rel - LOGNAME extract-x86-windows-rel - ) -endif() -if(NOT EXISTS ${CURRENT_BUILDTREES_DIR}/x86-windows-dbg) - message(STATUS "Extracting source ${ARCHIVE} for Debug") - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/x86-windows-dbg) - vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} -E tar xjf ${ARCHIVE} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/x86-windows-dbg - LOGNAME extract-x86-windows-dbg - ) -endif() -message(STATUS "Extracting done") - -message(STATUS "Building x86-windows-rel") -vcpkg_execute_required_process( - COMMAND ${NMAKE} -f makefile.vc release - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/x86-windows-rel/tcl8.6.5/win - LOGNAME build-x86-windows-rel -) -message(STATUS "Building x86-windows-rel done") - -message(STATUS "Building x86-windows-dbg") -vcpkg_execute_required_process( - COMMAND ${NMAKE} -f makefile.vc release OPTS=symbols - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/x86-windows-dbg/tcl8.6.5/win - LOGNAME build-x86-windows-rel -) -message(STATUS "Building x86-windows-dbg done") - -message(STATUS "Installing x86-windows-rel") -vcpkg_execute_required_process( - COMMAND ${NMAKE} -f makefile.vc install INSTALLDIR=${CURRENT_PACKAGES_DIR} SCRIPT_INSTALL_DIR=${CURRENT_PACKAGES_DIR}\\share\\tcltk\\tcl8.6 - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/x86-windows-rel/tcl8.6.5/win - LOGNAME install-x86-windows-rel -) -message(STATUS "Installing x86-windows-rel done") - -message(STATUS "Installing x86-windows-dbg") -vcpkg_execute_required_process( - COMMAND ${NMAKE} -f makefile.vc install INSTALLDIR=${CURRENT_PACKAGES_DIR}\\debug OPTS=symbols SCRIPT_INSTALL_DIR=${CURRENT_PACKAGES_DIR}\\debug\\share\\tcltk\\tcl8.6 - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/x86-windows-dbg/tcl8.6.5/win - LOGNAME install-x86-windows-dbg -) -message(STATUS "Installing x86-windows-dbg done") - -file(INSTALL ${CURRENT_BUILDTREES_DIR}/x86-windows-rel/tcl8.6.5/license.terms DESTINATION ${CURRENT_PACKAGES_DIR}/share/tcl RENAME copyright) -vcpkg_copy_pdbs() -- cgit v1.2.3 From e69e5ad81d91198cfa1a871587a81b069007a02d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 11:50:50 -0700 Subject: Remove tk incomplete port --- ports/tk/portfile.cmake | 63 ------------------------------------------------- 1 file changed, 63 deletions(-) delete mode 100644 ports/tk/portfile.cmake diff --git a/ports/tk/portfile.cmake b/ports/tk/portfile.cmake deleted file mode 100644 index 0391b0b30..000000000 --- a/ports/tk/portfile.cmake +++ /dev/null @@ -1,63 +0,0 @@ -include(vcpkg_common_functions) -vcpkg_download_distfile(ARCHIVE - URLS "http://prdownloads.sourceforge.net/tcl/tk8.6.5-src.tar.gz" - FILENAME "tk8.6.5-src.tar.gz" - MD5 11dbbd425c3e0201f20d6a51482ce6c4 -) - -find_program(NMAKE nmake) - -if(NOT EXISTS ${CURRENT_BUILDTREES_DIR}/x86-windows-rel) - message(STATUS "Extracting source ${ARCHIVE} for Release") - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/x86-windows-rel) - vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} -E tar xjf ${ARCHIVE} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/x86-windows-rel - LOGNAME extract-x86-windows-rel - ) -endif() -if(NOT EXISTS ${CURRENT_BUILDTREES_DIR}/x86-windows-dbg) - message(STATUS "Extracting source ${ARCHIVE} for Debug") - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/x86-windows-dbg) - vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} -E tar xjf ${ARCHIVE} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/x86-windows-dbg - LOGNAME extract-x86-windows-dbg - ) -endif() -message(STATUS "Extracting done") - -message(STATUS "Building x86-windows-rel") -vcpkg_execute_required_process( - COMMAND ${NMAKE} -f makefile.vc release TCLDIR=${CURRENT_BUILDTREES_DIR}\\x86-windows-rel\\tcl8.6.5 - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/x86-windows-rel/tk8.6.5/win - LOGNAME build-x86-windows-rel -) -message(STATUS "Building x86-windows-rel done") - -message(STATUS "Building x86-windows-dbg") -vcpkg_execute_required_process( - COMMAND ${NMAKE} -f makefile.vc release OPTS=symbols TCLDIR=${CURRENT_BUILDTREES_DIR}\\x86-windows-dbg\\tcl8.6.5 - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/x86-windows-dbg/tk8.6.5/win - LOGNAME build-x86-windows-dbg -) -message(STATUS "Building x86-windows-dbg done") - -message(STATUS "Installing x86-windows-rel") -vcpkg_execute_required_process( - COMMAND ${NMAKE} -f makefile.vc install INSTALLDIR=${CURRENT_PACKAGES_DIR} SCRIPT_INSTALL_DIR=${CURRENT_PACKAGES_DIR}\\share\\tcltk\\tk8.6 - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/x86-windows-rel/tk8.6.5/win - LOGNAME install-x86-windows-rel -) -message(STATUS "Installing x86-windows-rel done") - -message(STATUS "Installing x86-windows-dbg") -vcpkg_execute_required_process( - COMMAND ${NMAKE} -f makefile.vc install INSTALLDIR=${CURRENT_PACKAGES_DIR}\\debug OPTS=symbols SCRIPT_INSTALL_DIR=${CURRENT_PACKAGES_DIR}\\debug\\share\\tcltk\\tk8.6 - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/x86-windows-dbg/tk8.6.5/win - LOGNAME install-x86-windows-dbg -) -message(STATUS "Installing x86-windows-dbg done") - -file(INSTALL ${CURRENT_BUILDTREES_DIR}/x86-windows-rel/tk8.6.5/license.terms DESTINATION ${CURRENT_PACKAGES_DIR}/share/tk RENAME copyright) -vcpkg_copy_pdbs() -- cgit v1.2.3 From 0957ff5d4930890a410ec213c9fda7e07af2d57a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 11:56:57 -0700 Subject: [asio] Remove vcpkg_copy_pdbs() call from header-only lib --- ports/asio/portfile.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/asio/portfile.cmake b/ports/asio/portfile.cmake index 9c53f2995..de9b671aa 100644 --- a/ports/asio/portfile.cmake +++ b/ports/asio/portfile.cmake @@ -14,4 +14,3 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/share/asio/COPYING ${CURRENT_PACKAGES_DIR}/s # Copy the asio header files file(INSTALL ${SOURCE_PATH}/include DESTINATION ${CURRENT_PACKAGES_DIR} FILES_MATCHING PATTERN "*.hpp" PATTERN "*.ipp") -vcpkg_copy_pdbs() -- cgit v1.2.3 From e42f413269d400866ae3ecc67008b9ab931d6d91 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 11:59:46 -0700 Subject: [rapidjson] Mark as header-only library --- ports/asio/portfile.cmake | 2 +- ports/rapidjson/portfile.cmake | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ports/asio/portfile.cmake b/ports/asio/portfile.cmake index de9b671aa..c966b157e 100644 --- a/ports/asio/portfile.cmake +++ b/ports/asio/portfile.cmake @@ -1,5 +1,5 @@ -include(vcpkg_common_functions) #header-only library +include(vcpkg_common_functions) SET(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/asio-asio-1-10-6/asio/) vcpkg_download_distfile(ARCHIVE URLS "https://github.com/chriskohlhoff/asio/archive/asio-1-10-6.zip" diff --git a/ports/rapidjson/portfile.cmake b/ports/rapidjson/portfile.cmake index d907210d0..3d923cb95 100644 --- a/ports/rapidjson/portfile.cmake +++ b/ports/rapidjson/portfile.cmake @@ -1,3 +1,4 @@ +#header-only library include(vcpkg_common_functions) SET(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/rapidjson-879def80f2e466cdf4c86dc7e53ea2dd4cafaea0) vcpkg_download_distfile(ARCHIVE -- cgit v1.2.3 From 7e10cd1bda4e58e7b275f128c73ff444f646d118 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 12:02:41 -0700 Subject: [bond] Mark regarding dll/static support --- ports/bond/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/bond/portfile.cmake b/ports/bond/portfile.cmake index 36a127738..7e28270f2 100644 --- a/ports/bond/portfile.cmake +++ b/ports/bond/portfile.cmake @@ -1,3 +1,7 @@ +include(${CMAKE_TRIPLET_FILE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(FATAL_ERROR "Static building not supported yet") +endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/bond-53ea13692925bee4ba494ee9de3614f15c09d85d) vcpkg_download_distfile(ARCHIVE -- cgit v1.2.3 From 9142d7d0bf814969945fe87b21fc6d446d9cdaf7 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 12:03:27 -0700 Subject: [assimp] Only vcpkg_copy_pdbs() in dynamic build --- ports/assimp/portfile.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ports/assimp/portfile.cmake b/ports/assimp/portfile.cmake index 33527a46d..fd6cc1c0c 100644 --- a/ports/assimp/portfile.cmake +++ b/ports/assimp/portfile.cmake @@ -36,4 +36,6 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright file(COPY ${CURRENT_BUILDTREES_DIR}/src/assimp-3.3.1/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/assimp) file(RENAME ${CURRENT_PACKAGES_DIR}/share/assimp/LICENSE ${CURRENT_PACKAGES_DIR}/share/assimp/copyright) -vcpkg_copy_pdbs() \ No newline at end of file +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + vcpkg_copy_pdbs() +endif() \ No newline at end of file -- cgit v1.2.3 From c716b6bc60871f3c1adf5b1f2710646e6fdf3f8d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 12:09:34 -0700 Subject: [bullet3] Only call vcpkg_copy_pdbs() on dynamic builds --- ports/bullet3/portfile.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ports/bullet3/portfile.cmake b/ports/bullet3/portfile.cmake index dbc206f5f..5face2c0b 100644 --- a/ports/bullet3/portfile.cmake +++ b/ports/bullet3/portfile.cmake @@ -33,4 +33,6 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/bullet3) file(RENAME ${CURRENT_PACKAGES_DIR}/share/bullet3/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/bullet3/copyright) -vcpkg_copy_pdbs() +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + vcpkg_copy_pdbs() +endif() -- cgit v1.2.3 From 60cb31b054ded6f9e0d6605a3de16e0cec55b19e Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 12:11:36 -0700 Subject: [catch] Download from specific sha, not master branch --- ports/catch/portfile.cmake | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ports/catch/portfile.cmake b/ports/catch/portfile.cmake index bd55bb9ca..6b44dfebd 100644 --- a/ports/catch/portfile.cmake +++ b/ports/catch/portfile.cmake @@ -10,14 +10,13 @@ include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) vcpkg_download_distfile(HEADER - URLS "https://raw.githubusercontent.com/philsquared/Catch/master/single_include/catch.hpp" - #https://raw.githubusercontent.com/philsquared/Catch/master/LICENSE_1_0.txt + URLS "https://raw.githubusercontent.com/philsquared/Catch/e27c4ee04282f60aefcc9b1062a74f92cf6c1a2b/single_include/catch.hpp" FILENAME "catch.hpp" - SHA512 64eec1c291826ef235433729dc18f150e47d2a761f80ec47264be08b3f756b310c6e3aa2c6c3c7b5e2f345f86489d561d9a694506654823077d0f6c7c22df7cd + SHA512 c2fec38227bb1725c30f955583dbd012f86eef83512a0c154e91b77249df372db067710ae110463eb07adec722d214114fd6a2cebff7ee43c5fd567a6a1ba221 ) vcpkg_download_distfile(LICENSE - URLS "https://raw.githubusercontent.com/philsquared/Catch/master/LICENSE_1_0.txt" + URLS "https://raw.githubusercontent.com/philsquared/Catch/e27c4ee04282f60aefcc9b1062a74f92cf6c1a2b/LICENSE_1_0.txt" FILENAME "License_1_0.txt" SHA512 d6078467835dba8932314c1c1e945569a64b065474d7aced27c9a7acc391d52e9f234138ed9f1aa9cd576f25f12f557e0b733c14891d42c16ecdc4a7bd4d60b8 ) -- cgit v1.2.3 From 375d75366051073bd52cb09b4f96a73ebf442072 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 12:14:11 -0700 Subject: [cppwinrt] Mark as header-only library --- ports/cppwinrt/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/cppwinrt/portfile.cmake b/ports/cppwinrt/portfile.cmake index 927a17afb..452911172 100644 --- a/ports/cppwinrt/portfile.cmake +++ b/ports/cppwinrt/portfile.cmake @@ -1,3 +1,4 @@ +#header-only library include(vcpkg_common_functions) find_program(GIT git) -- cgit v1.2.3 From 78dd431fed335e2657ebce766badd52d630556c2 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 12:14:49 -0700 Subject: [boost-di] Mark as header-only library --- ports/boost-di/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/boost-di/portfile.cmake b/ports/boost-di/portfile.cmake index 83ea6afe9..38a1f99bd 100644 --- a/ports/boost-di/portfile.cmake +++ b/ports/boost-di/portfile.cmake @@ -1,4 +1,4 @@ -include(${CMAKE_TRIPLET_FILE}) +#header-only library include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/di-1.0.1) -- cgit v1.2.3 From 3036a2f8f497a183eba66d4e92493d440f6f9955 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 12:15:17 -0700 Subject: [catch] Mark as header-only library --- ports/catch/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/catch/portfile.cmake b/ports/catch/portfile.cmake index 6b44dfebd..5575af742 100644 --- a/ports/catch/portfile.cmake +++ b/ports/catch/portfile.cmake @@ -6,7 +6,7 @@ # CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} # -include(${CMAKE_TRIPLET_FILE}) +#header-only library include(vcpkg_common_functions) vcpkg_download_distfile(HEADER -- cgit v1.2.3 From ee82ebe9209540dfb1a4c5ce914d902198119fee Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 12:15:42 -0700 Subject: [constexpr] Mark as header-only library --- ports/constexpr/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/constexpr/portfile.cmake b/ports/constexpr/portfile.cmake index 137bf0e60..9563b6c15 100644 --- a/ports/constexpr/portfile.cmake +++ b/ports/constexpr/portfile.cmake @@ -1,3 +1,4 @@ +#header-only library include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/constexpr-a98b1db39c909e0130d21d3910d4faf97035a625) vcpkg_download_distfile(ARCHIVE -- cgit v1.2.3 From 863f28c080ea3ead61eb10fecb1b1616c86742f4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 12:16:29 -0700 Subject: [wtl] Mark as header-only library --- ports/wtl/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/wtl/portfile.cmake b/ports/wtl/portfile.cmake index c28019383..c8d8c6c34 100644 --- a/ports/wtl/portfile.cmake +++ b/ports/wtl/portfile.cmake @@ -1,3 +1,4 @@ +#header-only library include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE URLS "http://downloads.sourceforge.net/project/wtl/WTL%209.1/WTL%209.1.5321%20Final/WTL91_5321_Final.zip?r=&ts=1477467616&use_mirror=netix" -- cgit v1.2.3 From e9a17729ec0afaf6641569a477c49df6078e7532 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 12:18:53 -0700 Subject: [cryptopp] Fail when trying to build dll --- ports/cryptopp/portfile.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/cryptopp/portfile.cmake b/ports/cryptopp/portfile.cmake index e80c541b7..1fc1e4ebd 100644 --- a/ports/cryptopp/portfile.cmake +++ b/ports/cryptopp/portfile.cmake @@ -1,4 +1,7 @@ include(${CMAKE_TRIPLET_FILE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + message(FATAL_ERROR "Dynamic building not supported") # See note below +endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/cryptopp-CRYPTOPP_5_6_5) vcpkg_download_distfile(ARCHIVE -- cgit v1.2.3 From 814eaacd2c9830d1f1626eef6a5cb6d6d3d49e8d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 12:20:46 -0700 Subject: [chakracore] Mark regarding static/dynamic building --- ports/chakracore/portfile.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ports/chakracore/portfile.cmake b/ports/chakracore/portfile.cmake index 6780b6b55..989c76c60 100644 --- a/ports/chakracore/portfile.cmake +++ b/ports/chakracore/portfile.cmake @@ -1,4 +1,8 @@ -include(vcpkg_common_functions) +include(${CMAKE_TRIPLET_FILE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(FATAL_ERROR "Static building not supported yet") +endif() +include(vcpkg_common_functions) find_program(POWERSHELL powershell) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ChakraCore-1.2.0.0) -- cgit v1.2.3 From a1229417ef3d2f914a240683782350f4d3ecbf0a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 12:22:15 -0700 Subject: [doctest] Mark as header-only library --- ports/doctest/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/doctest/portfile.cmake b/ports/doctest/portfile.cmake index c392b2467..fd5f7fe4a 100644 --- a/ports/doctest/portfile.cmake +++ b/ports/doctest/portfile.cmake @@ -1,3 +1,4 @@ +#header-only library include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/doctest-1.1.0) vcpkg_download_distfile(ARCHIVE -- cgit v1.2.3 From 86bee246f427db79240cea8be8b934ded75342b0 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 12:24:09 -0700 Subject: [double-conversion] Only vcpkg_copy_pdbs() on dynamic build --- ports/double-conversion/portfile.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ports/double-conversion/portfile.cmake b/ports/double-conversion/portfile.cmake index 312946fea..6ac38fffd 100644 --- a/ports/double-conversion/portfile.cmake +++ b/ports/double-conversion/portfile.cmake @@ -37,7 +37,9 @@ file(INSTALL file(COPY ${SOURCE_PATH}/double-conversion DESTINATION ${CURRENT_PACKAGES_DIR}/include) -vcpkg_copy_pdbs() +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + vcpkg_copy_pdbs() +endif() message(STATUS "Installing done") -- cgit v1.2.3 From 7743e9c297bb5ff731b2cd1dc54b9ccdff5f1fdf Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 12:26:56 -0700 Subject: [dxut] Mark as not yet supporting static --- ports/dxut/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/dxut/portfile.cmake b/ports/dxut/portfile.cmake index d69a6e147..8a13e9a2b 100644 --- a/ports/dxut/portfile.cmake +++ b/ports/dxut/portfile.cmake @@ -1,3 +1,7 @@ +include(${CMAKE_TRIPLET_FILE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(FATAL_ERROR "Static building not supported yet") +endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/DXUT-sept2016) vcpkg_download_distfile(ARCHIVE_FILE -- cgit v1.2.3 From 52109eb709712215d23f60be07e19b83d150bd87 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 12:29:38 -0700 Subject: [eigen3] Mark as header-only library --- ports/eigen3/portfile.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/eigen3/portfile.cmake b/ports/eigen3/portfile.cmake index 5453f8dbc..42615b1a1 100644 --- a/ports/eigen3/portfile.cmake +++ b/ports/eigen3/portfile.cmake @@ -1,3 +1,4 @@ +#header-only library include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/eigen-eigen-b9cd8366d4e8) vcpkg_download_distfile(ARCHIVE @@ -17,5 +18,4 @@ file(COPY ${SOURCE_PATH}/COPYING.README DESTINATION ${CURRENT_PACKAGES_DIR}/shar file(RENAME ${CURRENT_PACKAGES_DIR}/share/eigen3/COPYING.README ${CURRENT_PACKAGES_DIR}/share/eigen3/copyright) # Copy the eigen header files -file(COPY ${SOURCE_PATH}/Eigen/ DESTINATION ${CURRENT_PACKAGES_DIR}/include/Eigen/) -vcpkg_copy_pdbs() +file(COPY ${SOURCE_PATH}/Eigen/ DESTINATION ${CURRENT_PACKAGES_DIR}/include/Eigen/) \ No newline at end of file -- cgit v1.2.3 From 164a3cd7697474c0795963bb99a7fd28f254f024 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 12:30:56 -0700 Subject: [curl] Mark as not supporting static yet --- ports/curl/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/curl/portfile.cmake b/ports/curl/portfile.cmake index 4c1a7bf3a..4207a27cc 100644 --- a/ports/curl/portfile.cmake +++ b/ports/curl/portfile.cmake @@ -1,3 +1,7 @@ +include(${CMAKE_TRIPLET_FILE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(FATAL_ERROR "Static building not supported yet") +endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/curl-7.48.0) vcpkg_download_distfile(ARCHIVE_FILE -- cgit v1.2.3 From 2915ddf1dcdca8c427be83e8cca5d40150c7cd45 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 12:34:46 -0700 Subject: [expact] Mark as not supporting static yet --- ports/expat/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/expat/portfile.cmake b/ports/expat/portfile.cmake index 7f547d091..c1c37046e 100644 --- a/ports/expat/portfile.cmake +++ b/ports/expat/portfile.cmake @@ -1,3 +1,7 @@ +include(${CMAKE_TRIPLET_FILE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(FATAL_ERROR "Static building not supported yet") +endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/expat-2.1.1) vcpkg_download_distfile(ARCHIVE_FILE -- cgit v1.2.3 From 1f8c2eaf90ca563d21b27df8e9bede10bd6f4891 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 12:38:17 -0700 Subject: [fmt] Mark as not supporting dynamic building --- ports/fmt/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/fmt/portfile.cmake b/ports/fmt/portfile.cmake index 4e1c69903..a265da175 100644 --- a/ports/fmt/portfile.cmake +++ b/ports/fmt/portfile.cmake @@ -1,3 +1,7 @@ +include(${CMAKE_TRIPLET_FILE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + message(FATAL_ERROR "Dynamic building not supported yet") +endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/fmt-3.0.0) vcpkg_download_distfile(ARCHIVE_FILE -- cgit v1.2.3 From 6380852f898c774897b6cfa74f0eaef3c0ca6b67 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 12:46:26 -0700 Subject: [coff_file_reader] Improve error message --- toolsrc/src/coff_file_reader.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/toolsrc/src/coff_file_reader.cpp b/toolsrc/src/coff_file_reader.cpp index 593bb18d1..f46150979 100644 --- a/toolsrc/src/coff_file_reader.cpp +++ b/toolsrc/src/coff_file_reader.cpp @@ -34,9 +34,9 @@ namespace vcpkg {namespace COFFFileReader return data; } - static void verify_equal_strings(const char* expected, const char* actual, int size) + static void verify_equal_strings(const char* expected, const char* actual, int size, const char* label) { - Checks::check_exit(memcmp(expected, actual, size) == 0, "Incorrect string found. Expected: %s but found %s", expected, actual); + Checks::check_exit(memcmp(expected, actual, size) == 0, "Incorrect string (%s) found. Expected: %s but found %s", label, expected, actual); } static void read_and_verify_PE_signature(fstream& fs) @@ -52,7 +52,7 @@ namespace vcpkg {namespace COFFFileReader fs.seekg(offset_to_PE_signature); char signature[PE_SIGNATURE_SIZE]; fs.read(signature, PE_SIGNATURE_SIZE); - verify_equal_strings(PE_SIGNATURE, signature, PE_SIGNATURE_SIZE); + verify_equal_strings(PE_SIGNATURE, signature, PE_SIGNATURE_SIZE, "PE_SIGNATURE"); fs.seekg(offset_to_PE_signature + PE_SIGNATURE_SIZE, ios_base::beg); } @@ -114,7 +114,7 @@ namespace vcpkg {namespace COFFFileReader fs.read(&ret.data[0], HEADER_SIZE); const std::string header_end = ret.data.substr(HEADER_END_OFFSET, HEADER_END_SIZE); - verify_equal_strings(HEADER_END, header_end.c_str(), HEADER_END_SIZE); + verify_equal_strings(HEADER_END, header_end.c_str(), HEADER_END_SIZE, "LIB HEADER_END"); return ret; } @@ -207,7 +207,7 @@ namespace vcpkg {namespace COFFFileReader char file_start[FILE_START_SIZE]; fs.read(file_start, FILE_START_SIZE); - verify_equal_strings(FILE_START, file_start, FILE_START_SIZE); + verify_equal_strings(FILE_START, file_start, FILE_START_SIZE, "LIB FILE_START"); } dll_info read_dll(const fs::path path) -- cgit v1.2.3 From 98b270b8be506f6c9c91c5aa80e4769b9b5455a6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 12:48:57 -0700 Subject: [freeglut] Mark as not supporting static building yet --- ports/freeglut/portfile.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/freeglut/portfile.cmake b/ports/freeglut/portfile.cmake index 53bde914e..3ef5be1fd 100644 --- a/ports/freeglut/portfile.cmake +++ b/ports/freeglut/portfile.cmake @@ -1,4 +1,7 @@ include(${CMAKE_TRIPLET_FILE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(FATAL_ERROR "Static building not supported yet") +endif() include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE URLS "http://downloads.sourceforge.net/project/freeglut/freeglut/3.0.0/freeglut-3.0.0.tar.gz" -- cgit v1.2.3 From 2058ea54a691a3752003005cd555db5b3e08f128 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 12:55:30 -0700 Subject: [freetype] Mark as not supporting static yet --- ports/freetype/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/freetype/portfile.cmake b/ports/freetype/portfile.cmake index f0d5728f6..ec462d611 100644 --- a/ports/freetype/portfile.cmake +++ b/ports/freetype/portfile.cmake @@ -1,3 +1,7 @@ +include(${CMAKE_TRIPLET_FILE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(FATAL_ERROR "Static building not supported yet") +endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/freetype-2.6.3) vcpkg_download_distfile(ARCHIVE -- cgit v1.2.3 From e58373ee261ca24da70aff17cc584016540d2015 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 12:58:10 -0700 Subject: [gflags] Mark as not supporting static yet --- ports/gflags/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/gflags/portfile.cmake b/ports/gflags/portfile.cmake index ca315ae31..cf353f4ed 100644 --- a/ports/gflags/portfile.cmake +++ b/ports/gflags/portfile.cmake @@ -1,3 +1,7 @@ +include(${CMAKE_TRIPLET_FILE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(FATAL_ERROR "Static building not supported yet") +endif() include(vcpkg_common_functions) find_program(GIT git) -- cgit v1.2.3 From 5a8aaa6dfc544cc1a8c4b6ca30eab4def6389bb1 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 14:24:40 -0700 Subject: [glew] Mark as not supporting static building --- ports/glew/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/glew/portfile.cmake b/ports/glew/portfile.cmake index 5d4ce387f..f048e8c41 100644 --- a/ports/glew/portfile.cmake +++ b/ports/glew/portfile.cmake @@ -1,3 +1,7 @@ +include(${CMAKE_TRIPLET_FILE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(FATAL_ERROR "Static building not supported yet") +endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/glew-2.0.0) vcpkg_download_distfile(ARCHIVE_FILE -- cgit v1.2.3 From 19cc2a482c234fc03409c8cbb7502dcf0a85d443 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 14:27:50 -0700 Subject: [glfw3] Mark as not supporting static building --- ports/glfw3/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/glfw3/portfile.cmake b/ports/glfw3/portfile.cmake index 8c0a90601..f2aa28e04 100644 --- a/ports/glfw3/portfile.cmake +++ b/ports/glfw3/portfile.cmake @@ -1,3 +1,7 @@ +include(${CMAKE_TRIPLET_FILE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(FATAL_ERROR "Static building not supported yet") +endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/glfw-3.2.1) vcpkg_download_distfile(ARCHIVE -- cgit v1.2.3 From 828d58fd6ecdb1aace5711008e010a07cce57268 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 14:29:12 -0700 Subject: [glm] Mark as header-only library --- ports/glm/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/glm/portfile.cmake b/ports/glm/portfile.cmake index 6b749b2de..4780a1b39 100644 --- a/ports/glm/portfile.cmake +++ b/ports/glm/portfile.cmake @@ -1,3 +1,4 @@ +#header-only library include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/glm) vcpkg_download_distfile(ARCHIVE -- cgit v1.2.3 From 34d13f11e7d681f4d66d45241178edefc99e781e Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 14:43:59 -0700 Subject: [glog] Mark as not supporting static building yet --- ports/glog/portfile.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/glog/portfile.cmake b/ports/glog/portfile.cmake index 1790d8649..daefd3c5e 100644 --- a/ports/glog/portfile.cmake +++ b/ports/glog/portfile.cmake @@ -7,6 +7,9 @@ # include(${CMAKE_TRIPLET_FILE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(FATAL_ERROR "Static building not supported yet. Portfile needs modification and also blocked by flags") +endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/glog-0472b91c5defdf90cff7292e3bf7bd86770a9a0a) vcpkg_download_distfile(ARCHIVE -- cgit v1.2.3 From fa24a2d00df84ffd8436081438074e0076043d7d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 14:52:55 -0700 Subject: [protobuf] Mark as tool --- ports/protobuf/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/protobuf/portfile.cmake b/ports/protobuf/portfile.cmake index 522a68634..ee273b787 100644 --- a/ports/protobuf/portfile.cmake +++ b/ports/protobuf/portfile.cmake @@ -1,3 +1,4 @@ +#tool include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE_FILE URLS "https://github.com/google/protobuf/releases/download/v3.0.2/protobuf-cpp-3.0.2.tar.gz" -- cgit v1.2.3 From 312373c08dbbff8e10f1cff8645afd9f841e166c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 15:26:56 -0700 Subject: [grpc] Mark as not supporting static building yet --- ports/grpc/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/grpc/portfile.cmake b/ports/grpc/portfile.cmake index 53f262c7e..89cf892a0 100644 --- a/ports/grpc/portfile.cmake +++ b/ports/grpc/portfile.cmake @@ -1,3 +1,7 @@ +include(${CMAKE_TRIPLET_FILE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(FATAL_ERROR "Static building not supported yet") +endif() include(vcpkg_common_functions) find_program(GIT git) -- cgit v1.2.3 From 42f180e5608322b180897bda1aeb877380e56ebb Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 15:28:27 -0700 Subject: [gsl] Mark as header-only library --- ports/gsl/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/gsl/portfile.cmake b/ports/gsl/portfile.cmake index e674cf2e4..8ccd6f2c7 100644 --- a/ports/gsl/portfile.cmake +++ b/ports/gsl/portfile.cmake @@ -1,3 +1,4 @@ +#header-only library include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/gsl-fd5ad87bf25cb5e87104ee58106dee9bc809cd93) vcpkg_download_distfile(ARCHIVE -- cgit v1.2.3 From b91df2281cab654e106d8c14132e3644a8d59e6a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 15:31:12 -0700 Subject: [gtest] Mark as not supporting static yet --- ports/gtest/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/gtest/portfile.cmake b/ports/gtest/portfile.cmake index 710736d0d..f798310ad 100644 --- a/ports/gtest/portfile.cmake +++ b/ports/gtest/portfile.cmake @@ -1,3 +1,7 @@ +include(${CMAKE_TRIPLET_FILE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(FATAL_ERROR "Static building not supported yet") +endif() include(vcpkg_common_functions) find_program(GIT git) -- cgit v1.2.3 From f18f97c5d52f2076d10dfb38ca744daf848b522e Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 15:32:35 -0700 Subject: [harfbuzz] Mark as not supporting static yet --- ports/harfbuzz/portfile.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/harfbuzz/portfile.cmake b/ports/harfbuzz/portfile.cmake index 6a46dda10..1bb64f3e4 100644 --- a/ports/harfbuzz/portfile.cmake +++ b/ports/harfbuzz/portfile.cmake @@ -7,6 +7,9 @@ # include(${CMAKE_TRIPLET_FILE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(FATAL_ERROR "Static building not supported yet. Portfile not modified for static and blocked on freetype.") +endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/harfbuzz-1.3.2) find_program(NMAKE nmake) -- cgit v1.2.3 From 88b698b04b4d7df915cacd6766403964badc0374 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 15:37:23 -0700 Subject: [libbson] Mark as not supporting static yet --- ports/libbson/portfile.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/libbson/portfile.cmake b/ports/libbson/portfile.cmake index ca7e97c16..a7d347cae 100644 --- a/ports/libbson/portfile.cmake +++ b/ports/libbson/portfile.cmake @@ -1,4 +1,7 @@ include(${CMAKE_TRIPLET_FILE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(FATAL_ERROR "Static building not supported yet") +endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libbson-1.4.2) -- cgit v1.2.3 From da5018c7c4e95597cb472908afa1297da0161a2e Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 15:56:16 -0700 Subject: [libjpeg-turbo] Mark as not supporting static yet --- ports/libjpeg-turbo/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/libjpeg-turbo/portfile.cmake b/ports/libjpeg-turbo/portfile.cmake index ba68bc48b..44958628c 100644 --- a/ports/libjpeg-turbo/portfile.cmake +++ b/ports/libjpeg-turbo/portfile.cmake @@ -1,3 +1,7 @@ +include(${CMAKE_TRIPLET_FILE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(FATAL_ERROR "Static building not supported yet") +endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libjpeg-turbo-1.4.90) -- cgit v1.2.3 From f689889ea8a3b2dddade80e5b1de4e232e7f85cd Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 16:00:04 -0700 Subject: [libmariadb] Mark as not supporting static yet --- ports/libmariadb/portfile.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/libmariadb/portfile.cmake b/ports/libmariadb/portfile.cmake index ef1d85cae..ab40ab5c9 100644 --- a/ports/libmariadb/portfile.cmake +++ b/ports/libmariadb/portfile.cmake @@ -1,4 +1,7 @@ include(${CMAKE_TRIPLET_FILE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(FATAL_ERROR "Static building not supported yet") +endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mariadb-connector-c-2.3.1) -- cgit v1.2.3 From 19c0405963fa7b3a67844d6f9653e058e5dc0c28 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 16:08:31 -0700 Subject: [libmysql] Marked as not supporting static yet --- ports/libmysql/portfile.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/libmysql/portfile.cmake b/ports/libmysql/portfile.cmake index c0c8ee4c4..dd85e104d 100644 --- a/ports/libmysql/portfile.cmake +++ b/ports/libmysql/portfile.cmake @@ -1,4 +1,7 @@ include(${CMAKE_TRIPLET_FILE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(FATAL_ERROR "Static building not supported yet") +endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mysql-server-mysql-5.7.16) -- cgit v1.2.3 From a7765c78cbe4ae8daa18a02b40b62ef4b7aa9e31 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 16:14:15 -0700 Subject: [libuv] Mark as not supporting static yet --- ports/libuv/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/libuv/portfile.cmake b/ports/libuv/portfile.cmake index d5aafdb21..e8fdb1eaa 100644 --- a/ports/libuv/portfile.cmake +++ b/ports/libuv/portfile.cmake @@ -1,3 +1,7 @@ +include(${CMAKE_TRIPLET_FILE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(FATAL_ERROR "Static building not supported yet") +endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-src/libuv-1.9.1) vcpkg_download_distfile(ARCHIVE -- cgit v1.2.3 From 5b3a90e57d554eb8eeef4716d2f085e6feac92e1 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 26 Oct 2016 16:28:58 -0700 Subject: [libvorbis] Correct Build-depends field in control file. Fixes #227 --- ports/libvorbis/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/libvorbis/CONTROL b/ports/libvorbis/CONTROL index 64721181e..76181b9e8 100644 --- a/ports/libvorbis/CONTROL +++ b/ports/libvorbis/CONTROL @@ -1,4 +1,4 @@ Source: libvorbis Version: Description: Ogg Vorbis is a fully open, non-proprietary, patent-and-royalty-free, general-purpose compressed audio format. -Build-depends: libogg +Build-Depends: libogg -- cgit v1.2.3 From fd81dc37bbb819bba79e782b7a2cacbabd42728c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 16:38:50 -0700 Subject: [libvorbis] Mark as not supporting static yet --- ports/libvorbis/portfile.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/libvorbis/portfile.cmake b/ports/libvorbis/portfile.cmake index 6e50efd93..cff89d653 100644 --- a/ports/libvorbis/portfile.cmake +++ b/ports/libvorbis/portfile.cmake @@ -7,6 +7,9 @@ # include(${CMAKE_TRIPLET_FILE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(FATAL_ERROR "Static building not supported yet") +endif() include(vcpkg_common_functions) find_program(GIT git) -- cgit v1.2.3 From b12d182d9739e2fda6037cac4a7ceb8232501779 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 16:45:41 -0700 Subject: [libwebsockets] Mark as not static ready --- ports/libwebsockets/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/libwebsockets/portfile.cmake b/ports/libwebsockets/portfile.cmake index 5253f6fa8..9622f0e01 100644 --- a/ports/libwebsockets/portfile.cmake +++ b/ports/libwebsockets/portfile.cmake @@ -1,3 +1,7 @@ +include(${CMAKE_TRIPLET_FILE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(FATAL_ERROR "Static building not supported yet") +endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libwebsockets-2.0.0) vcpkg_download_distfile(ARCHIVE -- cgit v1.2.3 From 52e40e67ca8fa620f23650f5a854974d5485a018 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 17:10:14 -0700 Subject: [mongo-driver] Mark as not static ready --- ports/mongo-c-driver/portfile.cmake | 3 +++ ports/mongo-cxx-driver/portfile.cmake | 3 +++ 2 files changed, 6 insertions(+) diff --git a/ports/mongo-c-driver/portfile.cmake b/ports/mongo-c-driver/portfile.cmake index df84008e4..27b70b7f7 100644 --- a/ports/mongo-c-driver/portfile.cmake +++ b/ports/mongo-c-driver/portfile.cmake @@ -1,4 +1,7 @@ include(${CMAKE_TRIPLET_FILE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(FATAL_ERROR "Static building not supported yet. Portfile not modified and blocked by libbson.") +endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mongo-c-driver-1.4.2) diff --git a/ports/mongo-cxx-driver/portfile.cmake b/ports/mongo-cxx-driver/portfile.cmake index fa29b14a3..867275aea 100644 --- a/ports/mongo-cxx-driver/portfile.cmake +++ b/ports/mongo-cxx-driver/portfile.cmake @@ -1,4 +1,7 @@ include(${CMAKE_TRIPLET_FILE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(FATAL_ERROR "Static building not supported yet. Portfile not modified and blocked by libbson.") +endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mongo-cxx-driver-r3.0.2) -- cgit v1.2.3 From 5cf3e485138fbb4e0827ced19976172cf7e900d3 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 17:11:59 -0700 Subject: [mpg123] Mark as not static ready --- ports/mpg123/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/mpg123/portfile.cmake b/ports/mpg123/portfile.cmake index 68d0f7baa..de04b9c88 100644 --- a/ports/mpg123/portfile.cmake +++ b/ports/mpg123/portfile.cmake @@ -1,3 +1,7 @@ +include(${CMAKE_TRIPLET_FILE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(FATAL_ERROR "Static building not supported yet") +endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mpg123-1.23.3) vcpkg_download_distfile(ARCHIVE -- cgit v1.2.3 From 1ec127cf4e45cc303729a63e3afccdd2ad1c1d42 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 17:30:41 -0700 Subject: [mpir] Mark as not static ready --- ports/mpir/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/mpir/portfile.cmake b/ports/mpir/portfile.cmake index e2f7040d6..92cec4b23 100644 --- a/ports/mpir/portfile.cmake +++ b/ports/mpir/portfile.cmake @@ -1,3 +1,7 @@ +include(${CMAKE_TRIPLET_FILE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(FATAL_ERROR "Static building not supported yet") +endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mpir-2.7.2) vcpkg_download_distfile(ARCHIVE_FILE -- cgit v1.2.3 From c58b6e6fd42e12d99a4f90ef8d23622d9e2401d4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 17:32:04 -0700 Subject: [nanobc] Mark as not static ready --- ports/nanodbc/portfile.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/nanodbc/portfile.cmake b/ports/nanodbc/portfile.cmake index 997042e18..9a949e7ac 100644 --- a/ports/nanodbc/portfile.cmake +++ b/ports/nanodbc/portfile.cmake @@ -1,4 +1,7 @@ include(${CMAKE_TRIPLET_FILE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(FATAL_ERROR "Static building not supported yet") +endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/nanodbc-2.12.4) -- cgit v1.2.3 From 64e894511aab2f3f4b87c8403b21981e940d5207 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 19:06:43 -0700 Subject: [openal-soft] Mark as not static ready --- ports/openal-soft/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/openal-soft/portfile.cmake b/ports/openal-soft/portfile.cmake index 856ac9367..397726cee 100644 --- a/ports/openal-soft/portfile.cmake +++ b/ports/openal-soft/portfile.cmake @@ -1,3 +1,7 @@ +include(${CMAKE_TRIPLET_FILE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(FATAL_ERROR "Static building not supported yet") +endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/openal-soft-1.17.2) vcpkg_download_distfile(ARCHIVE -- cgit v1.2.3 From fded91c062d89cd47060cfb251d916a27473224d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 19:23:55 -0700 Subject: [opencv] Mark as not static ready --- ports/opencv/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/opencv/portfile.cmake b/ports/opencv/portfile.cmake index 49fa463a2..b6665eedc 100644 --- a/ports/opencv/portfile.cmake +++ b/ports/opencv/portfile.cmake @@ -1,3 +1,7 @@ +include(${CMAKE_TRIPLET_FILE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(FATAL_ERROR "Static building not supported yet. Portfile not modified and blocked by libjpeg-turbo.") +endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/opencv-92387b1ef8fad15196dd5f7fb4931444a68bc93a) vcpkg_download_distfile(ARCHIVE -- cgit v1.2.3 From 2f8ddff8571c78ab75190a144e69d37e4d27fe46 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 19:25:11 -0700 Subject: [pcre] Delete some man pages and documentation files --- ports/pcre/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/pcre/portfile.cmake b/ports/pcre/portfile.cmake index 75d4275d2..2a9c1ee76 100644 --- a/ports/pcre/portfile.cmake +++ b/ports/pcre/portfile.cmake @@ -36,6 +36,10 @@ vcpkg_install_cmake() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/man) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/man) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/doc) + # Handle copyright file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/pcre) file(RENAME ${CURRENT_PACKAGES_DIR}/share/pcre/COPYING ${CURRENT_PACKAGES_DIR}/share/pcre/copyright) -- cgit v1.2.3 From d264387327f6d273f9493240eb31c3bf8e9abdd4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 19:26:01 -0700 Subject: [tiff] Enable static building --- ports/tiff/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/tiff/portfile.cmake b/ports/tiff/portfile.cmake index 647b61019..5a546967a 100644 --- a/ports/tiff/portfile.cmake +++ b/ports/tiff/portfile.cmake @@ -1,3 +1,4 @@ +include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/tiff-4.0.6) vcpkg_download_distfile(ARCHIVE -- cgit v1.2.3 From 8c5c5c16f46fbf487218fa759171fc86d5a16e0c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 19:28:59 -0700 Subject: [physfs] Mark as not static ready --- ports/physfs/portfile.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/physfs/portfile.cmake b/ports/physfs/portfile.cmake index 463d1b8a7..80ed17d0f 100644 --- a/ports/physfs/portfile.cmake +++ b/ports/physfs/portfile.cmake @@ -7,6 +7,9 @@ # include(${CMAKE_TRIPLET_FILE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(FATAL_ERROR "Static building not supported yet") +endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/physfs-2.0.3) vcpkg_download_distfile(ARCHIVE -- cgit v1.2.3 From afc5d0837b2206282eb1501e37402f3cae359d33 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 19:31:53 -0700 Subject: [range-v3] Mark as header-only library --- ports/range-v3/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/range-v3/portfile.cmake b/ports/range-v3/portfile.cmake index 5d2d89783..24ac932e1 100644 --- a/ports/range-v3/portfile.cmake +++ b/ports/range-v3/portfile.cmake @@ -1,3 +1,4 @@ +#header-only library include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/range-v3-6eb5c831ffe12cd5cb96390dbe917ca1b248772d) vcpkg_download_distfile(ARCHIVE -- cgit v1.2.3 From a499c3d98df4c6146e87a6ac47969448c7858ca4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 19:32:35 -0700 Subject: [ragel] Reorder top-most lines for consistency --- ports/ragel/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/ragel/portfile.cmake b/ports/ragel/portfile.cmake index 2c1f09de9..c5f91b5ca 100644 --- a/ports/ragel/portfile.cmake +++ b/ports/ragel/portfile.cmake @@ -6,9 +6,9 @@ # CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} # -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ragel-6.9) include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ragel-6.9) vcpkg_download_distfile(ARCHIVE URLS "http://www.colm.net/files/ragel/ragel-6.9.tar.gz" FILENAME "ragel-6.9.tar.gz" -- cgit v1.2.3 From c02d8cebbf2ef741032b9b04b37cdc1ec4867a61 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 19:33:50 -0700 Subject: [rapidxml] Mark as header-only library --- ports/rapidxml/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/rapidxml/portfile.cmake b/ports/rapidxml/portfile.cmake index 90dd06911..a5f3190d0 100644 --- a/ports/rapidxml/portfile.cmake +++ b/ports/rapidxml/portfile.cmake @@ -1,3 +1,4 @@ +#header-only library include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/rapidxml-1.13) vcpkg_download_distfile(ARCHIVE -- cgit v1.2.3 From 8780989f37349802412f28b04134d65e639784c4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 19:35:24 -0700 Subject: [rxcpp] Mark as header-only library --- ports/rxcpp/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/rxcpp/portfile.cmake b/ports/rxcpp/portfile.cmake index 15d0dc15c..65062c360 100644 --- a/ports/rxcpp/portfile.cmake +++ b/ports/rxcpp/portfile.cmake @@ -1,4 +1,4 @@ -include(${CMAKE_TRIPLET_FILE}) +#header-only library include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/RxCpp-2.3.0) vcpkg_download_distfile(ARCHIVE_FILE -- cgit v1.2.3 From 031a1f5198bd663a3f367a76dda4a17134fe7ba5 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 19:38:19 -0700 Subject: [SDL2] Mark as not static ready --- ports/sdl2/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/sdl2/portfile.cmake b/ports/sdl2/portfile.cmake index bfd4a8f63..d6e53b491 100644 --- a/ports/sdl2/portfile.cmake +++ b/ports/sdl2/portfile.cmake @@ -1,3 +1,7 @@ +include(${CMAKE_TRIPLET_FILE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(FATAL_ERROR "Static building not supported yet") +endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/SDL2-2.0.4) vcpkg_download_distfile(ARCHIVE_FILE -- cgit v1.2.3 From a8ec10429a9bd36440ade50977a659b2093bee0d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 19:39:09 -0700 Subject: [sery] Mark as not dynamic ready --- ports/sery/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/sery/portfile.cmake b/ports/sery/portfile.cmake index 900ca74e0..9d7e5b770 100644 --- a/ports/sery/portfile.cmake +++ b/ports/sery/portfile.cmake @@ -1,3 +1,7 @@ +include(${CMAKE_TRIPLET_FILE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + message(FATAL_ERROR "Dynamic building not supported yet") +endif() include(vcpkg_common_functions) SET(SOURCE_PATH "${CURRENT_BUILDTREES_DIR}/src/Sery-1.0") vcpkg_download_distfile(ARCHIVE -- cgit v1.2.3 From 0bfa90975b50723ca94fde3c5dd2306db980bff4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 19:44:28 -0700 Subject: [spdlog] Mark as header-only library --- ports/spdlog/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/spdlog/portfile.cmake b/ports/spdlog/portfile.cmake index 849bd8feb..f8a4c61ff 100644 --- a/ports/spdlog/portfile.cmake +++ b/ports/spdlog/portfile.cmake @@ -1,4 +1,4 @@ -include(${CMAKE_TRIPLET_FILE}) +#header-only library include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/spdlog-0.11.0) vcpkg_download_distfile(ARCHIVE -- cgit v1.2.3 From 21dcba6912b14fc8d9d8219c54752bb1c3093f2d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 19:48:51 -0700 Subject: [stb] Mark as header-only library --- ports/stb/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/stb/portfile.cmake b/ports/stb/portfile.cmake index 432d84604..1c00e99db 100644 --- a/ports/stb/portfile.cmake +++ b/ports/stb/portfile.cmake @@ -1,3 +1,4 @@ +#header-only library include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/stb-e713a69f1ea6ee1e0d55725ed0731520045a5993) vcpkg_download_distfile(ARCHIVE -- cgit v1.2.3 From 02b1ce2f5a49ceeb2fc5a589b08d73997f103d8d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 19:52:31 -0700 Subject: [tbb] Mark as not static ready --- ports/tbb/portfile.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/tbb/portfile.cmake b/ports/tbb/portfile.cmake index 80b6bff3f..06349b35c 100644 --- a/ports/tbb/portfile.cmake +++ b/ports/tbb/portfile.cmake @@ -7,6 +7,9 @@ # include(${CMAKE_TRIPLET_FILE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(FATAL_ERROR "Static building not supported yet") +endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/tbb2017_20160916oss) -- cgit v1.2.3 From a9886ec40ed0784dc1c540c86203ff29aee05cf7 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 19:56:15 -0700 Subject: [tinyxml2] Enable static building --- ports/tinyxml2/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/tinyxml2/portfile.cmake b/ports/tinyxml2/portfile.cmake index 656f4783f..a754b34e5 100644 --- a/ports/tinyxml2/portfile.cmake +++ b/ports/tinyxml2/portfile.cmake @@ -1,3 +1,4 @@ +include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/tinyxml2-3.0.0) vcpkg_download_distfile(ARCHIVE -- cgit v1.2.3 From b2d4660bdc07c49e019ec68e272e877945077043 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 26 Oct 2016 19:57:34 -0700 Subject: [utfcpp] Mar as header-only library --- ports/utfcpp/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/utfcpp/portfile.cmake b/ports/utfcpp/portfile.cmake index 760d4107c..56599dd3a 100644 --- a/ports/utfcpp/portfile.cmake +++ b/ports/utfcpp/portfile.cmake @@ -1,3 +1,4 @@ +#header-only library include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/utfcpp-2.3.4) vcpkg_download_distfile(ARCHIVE_FILE -- cgit v1.2.3 From 5d1dccf618870da571e498a52923fbbe3b11c180 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 27 Oct 2016 14:09:40 -0700 Subject: [post-build-checks] Fix debug/release file vectors that were swapped --- toolsrc/src/post_build_lint.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index 9b23013de..c9b36a0fb 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -403,11 +403,11 @@ namespace vcpkg if (debug_count == 0) { - System::println(System::color::warning, "Debug binaries were not built"); + System::println(System::color::warning, "Debug binaries were not found"); } if (release_count == 0) { - System::println(System::color::warning, "Release binaries were not built"); + System::println(System::color::warning, "Release binaries were not found"); } System::println(""); @@ -457,8 +457,8 @@ namespace vcpkg { case triplet::BuildType::DYNAMIC: { - const std::vector debug_dlls = recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "bin", ".dll"); - const std::vector release_dlls = recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "debug" / "bin", ".dll"); + const std::vector debug_dlls = recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "debug" / "bin", ".dll"); + const std::vector release_dlls = recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "bin", ".dll"); error_count += check_matching_debug_and_release_binaries(debug_dlls, release_dlls); @@ -487,8 +487,8 @@ namespace vcpkg error_count += check_no_subdirectories(paths.packages / spec.dir() / "lib"); error_count += check_no_subdirectories(paths.packages / spec.dir() / "debug" / "lib"); #endif - const std::vector debug_libs = recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "lib", ".lib"); - const std::vector release_libs = recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "debug" / "lib", ".lib"); + const std::vector debug_libs = recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "debug" / "lib", ".lib"); + const std::vector release_libs = recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "lib", ".lib"); error_count += check_matching_debug_and_release_binaries(debug_libs, release_libs); -- cgit v1.2.3 From 20f18f604f394c480b2177fd0b627cd5925aa63c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 27 Oct 2016 14:14:42 -0700 Subject: [gflags] Fix #225 --- ports/gflags/portfile.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ports/gflags/portfile.cmake b/ports/gflags/portfile.cmake index cf353f4ed..124cfa73c 100644 --- a/ports/gflags/portfile.cmake +++ b/ports/gflags/portfile.cmake @@ -50,7 +50,8 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/lib/gflags_nothreads.dll ${CURRENT_PACKAGES_ file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gflags.dll ${CURRENT_PACKAGES_DIR}/debug/bin/gflags.dll) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gflags_nothreads.dll ${CURRENT_PACKAGES_DIR}/debug/bin/gflags_nothreads.dll) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/cmake) file(INSTALL ${CURRENT_BUILDTREES_DIR}/src/COPYING.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/gflags RENAME copyright) -- cgit v1.2.3 From 1510af081a8c318952c995aa9f2196da990ebc22 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 27 Oct 2016 14:44:21 -0700 Subject: [boost] Patch for boost::range should not overwrite the downloaded patch --- ports/boost/portfile.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake index 783606f72..71fc8ba99 100644 --- a/ports/boost/portfile.cmake +++ b/ports/boost/portfile.cmake @@ -17,8 +17,9 @@ vcpkg_download_distfile(DIFF ) FILE(READ "${DIFF}" content) STRING(REGEX REPLACE "include/" "" content "${content}") -FILE(WRITE ${DIFF} "${content}") -vcpkg_apply_patches(SOURCE_PATH ${SOURCE_PATH} PATCHES ${DIFF}) +set(DIFF2 ${CURRENT_BUILDTREES_DIR}/src/boost-range-has_range_interator-hotfix_e7ebe14707130cda7b72e0ae5e93b17157fdb6a2.diff.fixed) +FILE(WRITE ${DIFF2} "${content}") +vcpkg_apply_patches(SOURCE_PATH ${SOURCE_PATH} PATCHES ${DIFF2}) if(NOT EXISTS ${SOURCE_PATH}/b2.exe) message(STATUS "Bootstrapping") -- cgit v1.2.3 From 05bc52d39ac0f0c164e5cbe3b7bfb9a97b5fab49 Mon Sep 17 00:00:00 2001 From: John Camp Date: Fri, 28 Oct 2016 00:12:52 -0400 Subject: Re-wrote portfile to support dynamic libraries --- ports/pdcurses/portfile.cmake | 51 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 41 insertions(+), 10 deletions(-) diff --git a/ports/pdcurses/portfile.cmake b/ports/pdcurses/portfile.cmake index be2f1fc4f..607a93b7d 100644 --- a/ports/pdcurses/portfile.cmake +++ b/ports/pdcurses/portfile.cmake @@ -10,17 +10,48 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) -message(STATUS "Build ${TARGET_TRIPLET}") +set(PDC_NMAKE_CMD ${NMAKE} -f vcwin32.mak WIDE=Y UTF8=Y) +set(PDC_NMAKE_CWD ${SOURCE_PATH}/win32) +set(PDC_PDCLIB ${SOURCE_PATH}/win32/pdcurses) +set(PDC_PANELLIB ${SOURCE_PATH}/win32/panel) +set(PDC_OUTPUT bin) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL "static") + set(PDC_PDCLIB ${PDC_PDCLIB}.lib) + set(PDC_PANELLIB ${PDC_PANELLIB}.lib) + set(PDC_OUTPUT lib) +else() + set(PDC_PDCLIB ${PDC_PDCLIB}.dll) + set(PDC_PANELLIB ${PDC_PANELLIB}.dll) + set(PDC_NMAKE_CMD ${PDC_NMAKE_CMD} DLL=Y) +endif() + +message(STATUS "Build ${TARGET_TRIPLET}-rel") +vcpkg_execute_required_process( + COMMAND ${PDC_NMAKE_CMD} + WORKING_DIRECTORY ${PDC_NMAKE_CWD} + LOGNAME build-${TARGET_TRIPLET}-rel +) +message(STATUS "Build ${TARGET_TRIPLET}-rel done") +file ( + COPY ${PDC_PDCLIB} ${PDC_PANELLIB} + DESTINATION ${CURRENT_PACKAGES_DIR}/${PDC_OUTPUT} +) + +message(STATUS "Build ${TARGET_TRIPLET}-dbg") vcpkg_execute_required_process( - COMMAND ${NMAKE} -f vcwin32.mak WIDE=Y UTF8=Y - WORKING_DIRECTORY ${SOURCE_PATH}/win32 - LOGNAME build-${TARGET_TRIPLET} + COMMAND ${PDC_NMAKE_CMD} DEBUG=Y + WORKING_DIRECTORY ${PDC_NMAKE_CWD} + LOGNAME build-${TARGET_TRIPLET}-dbg +) +message(STATUS "Build ${TARGET_TRIPLET}-dbg done") +file ( + COPY ${PDC_PDCLIB} ${PDC_PANELLIB} + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/${PDC_OUTPUT} ) -message(STATUS "Build ${TARGET_TRIPLET} done") +file( + COPY ${SOURCE_PATH}/curses.h ${SOURCE_PATH}/panel.h ${SOURCE_PATH}/term.h + DESTINATION ${CURRENT_PACKAGES_DIR}/include +) file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/pdcurses RENAME copyright) -file(COPY ${SOURCE_PATH}/win32/pdcurses.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) -file(COPY ${SOURCE_PATH}/win32/panel.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) -file(COPY ${SOURCE_PATH}/curses.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) -file(COPY ${SOURCE_PATH}/panel.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) -file(COPY ${SOURCE_PATH}/term.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) -- cgit v1.2.3 From b2e9efee976083ca6631a7db6c01551536c4384d Mon Sep 17 00:00:00 2001 From: John Camp Date: Fri, 28 Oct 2016 00:15:32 -0400 Subject: Removed panel library. Panel is not emitted as a dll, and is actually just a copy of the pdcurses library anyway. --- ports/pdcurses/portfile.cmake | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ports/pdcurses/portfile.cmake b/ports/pdcurses/portfile.cmake index 607a93b7d..4b993f73f 100644 --- a/ports/pdcurses/portfile.cmake +++ b/ports/pdcurses/portfile.cmake @@ -13,16 +13,13 @@ vcpkg_extract_source_archive(${ARCHIVE}) set(PDC_NMAKE_CMD ${NMAKE} -f vcwin32.mak WIDE=Y UTF8=Y) set(PDC_NMAKE_CWD ${SOURCE_PATH}/win32) set(PDC_PDCLIB ${SOURCE_PATH}/win32/pdcurses) -set(PDC_PANELLIB ${SOURCE_PATH}/win32/panel) set(PDC_OUTPUT bin) if (VCPKG_LIBRARY_LINKAGE STREQUAL "static") set(PDC_PDCLIB ${PDC_PDCLIB}.lib) - set(PDC_PANELLIB ${PDC_PANELLIB}.lib) set(PDC_OUTPUT lib) else() set(PDC_PDCLIB ${PDC_PDCLIB}.dll) - set(PDC_PANELLIB ${PDC_PANELLIB}.dll) set(PDC_NMAKE_CMD ${PDC_NMAKE_CMD} DLL=Y) endif() @@ -34,7 +31,7 @@ vcpkg_execute_required_process( ) message(STATUS "Build ${TARGET_TRIPLET}-rel done") file ( - COPY ${PDC_PDCLIB} ${PDC_PANELLIB} + COPY ${PDC_PDCLIB} DESTINATION ${CURRENT_PACKAGES_DIR}/${PDC_OUTPUT} ) @@ -46,7 +43,7 @@ vcpkg_execute_required_process( ) message(STATUS "Build ${TARGET_TRIPLET}-dbg done") file ( - COPY ${PDC_PDCLIB} ${PDC_PANELLIB} + COPY ${PDC_PDCLIB} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/${PDC_OUTPUT} ) -- cgit v1.2.3 From 7805bdff8cc38c83aaf2b5ea5ecc3042634fb017 Mon Sep 17 00:00:00 2001 From: John Camp Date: Fri, 28 Oct 2016 02:13:50 -0400 Subject: Added a fatal error for 64-bit builds. --- ports/pdcurses/portfile.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ports/pdcurses/portfile.cmake b/ports/pdcurses/portfile.cmake index 4b993f73f..10ff551c0 100644 --- a/ports/pdcurses/portfile.cmake +++ b/ports/pdcurses/portfile.cmake @@ -1,4 +1,9 @@ include(${CMAKE_TRIPLET_FILE}) + +if(VCPKG_TARGET_ARCHITECTURE STREQUAL x64) + message(FATAL_ERROR "64-bit builds are not supported for PDCurses.") +endif() + include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src) find_program(NMAKE nmake) -- cgit v1.2.3 From 2efbe4ec6f211326c395f2b0a075de2ce07a2d4a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 28 Oct 2016 18:58:39 -0700 Subject: [vcpkg.targets] Change VCPkg casing to Vcpkg --- scripts/buildsystems/msbuild/vcpkg.targets | 44 +++++++++++++++--------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/scripts/buildsystems/msbuild/vcpkg.targets b/scripts/buildsystems/msbuild/vcpkg.targets index 3a74099f0..0d89fedd3 100644 --- a/scripts/buildsystems/msbuild/vcpkg.targets +++ b/scripts/buildsystems/msbuild/vcpkg.targets @@ -1,56 +1,56 @@ - true - x86-windows + true + x86-windows - true - x86-uwp + true + x86-uwp - true - x64-windows + true + x64-windows - true - x64-uwp + true + x64-uwp - true - arm-uwp + true + arm-uwp - - $(Configuration) + + $(Configuration) - $(MSBuildThisFileDirectory)..\..\..\installed\$(VCPkgTriplet)\ + $(MSBuildThisFileDirectory)..\..\..\installed\$(VcpkgTriplet)\ - + - $(VCPkgRoot)debug\lib\*.lib;%(AdditionalDependencies) - $(VCPkgRoot)lib\*.lib;%(AdditionalDependencies) + $(VcpkgRoot)debug\lib\*.lib;%(AdditionalDependencies) + $(VcpkgRoot)lib\*.lib;%(AdditionalDependencies) - $(VCPkgRoot)include;%(AdditionalIncludeDirectories) + $(VcpkgRoot)include;%(AdditionalIncludeDirectories) - + - - -- cgit v1.2.3 From a79c348045f513de8fb24ffb12532c1b1a396c3c Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Sun, 30 Oct 2016 13:45:09 +1100 Subject: fixes for plugin installation, cmake package files --- ports/qt5/fixcmake.py | 36 ++++++++++++++++++++++++++++++++++++ ports/qt5/portfile.cmake | 34 ++++++++++++++++------------------ 2 files changed, 52 insertions(+), 18 deletions(-) create mode 100644 ports/qt5/fixcmake.py diff --git a/ports/qt5/fixcmake.py b/ports/qt5/fixcmake.py new file mode 100644 index 000000000..dbee0ed16 --- /dev/null +++ b/ports/qt5/fixcmake.py @@ -0,0 +1,36 @@ +import os +import re +from glob import glob + +files = [y for x in os.walk('.') for y in glob(os.path.join(x[0], '*.cmake'))] + +for f in files: + openedfile = open(f, "r") + builder = "" + exepattern = re.compile("_install_prefix}/bin/[a-z]+.exe") + for line in openedfile: + if "_install_prefix}/bin/${LIB_LOCATION}" in line: + builder += " if (${Configuration} STREQUAL \"RELEASE\")" + builder += "\n " + line + builder += " else()" + builder += "\n " + line.replace("/bin/", "/debug/bin/") + builder += " endif()\n" + elif "_install_prefix}/lib/${LIB_LOCATION}" in line: + builder += " if (${Configuration} STREQUAL \"RELEASE\")" + builder += "\n " + line + builder += " else()" + builder += "\n " + line.replace("/lib/", "/debug/lib/") + builder += " endif()\n" + elif "_install_prefix}/lib/${IMPLIB_LOCATION}" in line: + builder += " if (${Configuration} STREQUAL \"RELEASE\")" + builder += "\n " + line + builder += " else()" + builder += "\n " + line.replace("/lib/", "/debug/lib/") + builder += " endif()\n" + elif exepattern.search(line) != None: + builder += line.replace("/bin/", "/tools/") + else: + builder += line + new_file = open(f, "w") + new_file.write(builder) + new_file.close() diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake index e2949892b..81b30767c 100644 --- a/ports/qt5/portfile.cmake +++ b/ports/qt5/portfile.cmake @@ -7,6 +7,7 @@ set(ENV{PATH} "${OUTPUT_PATH}/qtbase/bin;$ENV{PATH}") find_program(NMAKE nmake) vcpkg_find_acquire_program(JOM) +find_program(PYTHON python) get_filename_component(JOM_EXE_PATH ${JOM} DIRECTORY) set(ENV{PATH} "${JOM_EXE_PATH};$ENV{PATH}") @@ -41,7 +42,11 @@ vcpkg_execute_required_process( -confirm-license -opensource -platform win32-msvc2015 -debug-and-release -force-debug-info ${QT_RUNTIME_LINKAGE} -nomake examples -nomake tests -skip webengine - -prefix "${CURRENT_PACKAGES_DIR}" + -prefix ${CURRENT_PACKAGES_DIR} + -bindir ${CURRENT_PACKAGES_DIR}/bin + -hostbindir ${CURRENT_PACKAGES_DIR}/tools + -archdatadir ${CURRENT_PACKAGES_DIR}/share/qt5 + -datadir ${CURRENT_PACKAGES_DIR}/share/qt5 WORKING_DIRECTORY ${OUTPUT_PATH} LOGNAME configure-${TARGET_TRIPLET} ) @@ -68,7 +73,6 @@ message(STATUS "Packaging ${TARGET_TRIPLET}") file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug) file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib) file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL dynamic) @@ -108,7 +112,6 @@ file(REMOVE ${DEBUG_LIB_FILES}) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Gamepad.lib ${CURRENT_PACKAGES_DIR}/lib/Qt5Gamepad.lib) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Gamepad.prl ${CURRENT_PACKAGES_DIR}/lib/Qt5Gamepad.prl) file(GLOB BINARY_TOOLS "${CURRENT_PACKAGES_DIR}/bin/*.exe") -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools) foreach(BINARY ${BINARY_TOOLS}) execute_process(COMMAND dumpbin /PDBPATH ${BINARY} COMMAND findstr PDB @@ -124,24 +127,19 @@ foreach(BINARY ${BINARY_TOOLS}) endif() endforeach() file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools) -FILE(REMOVE ${BINARY_TOOLS}) +file(REMOVE ${BINARY_TOOLS}) -#if we are using dynamic linkage, the tools also require the dlls and platforms directory to run correctly if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL dynamic) file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/bin/*.dll") file(INSTALL ${RELEASE_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools) - file(INSTALL ${CURRENT_PACKAGES_DIR}/plugins/platforms DESTINATION ${CURRENT_PACKAGES_DIR}/tools) -endif() -set(SHARE_PATH ${CURRENT_PACKAGES_DIR}/share/qt5) -file(MAKE_DIRECTORY ${SHARE_PATH}) -file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${SHARE_PATH} RENAME copyright) -file(RENAME ${CURRENT_PACKAGES_DIR}/doc ${SHARE_PATH}/doc) -file(RENAME ${CURRENT_PACKAGES_DIR}/mkspecs ${SHARE_PATH}/mkspecs) -file(RENAME ${CURRENT_PACKAGES_DIR}/phrasebooks ${SHARE_PATH}/phrasebooks) -file(RENAME ${CURRENT_PACKAGES_DIR}/plugins ${SHARE_PATH}/plugins) -file(RENAME ${CURRENT_PACKAGES_DIR}/qml ${SHARE_PATH}/qml) -file(RENAME ${CURRENT_PACKAGES_DIR}/translations ${SHARE_PATH}/translations) -if (EXISTS ${CURRENT_PACKAGES_DIR}/qtvirtualkeyboard) - file(RENAME ${CURRENT_PACKAGES_DIR}/qtvirtualkeyboard ${SHARE_PATH}/qtvirtualkeyboard) endif() + +vcpkg_execute_required_process( + COMMAND ${PYTHON} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py + WORKING_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/cmake + LOGNAME fix-cmake +) + +file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5 RENAME copyright) + vcpkg_copy_pdbs() -- cgit v1.2.3 From 0b54a01149a515e5603bb81d9d89ee9827b6c498 Mon Sep 17 00:00:00 2001 From: kumar8600 Date: Sun, 30 Oct 2016 18:46:24 +0900 Subject: Add cl.exe path based architecture detection for CMake toolchain --- scripts/buildsystems/vcpkg.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 88acc8436..649e5967a 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -11,7 +11,14 @@ if(NOT VCPKG_TOOLCHAIN) elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 14 2015 ARM$") set(_VCPKG_TARGET_TRIPLET_ARCH arm) else() - set(_VCPKG_TARGET_TRIPLET_ARCH x86) + find_program(_VCPKG_CL cl) + if(_VCPKG_CL MATCHES "amd64/cl.exe$") + set(_VCPKG_TARGET_TRIPLET_ARCH x64) + elseif(_VCPKG_CL MATCHES "arm/cl.exe$") + set(_VCPKG_TARGET_TRIPLET_ARCH arm) + else() + set(_VCPKG_TARGET_TRIPLET_ARCH x86) + endif() endif() endif() -- cgit v1.2.3 From 956f3b110ba2826899c97ab28dafc04ca36b4b20 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 31 Oct 2016 09:37:13 -0700 Subject: [vcpkg-cmake] Added slightly more error checking --- scripts/buildsystems/vcpkg.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 649e5967a..590b4994a 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -10,14 +10,18 @@ if(NOT VCPKG_TOOLCHAIN) set(_VCPKG_TARGET_TRIPLET_ARCH x64) elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 14 2015 ARM$") set(_VCPKG_TARGET_TRIPLET_ARCH arm) + elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 14 2015$") + set(_VCPKG_TARGET_TRIPLET_ARCH x86) else() find_program(_VCPKG_CL cl) if(_VCPKG_CL MATCHES "amd64/cl.exe$") set(_VCPKG_TARGET_TRIPLET_ARCH x64) elseif(_VCPKG_CL MATCHES "arm/cl.exe$") set(_VCPKG_TARGET_TRIPLET_ARCH arm) - else() + elseif(_VCPKG_CL MATCHES "x86/cl.exe$") set(_VCPKG_TARGET_TRIPLET_ARCH x86) + else() + message(FATAL_ERROR "Unable to determine target architecture.") endif() endif() endif() -- cgit v1.2.3 From 016406a52b54603dcb095b57992892222c78614d Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 31 Oct 2016 09:48:58 -0700 Subject: [pdcurses] Lib files are also required in dynamic linkage --- ports/pdcurses/portfile.cmake | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/ports/pdcurses/portfile.cmake b/ports/pdcurses/portfile.cmake index 10ff551c0..2f3429d68 100644 --- a/ports/pdcurses/portfile.cmake +++ b/ports/pdcurses/portfile.cmake @@ -20,11 +20,7 @@ set(PDC_NMAKE_CWD ${SOURCE_PATH}/win32) set(PDC_PDCLIB ${SOURCE_PATH}/win32/pdcurses) set(PDC_OUTPUT bin) -if (VCPKG_LIBRARY_LINKAGE STREQUAL "static") - set(PDC_PDCLIB ${PDC_PDCLIB}.lib) - set(PDC_OUTPUT lib) -else() - set(PDC_PDCLIB ${PDC_PDCLIB}.dll) +if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") set(PDC_NMAKE_CMD ${PDC_NMAKE_CMD} DLL=Y) endif() @@ -35,10 +31,17 @@ vcpkg_execute_required_process( LOGNAME build-${TARGET_TRIPLET}-rel ) message(STATUS "Build ${TARGET_TRIPLET}-rel done") + file ( - COPY ${PDC_PDCLIB} - DESTINATION ${CURRENT_PACKAGES_DIR}/${PDC_OUTPUT} + COPY ${PDC_PDCLIB}.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib ) +if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + file ( + COPY ${PDC_PDCLIB}.dll + DESTINATION ${CURRENT_PACKAGES_DIR}/bin + ) +endif() message(STATUS "Build ${TARGET_TRIPLET}-dbg") vcpkg_execute_required_process( @@ -47,13 +50,22 @@ vcpkg_execute_required_process( LOGNAME build-${TARGET_TRIPLET}-dbg ) message(STATUS "Build ${TARGET_TRIPLET}-dbg done") + file ( - COPY ${PDC_PDCLIB} - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/${PDC_OUTPUT} + COPY ${PDC_PDCLIB}.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib ) +if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + file ( + COPY ${PDC_PDCLIB}.dll + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin + ) +endif() file( COPY ${SOURCE_PATH}/curses.h ${SOURCE_PATH}/panel.h ${SOURCE_PATH}/term.h DESTINATION ${CURRENT_PACKAGES_DIR}/include ) file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/pdcurses RENAME copyright) + +vcpkg_copy_pdbs() -- cgit v1.2.3 From 268f5f306ff0aac8d10b31a457fc83f2eb6d09eb Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 31 Oct 2016 10:07:54 -0700 Subject: [eigen3] Deploy signature file. Deploy unsupported Eigen extensions. Fixes #230. --- ports/eigen3/CONTROL | 2 +- ports/eigen3/portfile.cmake | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ports/eigen3/CONTROL b/ports/eigen3/CONTROL index d5d8e074d..88ae596fb 100644 --- a/ports/eigen3/CONTROL +++ b/ports/eigen3/CONTROL @@ -1,3 +1,3 @@ Source: eigen3 -Version: 3.2.10-1 +Version: 3.2.10-2 Description: C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms. diff --git a/ports/eigen3/portfile.cmake b/ports/eigen3/portfile.cmake index 42615b1a1..706ed9f4c 100644 --- a/ports/eigen3/portfile.cmake +++ b/ports/eigen3/portfile.cmake @@ -8,14 +8,20 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) -file(GLOB_RECURSE GARBAGE ${SOURCE_PATH}/Eigen/CMakeLists.*) +file(GLOB_RECURSE GARBAGE ${SOURCE_PATH}/Eigen/CMakeLists.* ${SOURCE_PATH}/unsupported/Eigen/CMakeLists.*) if(GARBAGE) file(REMOVE ${GARBAGE}) endif() # Put the licence file where vcpkg expects it -file(COPY ${SOURCE_PATH}/COPYING.README DESTINATION ${CURRENT_PACKAGES_DIR}/share/eigen3/COPYING.README) +file(COPY ${SOURCE_PATH}/COPYING.README DESTINATION ${CURRENT_PACKAGES_DIR}/share/eigen3) file(RENAME ${CURRENT_PACKAGES_DIR}/share/eigen3/COPYING.README ${CURRENT_PACKAGES_DIR}/share/eigen3/copyright) # Copy the eigen header files -file(COPY ${SOURCE_PATH}/Eigen/ DESTINATION ${CURRENT_PACKAGES_DIR}/include/Eigen/) \ No newline at end of file +file(COPY ${SOURCE_PATH}/Eigen ${SOURCE_PATH}/signature_of_eigen3_matrix_library + DESTINATION ${CURRENT_PACKAGES_DIR}/include) +file(COPY ${SOURCE_PATH}/unsupported/Eigen + DESTINATION ${CURRENT_PACKAGES_DIR}/include/unsupported) + +# Copy signature file so tools can locate the eigen headers +file(COPY DESTINATION ${CURRENT_PACKAGES_DIR}/include) -- cgit v1.2.3 From bf16c7f4cc6f51c5e920f16f5b7cdf92cfe4ea67 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 31 Oct 2016 10:11:25 -0700 Subject: [vcpkg-cmake] Fix regression in Ninja generator support for x86. --- scripts/buildsystems/vcpkg.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 590b4994a..50b489b1a 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -18,7 +18,7 @@ if(NOT VCPKG_TOOLCHAIN) set(_VCPKG_TARGET_TRIPLET_ARCH x64) elseif(_VCPKG_CL MATCHES "arm/cl.exe$") set(_VCPKG_TARGET_TRIPLET_ARCH arm) - elseif(_VCPKG_CL MATCHES "x86/cl.exe$") + elseif(_VCPKG_CL MATCHES "bin/cl.exe$" OR _VCPKG_CL MATCHES "x86/cl.exe$") set(_VCPKG_TARGET_TRIPLET_ARCH x86) else() message(FATAL_ERROR "Unable to determine target architecture.") -- cgit v1.2.3 From edfb6c78453c5bf281a9b6e2e7c7981694455be4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 31 Oct 2016 11:43:32 -0700 Subject: [gflags] Enable static building --- ports/gflags/portfile.cmake | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/ports/gflags/portfile.cmake b/ports/gflags/portfile.cmake index 124cfa73c..5e000a689 100644 --- a/ports/gflags/portfile.cmake +++ b/ports/gflags/portfile.cmake @@ -1,7 +1,4 @@ include(${CMAKE_TRIPLET_FILE}) -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Static building not supported yet") -endif() include(vcpkg_common_functions) find_program(GIT git) @@ -35,21 +32,24 @@ if(NOT EXISTS "${CURRENT_BUILDTREES_DIR}/src/.git") endif() message(STATUS "Adding worktree and patching done") +set(F) + vcpkg_configure_cmake( SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src - OPTIONS - -DBUILD_SHARED_LIBS=ON ) vcpkg_install_cmake() -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) -file(RENAME ${CURRENT_PACKAGES_DIR}/cmake ${CURRENT_PACKAGES_DIR}/share/gflags) -file(RENAME ${CURRENT_PACKAGES_DIR}/lib/gflags.dll ${CURRENT_PACKAGES_DIR}/bin/gflags.dll) -file(RENAME ${CURRENT_PACKAGES_DIR}/lib/gflags_nothreads.dll ${CURRENT_PACKAGES_DIR}/bin/gflags_nothreads.dll) -file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gflags.dll ${CURRENT_PACKAGES_DIR}/debug/bin/gflags.dll) -file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gflags_nothreads.dll ${CURRENT_PACKAGES_DIR}/debug/bin/gflags_nothreads.dll) +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) + file(RENAME ${CURRENT_PACKAGES_DIR}/lib/gflags.dll ${CURRENT_PACKAGES_DIR}/bin/gflags.dll) + file(RENAME ${CURRENT_PACKAGES_DIR}/lib/gflags_nothreads.dll ${CURRENT_PACKAGES_DIR}/bin/gflags_nothreads.dll) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gflags.dll ${CURRENT_PACKAGES_DIR}/debug/bin/gflags.dll) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gflags_nothreads.dll ${CURRENT_PACKAGES_DIR}/debug/bin/gflags_nothreads.dll) +endif() +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) +file(RENAME ${CURRENT_PACKAGES_DIR}/cmake ${CURRENT_PACKAGES_DIR}/share/gflags) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/cmake) -- cgit v1.2.3 From 997ef3d06508a10bbb662f6729489494af15d434 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 31 Oct 2016 11:51:25 -0700 Subject: [gflags] Remove leftover set(F) --- ports/gflags/portfile.cmake | 2 -- 1 file changed, 2 deletions(-) diff --git a/ports/gflags/portfile.cmake b/ports/gflags/portfile.cmake index 5e000a689..a66e604a2 100644 --- a/ports/gflags/portfile.cmake +++ b/ports/gflags/portfile.cmake @@ -32,8 +32,6 @@ if(NOT EXISTS "${CURRENT_BUILDTREES_DIR}/src/.git") endif() message(STATUS "Adding worktree and patching done") -set(F) - vcpkg_configure_cmake( SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src ) -- cgit v1.2.3 From 8840ed809fbb2152b1156748bde30e30191228b9 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 31 Oct 2016 12:11:14 -0700 Subject: [glog] Fix downloaded file extension --- ports/glog/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/glog/portfile.cmake b/ports/glog/portfile.cmake index daefd3c5e..7811f185d 100644 --- a/ports/glog/portfile.cmake +++ b/ports/glog/portfile.cmake @@ -14,7 +14,7 @@ include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/glog-0472b91c5defdf90cff7292e3bf7bd86770a9a0a) vcpkg_download_distfile(ARCHIVE URLS "https://github.com/google/glog/archive/0472b91c5defdf90cff7292e3bf7bd86770a9a0a.zip" - FILENAME "glog-0472b91c5defdf90cff7292e3bf7bd86770a9a0a" + FILENAME "glog-0472b91c5defdf90cff7292e3bf7bd86770a9a0a.zip" SHA512 24506ad1cc05e8361379b925ecfc8f32cc47692a47598401cca340eb2a528fe28b8b0d3636983056c7910469d105095bd3bacacff6278bffa18d85603c3dbfa8 ) vcpkg_extract_source_archive(${ARCHIVE}) -- cgit v1.2.3 From 600e11d83cc8d66dc15f871ffa0b973978871910 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 31 Oct 2016 12:29:41 -0700 Subject: [vcpkg_copy_pdbs] Branch on dynamic/static. Resolves #224 --- scripts/cmake/vcpkg_copy_pdbs.cmake | 47 ++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/scripts/cmake/vcpkg_copy_pdbs.cmake b/scripts/cmake/vcpkg_copy_pdbs.cmake index b99649d59..10cd1b2d3 100644 --- a/scripts/cmake/vcpkg_copy_pdbs.cmake +++ b/scripts/cmake/vcpkg_copy_pdbs.cmake @@ -1,4 +1,5 @@ function(vcpkg_copy_pdbs) + function(merge_filelist OUTVAR INVAR) set(MSG "") foreach(VAR ${${INVAR}}) @@ -7,32 +8,34 @@ function(vcpkg_copy_pdbs) set(${OUTVAR} ${MSG} PARENT_SCOPE) endfunction() - file(GLOB_RECURSE DLLS ${CURRENT_PACKAGES_DIR}/bin/*.dll ${CURRENT_PACKAGES_DIR}/debug/bin/*.dll) + if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(GLOB_RECURSE DLLS ${CURRENT_PACKAGES_DIR}/bin/*.dll ${CURRENT_PACKAGES_DIR}/debug/bin/*.dll) - set(DLLS_WITHOUT_MATCHING_PDBS) + set(DLLS_WITHOUT_MATCHING_PDBS) - foreach(DLL ${DLLS}) - execute_process(COMMAND dumpbin /PDBPATH ${DLL} - COMMAND findstr PDB - OUTPUT_VARIABLE PDB_LINE - ERROR_QUIET - RESULT_VARIABLE error_code - ) + foreach(DLL ${DLLS}) + execute_process(COMMAND dumpbin /PDBPATH ${DLL} + COMMAND findstr PDB + OUTPUT_VARIABLE PDB_LINE + ERROR_QUIET + RESULT_VARIABLE error_code + ) - if(NOT error_code AND PDB_LINE MATCHES "PDB file found at") - string(REGEX MATCH '.*' PDB_PATH ${PDB_LINE}) # Extract the path which is in single quotes - string(REPLACE ' "" PDB_PATH ${PDB_PATH}) # Remove single quotes - get_filename_component(DLL_DIR ${DLL} DIRECTORY) - file(COPY ${PDB_PATH} DESTINATION ${DLL_DIR}) - else() - list(APPEND DLLS_WITHOUT_MATCHING_PDBS ${DLL}) - endif() - endforeach() + if(NOT error_code AND PDB_LINE MATCHES "PDB file found at") + string(REGEX MATCH '.*' PDB_PATH ${PDB_LINE}) # Extract the path which is in single quotes + string(REPLACE ' "" PDB_PATH ${PDB_PATH}) # Remove single quotes + get_filename_component(DLL_DIR ${DLL} DIRECTORY) + file(COPY ${PDB_PATH} DESTINATION ${DLL_DIR}) + else() + list(APPEND DLLS_WITHOUT_MATCHING_PDBS ${DLL}) + endif() + endforeach() - list(LENGTH DLLS_WITHOUT_MATCHING_PDBS UNMATCHED_DLLS_LENGTH) - if(UNMATCHED_DLLS_LENGTH GREATER 0) - merge_filelist(MSG DLLS_WITHOUT_MATCHING_PDBS) - message(STATUS "Warning: Could not find a matching pdb file for:\n${MSG}") + list(LENGTH DLLS_WITHOUT_MATCHING_PDBS UNMATCHED_DLLS_LENGTH) + if(UNMATCHED_DLLS_LENGTH GREATER 0) + merge_filelist(MSG DLLS_WITHOUT_MATCHING_PDBS) + message(STATUS "Warning: Could not find a matching pdb file for:\n${MSG}") + endif() endif() endfunction() \ No newline at end of file -- cgit v1.2.3 From 71594b6bef76b3510265cf508b24d9221ceede4b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 31 Oct 2016 12:34:04 -0700 Subject: Remove portfile branching of vcpkg_copy_pdbs() --- ports/assimp/portfile.cmake | 5 ++--- ports/bullet3/portfile.cmake | 4 +--- ports/cpprestsdk/portfile.cmake | 4 +--- ports/geos/portfile.cmake | 5 +++-- ports/jxrlib/portfile.cmake | 6 ++---- ports/libccd/portfile.cmake | 8 +++----- ports/libpng/portfile.cmake | 5 ++--- ports/libwebp/portfile.cmake | 6 ++---- ports/openjpeg/portfile.cmake | 6 ++---- ports/openssl/portfile.cmake | 6 +++--- ports/zlib/portfile.cmake | 3 ++- 11 files changed, 23 insertions(+), 35 deletions(-) diff --git a/ports/assimp/portfile.cmake b/ports/assimp/portfile.cmake index fd6cc1c0c..e53384ff1 100644 --- a/ports/assimp/portfile.cmake +++ b/ports/assimp/portfile.cmake @@ -36,6 +36,5 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright file(COPY ${CURRENT_BUILDTREES_DIR}/src/assimp-3.3.1/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/assimp) file(RENAME ${CURRENT_PACKAGES_DIR}/share/assimp/LICENSE ${CURRENT_PACKAGES_DIR}/share/assimp/copyright) -if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - vcpkg_copy_pdbs() -endif() \ No newline at end of file + +vcpkg_copy_pdbs() \ No newline at end of file diff --git a/ports/bullet3/portfile.cmake b/ports/bullet3/portfile.cmake index 5face2c0b..7b530ec07 100644 --- a/ports/bullet3/portfile.cmake +++ b/ports/bullet3/portfile.cmake @@ -33,6 +33,4 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/bullet3) file(RENAME ${CURRENT_PACKAGES_DIR}/share/bullet3/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/bullet3/copyright) -if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - vcpkg_copy_pdbs() -endif() +vcpkg_copy_pdbs() \ No newline at end of file diff --git a/ports/cpprestsdk/portfile.cmake b/ports/cpprestsdk/portfile.cmake index c10f2b065..ed0a2176b 100644 --- a/ports/cpprestsdk/portfile.cmake +++ b/ports/cpprestsdk/portfile.cmake @@ -32,7 +32,5 @@ file(INSTALL ${SOURCE_PATH}/license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/cpprestsdk RENAME copyright) -if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - vcpkg_copy_pdbs() -endif() +vcpkg_copy_pdbs() diff --git a/ports/geos/portfile.cmake b/ports/geos/portfile.cmake index 554015937..b539b3f6f 100644 --- a/ports/geos/portfile.cmake +++ b/ports/geos/portfile.cmake @@ -36,10 +36,11 @@ file(COPY ${CURRENT_BUILDTREES_DIR}/src/3.5/COPYING DESTINATION ${CURRENT_PACKAG file(RENAME ${CURRENT_PACKAGES_DIR}/share/geos/COPYING ${CURRENT_PACKAGES_DIR}/share/geos/copyright) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/libgeos.lib ${CURRENT_PACKAGES_DIR}/debug/lib/libgeos.lib) - vcpkg_copy_pdbs() else() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/geos.lib ${CURRENT_PACKAGES_DIR}/debug/lib/geos.lib) file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/geos_c.lib ${CURRENT_PACKAGES_DIR}/debug/lib/geos_c.lib) -endif() \ No newline at end of file +endif() + +vcpkg_copy_pdbs() \ No newline at end of file diff --git a/ports/jxrlib/portfile.cmake b/ports/jxrlib/portfile.cmake index 0fce5b9ba..53bf30bb5 100644 --- a/ports/jxrlib/portfile.cmake +++ b/ports/jxrlib/portfile.cmake @@ -19,10 +19,8 @@ vcpkg_install_cmake() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - vcpkg_copy_pdbs() -endif() - # Handle copyright file(COPY ${CMAKE_CURRENT_LIST_DIR}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/jxrlib) file(RENAME ${CURRENT_PACKAGES_DIR}/share/jxrlib/LICENSE ${CURRENT_PACKAGES_DIR}/share/jxrlib/copyright) + +vcpkg_copy_pdbs() \ No newline at end of file diff --git a/ports/libccd/portfile.cmake b/ports/libccd/portfile.cmake index 5b99d6c42..67eda1ccb 100644 --- a/ports/libccd/portfile.cmake +++ b/ports/libccd/portfile.cmake @@ -25,10 +25,6 @@ vcpkg_configure_cmake( vcpkg_install_cmake() -if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - vcpkg_copy_pdbs() -endif() - # Avoid a copy of file in debug file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) @@ -41,4 +37,6 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/doc) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/ccd) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/pkgconfig) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/ccd) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig) \ No newline at end of file +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig) + +vcpkg_copy_pdbs() \ No newline at end of file diff --git a/ports/libpng/portfile.cmake b/ports/libpng/portfile.cmake index 3b6768560..61500e680 100644 --- a/ports/libpng/portfile.cmake +++ b/ports/libpng/portfile.cmake @@ -36,9 +36,7 @@ vcpkg_configure_cmake( vcpkg_install_cmake() -if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - vcpkg_copy_pdbs() -else() +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) file(RENAME ${CURRENT_PACKAGES_DIR}/lib/libpng16_static.lib ${CURRENT_PACKAGES_DIR}/lib/libpng16.lib) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libpng16_staticd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/libpng16d.lib) endif() @@ -51,3 +49,4 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/libpng) file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libpng) file(RENAME ${CURRENT_PACKAGES_DIR}/share/libpng/LICENSE ${CURRENT_PACKAGES_DIR}/share/libpng/copyright) +vcpkg_copy_pdbs() diff --git a/ports/libwebp/portfile.cmake b/ports/libwebp/portfile.cmake index 71262f1ba..b9d77c6f6 100644 --- a/ports/libwebp/portfile.cmake +++ b/ports/libwebp/portfile.cmake @@ -23,10 +23,8 @@ vcpkg_install_cmake() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - vcpkg_copy_pdbs() -endif() - # Handle copyright file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libwebp) file(RENAME ${CURRENT_PACKAGES_DIR}/share/libwebp/COPYING ${CURRENT_PACKAGES_DIR}/share/libwebp/copyright) + +vcpkg_copy_pdbs() \ No newline at end of file diff --git a/ports/openjpeg/portfile.cmake b/ports/openjpeg/portfile.cmake index 80f18cd86..718ca6ca1 100644 --- a/ports/openjpeg/portfile.cmake +++ b/ports/openjpeg/portfile.cmake @@ -30,10 +30,8 @@ file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/vcruntime140.dll) file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/msvcp140.dll) file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/vcruntime140.dll) -if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - vcpkg_copy_pdbs() -endif() - # Handle copyright file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/openjpeg) file(RENAME ${CURRENT_PACKAGES_DIR}/share/openjpeg/LICENSE ${CURRENT_PACKAGES_DIR}/share/openjpeg/copyright) + +vcpkg_copy_pdbs() \ No newline at end of file diff --git a/ports/openssl/portfile.cmake b/ports/openssl/portfile.cmake index 7d693cb59..49d322095 100644 --- a/ports/openssl/portfile.cmake +++ b/ports/openssl/portfile.cmake @@ -60,10 +60,10 @@ file(REMOVE file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/openssl RENAME copyright) -if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - vcpkg_copy_pdbs() -else() +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) # They should be empty, only the exes deleted above were in these directories file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/) endif() + +vcpkg_copy_pdbs() \ No newline at end of file diff --git a/ports/zlib/portfile.cmake b/ports/zlib/portfile.cmake index ef42536dc..35ca5ff6d 100644 --- a/ports/zlib/portfile.cmake +++ b/ports/zlib/portfile.cmake @@ -20,7 +20,6 @@ vcpkg_install_cmake() if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/zlibstatic.lib ${CURRENT_PACKAGES_DIR}/debug/lib/zlibstaticd.lib) - vcpkg_copy_pdbs() else() file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/zlib.lib ${CURRENT_PACKAGES_DIR}/debug/lib/zlibd.lib) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) @@ -29,3 +28,5 @@ else() endif() file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/zlib RENAME copyright) + +vcpkg_copy_pdbs() \ No newline at end of file -- cgit v1.2.3 From 26260ae8696a6e344b40187282c0f42613769e7b Mon Sep 17 00:00:00 2001 From: Jens Frederich Date: Mon, 31 Oct 2016 20:34:19 +0100 Subject: [think-cell-range] upgrade to 1d785d9 Signed-off-by: Jens Frederich --- ports/think-cell-range/CONTROL | 2 +- ports/think-cell-range/portfile.cmake | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/think-cell-range/CONTROL b/ports/think-cell-range/CONTROL index 0311dd1ae..80b05f586 100644 --- a/ports/think-cell-range/CONTROL +++ b/ports/think-cell-range/CONTROL @@ -1,5 +1,5 @@ Source: think-cell-range Maintainer: jfrederich@gmail.com -Version: 61e184a +Version: 1d785d9 Description: think-cell's range library , , Build-Depends: boost diff --git a/ports/think-cell-range/portfile.cmake b/ports/think-cell-range/portfile.cmake index 81dc0eea4..bbe75cf8b 100644 --- a/ports/think-cell-range/portfile.cmake +++ b/ports/think-cell-range/portfile.cmake @@ -1,9 +1,9 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/range-61e184a102d7818fd18f293c9ef99e6ebb59c222) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/range-1d785d99b6d4e43b951bff51219e9304b012c3fe) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/think-cell/range/archive/61e184a102d7818fd18f293c9ef99e6ebb59c222.zip" - FILENAME "think-cell_range-61e184a.zip" - SHA512 1d27039918954624f98638636d107b4f8a997bee264552437f6229da4bce7fda31e67ac6f7b3b92a6dfa8d466b4ca6c05c1e516f3e7b37e0853d7d4153ef9587 + URLS "https://github.com/think-cell/range/archive/1d785d99b6d4e43b951bff51219e9304b012c3fe.zip" + FILENAME "think-cell_range-1d785d9.zip" + SHA512 2248d9bcc053f67c4b30b640254bf89a2f4c753fb144219806358175fb897a264c330e870556568d3b2f6c6987f49a5a875492b36f614f19bca0e3b46d0c2490 ) vcpkg_extract_source_archive(${ARCHIVE}) -- cgit v1.2.3 From d58f0c6680b93833a9a1b653c422ba7d2bb00f5d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 31 Oct 2016 13:32:58 -0700 Subject: [integration] Enable static lib integration. Also, detect .vcpkg-root --- scripts/buildsystems/msbuild/vcpkg.targets | 94 +++++++++++++++++------------- 1 file changed, 54 insertions(+), 40 deletions(-) diff --git a/scripts/buildsystems/msbuild/vcpkg.targets b/scripts/buildsystems/msbuild/vcpkg.targets index 0d89fedd3..a7abe5dba 100644 --- a/scripts/buildsystems/msbuild/vcpkg.targets +++ b/scripts/buildsystems/msbuild/vcpkg.targets @@ -1,44 +1,58 @@ - - true - x86-windows - - - - true - x86-uwp - - - - true - x64-windows - - - - true - x64-uwp - - - - true - arm-uwp - - - - $(Configuration) - - $(MSBuildThisFileDirectory)..\..\..\installed\$(VcpkgTriplet)\ - - - - - $(VcpkgRoot)debug\lib\*.lib;%(AdditionalDependencies) - $(VcpkgRoot)lib\*.lib;%(AdditionalDependencies) - - - $(VcpkgRoot)include;%(AdditionalIncludeDirectories) - - + + + + + + -static + + -static + + + + true + x86-windows$(VcpkgRuntimeLibrary) + + + + + + true + x86-uwp$(VcpkgRuntimeLibrary) + + + + true + x64-windows$(VcpkgRuntimeLibrary) + + + + true + x64-uwp$(VcpkgRuntimeLibrary) + + + + true + arm-uwp$(VcpkgRuntimeLibrary) + + + + $(Configuration) + $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), .vcpkg-root))\installed\$(VcpkgTriplet)\ + + + + + + + $(VcpkgRoot)debug\lib\*.lib;%(Link.AdditionalDependencies) + $(VcpkgRoot)lib\*.lib;%(Link.AdditionalDependencies) + + + $(VcpkgRoot)include;%(ClCompile.AdditionalIncludeDirectories) + + + Date: Mon, 31 Oct 2016 13:35:53 -0700 Subject: [libxml2] Call vcpkg_copy_pdbs() --- ports/libxml2/portfile.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/libxml2/portfile.cmake b/ports/libxml2/portfile.cmake index 11682c3bd..26a604897 100644 --- a/ports/libxml2/portfile.cmake +++ b/ports/libxml2/portfile.cmake @@ -143,3 +143,5 @@ endif() # Handle copyright file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libxml2) file(RENAME ${CURRENT_PACKAGES_DIR}/share/libxml2/COPYING ${CURRENT_PACKAGES_DIR}/share/libxml2/copyright) + +vcpkg_copy_pdbs() \ No newline at end of file -- cgit v1.2.3 From 091d55004f6e097979dc69f336763cf11804537f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 31 Oct 2016 13:47:07 -0700 Subject: [expat] Enable static building --- ports/expat/portfile.cmake | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ports/expat/portfile.cmake b/ports/expat/portfile.cmake index c1c37046e..883d6cffb 100644 --- a/ports/expat/portfile.cmake +++ b/ports/expat/portfile.cmake @@ -1,7 +1,4 @@ include(${CMAKE_TRIPLET_FILE}) -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Static building not supported yet") -endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/expat-2.1.1) vcpkg_download_distfile(ARCHIVE_FILE @@ -11,16 +8,24 @@ vcpkg_download_distfile(ARCHIVE_FILE ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(EXPAT_LINKAGE ON) +else() + set(EXPAT_LINKAGE OFF) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS -DBUILD_examples=OFF -DBUILD_tests=OFF -DBUILD_tools=OFF + -DBUILD_shared=${EXPAT_LINKAGE} ) vcpkg_install_cmake() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig ${CURRENT_PACKAGES_DIR}/lib/pkgconfig) file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/expat RENAME copyright) + vcpkg_copy_pdbs() \ No newline at end of file -- cgit v1.2.3 From d0a3c79829f31ac8cf5fda7e003fa6ee3d2d4cd2 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 31 Oct 2016 14:09:43 -0700 Subject: [freetype] Enable static building --- ports/freetype/portfile.cmake | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ports/freetype/portfile.cmake b/ports/freetype/portfile.cmake index ec462d611..621caea18 100644 --- a/ports/freetype/portfile.cmake +++ b/ports/freetype/portfile.cmake @@ -1,7 +1,4 @@ include(${CMAKE_TRIPLET_FILE}) -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Static building not supported yet") -endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/freetype-2.6.3) vcpkg_download_distfile(ARCHIVE @@ -20,7 +17,6 @@ vcpkg_apply_patches( vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS - -DBUILD_SHARED_LIBS=ON -DCONFIG_INSTALL_PATH=share/freetype ) -- cgit v1.2.3 From b04b264f29a80dceeb7c855c66653ac947f9b6f1 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 31 Oct 2016 16:18:30 -0700 Subject: [vcpkg_configure_cmake] Fix C_FLAGS --- scripts/cmake/vcpkg_configure_cmake.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index f956bc8da..901e57368 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -42,7 +42,7 @@ function(vcpkg_configure_cmake) if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL dynamic) list(APPEND _csc_OPTIONS_DEBUG "-DCMAKE_CXX_FLAGS_DEBUG=/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1" - "-DCMAKE_C_FLAGS_RELEASE=/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1" + "-DCMAKE_C_FLAGS_DEBUG=/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1" ) list(APPEND _csc_OPTIONS_RELEASE "-DCMAKE_CXX_FLAGS_RELEASE=/MD /O2 /Oi /Gy /DNDEBUG /Zi" @@ -51,7 +51,7 @@ function(vcpkg_configure_cmake) elseif(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL static) list(APPEND _csc_OPTIONS_DEBUG "-DCMAKE_CXX_FLAGS_DEBUG=/D_DEBUG /MTd /Zi /Ob0 /Od /RTC1" - "-DCMAKE_C_FLAGS_RELEASE=/D_DEBUG /MTd /Zi /Ob0 /Od /RTC1" + "-DCMAKE_C_FLAGS_DEBUG=/D_DEBUG /MTd /Zi /Ob0 /Od /RTC1" ) list(APPEND _csc_OPTIONS_RELEASE "-DCMAKE_CXX_FLAGS_RELEASE=/MT /O2 /Oi /Gy /DNDEBUG /Zi" -- cgit v1.2.3 From 789855546ca26ae30398235d0b3ee2f9eb92c40a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 31 Oct 2016 17:02:39 -0700 Subject: Fix issues with the integration file --- scripts/buildsystems/msbuild/vcpkg.targets | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/scripts/buildsystems/msbuild/vcpkg.targets b/scripts/buildsystems/msbuild/vcpkg.targets index a7abe5dba..e6a321ffd 100644 --- a/scripts/buildsystems/msbuild/vcpkg.targets +++ b/scripts/buildsystems/msbuild/vcpkg.targets @@ -1,6 +1,6 @@ - + @@ -44,16 +44,36 @@ - - $(VcpkgRoot)debug\lib\*.lib;%(Link.AdditionalDependencies) - $(VcpkgRoot)lib\*.lib;%(Link.AdditionalDependencies) - $(VcpkgRoot)include;%(ClCompile.AdditionalIncludeDirectories) + + + + + + + + @(VcpkgLink);%(Link.AdditionalDependencies) + + + + + + + $(ComputeLinkInputsTargets);VcpkgLinkInputs + + Date: Mon, 31 Oct 2016 18:21:57 -0700 Subject: [glfw3] Enable static building --- ports/glfw3/portfile.cmake | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/ports/glfw3/portfile.cmake b/ports/glfw3/portfile.cmake index f2aa28e04..b947142d8 100644 --- a/ports/glfw3/portfile.cmake +++ b/ports/glfw3/portfile.cmake @@ -1,7 +1,4 @@ include(${CMAKE_TRIPLET_FILE}) -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Static building not supported yet") -endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/glfw-3.2.1) vcpkg_download_distfile(ARCHIVE @@ -27,25 +24,15 @@ endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS - -DBUILD_SHARED_LIBS=ON -DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_TESTS=OFF -DGLFW_BUILD_DOCS=OFF -DPACKAGE_CMAKE_INSTALL_PREFIX=\${CMAKE_CURRENT_LIST_DIR}/../.. - # OPTIONS_RELEASE -DOPTIMIZE=1 - # OPTIONS_DEBUG -DDEBUGGABLE=1 ) vcpkg_install_cmake() -file(MAKE_DIRECTORY - ${CURRENT_PACKAGES_DIR}/bin - ${CURRENT_PACKAGES_DIR}/debug/bin - ${CURRENT_PACKAGES_DIR}/share -) -file(RENAME ${CURRENT_PACKAGES_DIR}/lib/glfw3.dll ${CURRENT_PACKAGES_DIR}/bin/glfw3.dll) -file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/glfw3.dll ${CURRENT_PACKAGES_DIR}/debug/bin/glfw3.dll) - +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake/glfw3 ${CURRENT_PACKAGES_DIR}/share/glfw3) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/cmake) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/cmake/glfw3/glfw3Targets-debug.cmake ${CURRENT_PACKAGES_DIR}/share/glfw3/glfw3Targets-debug.cmake) @@ -53,8 +40,11 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/glfw3.lib) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/glfw3.lib) +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) + file(RENAME ${CURRENT_PACKAGES_DIR}/lib/glfw3.dll ${CURRENT_PACKAGES_DIR}/bin/glfw3.dll) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/glfw3.dll ${CURRENT_PACKAGES_DIR}/debug/bin/glfw3.dll) +endif() file(COPY ${SOURCE_PATH}/COPYING.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/glfw3) file(RENAME ${CURRENT_PACKAGES_DIR}/share/glfw3/COPYING.txt ${CURRENT_PACKAGES_DIR}/share/glfw3/copyright) -- cgit v1.2.3 From c67b070df3bf554f3de18143daf8c36c7ded2f3e Mon Sep 17 00:00:00 2001 From: Silvio Date: Tue, 1 Nov 2016 09:32:25 +0100 Subject: Add cppzmq port --- ports/cppzmq/CONTROL | 4 ++++ ports/cppzmq/portfile.cmake | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 ports/cppzmq/CONTROL create mode 100644 ports/cppzmq/portfile.cmake diff --git a/ports/cppzmq/CONTROL b/ports/cppzmq/CONTROL new file mode 100644 index 000000000..a7625e25d --- /dev/null +++ b/ports/cppzmq/CONTROL @@ -0,0 +1,4 @@ +Source: cppzmq +Version: 0.0.0-1 +Build-Depends: zeromq +Description: lightweight messaging kernel, C++ bindings diff --git a/ports/cppzmq/portfile.cmake b/ports/cppzmq/portfile.cmake new file mode 100644 index 000000000..22d9689e8 --- /dev/null +++ b/ports/cppzmq/portfile.cmake @@ -0,0 +1,16 @@ +include(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/cppzmq-7faa9b061843fcbceb7ed94984ee8f20284ee759) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/zeromq/cppzmq/archive/7faa9b061843fcbceb7ed94984ee8f20284ee759.zip" + FILENAME "cppzmq-7faa.zip" + SHA512 10ba10f0e9a2387dc75fec01c2629b969f23d6152596a475474b701a4efccc4007c8eae5ec2a89f7f26e7d117f36016aaead16bf3325a8780bfd6419d84ac54e +) +vcpkg_extract_source_archive(${ARCHIVE}) + +# cppzmq is a single header library, so we just need to copy that file in the include directory +file(INSTALL ${SOURCE_PATH}/zmq.hpp DESTINATION ${CURRENT_PACKAGES_DIR}/include) + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/cppzmq) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/cppzmq/LICENSE ${CURRENT_PACKAGES_DIR}/share/cppzmq/copyright) -- cgit v1.2.3 From bbfe03fc2bbbcd7afa5d6a52234c45450968c27c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Tue, 1 Nov 2016 16:53:52 +0100 Subject: [libjpeg-turbo] Enable static build --- ports/libjpeg-turbo/CONTROL | 2 +- ports/libjpeg-turbo/portfile.cmake | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ports/libjpeg-turbo/CONTROL b/ports/libjpeg-turbo/CONTROL index 9c5ee1d07..1c1cd5d16 100644 --- a/ports/libjpeg-turbo/CONTROL +++ b/ports/libjpeg-turbo/CONTROL @@ -1,3 +1,3 @@ Source: libjpeg-turbo -Version: 1.4.90-1 +Version: 1.4.90-2 Description: libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2, NEON, AltiVec) to accelerate baseline JPEG compression and decompression on x86, x86-64, ARM, and PowerPC systems. diff --git a/ports/libjpeg-turbo/portfile.cmake b/ports/libjpeg-turbo/portfile.cmake index 44958628c..c688f74a7 100644 --- a/ports/libjpeg-turbo/portfile.cmake +++ b/ports/libjpeg-turbo/portfile.cmake @@ -1,6 +1,10 @@ include(${CMAKE_TRIPLET_FILE}) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Static building not supported yet") + set(BUILD_STATIC ON) + set(NOT_BUILD_STATIC OFF) +else() + set(BUILD_STATIC OFF) + set(NOT_BUILD_STATIC ON) endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libjpeg-turbo-1.4.90) @@ -23,7 +27,8 @@ set(ENV{PATH} "${NASM_EXE_PATH};$ENV{PATH}") vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS - -DENABLE_STATIC=OFF + -DENABLE_STATIC=${BUILD_STATIC} + -DENABLE_SHARED=${NOT_BUILD_STATIC} -DWITH_CRT_DLL=ON -DENABLE_EXECUTABLES=OFF -DINSTALL_DOCS=OFF -- cgit v1.2.3 From 4c5f2f9a30fa02c7b5a249bf7aa1059f6f216adb Mon Sep 17 00:00:00 2001 From: vlj Date: Sun, 30 Oct 2016 17:09:18 +0100 Subject: Add libtheora --- ports/libtheora/CMakeLists.txt | 68 ++++++++++++++++++++++++++++++++++++++++++ ports/libtheora/CONTROL | 4 +++ ports/libtheora/FindOGG.cmake | 8 +++++ ports/libtheora/portfile.cmake | 32 ++++++++++++++++++++ 4 files changed, 112 insertions(+) create mode 100644 ports/libtheora/CMakeLists.txt create mode 100644 ports/libtheora/CONTROL create mode 100644 ports/libtheora/FindOGG.cmake create mode 100644 ports/libtheora/portfile.cmake diff --git a/ports/libtheora/CMakeLists.txt b/ports/libtheora/CMakeLists.txt new file mode 100644 index 000000000..a13c5a8e6 --- /dev/null +++ b/ports/libtheora/CMakeLists.txt @@ -0,0 +1,68 @@ +project(theora) + +set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}") +FIND_PACKAGE(OGG REQUIRED) + +file(GLOB HEADERS +"include/theora/codec.h" +"include/theora/theora.h" +"include/theora/theoradec.h" +) + + +include_directories("include") +include_directories(${OGG_INCLUDE_DIR}) + +file(GLOB SOURCES +"lib/analyze.c" +"lib/encapiwrapper.c" +"lib/encfrag.c" +"lib/encinfo.c" +"lib/encode.c" +#"lib/encoder_disabled.c" +"lib/enquant.c" +"lib/fdct.c" +"lib/huffenc.c" +"lib/mathops.c" +"lib/mcenc.c" +"lib/rate.c" +"lib/tokenize.c" +"lib/x86_vc/mmxencfrag.c" +"lib/x86_vc/mmxfdct.c" +"lib/x86_vc/x86cpu.c" +"lib/x86_vc/x86enc.c" +"lib/apiwrapper.c" +"lib/bitpack.c" +"lib/decapiwrapper.c" +"lib/decinfo.c" +"lib/decode.c" +"lib/dequant.c" +"lib/fragment.c" +"lib/huffdec.c" +"lib/idct.c" +"lib/info.c" +"lib/internal.c" +"lib/quant.c" +"lib/state.c" +"lib/x86_vc/mmxfrag.c" +"lib/x86_vc/mmxidct.c" +"lib/x86_vc/mmxstate.c" +"lib/x86_vc/x86state.c" +"win32/xmingw32/libtheoradec-all.def" +) + +add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_BIND_TO_CURRENT_CRT_VERSION) +if (${BUILD_SHARED_LIBS}) + add_definitions(-DLIBTHEORA_EXPORTS) +endif() + +add_library(theora ${SOURCES} ${HEADERS}) +target_link_libraries(theora ${OGG_LIBRARY}) + +install(FILES ${HEADERS} DESTINATION include/theora) + +install(TARGETS theora + RUNTIME DESTINATION bin + LIBRARY DESTINATION bin + ARCHIVE DESTINATION lib +) diff --git a/ports/libtheora/CONTROL b/ports/libtheora/CONTROL new file mode 100644 index 000000000..7d373c1cf --- /dev/null +++ b/ports/libtheora/CONTROL @@ -0,0 +1,4 @@ +Source: libtheora +Version: 1.1.1 +Description: Theora is a free and open video compression format from the Xiph.org Foundation. +Build-Depends: libogg diff --git a/ports/libtheora/FindOGG.cmake b/ports/libtheora/FindOGG.cmake new file mode 100644 index 000000000..fc0d15feb --- /dev/null +++ b/ports/libtheora/FindOGG.cmake @@ -0,0 +1,8 @@ +find_path(OGG_INCLUDE_DIR NAMES ogg/ogg.h) + +find_library(OGG_LIBRARY NAMES ogg) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(OGG DEFAULT_MSG OGG_LIBRARY OGG_INCLUDE_DIR) + +mark_as_advanced(OGG_INCLUDE_DIR OGG_LIBRARY) diff --git a/ports/libtheora/portfile.cmake b/ports/libtheora/portfile.cmake new file mode 100644 index 000000000..fcaabf44f --- /dev/null +++ b/ports/libtheora/portfile.cmake @@ -0,0 +1,32 @@ +# 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(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libtheora-1.1.1) +vcpkg_download_distfile(ARCHIVE + URLS "http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2" + FILENAME "libtheora-1.1.1.tar.bz2" + SHA512 9ab9b3af1c35d16a7d6d84f61f59ef3180132e30c27bdd7c0fa2683e0d00e2c791accbc7fd2c90718cc947d8bd10ee4a5940fb55f90f1fd7b0ed30583a47dbbd +) +vcpkg_extract_source_archive(${ARCHIVE}) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindOGG.cmake DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libtheora) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/libtheora/LICENSE ${CURRENT_PACKAGES_DIR}/share/libtheora/copyright) -- cgit v1.2.3 From dc9fbdbb3ee42607e471e19ae5b796bf79272a9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Tue, 1 Nov 2016 17:59:19 +0100 Subject: Fixed link to CONTRIBUTING.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1a34c1c4a..ba9a989e4 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Vcpkg is built with your contributions. Here are some ways you can contribute: * [Submit Issues](https://github.com/Microsoft/vcpkg/issues) in vcpkg or existing packages * [Submit Fixes and New Packages](https://github.com/Microsoft/vcpkg/pulls) -Please refer to our [Contribution guidelines](docs/CONTRIBUTING.md) for more details. +Please refer to our [Contribution guidelines](CONTRIBUTING.md) for more details. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. -- cgit v1.2.3 From 37ab3c15cd787bf7325f62e4fd9e9ae40d6b8516 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 1 Nov 2016 11:11:24 -0700 Subject: [libjpeg-turbo] Consistency changes --- ports/libjpeg-turbo/CONTROL | 2 +- ports/libjpeg-turbo/portfile.cmake | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ports/libjpeg-turbo/CONTROL b/ports/libjpeg-turbo/CONTROL index 1c1cd5d16..9c5ee1d07 100644 --- a/ports/libjpeg-turbo/CONTROL +++ b/ports/libjpeg-turbo/CONTROL @@ -1,3 +1,3 @@ Source: libjpeg-turbo -Version: 1.4.90-2 +Version: 1.4.90-1 Description: libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2, NEON, AltiVec) to accelerate baseline JPEG compression and decompression on x86, x86-64, ARM, and PowerPC systems. diff --git a/ports/libjpeg-turbo/portfile.cmake b/ports/libjpeg-turbo/portfile.cmake index c688f74a7..0ec4a0c9c 100644 --- a/ports/libjpeg-turbo/portfile.cmake +++ b/ports/libjpeg-turbo/portfile.cmake @@ -1,11 +1,4 @@ include(${CMAKE_TRIPLET_FILE}) -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - set(BUILD_STATIC ON) - set(NOT_BUILD_STATIC OFF) -else() - set(BUILD_STATIC OFF) - set(NOT_BUILD_STATIC ON) -endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libjpeg-turbo-1.4.90) @@ -24,6 +17,14 @@ vcpkg_find_acquire_program(NASM) get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY) set(ENV{PATH} "${NASM_EXE_PATH};$ENV{PATH}") +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(BUILD_STATIC OFF) + set(NOT_BUILD_STATIC ON) +else() + set(BUILD_STATIC ON) + set(NOT_BUILD_STATIC OFF) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS -- cgit v1.2.3 From 992aa1b3dc58586a20390fd7e9fa3bc4f6f9fd1f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 1 Nov 2016 11:14:24 -0700 Subject: [cppzmq] Mark as header-only library --- ports/cppzmq/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/cppzmq/portfile.cmake b/ports/cppzmq/portfile.cmake index 22d9689e8..c2e03c81d 100644 --- a/ports/cppzmq/portfile.cmake +++ b/ports/cppzmq/portfile.cmake @@ -1,4 +1,4 @@ -include(${CMAKE_TRIPLET_FILE}) +#header-only library include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/cppzmq-7faa9b061843fcbceb7ed94984ee8f20284ee759) vcpkg_download_distfile(ARCHIVE -- cgit v1.2.3 From a217d1b8ac1c459aef1af6d3d8b7e83145aca86b Mon Sep 17 00:00:00 2001 From: Silvio Date: Tue, 1 Nov 2016 19:37:29 +0100 Subject: Add libraw port --- ports/libraw/CONTROL | 4 ++++ ports/libraw/portfile.cmake | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 ports/libraw/CONTROL create mode 100644 ports/libraw/portfile.cmake diff --git a/ports/libraw/CONTROL b/ports/libraw/CONTROL new file mode 100644 index 000000000..d627cdd16 --- /dev/null +++ b/ports/libraw/CONTROL @@ -0,0 +1,4 @@ +Source: libraw +Version: 0.17.2 +Build-Depends: libjpeg-turbo +Description: raw image decoder library diff --git a/ports/libraw/portfile.cmake b/ports/libraw/portfile.cmake new file mode 100644 index 000000000..997a92353 --- /dev/null +++ b/ports/libraw/portfile.cmake @@ -0,0 +1,41 @@ +include(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/LibRaw-0.17.2) +vcpkg_download_distfile(ARCHIVE + URLS "http://www.libraw.org/data/LibRaw-0.17.2.zip" + FILENAME "LibRaw-0.17.2" + SHA512 97d34c84dafdcad300d607fbd4df7b120aea1ecdbc2783a8616bc423fa6a7a15adfbeb975f8dab021be09d08ef466c401a3b65bfd1abcfa49d31d4ab91873e60 +) +set(LIBRAW_CMAKE_COMMIT "ffebb680e7457dad27fb74b5a52d6d2960121303") +set(LIBRAW_CMAKE_SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/LibRaw-cmake-${LIBRAW_CMAKE_COMMIT}) +vcpkg_download_distfile(CMAKE_BUILD_ARCHIVE + URLS "https://github.com/LibRaw/LibRaw-cmake/archive/${LIBRAW_CMAKE_COMMIT}.zip" + FILENAME "LibRaw-cmake-${LIBRAW_CMAKE_COMMIT}" + SHA512 5f4ce4aa9da7d27c19466882a1e118e7890db767d46765efb80d97a1f2817315864d063dd4316b12f9363a64434e2b7af5a7ef804313f5c6ca23d50d6c1a75aa +) + +vcpkg_extract_source_archive(${ARCHIVE}) +vcpkg_extract_source_archive(${CMAKE_BUILD_ARCHIVE} ${CURRENT_BUILDTREES_DIR}/src) + +# Copy the CMake build system from the external repo +file(COPY ${LIBRAW_CMAKE_SOURCE_PATH}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +file(COPY ${LIBRAW_CMAKE_SOURCE_PATH}/cmake DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} +) + +vcpkg_install_cmake() + +# Cleanup +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(GLOB RELEASE_EXECUTABLES ${CURRENT_PACKAGES_DIR}/bin/*.exe) +file(REMOVE ${RELEASE_EXECUTABLES}) +file(GLOB DEBUG_EXECUTABLES ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe) +file(REMOVE ${DEBUG_EXECUTABLES}) + +# Handle copyright +file(COPY ${SOURCE_PATH}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/libraw) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/libraw/COPYRIGHT ${CURRENT_PACKAGES_DIR}/share/libraw/copyright) + +vcpkg_copy_pdbs() \ No newline at end of file -- cgit v1.2.3 From cf47f605348c4192142a74f4833b19e4a0c398bd Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Tue, 1 Nov 2016 17:37:15 -0400 Subject: made double-conversion use a cmake build --- ports/double-conversion/portfile.cmake | 44 +++++++++++++++------------------- 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/ports/double-conversion/portfile.cmake b/ports/double-conversion/portfile.cmake index 6ac38fffd..670cb4310 100644 --- a/ports/double-conversion/portfile.cmake +++ b/ports/double-conversion/portfile.cmake @@ -6,6 +6,14 @@ # CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} # +# 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(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/double-conversion-d4d68e4e788bec89d55a6a3e33af674087837c82) @@ -15,31 +23,17 @@ vcpkg_download_distfile(ARCHIVE SHA512 1406dc22b4ea71e1a2490f96cfed3230e122b97607c83ba106df4e90c7e4bfdcfc136c88741e7f1127237b38b4944d462ec5a4627a71f5ea3fe14afbcc64cd44 ) vcpkg_extract_source_archive(${ARCHIVE}) - -vcpkg_apply_patches( - SOURCE_PATH ${SOURCE_PATH} - PATCHES ${CMAKE_CURRENT_LIST_DIR}/mscv_vers.patch -) - -vcpkg_build_msbuild( - PROJECT_PATH ${SOURCE_PATH}/msvc/double-conversion.vcxproj -) - -message(STATUS "Installing") -file(INSTALL - ${SOURCE_PATH}/msvc/Debug/Win32/double-conversion.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib -) -file(INSTALL - ${SOURCE_PATH}/msvc/Release/Win32/double-conversion.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/lib -) - -file(COPY ${SOURCE_PATH}/double-conversion DESTINATION ${CURRENT_PACKAGES_DIR}/include) - -if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - vcpkg_copy_pdbs() -endif() +vcpkg_configure_cmake(SOURCE_PATH ${SOURCE_PATH} + OPTIONS -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=True) +vcpkg_install_cmake() +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) +file(RENAME ${CURRENT_PACKAGES_DIR}/CMake ${CURRENT_PACKAGES_DIR}/share/double-conversion) +file(READ ${CURRENT_PACKAGES_DIR}/debug/CMake/double-conversionLibraryDepends-debug.cmake DEBUG_MODULE) +string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" DEBUG_MODULE "${DEBUG_MODULE}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/double-conversion/double-conversionLibraryDepends-debug.cmake "${DEBUG_MODULE}") +#file(COPY ${SOURCE_PATH}/double-conversion DESTINATION ${CURRENT_PACKAGES_DIR}/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/CMake) +vcpkg_copy_pdbs() message(STATUS "Installing done") -- cgit v1.2.3 From b25c13c1551456dc89ca959c7133b1cc6117532e Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Tue, 1 Nov 2016 19:19:05 -0400 Subject: made some qt5 fixes --- ports/qt5/fixcmake.py | 10 +++++++++- ports/qt5/portfile.cmake | 20 +++++++++++++++++--- scripts/buildsystems/vcpkg.cmake | 2 ++ scripts/cmake/vcpkg_find_acquire_program.cmake | 6 ++++++ tests/qt5/CMakeLists.txt | 10 ++++++++++ tests/qt5/main.cpp | 9 +++++++++ 6 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 tests/qt5/CMakeLists.txt create mode 100644 tests/qt5/main.cpp diff --git a/ports/qt5/fixcmake.py b/ports/qt5/fixcmake.py index dbee0ed16..bd37c1e54 100644 --- a/ports/qt5/fixcmake.py +++ b/ports/qt5/fixcmake.py @@ -27,10 +27,18 @@ for f in files: builder += " else()" builder += "\n " + line.replace("/lib/", "/debug/lib/") builder += " endif()\n" + elif "_install_prefix}/lib/qtmaind.lib" in line: + builder += line.replace("/lib/", "/debug/lib/") + elif "_install_prefix}/plugins/${PLUGIN_LOCATION}" in line: + builder += " if (${Configuration} STREQUAL \"RELEASE\")" + builder += "\n " + line + builder += " else()" + builder += "\n " + line.replace("/plugins/", "/debug/plugins/") + builder += " endif()\n" elif exepattern.search(line) != None: builder += line.replace("/bin/", "/tools/") else: builder += line new_file = open(f, "w") new_file.write(builder) - new_file.close() + new_file.close() \ No newline at end of file diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake index 81b30767c..d1181911b 100644 --- a/ports/qt5/portfile.cmake +++ b/ports/qt5/portfile.cmake @@ -7,9 +7,12 @@ set(ENV{PATH} "${OUTPUT_PATH}/qtbase/bin;$ENV{PATH}") find_program(NMAKE nmake) vcpkg_find_acquire_program(JOM) -find_program(PYTHON python) +vcpkg_find_acquire_program(PERL) +vcpkg_find_acquire_program(PYTHON3) +get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) +get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY) get_filename_component(JOM_EXE_PATH ${JOM} DIRECTORY) -set(ENV{PATH} "${JOM_EXE_PATH};$ENV{PATH}") +set(ENV{PATH} "${JOM_EXE_PATH};${PYTHON3_EXE_PATH};${PERL_EXE_PATH};$ENV{PATH}") vcpkg_download_distfile(ARCHIVE_FILE URLS "http://download.qt.io/official_releases/qt/5.7/5.7.0/single/qt-everywhere-opensource-src-5.7.0.7z" @@ -112,6 +115,17 @@ file(REMOVE ${DEBUG_LIB_FILES}) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Gamepad.lib ${CURRENT_PACKAGES_DIR}/lib/Qt5Gamepad.lib) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Gamepad.prl ${CURRENT_PACKAGES_DIR}/lib/Qt5Gamepad.prl) file(GLOB BINARY_TOOLS "${CURRENT_PACKAGES_DIR}/bin/*.exe") +file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/plugins") +file(GLOB_RECURSE DEBUG_PLUGINS + "${CURRENT_PACKAGES_DIR}/plugins/*d.dll" + "${CURRENT_PACKAGES_DIR}/plugins/*d.pdb") +foreach(file ${DEBUG_PLUGINS}) + get_filename_component(file_n ${file} NAME) + file(RELATIVE_PATH file_rel "${CURRENT_PACKAGES_DIR}/plugins" ${file}) + get_filename_component(rel_dir ${file_rel} DIRECTORY) + file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/plugins/${rel_dir}") + file(RENAME ${file} "${CURRENT_PACKAGES_DIR}/debug/plugins/${rel_dir}/${file_n}") +endforeach() foreach(BINARY ${BINARY_TOOLS}) execute_process(COMMAND dumpbin /PDBPATH ${BINARY} COMMAND findstr PDB @@ -135,7 +149,7 @@ if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL dynamic) endif() vcpkg_execute_required_process( - COMMAND ${PYTHON} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py + COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py WORKING_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/cmake LOGNAME fix-cmake ) diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 88acc8436..4f6805457 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -42,12 +42,14 @@ if(NOT VCPKG_TOOLCHAIN) if(OVERRIDE_ADD_EXECUTABLE) function(add_executable name) _add_executable(${ARGV}) + if(NOT "IMPORTED" IN_LIST ARGV) add_custom_command(TARGET ${name} POST_BUILD COMMAND powershell -noprofile -executionpolicy UnRestricted -file ${_VCPKG_TOOLCHAIN_DIR}/msbuild/applocal.ps1 -targetBinary $ -installedDir "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$:/debug>/bin" -OutVariable out ) + endif() endfunction() endif() set(VCPKG_TOOLCHAIN ON) diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 337cc04a5..633721f0e 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -24,6 +24,12 @@ function(vcpkg_find_acquire_program VAR) set(ARCHIVE "yasm.exe") set(NOEXTRACT ON) set(HASH 850b26be5bbbdaeaf45ac39dd27f69f1a85e600c35afbd16b9f621396b3c7a19863ea3ff316b025b578fce0a8280eef2203306a2b3e46ee1389abb65313fb720) + elseif(VAR MATCHES "PYTHON3") + set(PROGNAME python) + set(PATHS ${DOWNLOADS}/tools/python) + set(URL "https://www.python.org/ftp/python/3.5.2/python-3.5.2-embed-amd64.zip") + set(ARCHIVE "python-3.5.2-embed-amd64.zip") + set(HASH 48bdcb6f94c993acad6782ee33ad4a07a0ea3b9b1bfcdeadf446d459a9224336837e2e7b518d54d8d99c5c3f4e9f8877ea1789cae513fa2eda2a3cad9e4dfd8f) elseif(VAR MATCHES "JOM") set(PROGNAME jom) set(PATHS ${DOWNLOADS}/tools/jom) diff --git a/tests/qt5/CMakeLists.txt b/tests/qt5/CMakeLists.txt new file mode 100644 index 000000000..98667ef11 --- /dev/null +++ b/tests/qt5/CMakeLists.txt @@ -0,0 +1,10 @@ + +cmake_minimum_required(VERSION 3.6) +project(qt5-base-test) +set(CMAKE_AUTOMOC ON) +find_package(Qt5Widgets) +find_package(ZLIB) +find_library(PCRE_LIBRARY NAMES pcre16) +add_executable(test_qt main.cpp) + +target_link_libraries(test_qt Qt5::Widgets ZLIB::ZLIB ${PCRE_LIBRARY}) \ No newline at end of file diff --git a/tests/qt5/main.cpp b/tests/qt5/main.cpp new file mode 100644 index 000000000..cec294069 --- /dev/null +++ b/tests/qt5/main.cpp @@ -0,0 +1,9 @@ +#include +#include +#include +int main(int argc, char** argv) { + auto buildABI = QSysInfo::buildAbi().toStdString(); + fprintf(stdout, "%s\n", buildABI.c_str()); + printf("%d\n", QSysInfo::windowsVersion()); + return 0; +} \ No newline at end of file -- cgit v1.2.3 From 265ca59396eef343279e6369764f67094637e62e Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 1 Nov 2016 21:51:28 -0700 Subject: [README] Note requirement for git.exe to be available on the path --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ba9a989e4..99d8dc0b3 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,11 @@ Vcpkg helps you get C and C++ libraries on Windows. This tool and ecosystem are For short description of available commands, run `vcpkg help`. ## Quick Start -If there is no `vcpkg.exe` (such as after a `git clone`), run +Prerequisites: +- Visual Studio 2015 Update 3 +- `git.exe` available in your path + +Clone this repository, then run ``` C:\src\vcpkg> powershell -exec bypass scripts\bootstrap.ps1 ``` @@ -18,7 +22,7 @@ Install any packages with ``` C:\src\vcpkg> .\vcpkg install sdl2 curl ``` -Finally, create a New Project (or open an existing one) in Visual Studio 2015. You can now `#include` and use any of the installed libraries. +Finally, create a New Project (or open an existing one) in Visual Studio 2015 or Visual Studio "15" Preview. You can now `#include` and use any of the installed libraries. ## Examples See the [`docs\EXAMPLES.md`](docs/EXAMPLES.md) document for specific walkthroughs, including using a package and adding a new package. -- cgit v1.2.3 From cb67d4523b737cba274e12ea58cfbd0d0bb780d9 Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Wed, 2 Nov 2016 01:09:29 -0400 Subject: fix gflags --- ports/gflags/portfile.cmake | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/ports/gflags/portfile.cmake b/ports/gflags/portfile.cmake index a66e604a2..7ca94d9fd 100644 --- a/ports/gflags/portfile.cmake +++ b/ports/gflags/portfile.cmake @@ -49,8 +49,27 @@ endif() file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) file(RENAME ${CURRENT_PACKAGES_DIR}/cmake ${CURRENT_PACKAGES_DIR}/share/gflags) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +file(READ ${CURRENT_PACKAGES_DIR}/debug/cmake/gflags-export-debug.cmake GFLAGS_DEBUG_MODULE) +string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" GFLAGS_DEBUG_MODULE "${GFLAGS_DEBUG_MODULE}") +string(REPLACE "/Lib/gflags.dll" "/bin/gflags.dll" GFLAGS_DEBUG_MODULE "${GFLAGS_DEBUG_MODULE}") +string(REPLACE "/Lib/gflags_nothreads.dll" "/bin/gflags_nothreads.dll" GFLAGS_DEBUG_MODULE "${GFLAGS_DEBUG_MODULE}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/gflags/gflags-export-debug.cmake "${GFLAGS_DEBUG_MODULE}") + +file(READ ${CURRENT_PACKAGES_DIR}/share/gflags/gflags-export-release.cmake GFLAGS_RELEASE_MODULE) +string(REPLACE "/Lib/gflags.dll" "/bin/gflags.dll" GFLAGS_RELEASE_MODULE "${GFLAGS_RELEASE_MODULE}") +string(REPLACE "/Lib/gflags_nothreads.dll" "/bin/gflags_nothreads.dll" GFLAGS_RELEASE_MODULE "${GFLAGS_RELEASE_MODULE}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/gflags/gflags-export-release.cmake "${GFLAGS_RELEASE_MODULE}") + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/cmake) +file(READ ${CURRENT_PACKAGES_DIR}/share/gflags/gflags-export.cmake GFLAGS_CONFIG_MODULE) +string(REPLACE "get_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)" + "get_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)\nget_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)" + GFLAGS_CONFIG_MODULE "${GFLAGS_CONFIG_MODULE}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/gflags/gflags-export.cmake ${GFLAGS_CONFIG_MODULE}) + file(INSTALL ${CURRENT_BUILDTREES_DIR}/src/COPYING.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/gflags RENAME copyright) + vcpkg_copy_pdbs() -- cgit v1.2.3 From 8d7212aa09dab3175be224d81073e36a1f2e5798 Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Wed, 2 Nov 2016 18:49:41 +1100 Subject: remove extra dependencies --- tests/qt5/CMakeLists.txt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/qt5/CMakeLists.txt b/tests/qt5/CMakeLists.txt index 98667ef11..777b37c01 100644 --- a/tests/qt5/CMakeLists.txt +++ b/tests/qt5/CMakeLists.txt @@ -1,10 +1,8 @@ -cmake_minimum_required(VERSION 3.6) +cmake_minimum_required(VERSION 3.2) project(qt5-base-test) set(CMAKE_AUTOMOC ON) find_package(Qt5Widgets) -find_package(ZLIB) -find_library(PCRE_LIBRARY NAMES pcre16) add_executable(test_qt main.cpp) -target_link_libraries(test_qt Qt5::Widgets ZLIB::ZLIB ${PCRE_LIBRARY}) \ No newline at end of file +target_link_libraries(test_qt Qt5::Widgets) -- cgit v1.2.3 From 16351c61a2ea033d0c0eed14d7ef883298cba81e Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Tue, 1 Nov 2016 20:12:26 +0100 Subject: Add gettext. --- ports/gettext/0001-Fix-macro-definitions.patch | 45 ++ ports/gettext/CMakeLists.txt | 1 + ports/gettext/CMakeLists_libintl.txt | 54 ++ ports/gettext/CONTROL | 3 + ports/gettext/config.h | 666 +++++++++++++++++++++++++ ports/gettext/libgnuintl.h | 423 ++++++++++++++++ ports/gettext/portfile.cmake | 43 ++ 7 files changed, 1235 insertions(+) create mode 100644 ports/gettext/0001-Fix-macro-definitions.patch create mode 100644 ports/gettext/CMakeLists.txt create mode 100644 ports/gettext/CMakeLists_libintl.txt create mode 100644 ports/gettext/CONTROL create mode 100644 ports/gettext/config.h create mode 100644 ports/gettext/libgnuintl.h create mode 100644 ports/gettext/portfile.cmake diff --git a/ports/gettext/0001-Fix-macro-definitions.patch b/ports/gettext/0001-Fix-macro-definitions.patch new file mode 100644 index 000000000..506c43dba --- /dev/null +++ b/ports/gettext/0001-Fix-macro-definitions.patch @@ -0,0 +1,45 @@ +From df8121a8822245df0b191b7d3b1654611fdac1b2 Mon Sep 17 00:00:00 2001 +From: vlj +Date: Tue, 1 Nov 2016 23:09:06 +0100 +Subject: [PATCH] Fix macro definitions. + +--- + gettext-0.19/gettext-runtime/intl/printf-parse.c | 4 +++- + gettext-0.19/gettext-runtime/intl/xsize.h | 6 ++++++ + 2 files changed, 9 insertions(+), 1 deletion(-) + +diff --git a/gettext-0.19/gettext-runtime/intl/printf-parse.c b/gettext-0.19/gettext-runtime/intl/printf-parse.c +index 0e2d2c7..8cedfc6 100644 +--- a/gettext-0.19/gettext-runtime/intl/printf-parse.c ++++ b/gettext-0.19/gettext-runtime/intl/printf-parse.c +@@ -48,7 +48,9 @@ + #include + + /* Get intmax_t. */ +-#if defined IN_LIBINTL || defined IN_LIBASPRINTF ++#if _MSC_VER ++# define intmax_t long int ++#elif defined IN_LIBINTL || defined IN_LIBASPRINTF + # if HAVE_STDINT_H_WITH_UINTMAX + # include + # endif +diff --git a/gettext-0.19/gettext-runtime/intl/xsize.h b/gettext-0.19/gettext-runtime/intl/xsize.h +index c256665..d09e79f 100644 +--- a/gettext-0.19/gettext-runtime/intl/xsize.h ++++ b/gettext-0.19/gettext-runtime/intl/xsize.h +@@ -27,6 +27,12 @@ + # include + #endif + ++#ifdef _WIN32 ++# define _GL_INLINE_HEADER_BEGIN ++# define _GL_INLINE_HEADER_END ++# define _GL_INLINE static inline ++#endif ++ + #ifndef _GL_INLINE_HEADER_BEGIN + #error "Please include config.h first." + #endif +-- +2.10.1.windows.1 + diff --git a/ports/gettext/CMakeLists.txt b/ports/gettext/CMakeLists.txt new file mode 100644 index 000000000..410ff9c0a --- /dev/null +++ b/ports/gettext/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(gettext-runtime) \ No newline at end of file diff --git a/ports/gettext/CMakeLists_libintl.txt b/ports/gettext/CMakeLists_libintl.txt new file mode 100644 index 000000000..f01cf632c --- /dev/null +++ b/ports/gettext/CMakeLists_libintl.txt @@ -0,0 +1,54 @@ +cmake_policy(SET CMP0005 OLD) + +project(libintl) + +include_directories(".") + +FILE(GLOB SOURCES +"intl/bindtextdom.c" +"intl/dcgettext.c" +"intl/dcigettext.c" +"intl/dcngettext.c" +"intl/dgettext.c" +"intl/dngettext.c" +"intl/explodename.c" +"intl/finddomain.c" +"intl/gettext.c" +"intl/hash-string.c" +"intl/intl-compat.c" +"intl/l10nflist.c" +"intl/langprefs.c" +"intl/loadmsgcat.c" +"intl/localcharset.c" +"intl/localealias.c" +"intl/localename.c" +"intl/lock.c" +"intl/log.c" +"intl/ngettext.c" +"intl/osdep.c" +"intl/plural-exp.c" +"intl/plural.c" +"intl/printf.c" +"intl/relocatable.c" +"intl/textdomain.c" +"intl/version.c" +) + +set(LOCALDIR "c:\\gettext") + +add_definitions(-DLOCALEDIR=\\\"${LOCALDIR}\\\") +add_definitions(-DLOCALE_ALIAS_PATH=\\\"${LOCALDIR}\\\") +add_definitions(-DLIBDIR=\\\"${LOCALDIR}\\\") +add_definitions(-DINSTALLDIR=\\\"${LOCALDIR}\\\") +add_definitions("-DBUILDING_LIBINTL -DBUILDING_DLL -DIN_LIBINTL -DENABLE_RELOCATABLE=1 -DIN_LIBRARY") + +add_definitions("-DNO_XMALLOC -Dset_relocation_prefix=libintl_set_relocation_prefix -Drelocate=libintl_relocate -DDEPENDS_ON_LIBICONV=1 -DHAVE_CONFIG_H -D_CRT_SECURE_NO_WARNINGS") + +add_library(libintl ${SOURCES}) + +install(TARGETS libintl + RUNTIME DESTINATION bin + LIBRARY DESTINATION bin + ARCHIVE DESTINATION lib +) + diff --git a/ports/gettext/CONTROL b/ports/gettext/CONTROL new file mode 100644 index 000000000..3ab837168 --- /dev/null +++ b/ports/gettext/CONTROL @@ -0,0 +1,3 @@ +Source: gettext +Version: 0.19 +Description: The GNU gettext utilities are a set of tools that provides a framework to help other GNU packages produce multi-lingual messages diff --git a/ports/gettext/config.h b/ports/gettext/config.h new file mode 100644 index 000000000..cde9f23b4 --- /dev/null +++ b/ports/gettext/config.h @@ -0,0 +1,666 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to the number of bits in type 'ptrdiff_t'. */ +#define BITSIZEOF_PTRDIFF_T sizeof(ptrdiff_t) + +/* Define to the number of bits in type 'sig_atomic_t'. */ +#define BITSIZEOF_SIG_ATOMIC_T 32 + +/* Define to the number of bits in type 'size_t'. */ +#define BITSIZEOF_SIZE_T sizeof(size_t) + +/* Define to the number of bits in type 'wchar_t'. */ +#define BITSIZEOF_WCHAR_T 16 + +/* Define to the number of bits in type 'wint_t'. */ +#define BITSIZEOF_WINT_T 16 + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +/* #undef CRAY_STACKSEG_END */ + +/* Define if mono is the preferred C# implementation. */ +/* #undef CSHARP_CHOICE_MONO */ + +/* Define if pnet is the preferred C# implementation. */ +/* #undef CSHARP_CHOICE_PNET */ + +/* Define to 1 if using `alloca.c'. */ +/* #undef C_ALLOCA */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +#define ENABLE_NLS 1 + +/* Define to 1 if the package shall run at any location in the filesystem. */ +/* #undef ENABLE_RELOCATABLE */ + +/* Define to 1 when using the gnulib module fwriteerror. */ +#define GNULIB_FWRITEERROR 1 + +/* Define to 1 if you have `alloca', as a function or macro. */ +#define HAVE_ALLOCA 1 + +/* Define to 1 if you have and it should be used (not on Ultrix). + */ +/* #undef HAVE_ALLOCA_H */ + +/* Define to 1 if you have the `argz_count' function. */ +/* #undef HAVE_ARGZ_COUNT */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ARGZ_H */ + +/* Define to 1 if you have the `argz_next' function. */ +/* #undef HAVE_ARGZ_NEXT */ + +/* Define to 1 if you have the `argz_stringify' function. */ +/* #undef HAVE_ARGZ_STRINGIFY */ + +/* Define to 1 if you have the `asprintf' function. */ +/* #undef HAVE_ASPRINTF */ + +/* Define to 1 if you have the `atexit' function. */ +#define HAVE_ATEXIT 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BP_SYM_H */ + +/* Define to 1 if the compiler understands __builtin_expect. */ +/* #undef HAVE_BUILTIN_EXPECT */ + +/* Define to 1 if you have the `canonicalize_file_name' function. */ +/* #undef HAVE_CANONICALIZE_FILE_NAME */ + +/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYCURRENT */ + +/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +/* #undef HAVE_DCGETTEXT */ + +/* Define to 1 if you have the declaration of `canonicalize_file_name', and to + 0 if you don't. */ +#define HAVE_DECL_CANONICALIZE_FILE_NAME 0 + +/* Define to 1 if you have the declaration of `clearerr_unlocked', and to 0 if + you don't. */ +#define HAVE_DECL_CLEARERR_UNLOCKED 0 + +/* Define to 1 if you have the declaration of `feof_unlocked', and to 0 if you + don't. */ +#define HAVE_DECL_FEOF_UNLOCKED 0 + +/* Define to 1 if you have the declaration of `ferror_unlocked', and to 0 if + you don't. */ +#define HAVE_DECL_FERROR_UNLOCKED 0 + +/* Define to 1 if you have the declaration of `fflush_unlocked', and to 0 if + you don't. */ +#define HAVE_DECL_FFLUSH_UNLOCKED 0 + +/* Define to 1 if you have the declaration of `fgets_unlocked', and to 0 if + you don't. */ +#define HAVE_DECL_FGETS_UNLOCKED 0 + +/* Define to 1 if you have the declaration of `fputc_unlocked', and to 0 if + you don't. */ +#define HAVE_DECL_FPUTC_UNLOCKED 0 + +/* Define to 1 if you have the declaration of `fputs_unlocked', and to 0 if + you don't. */ +#define HAVE_DECL_FPUTS_UNLOCKED 0 + +/* Define to 1 if you have the declaration of `fread_unlocked', and to 0 if + you don't. */ +#define HAVE_DECL_FREAD_UNLOCKED 0 + +/* Define to 1 if you have the declaration of `fwrite_unlocked', and to 0 if + you don't. */ +#define HAVE_DECL_FWRITE_UNLOCKED 0 + +/* Define to 1 if you have the declaration of `getchar_unlocked', and to 0 if + you don't. */ +#define HAVE_DECL_GETCHAR_UNLOCKED 0 + +/* Define to 1 if you have the declaration of `getc_unlocked', and to 0 if you + don't. */ +#define HAVE_DECL_GETC_UNLOCKED 0 + +/* Define to 1 if you have the declaration of `getenv', and to 0 if you don't. + */ +#define HAVE_DECL_GETENV 1 + +/* Define to 1 if you have the declaration of `putchar_unlocked', and to 0 if + you don't. */ +#define HAVE_DECL_PUTCHAR_UNLOCKED 0 + +/* Define to 1 if you have the declaration of `putc_unlocked', and to 0 if you + don't. */ +#define HAVE_DECL_PUTC_UNLOCKED 0 + +/* Define to 1 if you have the declaration of `strdup', and to 0 if you don't. + */ +#define HAVE_DECL_STRDUP 1 + +/* Define to 1 if you have the declaration of `strerror', and to 0 if you + don't. */ +/* #undef HAVE_DECL_STRERROR */ + +/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you + don't. */ +#define HAVE_DECL_STRERROR_R 0 + +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 0 + +/* Define to 1 if you have the declaration of `wcwidth', and to 0 if you + don't. */ +#define HAVE_DECL_WCWIDTH 0 + +/* Define to 1 if you have the declaration of `_snprintf', and to 0 if you + don't. */ +#define HAVE_DECL__SNPRINTF 1 + +/* Define to 1 if you have the declaration of `_snwprintf', and to 0 if you + don't. */ +#define HAVE_DECL__SNWPRINTF 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DLFCN_H */ + +/* Define if you have the declaration of environ. */ +#define HAVE_ENVIRON_DECL 1 + +/* Define to 1 if you have the `fwprintf' function. */ +#define HAVE_FWPRINTF 1 + +/* Define to 1 if you have the `getcwd' function. */ +#define HAVE_GETCWD 1 + +/* Define to 1 if you have the `getegid' function. */ +/* #undef HAVE_GETEGID */ + +/* Define to 1 if you have the `geteuid' function. */ +/* #undef HAVE_GETEUID */ + +/* Define to 1 if you have the `getgid' function. */ +/* #undef HAVE_GETGID */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_GETOPT_H */ + +/* Define to 1 if you have the `getopt_long_only' function. */ +/* #undef HAVE_GETOPT_LONG_ONLY */ + +/* Define to 1 if you have the `getpagesize' function. */ +/* #undef HAVE_GETPAGESIZE */ + +/* Define if the GNU gettext() function is already present or preinstalled. */ +/* #undef HAVE_GETTEXT */ + +/* Define to 1 if you have the `getuid' function. */ +/* #undef HAVE_GETUID */ + +/* Define if you have the iconv() function and it works. */ +/* #undef HAVE_ICONV */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ICONV_H */ + +/* Define if your compiler supports the #include_next directive. */ +/* #undef HAVE_INCLUDE_NEXT */ + +/* Define if you have the 'intmax_t' type in or . */ +/* #undef HAVE_INTMAX_T */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_INTTYPES_H */ + +/* Define if exists, doesn't clash with , and + declares uintmax_t. */ +/* #undef HAVE_INTTYPES_H_WITH_UINTMAX */ + +/* Define to 1 if you have the `iswcntrl' function. */ +#define HAVE_ISWCNTRL 1 + +/* Define if you have and nl_langinfo(CODESET). */ +/* #undef HAVE_LANGINFO_CODESET */ + +/* Define if your file defines LC_MESSAGES. */ +/* #undef HAVE_LC_MESSAGES */ + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if the system has the type `long long int'. */ +/* #undef HAVE_LONG_LONG_INT */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MACH_O_DYLD_H */ + +/* Define if the 'malloc' function is POSIX compliant. */ +/* #undef HAVE_MALLOC_POSIX */ + +/* Define to 1 if mbrtowc and mbstate_t are properly declared. */ +/* #undef HAVE_MBRTOWC */ + +/* Define to 1 if declares mbstate_t. */ +#define HAVE_MBSTATE_T 1 + +/* Define to 1 if you have the `memchr' function. */ +#define HAVE_MEMCHR 1 + +/* Define to 1 if you have the `memmove' function. */ +#define HAVE_MEMMOVE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mempcpy' function. */ +/* #undef HAVE_MEMPCPY */ + +/* Define to 1 if you have a working `mmap' system call. */ +/* #undef HAVE_MMAP */ + +/* Define to 1 if you have the `munmap' function. */ +/* #undef HAVE_MUNMAP */ + +/* Define if you have and it defines the NL_LOCALE_NAME macro if + _GNU_SOURCE is defined. */ +/* #undef HAVE_NL_LOCALE_NAME */ + +/* Define if your printf() function supports format strings with positions. */ +/* #undef HAVE_POSIX_PRINTF */ + +/* Define if the defines PTHREAD_MUTEX_RECURSIVE. */ +/* #undef HAVE_PTHREAD_MUTEX_RECURSIVE */ + +/* Define if the POSIX multithreading library has read/write locks. */ +/* #undef HAVE_PTHREAD_RWLOCK */ + +/* Define to 1 if you have the `putenv' function. */ +#define HAVE_PUTENV 1 + +/* Define to 1 if you have the `readlink' function. */ +/* #undef HAVE_READLINK */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SEARCH_H 1 + +/* Define to 1 if you have the `setenv' function. */ +/* #undef HAVE_SETENV */ + +/* Define to 1 if you have the `setlocale' function. */ +#define HAVE_SETLOCALE 1 + +/* Define to 1 if 'sig_atomic_t' is a signed integer type. */ +#define HAVE_SIGNED_SIG_ATOMIC_T 1 + +/* Define to 1 if 'wchar_t' is a signed integer type. */ +/* #undef HAVE_SIGNED_WCHAR_T */ + +/* Define to 1 if 'wint_t' is a signed integer type. */ +/* #undef HAVE_SIGNED_WINT_T */ + +/* Define to 1 if you have the `snprintf' function. */ +/* #undef HAVE_SNPRINTF */ + +/* Define to 1 if stdbool.h conforms to C99. */ +/* #undef HAVE_STDBOOL_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDDEF_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STDINT_H */ + +/* Define if exists, doesn't clash with , and declares + uintmax_t. */ +/* #undef HAVE_STDINT_H_WITH_UINTMAX */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `stpcpy' function. */ +/* #undef HAVE_STPCPY */ + +/* Define to 1 if you have the `strcasecmp' function. */ +/* #undef HAVE_STRCASECMP */ + +/* Define to 1 if you have the `strdup' function. */ +#define HAVE_STRDUP 1 + +/* Define to 1 if you have the `strerror_r' function. */ +/* #undef HAVE_STRERROR_R */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STRINGS_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strtol' function. */ +#define HAVE_STRTOL 1 + +/* Define to 1 if you have the `strtoul' function. */ +#define HAVE_STRTOUL 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_BITYPES_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_INTTYPES_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_PARAM_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the `tsearch' function. */ +/* #undef HAVE_TSEARCH */ + +/* Define if you have the 'uintmax_t' type in or . */ +/* #undef HAVE_UINTMAX_T */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_UNISTD_H */ + +/* Define to 1 if the system has the type `unsigned long long int'. */ +/* #undef HAVE_UNSIGNED_LONG_LONG_INT */ + +/* Define to 1 or 0, depending whether the compiler supports simple visibility + declarations. */ +#define HAVE_VISIBILITY 0 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define if you have the 'wchar_t' type. */ +#define HAVE_WCHAR_T 1 + +/* Define to 1 if you have the `wcslen' function. */ +#define HAVE_WCSLEN 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCTYPE_H 1 + +/* Define to 1 if you have the `wcwidth' function. */ +/* #undef HAVE_WCWIDTH */ + +/* Define if you have the 'wint_t' type. */ +#define HAVE_WINT_T 1 + +/* Define to 1 if the system has the type `_Bool'. */ +/* #undef HAVE__BOOL */ + +/* Define to 1 if you have the `_NSGetExecutablePath' function. */ +/* #undef HAVE__NSGETEXECUTABLEPATH */ + +/* Define to 1 if you have the `__fsetlocking' function. */ +/* #undef HAVE___FSETLOCKING */ + +/* Define as const if the declaration of iconv() needs const. */ +/* #undef ICONV_CONST */ + +/* Define to a symbolic name denoting the flavor of iconv_open() + implementation. */ +/* #undef ICONV_FLAVOR */ + +/* Define to the value of ${prefix}, as a string. */ +/* #define INSTALLPREFIX "/usr/local" */ + +/* Define if integer division by zero raises signal SIGFPE. */ +#define INTDIV0_RAISES_SIGFPE 0 + +/* If malloc(0) is != NULL, define this to 1. Otherwise define this to 0. */ +#define MALLOC_0_IS_NONNULL 1 + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +#define NO_MINUS_C_MINUS_O 1 + +/* Name of package */ +#define PACKAGE "gettext-runtime" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "" + +/* Define if exists and defines unusable PRI* macros. */ +/* #undef PRI_MACROS_BROKEN */ + +/* Define if the pthread_in_use() detection is hard. */ +/* #undef PTHREAD_IN_USE_DETECTION_HARD */ + +/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + 'ptrdiff_t'. */ +#define PTRDIFF_T_SUFFIX + +/* Define this to 1 if strerror is broken. */ +/* #undef REPLACE_STRERROR */ + +/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + 'sig_atomic_t'. */ +#define SIG_ATOMIC_T_SUFFIX + +/* Define as the maximum value of type 'size_t', if the system doesn't define + it. */ +#define SIZE_MAX (((1UL << 31) - 1) * 2 + 1) + +/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + 'size_t'. */ +#define SIZE_T_SUFFIX u + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at runtime. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +/* #undef STACK_DIRECTION */ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define to 1 if strerror_r returns char *. */ +/* #undef STRERROR_R_CHAR_P */ + +/* Define if the POSIX multithreading library can be used. */ +/* #undef USE_POSIX_THREADS */ + +/* Define if references to the POSIX multithreading library should be made + weak. */ +/* #undef USE_POSIX_THREADS_WEAK */ + +/* Define if the GNU Pth multithreading library can be used. */ +/* #undef USE_PTH_THREADS */ + +/* Define if references to the GNU Pth multithreading library should be made + weak. */ +/* #undef USE_PTH_THREADS_WEAK */ + +/* Define if the old Solaris multithreading library can be used. */ +/* #undef USE_SOLARIS_THREADS */ + +/* Define if references to the old Solaris multithreading library should be + made weak. */ +/* #undef USE_SOLARIS_THREADS_WEAK */ + +/* Define to 1 if you want getc etc. to use unlocked I/O if available. + Unlocked I/O can improve performance in unithreaded apps, but it is not + safe for multithreaded apps. */ +#define USE_UNLOCKED_IO 0 + +/* Define if the Win32 multithreading API can be used. */ +#define USE_WIN32_THREADS 1 + +/* Version number of package */ +#define VERSION "0.17" + +/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + 'wchar_t'. */ +#define WCHAR_T_SUFFIX + +/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + 'wint_t'. */ +#define WINT_T_SUFFIX + +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Define to rpl_ if the getopt replacement functions and variables should be + used. */ +#define __GETOPT_PREFIX rpl_ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#define inline __inline +#endif + +/* Define to a type if does not define. */ +/* #undef mbstate_t */ + +/* Define as the type of the result of subtracting two pointers, if the system + doesn't define it. */ +/* #undef ptrdiff_t */ + +/* Define to a replacement function name for realpath(). */ +#define realpath rpl_realpath + +/* Define to the equivalent of the C99 'restrict' keyword, or to + nothing if this is not supported. Do not define if restrict is + supported directly. */ +#define restrict +/* Work around a bug in Sun C++: it does not support _Restrict, even + though the corresponding Sun C compiler does, which causes + "#define restrict _Restrict" in the previous line. Perhaps some future + version of Sun C++ will work with _Restrict; if so, it'll probably + define __RESTRICT, just as Sun C does. */ +#if defined __SUNPRO_CC && !defined __RESTRICT +# define _Restrict +#endif + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ + +/* Define as a signed type of the same size as size_t. */ +#ifdef _WIN64 +#define ssize_t __int64 +#else +#define ssize_t __int32 +#endif + +/* Define to rpl_strnlen if the replacement function should be used. */ +#define strnlen rpl_strnlen + +/* Define to unsigned long or unsigned long long if and + don't define. */ +#ifdef _WIN64 +#define uintmax_t unsigned __int64 +#else +#define uintmax_t unsigned __int32 +#endif + +#define __libc_lock_t gl_lock_t +#define __libc_lock_define gl_lock_define +#define __libc_lock_define_initialized gl_lock_define_initialized +#define __libc_lock_init gl_lock_init +#define __libc_lock_lock gl_lock_lock +#define __libc_lock_unlock gl_lock_unlock +#define __libc_lock_recursive_t gl_recursive_lock_t +#define __libc_lock_define_recursive gl_recursive_lock_define +#define __libc_lock_define_initialized_recursive gl_recursive_lock_define_initialized +#define __libc_lock_init_recursive gl_recursive_lock_init +#define __libc_lock_lock_recursive gl_recursive_lock_lock +#define __libc_lock_unlock_recursive gl_recursive_lock_unlock +#if 0 +#define glthread_in_use libintl_thread_in_use +#define glthread_lock_init libintl_lock_init +#define glthread_lock_lock libintl_lock_lock +#define glthread_lock_unlock libintl_lock_unlock +#define glthread_lock_destroy libintl_lock_destroy +#define glthread_rwlock_init libintl_rwlock_init +#define glthread_rwlock_rdlock libintl_rwlock_rdlock +#define glthread_rwlock_wrlock libintl_rwlock_wrlock +#define glthread_rwlock_unlock libintl_rwlock_unlock +#define glthread_rwlock_destroy libintl_rwlock_destroy +#define glthread_recursive_lock_init libintl_recursive_lock_init +#define glthread_recursive_lock_lock libintl_recursive_lock_lock +#define glthread_recursive_lock_unlock libintl_recursive_lock_unlock +#define glthread_recursive_lock_destroy libintl_recursive_lock_destroy +#define glthread_once libintl_once +#define glthread_once_call libintl_once_call +#define glthread_once_singlethreaded libintl_once_singlethreaded +#endif + + +/* On Windows, variables that may be in a DLL must be marked specially. */ +#if (defined _MSC_VER && defined _DLL) && !defined IN_RELOCWRAPPER +# define DLL_VARIABLE __declspec (dllimport) +#else +# define DLL_VARIABLE +#endif + +/* Extra OS/2 (emx+gcc) defines. */ +#ifdef __EMX__ +# include "intl/os2compat.h" +#endif + diff --git a/ports/gettext/libgnuintl.h b/ports/gettext/libgnuintl.h new file mode 100644 index 000000000..eac6c8c25 --- /dev/null +++ b/ports/gettext/libgnuintl.h @@ -0,0 +1,423 @@ +/* Message catalogs for internationalization. +Copyright (C) 1995-1997, 2000-2007 Free Software Foundation, Inc. + +This program is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2, or (at your option) +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +USA. */ + +#ifndef _LIBINTL_H +#define _LIBINTL_H 1 + +#ifdef BUILDING_LIBINTL +#define LIBINTL_DLL_EXPORTED __declspec(dllexport) +#else +#define LIBINTL_DLL_EXPORTED +#endif + +#include + +/* The LC_MESSAGES locale category is the category used by the functions +gettext() and dgettext(). It is specified in POSIX, but not in ANSI C. +On systems that don't define it, use an arbitrary value instead. +On Solaris, defines __LOCALE_H (or _LOCALE_H in Solaris 2.5) +then includes (i.e. this file!) and then only defines +LC_MESSAGES. To avoid a redefinition warning, don't define LC_MESSAGES +in this case. */ +#if !defined LC_MESSAGES && !(defined __LOCALE_H || (defined _LOCALE_H && defined __sun)) +# define LC_MESSAGES 1729 +#endif + +/* We define an additional symbol to signal that we use the GNU +implementation of gettext. */ +#define __USE_GNU_GETTEXT 1 + +/* Provide information about the supported file formats. Returns the +maximum minor revision number supported for a given major revision. */ +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) \ + ((major) == 0 || (major) == 1 ? 1 : -1) + +/* Resolve a platform specific conflict on DJGPP. GNU gettext takes +precedence over _conio_gettext. */ +#ifdef __DJGPP__ +# undef gettext +#endif + +#ifdef __cplusplus +extern "C" { +#endif + + + /* Version number: (major<<16) + (minor<<8) + subminor */ +#define LIBINTL_VERSION 0x001100 + extern LIBINTL_DLL_EXPORTED int libintl_version; + + + /* We redirect the functions to those prefixed with "libintl_". This is + necessary, because some systems define gettext/textdomain/... in the C + library (namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer). + If we used the unprefixed names, there would be cases where the + definition in the C library would override the one in the libintl.so + shared library. Recall that on ELF systems, the symbols are looked + up in the following order: + 1. in the executable, + 2. in the shared libraries specified on the link command line, in order, + 3. in the dependencies of the shared libraries specified on the link + command line, + 4. in the dlopen()ed shared libraries, in the order in which they were + dlopen()ed. + The definition in the C library would override the one in libintl.so if + either + * -lc is given on the link command line and -lintl isn't, or + * -lc is given on the link command line before -lintl, or + * libintl.so is a dependency of a dlopen()ed shared library but not + linked to the executable at link time. + Since Solaris gettext() behaves differently than GNU gettext(), this + would be unacceptable. + + The redirection happens by default through macros in C, so that &gettext + is independent of the compilation unit, but through inline functions in + C++, in order not to interfere with the name mangling of class fields or + class methods called 'gettext'. */ + + /* The user can define _INTL_REDIRECT_INLINE or _INTL_REDIRECT_MACROS. + If he doesn't, we choose the method. A third possible method is + _INTL_REDIRECT_ASM, supported only by GCC. */ +#if !(defined _INTL_REDIRECT_INLINE || defined _INTL_REDIRECT_MACROS) +# if __GNUC__ >= 2 && !(__APPLE_CC__ > 1) && !defined __MINGW32__ && !(__GNUC__ == 2 && defined _AIX) && (defined __STDC__ || defined __cplusplus) +# define _INTL_REDIRECT_ASM +# else +# ifdef __cplusplus +# define _INTL_REDIRECT_INLINE +# else +# define _INTL_REDIRECT_MACROS +# endif +# endif +#endif + /* Auxiliary macros. */ +#ifdef _INTL_REDIRECT_ASM +# define _INTL_ASM(cname) __asm__ (_INTL_ASMNAME (__USER_LABEL_PREFIX__, #cname)) +# define _INTL_ASMNAME(prefix,cnamestring) _INTL_STRINGIFY (prefix) cnamestring +# define _INTL_STRINGIFY(prefix) #prefix +#else +# define _INTL_ASM(cname) +#endif + + /* _INTL_MAY_RETURN_STRING_ARG(n) declares that the given function may return + its n-th argument literally. This enables GCC to warn for example about + printf (gettext ("foo %y")). */ +#if __GNUC__ >= 3 && !(__APPLE_CC__ > 1 && defined __cplusplus) +# define _INTL_MAY_RETURN_STRING_ARG(n) __attribute__ ((__format_arg__ (n))) +#else +# define _INTL_MAY_RETURN_STRING_ARG(n) +#endif + + /* Look up MSGID in the current default message catalog for the current + LC_MESSAGES locale. If not found, returns MSGID itself (the default + text). */ +#ifdef _INTL_REDIRECT_INLINE + extern LIBINTL_DLL_EXPORTED char *libintl_gettext(const char *__msgid) + _INTL_MAY_RETURN_STRING_ARG(1); + static inline char *gettext(const char *__msgid) + { + return libintl_gettext(__msgid); + } +#else +#ifdef _INTL_REDIRECT_MACROS +# define gettext libintl_gettext +#endif + extern LIBINTL_DLL_EXPORTED char *gettext(const char *__msgid) + _INTL_ASM(libintl_gettext) + _INTL_MAY_RETURN_STRING_ARG(1); +#endif + + /* Look up MSGID in the DOMAINNAME message catalog for the current + LC_MESSAGES locale. */ +#ifdef _INTL_REDIRECT_INLINE + extern LIBINTL_DLL_EXPORTED char *libintl_dgettext(const char *__domainname, const char *__msgid) + _INTL_MAY_RETURN_STRING_ARG(2); + static inline char *dgettext(const char *__domainname, const char *__msgid) + { + return libintl_dgettext(__domainname, __msgid); + } +#else +#ifdef _INTL_REDIRECT_MACROS +# define dgettext libintl_dgettext +#endif + extern LIBINTL_DLL_EXPORTED char *dgettext(const char *__domainname, const char *__msgid) + _INTL_ASM(libintl_dgettext) + _INTL_MAY_RETURN_STRING_ARG(2); +#endif + + /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY + locale. */ +#ifdef _INTL_REDIRECT_INLINE + extern LIBINTL_DLL_EXPORTED char *libintl_dcgettext(const char *__domainname, const char *__msgid, + int __category) + _INTL_MAY_RETURN_STRING_ARG(2); + static inline char *dcgettext(const char *__domainname, const char *__msgid, + int __category) + { + return libintl_dcgettext(__domainname, __msgid, __category); + } +#else +#ifdef _INTL_REDIRECT_MACROS +# define dcgettext libintl_dcgettext +#endif + extern LIBINTL_DLL_EXPORTED char *dcgettext(const char *__domainname, const char *__msgid, + int __category) + _INTL_ASM(libintl_dcgettext) + _INTL_MAY_RETURN_STRING_ARG(2); +#endif + + + /* Similar to `gettext' but select the plural form corresponding to the + number N. */ +#ifdef _INTL_REDIRECT_INLINE + extern LIBINTL_DLL_EXPORTED char *libintl_ngettext(const char *__msgid1, const char *__msgid2, + unsigned long int __n) + _INTL_MAY_RETURN_STRING_ARG(1) _INTL_MAY_RETURN_STRING_ARG(2); + static inline char *ngettext(const char *__msgid1, const char *__msgid2, + unsigned long int __n) + { + return libintl_ngettext(__msgid1, __msgid2, __n); + } +#else +#ifdef _INTL_REDIRECT_MACROS +# define ngettext libintl_ngettext +#endif + extern LIBINTL_DLL_EXPORTED char *ngettext(const char *__msgid1, const char *__msgid2, + unsigned long int __n) + _INTL_ASM(libintl_ngettext) + _INTL_MAY_RETURN_STRING_ARG(1) _INTL_MAY_RETURN_STRING_ARG(2); +#endif + + /* Similar to `dgettext' but select the plural form corresponding to the + number N. */ +#ifdef _INTL_REDIRECT_INLINE + extern LIBINTL_DLL_EXPORTED char *libintl_dngettext(const char *__domainname, const char *__msgid1, + const char *__msgid2, unsigned long int __n) + _INTL_MAY_RETURN_STRING_ARG(2) _INTL_MAY_RETURN_STRING_ARG(3); + static inline char *dngettext(const char *__domainname, const char *__msgid1, + const char *__msgid2, unsigned long int __n) + { + return libintl_dngettext(__domainname, __msgid1, __msgid2, __n); + } +#else +#ifdef _INTL_REDIRECT_MACROS +# define dngettext libintl_dngettext +#endif + extern LIBINTL_DLL_EXPORTED char *dngettext(const char *__domainname, + const char *__msgid1, const char *__msgid2, + unsigned long int __n) + _INTL_ASM(libintl_dngettext) + _INTL_MAY_RETURN_STRING_ARG(2) _INTL_MAY_RETURN_STRING_ARG(3); +#endif + + /* Similar to `dcgettext' but select the plural form corresponding to the + number N. */ +#ifdef _INTL_REDIRECT_INLINE + extern LIBINTL_DLL_EXPORTED char *libintl_dcngettext(const char *__domainname, + const char *__msgid1, const char *__msgid2, + unsigned long int __n, int __category) + _INTL_MAY_RETURN_STRING_ARG(2) _INTL_MAY_RETURN_STRING_ARG(3); + static inline char *dcngettext(const char *__domainname, + const char *__msgid1, const char *__msgid2, + unsigned long int __n, int __category) + { + return libintl_dcngettext(__domainname, __msgid1, __msgid2, __n, __category); + } +#else +#ifdef _INTL_REDIRECT_MACROS +# define dcngettext libintl_dcngettext +#endif + extern LIBINTL_DLL_EXPORTED char *dcngettext(const char *__domainname, + const char *__msgid1, const char *__msgid2, + unsigned long int __n, int __category) + _INTL_ASM(libintl_dcngettext) + _INTL_MAY_RETURN_STRING_ARG(2) _INTL_MAY_RETURN_STRING_ARG(3); +#endif + + + + /* Set the current default message catalog to DOMAINNAME. + If DOMAINNAME is null, return the current default. + If DOMAINNAME is "", reset to the default of "messages". */ +#ifdef _INTL_REDIRECT_INLINE + extern LIBINTL_DLL_EXPORTED char *libintl_textdomain(const char *__domainname); + static inline char *textdomain(const char *__domainname) + { + return libintl_textdomain(__domainname); + } +#else +#ifdef _INTL_REDIRECT_MACROS +# define textdomain libintl_textdomain +#endif + extern LIBINTL_DLL_EXPORTED char *textdomain(const char *__domainname) + _INTL_ASM(libintl_textdomain); +#endif + + /* Specify that the DOMAINNAME message catalog will be found + in DIRNAME rather than in the system locale data base. */ +#ifdef _INTL_REDIRECT_INLINE + extern LIBINTL_DLL_EXPORTED char *libintl_bindtextdomain(const char *__domainname, + const char *__dirname); + static inline char *bindtextdomain(const char *__domainname, + const char *__dirname) + { + return libintl_bindtextdomain(__domainname, __dirname); + } +#else +#ifdef _INTL_REDIRECT_MACROS +# define bindtextdomain libintl_bindtextdomain +#endif + extern LIBINTL_DLL_EXPORTED char *bindtextdomain(const char *__domainname, const char *__dirname) + _INTL_ASM(libintl_bindtextdomain); +#endif + + /* Specify the character encoding in which the messages from the + DOMAINNAME message catalog will be returned. */ +#ifdef _INTL_REDIRECT_INLINE + extern LIBINTL_DLL_EXPORTED char *libintl_bind_textdomain_codeset(const char *__domainname, + const char *__codeset); + static inline char *bind_textdomain_codeset(const char *__domainname, + const char *__codeset) + { + return libintl_bind_textdomain_codeset(__domainname, __codeset); + } +#else +#ifdef _INTL_REDIRECT_MACROS +# define bind_textdomain_codeset libintl_bind_textdomain_codeset +#endif + extern LIBINTL_DLL_EXPORTED char *bind_textdomain_codeset(const char *__domainname, + const char *__codeset) + _INTL_ASM(libintl_bind_textdomain_codeset); +#endif + + + + /* Support for format strings with positions in *printf(), following the + POSIX/XSI specification. + Note: These replacements for the *printf() functions are visible only + in source files that #include or #include "gettext.h". + Packages that use *printf() in source files that don't refer to _() + or gettext() but for which the format string could be the return value + of _() or gettext() need to add this #include. Oh well. */ + +#if !0 + +#include +#include + + /* Get va_list. */ +#if __STDC__ || defined __cplusplus || defined _MSC_VER +# include +#else +# include +#endif + +#undef fprintf +#define fprintf libintl_fprintf + extern LIBINTL_DLL_EXPORTED int fprintf(FILE *, const char *, ...); +#undef vfprintf +#define vfprintf libintl_vfprintf + extern LIBINTL_DLL_EXPORTED int vfprintf(FILE *, const char *, va_list); + +#undef printf +#if defined __NetBSD__ || defined __BEOS__ || defined __CYGWIN__ || defined __MINGW32__ + /* Don't break __attribute__((format(printf,M,N))). + This redefinition is only possible because the libc in NetBSD, Cygwin, + mingw does not have a function __printf__. */ +# define libintl_printf __printf__ +#endif +#define printf libintl_printf + extern LIBINTL_DLL_EXPORTED int printf(const char *, ...); +#undef vprintf +#define vprintf libintl_vprintf + extern LIBINTL_DLL_EXPORTED int vprintf(const char *, va_list); + +#undef sprintf +#define sprintf libintl_sprintf + extern LIBINTL_DLL_EXPORTED int sprintf(char *, const char *, ...); +#undef vsprintf +#define vsprintf libintl_vsprintf + extern LIBINTL_DLL_EXPORTED int vsprintf(char *, const char *, va_list); + +#if 0 + +#undef snprintf +#define snprintf libintl_snprintf + extern LIBINTL_DLL_EXPORTED int snprintf(char *, size_t, const char *, ...); +#undef vsnprintf +#define vsnprintf libintl_vsnprintf + extern LIBINTL_DLL_EXPORTED int vsnprintf(char *, size_t, const char *, va_list); + +#endif + +#if 0 + +#undef asprintf +#define asprintf libintl_asprintf + extern LIBINTL_DLL_EXPORTED int asprintf(char **, const char *, ...); +#undef vasprintf +#define vasprintf libintl_vasprintf + extern LIBINTL_DLL_EXPORTED int vasprintf(char **, const char *, va_list); + +#endif + +#if 0 + +#undef fwprintf +#define fwprintf libintl_fwprintf + extern LIBINTL_DLL_EXPORTED int fwprintf(FILE *, const wchar_t *, ...); +#undef vfwprintf +#define vfwprintf libintl_vfwprintf + extern LIBINTL_DLL_EXPORTED int vfwprintf(FILE *, const wchar_t *, va_list); + +#undef wprintf +#define wprintf libintl_wprintf + extern LIBINTL_DLL_EXPORTED int wprintf(const wchar_t *, ...); +#undef vwprintf +#define vwprintf libintl_vwprintf + extern LIBINTL_DLL_EXPORTED int vwprintf(const wchar_t *, va_list); + +#undef swprintf +#define swprintf libintl_swprintf + extern LIBINTL_DLL_EXPORTED int swprintf(wchar_t *, size_t, const wchar_t *, ...); +#undef vswprintf +#define vswprintf libintl_vswprintf + extern LIBINTL_DLL_EXPORTED int vswprintf(wchar_t *, size_t, const wchar_t *, va_list); + +#endif + +#endif + + + /* Support for relocatable packages. */ + + /* Sets the original and the current installation prefix of the package. + Relocation simply replaces a pathname starting with the original prefix + by the corresponding pathname with the current prefix instead. Both + prefixes should be directory names without trailing slash (i.e. use "" + instead of "/"). */ +#define libintl_set_relocation_prefix libintl_set_relocation_prefix + extern LIBINTL_DLL_EXPORTED void + libintl_set_relocation_prefix(const char *orig_prefix, + const char *curr_prefix); + + +#ifdef __cplusplus +} +#endif + +#endif /* libintl.h */ \ No newline at end of file diff --git a/ports/gettext/portfile.cmake b/ports/gettext/portfile.cmake new file mode 100644 index 000000000..778086b75 --- /dev/null +++ b/ports/gettext/portfile.cmake @@ -0,0 +1,43 @@ +# 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} +# + +#Based on https://github.com/winlibs/gettext + +include(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/gettext-0.19) +vcpkg_download_distfile(ARCHIVE + URLS "http://ftp.gnu.org/pub/gnu/gettext/gettext-0.19.tar.gz" + FILENAME "gettext-0.19.tar.gz" + SHA512 a5db035c582ff49d45ee6eab9466b2bef918e413a882019c204a9d8903cb3770ddfecd32c971ea7c7b037c7b69476cf7c56dcabc8b498b94ab99f132516c9922 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_libintl.txt DESTINATION ${SOURCE_PATH}/gettext-runtime) +file(RENAME ${SOURCE_PATH}/gettext-runtime/CMakeLists_libintl.txt ${SOURCE_PATH}/gettext-runtime/CMakeLists.txt) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/libgnuintl.h DESTINATION ${SOURCE_PATH}/gettext-runtime/intl) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/config.h DESTINATION ${SOURCE_PATH}/gettext-runtime) + +vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ + PATCHES "${CMAKE_CURRENT_LIST_DIR}/0001-Fix-macro-definitions.patch" +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} +) + +vcpkg_install_cmake() + +file(COPY ${SOURCE_PATH}/gettext-runtime/intl/libgnuintl.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) +file(RENAME ${CURRENT_PACKAGES_DIR}/include/libgnuintl.h ${CURRENT_PACKAGES_DIR}/include/libintl.h) + +# Handle copyright +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/gettext) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/gettext/COPYING ${CURRENT_PACKAGES_DIR}/share/gettext/copyright) -- cgit v1.2.3 From 2fee22e19eacee21bf6bbea7961f94a244f9ec1a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 2 Nov 2016 11:05:59 -0700 Subject: [gettext] Add call to vcpkg_copy_pdbs() --- ports/gettext/portfile.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/gettext/portfile.cmake b/ports/gettext/portfile.cmake index 778086b75..1da88b0e9 100644 --- a/ports/gettext/portfile.cmake +++ b/ports/gettext/portfile.cmake @@ -41,3 +41,5 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/include/libgnuintl.h ${CURRENT_PACKAGES_DIR} # Handle copyright file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/gettext) file(RENAME ${CURRENT_PACKAGES_DIR}/share/gettext/COPYING ${CURRENT_PACKAGES_DIR}/share/gettext/copyright) + +vcpkg_copy_pdbs() \ No newline at end of file -- cgit v1.2.3 From d962ccfac468aa04bfcbca5ad923b84c53c2d916 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 2 Nov 2016 12:59:08 -0700 Subject: [libraw] Update commit to the latest that has cmake module redirection --- ports/libraw/portfile.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/libraw/portfile.cmake b/ports/libraw/portfile.cmake index 997a92353..18bb5f590 100644 --- a/ports/libraw/portfile.cmake +++ b/ports/libraw/portfile.cmake @@ -6,12 +6,12 @@ vcpkg_download_distfile(ARCHIVE FILENAME "LibRaw-0.17.2" SHA512 97d34c84dafdcad300d607fbd4df7b120aea1ecdbc2783a8616bc423fa6a7a15adfbeb975f8dab021be09d08ef466c401a3b65bfd1abcfa49d31d4ab91873e60 ) -set(LIBRAW_CMAKE_COMMIT "ffebb680e7457dad27fb74b5a52d6d2960121303") +set(LIBRAW_CMAKE_COMMIT "a71f3b83ee3dccd7be32f9a2f410df4d9bdbde0a") set(LIBRAW_CMAKE_SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/LibRaw-cmake-${LIBRAW_CMAKE_COMMIT}) vcpkg_download_distfile(CMAKE_BUILD_ARCHIVE URLS "https://github.com/LibRaw/LibRaw-cmake/archive/${LIBRAW_CMAKE_COMMIT}.zip" FILENAME "LibRaw-cmake-${LIBRAW_CMAKE_COMMIT}" - SHA512 5f4ce4aa9da7d27c19466882a1e118e7890db767d46765efb80d97a1f2817315864d063dd4316b12f9363a64434e2b7af5a7ef804313f5c6ca23d50d6c1a75aa + SHA512 54216e6760e2339dc3bf4b4be533a13160047cabfc033a06da31f2226c43fc93eaea9672af83589e346ce9231c1a57910ac5e800759e692fe2cd9d53b7fba0c6 ) vcpkg_extract_source_archive(${ARCHIVE}) -- cgit v1.2.3 From 53cfd70b1e23964bbdf2bee66f8a6ace7e3fee6d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 2 Nov 2016 13:16:34 -0700 Subject: [libraw] Redirect FindLibRaw.cmake to the share/libraw folder --- ports/libraw/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/libraw/portfile.cmake b/ports/libraw/portfile.cmake index 18bb5f590..4d5621285 100644 --- a/ports/libraw/portfile.cmake +++ b/ports/libraw/portfile.cmake @@ -23,10 +23,14 @@ file(COPY ${LIBRAW_CMAKE_SOURCE_PATH}/cmake DESTINATION ${SOURCE_PATH}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DINSTALL_CMAKE_MODULE_PATH=${SOURCE_PATH} ) vcpkg_install_cmake() +file(COPY ${SOURCE_PATH}/FindLibRaw.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/libraw/cmake/FindLibRaw.cmake) + # Cleanup file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(GLOB RELEASE_EXECUTABLES ${CURRENT_PACKAGES_DIR}/bin/*.exe) -- cgit v1.2.3 From 9246a0aa7afe04d119dbcf340c4e5158a61c5733 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 2 Nov 2016 13:22:10 -0700 Subject: [libraw] Remove bin folders in static build --- ports/libraw/portfile.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/libraw/portfile.cmake b/ports/libraw/portfile.cmake index 4d5621285..284b440e6 100644 --- a/ports/libraw/portfile.cmake +++ b/ports/libraw/portfile.cmake @@ -37,6 +37,9 @@ file(GLOB RELEASE_EXECUTABLES ${CURRENT_PACKAGES_DIR}/bin/*.exe) file(REMOVE ${RELEASE_EXECUTABLES}) file(GLOB DEBUG_EXECUTABLES ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe) file(REMOVE ${DEBUG_EXECUTABLES}) +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) +endif() # Handle copyright file(COPY ${SOURCE_PATH}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/libraw) -- cgit v1.2.3 From 4bf461c9cd136df6aa12a02d7f6ec09b91f8acb7 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 2 Nov 2016 14:38:16 -0700 Subject: [post-build-checks] Add check for bin folders in static builds --- toolsrc/src/post_build_lint.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index c9b36a0fb..40ddef3bb 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -433,6 +433,37 @@ namespace vcpkg return lint_status::SUCCESS; } + static lint_status check_bin_folders_are_not_present_in_static_build(const package_spec& spec, const vcpkg_paths& paths) + { + const fs::path bin = paths.packages / spec.dir() / "bin"; + const fs::path debug_bin = paths.packages / spec.dir() / "debug" / "bin"; + + if (!fs::exists(bin) && !fs::exists(debug_bin)) + { + return lint_status::SUCCESS; + } + + if (fs::exists(bin)) + { + System::println(System::color::warning, R"(There should be no bin\ directory in a static build, but %s is present.)", bin.generic_string()); + } + + if (fs::exists(debug_bin)) + { + System::println(System::color::warning, R"(There should be no debug\bin\ directory in a static build, but %s is present.)", debug_bin.generic_string()); + } + + System::println(System::color::warning, R"(If the creation of bin\ and/or debug\bin\ cannot be disabled, use this in the portfile to remove them)" "\n" + "\n" + R"###( if(VCPKG_LIBRARY_LINKAGE STREQUAL static))###""\n" + R"###( file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin))###""\n" + R"###( endif())###" + "\n" + ); + + return lint_status::ERROR_DETECTED; + } + static void operator +=(size_t& left, const lint_status& right) { left += static_cast(right); @@ -477,6 +508,7 @@ namespace vcpkg recursive_find_files_with_extension_in_dir(paths.packages / spec.dir(), ".dll", &dlls); error_count += check_no_dlls_present(dlls); + error_count += check_bin_folders_are_not_present_in_static_build(spec, paths); break; } -- cgit v1.2.3 From e695f92dec6177ea28554638deb294aa0be2d2e6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 2 Nov 2016 14:57:50 -0700 Subject: [post-build-checks] Add check for empty directories --- toolsrc/src/post_build_lint.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index 40ddef3bb..8301e74cc 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -464,6 +464,29 @@ namespace vcpkg return lint_status::ERROR_DETECTED; } + static lint_status check_no_empty_folders(const fs::path& dir) + { + const std::vector empty_directories = recursive_find_matching_paths_in_dir(dir, [](const fs::path& current) + { + return fs::is_directory(current) && fs::is_empty(current); + }); + + if (!empty_directories.empty()) + { + System::println(System::color::warning, "There should be no empty directories in %s", dir.generic_string()); + System::println("The following empty directories were found: "); + print_vector_of_files(empty_directories); + System::println(System::color::warning, "If a directory should be populated but is not, this might indicate an error in the portfile.\n" + "If the directories are not needed and their creation cannot be disabled, use something like this in the portfile to remove them)\n" + "\n" + R"###( file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/a/dir ${CURRENT_PACKAGES_DIR}/some/other/dir))###""\n" + "\n"); + return lint_status::ERROR_DETECTED; + } + + return lint_status::SUCCESS; + } + static void operator +=(size_t& left, const lint_status& right) { left += static_cast(right); @@ -530,6 +553,8 @@ namespace vcpkg error_count += check_lib_architecture(spec.target_triplet().architecture(), libs); + error_count += check_no_empty_folders(paths.packages / spec.dir()); + if (error_count != 0) { const fs::path portfile = paths.ports / spec.name() / "portfile.cmake"; -- cgit v1.2.3 From 05369e9e26bf08754fe3c22e6469983231470567 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 2 Nov 2016 15:01:26 -0700 Subject: [protobuf] Remove empty directories --- ports/protobuf/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/protobuf/portfile.cmake b/ports/protobuf/portfile.cmake index ee273b787..fa7748381 100644 --- a/ports/protobuf/portfile.cmake +++ b/ports/protobuf/portfile.cmake @@ -40,6 +40,7 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/protoc.exe) file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/protoc.exe) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) file(INSTALL ${CURRENT_BUILDTREES_DIR}/src/protobuf-3.0.2/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/protobuf RENAME copyright) file(INSTALL ${CURRENT_BUILDTREES_DIR}/src/protobuf-3.0.2-win32/bin/protoc.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools) -- cgit v1.2.3 From ca79ebf498a841fec0f8da8e29ff04e0cf5f043a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 2 Nov 2016 15:17:28 -0700 Subject: [fmt] Remove empty directories --- ports/fmt/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/fmt/portfile.cmake b/ports/fmt/portfile.cmake index a265da175..26465b6b2 100644 --- a/ports/fmt/portfile.cmake +++ b/ports/fmt/portfile.cmake @@ -31,5 +31,6 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake/fmt/fmt-targets.cmake ${CURRENT_PA file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/cmake) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/cmake/fmt/fmt-targets.cmake ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/cmake) vcpkg_copy_pdbs() -- cgit v1.2.3 From 9b603bd884934a5d0882109378672ecc34ec1b02 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 2 Nov 2016 15:23:44 -0700 Subject: [libmysql] Do not create empty directory --- ports/libmysql/portfile.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/libmysql/portfile.cmake b/ports/libmysql/portfile.cmake index dd85e104d..9c2aafdc1 100644 --- a/ports/libmysql/portfile.cmake +++ b/ports/libmysql/portfile.cmake @@ -42,7 +42,6 @@ file(REMOVE_RECURSE file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share - ${CURRENT_PACKAGES_DIR}/debug/share ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) -- cgit v1.2.3 From f25c8c8da58648df46ca569aefcffd825d594298 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 2 Nov 2016 16:25:40 -0700 Subject: [tiff] Remove bin directories in static builds --- ports/tiff/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/tiff/portfile.cmake b/ports/tiff/portfile.cmake index 5a546967a..2266cfe35 100644 --- a/ports/tiff/portfile.cmake +++ b/ports/tiff/portfile.cmake @@ -34,4 +34,8 @@ file(RENAME ) file(GLOB EXES ${CURRENT_PACKAGES_DIR}/bin/*.exe ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe) file(REMOVE ${EXES}) +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) +endif() + vcpkg_copy_pdbs() -- cgit v1.2.3 From 70fe3d15be2d68b46c5d58aacf488d859895a589 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 2 Nov 2016 16:38:39 -0700 Subject: [openjpeg] Remove bin directories in static builds --- ports/openjpeg/portfile.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ports/openjpeg/portfile.cmake b/ports/openjpeg/portfile.cmake index 718ca6ca1..9ce215bbc 100644 --- a/ports/openjpeg/portfile.cmake +++ b/ports/openjpeg/portfile.cmake @@ -24,6 +24,11 @@ string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" OPENJPEG_DEBUG_MO file(WRITE ${CURRENT_PACKAGES_DIR}/share/openjpeg/OpenJPEGTargets-debug.cmake "${OPENJPEG_DEBUG_MODULE}") file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +# Cleanup bin directories in static builds +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) +endif() + # Cleanup Visual C++ Redistributable runtime file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/msvcp140.dll) file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/vcruntime140.dll) -- cgit v1.2.3 From d7ff71610b5eed96c86374ad0fb41857a49839cb Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 2 Nov 2016 16:49:15 -0700 Subject: [vcpkg-apply-patches] Correct issue with src directories which contain a config\ folder. Reduce verbosity of output. --- scripts/cmake/vcpkg_apply_patches.cmake | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/scripts/cmake/vcpkg_apply_patches.cmake b/scripts/cmake/vcpkg_apply_patches.cmake index 2ebf4266e..cd3026b6a 100644 --- a/scripts/cmake/vcpkg_apply_patches.cmake +++ b/scripts/cmake/vcpkg_apply_patches.cmake @@ -7,19 +7,15 @@ function(vcpkg_apply_patches) message(STATUS "Applying patch ${PATCH}") set(LOGNAME patch-${TARGET_TRIPLET}-${PATCHNUM}) execute_process( - COMMAND ${GIT} --work-tree=. --git-dir=. apply "${PATCH}" --ignore-whitespace --whitespace=nowarn --verbose + COMMAND ${GIT} --work-tree=. --git-dir=.git apply "${PATCH}" --ignore-whitespace --whitespace=nowarn --verbose OUTPUT_FILE ${CURRENT_BUILDTREES_DIR}/${LOGNAME}-out.log ERROR_FILE ${CURRENT_BUILDTREES_DIR}/${LOGNAME}-err.log WORKING_DIRECTORY ${_ap_SOURCE_PATH} RESULT_VARIABLE error_code ) - + if(error_code) - message(STATUS - "Applying patch failed: ${GIT} --work-tree=. --git-dir=. apply \"${PATCH}\" --ignore-whitespace --whitespace=nowarn --verbose\n" - "-- Working Directory: ${_ap_SOURCE_PATH}\n" - "-- This is expected if this patch was previously applied.\n" - "-- See logs for more information: ${CURRENT_BUILDTREES_DIR}/${LOGNAME}-out.log ${CURRENT_BUILDTREES_DIR}/${LOGNAME}-err.log") + message(STATUS "Applying patch failed. This is expected if this patch was previously applied.") endif() message(STATUS "Applying patch ${PATCH} done") -- cgit v1.2.3 From ce890f979945183f5a52663d869a9c7ee1e1bb01 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 2 Nov 2016 17:47:25 -0700 Subject: check_exit() instead of check_throw() --- toolsrc/src/vcpkglib_helpers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/vcpkglib_helpers.cpp b/toolsrc/src/vcpkglib_helpers.cpp index 3aa3735b0..04fdf214e 100644 --- a/toolsrc/src/vcpkglib_helpers.cpp +++ b/toolsrc/src/vcpkglib_helpers.cpp @@ -18,7 +18,7 @@ namespace vcpkg {namespace details std::string required_field(const std::unordered_map& fields, const std::string& fieldname) { auto it = fields.find(fieldname); - vcpkg::Checks::check_throw(it != fields.end(), "Required field not present: %s", fieldname); + vcpkg::Checks::check_exit(it != fields.end(), "Required field not present: %s", fieldname); return it->second; }; -- cgit v1.2.3 From 1fa055569540d887ceca0daadca7d0160b886089 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 2 Nov 2016 19:30:53 -0700 Subject: [building] Parse SourceParagraph at the start of the build --- toolsrc/src/commands_installation.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_installation.cpp index 7e7da9e3f..c728c41dc 100644 --- a/toolsrc/src/commands_installation.cpp +++ b/toolsrc/src/commands_installation.cpp @@ -11,17 +11,19 @@ namespace vcpkg { - static void create_binary_control_file(const vcpkg_paths& paths, const fs::path& port_dir, const triplet& target_triplet) + static void create_binary_control_file(const vcpkg_paths& paths, const SourceParagraph& source_paragraph, const triplet& target_triplet) { - auto pghs = get_paragraphs(port_dir / "CONTROL"); - Checks::check_exit(pghs.size() == 1, "Error: invalid control file"); - auto bpgh = BinaryParagraph(SourceParagraph(pghs[0]), target_triplet); + auto 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 package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir) { + auto pghs = get_paragraphs(port_dir / "CONTROL"); + Checks::check_exit(pghs.size() == 1, "Error: invalid control file"); + SourceParagraph source_paragraph(pghs[0]); + const fs::path ports_cmake_script_path = paths.ports_cmake; auto&& target_triplet = spec.target_triplet(); 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")", @@ -54,7 +56,7 @@ namespace vcpkg perform_all_checks(spec, paths); - create_binary_control_file(paths, port_dir, target_triplet); + create_binary_control_file(paths, source_paragraph, target_triplet); // const fs::path port_buildtrees_dir = paths.buildtrees / spec.name; // delete_directory(port_buildtrees_dir); -- cgit v1.2.3 From 8a97f05d92a34589e1cf87865d0e0b5394ac05b3 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 2 Nov 2016 19:33:11 -0700 Subject: [Maps] Add function extract_keys() --- toolsrc/include/vcpkg_Maps.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/toolsrc/include/vcpkg_Maps.h b/toolsrc/include/vcpkg_Maps.h index 5b7b8ed46..886889294 100644 --- a/toolsrc/include/vcpkg_Maps.h +++ b/toolsrc/include/vcpkg_Maps.h @@ -15,4 +15,15 @@ namespace vcpkg { namespace Maps } return key_set; } + + template + std::vector extract_keys(const std::unordered_map& input_map) + { + std::vector key_set; + for (auto const& element : input_map) + { + key_set.push_back(element.first); + } + return key_set; + } }} -- cgit v1.2.3 From 87a78a78dcb88d1656eda5dcbdf306fb55eba575 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 2 Nov 2016 19:34:30 -0700 Subject: [Strings] Add join() --- toolsrc/include/vcpkg_Strings.h | 3 +++ toolsrc/src/vcpkg_Strings.cpp | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/toolsrc/include/vcpkg_Strings.h b/toolsrc/include/vcpkg_Strings.h index 70526198c..d55a01224 100644 --- a/toolsrc/include/vcpkg_Strings.h +++ b/toolsrc/include/vcpkg_Strings.h @@ -1,6 +1,7 @@ #pragma once #include +#include namespace vcpkg {namespace Strings {namespace details { @@ -67,4 +68,6 @@ namespace vcpkg {namespace Strings std::string::const_iterator case_insensitive_ascii_find(const std::string& s, const std::string& pattern); std::string ascii_to_lowercase(const std::string& input); + + std::string join(const std::vector& v, const std::string& delimiter); }} diff --git a/toolsrc/src/vcpkg_Strings.cpp b/toolsrc/src/vcpkg_Strings.cpp index 56eeae7a0..c53cba1fc 100644 --- a/toolsrc/src/vcpkg_Strings.cpp +++ b/toolsrc/src/vcpkg_Strings.cpp @@ -64,4 +64,25 @@ namespace vcpkg {namespace Strings std::transform(output.begin(), output.end(), output.begin(), ::tolower); return output; } + + std::string join(const std::vector& v, const std::string& delimiter) + { + if (v.empty()) + { + return std::string(); + } + + std::string output; + size_t size = v.size(); + + output.append(v.at(0)); + + for (int i = 1; i < size; ++i) + { + output.append(delimiter); + output.append(v.at(i)); + } + + return output; + } }} -- cgit v1.2.3 From 079a027b1e81becd4ba448362579f625dd7bcca4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 2 Nov 2016 19:39:45 -0700 Subject: parse_depends() now handles empty case internally --- toolsrc/src/BinaryParagraph.cpp | 6 +----- toolsrc/src/SourceParagraph.cpp | 6 +----- toolsrc/src/vcpkglib_helpers.cpp | 5 +++++ 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/toolsrc/src/BinaryParagraph.cpp b/toolsrc/src/BinaryParagraph.cpp index 48d04f686..61c74fcf5 100644 --- a/toolsrc/src/BinaryParagraph.cpp +++ b/toolsrc/src/BinaryParagraph.cpp @@ -23,11 +23,7 @@ namespace vcpkg } std::string deps = optional_field(fields, "Depends"); - if (!deps.empty()) - { - this->depends.clear(); - this->depends = parse_depends(deps); - } + this->depends = parse_depends(deps); } BinaryParagraph::BinaryParagraph(const SourceParagraph& spgh, const triplet& target_triplet) diff --git a/toolsrc/src/SourceParagraph.cpp b/toolsrc/src/SourceParagraph.cpp index 374121ae9..75c8ebfef 100644 --- a/toolsrc/src/SourceParagraph.cpp +++ b/toolsrc/src/SourceParagraph.cpp @@ -12,9 +12,5 @@ vcpkg::SourceParagraph::SourceParagraph(const std::unordered_mapdepends.clear(); - this->depends = parse_depends(deps); - }; + this->depends = parse_depends(deps); } diff --git a/toolsrc/src/vcpkglib_helpers.cpp b/toolsrc/src/vcpkglib_helpers.cpp index 04fdf214e..02182b995 100644 --- a/toolsrc/src/vcpkglib_helpers.cpp +++ b/toolsrc/src/vcpkglib_helpers.cpp @@ -24,6 +24,11 @@ namespace vcpkg {namespace details std::vector parse_depends(const std::string& depends_string) { + if (depends_string.empty()) + { + return {}; + } + std::vector out; size_t cur = 0; -- cgit v1.2.3 From 4665b16ab3556235ddcbdac160df261ee87694e4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 2 Nov 2016 20:26:52 -0700 Subject: Add checks for fields in CONTROL file. Resolves #228 --- toolsrc/include/SourceParagraph.h | 5 +++- toolsrc/include/vcpkglib_helpers.h | 2 ++ toolsrc/src/SourceParagraph.cpp | 54 ++++++++++++++++++++++++++++------- toolsrc/src/commands_installation.cpp | 15 ++++++++++ toolsrc/src/vcpkglib_helpers.cpp | 29 +++++++++++++++++-- 5 files changed, 91 insertions(+), 14 deletions(-) diff --git a/toolsrc/include/SourceParagraph.h b/toolsrc/include/SourceParagraph.h index 72dca8324..a8ad13668 100644 --- a/toolsrc/include/SourceParagraph.h +++ b/toolsrc/include/SourceParagraph.h @@ -7,14 +7,17 @@ namespace vcpkg { struct SourceParagraph { + static const std::vector& get_list_of_valid_entries(); + SourceParagraph(); - explicit SourceParagraph(const std::unordered_map& fields); + explicit SourceParagraph(std::unordered_map fields); std::string name; std::string version; std::string description; std::string maintainer; std::vector depends; + std::unordered_map unparsed_fields; }; } diff --git a/toolsrc/include/vcpkglib_helpers.h b/toolsrc/include/vcpkglib_helpers.h index 72711d63b..05c9e17df 100644 --- a/toolsrc/include/vcpkglib_helpers.h +++ b/toolsrc/include/vcpkglib_helpers.h @@ -5,8 +5,10 @@ namespace vcpkg {namespace details { std::string optional_field(const std::unordered_map& fields, const std::string& fieldname); + std::string remove_optional_field(std::unordered_map* fields, const std::string& fieldname); std::string required_field(const std::unordered_map& fields, const std::string& fieldname); + std::string remove_required_field(std::unordered_map* fields, const std::string& fieldname); std::vector parse_depends(const std::string& depends_string); }} diff --git a/toolsrc/src/SourceParagraph.cpp b/toolsrc/src/SourceParagraph.cpp index 75c8ebfef..c870bde21 100644 --- a/toolsrc/src/SourceParagraph.cpp +++ b/toolsrc/src/SourceParagraph.cpp @@ -1,16 +1,50 @@ #include "SourceParagraph.h" #include "vcpkglib_helpers.h" -using namespace vcpkg::details; +namespace vcpkg +{ + // + namespace SourceParagraphRequiredField + { + static const std::string SOURCE = "Source"; + static const std::string VERSION = "Version"; + } -vcpkg::SourceParagraph::SourceParagraph() = default; + namespace SourceParagraphOptionalEntry + { + static const std::string DESCRIPTION = "Description"; + static const std::string MAINTAINER = "Maintainer"; + static const std::string BUILD_DEPENDS = "Build-Depends"; + } -vcpkg::SourceParagraph::SourceParagraph(const std::unordered_map& fields): - name(required_field(fields, "Source")), - version(required_field(fields, "Version")), - description(optional_field(fields, "Description")), - maintainer(optional_field(fields, "Maintainer")) -{ - std::string deps = optional_field(fields, "Build-Depends"); - this->depends = parse_depends(deps); + const std::vector& SourceParagraph::get_list_of_valid_entries() + { + static const std::vector valid_enties = + { + SourceParagraphRequiredField::SOURCE, + SourceParagraphRequiredField::VERSION, + + SourceParagraphOptionalEntry::DESCRIPTION, + SourceParagraphOptionalEntry::MAINTAINER, + SourceParagraphOptionalEntry::BUILD_DEPENDS + }; + + return valid_enties; + } + + SourceParagraph::SourceParagraph() = default; + + SourceParagraph::SourceParagraph(std::unordered_map fields) + { + using namespace vcpkg::details; + this->name = remove_required_field(&fields, SourceParagraphRequiredField::SOURCE); + this->version = remove_required_field(&fields, SourceParagraphRequiredField::VERSION); + this->description = remove_optional_field(&fields, SourceParagraphOptionalEntry::DESCRIPTION); + this->maintainer = remove_optional_field(&fields, SourceParagraphOptionalEntry::MAINTAINER); + + std::string deps = remove_optional_field(&fields, SourceParagraphOptionalEntry::BUILD_DEPENDS); + this->depends = parse_depends(deps); + + this->unparsed_fields = std::move(fields); + } } diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_installation.cpp index c728c41dc..914168092 100644 --- a/toolsrc/src/commands_installation.cpp +++ b/toolsrc/src/commands_installation.cpp @@ -8,6 +8,7 @@ #include "vcpkg_System.h" #include "vcpkg_Dependencies.h" #include "vcpkg_Input.h" +#include "vcpkg_Maps.h" namespace vcpkg { @@ -24,6 +25,20 @@ namespace vcpkg Checks::check_exit(pghs.size() == 1, "Error: invalid control file"); SourceParagraph source_paragraph(pghs[0]); + if (!source_paragraph.unparsed_fields.empty()) + { + const std::vector remaining_keys = Maps::extract_keys(source_paragraph.unparsed_fields); + const std::vector& valid_entries = SourceParagraph::get_list_of_valid_entries(); + + const std::string remaining_keys_as_string = Strings::join(remaining_keys, "\n "); + const std::string valid_keys_as_string = Strings::join(valid_entries, "\n "); + + System::println(System::color::error, "Error: There are invalid fields in the port file"); + System::println("The following fields were not expected in the port file:\n\n %s\n\n", remaining_keys_as_string); + System::println("This is the list of valid fields (case-sensitive): \n\n %s\n", valid_keys_as_string); + exit(EXIT_FAILURE); + } + const fs::path ports_cmake_script_path = paths.ports_cmake; auto&& target_triplet = spec.target_triplet(); 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")", diff --git a/toolsrc/src/vcpkglib_helpers.cpp b/toolsrc/src/vcpkglib_helpers.cpp index 02182b995..3d14d4b06 100644 --- a/toolsrc/src/vcpkglib_helpers.cpp +++ b/toolsrc/src/vcpkglib_helpers.cpp @@ -13,14 +13,37 @@ namespace vcpkg {namespace details } return it->second; - }; + } + + std::string remove_optional_field(std::unordered_map* fields, const std::string& fieldname) + { + auto it = fields->find(fieldname); + if (it == fields->end()) + { + return std::string(); + } + + const std::string value = std::move(it->second); + fields->erase(it); + return value; + } std::string required_field(const std::unordered_map& fields, const std::string& fieldname) { auto it = fields.find(fieldname); - vcpkg::Checks::check_exit(it != fields.end(), "Required field not present: %s", fieldname); + Checks::check_exit(it != fields.end(), "Required field not present: %s", fieldname); return it->second; - }; + } + + std::string remove_required_field(std::unordered_map* fields, const std::string& fieldname) + { + auto it = fields->find(fieldname); + Checks::check_exit(it != fields->end(), "Required field not present: %s", fieldname); + + const std::string value = std::move(it->second); + fields->erase(it); + return value; + } std::vector parse_depends(const std::string& depends_string) { -- cgit v1.2.3 From a868bc96da158f3b2dcbc9e8e406b9577a8a1ab0 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 2 Nov 2016 20:57:19 -0700 Subject: Add port name to the output message --- toolsrc/src/commands_installation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_installation.cpp index 914168092..67623b855 100644 --- a/toolsrc/src/commands_installation.cpp +++ b/toolsrc/src/commands_installation.cpp @@ -33,7 +33,7 @@ namespace vcpkg const std::string remaining_keys_as_string = Strings::join(remaining_keys, "\n "); const std::string valid_keys_as_string = Strings::join(valid_entries, "\n "); - System::println(System::color::error, "Error: There are invalid fields in the port file"); + System::println(System::color::error, "Error: There are invalid fields in port file %s", port_dir.generic_string()); System::println("The following fields were not expected in the port file:\n\n %s\n\n", remaining_keys_as_string); System::println("This is the list of valid fields (case-sensitive): \n\n %s\n", valid_keys_as_string); exit(EXIT_FAILURE); -- cgit v1.2.3 From 56a30ed4bc551aae29748d0aeae818bb78e1b522 Mon Sep 17 00:00:00 2001 From: Bert Huijben Date: Thu, 3 Nov 2016 14:00:49 +0100 Subject: Add APR port --- ports/apr/CONTROL | 3 +++ ports/apr/portfile.cmake | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 ports/apr/CONTROL create mode 100644 ports/apr/portfile.cmake diff --git a/ports/apr/CONTROL b/ports/apr/CONTROL new file mode 100644 index 000000000..067f5cb1d --- /dev/null +++ b/ports/apr/CONTROL @@ -0,0 +1,3 @@ +Source: apr +Version: 1.5.2 +Description: The Apache Portable Runtime (APR) is a C library that forms a system portability layer that covers many operating systems. diff --git a/ports/apr/portfile.cmake b/ports/apr/portfile.cmake new file mode 100644 index 000000000..a32848f28 --- /dev/null +++ b/ports/apr/portfile.cmake @@ -0,0 +1,34 @@ +# 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(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/apr-1.5.2) +vcpkg_download_distfile(ARCHIVE + URLS "https://www.apache.org/dist/apr/apr-1.5.2.tar.bz2" + FILENAME "apr-1.5.2.tar.bz2" + SHA512 d1156ad16abf07887797777b56c2147c890f16d8445829b3e3b4917950d24c5fd2f8febd439992467a5ea0511da562c0fb4a7cfd8a235ab55882388bfa2b919d +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS -DINSTALL_PDB=OFF -DMIN_WINDOWS_VER=Windows7 -DAPR_HAVE_IPV6=ON + # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 + # OPTIONS_RELEASE -DOPTIMIZE=1 + # OPTIONS_DEBUG -DDEBUGGABLE=1 +) + +vcpkg_install_cmake() + +# There is no way to suppress installation of the headers and resource files in build. +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/apr) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/apr/LICENSE ${CURRENT_PACKAGES_DIR}/share/apr/copyright) -- cgit v1.2.3 From 3998871e541e3980db55d109dea3e35c81a0fd87 Mon Sep 17 00:00:00 2001 From: Bert Huijben Date: Thu, 3 Nov 2016 14:06:02 +0100 Subject: Fix line-endings in files and minor comment update. --- ports/apr/portfile.cmake | 68 ++++++++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/ports/apr/portfile.cmake b/ports/apr/portfile.cmake index a32848f28..ae505cc4e 100644 --- a/ports/apr/portfile.cmake +++ b/ports/apr/portfile.cmake @@ -1,34 +1,34 @@ -# 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(${CMAKE_TRIPLET_FILE}) -include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/apr-1.5.2) -vcpkg_download_distfile(ARCHIVE - URLS "https://www.apache.org/dist/apr/apr-1.5.2.tar.bz2" - FILENAME "apr-1.5.2.tar.bz2" - SHA512 d1156ad16abf07887797777b56c2147c890f16d8445829b3e3b4917950d24c5fd2f8febd439992467a5ea0511da562c0fb4a7cfd8a235ab55882388bfa2b919d -) -vcpkg_extract_source_archive(${ARCHIVE}) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - OPTIONS -DINSTALL_PDB=OFF -DMIN_WINDOWS_VER=Windows7 -DAPR_HAVE_IPV6=ON - # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 - # OPTIONS_RELEASE -DOPTIMIZE=1 - # OPTIONS_DEBUG -DDEBUGGABLE=1 -) - -vcpkg_install_cmake() - -# There is no way to suppress installation of the headers and resource files in build. -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) - -# Handle copyright -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/apr) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/apr/LICENSE ${CURRENT_PACKAGES_DIR}/share/apr/copyright) +# 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(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/apr-1.5.2) +vcpkg_download_distfile(ARCHIVE + URLS "https://www.apache.org/dist/apr/apr-1.5.2.tar.bz2" + FILENAME "apr-1.5.2.tar.bz2" + SHA512 d1156ad16abf07887797777b56c2147c890f16d8445829b3e3b4917950d24c5fd2f8febd439992467a5ea0511da562c0fb4a7cfd8a235ab55882388bfa2b919d +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS -DINSTALL_PDB=OFF -DMIN_WINDOWS_VER=Windows7 -DAPR_HAVE_IPV6=ON + # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 + # OPTIONS_RELEASE -DOPTIMIZE=1 + # OPTIONS_DEBUG -DDEBUGGABLE=1 +) + +vcpkg_install_cmake() + +# There is no way to suppress installation of the headers in debug builds. +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/apr) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/apr/LICENSE ${CURRENT_PACKAGES_DIR}/share/apr/copyright) -- cgit v1.2.3 From 6f74f29784dd70935cf90f743083fabee6ef27fe Mon Sep 17 00:00:00 2001 From: Bert Huijben Date: Thu, 3 Nov 2016 14:10:04 +0100 Subject: More line ending fixes --- ports/apr/CONTROL | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/apr/CONTROL b/ports/apr/CONTROL index 067f5cb1d..eed3c518d 100644 --- a/ports/apr/CONTROL +++ b/ports/apr/CONTROL @@ -1,3 +1,3 @@ -Source: apr -Version: 1.5.2 -Description: The Apache Portable Runtime (APR) is a C library that forms a system portability layer that covers many operating systems. +Source: apr +Version: 1.5.2 +Description: The Apache Portable Runtime (APR) is a C library that forms a system portability layer that covers many operating systems. -- cgit v1.2.3 From 41bc51b5e7d5ddbd7821bc04d155d6e4d2b2f2db Mon Sep 17 00:00:00 2001 From: Bert Huijben Date: Thu, 3 Nov 2016 17:01:49 +0100 Subject: Add vcpkg_copy_pdbs() line to copy PDB files properly --- ports/apr/portfile.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/apr/portfile.cmake b/ports/apr/portfile.cmake index ae505cc4e..98557284c 100644 --- a/ports/apr/portfile.cmake +++ b/ports/apr/portfile.cmake @@ -32,3 +32,5 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/apr) file(RENAME ${CURRENT_PACKAGES_DIR}/share/apr/LICENSE ${CURRENT_PACKAGES_DIR}/share/apr/copyright) + +vcpkg_copy_pdbs() -- cgit v1.2.3 From 12d61331d2ce8b9c8aab467d03c9ea30a31b205f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 3 Nov 2016 12:08:24 -0700 Subject: [apr] Retain only dynamic/static files from the corresponding build --- ports/apr/portfile.cmake | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/ports/apr/portfile.cmake b/ports/apr/portfile.cmake index 98557284c..df96d4474 100644 --- a/ports/apr/portfile.cmake +++ b/ports/apr/portfile.cmake @@ -29,6 +29,20 @@ vcpkg_install_cmake() # There is no way to suppress installation of the headers in debug builds. file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +# Both dynamic and static are built, so keep only the one needed +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/apr-1.lib + ${CURRENT_PACKAGES_DIR}/lib/aprapp-1.lib + ${CURRENT_PACKAGES_DIR}/debug/lib/apr-1.lib + ${CURRENT_PACKAGES_DIR}/debug/lib/aprapp-1.lib) +else() + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/libapr-1.lib + ${CURRENT_PACKAGES_DIR}/lib/libaprapp-1.lib + ${CURRENT_PACKAGES_DIR}/debug/lib/libapr-1.lib + ${CURRENT_PACKAGES_DIR}/debug/lib/libaprapp-1.lib) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) +endif() + # Handle copyright file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/apr) file(RENAME ${CURRENT_PACKAGES_DIR}/share/apr/LICENSE ${CURRENT_PACKAGES_DIR}/share/apr/copyright) -- cgit v1.2.3 From f67609acf1ebe1b4ce53e4128eee67e9fa13612c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 3 Nov 2016 12:09:23 -0700 Subject: [zlib] Add comment about zlib building both static and dynamic --- ports/zlib/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/zlib/portfile.cmake b/ports/zlib/portfile.cmake index 35ca5ff6d..1d6d807d4 100644 --- a/ports/zlib/portfile.cmake +++ b/ports/zlib/portfile.cmake @@ -18,6 +18,7 @@ vcpkg_configure_cmake( vcpkg_install_cmake() +# Both dynamic and static are built, so keep only the one needed if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/zlibstatic.lib ${CURRENT_PACKAGES_DIR}/debug/lib/zlibstaticd.lib) else() -- cgit v1.2.3 From 5b60e134665cdb33bd1f01f17e61c5b9ba4ad137 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 3 Nov 2016 14:34:52 -0700 Subject: [SourceParagraph] Consistency rename --- toolsrc/include/SourceParagraph.h | 2 +- toolsrc/src/SourceParagraph.cpp | 20 ++++++++++---------- toolsrc/src/commands_installation.cpp | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/toolsrc/include/SourceParagraph.h b/toolsrc/include/SourceParagraph.h index a8ad13668..6aae81872 100644 --- a/toolsrc/include/SourceParagraph.h +++ b/toolsrc/include/SourceParagraph.h @@ -7,7 +7,7 @@ namespace vcpkg { struct SourceParagraph { - static const std::vector& get_list_of_valid_entries(); + static const std::vector& get_list_of_valid_fields(); SourceParagraph(); diff --git a/toolsrc/src/SourceParagraph.cpp b/toolsrc/src/SourceParagraph.cpp index c870bde21..34d2a8170 100644 --- a/toolsrc/src/SourceParagraph.cpp +++ b/toolsrc/src/SourceParagraph.cpp @@ -10,26 +10,26 @@ namespace vcpkg static const std::string VERSION = "Version"; } - namespace SourceParagraphOptionalEntry + namespace SourceParagraphOptionalField { static const std::string DESCRIPTION = "Description"; static const std::string MAINTAINER = "Maintainer"; static const std::string BUILD_DEPENDS = "Build-Depends"; } - const std::vector& SourceParagraph::get_list_of_valid_entries() + const std::vector& SourceParagraph::get_list_of_valid_fields() { - static const std::vector valid_enties = + static const std::vector valid_fields = { SourceParagraphRequiredField::SOURCE, SourceParagraphRequiredField::VERSION, - SourceParagraphOptionalEntry::DESCRIPTION, - SourceParagraphOptionalEntry::MAINTAINER, - SourceParagraphOptionalEntry::BUILD_DEPENDS + SourceParagraphOptionalField::DESCRIPTION, + SourceParagraphOptionalField::MAINTAINER, + SourceParagraphOptionalField::BUILD_DEPENDS }; - return valid_enties; + return valid_fields; } SourceParagraph::SourceParagraph() = default; @@ -39,10 +39,10 @@ namespace vcpkg using namespace vcpkg::details; this->name = remove_required_field(&fields, SourceParagraphRequiredField::SOURCE); this->version = remove_required_field(&fields, SourceParagraphRequiredField::VERSION); - this->description = remove_optional_field(&fields, SourceParagraphOptionalEntry::DESCRIPTION); - this->maintainer = remove_optional_field(&fields, SourceParagraphOptionalEntry::MAINTAINER); + this->description = remove_optional_field(&fields, SourceParagraphOptionalField::DESCRIPTION); + this->maintainer = remove_optional_field(&fields, SourceParagraphOptionalField::MAINTAINER); - std::string deps = remove_optional_field(&fields, SourceParagraphOptionalEntry::BUILD_DEPENDS); + std::string deps = remove_optional_field(&fields, SourceParagraphOptionalField::BUILD_DEPENDS); this->depends = parse_depends(deps); this->unparsed_fields = std::move(fields); diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_installation.cpp index 67623b855..22309cabf 100644 --- a/toolsrc/src/commands_installation.cpp +++ b/toolsrc/src/commands_installation.cpp @@ -28,7 +28,7 @@ namespace vcpkg if (!source_paragraph.unparsed_fields.empty()) { const std::vector remaining_keys = Maps::extract_keys(source_paragraph.unparsed_fields); - const std::vector& valid_entries = SourceParagraph::get_list_of_valid_entries(); + const std::vector& valid_entries = SourceParagraph::get_list_of_valid_fields(); const std::string remaining_keys_as_string = Strings::join(remaining_keys, "\n "); const std::string valid_keys_as_string = Strings::join(valid_entries, "\n "); -- cgit v1.2.3 From 90876a3bfef586a20e475d5ef812bac843e7a1a8 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 3 Nov 2016 15:43:09 -0700 Subject: SourceParagraph checks fields at construction time --- toolsrc/include/SourceParagraph.h | 1 - toolsrc/src/SourceParagraph.cpp | 16 +++++++++++++++- toolsrc/src/commands_installation.cpp | 14 -------------- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/toolsrc/include/SourceParagraph.h b/toolsrc/include/SourceParagraph.h index 6aae81872..9c9439ea7 100644 --- a/toolsrc/include/SourceParagraph.h +++ b/toolsrc/include/SourceParagraph.h @@ -18,6 +18,5 @@ namespace vcpkg std::string description; std::string maintainer; std::vector depends; - std::unordered_map unparsed_fields; }; } diff --git a/toolsrc/src/SourceParagraph.cpp b/toolsrc/src/SourceParagraph.cpp index 34d2a8170..1fa50e233 100644 --- a/toolsrc/src/SourceParagraph.cpp +++ b/toolsrc/src/SourceParagraph.cpp @@ -1,5 +1,7 @@ #include "SourceParagraph.h" #include "vcpkglib_helpers.h" +#include "vcpkg_System.h" +#include "vcpkg_Maps.h" namespace vcpkg { @@ -45,6 +47,18 @@ namespace vcpkg std::string deps = remove_optional_field(&fields, SourceParagraphOptionalField::BUILD_DEPENDS); this->depends = parse_depends(deps); - this->unparsed_fields = std::move(fields); + if (!fields.empty()) + { + const std::vector remaining_fields = Maps::extract_keys(fields); + const std::vector& valid_fields = get_list_of_valid_fields(); + + const std::string remaining_fields_as_string = Strings::join(remaining_fields, "\n "); + const std::string valid_fields_as_string = Strings::join(valid_fields, "\n "); + + System::println(System::color::error, "Error: There are invalid fields in the Source Paragraph of %s", this->name); + System::println("The following fields were not expected:\n\n %s\n\n", remaining_fields_as_string); + System::println("This is the list of valid fields (case-sensitive): \n\n %s\n", valid_fields_as_string); + exit(EXIT_FAILURE); + } } } diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_installation.cpp index 22309cabf..022b87139 100644 --- a/toolsrc/src/commands_installation.cpp +++ b/toolsrc/src/commands_installation.cpp @@ -25,20 +25,6 @@ namespace vcpkg Checks::check_exit(pghs.size() == 1, "Error: invalid control file"); SourceParagraph source_paragraph(pghs[0]); - if (!source_paragraph.unparsed_fields.empty()) - { - const std::vector remaining_keys = Maps::extract_keys(source_paragraph.unparsed_fields); - const std::vector& valid_entries = SourceParagraph::get_list_of_valid_fields(); - - const std::string remaining_keys_as_string = Strings::join(remaining_keys, "\n "); - const std::string valid_keys_as_string = Strings::join(valid_entries, "\n "); - - System::println(System::color::error, "Error: There are invalid fields in port file %s", port_dir.generic_string()); - System::println("The following fields were not expected in the port file:\n\n %s\n\n", remaining_keys_as_string); - System::println("This is the list of valid fields (case-sensitive): \n\n %s\n", valid_keys_as_string); - exit(EXIT_FAILURE); - } - const fs::path ports_cmake_script_path = paths.ports_cmake; auto&& target_triplet = spec.target_triplet(); 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")", -- cgit v1.2.3 From 99b3c491729187d87ba9fd1cc78bc9b63a046616 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 3 Nov 2016 15:53:15 -0700 Subject: [SourceParagraph] Remove using namespace; --- toolsrc/src/SourceParagraph.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/toolsrc/src/SourceParagraph.cpp b/toolsrc/src/SourceParagraph.cpp index 1fa50e233..f46a9c2af 100644 --- a/toolsrc/src/SourceParagraph.cpp +++ b/toolsrc/src/SourceParagraph.cpp @@ -38,14 +38,13 @@ namespace vcpkg SourceParagraph::SourceParagraph(std::unordered_map fields) { - using namespace vcpkg::details; - this->name = remove_required_field(&fields, SourceParagraphRequiredField::SOURCE); - this->version = remove_required_field(&fields, SourceParagraphRequiredField::VERSION); - this->description = remove_optional_field(&fields, SourceParagraphOptionalField::DESCRIPTION); - this->maintainer = remove_optional_field(&fields, SourceParagraphOptionalField::MAINTAINER); + this->name = details::remove_required_field(&fields, SourceParagraphRequiredField::SOURCE); + this->version = details::remove_required_field(&fields, SourceParagraphRequiredField::VERSION); + this->description = details::remove_optional_field(&fields, SourceParagraphOptionalField::DESCRIPTION); + this->maintainer = details::remove_optional_field(&fields, SourceParagraphOptionalField::MAINTAINER); - std::string deps = remove_optional_field(&fields, SourceParagraphOptionalField::BUILD_DEPENDS); - this->depends = parse_depends(deps); + std::string deps = details::remove_optional_field(&fields, SourceParagraphOptionalField::BUILD_DEPENDS); + this->depends = details::parse_depends(deps); if (!fields.empty()) { -- cgit v1.2.3 From 95ef1b95e6e2f7933bb40f428514dcf178b201e6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 3 Nov 2016 17:36:47 -0700 Subject: [BinaryParagraph] Refactor implementation --- toolsrc/include/BinaryParagraph.h | 2 +- toolsrc/src/BinaryParagraph.cpp | 57 ++++++++++++++++++++++++++++++--------- 2 files changed, 46 insertions(+), 13 deletions(-) diff --git a/toolsrc/include/BinaryParagraph.h b/toolsrc/include/BinaryParagraph.h index 01979c924..dcb986423 100644 --- a/toolsrc/include/BinaryParagraph.h +++ b/toolsrc/include/BinaryParagraph.h @@ -10,7 +10,7 @@ namespace vcpkg struct BinaryParagraph { BinaryParagraph(); - explicit BinaryParagraph(const std::unordered_map& fields); + explicit BinaryParagraph(std::unordered_map fields); BinaryParagraph(const SourceParagraph& spgh, const triplet& target_triplet); std::string displayname() const; diff --git a/toolsrc/src/BinaryParagraph.cpp b/toolsrc/src/BinaryParagraph.cpp index 61c74fcf5..6dceb66d9 100644 --- a/toolsrc/src/BinaryParagraph.cpp +++ b/toolsrc/src/BinaryParagraph.cpp @@ -6,24 +6,57 @@ using namespace vcpkg::details; namespace vcpkg { + // + namespace BinaryParagraphRequiredField + { + static const std::string PACKAGE = "Package"; + static const std::string VERSION = "Version"; + static const std::string ARCHITECTURE = "Architecture"; + static const std::string MULTI_ARCH = "Multi-Arch"; + } + + namespace BinaryParagraphOptionalField + { + static const std::string DESCRIPTION = "Description"; + static const std::string MAINTAINER = "Maintainer"; + static const std::string DEPENDS = "Depends"; + } + + static const std::vector& get_list_of_valid_fields() + { + static const std::vector valid_fields = + { + BinaryParagraphRequiredField::PACKAGE, + BinaryParagraphRequiredField::VERSION, + BinaryParagraphRequiredField::ARCHITECTURE, + + BinaryParagraphOptionalField::DESCRIPTION, + BinaryParagraphOptionalField::MAINTAINER, + BinaryParagraphOptionalField::DEPENDS + }; + + return valid_fields; + } + BinaryParagraph::BinaryParagraph() = default; - BinaryParagraph::BinaryParagraph(const std::unordered_map& fields) : - version(required_field(fields, "Version")), - description(optional_field(fields, "Description")), - maintainer(optional_field(fields, "Maintainer")) + BinaryParagraph::BinaryParagraph(std::unordered_map fields) { - const std::string name = required_field(fields, "Package"); - const triplet target_triplet = triplet::from_canonical_name(required_field(fields, "Architecture")); + const std::string name = details::remove_required_field(&fields, BinaryParagraphRequiredField::PACKAGE); + const std::string architecture = details::remove_required_field(&fields, BinaryParagraphRequiredField::ARCHITECTURE); + const triplet target_triplet = triplet::from_canonical_name(architecture); + this->spec = package_spec::from_name_and_triplet(name, target_triplet).get_or_throw(); + this->version = details::remove_required_field(&fields, BinaryParagraphRequiredField::VERSION); - { - std::string multi_arch = required_field(fields, "Multi-Arch"); - Checks::check_throw(multi_arch == "same", "Multi-Arch must be 'same' but was %s", multi_arch); - } + this->description = details::remove_optional_field(&fields, BinaryParagraphOptionalField::DESCRIPTION); + this->maintainer = details::remove_optional_field(&fields, BinaryParagraphOptionalField::MAINTAINER); + + std::string multi_arch = details::remove_required_field(&fields, BinaryParagraphRequiredField::MULTI_ARCH); + Checks::check_exit(multi_arch == "same", "Multi-Arch must be 'same' but was %s", multi_arch); - std::string deps = optional_field(fields, "Depends"); - this->depends = parse_depends(deps); + std::string deps = details::remove_optional_field(&fields, BinaryParagraphOptionalField::DEPENDS); + this->depends = details::parse_depends(deps); } BinaryParagraph::BinaryParagraph(const SourceParagraph& spgh, const triplet& target_triplet) -- cgit v1.2.3 From 11c9a523f7cd8cc324606c543311de1edcaee6cb Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 3 Nov 2016 18:52:44 -0700 Subject: [SourceParagraph] Make function static --- toolsrc/include/SourceParagraph.h | 2 -- toolsrc/src/SourceParagraph.cpp | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/toolsrc/include/SourceParagraph.h b/toolsrc/include/SourceParagraph.h index 9c9439ea7..bac005144 100644 --- a/toolsrc/include/SourceParagraph.h +++ b/toolsrc/include/SourceParagraph.h @@ -7,8 +7,6 @@ namespace vcpkg { struct SourceParagraph { - static const std::vector& get_list_of_valid_fields(); - SourceParagraph(); explicit SourceParagraph(std::unordered_map fields); diff --git a/toolsrc/src/SourceParagraph.cpp b/toolsrc/src/SourceParagraph.cpp index f46a9c2af..6f25dbded 100644 --- a/toolsrc/src/SourceParagraph.cpp +++ b/toolsrc/src/SourceParagraph.cpp @@ -19,7 +19,7 @@ namespace vcpkg static const std::string BUILD_DEPENDS = "Build-Depends"; } - const std::vector& SourceParagraph::get_list_of_valid_fields() + static const std::vector& get_list_of_valid_fields() { static const std::vector valid_fields = { -- cgit v1.2.3 From d5d997bd7dbf7f1de5c5b72a7e89bf63a5925ad6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 3 Nov 2016 18:55:32 -0700 Subject: [StatusParagraph] Minor refactor --- toolsrc/src/StatusParagraph.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/toolsrc/src/StatusParagraph.cpp b/toolsrc/src/StatusParagraph.cpp index 5aa425969..bf12ae89a 100644 --- a/toolsrc/src/StatusParagraph.cpp +++ b/toolsrc/src/StatusParagraph.cpp @@ -5,6 +5,12 @@ using namespace vcpkg::details; namespace vcpkg { + // + namespace BinaryParagraphRequiredField + { + static const std::string STATUS = "Status"; + } + StatusParagraph::StatusParagraph() : want(want_t::error), state(install_state_t::error) { } @@ -19,7 +25,7 @@ namespace vcpkg StatusParagraph::StatusParagraph(const std::unordered_map& fields) : package(fields) { - std::string status_field = required_field(fields, "Status"); + std::string status_field = required_field(fields, BinaryParagraphRequiredField::STATUS); auto b = status_field.begin(); auto mark = b; -- cgit v1.2.3 From c1a87697dd684d23f25d7dc01a1927e58374ffca Mon Sep 17 00:00:00 2001 From: Patrick Dehne Date: Fri, 4 Nov 2016 13:09:13 +0100 Subject: Add Microsofts openssl fork which supports the UWP platform --- ports/openssl-microsoft/CONTROL | 3 + ports/openssl-microsoft/make-openssl.bat | 10 ++ ports/openssl-microsoft/portfile.cmake | 111 +++++++++++++++++++ ports/openssl-microsoft/setVSvars.bat | 185 +++++++++++++++++++++++++++++++ 4 files changed, 309 insertions(+) create mode 100644 ports/openssl-microsoft/CONTROL create mode 100644 ports/openssl-microsoft/make-openssl.bat create mode 100644 ports/openssl-microsoft/portfile.cmake create mode 100644 ports/openssl-microsoft/setVSvars.bat diff --git a/ports/openssl-microsoft/CONTROL b/ports/openssl-microsoft/CONTROL new file mode 100644 index 000000000..8b67282ac --- /dev/null +++ b/ports/openssl-microsoft/CONTROL @@ -0,0 +1,3 @@ +Source: openssl-microsoft +Version: 1.0.2-winrt-stable +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. This is Microsofts fork of openssl that supports Windows Phone and Store apps. diff --git a/ports/openssl-microsoft/make-openssl.bat b/ports/openssl-microsoft/make-openssl.bat new file mode 100644 index 000000000..4c038094d --- /dev/null +++ b/ports/openssl-microsoft/make-openssl.bat @@ -0,0 +1,10 @@ +set build=%1 + +perl Configure no-asm no-hw no-dso VC-WINUNIVERSAL + +call ms\do_winuniversal.bat + +call ms\setVSvars.bat universal10.0%build% + +nmake -f ms\ntdll.mak + diff --git a/ports/openssl-microsoft/portfile.cmake b/ports/openssl-microsoft/portfile.cmake new file mode 100644 index 000000000..30d85abf7 --- /dev/null +++ b/ports/openssl-microsoft/portfile.cmake @@ -0,0 +1,111 @@ +# 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(${CMAKE_TRIPLET_FILE}) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(FATAL_ERROR "Static building not supported yet") +endif() + +if (TARGET_TRIPLET MATCHES "arm-uwp") + set(UWP_PLATFORM "arm") +elseif (TARGET_TRIPLET MATCHES "x64-uwp") + set(UWP_PLATFORM "x64") +elseif (TARGET_TRIPLET MATCHES "x86-uwp") + set(UWP_PLATFORM "Win32") +else () + message(FATAL_ERROR "Only UWP DLL builds are supported at the moment") +endif() + +include(vcpkg_common_functions) + +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/openssl-OpenSSL_1_0_2_WinRT-stable) + +vcpkg_find_acquire_program(PERL) +get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) +set(ENV{PATH} "${PERL_EXE_PATH};$ENV{PATH}") + +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/Microsoft/openssl/archive/OpenSSL_1_0_2_WinRT-stable.zip" + FILENAME "openssl-microsoft-1.0.2.zip" + SHA512 f265b7dbeca6b86815dbc14af9f2b6688407efd921eb335b1acf5a642dddb6b6334a794fe0939666d9db66976db11a67ad78a3ed74484708d3bf2040aae598d2 +) + +vcpkg_extract_source_archive(${ARCHIVE}) + +# file(REMOVE_RECURSE ${SOURCE_PATH}/tmp32dll) +# file(REMOVE_RECURSE ${SOURCE_PATH}/out32dll) +# file(REMOVE_RECURSE ${SOURCE_PATH}/inc32dll) + +file(COPY +${CMAKE_CURRENT_LIST_DIR}/setVSvars.bat +DESTINATION ${SOURCE_PATH}/ms) + +file(COPY +${CMAKE_CURRENT_LIST_DIR}/make-openssl.bat +DESTINATION ${SOURCE_PATH}) + +message(STATUS "Build ${TARGET_TRIPLET}") + +vcpkg_execute_required_process( + COMMAND ${SOURCE_PATH}/make-openssl.bat ${UWP_PLATFORM} + WORKING_DIRECTORY ${SOURCE_PATH} + LOGNAME make-openssl-${TARGET_TRIPLET} +) + + +message(STATUS "Build ${TARGET_TRIPLET} done") + + + +file( + COPY ${SOURCE_PATH}/inc32/openssl + DESTINATION ${CURRENT_PACKAGES_DIR}/include +) + +file(INSTALL ${SOURCE_PATH}/out32dll/libeay32.dll + DESTINATION ${CURRENT_PACKAGES_DIR}/bin) + +file(INSTALL ${SOURCE_PATH}/out32dll/libeay32.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/bin) + +file(INSTALL ${SOURCE_PATH}/out32dll/libeay32.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + +file(INSTALL ${SOURCE_PATH}/out32dll/ssleay32.dll + DESTINATION ${CURRENT_PACKAGES_DIR}/bin) + +file(INSTALL ${SOURCE_PATH}/out32dll/ssleay32.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/bin) + +file(INSTALL ${SOURCE_PATH}/out32dll/ssleay32.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + + + +file(INSTALL ${SOURCE_PATH}/out32dll/libeay32.dll + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) + +file(INSTALL ${SOURCE_PATH}/out32dll/libeay32.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) + +file(INSTALL ${SOURCE_PATH}/out32dll/libeay32.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + +file(INSTALL ${SOURCE_PATH}/out32dll/ssleay32.dll + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) + +file(INSTALL ${SOURCE_PATH}/out32dll/ssleay32.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) + +file(INSTALL ${SOURCE_PATH}/out32dll/ssleay32.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + + + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/openssl-microsoft RENAME copyright) diff --git a/ports/openssl-microsoft/setVSvars.bat b/ports/openssl-microsoft/setVSvars.bat new file mode 100644 index 000000000..23259821e --- /dev/null +++ b/ports/openssl-microsoft/setVSvars.bat @@ -0,0 +1,185 @@ +@echo off +call:set_%1 +exit /b +:set_universal10.0Win32 + call:setVar _VS14VC VisualStudio14VC + call "%_VS14VC%vcvarsall" x86 + set _VCPlatform=x86 + set _VCLibPlat= + call:setEnv + goto :eof + +:set_universal10.0x64 + call:setVar _VS14VC VisualStudio14VC + call "%_VS14VC%vcvarsall" x64 + set _VCPlatform=x64 + set _VCLibPlat=amd64 + call:setEnv + goto :eof + +:set_universal10.0arm + call:setVar _VS14VC VisualStudio14VC + call "%_VS14VC%vcvarsall" x86_arm + set _VCPlatform=ARM + set _VCLibPlat=ARM + call:setEnv + goto :eof + +:set_universal10.0arm64 + call:setVar _VS14VC VisualStudio14VC + call "%_VS14VC%vcvarsall" x86_arm64 + set _VCPlatform=ARM64 + set _VCLibPlat=ARM64 + call:setEnv + goto :eof + +:set_wp8.1arm + call:setVar _VS12VC VisualStudio12VC + call:setVar _WPKITS81 WindowsPhoneKits8.1 + call:setVar _VS14VC VisualStudio14VC + call "%_VS12VC%\vcvarsall" x86_arm + set PATH=%_VS12VC\Bin%;%PATH% + set INCLUDE=%_WPKITS81%\Include;%_WPKITS81%\Include\abi;%_WPKITS81%\Include\mincore;%_WPKITS81%\Include\minwin;%_WPKITS81%\Include\wrl;%INCLUDE% + set LIB=%_WPKITS81%\lib\ARM;%_VS12VC%\lib\store\ARM; + set LIBPATH=%LIBPATH%;%_VS12VC%\vcpackages;%WindowsSDK_ExecutablePath_x86%\..\..\Tools\MDILXAPCompile\WinMDs;%_VS14VC%\vcpackages; + goto :eof + +:set_wp8.1Win32 + call:setVar _VS12VC VisualStudio12VC + call:setVar _WPKITS81 WindowsPhoneKits8.1 + call:setVar _VS14VC VisualStudio14VC + call "%_VS12VC%\vcvarsall" x86 + set INCLUDE=%_WPKITS81%\Include;%_WPKITS81%\Include\abi;%_WPKITS81%\Include\mincore;%_WPKITS81%\Include\minwin;%_WPKITS81%\Include\wrl;%INCLUDE% + set LIB=%_WPKITS81%\lib\x86;%_VS12VC%\lib\store; + set LIBPATH=%LIBPATH%;%_VS12VC%\vcpackages;%WindowsSDK_ExecutablePath_x86%\..\..\Tools\MDILXAPCompile\WinMDs;%_VS14VC%\vcpackages; + goto :eof + +:set_wp8.0arm + call:setVar _VS11VC VisualStudio11VC + call:setVar _WPKITS80 WindowsPhoneKits8.0 + call "%_VS11VC%\WPSDK\WP80\vcvarsphoneall.bat" x86_arm + goto :eof + +:set_wp8.0Win32 + call:setVar _VS11VC VisualStudio11VC + call:setVar _WPKITS80 WindowsPhoneKits8.0 + call "%_VS11VC%\WPSDK\WP80\vcvarsphoneall.bat" x86 + goto :eof + +:set_ws8.1Win32 + call:setVar _VS12VC VisualStudio12VC + call:setVar _WSKITS81 WindowsKits8.1 + call:setVar _VS14VC VisualStudio14VC + call "%_VS12VC%\vcvarsall" x86 + set INCLUDE=%_VS12VC%\include;%_VS12VC%\atlmfc\include;%_WSKITS81%\Include\um;%_WSKITS81%\Include\shared;%_WSKITS81%\Include\winrt; + set LIB=%_VS12VC%\lib\store;%_VS12VC%\atlmfc\lib;%_WSKITS81%\lib\winv6.3\um\x86; + set LIBPATH=%_WSKITS81%\References\CommonConfiguration\Neutral;%_VS12VC%\atlmfc\lib;%_VS12VC%\lib\store;%_VS12VC%\vcpackages;%WindowsSDK_ExecutablePath_x86%\..\..\Tools\MDILXAPCompile\WinMDs;%_VS14VC%\vcpackages; + goto :eof + +:set_ws8.1x64 + call:setVar _VS12VC VisualStudio12VC + call:setVar _WSKITS81 WindowsKits8.1 + call:setVar _VS14VC VisualStudio14VC + call "%_VS12VC%\vcvarsall" x64 + set INCLUDE=%_VS12VC%\include;%_VS12VC%\atlmfc\include;%_WSKITS81%\Include\um;%_WSKITS81%\Include\shared;%_WSKITS81%\Include\winrt; + set LIB=%_VS12VC%\lib\store\amd64;%_VS12VC%\atlmfc\lib\amd64;%_WSKITS81%\lib\winv6.3\um\x64; + set LIBPATH=%_WSKITS81%\References\CommonConfiguration\Neutral;%_VS12VC%\atlmfc\lib\amd64;%_VS12VC%\lib\store;%_VS12VC%\vcpackages;%WindowsSDK_ExecutablePath_x86%\..\..\Tools\MDILXAPCompile\WinMDs;%_VS14VC%\vcpackages; + goto :eof + +:set_ws8.1arm + call:setVar _VS12VC VisualStudio12VC + call:setVar _WSKITS81 WindowsKits8.1 + call:setVar _VS14VC VisualStudio14VC + call "%_VS12VC%\vcvarsall" x86_arm + set INCLUDE=%_VS12VC%\include;%_VS12VC%\atlmfc\include;%_WSKITS81%\Include\um;%_WSKITS81%\Include\shared;%_WSKITS81%\Include\winrt; + set LIB=%_VS12VC%\lib\store\arm;%_VS12VC%\atlmfc\lib\arm;%_WSKITS81%\lib\winv6.3\um\arm; + set LIBPATH=%_WSKITS81%\References\CommonConfiguration\Neutral;%_VS12VC%\atlmfc\lib\arm;%_VS12VC%\lib\store;%_VS12VC%\vcpackages;%WindowsSDK_ExecutablePath_x86%\..\..\Tools\MDILXAPCompile\WinMDs;%_VS14VC%\vcpackages; + goto :eof + +:setVar + call:set%1 + if "!%1!"=="" echo warning: could not locate %2 + goto :eof + +:setRegVar + for /F "usebackq tokens=2*" %%A IN (`reg query %1 /v %2 2^>nul`) do ( + set %3=%%B + ) + goto :eof + +:setAppend + if exist %1%2 set %3=%1%2 + goto :eof + +:set_VS11VC + if not "%_VS11VC%"=="" goto :eof + call:setRegVar "HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0_Config\Setup\VC" ProductDir _VS11VC + if not "%_VS11VC%"=="" goto :eof + call:setRegVar "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\11.0\Setup\VC" ProductDir _VS11VC + if not "%_VS11VC%"=="" goto :eof + call:setAppend VSSDK110Install \..\VC _VS11VC + if not "%_VS11VC%"=="" goto :eof + call:setAppend VS110COMNTOOLS \..\..\VC _VS11VC + goto :eof + +:set_VS12VC + if not "%_VS12VC%"=="" goto :eof + call:setRegVar "HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0_Config\Setup\VC" ProductDir _VS12VC + if not "%_VS12VC%"=="" goto :eof + call:setRegVar "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0\Setup\VC" ProductDir _VS12VC + if not "%_VS12VC%"=="" goto :eof + call:setAppend VSSDK120Install \..\VC _VS12VC + if not "%_VS12VC%"=="" goto :eof + call:setAppend VS120COMNTOOLS \..\..\VC _VS12VC + goto :eof + +:set_VS14VC + if not "%_VS14VC%"=="" goto :eof + call:setRegVar "HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0_Config\Setup\VC" ProductDir _VS14VC + if not "%_VS14VC%"=="" goto :eof + call:setRegVar "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\Setup\VC" ProductDir _VS14VC + if not "%_VS14VC%"=="" goto :eof + call:setAppend VSSDK140Install \..\VC _VS14VC + if not "%_VS14VC%"=="" goto :eof + call:setAppend VS140COMNTOOLS \..\..\VC _VS14VC + goto :eof + +:set_WPKITS80 + if not "%_WPKITS80%"=="" goto :eof + call:setRegVar "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows Phone\v8.0" InstallationFolder _WPKITS80 + if not "%_WPKITS80%"=="" goto :eof + goto :eof + +:set_WPKITS81 + if not "%_WPKITS81%"=="" goto :eof + call:setRegVar "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows Phone\v8.1" InstallationFolder _WPKITS81 + if not "%_WPKITS81%"=="" goto :eof + goto :eof + +:set_WSKITS81 + if not "%_WSKITS81%"=="" goto :eof + call:setRegVar "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots" KitsRoot81 _WSKITS81 + if not "%_WSKITS81%"=="" goto :eof + goto :eof + +:set_WKITS10 + if not "%_WKITS10%"=="" goto :eof + call:setRegVar "HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0" InstallationFolder _WKITS10 + if not "%_WKITS10%"=="" goto :eof + goto :eof + +:set_WKITS10VER + if not "%_WKITS10VER%"=="" goto :eof + call:setRegVar "HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0" ProductVersion _WKITS10VER + echo %_WKITS10VER% + if not "%_WKITS10VER%"=="" goto :eof + goto :eof + +:setEnv + call:setVar _VS14VC VisualStudio14VC + call:setVar _WKITS10 WindowsKits10.0 + set PATH=%_VS14VCBin%;%PATH% + set "LIBPATH=%_WKITS10%UnionMetadata\Facade;%_VS14VC%vcpackages;%_WKITS10%references\windows.foundation.foundationcontract\1.0.0.0\;%_WKITS10%references\windows.foundation.universalapicontract\1.0.0.0\" + goto :eof + +:end -- cgit v1.2.3 From f413b423960ab6080681d460a042a2e09dc1c0e6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 4 Nov 2016 12:58:52 -0700 Subject: [openssl] Update to 1.0.2j --- ports/openssl/CMakeLists.txt | 2 +- ports/openssl/CONTROL | 2 +- ports/openssl/portfile.cmake | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ports/openssl/CMakeLists.txt b/ports/openssl/CMakeLists.txt index acb9bc7a5..1fa0f30d0 100644 --- a/ports/openssl/CMakeLists.txt +++ b/ports/openssl/CMakeLists.txt @@ -3,7 +3,7 @@ project(openssl NONE) include(vcpkg_execute_required_process) include(vcpkg_apply_patches) -set(SOURCE_PATH ${CMAKE_CURRENT_BINARY_DIR}/openssl-1.0.2h) +set(SOURCE_PATH ${CMAKE_CURRENT_BINARY_DIR}/openssl-1.0.2j) find_program(PERL perl) find_program(NMAKE nmake) diff --git a/ports/openssl/CONTROL b/ports/openssl/CONTROL index 9ee9ef163..d0cd893f5 100644 --- a/ports/openssl/CONTROL +++ b/ports/openssl/CONTROL @@ -1,3 +1,3 @@ Source: openssl -Version: 1.0.2h-1 +Version: 1.0.2j 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 diff --git a/ports/openssl/portfile.cmake b/ports/openssl/portfile.cmake index 49d322095..1d3d40b78 100644 --- a/ports/openssl/portfile.cmake +++ b/ports/openssl/portfile.cmake @@ -1,6 +1,6 @@ include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/openssl-1.0.2h) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/openssl-1.0.2j) vcpkg_find_acquire_program(PERL) find_program(NMAKE nmake) @@ -8,9 +8,9 @@ get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) set(ENV{PATH} "${PERL_EXE_PATH};$ENV{PATH}") vcpkg_download_distfile(OPENSSL_SOURCE_ARCHIVE - URLS "https://www.openssl.org/source/openssl-1.0.2h.tar.gz" - FILENAME "openssl-1.0.2h.tar.gz" - SHA512 780601f6f3f32f42b6d7bbc4c593db39a3575f9db80294a10a68b2b0bb79448d9bd529ca700b9977354cbdfc65887c76af0aa7b90d3ee421f74ab53e6f15c303 + URLS "https://www.openssl.org/source/openssl-1.0.2j.tar.gz" + FILENAME "openssl-1.0.2j.tar.gz" + SHA512 7d6ccae4aa3ccec3a5d128da29c68401cdb1210cba6d212d55235fc3bc63d7085e2f119e2bbee7ddff6b7b5eef07c6196156791724cd2caf313a4c2fef724edd ) file(COPY @@ -30,7 +30,7 @@ vcpkg_configure_cmake( -DOPENSSL_SOURCE_ARCHIVE=${OPENSSL_SOURCE_ARCHIVE} -DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH} -DTRIPLET_SYSTEM_ARCH=${TRIPLET_SYSTEM_ARCH} - -DVERSION=1.0.2h + -DVERSION=1.0.2j -DTARGET_TRIPLET=${TARGET_TRIPLET} ) -- cgit v1.2.3 From e5152851f2bb070eb4bcc2b8968d40d48226b04e Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 4 Nov 2016 17:37:58 -0700 Subject: Revert d58f0c6680. MSBuild (and CMake) do not allow switching on CRT type effectively, so we should use more robust logic. --- scripts/buildsystems/msbuild/vcpkg.targets | 101 ++++++++++------------------- 1 file changed, 33 insertions(+), 68 deletions(-) diff --git a/scripts/buildsystems/msbuild/vcpkg.targets b/scripts/buildsystems/msbuild/vcpkg.targets index e6a321ffd..18c4e9d9f 100644 --- a/scripts/buildsystems/msbuild/vcpkg.targets +++ b/scripts/buildsystems/msbuild/vcpkg.targets @@ -1,79 +1,44 @@ + + true + x86-windows + - - - - - -static - - -static - - - - true - x86-windows$(VcpkgRuntimeLibrary) - - - - - - true - x86-uwp$(VcpkgRuntimeLibrary) - - - - true - x64-windows$(VcpkgRuntimeLibrary) - - - - true - x64-uwp$(VcpkgRuntimeLibrary) - - - - true - arm-uwp$(VcpkgRuntimeLibrary) - - - - $(Configuration) - $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), .vcpkg-root))\installed\$(VcpkgTriplet)\ - + + true + x86-uwp + - - - - - $(VcpkgRoot)include;%(ClCompile.AdditionalIncludeDirectories) - - - + + true + x64-windows + - - - - - + + true + x64-uwp + - - @(VcpkgLink);%(Link.AdditionalDependencies) - - - - + + true + arm-uwp + - - $(ComputeLinkInputsTargets);VcpkgLinkInputs + + $(Configuration) + $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), .vcpkg-root))\installed\$(VcpkgTriplet)\ + + + $(VcpkgRoot)debug\lib\*.lib;%(AdditionalDependencies) + $(VcpkgRoot)lib\*.lib;%(AdditionalDependencies) + + + $(VcpkgRoot)include;%(AdditionalIncludeDirectories) + + + Date: Sat, 5 Nov 2016 01:02:15 -0700 Subject: Enable qualified dependencies. Fix bug in internal 'build' command. Added capability for CONTROL files to specify qualified dependencies, which are substring searched inside triplet names. Fixed bug in internal 'build' command where if a package is already built, that built package's dependencies will be used to determine requirements for the build instead of the port directory's CONTROL file. --- toolsrc/include/SourceParagraph.h | 17 +- toolsrc/include/vcpkg.h | 1 + toolsrc/include/vcpkg_Dependencies.h | 2 +- toolsrc/include/vcpkglib_helpers.h | 2 - toolsrc/src/BinaryParagraph.cpp | 4 +- toolsrc/src/SourceParagraph.cpp | 83 ++++++- toolsrc/src/commands_installation.cpp | 11 +- toolsrc/src/lib.cpp | 40 +-- toolsrc/src/test.cpp | 347 -------------------------- toolsrc/src/tests_dependencies.cpp | 39 +++ toolsrc/src/tests_paragraph.cpp | 367 ++++++++++++++++++++++++++++ toolsrc/src/vcpkg_Checks.cpp | 3 + toolsrc/src/vcpkg_Dependencies.cpp | 8 +- toolsrc/src/vcpkglib_helpers.cpp | 33 --- toolsrc/vcpkgtest/vcpkgtest.vcxproj | 5 +- toolsrc/vcpkgtest/vcpkgtest.vcxproj.filters | 5 +- 16 files changed, 553 insertions(+), 414 deletions(-) delete mode 100644 toolsrc/src/test.cpp create mode 100644 toolsrc/src/tests_dependencies.cpp create mode 100644 toolsrc/src/tests_paragraph.cpp diff --git a/toolsrc/include/SourceParagraph.h b/toolsrc/include/SourceParagraph.h index bac005144..5ae9b38b8 100644 --- a/toolsrc/include/SourceParagraph.h +++ b/toolsrc/include/SourceParagraph.h @@ -5,6 +5,16 @@ namespace vcpkg { + struct triplet; + + struct dependency + { + std::string name; + std::string qualifier; + }; + + std::ostream& operator<<(std::ostream& os, const dependency& p); + struct SourceParagraph { SourceParagraph(); @@ -15,6 +25,11 @@ namespace vcpkg std::string version; std::string description; std::string maintainer; - std::vector depends; + std::vector depends; }; + + std::vector filter_dependencies(const std::vector& deps, const triplet& t); + + std::vector expand_qualified_dependencies(const std::vector& depends); + std::vector parse_depends(const std::string& depends_string); } diff --git a/toolsrc/include/vcpkg.h b/toolsrc/include/vcpkg.h index a4a0682cf..dc5933f10 100644 --- a/toolsrc/include/vcpkg.h +++ b/toolsrc/include/vcpkg.h @@ -21,6 +21,7 @@ namespace vcpkg StatusParagraphs database_load_check(const vcpkg_paths& paths); std::vector get_unmet_package_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db); + std::vector get_unmet_package_build_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db); void install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs& status_db); void deinstall_package(const vcpkg_paths& paths, const package_spec& spec, StatusParagraphs& status_db); diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 9dc32fc41..94aa51f99 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -9,5 +9,5 @@ namespace vcpkg {namespace Dependencies { std::vector create_dependency_ordered_install_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); - std::unordered_set find_unmet_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db); + std::unordered_set find_unmet_dependencies(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); }} diff --git a/toolsrc/include/vcpkglib_helpers.h b/toolsrc/include/vcpkglib_helpers.h index 05c9e17df..640fab555 100644 --- a/toolsrc/include/vcpkglib_helpers.h +++ b/toolsrc/include/vcpkglib_helpers.h @@ -9,6 +9,4 @@ namespace vcpkg {namespace details std::string required_field(const std::unordered_map& fields, const std::string& fieldname); std::string remove_required_field(std::unordered_map* fields, const std::string& fieldname); - - std::vector parse_depends(const std::string& depends_string); }} diff --git a/toolsrc/src/BinaryParagraph.cpp b/toolsrc/src/BinaryParagraph.cpp index 6dceb66d9..ad85a1f8a 100644 --- a/toolsrc/src/BinaryParagraph.cpp +++ b/toolsrc/src/BinaryParagraph.cpp @@ -56,7 +56,7 @@ namespace vcpkg Checks::check_exit(multi_arch == "same", "Multi-Arch must be 'same' but was %s", multi_arch); std::string deps = details::remove_optional_field(&fields, BinaryParagraphOptionalField::DEPENDS); - this->depends = details::parse_depends(deps); + this->depends = parse_depends(deps); } BinaryParagraph::BinaryParagraph(const SourceParagraph& spgh, const triplet& target_triplet) @@ -65,7 +65,7 @@ namespace vcpkg this->version = spgh.version; this->description = spgh.description; this->maintainer = spgh.maintainer; - this->depends = spgh.depends; + this->depends = filter_dependencies(spgh.depends, target_triplet); } std::string BinaryParagraph::displayname() const diff --git a/toolsrc/src/SourceParagraph.cpp b/toolsrc/src/SourceParagraph.cpp index 6f25dbded..bdf15a737 100644 --- a/toolsrc/src/SourceParagraph.cpp +++ b/toolsrc/src/SourceParagraph.cpp @@ -2,6 +2,7 @@ #include "vcpkglib_helpers.h" #include "vcpkg_System.h" #include "vcpkg_Maps.h" +#include "triplet.h" namespace vcpkg { @@ -44,7 +45,7 @@ namespace vcpkg this->maintainer = details::remove_optional_field(&fields, SourceParagraphOptionalField::MAINTAINER); std::string deps = details::remove_optional_field(&fields, SourceParagraphOptionalField::BUILD_DEPENDS); - this->depends = details::parse_depends(deps); + this->depends = expand_qualified_dependencies(parse_depends(deps)); if (!fields.empty()) { @@ -60,4 +61,84 @@ namespace vcpkg exit(EXIT_FAILURE); } } + + std::vector vcpkg::expand_qualified_dependencies(const std::vector& depends) + { + auto convert = [&](const std::string& depend_string) -> dependency { + auto pos = depend_string.find(' '); + if (pos == std::string::npos) + return{ depend_string, "" }; + // expect of the form "\w+ \[\w+\]" + dependency dep; + dep.name = depend_string.substr(0, pos); + if (depend_string.c_str()[pos + 1] != '[' || depend_string[depend_string.size() - 1] != ']') + { + // Error, but for now just slurp the entire string. + return{ depend_string, "" }; + } + dep.qualifier = depend_string.substr(pos + 2, depend_string.size() - pos - 3); + return dep; + }; + + std::vector ret; + + for (auto&& depend_string : depends) + { + ret.push_back(convert(depend_string)); + } + + return ret; + } + + std::vector parse_depends(const std::string& depends_string) + { + if (depends_string.empty()) + { + return{}; + } + + std::vector out; + + size_t cur = 0; + do + { + auto pos = depends_string.find(',', cur); + if (pos == std::string::npos) + { + out.push_back(depends_string.substr(cur)); + break; + } + out.push_back(depends_string.substr(cur, pos - cur)); + + // skip comma and space + ++pos; + if (depends_string[pos] == ' ') + { + ++pos; + } + + cur = pos; + } while (cur != std::string::npos); + + return out; + } + + std::vector filter_dependencies(const std::vector& deps, const triplet& t) + { + std::vector ret; + for (auto&& dep : deps) + { + if (dep.qualifier.empty() || t.canonical_name().find(dep.qualifier) != std::string::npos) + { + ret.push_back(dep.name); + } + } + return ret; + } + + std::ostream & operator<<(std::ostream & os, const dependency & p) + { + os << p.name; + return os; + } } diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_installation.cpp index 022b87139..f6aeafa02 100644 --- a/toolsrc/src/commands_installation.cpp +++ b/toolsrc/src/commands_installation.cpp @@ -138,7 +138,16 @@ namespace vcpkg const package_spec spec = Input::check_and_get_package_spec(args.command_arguments.at(0), default_target_triplet, example.c_str()); Input::check_triplet(spec.target_triplet(), paths); - std::unordered_set unmet_dependencies = Dependencies::find_unmet_dependencies(paths, spec, status_db); + + // Explicitly load and use the portfile's build dependencies when resolving the build command (instead of a cached package's dependencies). + auto first_level_deps = get_unmet_package_build_dependencies(paths, spec, status_db); + std::vector first_level_deps_specs; + for (auto&& dep : first_level_deps) + { + first_level_deps_specs.push_back(package_spec::from_name_and_triplet(dep, spec.target_triplet()).get_or_throw()); + } + + std::unordered_set unmet_dependencies = Dependencies::find_unmet_dependencies(paths, first_level_deps_specs, status_db); if (!unmet_dependencies.empty()) { System::println(System::color::error, "The build command requires all dependencies to be already installed."); diff --git a/toolsrc/src/lib.cpp b/toolsrc/src/lib.cpp index 45b73ee07..3c844ac3f 100644 --- a/toolsrc/src/lib.cpp +++ b/toolsrc/src/lib.cpp @@ -209,29 +209,33 @@ static void install_and_write_listfile(const vcpkg_paths& paths, const BinaryPar // TODO: Refactoring between this function and install_package std::vector vcpkg::get_unmet_package_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db) { - std::vector> pghs; - { - const fs::path packages_dir_control_file_path = paths.package_dir(spec) / "CONTROL"; + const fs::path packages_dir_control_file_path = paths.package_dir(spec) / "CONTROL"; - auto control_contents_maybe = Files::get_contents(packages_dir_control_file_path); - if (auto control_contents = control_contents_maybe.get()) + auto control_contents_maybe = Files::get_contents(packages_dir_control_file_path); + if (auto control_contents = control_contents_maybe.get()) + { + std::vector> pghs; + try + { + pghs = parse_paragraphs(*control_contents); + } + catch (std::runtime_error) { - try - { - pghs = parse_paragraphs(*control_contents); - } - catch (std::runtime_error) - { - } - Checks::check_exit(pghs.size() == 1, "Invalid control file at %s", packages_dir_control_file_path.string()); - return BinaryParagraph(pghs[0]).depends; } + Checks::check_exit(pghs.size() == 1, "Invalid control file at %s", packages_dir_control_file_path.string()); + return BinaryParagraph(pghs[0]).depends; } + return get_unmet_package_build_dependencies(paths, spec, status_db); +} + +std::vector vcpkg::get_unmet_package_build_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db) +{ const fs::path ports_dir_control_file_path = paths.port_dir(spec) / "CONTROL"; auto control_contents_maybe = Files::get_contents(ports_dir_control_file_path); if (auto control_contents = control_contents_maybe.get()) { + std::vector> pghs; try { pghs = parse_paragraphs(*control_contents); @@ -240,7 +244,7 @@ std::vector vcpkg::get_unmet_package_dependencies(const vcpkg_paths { } Checks::check_exit(pghs.size() == 1, "Invalid control file at %s", ports_dir_control_file_path.string()); - return SourceParagraph(pghs[0]).depends; + return filter_dependencies(SourceParagraph(pghs[0]).depends, spec.target_triplet()); } Checks::exit_with_message("Could not find package named %s", spec); @@ -252,11 +256,11 @@ void vcpkg::install_package(const vcpkg_paths& paths, const BinaryParagraph& bin spgh.package = binary_paragraph; spgh.want = want_t::install; spgh.state = install_state_t::half_installed; - for (const std::string& dependency : spgh.package.depends) + for (auto&& dep : spgh.package.depends) { - if (status_db.find_installed(dependency, spgh.package.spec.target_triplet()) == status_db.end()) + if (status_db.find_installed(dep, spgh.package.spec.target_triplet()) == status_db.end()) { - std::abort(); + Checks::unreachable(); } } write_update(paths, spgh); diff --git a/toolsrc/src/test.cpp b/toolsrc/src/test.cpp deleted file mode 100644 index fc49b362d..000000000 --- a/toolsrc/src/test.cpp +++ /dev/null @@ -1,347 +0,0 @@ -#include "CppUnitTest.h" -#include "vcpkg.h" - -#pragma comment(lib,"version") -#pragma comment(lib,"winhttp") - -using namespace Microsoft::VisualStudio::CppUnitTestFramework; - -namespace Microsoft { namespace VisualStudio { namespace CppUnitTestFramework -{ - template <> - inline std::wstring ToString(const vcpkg::package_spec_parse_result& t) - { - return ToString(static_cast(t)); - } -}}} - -namespace UnitTest1 -{ - TEST_CLASS(ControlParsing) - { - public: - TEST_METHOD(SourceParagraph_Construct_Minimum) - { - vcpkg::SourceParagraph pgh({ - {"Source", "zlib"}, - {"Version", "1.2.8"} - }); - - Assert::AreEqual("zlib", pgh.name.c_str()); - Assert::AreEqual("1.2.8", pgh.version.c_str()); - Assert::AreEqual("", pgh.maintainer.c_str()); - Assert::AreEqual("", pgh.description.c_str()); - Assert::AreEqual(size_t(0), pgh.depends.size()); - } - - TEST_METHOD(SourceParagraph_Construct_Maximum) - { - vcpkg::SourceParagraph pgh({ - {"Source", "s"}, - {"Version", "v"}, - {"Maintainer", "m"}, - {"Description", "d"}, - {"Build-Depends", "bd"} - }); - Assert::AreEqual("s", pgh.name.c_str()); - Assert::AreEqual("v", pgh.version.c_str()); - Assert::AreEqual("m", pgh.maintainer.c_str()); - Assert::AreEqual("d", pgh.description.c_str()); - Assert::AreEqual(size_t(1), pgh.depends.size()); - Assert::AreEqual("bd", pgh.depends[0].c_str()); - } - - TEST_METHOD(SourceParagraph_Two_Depends) - { - vcpkg::SourceParagraph pgh({ - {"Source", "zlib"}, - {"Version", "1.2.8"}, - {"Build-Depends", "z, openssl"} - }); - - Assert::AreEqual(size_t(2), pgh.depends.size()); - Assert::AreEqual("z", pgh.depends[0].c_str()); - Assert::AreEqual("openssl", pgh.depends[1].c_str()); - } - - TEST_METHOD(SourceParagraph_Three_Depends) - { - vcpkg::SourceParagraph pgh({ - {"Source", "zlib"}, - {"Version", "1.2.8"}, - {"Build-Depends", "z, openssl, xyz"} - }); - - Assert::AreEqual(size_t(3), pgh.depends.size()); - Assert::AreEqual("z", pgh.depends[0].c_str()); - Assert::AreEqual("openssl", pgh.depends[1].c_str()); - Assert::AreEqual("xyz", pgh.depends[2].c_str()); - } - - TEST_METHOD(BinaryParagraph_Construct_Minimum) - { - vcpkg::BinaryParagraph pgh({ - {"Package", "zlib"}, - {"Version", "1.2.8"}, - {"Architecture", "a"}, - {"Multi-Arch", "same"}, - }); - - Assert::AreEqual("zlib", pgh.spec.name().c_str()); - Assert::AreEqual("1.2.8", pgh.version.c_str()); - Assert::AreEqual("", pgh.maintainer.c_str()); - Assert::AreEqual("", pgh.description.c_str()); - Assert::AreEqual("a", pgh.spec.target_triplet().canonical_name().c_str()); - Assert::AreEqual(size_t(0), pgh.depends.size()); - } - - TEST_METHOD(BinaryParagraph_Construct_Maximum) - { - vcpkg::BinaryParagraph pgh({ - {"Package", "s"}, - {"Version", "v"}, - {"Architecture", "a"}, - {"Multi-Arch", "same"}, - {"Maintainer", "m"}, - {"Description", "d"}, - {"Depends", "bd"} - }); - Assert::AreEqual("s", pgh.spec.name().c_str()); - Assert::AreEqual("v", pgh.version.c_str()); - Assert::AreEqual("m", pgh.maintainer.c_str()); - Assert::AreEqual("d", pgh.description.c_str()); - Assert::AreEqual(size_t(1), pgh.depends.size()); - Assert::AreEqual("bd", pgh.depends[0].c_str()); - } - - TEST_METHOD(BinaryParagraph_Three_Depends) - { - vcpkg::BinaryParagraph pgh({ - {"Package", "zlib"}, - {"Version", "1.2.8"}, - {"Architecture", "a"}, - {"Multi-Arch", "same"}, - {"Depends", "a, b, c"}, - }); - - Assert::AreEqual(size_t(3), pgh.depends.size()); - Assert::AreEqual("a", pgh.depends[0].c_str()); - Assert::AreEqual("b", pgh.depends[1].c_str()); - Assert::AreEqual("c", pgh.depends[2].c_str()); - } - - TEST_METHOD(parse_paragraphs_empty) - { - const char* str = ""; - auto pghs = vcpkg::parse_paragraphs(str); - Assert::IsTrue(pghs.empty()); - } - - TEST_METHOD(parse_paragraphs_one_field) - { - const char* str = "f1: v1"; - auto pghs = vcpkg::parse_paragraphs(str); - Assert::AreEqual(size_t(1), pghs.size()); - Assert::AreEqual(size_t(1), pghs[0].size()); - Assert::AreEqual("v1", pghs[0]["f1"].c_str()); - } - - TEST_METHOD(parse_paragraphs_one_pgh) - { - const char* str = - "f1: v1\n" - "f2: v2"; - auto pghs = vcpkg::parse_paragraphs(str); - Assert::AreEqual(size_t(1), pghs.size()); - Assert::AreEqual(size_t(2), pghs[0].size()); - Assert::AreEqual("v1", pghs[0]["f1"].c_str()); - Assert::AreEqual("v2", pghs[0]["f2"].c_str()); - } - - TEST_METHOD(parse_paragraphs_two_pgh) - { - const char* str = - "f1: v1\n" - "f2: v2\n" - "\n" - "f3: v3\n" - "f4: v4"; - auto pghs = vcpkg::parse_paragraphs(str); - Assert::AreEqual(size_t(2), pghs.size()); - Assert::AreEqual(size_t(2), pghs[0].size()); - Assert::AreEqual("v1", pghs[0]["f1"].c_str()); - Assert::AreEqual("v2", pghs[0]["f2"].c_str()); - Assert::AreEqual(size_t(2), pghs[1].size()); - Assert::AreEqual("v3", pghs[1]["f3"].c_str()); - Assert::AreEqual("v4", pghs[1]["f4"].c_str()); - } - - TEST_METHOD(parse_paragraphs_field_names) - { - const char* str = - "1:\n" - "f:\n" - "F:\n" - "0:\n" - "F-2:\n"; - auto pghs = vcpkg::parse_paragraphs(str); - Assert::AreEqual(size_t(1), pghs.size()); - Assert::AreEqual(size_t(5), pghs[0].size()); - } - - TEST_METHOD(parse_paragraphs_multiple_blank_lines) - { - const char* str = - "f1: v1\n" - "f2: v2\n" - "\n" - "\n" - "f3: v3\n" - "f4: v4"; - auto pghs = vcpkg::parse_paragraphs(str); - Assert::AreEqual(size_t(2), pghs.size()); - } - - TEST_METHOD(parse_paragraphs_empty_fields) - { - const char* str = - "f1:\n" - "f2: "; - auto pghs = vcpkg::parse_paragraphs(str); - Assert::AreEqual(size_t(1), pghs.size()); - Assert::AreEqual(size_t(2), pghs[0].size()); - Assert::AreEqual("", pghs[0]["f1"].c_str()); - Assert::AreEqual("", pghs[0]["f2"].c_str()); - Assert::AreEqual(size_t(2), pghs[0].size()); - } - - TEST_METHOD(parse_paragraphs_multiline_fields) - { - const char* str = - "f1: simple\n" - " f1\r\n" - "f2:\r\n" - " f2\r\n" - " continue\r\n"; - auto pghs = vcpkg::parse_paragraphs(str); - Assert::AreEqual(size_t(1), pghs.size()); - Assert::AreEqual("simple\n f1", pghs[0]["f1"].c_str()); - Assert::AreEqual("\n f2\n continue", pghs[0]["f2"].c_str()); - } - - TEST_METHOD(parse_paragraphs_crlfs) - { - const char* str = - "f1: v1\r\n" - "f2: v2\r\n" - "\r\n" - "f3: v3\r\n" - "f4: v4"; - auto pghs = vcpkg::parse_paragraphs(str); - Assert::AreEqual(size_t(2), pghs.size()); - Assert::AreEqual(size_t(2), pghs[0].size()); - Assert::AreEqual("v1", pghs[0]["f1"].c_str()); - Assert::AreEqual("v2", pghs[0]["f2"].c_str()); - Assert::AreEqual(size_t(2), pghs[1].size()); - Assert::AreEqual("v3", pghs[1]["f3"].c_str()); - Assert::AreEqual("v4", pghs[1]["f4"].c_str()); - } - - TEST_METHOD(BinaryParagraph_serialize_min) - { - std::stringstream ss; - vcpkg::BinaryParagraph pgh({ - {"Package", "zlib"}, - {"Version", "1.2.8"}, - {"Architecture", "a"}, - {"Multi-Arch", "same"}, - }); - ss << pgh; - auto pghs = vcpkg::parse_paragraphs(ss.str()); - Assert::AreEqual(size_t(1), pghs.size()); - Assert::AreEqual(size_t(4), pghs[0].size()); - Assert::AreEqual("zlib", pghs[0]["Package"].c_str()); - Assert::AreEqual("1.2.8", pghs[0]["Version"].c_str()); - Assert::AreEqual("a", pghs[0]["Architecture"].c_str()); - Assert::AreEqual("same", pghs[0]["Multi-Arch"].c_str()); - } - - TEST_METHOD(BinaryParagraph_serialize_max) - { - std::stringstream ss; - vcpkg::BinaryParagraph pgh({ - {"Package", "zlib"}, - {"Version", "1.2.8"}, - {"Architecture", "a"}, - {"Description", "first line\n second line"}, - {"Maintainer", "abc "}, - {"Depends", "dep"}, - {"Multi-Arch", "same"}, - }); - ss << pgh; - auto pghs = vcpkg::parse_paragraphs(ss.str()); - Assert::AreEqual(size_t(1), pghs.size()); - Assert::AreEqual(size_t(7), pghs[0].size()); - Assert::AreEqual("zlib", pghs[0]["Package"].c_str()); - Assert::AreEqual("1.2.8", pghs[0]["Version"].c_str()); - Assert::AreEqual("a", pghs[0]["Architecture"].c_str()); - Assert::AreEqual("same", pghs[0]["Multi-Arch"].c_str()); - Assert::AreEqual("first line\n second line", pghs[0]["Description"].c_str()); - Assert::AreEqual("dep", pghs[0]["Depends"].c_str()); - } - - TEST_METHOD(BinaryParagraph_serialize_multiple_deps) - { - std::stringstream ss; - vcpkg::BinaryParagraph pgh({ - {"Package", "zlib"}, - {"Version", "1.2.8"}, - {"Architecture", "a"}, - {"Multi-Arch", "same"}, - {"Depends", "a, b, c"}, - }); - ss << pgh; - auto pghs = vcpkg::parse_paragraphs(ss.str()); - Assert::AreEqual(size_t(1), pghs.size()); - Assert::AreEqual("a, b, c", pghs[0]["Depends"].c_str()); - } - - TEST_METHOD(package_spec_parse) - { - vcpkg::expected spec = vcpkg::package_spec::from_string("zlib", vcpkg::triplet::X86_WINDOWS); - Assert::AreEqual(vcpkg::package_spec_parse_result::SUCCESS, vcpkg::to_package_spec_parse_result(spec.error_code())); - Assert::AreEqual("zlib", spec.get()->name().c_str()); - Assert::AreEqual(vcpkg::triplet::X86_WINDOWS.canonical_name(), spec.get()->target_triplet().canonical_name()); - } - - TEST_METHOD(package_spec_parse_with_arch) - { - vcpkg::expected spec = vcpkg::package_spec::from_string("zlib:x64-uwp", vcpkg::triplet::X86_WINDOWS); - Assert::AreEqual(vcpkg::package_spec_parse_result::SUCCESS, vcpkg::to_package_spec_parse_result(spec.error_code())); - Assert::AreEqual("zlib", spec.get()->name().c_str()); - Assert::AreEqual(vcpkg::triplet::X64_UWP.canonical_name(), spec.get()->target_triplet().canonical_name()); - } - - TEST_METHOD(package_spec_parse_with_multiple_colon) - { - auto ec = vcpkg::package_spec::from_string("zlib:x86-uwp:", vcpkg::triplet::X86_WINDOWS).error_code(); - Assert::AreEqual(vcpkg::package_spec_parse_result::TOO_MANY_COLONS, vcpkg::to_package_spec_parse_result(ec)); - } - - TEST_METHOD(utf8_to_utf16) - { - auto str = vcpkg::Strings::utf8_to_utf16("abc"); - Assert::AreEqual(L"abc", str.c_str()); - } - - TEST_METHOD(utf8_to_utf16_with_whitespace) - { - auto str = vcpkg::Strings::utf8_to_utf16("abc -x86-windows"); - Assert::AreEqual(L"abc -x86-windows", str.c_str()); - } - }; - - TEST_CLASS(Metrics) - { - }; -} diff --git a/toolsrc/src/tests_dependencies.cpp b/toolsrc/src/tests_dependencies.cpp new file mode 100644 index 000000000..bce1cab0e --- /dev/null +++ b/toolsrc/src/tests_dependencies.cpp @@ -0,0 +1,39 @@ +#include "CppUnitTest.h" +#include "SourceParagraph.h" +#include "triplet.h" + +#pragma comment(lib,"version") +#pragma comment(lib,"winhttp") + +using namespace Microsoft::VisualStudio::CppUnitTestFramework; + +using namespace vcpkg; + +namespace UnitTest1 +{ + TEST_CLASS(DependencyTests) + { + public: + TEST_METHOD(parse_depends_one) + { + auto v = expand_qualified_dependencies(parse_depends("libA [windows]")); + Assert::AreEqual(size_t(1), v.size()); + Assert::AreEqual("libA", v[0].name.c_str()); + Assert::AreEqual("windows", v[0].qualifier.c_str()); + } + + TEST_METHOD(filter_depends) + { + auto deps = expand_qualified_dependencies(parse_depends("libA [windows], libB, libC [uwp]")); + auto v = filter_dependencies(deps, triplet::X64_WINDOWS); + Assert::AreEqual(size_t(2), v.size()); + Assert::AreEqual("libA", v[0].c_str()); + Assert::AreEqual("libB", v[1].c_str()); + + auto v2 = filter_dependencies(deps, triplet::ARM_UWP); + Assert::AreEqual(size_t(2), v.size()); + Assert::AreEqual("libB", v2[0].c_str()); + Assert::AreEqual("libC", v2[1].c_str()); + } + }; +} diff --git a/toolsrc/src/tests_paragraph.cpp b/toolsrc/src/tests_paragraph.cpp new file mode 100644 index 000000000..b06359b90 --- /dev/null +++ b/toolsrc/src/tests_paragraph.cpp @@ -0,0 +1,367 @@ +#include "CppUnitTest.h" +#include "vcpkg.h" + +#pragma comment(lib,"version") +#pragma comment(lib,"winhttp") + +using namespace Microsoft::VisualStudio::CppUnitTestFramework; + +namespace Microsoft { namespace VisualStudio { namespace CppUnitTestFramework +{ + template <> + inline std::wstring ToString(const vcpkg::package_spec_parse_result& t) + { + return ToString(static_cast(t)); + } +}}} + +namespace UnitTest1 +{ + TEST_CLASS(ControlParsing) + { + public: + TEST_METHOD(SourceParagraph_Construct_Minimum) + { + vcpkg::SourceParagraph pgh({ + {"Source", "zlib"}, + {"Version", "1.2.8"} + }); + + Assert::AreEqual("zlib", pgh.name.c_str()); + Assert::AreEqual("1.2.8", pgh.version.c_str()); + Assert::AreEqual("", pgh.maintainer.c_str()); + Assert::AreEqual("", pgh.description.c_str()); + Assert::AreEqual(size_t(0), pgh.depends.size()); + } + + TEST_METHOD(SourceParagraph_Construct_Maximum) + { + vcpkg::SourceParagraph pgh({ + {"Source", "s"}, + {"Version", "v"}, + {"Maintainer", "m"}, + {"Description", "d"}, + {"Build-Depends", "bd"} + }); + Assert::AreEqual("s", pgh.name.c_str()); + Assert::AreEqual("v", pgh.version.c_str()); + Assert::AreEqual("m", pgh.maintainer.c_str()); + Assert::AreEqual("d", pgh.description.c_str()); + Assert::AreEqual(size_t(1), pgh.depends.size()); + Assert::AreEqual("bd", pgh.depends[0].name.c_str()); + } + + TEST_METHOD(SourceParagraph_Two_Depends) + { + vcpkg::SourceParagraph pgh({ + {"Source", "zlib"}, + {"Version", "1.2.8"}, + {"Build-Depends", "z, openssl"} + }); + + Assert::AreEqual(size_t(2), pgh.depends.size()); + Assert::AreEqual("z", pgh.depends[0].name.c_str()); + Assert::AreEqual("openssl", pgh.depends[1].name.c_str()); + } + + TEST_METHOD(SourceParagraph_Three_Depends) + { + vcpkg::SourceParagraph pgh({ + {"Source", "zlib"}, + {"Version", "1.2.8"}, + {"Build-Depends", "z, openssl, xyz"} + }); + + Assert::AreEqual(size_t(3), pgh.depends.size()); + Assert::AreEqual("z", pgh.depends[0].name.c_str()); + Assert::AreEqual("openssl", pgh.depends[1].name.c_str()); + Assert::AreEqual("xyz", pgh.depends[2].name.c_str()); + } + + TEST_METHOD(SourceParagraph_Construct_Qualified_Depends) + { + vcpkg::SourceParagraph pgh({ + { "Source", "zlib" }, + { "Version", "1.2.8" }, + { "Build-Depends", "libA [windows], libB [uwp]" } + }); + + Assert::AreEqual("zlib", pgh.name.c_str()); + Assert::AreEqual("1.2.8", pgh.version.c_str()); + Assert::AreEqual("", pgh.maintainer.c_str()); + Assert::AreEqual("", pgh.description.c_str()); + Assert::AreEqual(size_t(2), pgh.depends.size()); + Assert::AreEqual("libA", pgh.depends[0].name.c_str()); + Assert::AreEqual("windows", pgh.depends[0].qualifier.c_str()); + Assert::AreEqual("libB", pgh.depends[1].name.c_str()); + Assert::AreEqual("uwp", pgh.depends[1].qualifier.c_str()); + } + + + TEST_METHOD(BinaryParagraph_Construct_Minimum) + { + vcpkg::BinaryParagraph pgh({ + {"Package", "zlib"}, + {"Version", "1.2.8"}, + {"Architecture", "x86-windows"}, + {"Multi-Arch", "same"}, + }); + + Assert::AreEqual("zlib", pgh.spec.name().c_str()); + Assert::AreEqual("1.2.8", pgh.version.c_str()); + Assert::AreEqual("", pgh.maintainer.c_str()); + Assert::AreEqual("", pgh.description.c_str()); + Assert::AreEqual("x86-windows", pgh.spec.target_triplet().canonical_name().c_str()); + Assert::AreEqual(size_t(0), pgh.depends.size()); + } + + TEST_METHOD(BinaryParagraph_Construct_Maximum) + { + vcpkg::BinaryParagraph pgh({ + {"Package", "s"}, + {"Version", "v"}, + {"Architecture", "x86-windows"}, + {"Multi-Arch", "same"}, + {"Maintainer", "m"}, + {"Description", "d"}, + {"Depends", "bd"} + }); + Assert::AreEqual("s", pgh.spec.name().c_str()); + Assert::AreEqual("v", pgh.version.c_str()); + Assert::AreEqual("m", pgh.maintainer.c_str()); + Assert::AreEqual("d", pgh.description.c_str()); + Assert::AreEqual(size_t(1), pgh.depends.size()); + Assert::AreEqual("bd", pgh.depends[0].c_str()); + } + + TEST_METHOD(BinaryParagraph_Three_Depends) + { + vcpkg::BinaryParagraph pgh({ + {"Package", "zlib"}, + {"Version", "1.2.8"}, + {"Architecture", "x86-windows"}, + {"Multi-Arch", "same"}, + {"Depends", "a, b, c"}, + }); + + Assert::AreEqual(size_t(3), pgh.depends.size()); + Assert::AreEqual("a", pgh.depends[0].c_str()); + Assert::AreEqual("b", pgh.depends[1].c_str()); + Assert::AreEqual("c", pgh.depends[2].c_str()); + } + + TEST_METHOD(parse_paragraphs_empty) + { + const char* str = ""; + auto pghs = vcpkg::parse_paragraphs(str); + Assert::IsTrue(pghs.empty()); + } + + TEST_METHOD(parse_paragraphs_one_field) + { + const char* str = "f1: v1"; + auto pghs = vcpkg::parse_paragraphs(str); + Assert::AreEqual(size_t(1), pghs.size()); + Assert::AreEqual(size_t(1), pghs[0].size()); + Assert::AreEqual("v1", pghs[0]["f1"].c_str()); + } + + TEST_METHOD(parse_paragraphs_one_pgh) + { + const char* str = + "f1: v1\n" + "f2: v2"; + auto pghs = vcpkg::parse_paragraphs(str); + Assert::AreEqual(size_t(1), pghs.size()); + Assert::AreEqual(size_t(2), pghs[0].size()); + Assert::AreEqual("v1", pghs[0]["f1"].c_str()); + Assert::AreEqual("v2", pghs[0]["f2"].c_str()); + } + + TEST_METHOD(parse_paragraphs_two_pgh) + { + const char* str = + "f1: v1\n" + "f2: v2\n" + "\n" + "f3: v3\n" + "f4: v4"; + auto pghs = vcpkg::parse_paragraphs(str); + Assert::AreEqual(size_t(2), pghs.size()); + Assert::AreEqual(size_t(2), pghs[0].size()); + Assert::AreEqual("v1", pghs[0]["f1"].c_str()); + Assert::AreEqual("v2", pghs[0]["f2"].c_str()); + Assert::AreEqual(size_t(2), pghs[1].size()); + Assert::AreEqual("v3", pghs[1]["f3"].c_str()); + Assert::AreEqual("v4", pghs[1]["f4"].c_str()); + } + + TEST_METHOD(parse_paragraphs_field_names) + { + const char* str = + "1:\n" + "f:\n" + "F:\n" + "0:\n" + "F-2:\n"; + auto pghs = vcpkg::parse_paragraphs(str); + Assert::AreEqual(size_t(1), pghs.size()); + Assert::AreEqual(size_t(5), pghs[0].size()); + } + + TEST_METHOD(parse_paragraphs_multiple_blank_lines) + { + const char* str = + "f1: v1\n" + "f2: v2\n" + "\n" + "\n" + "f3: v3\n" + "f4: v4"; + auto pghs = vcpkg::parse_paragraphs(str); + Assert::AreEqual(size_t(2), pghs.size()); + } + + TEST_METHOD(parse_paragraphs_empty_fields) + { + const char* str = + "f1:\n" + "f2: "; + auto pghs = vcpkg::parse_paragraphs(str); + Assert::AreEqual(size_t(1), pghs.size()); + Assert::AreEqual(size_t(2), pghs[0].size()); + Assert::AreEqual("", pghs[0]["f1"].c_str()); + Assert::AreEqual("", pghs[0]["f2"].c_str()); + Assert::AreEqual(size_t(2), pghs[0].size()); + } + + TEST_METHOD(parse_paragraphs_multiline_fields) + { + const char* str = + "f1: simple\n" + " f1\r\n" + "f2:\r\n" + " f2\r\n" + " continue\r\n"; + auto pghs = vcpkg::parse_paragraphs(str); + Assert::AreEqual(size_t(1), pghs.size()); + Assert::AreEqual("simple\n f1", pghs[0]["f1"].c_str()); + Assert::AreEqual("\n f2\n continue", pghs[0]["f2"].c_str()); + } + + TEST_METHOD(parse_paragraphs_crlfs) + { + const char* str = + "f1: v1\r\n" + "f2: v2\r\n" + "\r\n" + "f3: v3\r\n" + "f4: v4"; + auto pghs = vcpkg::parse_paragraphs(str); + Assert::AreEqual(size_t(2), pghs.size()); + Assert::AreEqual(size_t(2), pghs[0].size()); + Assert::AreEqual("v1", pghs[0]["f1"].c_str()); + Assert::AreEqual("v2", pghs[0]["f2"].c_str()); + Assert::AreEqual(size_t(2), pghs[1].size()); + Assert::AreEqual("v3", pghs[1]["f3"].c_str()); + Assert::AreEqual("v4", pghs[1]["f4"].c_str()); + } + + TEST_METHOD(BinaryParagraph_serialize_min) + { + std::stringstream ss; + vcpkg::BinaryParagraph pgh({ + {"Package", "zlib"}, + {"Version", "1.2.8"}, + {"Architecture", "x86-windows"}, + {"Multi-Arch", "same"}, + }); + ss << pgh; + auto pghs = vcpkg::parse_paragraphs(ss.str()); + Assert::AreEqual(size_t(1), pghs.size()); + Assert::AreEqual(size_t(4), pghs[0].size()); + Assert::AreEqual("zlib", pghs[0]["Package"].c_str()); + Assert::AreEqual("1.2.8", pghs[0]["Version"].c_str()); + Assert::AreEqual("x86-windows", pghs[0]["Architecture"].c_str()); + Assert::AreEqual("same", pghs[0]["Multi-Arch"].c_str()); + } + + TEST_METHOD(BinaryParagraph_serialize_max) + { + std::stringstream ss; + vcpkg::BinaryParagraph pgh({ + {"Package", "zlib"}, + {"Version", "1.2.8"}, + {"Architecture", "x86-windows"}, + {"Description", "first line\n second line"}, + {"Maintainer", "abc "}, + {"Depends", "dep"}, + {"Multi-Arch", "same"}, + }); + ss << pgh; + auto pghs = vcpkg::parse_paragraphs(ss.str()); + Assert::AreEqual(size_t(1), pghs.size()); + Assert::AreEqual(size_t(7), pghs[0].size()); + Assert::AreEqual("zlib", pghs[0]["Package"].c_str()); + Assert::AreEqual("1.2.8", pghs[0]["Version"].c_str()); + Assert::AreEqual("x86-windows", pghs[0]["Architecture"].c_str()); + Assert::AreEqual("same", pghs[0]["Multi-Arch"].c_str()); + Assert::AreEqual("first line\n second line", pghs[0]["Description"].c_str()); + Assert::AreEqual("dep", pghs[0]["Depends"].c_str()); + } + + TEST_METHOD(BinaryParagraph_serialize_multiple_deps) + { + std::stringstream ss; + vcpkg::BinaryParagraph pgh({ + {"Package", "zlib"}, + {"Version", "1.2.8"}, + {"Architecture", "x86-windows"}, + {"Multi-Arch", "same"}, + {"Depends", "a, b, c"}, + }); + ss << pgh; + auto pghs = vcpkg::parse_paragraphs(ss.str()); + Assert::AreEqual(size_t(1), pghs.size()); + Assert::AreEqual("a, b, c", pghs[0]["Depends"].c_str()); + } + + TEST_METHOD(package_spec_parse) + { + vcpkg::expected spec = vcpkg::package_spec::from_string("zlib", vcpkg::triplet::X86_WINDOWS); + Assert::AreEqual(vcpkg::package_spec_parse_result::SUCCESS, vcpkg::to_package_spec_parse_result(spec.error_code())); + Assert::AreEqual("zlib", spec.get()->name().c_str()); + Assert::AreEqual(vcpkg::triplet::X86_WINDOWS.canonical_name(), spec.get()->target_triplet().canonical_name()); + } + + TEST_METHOD(package_spec_parse_with_arch) + { + vcpkg::expected spec = vcpkg::package_spec::from_string("zlib:x64-uwp", vcpkg::triplet::X86_WINDOWS); + Assert::AreEqual(vcpkg::package_spec_parse_result::SUCCESS, vcpkg::to_package_spec_parse_result(spec.error_code())); + Assert::AreEqual("zlib", spec.get()->name().c_str()); + Assert::AreEqual(vcpkg::triplet::X64_UWP.canonical_name(), spec.get()->target_triplet().canonical_name()); + } + + TEST_METHOD(package_spec_parse_with_multiple_colon) + { + auto ec = vcpkg::package_spec::from_string("zlib:x86-uwp:", vcpkg::triplet::X86_WINDOWS).error_code(); + Assert::AreEqual(vcpkg::package_spec_parse_result::TOO_MANY_COLONS, vcpkg::to_package_spec_parse_result(ec)); + } + + TEST_METHOD(utf8_to_utf16) + { + auto str = vcpkg::Strings::utf8_to_utf16("abc"); + Assert::AreEqual(L"abc", str.c_str()); + } + + TEST_METHOD(utf8_to_utf16_with_whitespace) + { + auto str = vcpkg::Strings::utf8_to_utf16("abc -x86-windows"); + Assert::AreEqual(L"abc -x86-windows", str.c_str()); + } + }; + + TEST_CLASS(Metrics) + { + }; +} diff --git a/toolsrc/src/vcpkg_Checks.cpp b/toolsrc/src/vcpkg_Checks.cpp index db6c03480..453ba81fd 100644 --- a/toolsrc/src/vcpkg_Checks.cpp +++ b/toolsrc/src/vcpkg_Checks.cpp @@ -8,6 +8,9 @@ namespace vcpkg {namespace Checks void unreachable() { System::println(System::color::error, "Error: Unreachable code was reached"); +#ifndef NDEBUG + std::abort(); +#endif exit(EXIT_FAILURE); } diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp index 54b37cd11..0e45b28dd 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg_Dependencies.cpp @@ -57,11 +57,9 @@ namespace vcpkg { namespace Dependencies return build_dependency_graph(paths, specs, status_db).find_topological_sort(); } - std::unordered_set find_unmet_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db) + std::unordered_set find_unmet_dependencies(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db) { - const Graphs::Graph dependency_graph = build_dependency_graph(paths, {spec}, status_db); - std::unordered_set key_set = Maps::extract_key_set(dependency_graph.adjacency_list()); - key_set.erase(spec); - return key_set; + const Graphs::Graph dependency_graph = build_dependency_graph(paths, specs, status_db); + return Maps::extract_key_set(dependency_graph.adjacency_list()); } }} diff --git a/toolsrc/src/vcpkglib_helpers.cpp b/toolsrc/src/vcpkglib_helpers.cpp index 3d14d4b06..61dc4f4cc 100644 --- a/toolsrc/src/vcpkglib_helpers.cpp +++ b/toolsrc/src/vcpkglib_helpers.cpp @@ -45,37 +45,4 @@ namespace vcpkg {namespace details return value; } - std::vector parse_depends(const std::string& depends_string) - { - if (depends_string.empty()) - { - return {}; - } - - std::vector out; - - size_t cur = 0; - do - { - auto pos = depends_string.find(',', cur); - if (pos == std::string::npos) - { - out.push_back(depends_string.substr(cur)); - break; - } - out.push_back(depends_string.substr(cur, pos - cur)); - - // skip comma and space - ++pos; - if (depends_string[pos] == ' ') - { - ++pos; - } - - cur = pos; - } - while (cur != std::string::npos); - - return out; - } }} diff --git a/toolsrc/vcpkgtest/vcpkgtest.vcxproj b/toolsrc/vcpkgtest/vcpkgtest.vcxproj index 3d9503374..d14f86745 100644 --- a/toolsrc/vcpkgtest/vcpkgtest.vcxproj +++ b/toolsrc/vcpkgtest/vcpkgtest.vcxproj @@ -19,7 +19,8 @@ - + + @@ -116,7 +117,7 @@ NotUsing Level3 Disabled - ..\include;$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories) + ..\include;$(VCInstallDir)UnitTest\include;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\UnitTest\include;%(AdditionalIncludeDirectories) _DEBUG;%(PreprocessorDefinitions) true diff --git a/toolsrc/vcpkgtest/vcpkgtest.vcxproj.filters b/toolsrc/vcpkgtest/vcpkgtest.vcxproj.filters index 9db7e6ef8..bbbc6bd40 100644 --- a/toolsrc/vcpkgtest/vcpkgtest.vcxproj.filters +++ b/toolsrc/vcpkgtest/vcpkgtest.vcxproj.filters @@ -15,7 +15,10 @@ - + + Source Files + + Source Files -- cgit v1.2.3 From 8b95900a7e232addb7fb593ebc305610be7ba928 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 5 Nov 2016 01:04:45 -0700 Subject: [cpprestsdk] Qualify all dependencies as not needed for uwp. --- ports/cpprestsdk/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/cpprestsdk/CONTROL b/ports/cpprestsdk/CONTROL index db1c9038e..b3438026f 100644 --- a/ports/cpprestsdk/CONTROL +++ b/ports/cpprestsdk/CONTROL @@ -1,5 +1,5 @@ Source: cpprestsdk Version: 2.9.0-1 -Build-Depends: zlib, openssl, boost +Build-Depends: zlib [windows], openssl [windows], boost [windows] Description: C++11 JSON, REST, and OAuth library The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services. \ No newline at end of file -- cgit v1.2.3 From 179f1148dc4cc7f7a5c2a7e7e2aa7f71c1356801 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 5 Nov 2016 02:15:55 -0700 Subject: [zeromq] Update to official release of 4.2.0 --- ports/zeromq/CONTROL | 2 +- ports/zeromq/portfile.cmake | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/zeromq/CONTROL b/ports/zeromq/CONTROL index 9ea585232..8274ec0fd 100644 --- a/ports/zeromq/CONTROL +++ b/ports/zeromq/CONTROL @@ -1,3 +1,3 @@ Source: zeromq -Version: 4.2.x.1a02b1b3f2 +Version: 4.2.0 Description: The ZeroMQ lightweight messaging kernel is a library which extends the standard socket interfaces with features traditionally provided by specialised messaging middleware products diff --git a/ports/zeromq/portfile.cmake b/ports/zeromq/portfile.cmake index 0f75902cc..3679a6b35 100644 --- a/ports/zeromq/portfile.cmake +++ b/ports/zeromq/portfile.cmake @@ -2,9 +2,9 @@ include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libzmq-1a02b1b3f2fde6288579cbb0ff9a0b1f195e1812) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/zeromq/libzmq/archive/1a02b1b3f2fde6288579cbb0ff9a0b1f195e1812.zip" - FILENAME "zeromq-1a02b1b3f2fde6288579cbb0ff9a0b1f195e1812.zip" - SHA512 64a5cfb23dd2daa99c9c5a5e2b0693458658e34102b07169a43c63c159af88181ec36caaaa2c780303c4ceba3c4b901e409baebaf12106bdf6a14c5832dfa219 + URLS "https://github.com/zeromq/libzmq/releases/download/v4.2.0/zeromq-4.2.0.tar.gz" + FILENAME "zeromq-4.2.0.tar.gz" + SHA512 3b6f0a1869fb1663ea40b3c3aa088b81399a35c051e4ade2b30bbac60bfceefe6b4403248a4635fb31d33767c1e478342f61c47b0ffdb4501419c13590ebeb96 ) vcpkg_extract_source_archive(${ARCHIVE}) -- cgit v1.2.3 From ef4be3ab1d5619e13a0fe975772a4be200f47a6f Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 5 Nov 2016 03:17:06 -0700 Subject: [curl] Update to 7.51.0 --- ports/curl/CONTROL | 2 +- ports/curl/portfile.cmake | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/curl/CONTROL b/ports/curl/CONTROL index 259803ab7..26fe767c3 100644 --- a/ports/curl/CONTROL +++ b/ports/curl/CONTROL @@ -1,3 +1,3 @@ Source: curl -Version: 7.48.0 +Version: 7.51.0 Description: A library for transferring data with URLs \ No newline at end of file diff --git a/ports/curl/portfile.cmake b/ports/curl/portfile.cmake index 4207a27cc..d01abc0b0 100644 --- a/ports/curl/portfile.cmake +++ b/ports/curl/portfile.cmake @@ -3,11 +3,11 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) message(FATAL_ERROR "Static building not supported yet") endif() include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/curl-7.48.0) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/curl-curl-7_51_0) vcpkg_download_distfile(ARCHIVE_FILE - URLS "https://curl.haxx.se/download/curl-7.48.0.tar.bz2" - FILENAME "curl-7.48.0.tar.bz2" - SHA512 9bb554eaf4ccaced0fa9b38de4f381eab84b96c1aa07a45d83ddfd38a925044d0fe9fac517263f67f009d2294a31c33dedb2267defbab0cb14f96091bbed5f92 + URLS "https://github.com/curl/curl/archive/curl-7_51_0.tar.gz" + FILENAME "curl-7.51.0.tar.gz" + SHA512 88ec572efb1b2fb793dc26b627e54863718e774343283f0eb92022ce252f7798332d9d3f20f63e45c38576614a000abbf12570e91e14a118f150e0378f1a27e5 ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) -- cgit v1.2.3 From d26fff6e67c4f032dda402d0c7e94b3308e3710b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Sat, 5 Nov 2016 20:52:44 +0100 Subject: [curl] Change BUILD_CURL_TESTS to BUILD_TESTING It was changed between the previous version and the current one (https://github.com/curl/curl/commit/12e21fab26bd83dfa75f009a24380d144ea51857) --- ports/curl/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/curl/portfile.cmake b/ports/curl/portfile.cmake index d01abc0b0..17063f382 100644 --- a/ports/curl/portfile.cmake +++ b/ports/curl/portfile.cmake @@ -14,7 +14,7 @@ vcpkg_extract_source_archive(${ARCHIVE_FILE}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS - -DBUILD_CURL_TESTS=OFF + -DBUILD_TESTING=OFF -DBUILD_CURL_EXE=OFF -DENABLE_MANUAL=OFF OPTIONS_DEBUG -- cgit v1.2.3 From 6e9eafb7ed6a841e3c8eff8e3a674037a9f30f26 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sun, 6 Nov 2016 20:11:26 -0800 Subject: Do a git-reset after using git --worktree checkout --- scripts/doVcpkgRelease.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/doVcpkgRelease.ps1 b/scripts/doVcpkgRelease.ps1 index 97656ba69..fb964d0c3 100644 --- a/scripts/doVcpkgRelease.ps1 +++ b/scripts/doVcpkgRelease.ps1 @@ -54,6 +54,7 @@ for ($disableMetrics = 0; $disableMetrics -le 1; $disableMetrics++) $checkoutForBuildOnly = ".\scripts",".\toolsrc",".vcpkg-root" # Must be relative to the root of the repository Write-Verbose("Creating partial temporary checkout: $buildPath") git --git-dir="$dotGitDir" --work-tree="$workTreeForBuildOnly" checkout $gitHash -f -q -- $checkoutForBuildOnly + git reset & "$buildPath\scripts\bootstrap.ps1" -disableMetrics $disableMetrics @@ -62,6 +63,7 @@ for ($disableMetrics = 0; $disableMetrics -le 1; $disableMetrics++) $checkoutThisDir = ".\" # Must be relative to the root of the repository Write-Verbose("Creating temporary checkout: $releasePath") git --git-dir=$dotGitDir --work-tree=$workTree checkout $gitHash -f -q -- $checkoutThisDir + git reset Copy-Item $buildPath\vcpkg.exe $releasePath\vcpkg.exe | Out-Null Copy-Item $buildPath\scripts\vcpkgmetricsuploader.exe $releasePath\scripts\vcpkgmetricsuploader.exe | Out-Null -- cgit v1.2.3 From 83ffbf028f8a77bfab23328aa8f2280db5539329 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sun, 6 Nov 2016 20:11:50 -0800 Subject: [Maps] Add overload for map (existing: unordered_map) --- toolsrc/include/vcpkg_Maps.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/toolsrc/include/vcpkg_Maps.h b/toolsrc/include/vcpkg_Maps.h index 886889294..c67462a39 100644 --- a/toolsrc/include/vcpkg_Maps.h +++ b/toolsrc/include/vcpkg_Maps.h @@ -2,6 +2,7 @@ #include #include +#include namespace vcpkg { namespace Maps { @@ -26,4 +27,15 @@ namespace vcpkg { namespace Maps } return key_set; } + + template + std::vector extract_keys(const std::map& input_map) + { + std::vector key_set; + for (auto const& element : input_map) + { + key_set.push_back(element.first); + } + return key_set; + } }} -- cgit v1.2.3 From a6821438bc63a35efc79b53588149271652ec5e3 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sun, 6 Nov 2016 20:12:21 -0800 Subject: Make parameter const --- toolsrc/src/commands_search.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/commands_search.cpp b/toolsrc/src/commands_search.cpp index c90538e86..771b43507 100644 --- a/toolsrc/src/commands_search.cpp +++ b/toolsrc/src/commands_search.cpp @@ -51,7 +51,7 @@ namespace vcpkg } // At this point there is 1 argument - do_print(paths, [&](std::string& port_name) -> bool + do_print(paths, [&](const std::string& port_name) -> bool { return Strings::case_insensitive_ascii_find(port_name, args.command_arguments[0]) != port_name.end(); }); -- cgit v1.2.3 From e4cab414aee77b03140d0198ce8c0756c46b5c0a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sun, 6 Nov 2016 20:12:54 -0800 Subject: Add new command: portsdiff --- toolsrc/include/vcpkg_Commands.h | 2 + toolsrc/src/commands_other.cpp | 1 + toolsrc/src/commands_portsdiff.cpp | 155 ++++++++++++++++++++++++++++++++++++ toolsrc/vcpkg/vcpkg.vcxproj | 1 + toolsrc/vcpkg/vcpkg.vcxproj.filters | 3 + 5 files changed, 162 insertions(+) create mode 100644 toolsrc/src/commands_portsdiff.cpp diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index 3cc48ac89..8272929a7 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -30,6 +30,8 @@ namespace vcpkg void integrate_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + void portsdiff_command(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); diff --git a/toolsrc/src/commands_other.cpp b/toolsrc/src/commands_other.cpp index 148673afe..894beae27 100644 --- a/toolsrc/src/commands_other.cpp +++ b/toolsrc/src/commands_other.cpp @@ -86,6 +86,7 @@ namespace vcpkg {"import", import_command}, {"cache", cache_command}, {"internal_test", internal_test_command}, + {"portsdiff", portsdiff_command} }; return t; } diff --git a/toolsrc/src/commands_portsdiff.cpp b/toolsrc/src/commands_portsdiff.cpp new file mode 100644 index 000000000..e15db3567 --- /dev/null +++ b/toolsrc/src/commands_portsdiff.cpp @@ -0,0 +1,155 @@ +#include "vcpkg_Commands.h" +#include "vcpkg_System.h" +#include "vcpkg.h" +#include +#include +#include "vcpkg_Maps.h" +#include +#include +#include + +namespace vcpkg +{ + static void do_print_name_and_version(const std::vector& ports_to_print, const std::map& names_and_versions) + { + for (const std::string& name : ports_to_print) + { + const std::string& version = names_and_versions.at(name); + std::cout << std::left + << std::setw(20) << name << ' ' + << std::setw(16) << version << ' ' + << '\n'; + } + } + + static void do_print_name_and_previous_version_and_current_version(const std::vector& ports_to_print, + const std::map& previous_names_and_versions, + const std::map& current_names_and_versions) + { + for (const std::string& name : ports_to_print) + { + if (name == "") + { + continue; + } + + const std::string& previous_version = previous_names_and_versions.at(name); + const std::string& current_version = current_names_and_versions.at(name); + std::cout << std::left + << std::setw(20) << name << ' ' + << std::setw(16) << previous_version << " -> " << current_version + << '\n'; + } + } + + static std::map read_all_ports(const fs::path& ports_folder_path) + { + std::map names_and_versions; + + for (auto it = fs::directory_iterator(ports_folder_path); it != fs::directory_iterator(); ++it) + { + const fs::path& path = it->path(); + + try + { + auto pghs = get_paragraphs(path / "CONTROL"); + if (pghs.empty()) + continue; + auto srcpgh = SourceParagraph(pghs[0]); + names_and_versions.emplace(srcpgh.name, srcpgh.version); + } + catch (std::runtime_error const&) + { + } + } + + return names_and_versions; + } + + static std::map read_ports_from_commit(const vcpkg_paths& paths, const std::wstring& git_commit_id) + { + const fs::path dot_git_dir = paths.root / ".git"; + const std::wstring ports_dir_name_as_string = paths.ports.filename().native(); + const fs::path temp_checkout_path = paths.root / Strings::wformat(L"%s-%s", ports_dir_name_as_string, git_commit_id); + fs::create_directory(temp_checkout_path); + const std::wstring checkout_this_dir = Strings::wformat(LR"(.\%s)", ports_dir_name_as_string); // Must be relative to the root of the repository + + const std::wstring cmd = Strings::wformat(LR"(git --git-dir="%s" --work-tree="%s" checkout %s -f -q -- %s %s & git reset >NUL)", + dot_git_dir.native(), + temp_checkout_path.native(), + git_commit_id, + checkout_this_dir, + L".vcpkg-root"); + System::cmd_execute(cmd); + std::map names_and_versions = read_all_ports(temp_checkout_path / ports_dir_name_as_string); + fs::remove_all(temp_checkout_path); + return names_and_versions; + } + + 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")); + args.check_min_arg_count(1, example.c_str()); + args.check_max_arg_count(2, example.c_str()); + const std::wstring git_commit_id_for_previous_snapshot = Strings::utf8_to_utf16(args.command_arguments.at(0)); + const std::wstring git_commit_id_for_current_snapshot = args.command_arguments.size() < 2 ? L"HEAD" : Strings::utf8_to_utf16(args.command_arguments.at(1)); + + const std::map current_names_and_versions = read_ports_from_commit(paths, git_commit_id_for_current_snapshot); + const std::map previous_names_and_versions = read_ports_from_commit(paths, git_commit_id_for_previous_snapshot); + + // Already sorted, so set_difference can work on std::vector too + std::vector current_ports = Maps::extract_keys(current_names_and_versions); + std::vector previous_ports = Maps::extract_keys(previous_names_and_versions); + + std::vector added_ports; + std::set_difference( + current_ports.cbegin(), current_ports.cend(), + previous_ports.cbegin(), previous_ports.cend(), + std::back_inserter(added_ports)); + + if (!added_ports.empty()) + { + System::println("\nThe following %d ports were added:\n", added_ports.size()); + do_print_name_and_version(added_ports, current_names_and_versions); + } + + std::vector removed_ports; + std::set_difference( + previous_ports.cbegin(), previous_ports.cend(), + current_ports.cbegin(), current_ports.cend(), + std::back_inserter(removed_ports)); + + if (!removed_ports.empty()) + { + System::println("\nThe following %d ports were removed:\n", removed_ports.size()); + do_print_name_and_version(removed_ports, previous_names_and_versions); + } + + std::vector potentially_updated_ports; + std::set_intersection( + current_ports.cbegin(), current_ports.cend(), + previous_ports.cbegin(), previous_ports.cend(), + std::back_inserter(potentially_updated_ports)); + + std::vector updated_ports; + std::copy_if(potentially_updated_ports.cbegin(), potentially_updated_ports.cend(), std::back_inserter(updated_ports), + [&](const std::string& port) -> bool + { + return current_names_and_versions.at(port) != previous_names_and_versions.at(port); + } + ); + + if (!updated_ports.empty()) + { + System::println("\nThe following %d ports were updated:\n", updated_ports.size()); + do_print_name_and_previous_version_and_current_version(updated_ports, previous_names_and_versions, current_names_and_versions); + } + + if (added_ports.empty() && removed_ports.empty() && updated_ports.empty()) + { + System::println("There were no changes in the ports between the two commits."); + } + + exit(EXIT_SUCCESS); + } +} diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/vcpkg/vcpkg.vcxproj index ec877d09c..9d9022229 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj +++ b/toolsrc/vcpkg/vcpkg.vcxproj @@ -137,6 +137,7 @@ + diff --git a/toolsrc/vcpkg/vcpkg.vcxproj.filters b/toolsrc/vcpkg/vcpkg.vcxproj.filters index e46652d90..568850787 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj.filters +++ b/toolsrc/vcpkg/vcpkg.vcxproj.filters @@ -81,6 +81,9 @@ Source Files + + Source Files + -- cgit v1.2.3 From e745e3f8552f94554337b8535de9f5233dfc5d15 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sun, 6 Nov 2016 23:43:49 -0800 Subject: Update CHANGELOG and bump version to v0.0.50 --- CHANGELOG.md | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++ toolsrc/VERSION.txt | 2 +- 2 files changed, 72 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9fa0b2b27..395026a42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,74 @@ +vcpkg (0.0.50) +-------------- + * Add ports: + - apr 1.5.2 + - assimp 3.3.1 + - boost-di 1.0.1 + - bullet3 2.83.7.98d4780 + - catch 1.5.7 + - chakracore 1.2.0.0 + - cppwinrt 1.010.0.14393.0 + - cppzmq 0.0.0-1 + - cryptopp 5.6.5 + - double-conversion 2.0.1 + - dxut 11.14 + - fastlz 1.0 + - freeglut 3.0.0 + - geos 3.5.0 + - gettext 0.19 + - glbinding 2.1.1 + - glog 0.3.4-0472b91 + - harfbuzz 1.3.2 + - jxrlib 1.1 + - libbson 1.4.2 + - libccd 2.0.0 + - libmariadb 2.3.1 + - libmysql 5.7.16 + - libodb 2.4.0 + - libodb-sqlite 2.4.0 + - libogg 1.3.2 + - libraw 0.17.2 + - libtheora 1.1.1 + - libvorbis + - libwebp 0.5.1 + - libxml2 2.9.4 + - log4cplus 1.1.3-RC7 + - lua 5.3.3 + - mongo-c-driver 1.4.2 + - mongo-cxx-driver 3.0.2 + - nanodbc 2.12.4 + - openjpeg 2.1.2 + - pcre 8.38 + - pdcurses 3.4 + - physfs 2.0.3 + - rxcpp 2.3.0 + - spdlog 0.11.0 + - tbb 20160916 + - think-cell-range 1d785d9 + - utfcpp 2.3.4 + - wt 3.3.6 + - wtl 9.1 + - zeromq 4.2.0 + - zziplib 0.13.62 + * Update ports: + - boost 1.62 -> 1.62-1 + - cpprestsdk 2.8 -> 2.9.0-1 + - curl 7.48.0 -> 7.51.0 + - eigen3 3.2.9 -> 3.2.10-2 + - freetype 2.6.3 -> 2.6.3-1 + - glew 1.13.0 -> 2.0.0 + - openssl 1.0.2h -> 1.0.2j + - range-v3 0.0.0-1 -> 20150729-vcpkg2 + - sqlite3 3120200 -> 3.15.0 + * Add support for static libraries + * Add more post build checks + * Improve post build checks related to verifying information in the dll/pdb files (e.g. architecture) + * Many fixes in existing portfiles + * Various updates in FAQ + * Release builds now create pdbs (debug builds already did) + +-- vcpkg team WED, 07 Nov 2016 00:00:00 -0800 + vcpkg (0.0.40) -------------- * Add ports: diff --git a/toolsrc/VERSION.txt b/toolsrc/VERSION.txt index fe0104ac9..621ae62d1 100644 --- a/toolsrc/VERSION.txt +++ b/toolsrc/VERSION.txt @@ -1 +1 @@ -"0.0.40" \ No newline at end of file +"0.0.50" \ No newline at end of file -- cgit v1.2.3 From 355d79ea4098834634606f3eca65d1261474f0d9 Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Mon, 7 Nov 2016 23:25:20 +1100 Subject: remove tests from base repository --- tests/qt5/CMakeLists.txt | 8 -------- tests/qt5/main.cpp | 9 --------- 2 files changed, 17 deletions(-) delete mode 100644 tests/qt5/CMakeLists.txt delete mode 100644 tests/qt5/main.cpp diff --git a/tests/qt5/CMakeLists.txt b/tests/qt5/CMakeLists.txt deleted file mode 100644 index 777b37c01..000000000 --- a/tests/qt5/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ - -cmake_minimum_required(VERSION 3.2) -project(qt5-base-test) -set(CMAKE_AUTOMOC ON) -find_package(Qt5Widgets) -add_executable(test_qt main.cpp) - -target_link_libraries(test_qt Qt5::Widgets) diff --git a/tests/qt5/main.cpp b/tests/qt5/main.cpp deleted file mode 100644 index cec294069..000000000 --- a/tests/qt5/main.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include -#include -#include -int main(int argc, char** argv) { - auto buildABI = QSysInfo::buildAbi().toStdString(); - fprintf(stdout, "%s\n", buildABI.c_str()); - printf("%d\n", QSysInfo::windowsVersion()); - return 0; -} \ No newline at end of file -- cgit v1.2.3 From dcb9be0b42b991b81ab46e90253cdf55f2c5d12d Mon Sep 17 00:00:00 2001 From: Mateusz Adamczyk Date: Sat, 5 Nov 2016 18:41:40 +0100 Subject: Added Box2D (in default, static version) --- ports/box2d/CONTROL | 3 ++ ports/box2d/portfile.cmake | 85 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 ports/box2d/CONTROL create mode 100644 ports/box2d/portfile.cmake diff --git a/ports/box2d/CONTROL b/ports/box2d/CONTROL new file mode 100644 index 000000000..4126c7b89 --- /dev/null +++ b/ports/box2d/CONTROL @@ -0,0 +1,3 @@ +Source: box2d +Version: 374664b +Description: Box2D (http://box2d.org) is an open source C++ engine for simulating rigid bodies in 2D. diff --git a/ports/box2d/portfile.cmake b/ports/box2d/portfile.cmake new file mode 100644 index 000000000..e70c373eb --- /dev/null +++ b/ports/box2d/portfile.cmake @@ -0,0 +1,85 @@ +include(${CMAKE_TRIPLET_FILE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + message(FATAL_ERROR "Dynamic building not supported") +endif() + +# Get architecture params +set(PROJECT_ARCH "x64") +if(TRIPLET_SYSTEM_ARCH MATCHES "x86") + set(PROJECT_ARCH "Win32") +endif(TRIPLET_SYSTEM_ARCH MATCHES "x86") + +include(vcpkg_common_functions) +find_program(GIT git) + +set(GIT_URL "https://github.com/erincatto/Box2D.git") +set(GIT_REF "374664b") + +if(NOT EXISTS "${DOWNLOADS}/box2d.git") + message(STATUS "Cloning") + vcpkg_execute_required_process( + COMMAND ${GIT} clone --bare ${GIT_URL} ${DOWNLOADS}/box2d.git + WORKING_DIRECTORY ${DOWNLOADS} + LOGNAME clone + ) +endif() +message(STATUS "Cloning done") + +if(NOT EXISTS "${CURRENT_BUILDTREES_DIR}/src/.git") + message(STATUS "Adding worktree") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}) + vcpkg_execute_required_process( + COMMAND ${GIT} worktree add -f --detach ${CURRENT_BUILDTREES_DIR}/src ${GIT_REF} + WORKING_DIRECTORY ${DOWNLOADS}/box2d.git + LOGNAME worktree + ) +endif() +message(STATUS "Adding worktree done") + +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/) + +# Put the licence and readme files where vcpkg expects it +message(STATUS "Packaging license") +file(COPY ${SOURCE_PATH}/README.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/box2d) +file(COPY ${SOURCE_PATH}/Box2D/License.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/box2d) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/box2d/License.txt ${CURRENT_PACKAGES_DIR}/share/box2d/copyright) +message(STATUS "Packaging license done") + +# Building: +foreach(TYPE "Release" "Debug") + message(STATUS "Building ${TARGET_TRIPLET}-${TYPE}") + vcpkg_execute_required_process( + COMMAND "devenv.exe" + "./Box2D/Build/vs2015/Box2D.sln" + /Build "${TYPE}|${PROJECT_ARCH}" + /Project "./Box2D/Build/vs2015/Box2D.vcxproj" + /Projectconfig "${TYPE}|${PROJECT_ARCH}" + WORKING_DIRECTORY ${SOURCE_PATH} + LOGNAME build-${TARGET_TRIPLET}-${TYPE} + ) + message(STATUS "Building ${TARGET_TRIPLET}-${TYPE} done") + + message(STATUS "Packaging ${TARGET_TRIPLET}-${TYPE} lib") + set(TARGET_PATH "${CURRENT_PACKAGES_DIR}/lib") + if(TYPE STREQUAL Debug) + set(TARGET_PATH "${CURRENT_PACKAGES_DIR}/debug/lib") + endif(TYPE STREQUAL Debug) + + file( + INSTALL ${SOURCE_PATH}/Box2D/Build/vs2015/bin/${PROJECT_ARCH}/${TYPE}/ + DESTINATION ${TARGET_PATH} + FILES_MATCHING PATTERN "*.lib" + ) + file(RENAME ${TARGET_PATH}/Box2D.lib ${TARGET_PATH}/box2d.lib) + message(STATUS "Packaging ${TARGET_TRIPLET}-${TYPE} lib done") +endforeach() + +message(STATUS "Packaging headers") +file( + COPY ${SOURCE_PATH}/Box2D/Box2D + DESTINATION ${CURRENT_PACKAGES_DIR}/include + PATTERN "*.h" +) +message(STATUS "Packaging headers done") + +vcpkg_copy_pdbs() -- cgit v1.2.3 From 5dea0f41d183a89cbce8cdfed62cc80c4335566f Mon Sep 17 00:00:00 2001 From: Mateusz Adamczyk Date: Sun, 6 Nov 2016 14:55:26 +0100 Subject: Added dynamic linking for windows --- ports/box2d/dll.patch | 410 +++++++++++++++++++++++++++++++++++++++++++++ ports/box2d/portfile.cmake | 42 +++-- 2 files changed, 442 insertions(+), 10 deletions(-) create mode 100644 ports/box2d/dll.patch diff --git a/ports/box2d/dll.patch b/ports/box2d/dll.patch new file mode 100644 index 000000000..dd538ae08 --- /dev/null +++ b/ports/box2d/dll.patch @@ -0,0 +1,410 @@ +From 05e359c59228183562d636d8c4559730d3674fc7 Mon Sep 17 00:00:00 2001 +From: Mateusz Adamczyk +Date: Sun, 6 Nov 2016 00:27:18 +0100 +Subject: [PATCH] Auto-create dll + +--- + Box2D/Build/vs2015/Box2D.sln | 12 +- + Box2D/Build/vs2015/Box2D.vcxproj | 24 +++ + Box2D/Build/vs2015/Box2D_dll.vcxproj | 216 +++++++++++++++++++++++++++ + Box2D/Build/vs2015/Box2D_dll.vcxproj.filters | 27 ++++ + Box2D/Build/vs2015/createDef.ps1 | 18 +++ + Box2D/Build/vs2015/main.cpp | 8 + + 6 files changed, 304 insertions(+), 1 deletion(-) + create mode 100644 Box2D/Build/vs2015/Box2D_dll.vcxproj + create mode 100644 Box2D/Build/vs2015/Box2D_dll.vcxproj.filters + create mode 100644 Box2D/Build/vs2015/createDef.ps1 + create mode 100644 Box2D/Build/vs2015/main.cpp + +diff --git a/Box2D/Build/vs2015/Box2D.sln b/Box2D/Build/vs2015/Box2D.sln +index 68a6bac..cfdd4c3 100644 +--- a/Box2D/Build/vs2015/Box2D.sln ++++ b/Box2D/Build/vs2015/Box2D.sln +@@ -1,7 +1,7 @@ +  + Microsoft Visual Studio Solution File, Format Version 12.00 + # Visual Studio 14 +-VisualStudioVersion = 14.0.25123.0 ++VisualStudioVersion = 14.0.25420.1 + MinimumVisualStudioVersion = 10.0.40219.1 + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Box2D", "Box2D.vcxproj", "{98400D17-43A5-1A40-95BE-C53AC78E7694}" + EndProject +@@ -22,6 +22,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glew", "glew.vcxproj", "{CD + EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "imgui", "imgui.vcxproj", "{542D8CF8-03FC-43BB-9586-D95E98150A56}" + EndProject ++Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Box2D_dll", "Box2D_dll.vcxproj", "{6CF7BCAA-8E3A-42B2-8763-5E4B63A41D84}" ++EndProject + Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 +@@ -78,6 +80,14 @@ Global + {542D8CF8-03FC-43BB-9586-D95E98150A56}.Release|Win32.Build.0 = Release|Win32 + {542D8CF8-03FC-43BB-9586-D95E98150A56}.Release|x64.ActiveCfg = Release|x64 + {542D8CF8-03FC-43BB-9586-D95E98150A56}.Release|x64.Build.0 = Release|x64 ++ {6CF7BCAA-8E3A-42B2-8763-5E4B63A41D84}.Debug|Win32.ActiveCfg = Debug|Win32 ++ {6CF7BCAA-8E3A-42B2-8763-5E4B63A41D84}.Debug|Win32.Build.0 = Debug|Win32 ++ {6CF7BCAA-8E3A-42B2-8763-5E4B63A41D84}.Debug|x64.ActiveCfg = Debug|x64 ++ {6CF7BCAA-8E3A-42B2-8763-5E4B63A41D84}.Debug|x64.Build.0 = Debug|x64 ++ {6CF7BCAA-8E3A-42B2-8763-5E4B63A41D84}.Release|Win32.ActiveCfg = Release|Win32 ++ {6CF7BCAA-8E3A-42B2-8763-5E4B63A41D84}.Release|Win32.Build.0 = Release|Win32 ++ {6CF7BCAA-8E3A-42B2-8763-5E4B63A41D84}.Release|x64.ActiveCfg = Release|x64 ++ {6CF7BCAA-8E3A-42B2-8763-5E4B63A41D84}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE +diff --git a/Box2D/Build/vs2015/Box2D.vcxproj b/Box2D/Build/vs2015/Box2D.vcxproj +index 830803c..3d86e39 100644 +--- a/Box2D/Build/vs2015/Box2D.vcxproj ++++ b/Box2D/Build/vs2015/Box2D.vcxproj +@@ -107,6 +107,12 @@ + Windows + true + ++ ++ dumpbin /LINKERMEMBER:1 $(TargetPath) > $(TargetDir)\symbols.symb ++ ++ ++ Dumping symbols ++ + + + +@@ -137,6 +143,12 @@ + Windows + true + ++ ++ dumpbin /LINKERMEMBER:1 $(TargetPath) > $(TargetDir)\symbols.symb ++ ++ ++ Dumping symbols ++ + + + +@@ -168,6 +180,12 @@ + true + true + ++ ++ dumpbin /LINKERMEMBER:1 $(TargetPath) > $(TargetDir)\symbols.symb ++ ++ ++ Dumping symbols ++ + + + +@@ -202,6 +220,12 @@ + true + true + ++ ++ dumpbin /LINKERMEMBER:1 $(TargetPath) > $(TargetDir)\symbols.symb ++ ++ ++ Dumping symbols ++ + + + +diff --git a/Box2D/Build/vs2015/Box2D_dll.vcxproj b/Box2D/Build/vs2015/Box2D_dll.vcxproj +new file mode 100644 +index 0000000..5c438f6 +--- /dev/null ++++ b/Box2D/Build/vs2015/Box2D_dll.vcxproj +@@ -0,0 +1,216 @@ ++ ++ ++ ++ ++ Debug ++ Win32 ++ ++ ++ Release ++ Win32 ++ ++ ++ Debug ++ x64 ++ ++ ++ Release ++ x64 ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ {98400d17-43a5-1a40-95be-c53ac78e7694} ++ ++ ++ ++ {6CF7BCAA-8E3A-42B2-8763-5E4B63A41D84} ++ Win32Proj ++ Box2D_dll ++ 8.1 ++ ++ ++ ++ DynamicLibrary ++ true ++ v140 ++ Unicode ++ ++ ++ DynamicLibrary ++ false ++ v140 ++ true ++ Unicode ++ ++ ++ DynamicLibrary ++ true ++ v140 ++ Unicode ++ ++ ++ DynamicLibrary ++ false ++ v140 ++ true ++ Unicode ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ true ++ bin\dll\x$(PlatformArchitecture)\$(Configuration)\ ++ obj\x$(PlatformArchitecture)\$(Configuration)\Box2D\dll\ ++ Box2D ++ ++ ++ true ++ ++ ++ bin\dll\x$(PlatformArchitecture)\$(Configuration)\ ++ obj\x$(PlatformArchitecture)\$(Configuration)\Box2D\dll\ ++ Box2D ++ ++ ++ false ++ bin\dll\x$(PlatformArchitecture)\$(Configuration)\ ++ obj\x$(PlatformArchitecture)\$(Configuration)\Box2D\dll\ ++ Box2D ++ ++ ++ false ++ bin\dll\x$(PlatformArchitecture)\$(Configuration)\ ++ obj\x$(PlatformArchitecture)\$(Configuration)\Box2D\dll\ ++ Box2D ++ ++ ++ ++ ++ ++ Level3 ++ Disabled ++ WIN32;_DEBUG;_WINDOWS;_USRDLL;BOX2D_DLL_EXPORTS;%(PreprocessorDefinitions) ++ ++ ++ Windows ++ true ++ $(TargetDir)symbols.def ++ $(OutDir)Box2D$(TargetExt) ++ ++ ++ powershell -exec bypass $(SolutionDir)createDef.ps1 -symbols $(SolutionDir)\bin\x$(PlatformArchitecture)\$(Configuration)\symbols.symb -output $(TargetDir)symbols.def ++ ++ ++ Create def file ++ ++ ++ ++ ++ ++ ++ Level3 ++ Disabled ++ _DEBUG;_WINDOWS;_USRDLL;BOX2D_DLL_EXPORTS;%(PreprocessorDefinitions) ++ ++ ++ Windows ++ true ++ $(TargetDir)symbols.def ++ $(OutDir)Box2D$(TargetExt) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ powershell -exec bypass $(SolutionDir)createDef.ps1 -symbols $(SolutionDir)\bin\x$(PlatformArchitecture)\$(Configuration)\symbols.symb -output $(TargetDir)symbols.def ++ ++ ++ Create def file ++ ++ ++ ++ ++ Level3 ++ ++ ++ MaxSpeed ++ true ++ true ++ WIN32;NDEBUG;_WINDOWS;_USRDLL;BOX2D_DLL_EXPORTS;%(PreprocessorDefinitions) ++ ++ ++ Windows ++ true ++ true ++ true ++ $(TargetDir)symbols.def ++ $(OutDir)Box2D$(TargetExt) ++ ++ ++ powershell -exec bypass $(SolutionDir)createDef.ps1 -symbols $(SolutionDir)\bin\x$(PlatformArchitecture)\$(Configuration)\symbols.symb -output $(TargetDir)symbols.def ++ ++ ++ Create def file ++ ++ ++ ++ ++ Level3 ++ ++ ++ MaxSpeed ++ true ++ true ++ NDEBUG;_WINDOWS;_USRDLL;BOX2D_DLL_EXPORTS;%(PreprocessorDefinitions) ++ ++ ++ Windows ++ true ++ true ++ true ++ $(TargetDir)symbols.def ++ $(OutDir)Box2D$(TargetExt) ++ ++ ++ powershell -exec bypass $(SolutionDir)createDef.ps1 -symbols $(SolutionDir)\bin\x$(PlatformArchitecture)\$(Configuration)\symbols.symb -output $(TargetDir)symbols.def ++ ++ ++ Create def file ++ ++ ++ ++ ++ ++ +\ No newline at end of file +diff --git a/Box2D/Build/vs2015/Box2D_dll.vcxproj.filters b/Box2D/Build/vs2015/Box2D_dll.vcxproj.filters +new file mode 100644 +index 0000000..6e1dfcb +--- /dev/null ++++ b/Box2D/Build/vs2015/Box2D_dll.vcxproj.filters +@@ -0,0 +1,27 @@ ++ ++ ++ ++ ++ {4FC737F1-C7A5-4376-A066-2A32D752A2FF} ++ cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx ++ ++ ++ {93995380-89BD-4b04-88EB-625FBE52EBFB} ++ h;hh;hpp;hxx;hm;inl;inc;xsd ++ ++ ++ {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} ++ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms ++ ++ ++ ++ ++ Source Files ++ ++ ++ ++ ++ Source Files ++ ++ ++ +\ No newline at end of file +diff --git a/Box2D/Build/vs2015/createDef.ps1 b/Box2D/Build/vs2015/createDef.ps1 +new file mode 100644 +index 0000000..4939723 +--- /dev/null ++++ b/Box2D/Build/vs2015/createDef.ps1 +@@ -0,0 +1,18 @@ ++param( ++ [String] $symbols, ++ [String] $output ++) ++ ++Write-Output "LIBRARY Box2D" > $output ++Write-Output 'DESCRIPTION "Box2D dynamic link library"' >> $output ++Write-Output "EXPORTS" >> $output ++ ++$from = (Select-String $symbols -pattern "public symbols" | Select-Object LineNumber).LineNumber + 1 ++$to = (Select-String $symbols -pattern "Summary" | Select-Object LineNumber).LineNumber - 2 ++$no = 1 ++Get-Content $symbols -head $to ` ++ | Select-Object -Last ($to - $from) ` ++ | ForEach-Object { Write-Output $_.split()[-1] } ` ++ | Select-String -Pattern '^\?' ` ++ | ForEach-Object { Write-Output ("`t" + $_ + " @" + $no++) } ` ++ >> $output +\ No newline at end of file +diff --git a/Box2D/Build/vs2015/main.cpp b/Box2D/Build/vs2015/main.cpp +new file mode 100644 +index 0000000..72216f9 +--- /dev/null ++++ b/Box2D/Build/vs2015/main.cpp +@@ -0,0 +1,8 @@ ++#define WIN32_LEAN_AND_MEAN ++#include ++ ++BOOL APIENTRY DllMain(HANDLE hModule, ++ DWORD ul_reason_for_call, ++ LPVOID lpReserved) { ++ return TRUE; ++} +-- +2.10.2.windows.1 + diff --git a/ports/box2d/portfile.cmake b/ports/box2d/portfile.cmake index e70c373eb..59d7c119e 100644 --- a/ports/box2d/portfile.cmake +++ b/ports/box2d/portfile.cmake @@ -1,12 +1,11 @@ include(${CMAKE_TRIPLET_FILE}) -if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - message(FATAL_ERROR "Dynamic building not supported") -endif() # Get architecture params set(PROJECT_ARCH "x64") +set(PROJECT_ARCH_BITS "${PROJECT_ARCH}") if(TRIPLET_SYSTEM_ARCH MATCHES "x86") set(PROJECT_ARCH "Win32") + set(PROJECT_ARCH_BITS "x32") endif(TRIPLET_SYSTEM_ARCH MATCHES "x86") include(vcpkg_common_functions) @@ -38,6 +37,11 @@ message(STATUS "Adding worktree done") set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/) +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES "${CMAKE_CURRENT_LIST_DIR}/dll.patch" +) + # Put the licence and readme files where vcpkg expects it message(STATUS "Packaging license") file(COPY ${SOURCE_PATH}/README.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/box2d) @@ -46,32 +50,50 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/share/box2d/License.txt ${CURRENT_PACKAGES_D message(STATUS "Packaging license done") # Building: +set(PROJECT "./Box2D/Build/vs2015/Box2D.vcxproj") +set(OUTPUTS_PATH "${SOURCE_PATH}/Box2D/Build/vs2015/bin/${PROJECT_ARCH_BITS}") +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(PROJECT "./Box2D/Build/vs2015/Box2D_dll.vcxproj") + set(OUTPUTS_PATH "${SOURCE_PATH}/Box2D/Build/vs2015/bin/dll/${PROJECT_ARCH_BITS}") +endif(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + foreach(TYPE "Release" "Debug") message(STATUS "Building ${TARGET_TRIPLET}-${TYPE}") vcpkg_execute_required_process( COMMAND "devenv.exe" "./Box2D/Build/vs2015/Box2D.sln" /Build "${TYPE}|${PROJECT_ARCH}" - /Project "./Box2D/Build/vs2015/Box2D.vcxproj" + /Project "${PROJECT}" /Projectconfig "${TYPE}|${PROJECT_ARCH}" WORKING_DIRECTORY ${SOURCE_PATH} LOGNAME build-${TARGET_TRIPLET}-${TYPE} ) message(STATUS "Building ${TARGET_TRIPLET}-${TYPE} done") - message(STATUS "Packaging ${TARGET_TRIPLET}-${TYPE} lib") - set(TARGET_PATH "${CURRENT_PACKAGES_DIR}/lib") + set(TARGET_PATH "${CURRENT_PACKAGES_DIR}") if(TYPE STREQUAL Debug) - set(TARGET_PATH "${CURRENT_PACKAGES_DIR}/debug/lib") + set(TARGET_PATH "${CURRENT_PACKAGES_DIR}/debug") endif(TYPE STREQUAL Debug) + message(STATUS "Packaging ${TARGET_TRIPLET}-${TYPE} lib") file( - INSTALL ${SOURCE_PATH}/Box2D/Build/vs2015/bin/${PROJECT_ARCH}/${TYPE}/ - DESTINATION ${TARGET_PATH} + INSTALL ${OUTPUTS_PATH}/${TYPE}/ + DESTINATION ${TARGET_PATH}/lib FILES_MATCHING PATTERN "*.lib" ) - file(RENAME ${TARGET_PATH}/Box2D.lib ${TARGET_PATH}/box2d.lib) + file(RENAME ${TARGET_PATH}/lib/Box2D.lib ${TARGET_PATH}/lib/box2d.lib) message(STATUS "Packaging ${TARGET_TRIPLET}-${TYPE} lib done") + + if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + message(STATUS "Packaging ${TARGET_TRIPLET}-${TYPE} dll") + file( + INSTALL ${OUTPUTS_PATH}/${TYPE}/ + DESTINATION ${TARGET_PATH}/bin + FILES_MATCHING PATTERN "*.dll" + ) + file(RENAME ${TARGET_PATH}/bin/Box2D.dll ${TARGET_PATH}/bin/box2d.dll) + message(STATUS "Packaging ${TARGET_TRIPLET}-${TYPE} dll done") + endif(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) endforeach() message(STATUS "Packaging headers") -- cgit v1.2.3 From 9cc42fa390fa0c14846563d720312b77963ba991 Mon Sep 17 00:00:00 2001 From: Mateusz Adamczyk Date: Mon, 7 Nov 2016 22:09:43 +0100 Subject: Do not hack dll - always build only static lib --- ports/box2d/dll.patch | 410 --------------------------------------------- ports/box2d/portfile.cmake | 28 +--- 2 files changed, 5 insertions(+), 433 deletions(-) delete mode 100644 ports/box2d/dll.patch diff --git a/ports/box2d/dll.patch b/ports/box2d/dll.patch deleted file mode 100644 index dd538ae08..000000000 --- a/ports/box2d/dll.patch +++ /dev/null @@ -1,410 +0,0 @@ -From 05e359c59228183562d636d8c4559730d3674fc7 Mon Sep 17 00:00:00 2001 -From: Mateusz Adamczyk -Date: Sun, 6 Nov 2016 00:27:18 +0100 -Subject: [PATCH] Auto-create dll - ---- - Box2D/Build/vs2015/Box2D.sln | 12 +- - Box2D/Build/vs2015/Box2D.vcxproj | 24 +++ - Box2D/Build/vs2015/Box2D_dll.vcxproj | 216 +++++++++++++++++++++++++++ - Box2D/Build/vs2015/Box2D_dll.vcxproj.filters | 27 ++++ - Box2D/Build/vs2015/createDef.ps1 | 18 +++ - Box2D/Build/vs2015/main.cpp | 8 + - 6 files changed, 304 insertions(+), 1 deletion(-) - create mode 100644 Box2D/Build/vs2015/Box2D_dll.vcxproj - create mode 100644 Box2D/Build/vs2015/Box2D_dll.vcxproj.filters - create mode 100644 Box2D/Build/vs2015/createDef.ps1 - create mode 100644 Box2D/Build/vs2015/main.cpp - -diff --git a/Box2D/Build/vs2015/Box2D.sln b/Box2D/Build/vs2015/Box2D.sln -index 68a6bac..cfdd4c3 100644 ---- a/Box2D/Build/vs2015/Box2D.sln -+++ b/Box2D/Build/vs2015/Box2D.sln -@@ -1,7 +1,7 @@ -  - Microsoft Visual Studio Solution File, Format Version 12.00 - # Visual Studio 14 --VisualStudioVersion = 14.0.25123.0 -+VisualStudioVersion = 14.0.25420.1 - MinimumVisualStudioVersion = 10.0.40219.1 - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Box2D", "Box2D.vcxproj", "{98400D17-43A5-1A40-95BE-C53AC78E7694}" - EndProject -@@ -22,6 +22,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glew", "glew.vcxproj", "{CD - EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "imgui", "imgui.vcxproj", "{542D8CF8-03FC-43BB-9586-D95E98150A56}" - EndProject -+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Box2D_dll", "Box2D_dll.vcxproj", "{6CF7BCAA-8E3A-42B2-8763-5E4B63A41D84}" -+EndProject - Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 -@@ -78,6 +80,14 @@ Global - {542D8CF8-03FC-43BB-9586-D95E98150A56}.Release|Win32.Build.0 = Release|Win32 - {542D8CF8-03FC-43BB-9586-D95E98150A56}.Release|x64.ActiveCfg = Release|x64 - {542D8CF8-03FC-43BB-9586-D95E98150A56}.Release|x64.Build.0 = Release|x64 -+ {6CF7BCAA-8E3A-42B2-8763-5E4B63A41D84}.Debug|Win32.ActiveCfg = Debug|Win32 -+ {6CF7BCAA-8E3A-42B2-8763-5E4B63A41D84}.Debug|Win32.Build.0 = Debug|Win32 -+ {6CF7BCAA-8E3A-42B2-8763-5E4B63A41D84}.Debug|x64.ActiveCfg = Debug|x64 -+ {6CF7BCAA-8E3A-42B2-8763-5E4B63A41D84}.Debug|x64.Build.0 = Debug|x64 -+ {6CF7BCAA-8E3A-42B2-8763-5E4B63A41D84}.Release|Win32.ActiveCfg = Release|Win32 -+ {6CF7BCAA-8E3A-42B2-8763-5E4B63A41D84}.Release|Win32.Build.0 = Release|Win32 -+ {6CF7BCAA-8E3A-42B2-8763-5E4B63A41D84}.Release|x64.ActiveCfg = Release|x64 -+ {6CF7BCAA-8E3A-42B2-8763-5E4B63A41D84}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE -diff --git a/Box2D/Build/vs2015/Box2D.vcxproj b/Box2D/Build/vs2015/Box2D.vcxproj -index 830803c..3d86e39 100644 ---- a/Box2D/Build/vs2015/Box2D.vcxproj -+++ b/Box2D/Build/vs2015/Box2D.vcxproj -@@ -107,6 +107,12 @@ - Windows - true - -+ -+ dumpbin /LINKERMEMBER:1 $(TargetPath) > $(TargetDir)\symbols.symb -+ -+ -+ Dumping symbols -+ - - - -@@ -137,6 +143,12 @@ - Windows - true - -+ -+ dumpbin /LINKERMEMBER:1 $(TargetPath) > $(TargetDir)\symbols.symb -+ -+ -+ Dumping symbols -+ - - - -@@ -168,6 +180,12 @@ - true - true - -+ -+ dumpbin /LINKERMEMBER:1 $(TargetPath) > $(TargetDir)\symbols.symb -+ -+ -+ Dumping symbols -+ - - - -@@ -202,6 +220,12 @@ - true - true - -+ -+ dumpbin /LINKERMEMBER:1 $(TargetPath) > $(TargetDir)\symbols.symb -+ -+ -+ Dumping symbols -+ - - - -diff --git a/Box2D/Build/vs2015/Box2D_dll.vcxproj b/Box2D/Build/vs2015/Box2D_dll.vcxproj -new file mode 100644 -index 0000000..5c438f6 ---- /dev/null -+++ b/Box2D/Build/vs2015/Box2D_dll.vcxproj -@@ -0,0 +1,216 @@ -+ -+ -+ -+ -+ Debug -+ Win32 -+ -+ -+ Release -+ Win32 -+ -+ -+ Debug -+ x64 -+ -+ -+ Release -+ x64 -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ {98400d17-43a5-1a40-95be-c53ac78e7694} -+ -+ -+ -+ {6CF7BCAA-8E3A-42B2-8763-5E4B63A41D84} -+ Win32Proj -+ Box2D_dll -+ 8.1 -+ -+ -+ -+ DynamicLibrary -+ true -+ v140 -+ Unicode -+ -+ -+ DynamicLibrary -+ false -+ v140 -+ true -+ Unicode -+ -+ -+ DynamicLibrary -+ true -+ v140 -+ Unicode -+ -+ -+ DynamicLibrary -+ false -+ v140 -+ true -+ Unicode -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ true -+ bin\dll\x$(PlatformArchitecture)\$(Configuration)\ -+ obj\x$(PlatformArchitecture)\$(Configuration)\Box2D\dll\ -+ Box2D -+ -+ -+ true -+ -+ -+ bin\dll\x$(PlatformArchitecture)\$(Configuration)\ -+ obj\x$(PlatformArchitecture)\$(Configuration)\Box2D\dll\ -+ Box2D -+ -+ -+ false -+ bin\dll\x$(PlatformArchitecture)\$(Configuration)\ -+ obj\x$(PlatformArchitecture)\$(Configuration)\Box2D\dll\ -+ Box2D -+ -+ -+ false -+ bin\dll\x$(PlatformArchitecture)\$(Configuration)\ -+ obj\x$(PlatformArchitecture)\$(Configuration)\Box2D\dll\ -+ Box2D -+ -+ -+ -+ -+ -+ Level3 -+ Disabled -+ WIN32;_DEBUG;_WINDOWS;_USRDLL;BOX2D_DLL_EXPORTS;%(PreprocessorDefinitions) -+ -+ -+ Windows -+ true -+ $(TargetDir)symbols.def -+ $(OutDir)Box2D$(TargetExt) -+ -+ -+ powershell -exec bypass $(SolutionDir)createDef.ps1 -symbols $(SolutionDir)\bin\x$(PlatformArchitecture)\$(Configuration)\symbols.symb -output $(TargetDir)symbols.def -+ -+ -+ Create def file -+ -+ -+ -+ -+ -+ -+ Level3 -+ Disabled -+ _DEBUG;_WINDOWS;_USRDLL;BOX2D_DLL_EXPORTS;%(PreprocessorDefinitions) -+ -+ -+ Windows -+ true -+ $(TargetDir)symbols.def -+ $(OutDir)Box2D$(TargetExt) -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ powershell -exec bypass $(SolutionDir)createDef.ps1 -symbols $(SolutionDir)\bin\x$(PlatformArchitecture)\$(Configuration)\symbols.symb -output $(TargetDir)symbols.def -+ -+ -+ Create def file -+ -+ -+ -+ -+ Level3 -+ -+ -+ MaxSpeed -+ true -+ true -+ WIN32;NDEBUG;_WINDOWS;_USRDLL;BOX2D_DLL_EXPORTS;%(PreprocessorDefinitions) -+ -+ -+ Windows -+ true -+ true -+ true -+ $(TargetDir)symbols.def -+ $(OutDir)Box2D$(TargetExt) -+ -+ -+ powershell -exec bypass $(SolutionDir)createDef.ps1 -symbols $(SolutionDir)\bin\x$(PlatformArchitecture)\$(Configuration)\symbols.symb -output $(TargetDir)symbols.def -+ -+ -+ Create def file -+ -+ -+ -+ -+ Level3 -+ -+ -+ MaxSpeed -+ true -+ true -+ NDEBUG;_WINDOWS;_USRDLL;BOX2D_DLL_EXPORTS;%(PreprocessorDefinitions) -+ -+ -+ Windows -+ true -+ true -+ true -+ $(TargetDir)symbols.def -+ $(OutDir)Box2D$(TargetExt) -+ -+ -+ powershell -exec bypass $(SolutionDir)createDef.ps1 -symbols $(SolutionDir)\bin\x$(PlatformArchitecture)\$(Configuration)\symbols.symb -output $(TargetDir)symbols.def -+ -+ -+ Create def file -+ -+ -+ -+ -+ -+ -\ No newline at end of file -diff --git a/Box2D/Build/vs2015/Box2D_dll.vcxproj.filters b/Box2D/Build/vs2015/Box2D_dll.vcxproj.filters -new file mode 100644 -index 0000000..6e1dfcb ---- /dev/null -+++ b/Box2D/Build/vs2015/Box2D_dll.vcxproj.filters -@@ -0,0 +1,27 @@ -+ -+ -+ -+ -+ {4FC737F1-C7A5-4376-A066-2A32D752A2FF} -+ cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx -+ -+ -+ {93995380-89BD-4b04-88EB-625FBE52EBFB} -+ h;hh;hpp;hxx;hm;inl;inc;xsd -+ -+ -+ {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} -+ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms -+ -+ -+ -+ -+ Source Files -+ -+ -+ -+ -+ Source Files -+ -+ -+ -\ No newline at end of file -diff --git a/Box2D/Build/vs2015/createDef.ps1 b/Box2D/Build/vs2015/createDef.ps1 -new file mode 100644 -index 0000000..4939723 ---- /dev/null -+++ b/Box2D/Build/vs2015/createDef.ps1 -@@ -0,0 +1,18 @@ -+param( -+ [String] $symbols, -+ [String] $output -+) -+ -+Write-Output "LIBRARY Box2D" > $output -+Write-Output 'DESCRIPTION "Box2D dynamic link library"' >> $output -+Write-Output "EXPORTS" >> $output -+ -+$from = (Select-String $symbols -pattern "public symbols" | Select-Object LineNumber).LineNumber + 1 -+$to = (Select-String $symbols -pattern "Summary" | Select-Object LineNumber).LineNumber - 2 -+$no = 1 -+Get-Content $symbols -head $to ` -+ | Select-Object -Last ($to - $from) ` -+ | ForEach-Object { Write-Output $_.split()[-1] } ` -+ | Select-String -Pattern '^\?' ` -+ | ForEach-Object { Write-Output ("`t" + $_ + " @" + $no++) } ` -+ >> $output -\ No newline at end of file -diff --git a/Box2D/Build/vs2015/main.cpp b/Box2D/Build/vs2015/main.cpp -new file mode 100644 -index 0000000..72216f9 ---- /dev/null -+++ b/Box2D/Build/vs2015/main.cpp -@@ -0,0 +1,8 @@ -+#define WIN32_LEAN_AND_MEAN -+#include -+ -+BOOL APIENTRY DllMain(HANDLE hModule, -+ DWORD ul_reason_for_call, -+ LPVOID lpReserved) { -+ return TRUE; -+} --- -2.10.2.windows.1 - diff --git a/ports/box2d/portfile.cmake b/ports/box2d/portfile.cmake index 59d7c119e..b7f101915 100644 --- a/ports/box2d/portfile.cmake +++ b/ports/box2d/portfile.cmake @@ -6,6 +6,8 @@ set(PROJECT_ARCH_BITS "${PROJECT_ARCH}") if(TRIPLET_SYSTEM_ARCH MATCHES "x86") set(PROJECT_ARCH "Win32") set(PROJECT_ARCH_BITS "x32") +elseif(TRIPLET_SYSTEM_ARCH MATCHES "arm") + message(FATAL_ERROR "ARM not supported") endif(TRIPLET_SYSTEM_ARCH MATCHES "x86") include(vcpkg_common_functions) @@ -21,7 +23,7 @@ if(NOT EXISTS "${DOWNLOADS}/box2d.git") WORKING_DIRECTORY ${DOWNLOADS} LOGNAME clone ) -endif() +endif(NOT EXISTS "${DOWNLOADS}/box2d.git") message(STATUS "Cloning done") if(NOT EXISTS "${CURRENT_BUILDTREES_DIR}/src/.git") @@ -32,16 +34,11 @@ if(NOT EXISTS "${CURRENT_BUILDTREES_DIR}/src/.git") WORKING_DIRECTORY ${DOWNLOADS}/box2d.git LOGNAME worktree ) -endif() +endif(NOT EXISTS "${CURRENT_BUILDTREES_DIR}/src/.git") message(STATUS "Adding worktree done") set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/) -vcpkg_apply_patches( - SOURCE_PATH ${SOURCE_PATH} - PATCHES "${CMAKE_CURRENT_LIST_DIR}/dll.patch" -) - # Put the licence and readme files where vcpkg expects it message(STATUS "Packaging license") file(COPY ${SOURCE_PATH}/README.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/box2d) @@ -52,10 +49,6 @@ message(STATUS "Packaging license done") # Building: set(PROJECT "./Box2D/Build/vs2015/Box2D.vcxproj") set(OUTPUTS_PATH "${SOURCE_PATH}/Box2D/Build/vs2015/bin/${PROJECT_ARCH_BITS}") -if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - set(PROJECT "./Box2D/Build/vs2015/Box2D_dll.vcxproj") - set(OUTPUTS_PATH "${SOURCE_PATH}/Box2D/Build/vs2015/bin/dll/${PROJECT_ARCH_BITS}") -endif(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) foreach(TYPE "Release" "Debug") message(STATUS "Building ${TARGET_TRIPLET}-${TYPE}") @@ -83,18 +76,7 @@ foreach(TYPE "Release" "Debug") ) file(RENAME ${TARGET_PATH}/lib/Box2D.lib ${TARGET_PATH}/lib/box2d.lib) message(STATUS "Packaging ${TARGET_TRIPLET}-${TYPE} lib done") - - if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - message(STATUS "Packaging ${TARGET_TRIPLET}-${TYPE} dll") - file( - INSTALL ${OUTPUTS_PATH}/${TYPE}/ - DESTINATION ${TARGET_PATH}/bin - FILES_MATCHING PATTERN "*.dll" - ) - file(RENAME ${TARGET_PATH}/bin/Box2D.dll ${TARGET_PATH}/bin/box2d.dll) - message(STATUS "Packaging ${TARGET_TRIPLET}-${TYPE} dll done") - endif(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) -endforeach() +endforeach(TYPE "Release" "Debug") message(STATUS "Packaging headers") file( -- cgit v1.2.3 From 70814cd7ca17336438d3feec91f27bd86ab3aa13 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 13:32:31 -0800 Subject: Fix day in CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 395026a42..3b91dda6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -67,7 +67,7 @@ vcpkg (0.0.50) * Various updates in FAQ * Release builds now create pdbs (debug builds already did) --- vcpkg team WED, 07 Nov 2016 00:00:00 -0800 +-- vcpkg team MON, 07 Nov 2016 00:01:00 -0800 vcpkg (0.0.40) -------------- -- cgit v1.2.3 From 331ac16736b9698c0fed9e5cbd38ef9322b9a824 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 13:43:36 -0800 Subject: Make lambda arg const --- toolsrc/src/commands_search.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/commands_search.cpp b/toolsrc/src/commands_search.cpp index 771b43507..2eb35b223 100644 --- a/toolsrc/src/commands_search.cpp +++ b/toolsrc/src/commands_search.cpp @@ -43,7 +43,7 @@ namespace vcpkg if (args.command_arguments.size() == 0) { - do_print(paths, [](std::string&) -> bool + do_print(paths, [](const std::string&) -> bool { return true; }); -- cgit v1.2.3 From 8f162188ddef5841f50250ef92bf629eac512650 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 13:44:20 -0800 Subject: Add simple substring filtering to `vcpkg cache`, like `vcpkg search` --- toolsrc/src/commands_cache.cpp | 61 +++++++++++++++++++++++++++++++----------- 1 file changed, 46 insertions(+), 15 deletions(-) diff --git a/toolsrc/src/commands_cache.cpp b/toolsrc/src/commands_cache.cpp index 0d70f0f29..53518264e 100644 --- a/toolsrc/src/commands_cache.cpp +++ b/toolsrc/src/commands_cache.cpp @@ -5,34 +5,65 @@ namespace vcpkg { - void cache_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) + template + static void do_print(const vcpkg_paths& paths, Pred predicate) { - args.check_exact_arg_count(0); - - auto begin_it = fs::directory_iterator(paths.packages); - auto end_it = fs::directory_iterator(); + auto it = fs::directory_iterator(paths.packages); + const fs::directory_iterator end_it = fs::directory_iterator(); - if (begin_it == end_it) + if (it == end_it) { System::println("No packages are cached."); exit(EXIT_SUCCESS); } - for (; begin_it != end_it; ++begin_it) + for (; it != end_it; ++it) { - const auto& path = begin_it->path(); + const fs::path& path = it->path(); - auto file_contents = Files::get_contents(path / "CONTROL"); - if (auto text = file_contents.get()) + try { - auto pghs = parse_paragraphs(*text); - if (pghs.size() != 1) - continue; + auto file_contents = Files::get_contents(path / "CONTROL"); + if (auto text = file_contents.get()) + { + auto pghs = parse_paragraphs(*text); + if (pghs.size() != 1) + continue; - auto src = BinaryParagraph(pghs[0]); - System::println(src.displayname().c_str()); + const BinaryParagraph src = BinaryParagraph(pghs[0]); + const std::string displayname = src.displayname(); + if (predicate(displayname)) + { + System::println(displayname.c_str()); + } + } + } + catch (std::runtime_error const&) + { } } + } + + 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")); + args.check_max_arg_count(1, example.c_str()); + + if (args.command_arguments.size() == 0) + { + do_print(paths, [](const std::string&) -> bool + { + return true; + }); + exit(EXIT_SUCCESS); + } + + // At this point there is 1 argument + do_print(paths, [&](const std::string& port_name) -> bool + { + return Strings::case_insensitive_ascii_find(port_name, args.command_arguments[0]) != port_name.end(); + }); exit(EXIT_SUCCESS); } -- cgit v1.2.3 From c2a6ed412bd6cfa95a263a9ed42dd352d3a8551c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 13:57:52 -0800 Subject: Rework `vcpkg search` implementation --- toolsrc/src/commands_search.cpp | 54 ++++++++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 20 deletions(-) diff --git a/toolsrc/src/commands_search.cpp b/toolsrc/src/commands_search.cpp index 2eb35b223..267f9a3d4 100644 --- a/toolsrc/src/commands_search.cpp +++ b/toolsrc/src/commands_search.cpp @@ -8,9 +8,9 @@ namespace fs = std::tr2::sys; namespace vcpkg { - template - static void do_print(const vcpkg_paths& paths, Pred predicate) + static std::vector read_all_source_paragraphs(const vcpkg_paths& paths) { + std::vector output; for (auto it = fs::directory_iterator(paths.ports); it != fs::directory_iterator(); ++it) { const fs::path& path = it->path(); @@ -19,21 +19,27 @@ namespace vcpkg { auto pghs = get_paragraphs(path / "CONTROL"); if (pghs.empty()) - continue; - auto srcpgh = SourceParagraph(pghs[0]); - - if (predicate(srcpgh.name)) { - std::cout << std::left - << std::setw(20) << srcpgh.name << ' ' - << std::setw(16) << srcpgh.version << ' ' - << shorten_description(srcpgh.description) << '\n'; + continue; } + + auto srcpgh = SourceParagraph(pghs[0]); + output.push_back(srcpgh); } catch (std::runtime_error const&) { } } + + return output; + } + + static void do_print(const SourceParagraph& source_paragraph) + { + std::cout << std::left + << std::setw(20) << source_paragraph.name << ' ' + << std::setw(16) << source_paragraph.version << ' ' + << shorten_description(source_paragraph.description) << '\n'; } void search_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) @@ -41,20 +47,28 @@ namespace vcpkg 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")); args.check_max_arg_count(1, example.c_str()); + const std::vector source_paragraphs = read_all_source_paragraphs(paths); + if (args.command_arguments.size() == 0) { - do_print(paths, [](const std::string&) -> bool - { - return true; - }); - exit(EXIT_SUCCESS); + for (const SourceParagraph& source_paragraph : source_paragraphs) + { + do_print(source_paragraph); + } } + else + { + // At this point there is 1 argument + for (const SourceParagraph& source_paragraph : source_paragraphs) + { + if (Strings::case_insensitive_ascii_find(source_paragraph.name, args.command_arguments[0]) == source_paragraph.name.end()) + { + continue; + } - // At this point there is 1 argument - do_print(paths, [&](const std::string& port_name) -> bool - { - return Strings::case_insensitive_ascii_find(port_name, args.command_arguments[0]) != port_name.end(); - }); + do_print(source_paragraph); + } + } System::println("\nIf your library is not listed, please open an issue at:\n" " https://github.com/Microsoft/vcpkg/issues"); -- cgit v1.2.3 From 7e05c53628e686e5e2aa39e185789c2b6146f35b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 14:06:51 -0800 Subject: Rework `vcpkg cache` implementation --- toolsrc/src/commands_cache.cpp | 60 ++++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/toolsrc/src/commands_cache.cpp b/toolsrc/src/commands_cache.cpp index 53518264e..5e20a39af 100644 --- a/toolsrc/src/commands_cache.cpp +++ b/toolsrc/src/commands_cache.cpp @@ -5,19 +5,10 @@ namespace vcpkg { - template - static void do_print(const vcpkg_paths& paths, Pred predicate) + static std::vector read_all_binary_paragraphs(const vcpkg_paths& paths) { - auto it = fs::directory_iterator(paths.packages); - const fs::directory_iterator end_it = fs::directory_iterator(); - - if (it == end_it) - { - System::println("No packages are cached."); - exit(EXIT_SUCCESS); - } - - for (; it != end_it; ++it) + std::vector output; + for (auto it = fs::directory_iterator(paths.packages); it != fs::directory_iterator(); ++it) { const fs::path& path = it->path(); @@ -30,18 +21,16 @@ namespace vcpkg if (pghs.size() != 1) continue; - const BinaryParagraph src = BinaryParagraph(pghs[0]); - const std::string displayname = src.displayname(); - if (predicate(displayname)) - { - System::println(displayname.c_str()); - } + const BinaryParagraph binary_paragraph = BinaryParagraph(pghs[0]); + output.push_back(binary_paragraph); } } catch (std::runtime_error const&) { } } + + return output; } void cache_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) @@ -50,20 +39,35 @@ namespace vcpkg "The argument should be a substring to search for, or no argument to display all cached libraries.\n%s", create_example_string("cache png")); args.check_max_arg_count(1, example.c_str()); - if (args.command_arguments.size() == 0) + const std::vector binary_paragraphs = read_all_binary_paragraphs(paths); + if (binary_paragraphs.empty()) { - do_print(paths, [](const std::string&) -> bool - { - return true; - }); + System::println("No packages are cached."); exit(EXIT_SUCCESS); } - // At this point there is 1 argument - do_print(paths, [&](const std::string& port_name) -> bool - { - return Strings::case_insensitive_ascii_find(port_name, args.command_arguments[0]) != port_name.end(); - }); + if (args.command_arguments.size() == 0) + { + for (const BinaryParagraph& binary_paragraph : binary_paragraphs) + { + const std::string displayname = binary_paragraph.displayname(); + System::println(displayname.c_str()); + } + } + else + { + // At this point there is 1 argument + for (const BinaryParagraph& binary_paragraph : binary_paragraphs) + { + const std::string displayname = binary_paragraph.displayname(); + if (Strings::case_insensitive_ascii_find(displayname, args.command_arguments[0]) == displayname.end()) + { + continue; + } + + System::println(displayname.c_str()); + } + } exit(EXIT_SUCCESS); } -- cgit v1.2.3 From 45eee10708a97a90566af8ab7d781e89b255055b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 14:39:52 -0800 Subject: Add simple substring filtering to `vcpkg list` --- toolsrc/src/commands_list.cpp | 58 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 46 insertions(+), 12 deletions(-) diff --git a/toolsrc/src/commands_list.cpp b/toolsrc/src/commands_list.cpp index 194e4b435..87aad1991 100644 --- a/toolsrc/src/commands_list.cpp +++ b/toolsrc/src/commands_list.cpp @@ -4,29 +4,63 @@ namespace vcpkg { + static void do_print(const StatusParagraph& pgh) + { + System::println("%-27s %-16s %s", + pgh.package.displayname(), + pgh.package.version, + shorten_description(pgh.package.description)); + } + void list_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { - args.check_exact_arg_count(0); + 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")); + args.check_max_arg_count(1, example.c_str()); - std::vector packages_output; - for (auto&& pgh : database_load_check(paths)) + const StatusParagraphs status_paragraphs = database_load_check(paths); + std::vector installed_packages; + for (auto&& pgh : status_paragraphs) { if (pgh->state == install_state_t::not_installed && pgh->want == want_t::purge) continue; - packages_output.push_back(Strings::format("%-27s %-16s %s", - pgh->package.displayname(), - pgh->package.version, - shorten_description(pgh->package.description))); + installed_packages.push_back(*pgh); + } + + if (installed_packages.empty()) + { + System::println("No packages are installed. Did you mean `search`?"); + exit(EXIT_SUCCESS); } - std::sort(packages_output.begin(), packages_output.end()); - for (auto&& package : packages_output) + + std::sort(installed_packages.begin(), installed_packages.end(), + [ ]( const StatusParagraph& lhs, const StatusParagraph& rhs ) -> bool + { + return lhs.package.displayname() < rhs.package.displayname(); + }); + + if (args.command_arguments.size() == 0) { - System::println(package.c_str()); + for (const StatusParagraph& status_paragraph : installed_packages) + { + do_print(status_paragraph); + } } - if (packages_output.empty()) + else { - System::println("No packages are installed. Did you mean `search`?"); + // At this point there is 1 argument + for (const StatusParagraph& status_paragraph : installed_packages) + { + const std::string displayname = status_paragraph.package.displayname(); + if (Strings::case_insensitive_ascii_find(displayname, args.command_arguments[0]) == displayname.end()) + { + continue; + } + + do_print(status_paragraph); + } } + exit(EXIT_SUCCESS); } } -- cgit v1.2.3 From b81d1910dbd731326ce2d31db134820c14acdc76 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 14:42:25 -0800 Subject: [vcpkg search] Use System::println() instead of iostream + iomanip --- toolsrc/src/commands_search.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/toolsrc/src/commands_search.cpp b/toolsrc/src/commands_search.cpp index 267f9a3d4..d59a338ac 100644 --- a/toolsrc/src/commands_search.cpp +++ b/toolsrc/src/commands_search.cpp @@ -1,8 +1,6 @@ #include "vcpkg_Commands.h" #include "vcpkg_System.h" #include "vcpkg.h" -#include -#include namespace fs = std::tr2::sys; @@ -36,10 +34,10 @@ namespace vcpkg static void do_print(const SourceParagraph& source_paragraph) { - std::cout << std::left - << std::setw(20) << source_paragraph.name << ' ' - << std::setw(16) << source_paragraph.version << ' ' - << shorten_description(source_paragraph.description) << '\n'; + System::println("%-20s %-16s %s", + source_paragraph.name, + source_paragraph.version, + shorten_description(source_paragraph.description)); } void search_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) -- cgit v1.2.3 From 8e9338e4a00b44fd7721d8c6866c72d1502c3f97 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 14:45:53 -0800 Subject: Update CHANGELOG and bump version to v0.0.51 --- CHANGELOG.md | 9 +++++++++ toolsrc/VERSION.txt | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b91dda6d..1ea89a30f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +vcpkg (0.0.51) +-------------- + * Add simple substring search to `vcpkg cache` + * Add simple substring search to `vcpkg list` + +-- vcpkg team MON, 07 Nov 2016 14:45:00 -0800 + + vcpkg (0.0.50) -------------- * Add ports: @@ -69,6 +77,7 @@ vcpkg (0.0.50) -- vcpkg team MON, 07 Nov 2016 00:01:00 -0800 + vcpkg (0.0.40) -------------- * Add ports: diff --git a/toolsrc/VERSION.txt b/toolsrc/VERSION.txt index 621ae62d1..f19db15c3 100644 --- a/toolsrc/VERSION.txt +++ b/toolsrc/VERSION.txt @@ -1 +1 @@ -"0.0.50" \ No newline at end of file +"0.0.51" \ No newline at end of file -- cgit v1.2.3 From a721db2c1fbfc1b87065b0b43e32249117e53242 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 16:06:36 -0800 Subject: Refactor: create new Paragraphs.h/cpp --- toolsrc/include/Paragraphs.h | 11 ++ toolsrc/include/vcpkg.h | 2 - toolsrc/src/Paragraphs.cpp | 163 +++++++++++++++++++++++++++++ toolsrc/src/commands_cache.cpp | 3 +- toolsrc/src/commands_import.cpp | 3 +- toolsrc/src/commands_installation.cpp | 5 +- toolsrc/src/commands_portsdiff.cpp | 3 +- toolsrc/src/commands_search.cpp | 3 +- toolsrc/src/commands_update.cpp | 3 +- toolsrc/src/lib.cpp | 9 +- toolsrc/src/main.cpp | 3 +- toolsrc/src/tests_paragraph.cpp | 32 +++--- toolsrc/src/vcpkg.cpp | 165 ------------------------------ toolsrc/vcpkglib/vcpkglib.vcxproj | 2 + toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 6 ++ 15 files changed, 218 insertions(+), 195 deletions(-) create mode 100644 toolsrc/include/Paragraphs.h create mode 100644 toolsrc/src/Paragraphs.cpp diff --git a/toolsrc/include/Paragraphs.h b/toolsrc/include/Paragraphs.h new file mode 100644 index 000000000..22aaefe98 --- /dev/null +++ b/toolsrc/include/Paragraphs.h @@ -0,0 +1,11 @@ +#pragma once + +#include +#include + +namespace vcpkg { namespace Paragraphs +{ + namespace fs = std::tr2::sys; + std::vector> get_paragraphs(const fs::path& control_path); + std::vector> parse_paragraphs(const std::string& str); +}} diff --git a/toolsrc/include/vcpkg.h b/toolsrc/include/vcpkg.h index dc5933f10..1715a40a5 100644 --- a/toolsrc/include/vcpkg.h +++ b/toolsrc/include/vcpkg.h @@ -14,8 +14,6 @@ namespace vcpkg extern bool g_do_dry_run; - std::vector> get_paragraphs(const fs::path& control_path); - std::vector> parse_paragraphs(const std::string& str); std::string shorten_description(const std::string& desc); StatusParagraphs database_load_check(const vcpkg_paths& paths); diff --git a/toolsrc/src/Paragraphs.cpp b/toolsrc/src/Paragraphs.cpp new file mode 100644 index 000000000..5efa9a7b3 --- /dev/null +++ b/toolsrc/src/Paragraphs.cpp @@ -0,0 +1,163 @@ +#include "Paragraphs.h" +#include "vcpkg_Files.h" + +namespace vcpkg { namespace Paragraphs +{ + struct Parser + { + Parser(const char* c, const char* e) : cur(c), end(e) + { + } + + private: + const char* cur; + const char* const end; + + void peek(char& ch) const + { + if (cur == end) + ch = 0; + else + ch = *cur; + } + + void next(char& ch) + { + if (cur == end) + ch = 0; + else + { + ++cur; + peek(ch); + } + } + + void skip_spaces(char& ch) + { + while (ch == ' ' || ch == '\t') + next(ch); + } + + static bool is_alphanum(char ch) + { + return (ch >= 'A' && ch <= 'Z') + || (ch >= 'a' && ch <= 'z') + || (ch >= '0' && ch <= '9'); + } + + static bool is_lineend(char ch) + { + return ch == '\r' || ch == '\n' || ch == 0; + } + + void get_fieldvalue(char& ch, std::string& fieldvalue) + { + fieldvalue.clear(); + + auto beginning_of_line = cur; + do + { + // scan to end of current line (it is part of the field value) + while (!is_lineend(ch)) + next(ch); + + fieldvalue.append(beginning_of_line, cur); + + if (ch == '\r') + next(ch); + if (ch == '\n') + next(ch); + + if (is_alphanum(ch)) + { + // Line begins a new field. + return; + } + + beginning_of_line = cur; + + // Line may continue the current field with data or terminate the paragraph, + // depending on first nonspace character. + skip_spaces(ch); + + if (is_lineend(ch)) + { + // Line was whitespace or empty. + // This terminates the field and the paragraph. + // We leave the blank line's whitespace consumed, because it doesn't matter. + return; + } + + // First nonspace is not a newline. This continues the current field value. + // We forcibly convert all newlines into single '\n' for ease of text handling later on. + fieldvalue.push_back('\n'); + } + while (true); + } + + void get_fieldname(char& ch, std::string& fieldname) + { + auto begin_fieldname = cur; + while (is_alphanum(ch) || ch == '-') + next(ch); + Checks::check_throw(ch == ':', "Expected ':'"); + fieldname = std::string(begin_fieldname, cur); + + // skip ': ' + next(ch); + skip_spaces(ch); + } + + void get_paragraph(char& ch, std::unordered_map& fields) + { + fields.clear(); + std::string fieldname; + std::string fieldvalue; + do + { + get_fieldname(ch, fieldname); + + auto it = fields.find(fieldname); + Checks::check_throw(it == fields.end(), "Duplicate field"); + + get_fieldvalue(ch, fieldvalue); + + fields.emplace(fieldname, fieldvalue); + } + while (!is_lineend(ch)); + } + + public: + std::vector> get_paragraphs() + { + std::vector> paragraphs; + + char ch; + peek(ch); + + while (ch != 0) + { + if (ch == '\n' || ch == '\r' || ch == ' ' || ch == '\t') + { + next(ch); + continue; + } + + paragraphs.emplace_back(); + get_paragraph(ch, paragraphs.back()); + } + + return paragraphs; + } + }; + + std::vector> get_paragraphs(const fs::path& control_path) + { + return parse_paragraphs(Files::get_contents(control_path).get_or_throw()); + } + + std::vector> parse_paragraphs(const std::string& str) + { + return Parser(str.c_str(), str.c_str() + str.size()).get_paragraphs(); + } +}} diff --git a/toolsrc/src/commands_cache.cpp b/toolsrc/src/commands_cache.cpp index 5e20a39af..634a72a64 100644 --- a/toolsrc/src/commands_cache.cpp +++ b/toolsrc/src/commands_cache.cpp @@ -2,6 +2,7 @@ #include "vcpkg_System.h" #include "vcpkg_Files.h" #include "vcpkg.h" +#include "Paragraphs.h" namespace vcpkg { @@ -17,7 +18,7 @@ namespace vcpkg auto file_contents = Files::get_contents(path / "CONTROL"); if (auto text = file_contents.get()) { - auto pghs = parse_paragraphs(*text); + auto pghs = Paragraphs::parse_paragraphs(*text); if (pghs.size() != 1) continue; diff --git a/toolsrc/src/commands_import.cpp b/toolsrc/src/commands_import.cpp index 9cfc53d6c..7a6139085 100644 --- a/toolsrc/src/commands_import.cpp +++ b/toolsrc/src/commands_import.cpp @@ -1,5 +1,6 @@ #include "vcpkg_Commands.h" #include "vcpkg.h" +#include "Paragraphs.h" namespace vcpkg { @@ -12,7 +13,7 @@ namespace vcpkg const fs::path include_directory(args.command_arguments[1]); const fs::path project_directory(args.command_arguments[2]); - auto pghs = get_paragraphs(control_file_path); + auto pghs = Paragraphs::get_paragraphs(control_file_path); Checks::check_throw(pghs.size() == 1, "Invalid control file for package"); StatusParagraph spgh; diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_installation.cpp index f6aeafa02..b5f4e1a5d 100644 --- a/toolsrc/src/commands_installation.cpp +++ b/toolsrc/src/commands_installation.cpp @@ -9,6 +9,7 @@ #include "vcpkg_Dependencies.h" #include "vcpkg_Input.h" #include "vcpkg_Maps.h" +#include "Paragraphs.h" namespace vcpkg { @@ -21,7 +22,7 @@ namespace vcpkg static void build_internal(const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir) { - auto pghs = get_paragraphs(port_dir / "CONTROL"); + auto pghs = Paragraphs::get_paragraphs(port_dir / "CONTROL"); Checks::check_exit(pghs.size() == 1, "Error: invalid control file"); SourceParagraph source_paragraph(pghs[0]); @@ -111,7 +112,7 @@ namespace vcpkg } } - auto pghs = parse_paragraphs(file_contents.get_or_throw()); + auto pghs = Paragraphs::parse_paragraphs(file_contents.get_or_throw()); Checks::check_throw(pghs.size() == 1, "multiple paragraphs in control file"); install_package(paths, BinaryParagraph(pghs[0]), status_db); System::println(System::color::success, "Package %s is installed", spec); diff --git a/toolsrc/src/commands_portsdiff.cpp b/toolsrc/src/commands_portsdiff.cpp index e15db3567..fdbaec0ac 100644 --- a/toolsrc/src/commands_portsdiff.cpp +++ b/toolsrc/src/commands_portsdiff.cpp @@ -7,6 +7,7 @@ #include #include #include +#include "Paragraphs.h" namespace vcpkg { @@ -52,7 +53,7 @@ namespace vcpkg try { - auto pghs = get_paragraphs(path / "CONTROL"); + auto pghs = Paragraphs::get_paragraphs(path / "CONTROL"); if (pghs.empty()) continue; auto srcpgh = SourceParagraph(pghs[0]); diff --git a/toolsrc/src/commands_search.cpp b/toolsrc/src/commands_search.cpp index d59a338ac..399709cf3 100644 --- a/toolsrc/src/commands_search.cpp +++ b/toolsrc/src/commands_search.cpp @@ -1,6 +1,7 @@ #include "vcpkg_Commands.h" #include "vcpkg_System.h" #include "vcpkg.h" +#include "Paragraphs.h" namespace fs = std::tr2::sys; @@ -15,7 +16,7 @@ namespace vcpkg try { - auto pghs = get_paragraphs(path / "CONTROL"); + auto pghs = Paragraphs::get_paragraphs(path / "CONTROL"); if (pghs.empty()) { continue; diff --git a/toolsrc/src/commands_update.cpp b/toolsrc/src/commands_update.cpp index 5d531ef39..b448091f7 100644 --- a/toolsrc/src/commands_update.cpp +++ b/toolsrc/src/commands_update.cpp @@ -2,6 +2,7 @@ #include "vcpkg.h" #include "vcpkg_System.h" #include "vcpkg_Files.h" +#include "Paragraphs.h" namespace vcpkg { @@ -21,7 +22,7 @@ namespace vcpkg const auto& path = begin_it->path(); try { - auto pghs = get_paragraphs(path / "CONTROL"); + auto pghs = Paragraphs::get_paragraphs(path / "CONTROL"); if (pghs.empty()) continue; auto srcpgh = SourceParagraph(pghs[0]); diff --git a/toolsrc/src/lib.cpp b/toolsrc/src/lib.cpp index 3c844ac3f..5de9f9639 100644 --- a/toolsrc/src/lib.cpp +++ b/toolsrc/src/lib.cpp @@ -11,6 +11,7 @@ #include #include "vcpkg_Files.h" #include "vcpkg_System.h" +#include "Paragraphs.h" using namespace vcpkg; @@ -51,7 +52,7 @@ static StatusParagraphs load_current_database(const fs::path& vcpkg_dir_status_f } auto text = Files::get_contents(vcpkg_dir_status_file).get_or_throw(); - auto pghs = parse_paragraphs(text); + auto pghs = Paragraphs::parse_paragraphs(text); std::vector> status_pghs; for (auto&& p : pghs) @@ -94,7 +95,7 @@ StatusParagraphs vcpkg::database_load_check(const vcpkg_paths& paths) continue; auto text = Files::get_contents(b->path()).get_or_throw(); - auto pghs = parse_paragraphs(text); + auto pghs = Paragraphs::parse_paragraphs(text); for (auto&& p : pghs) { current_status_db.insert(std::make_unique(p)); @@ -217,7 +218,7 @@ std::vector vcpkg::get_unmet_package_dependencies(const vcpkg_paths std::vector> pghs; try { - pghs = parse_paragraphs(*control_contents); + pghs = Paragraphs::parse_paragraphs(*control_contents); } catch (std::runtime_error) { @@ -238,7 +239,7 @@ std::vector vcpkg::get_unmet_package_build_dependencies(const vcpkg std::vector> pghs; try { - pghs = parse_paragraphs(*control_contents); + pghs = Paragraphs::parse_paragraphs(*control_contents); } catch (std::runtime_error) { diff --git a/toolsrc/src/main.cpp b/toolsrc/src/main.cpp index 2200cd105..22c45e5ab 100644 --- a/toolsrc/src/main.cpp +++ b/toolsrc/src/main.cpp @@ -12,6 +12,7 @@ #include "vcpkg_Files.h" #include "vcpkg_System.h" #include "vcpkg_Input.h" +#include "Paragraphs.h" using namespace vcpkg; @@ -115,7 +116,7 @@ static void loadConfig() std::string config_contents = Files::get_contents(localappdata / "vcpkg" / "config").get_or_throw(); std::unordered_map keys; - auto pghs = parse_paragraphs(config_contents); + auto pghs = Paragraphs::parse_paragraphs(config_contents); if (pghs.size() > 0) keys = pghs[0]; diff --git a/toolsrc/src/tests_paragraph.cpp b/toolsrc/src/tests_paragraph.cpp index b06359b90..28309fd31 100644 --- a/toolsrc/src/tests_paragraph.cpp +++ b/toolsrc/src/tests_paragraph.cpp @@ -1,5 +1,6 @@ #include "CppUnitTest.h" #include "vcpkg.h" +#include "Paragraphs.h" #pragma comment(lib,"version") #pragma comment(lib,"winhttp") @@ -81,9 +82,9 @@ namespace UnitTest1 TEST_METHOD(SourceParagraph_Construct_Qualified_Depends) { vcpkg::SourceParagraph pgh({ - { "Source", "zlib" }, - { "Version", "1.2.8" }, - { "Build-Depends", "libA [windows], libB [uwp]" } + {"Source", "zlib"}, + {"Version", "1.2.8"}, + {"Build-Depends", "libA [windows], libB [uwp]"} }); Assert::AreEqual("zlib", pgh.name.c_str()); @@ -97,7 +98,6 @@ namespace UnitTest1 Assert::AreEqual("uwp", pgh.depends[1].qualifier.c_str()); } - TEST_METHOD(BinaryParagraph_Construct_Minimum) { vcpkg::BinaryParagraph pgh({ @@ -153,14 +153,14 @@ namespace UnitTest1 TEST_METHOD(parse_paragraphs_empty) { const char* str = ""; - auto pghs = vcpkg::parse_paragraphs(str); + auto pghs = vcpkg::Paragraphs::parse_paragraphs(str); Assert::IsTrue(pghs.empty()); } TEST_METHOD(parse_paragraphs_one_field) { const char* str = "f1: v1"; - auto pghs = vcpkg::parse_paragraphs(str); + auto pghs = vcpkg::Paragraphs::parse_paragraphs(str); Assert::AreEqual(size_t(1), pghs.size()); Assert::AreEqual(size_t(1), pghs[0].size()); Assert::AreEqual("v1", pghs[0]["f1"].c_str()); @@ -171,7 +171,7 @@ namespace UnitTest1 const char* str = "f1: v1\n" "f2: v2"; - auto pghs = vcpkg::parse_paragraphs(str); + auto pghs = vcpkg::Paragraphs::parse_paragraphs(str); Assert::AreEqual(size_t(1), pghs.size()); Assert::AreEqual(size_t(2), pghs[0].size()); Assert::AreEqual("v1", pghs[0]["f1"].c_str()); @@ -186,7 +186,7 @@ namespace UnitTest1 "\n" "f3: v3\n" "f4: v4"; - auto pghs = vcpkg::parse_paragraphs(str); + auto pghs = vcpkg::Paragraphs::parse_paragraphs(str); Assert::AreEqual(size_t(2), pghs.size()); Assert::AreEqual(size_t(2), pghs[0].size()); Assert::AreEqual("v1", pghs[0]["f1"].c_str()); @@ -204,7 +204,7 @@ namespace UnitTest1 "F:\n" "0:\n" "F-2:\n"; - auto pghs = vcpkg::parse_paragraphs(str); + auto pghs = vcpkg::Paragraphs::parse_paragraphs(str); Assert::AreEqual(size_t(1), pghs.size()); Assert::AreEqual(size_t(5), pghs[0].size()); } @@ -218,7 +218,7 @@ namespace UnitTest1 "\n" "f3: v3\n" "f4: v4"; - auto pghs = vcpkg::parse_paragraphs(str); + auto pghs = vcpkg::Paragraphs::parse_paragraphs(str); Assert::AreEqual(size_t(2), pghs.size()); } @@ -227,7 +227,7 @@ namespace UnitTest1 const char* str = "f1:\n" "f2: "; - auto pghs = vcpkg::parse_paragraphs(str); + auto pghs = vcpkg::Paragraphs::parse_paragraphs(str); Assert::AreEqual(size_t(1), pghs.size()); Assert::AreEqual(size_t(2), pghs[0].size()); Assert::AreEqual("", pghs[0]["f1"].c_str()); @@ -243,7 +243,7 @@ namespace UnitTest1 "f2:\r\n" " f2\r\n" " continue\r\n"; - auto pghs = vcpkg::parse_paragraphs(str); + auto pghs = vcpkg::Paragraphs::parse_paragraphs(str); Assert::AreEqual(size_t(1), pghs.size()); Assert::AreEqual("simple\n f1", pghs[0]["f1"].c_str()); Assert::AreEqual("\n f2\n continue", pghs[0]["f2"].c_str()); @@ -257,7 +257,7 @@ namespace UnitTest1 "\r\n" "f3: v3\r\n" "f4: v4"; - auto pghs = vcpkg::parse_paragraphs(str); + auto pghs = vcpkg::Paragraphs::parse_paragraphs(str); Assert::AreEqual(size_t(2), pghs.size()); Assert::AreEqual(size_t(2), pghs[0].size()); Assert::AreEqual("v1", pghs[0]["f1"].c_str()); @@ -277,7 +277,7 @@ namespace UnitTest1 {"Multi-Arch", "same"}, }); ss << pgh; - auto pghs = vcpkg::parse_paragraphs(ss.str()); + auto pghs = vcpkg::Paragraphs::parse_paragraphs(ss.str()); Assert::AreEqual(size_t(1), pghs.size()); Assert::AreEqual(size_t(4), pghs[0].size()); Assert::AreEqual("zlib", pghs[0]["Package"].c_str()); @@ -299,7 +299,7 @@ namespace UnitTest1 {"Multi-Arch", "same"}, }); ss << pgh; - auto pghs = vcpkg::parse_paragraphs(ss.str()); + auto pghs = vcpkg::Paragraphs::parse_paragraphs(ss.str()); Assert::AreEqual(size_t(1), pghs.size()); Assert::AreEqual(size_t(7), pghs[0].size()); Assert::AreEqual("zlib", pghs[0]["Package"].c_str()); @@ -321,7 +321,7 @@ namespace UnitTest1 {"Depends", "a, b, c"}, }); ss << pgh; - auto pghs = vcpkg::parse_paragraphs(ss.str()); + auto pghs = vcpkg::Paragraphs::parse_paragraphs(ss.str()); Assert::AreEqual(size_t(1), pghs.size()); Assert::AreEqual("a, b, c", pghs[0]["Depends"].c_str()); } diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index f705858cc..a9ef963e7 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -1,160 +1,5 @@ #include "vcpkg.h" #include -#include "vcpkg_Files.h" -#include "vcpkglib_helpers.h" - -namespace -{ - using namespace vcpkg; - - struct Parser - { - Parser(const char* c, const char* e) : cur(c), end(e) - { - } - - private: - const char* cur; - const char* const end; - - void peek(char& ch) const - { - if (cur == end) - ch = 0; - else - ch = *cur; - } - - void next(char& ch) - { - if (cur == end) - ch = 0; - else - { - ++cur; - peek(ch); - } - } - - void skip_spaces(char& ch) - { - while (ch == ' ' || ch == '\t') - next(ch); - } - - static bool is_alphanum(char ch) - { - return (ch >= 'A' && ch <= 'Z') - || (ch >= 'a' && ch <= 'z') - || (ch >= '0' && ch <= '9'); - } - - static bool is_lineend(char ch) - { - return ch == '\r' || ch == '\n' || ch == 0; - } - - void get_fieldvalue(char& ch, std::string& fieldvalue) - { - fieldvalue.clear(); - - auto beginning_of_line = cur; - do - { - // scan to end of current line (it is part of the field value) - while (!is_lineend(ch)) - next(ch); - - fieldvalue.append(beginning_of_line, cur); - - if (ch == '\r') - next(ch); - if (ch == '\n') - next(ch); - - if (is_alphanum(ch)) - { - // Line begins a new field. - return; - } - - beginning_of_line = cur; - - // Line may continue the current field with data or terminate the paragraph, - // depending on first nonspace character. - skip_spaces(ch); - - if (is_lineend(ch)) - { - // Line was whitespace or empty. - // This terminates the field and the paragraph. - // We leave the blank line's whitespace consumed, because it doesn't matter. - return; - } - - // First nonspace is not a newline. This continues the current field value. - // We forcibly convert all newlines into single '\n' for ease of text handling later on. - fieldvalue.push_back('\n'); - } - while (true); - } - - void get_fieldname(char& ch, std::string& fieldname) - { - auto begin_fieldname = cur; - while (is_alphanum(ch) || ch == '-') - next(ch); - Checks::check_throw(ch == ':', "Expected ':'"); - fieldname = std::string(begin_fieldname, cur); - - // skip ': ' - next(ch); - skip_spaces(ch); - } - - void get_paragraph(char& ch, std::unordered_map& fields) - { - fields.clear(); - std::string fieldname; - std::string fieldvalue; - do - { - get_fieldname(ch, fieldname); - - auto it = fields.find(fieldname); - Checks::check_throw(it == fields.end(), "Duplicate field"); - - get_fieldvalue(ch, fieldvalue); - - fields.emplace(fieldname, fieldvalue); - } - while (!is_lineend(ch)); - } - - public: - std::vector> get_paragraphs() - { - std::vector> paragraphs; - - char ch; - peek(ch); - - while (ch != 0) - { - if (ch == '\n' || ch == '\r' || ch == ' ' || ch == '\t') - { - next(ch); - continue; - } - - paragraphs.emplace_back(); - get_paragraph(ch, paragraphs.back()); - } - - return paragraphs; - } - }; -} namespace vcpkg { @@ -165,14 +10,4 @@ namespace vcpkg simple_desc.append("..."); return simple_desc; } - - std::vector> get_paragraphs(const fs::path& control_path) - { - return parse_paragraphs(Files::get_contents(control_path).get_or_throw()); - } - - std::vector> parse_paragraphs(const std::string& str) - { - return Parser(str.c_str(), str.c_str() + str.size()).get_paragraphs(); - } } diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index 99e16e431..5d1554d49 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -125,6 +125,7 @@ + @@ -138,6 +139,7 @@ + diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index eec73a445..358839f8a 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -51,6 +51,9 @@ Source Files + + Source Files + @@ -83,5 +86,8 @@ Header Files + + Header Files + \ No newline at end of file -- cgit v1.2.3 From 058cbaf459e48b395cf170a9589f36b75a95c7bd Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 16:10:41 -0800 Subject: Merge lib.cpp and vcpkg.cpp -> vcpkg.cpp --- toolsrc/src/lib.cpp | 516 ----------------------------- toolsrc/src/vcpkg.cpp | 524 +++++++++++++++++++++++++++++- toolsrc/vcpkglib/vcpkglib.vcxproj | 3 +- toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 9 +- 4 files changed, 522 insertions(+), 530 deletions(-) delete mode 100644 toolsrc/src/lib.cpp diff --git a/toolsrc/src/lib.cpp b/toolsrc/src/lib.cpp deleted file mode 100644 index 5de9f9639..000000000 --- a/toolsrc/src/lib.cpp +++ /dev/null @@ -1,516 +0,0 @@ -#include "vcpkg.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "vcpkg_Files.h" -#include "vcpkg_System.h" -#include "Paragraphs.h" - -using namespace vcpkg; - -bool vcpkg::g_do_dry_run = false; - -namespace -{ - template - auto find_or_default(const M& map, const K& key, const V& val) - { - auto it = map.find(key); - if (it == map.end()) - return decltype(it->second)(val); - else - return it->second; - } -} - -namespace -{ - std::fstream open_status_file(const vcpkg_paths& paths, std::ios_base::openmode mode = std::ios_base::app | std::ios_base::in | std::ios_base::out | std::ios_base::binary) - { - return std::fstream(paths.vcpkg_dir_status_file, mode); - } -} - -static StatusParagraphs load_current_database(const fs::path& vcpkg_dir_status_file, const fs::path& vcpkg_dir_status_file_old) -{ - if (!fs::exists(vcpkg_dir_status_file)) - { - if (!fs::exists(vcpkg_dir_status_file_old)) - { - // no status file, use empty db - return StatusParagraphs(); - } - - fs::rename(vcpkg_dir_status_file_old, vcpkg_dir_status_file); - } - - auto text = Files::get_contents(vcpkg_dir_status_file).get_or_throw(); - auto pghs = Paragraphs::parse_paragraphs(text); - - std::vector> status_pghs; - for (auto&& p : pghs) - { - status_pghs.push_back(std::make_unique(p)); - } - - return StatusParagraphs(std::move(status_pghs)); -} - -StatusParagraphs vcpkg::database_load_check(const vcpkg_paths& paths) -{ - auto updates_dir = paths.vcpkg_dir_updates; - - std::error_code ec; - fs::create_directory(paths.installed, ec); - fs::create_directory(paths.vcpkg_dir, ec); - fs::create_directory(paths.vcpkg_dir_info, ec); - fs::create_directory(updates_dir, ec); - - const fs::path& status_file = paths.vcpkg_dir_status_file; - const fs::path status_file_old = status_file.parent_path() / "status-old"; - const fs::path status_file_new = status_file.parent_path() / "status-new"; - - StatusParagraphs current_status_db = load_current_database(status_file, status_file_old); - - auto b = fs::directory_iterator(updates_dir); - auto e = fs::directory_iterator(); - if (b == e) - { - // updates directory is empty, control file is up-to-date. - return current_status_db; - } - - for (; b != e; ++b) - { - if (!fs::is_regular_file(b->status())) - continue; - if (b->path().filename() == "incomplete") - continue; - - auto text = Files::get_contents(b->path()).get_or_throw(); - auto pghs = Paragraphs::parse_paragraphs(text); - for (auto&& p : pghs) - { - current_status_db.insert(std::make_unique(p)); - } - } - - std::fstream(status_file_new, std::ios_base::out | std::ios_base::binary | std::ios_base::trunc) << current_status_db; - - if (fs::exists(status_file_old)) - fs::remove(status_file_old); - if (fs::exists(status_file)) - fs::rename(status_file, status_file_old); - fs::rename(status_file_new, status_file); - fs::remove(status_file_old); - - b = fs::directory_iterator(updates_dir); - for (; b != e; ++b) - { - if (!fs::is_regular_file(b->status())) - continue; - fs::remove(b->path()); - } - - return current_status_db; -} - -static fs::path listfile_path(const vcpkg_paths& paths, const BinaryParagraph& pgh) -{ - return paths.vcpkg_dir_info / (pgh.fullstem() + ".list"); -} - -static std::string get_fullpkgname_from_listfile(const fs::path& path) -{ - auto ret = path.stem().generic_u8string(); - std::replace(ret.begin(), ret.end(), '_', ':'); - return ret; -} - -static void write_update(const vcpkg_paths& paths, const StatusParagraph& p) -{ - static int update_id = 0; - auto my_update_id = update_id++; - auto tmp_update_filename = paths.vcpkg_dir_updates / "incomplete"; - auto update_filename = paths.vcpkg_dir_updates / std::to_string(my_update_id); - std::fstream fs(tmp_update_filename, std::ios_base::out | std::ios_base::binary | std::ios_base::trunc); - fs << p; - fs.close(); - fs::rename(tmp_update_filename, update_filename); -} - -static void install_and_write_listfile(const vcpkg_paths& paths, const BinaryParagraph& bpgh) -{ - std::fstream listfile(listfile_path(paths, bpgh), std::ios_base::out | std::ios_base::binary | std::ios_base::trunc); - - auto package_prefix_path = paths.package_dir(bpgh.spec); - auto prefix_length = package_prefix_path.native().size(); - - const triplet& target_triplet = bpgh.spec.target_triplet(); - const std::string& target_triplet_as_string = target_triplet.canonical_name(); - std::error_code ec; - fs::create_directory(paths.installed / target_triplet_as_string, ec); - listfile << target_triplet << "\n"; - - for (auto it = fs::recursive_directory_iterator(package_prefix_path); it != fs::recursive_directory_iterator(); ++it) - { - const auto& filename = it->path().filename(); - if (fs::is_regular_file(it->status()) && (filename == "CONTROL" || filename == "control")) - { - // Do not copy the control file - continue; - } - - auto suffix = it->path().generic_u8string().substr(prefix_length + 1); - auto target = paths.installed / target_triplet_as_string / suffix; - - auto status = it->status(ec); - if (ec) - { - System::println(System::color::error, "failed: %s: %s", it->path().u8string(), ec.message()); - continue; - } - if (fs::is_directory(status)) - { - fs::create_directory(target, ec); - if (ec) - { - System::println(System::color::error, "failed: %s: %s", target.u8string(), ec.message()); - } - - listfile << target_triplet << "/" << suffix << "\n"; - } - else if (fs::is_regular_file(status)) - { - fs::copy_file(*it, target, ec); - if (ec) - { - System::println(System::color::error, "failed: %s: %s", target.u8string(), ec.message()); - } - listfile << target_triplet << "/" << suffix << "\n"; - } - else if (!fs::status_known(status)) - { - System::println(System::color::error, "failed: %s: unknown status", it->path().u8string()); - } - else - System::println(System::color::error, "failed: %s: cannot handle file type", it->path().u8string()); - } - - listfile.close(); -} - -// TODO: Refactoring between this function and install_package -std::vector vcpkg::get_unmet_package_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db) -{ - const fs::path packages_dir_control_file_path = paths.package_dir(spec) / "CONTROL"; - - auto control_contents_maybe = Files::get_contents(packages_dir_control_file_path); - if (auto control_contents = control_contents_maybe.get()) - { - std::vector> pghs; - try - { - pghs = Paragraphs::parse_paragraphs(*control_contents); - } - catch (std::runtime_error) - { - } - Checks::check_exit(pghs.size() == 1, "Invalid control file at %s", packages_dir_control_file_path.string()); - return BinaryParagraph(pghs[0]).depends; - } - - return get_unmet_package_build_dependencies(paths, spec, status_db); -} - -std::vector vcpkg::get_unmet_package_build_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db) -{ - const fs::path ports_dir_control_file_path = paths.port_dir(spec) / "CONTROL"; - auto control_contents_maybe = Files::get_contents(ports_dir_control_file_path); - if (auto control_contents = control_contents_maybe.get()) - { - std::vector> pghs; - try - { - pghs = Paragraphs::parse_paragraphs(*control_contents); - } - catch (std::runtime_error) - { - } - Checks::check_exit(pghs.size() == 1, "Invalid control file at %s", ports_dir_control_file_path.string()); - return filter_dependencies(SourceParagraph(pghs[0]).depends, spec.target_triplet()); - } - - Checks::exit_with_message("Could not find package named %s", spec); -} - -void vcpkg::install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs& status_db) -{ - StatusParagraph spgh; - spgh.package = binary_paragraph; - spgh.want = want_t::install; - spgh.state = install_state_t::half_installed; - for (auto&& dep : spgh.package.depends) - { - if (status_db.find_installed(dep, spgh.package.spec.target_triplet()) == status_db.end()) - { - Checks::unreachable(); - } - } - write_update(paths, spgh); - status_db.insert(std::make_unique(spgh)); - - install_and_write_listfile(paths, spgh.package); - - spgh.state = install_state_t::installed; - write_update(paths, spgh); - status_db.insert(std::make_unique(spgh)); -} - -enum class deinstall_plan -{ - not_installed, - dependencies_not_satisfied, - should_deinstall -}; - -static deinstall_plan deinstall_package_plan( - const StatusParagraphs::iterator package_it, - const StatusParagraphs& status_db, - std::vector& dependencies_out) -{ - dependencies_out.clear(); - - if (package_it == status_db.end() || (*package_it)->state == install_state_t::not_installed) - { - return deinstall_plan::not_installed; - } - - auto& pkg = (*package_it)->package; - - for (auto&& inst_pkg : status_db) - { - if (inst_pkg->want != want_t::install) - continue; - if (inst_pkg->package.spec.target_triplet() != pkg.spec.target_triplet()) - continue; - - const auto& deps = inst_pkg->package.depends; - - if (std::find(deps.begin(), deps.end(), pkg.spec.name()) != deps.end()) - { - dependencies_out.push_back(inst_pkg.get()); - } - } - - if (!dependencies_out.empty()) - return deinstall_plan::dependencies_not_satisfied; - - return deinstall_plan::should_deinstall; -} - -void vcpkg::deinstall_package(const vcpkg_paths& paths, const package_spec& spec, StatusParagraphs& status_db) -{ - auto package_it = status_db.find(spec.name(), spec.target_triplet()); - if (package_it == status_db.end()) - { - System::println(System::color::success, "Package %s is not installed", spec); - return; - } - - auto& pkg = **package_it; - - std::vector deps; - auto plan = deinstall_package_plan(package_it, status_db, deps); - switch (plan) - { - case deinstall_plan::not_installed: - System::println(System::color::success, "Package %s is not installed", spec); - return; - case deinstall_plan::dependencies_not_satisfied: - System::println(System::color::error, "Error: Cannot remove package %s:", spec); - for (auto&& dep : deps) - { - System::println(" %s depends on %s", dep->package.displayname(), pkg.package.displayname()); - } - exit(EXIT_FAILURE); - case deinstall_plan::should_deinstall: - break; - default: - Checks::unreachable(); - } - - pkg.want = want_t::purge; - pkg.state = install_state_t::half_installed; - write_update(paths, pkg); - - std::fstream listfile(listfile_path(paths, pkg.package), std::ios_base::in | std::ios_base::binary); - if (listfile) - { - std::vector dirs_touched; - std::string suffix; - while (std::getline(listfile, suffix)) - { - if (!suffix.empty() && suffix.back() == '\r') - suffix.pop_back(); - - std::error_code ec; - - auto target = paths.installed / suffix; - - auto status = fs::status(target, ec); - if (ec) - { - System::println(System::color::error, "failed: %s", ec.message()); - continue; - } - - if (fs::is_directory(status)) - { - dirs_touched.push_back(target); - } - else if (fs::is_regular_file(status)) - { - fs::remove(target, ec); - if (ec) - { - System::println(System::color::error, "failed: %s: %s", target.u8string(), ec.message()); - } - } - else if (!fs::status_known(status)) - { - System::println(System::color::warning, "Warning: unknown status: %s", target.u8string()); - } - else - { - System::println(System::color::warning, "Warning: %s: cannot handle file type", target.u8string()); - } - } - - auto b = dirs_touched.rbegin(); - auto e = dirs_touched.rend(); - for (; b != e; ++b) - { - if (fs::directory_iterator(*b) == fs::directory_iterator()) - { - std::error_code ec; - fs::remove(*b, ec); - if (ec) - { - System::println(System::color::error, "failed: %s", ec.message()); - } - } - } - - listfile.close(); - fs::remove(listfile_path(paths, pkg.package)); - } - - pkg.state = install_state_t::not_installed; - write_update(paths, pkg); - System::println(System::color::success, "Package %s was successfully removed", pkg.package.displayname()); -} - -void vcpkg::search_file(const vcpkg_paths& paths, const std::string& file_substr, const StatusParagraphs& status_db) -{ - std::string line; - - for (auto&& pgh : status_db) - { - if (pgh->state != install_state_t::installed) - continue; - - std::fstream listfile(listfile_path(paths, pgh->package)); - while (std::getline(listfile, line)) - { - if (line.empty()) - { - continue; - } - - if (line.find(file_substr) != std::string::npos) - { - System::println("%s: %s", pgh->package.displayname(), line); - } - } - } -} - -namespace -{ - struct Binaries - { - std::vector dlls; - std::vector libs; - }; - - Binaries detect_files_in_directory_ending_with(const fs::path& path) - { - Files::check_is_directory(path); - - Binaries binaries; - - for (auto it = fs::recursive_directory_iterator(path); it != fs::recursive_directory_iterator(); ++it) - { - fs::path file = *it; - // Skip if directory ????? - if (file.extension() == ".dll") - { - binaries.dlls.push_back(file); - } - else if (file.extension() == ".lib") - { - binaries.libs.push_back(file); - } - } - - return binaries; - } - - void copy_files_into_directory(const std::vector& files, const fs::path& destination_folder) - { - fs::create_directory(destination_folder); - - for (auto const& src_path : files) - { - fs::path dest_path = destination_folder / src_path.filename(); - fs::copy(src_path, dest_path, fs::copy_options::overwrite_existing); - } - } - - void place_library_files_in(const fs::path& include_directory, const fs::path& project_directory, const fs::path& destination_path) - { - Files::check_is_directory(include_directory); - Files::check_is_directory(project_directory); - Files::check_is_directory(destination_path); - Binaries debug_binaries = detect_files_in_directory_ending_with(project_directory / "Debug"); - Binaries release_binaries = detect_files_in_directory_ending_with(project_directory / "Release"); - - fs::path destination_include_directory = destination_path / "include"; - fs::copy(include_directory, destination_include_directory, fs::copy_options::recursive | fs::copy_options::overwrite_existing); - - copy_files_into_directory(release_binaries.dlls, destination_path / "bin"); - copy_files_into_directory(release_binaries.libs, destination_path / "lib"); - - fs::create_directory(destination_path / "debug"); - copy_files_into_directory(debug_binaries.dlls, destination_path / "debug" / "bin"); - copy_files_into_directory(debug_binaries.libs, destination_path / "debug" / "lib"); - } -} - -void vcpkg::binary_import(const vcpkg_paths& paths, const fs::path& include_directory, const fs::path& project_directory, const BinaryParagraph& control_file_data) -{ - fs::path library_destination_path = paths.package_dir(control_file_data.spec); - fs::create_directory(library_destination_path); - place_library_files_in(include_directory, project_directory, library_destination_path); - - fs::path control_file_path = library_destination_path / "CONTROL"; - std::ofstream(control_file_path) << control_file_data; -} diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index a9ef963e7..560df8dcb 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -1,13 +1,525 @@ #include "vcpkg.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "vcpkg_Files.h" +#include "vcpkg_System.h" +#include "Paragraphs.h" #include -namespace vcpkg +using namespace vcpkg; + +bool vcpkg::g_do_dry_run = false; + +namespace +{ + template + auto find_or_default(const M& map, const K& key, const V& val) + { + auto it = map.find(key); + if (it == map.end()) + return decltype(it->second)(val); + else + return it->second; + } +} + +namespace +{ + std::fstream open_status_file(const vcpkg_paths& paths, std::ios_base::openmode mode = std::ios_base::app | std::ios_base::in | std::ios_base::out | std::ios_base::binary) + { + return std::fstream(paths.vcpkg_dir_status_file, mode); + } +} + +static StatusParagraphs load_current_database(const fs::path& vcpkg_dir_status_file, const fs::path& vcpkg_dir_status_file_old) +{ + if (!fs::exists(vcpkg_dir_status_file)) + { + if (!fs::exists(vcpkg_dir_status_file_old)) + { + // no status file, use empty db + return StatusParagraphs(); + } + + fs::rename(vcpkg_dir_status_file_old, vcpkg_dir_status_file); + } + + auto text = Files::get_contents(vcpkg_dir_status_file).get_or_throw(); + auto pghs = Paragraphs::parse_paragraphs(text); + + std::vector> status_pghs; + for (auto&& p : pghs) + { + status_pghs.push_back(std::make_unique(p)); + } + + return StatusParagraphs(std::move(status_pghs)); +} + +std::string vcpkg::shorten_description(const std::string& desc) +{ + auto simple_desc = std::regex_replace(desc.substr(0, 49), std::regex("\\n( |\\t)?"), ""); + if (desc.size() > 49) + simple_desc.append("..."); + return simple_desc; +} + +StatusParagraphs vcpkg::database_load_check(const vcpkg_paths& paths) { - std::string shorten_description(const std::string& desc) + auto updates_dir = paths.vcpkg_dir_updates; + + std::error_code ec; + fs::create_directory(paths.installed, ec); + fs::create_directory(paths.vcpkg_dir, ec); + fs::create_directory(paths.vcpkg_dir_info, ec); + fs::create_directory(updates_dir, ec); + + const fs::path& status_file = paths.vcpkg_dir_status_file; + const fs::path status_file_old = status_file.parent_path() / "status-old"; + const fs::path status_file_new = status_file.parent_path() / "status-new"; + + StatusParagraphs current_status_db = load_current_database(status_file, status_file_old); + + auto b = fs::directory_iterator(updates_dir); + auto e = fs::directory_iterator(); + if (b == e) { - auto simple_desc = std::regex_replace(desc.substr(0, 49), std::regex("\\n( |\\t)?"), ""); - if (desc.size() > 49) - simple_desc.append("..."); - return simple_desc; + // updates directory is empty, control file is up-to-date. + return current_status_db; + } + + for (; b != e; ++b) + { + if (!fs::is_regular_file(b->status())) + continue; + if (b->path().filename() == "incomplete") + continue; + + auto text = Files::get_contents(b->path()).get_or_throw(); + auto pghs = Paragraphs::parse_paragraphs(text); + for (auto&& p : pghs) + { + current_status_db.insert(std::make_unique(p)); + } } + + std::fstream(status_file_new, std::ios_base::out | std::ios_base::binary | std::ios_base::trunc) << current_status_db; + + if (fs::exists(status_file_old)) + fs::remove(status_file_old); + if (fs::exists(status_file)) + fs::rename(status_file, status_file_old); + fs::rename(status_file_new, status_file); + fs::remove(status_file_old); + + b = fs::directory_iterator(updates_dir); + for (; b != e; ++b) + { + if (!fs::is_regular_file(b->status())) + continue; + fs::remove(b->path()); + } + + return current_status_db; +} + +static fs::path listfile_path(const vcpkg_paths& paths, const BinaryParagraph& pgh) +{ + return paths.vcpkg_dir_info / (pgh.fullstem() + ".list"); +} + +static std::string get_fullpkgname_from_listfile(const fs::path& path) +{ + auto ret = path.stem().generic_u8string(); + std::replace(ret.begin(), ret.end(), '_', ':'); + return ret; +} + +static void write_update(const vcpkg_paths& paths, const StatusParagraph& p) +{ + static int update_id = 0; + auto my_update_id = update_id++; + auto tmp_update_filename = paths.vcpkg_dir_updates / "incomplete"; + auto update_filename = paths.vcpkg_dir_updates / std::to_string(my_update_id); + std::fstream fs(tmp_update_filename, std::ios_base::out | std::ios_base::binary | std::ios_base::trunc); + fs << p; + fs.close(); + fs::rename(tmp_update_filename, update_filename); +} + +static void install_and_write_listfile(const vcpkg_paths& paths, const BinaryParagraph& bpgh) +{ + std::fstream listfile(listfile_path(paths, bpgh), std::ios_base::out | std::ios_base::binary | std::ios_base::trunc); + + auto package_prefix_path = paths.package_dir(bpgh.spec); + auto prefix_length = package_prefix_path.native().size(); + + const triplet& target_triplet = bpgh.spec.target_triplet(); + const std::string& target_triplet_as_string = target_triplet.canonical_name(); + std::error_code ec; + fs::create_directory(paths.installed / target_triplet_as_string, ec); + listfile << target_triplet << "\n"; + + for (auto it = fs::recursive_directory_iterator(package_prefix_path); it != fs::recursive_directory_iterator(); ++it) + { + const auto& filename = it->path().filename(); + if (fs::is_regular_file(it->status()) && (filename == "CONTROL" || filename == "control")) + { + // Do not copy the control file + continue; + } + + auto suffix = it->path().generic_u8string().substr(prefix_length + 1); + auto target = paths.installed / target_triplet_as_string / suffix; + + auto status = it->status(ec); + if (ec) + { + System::println(System::color::error, "failed: %s: %s", it->path().u8string(), ec.message()); + continue; + } + if (fs::is_directory(status)) + { + fs::create_directory(target, ec); + if (ec) + { + System::println(System::color::error, "failed: %s: %s", target.u8string(), ec.message()); + } + + listfile << target_triplet << "/" << suffix << "\n"; + } + else if (fs::is_regular_file(status)) + { + fs::copy_file(*it, target, ec); + if (ec) + { + System::println(System::color::error, "failed: %s: %s", target.u8string(), ec.message()); + } + listfile << target_triplet << "/" << suffix << "\n"; + } + else if (!fs::status_known(status)) + { + System::println(System::color::error, "failed: %s: unknown status", it->path().u8string()); + } + else + System::println(System::color::error, "failed: %s: cannot handle file type", it->path().u8string()); + } + + listfile.close(); +} + +// TODO: Refactoring between this function and install_package +std::vector vcpkg::get_unmet_package_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db) +{ + const fs::path packages_dir_control_file_path = paths.package_dir(spec) / "CONTROL"; + + auto control_contents_maybe = Files::get_contents(packages_dir_control_file_path); + if (auto control_contents = control_contents_maybe.get()) + { + std::vector> pghs; + try + { + pghs = Paragraphs::parse_paragraphs(*control_contents); + } + catch (std::runtime_error) + { + } + Checks::check_exit(pghs.size() == 1, "Invalid control file at %s", packages_dir_control_file_path.string()); + return BinaryParagraph(pghs[0]).depends; + } + + return get_unmet_package_build_dependencies(paths, spec, status_db); +} + +std::vector vcpkg::get_unmet_package_build_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db) +{ + const fs::path ports_dir_control_file_path = paths.port_dir(spec) / "CONTROL"; + auto control_contents_maybe = Files::get_contents(ports_dir_control_file_path); + if (auto control_contents = control_contents_maybe.get()) + { + std::vector> pghs; + try + { + pghs = Paragraphs::parse_paragraphs(*control_contents); + } + catch (std::runtime_error) + { + } + Checks::check_exit(pghs.size() == 1, "Invalid control file at %s", ports_dir_control_file_path.string()); + return filter_dependencies(SourceParagraph(pghs[0]).depends, spec.target_triplet()); + } + + Checks::exit_with_message("Could not find package named %s", spec); +} + +void vcpkg::install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs& status_db) +{ + StatusParagraph spgh; + spgh.package = binary_paragraph; + spgh.want = want_t::install; + spgh.state = install_state_t::half_installed; + for (auto&& dep : spgh.package.depends) + { + if (status_db.find_installed(dep, spgh.package.spec.target_triplet()) == status_db.end()) + { + Checks::unreachable(); + } + } + write_update(paths, spgh); + status_db.insert(std::make_unique(spgh)); + + install_and_write_listfile(paths, spgh.package); + + spgh.state = install_state_t::installed; + write_update(paths, spgh); + status_db.insert(std::make_unique(spgh)); +} + +enum class deinstall_plan +{ + not_installed, + dependencies_not_satisfied, + should_deinstall +}; + +static deinstall_plan deinstall_package_plan( + const StatusParagraphs::iterator package_it, + const StatusParagraphs& status_db, + std::vector& dependencies_out) +{ + dependencies_out.clear(); + + if (package_it == status_db.end() || (*package_it)->state == install_state_t::not_installed) + { + return deinstall_plan::not_installed; + } + + auto& pkg = (*package_it)->package; + + for (auto&& inst_pkg : status_db) + { + if (inst_pkg->want != want_t::install) + continue; + if (inst_pkg->package.spec.target_triplet() != pkg.spec.target_triplet()) + continue; + + const auto& deps = inst_pkg->package.depends; + + if (std::find(deps.begin(), deps.end(), pkg.spec.name()) != deps.end()) + { + dependencies_out.push_back(inst_pkg.get()); + } + } + + if (!dependencies_out.empty()) + return deinstall_plan::dependencies_not_satisfied; + + return deinstall_plan::should_deinstall; +} + +void vcpkg::deinstall_package(const vcpkg_paths& paths, const package_spec& spec, StatusParagraphs& status_db) +{ + auto package_it = status_db.find(spec.name(), spec.target_triplet()); + if (package_it == status_db.end()) + { + System::println(System::color::success, "Package %s is not installed", spec); + return; + } + + auto& pkg = **package_it; + + std::vector deps; + auto plan = deinstall_package_plan(package_it, status_db, deps); + switch (plan) + { + case deinstall_plan::not_installed: + System::println(System::color::success, "Package %s is not installed", spec); + return; + case deinstall_plan::dependencies_not_satisfied: + System::println(System::color::error, "Error: Cannot remove package %s:", spec); + for (auto&& dep : deps) + { + System::println(" %s depends on %s", dep->package.displayname(), pkg.package.displayname()); + } + exit(EXIT_FAILURE); + case deinstall_plan::should_deinstall: + break; + default: + Checks::unreachable(); + } + + pkg.want = want_t::purge; + pkg.state = install_state_t::half_installed; + write_update(paths, pkg); + + std::fstream listfile(listfile_path(paths, pkg.package), std::ios_base::in | std::ios_base::binary); + if (listfile) + { + std::vector dirs_touched; + std::string suffix; + while (std::getline(listfile, suffix)) + { + if (!suffix.empty() && suffix.back() == '\r') + suffix.pop_back(); + + std::error_code ec; + + auto target = paths.installed / suffix; + + auto status = fs::status(target, ec); + if (ec) + { + System::println(System::color::error, "failed: %s", ec.message()); + continue; + } + + if (fs::is_directory(status)) + { + dirs_touched.push_back(target); + } + else if (fs::is_regular_file(status)) + { + fs::remove(target, ec); + if (ec) + { + System::println(System::color::error, "failed: %s: %s", target.u8string(), ec.message()); + } + } + else if (!fs::status_known(status)) + { + System::println(System::color::warning, "Warning: unknown status: %s", target.u8string()); + } + else + { + System::println(System::color::warning, "Warning: %s: cannot handle file type", target.u8string()); + } + } + + auto b = dirs_touched.rbegin(); + auto e = dirs_touched.rend(); + for (; b != e; ++b) + { + if (fs::directory_iterator(*b) == fs::directory_iterator()) + { + std::error_code ec; + fs::remove(*b, ec); + if (ec) + { + System::println(System::color::error, "failed: %s", ec.message()); + } + } + } + + listfile.close(); + fs::remove(listfile_path(paths, pkg.package)); + } + + pkg.state = install_state_t::not_installed; + write_update(paths, pkg); + System::println(System::color::success, "Package %s was successfully removed", pkg.package.displayname()); +} + +void vcpkg::search_file(const vcpkg_paths& paths, const std::string& file_substr, const StatusParagraphs& status_db) +{ + std::string line; + + for (auto&& pgh : status_db) + { + if (pgh->state != install_state_t::installed) + continue; + + std::fstream listfile(listfile_path(paths, pgh->package)); + while (std::getline(listfile, line)) + { + if (line.empty()) + { + continue; + } + + if (line.find(file_substr) != std::string::npos) + { + System::println("%s: %s", pgh->package.displayname(), line); + } + } + } +} + +namespace +{ + struct Binaries + { + std::vector dlls; + std::vector libs; + }; + + Binaries detect_files_in_directory_ending_with(const fs::path& path) + { + Files::check_is_directory(path); + + Binaries binaries; + + for (auto it = fs::recursive_directory_iterator(path); it != fs::recursive_directory_iterator(); ++it) + { + fs::path file = *it; + // Skip if directory ????? + if (file.extension() == ".dll") + { + binaries.dlls.push_back(file); + } + else if (file.extension() == ".lib") + { + binaries.libs.push_back(file); + } + } + + return binaries; + } + + void copy_files_into_directory(const std::vector& files, const fs::path& destination_folder) + { + fs::create_directory(destination_folder); + + for (auto const& src_path : files) + { + fs::path dest_path = destination_folder / src_path.filename(); + fs::copy(src_path, dest_path, fs::copy_options::overwrite_existing); + } + } + + void place_library_files_in(const fs::path& include_directory, const fs::path& project_directory, const fs::path& destination_path) + { + Files::check_is_directory(include_directory); + Files::check_is_directory(project_directory); + Files::check_is_directory(destination_path); + Binaries debug_binaries = detect_files_in_directory_ending_with(project_directory / "Debug"); + Binaries release_binaries = detect_files_in_directory_ending_with(project_directory / "Release"); + + fs::path destination_include_directory = destination_path / "include"; + fs::copy(include_directory, destination_include_directory, fs::copy_options::recursive | fs::copy_options::overwrite_existing); + + copy_files_into_directory(release_binaries.dlls, destination_path / "bin"); + copy_files_into_directory(release_binaries.libs, destination_path / "lib"); + + fs::create_directory(destination_path / "debug"); + copy_files_into_directory(debug_binaries.dlls, destination_path / "debug" / "bin"); + copy_files_into_directory(debug_binaries.libs, destination_path / "debug" / "lib"); + } +} + +void vcpkg::binary_import(const vcpkg_paths& paths, const fs::path& include_directory, const fs::path& project_directory, const BinaryParagraph& control_file_data) +{ + fs::path library_destination_path = paths.package_dir(control_file_data.spec); + fs::create_directory(library_destination_path); + place_library_files_in(include_directory, project_directory, library_destination_path); + + fs::path control_file_path = library_destination_path / "CONTROL"; + std::ofstream(control_file_path) << control_file_data; } diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index 5d1554d49..de8e3c8ca 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -136,7 +136,7 @@ - + @@ -144,7 +144,6 @@ - diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index 358839f8a..24a417c0d 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -15,12 +15,6 @@ - - Source Files - - - Source Files - Source Files @@ -54,6 +48,9 @@ Source Files + + Source Files + -- cgit v1.2.3 From b66679e2cb910f60047fec269945d060d665cb9f Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 7 Nov 2016 16:13:45 -0800 Subject: [box2d] Use most recent release in version --- ports/box2d/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/box2d/CONTROL b/ports/box2d/CONTROL index 4126c7b89..7cfcb01a0 100644 --- a/ports/box2d/CONTROL +++ b/ports/box2d/CONTROL @@ -1,3 +1,3 @@ Source: box2d -Version: 374664b +Version: 2.3.1-374664b Description: Box2D (http://box2d.org) is an open source C++ engine for simulating rigid bodies in 2D. -- cgit v1.2.3 From d65e78f6f5005c08832668a8f713d1f678c49b7c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 16:17:34 -0800 Subject: Move functions that are only used by `import` out of vcpkg.h/cpp --- toolsrc/include/vcpkg.h | 2 -- toolsrc/src/commands_import.cpp | 75 +++++++++++++++++++++++++++++++++++++++-- toolsrc/src/vcpkg.cpp | 72 --------------------------------------- 3 files changed, 73 insertions(+), 76 deletions(-) diff --git a/toolsrc/include/vcpkg.h b/toolsrc/include/vcpkg.h index 1715a40a5..4e284241d 100644 --- a/toolsrc/include/vcpkg.h +++ b/toolsrc/include/vcpkg.h @@ -26,7 +26,5 @@ namespace vcpkg void search_file(const vcpkg_paths& paths, const std::string& file_substr, const StatusParagraphs& status_db); - void binary_import(const vcpkg_paths& paths, const fs::path& include_directory, const fs::path& project_directory, const BinaryParagraph& control_file_data); - const std::string& version(); } // namespace vcpkg diff --git a/toolsrc/src/commands_import.cpp b/toolsrc/src/commands_import.cpp index 7a6139085..e5e731799 100644 --- a/toolsrc/src/commands_import.cpp +++ b/toolsrc/src/commands_import.cpp @@ -1,9 +1,80 @@ #include "vcpkg_Commands.h" -#include "vcpkg.h" #include "Paragraphs.h" +#include "StatusParagraph.h" +#include "vcpkg_Files.h" +#include namespace vcpkg { + struct Binaries + { + std::vector dlls; + std::vector libs; + }; + + static Binaries detect_files_in_directory_ending_with(const fs::path& path) + { + Files::check_is_directory(path); + + Binaries binaries; + + for (auto it = fs::recursive_directory_iterator(path); it != fs::recursive_directory_iterator(); ++it) + { + fs::path file = *it; + // Skip if directory ????? + if (file.extension() == ".dll") + { + binaries.dlls.push_back(file); + } + else if (file.extension() == ".lib") + { + binaries.libs.push_back(file); + } + } + + return binaries; + } + + static void copy_files_into_directory(const std::vector& files, const fs::path& destination_folder) + { + fs::create_directory(destination_folder); + + for (auto const& src_path : files) + { + fs::path dest_path = destination_folder / src_path.filename(); + fs::copy(src_path, dest_path, fs::copy_options::overwrite_existing); + } + } + + static void place_library_files_in(const fs::path& include_directory, const fs::path& project_directory, const fs::path& destination_path) + { + Files::check_is_directory(include_directory); + Files::check_is_directory(project_directory); + Files::check_is_directory(destination_path); + Binaries debug_binaries = detect_files_in_directory_ending_with(project_directory / "Debug"); + Binaries release_binaries = detect_files_in_directory_ending_with(project_directory / "Release"); + + fs::path destination_include_directory = destination_path / "include"; + fs::copy(include_directory, destination_include_directory, fs::copy_options::recursive | fs::copy_options::overwrite_existing); + + copy_files_into_directory(release_binaries.dlls, destination_path / "bin"); + copy_files_into_directory(release_binaries.libs, destination_path / "lib"); + + fs::create_directory(destination_path / "debug"); + copy_files_into_directory(debug_binaries.dlls, destination_path / "debug" / "bin"); + copy_files_into_directory(debug_binaries.libs, destination_path / "debug" / "lib"); + } + + static void do_import(const vcpkg_paths& paths, const fs::path& include_directory, const fs::path& project_directory, const BinaryParagraph& control_file_data) + { + fs::path library_destination_path = paths.package_dir(control_file_data.spec); + fs::create_directory(library_destination_path); + place_library_files_in(include_directory, project_directory, library_destination_path); + + fs::path control_file_path = library_destination_path / "CONTROL"; + std::ofstream(control_file_path) << control_file_data; + } + 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)"); @@ -20,7 +91,7 @@ namespace vcpkg spgh.package = BinaryParagraph(pghs[0]); auto& control_file_data = spgh.package; - vcpkg::binary_import(paths, include_directory, project_directory, control_file_data); + do_import(paths, include_directory, project_directory, control_file_data); exit(EXIT_SUCCESS); } } diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index 560df8dcb..3e1f16179 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -451,75 +451,3 @@ void vcpkg::search_file(const vcpkg_paths& paths, const std::string& file_substr } } } - -namespace -{ - struct Binaries - { - std::vector dlls; - std::vector libs; - }; - - Binaries detect_files_in_directory_ending_with(const fs::path& path) - { - Files::check_is_directory(path); - - Binaries binaries; - - for (auto it = fs::recursive_directory_iterator(path); it != fs::recursive_directory_iterator(); ++it) - { - fs::path file = *it; - // Skip if directory ????? - if (file.extension() == ".dll") - { - binaries.dlls.push_back(file); - } - else if (file.extension() == ".lib") - { - binaries.libs.push_back(file); - } - } - - return binaries; - } - - void copy_files_into_directory(const std::vector& files, const fs::path& destination_folder) - { - fs::create_directory(destination_folder); - - for (auto const& src_path : files) - { - fs::path dest_path = destination_folder / src_path.filename(); - fs::copy(src_path, dest_path, fs::copy_options::overwrite_existing); - } - } - - void place_library_files_in(const fs::path& include_directory, const fs::path& project_directory, const fs::path& destination_path) - { - Files::check_is_directory(include_directory); - Files::check_is_directory(project_directory); - Files::check_is_directory(destination_path); - Binaries debug_binaries = detect_files_in_directory_ending_with(project_directory / "Debug"); - Binaries release_binaries = detect_files_in_directory_ending_with(project_directory / "Release"); - - fs::path destination_include_directory = destination_path / "include"; - fs::copy(include_directory, destination_include_directory, fs::copy_options::recursive | fs::copy_options::overwrite_existing); - - copy_files_into_directory(release_binaries.dlls, destination_path / "bin"); - copy_files_into_directory(release_binaries.libs, destination_path / "lib"); - - fs::create_directory(destination_path / "debug"); - copy_files_into_directory(debug_binaries.dlls, destination_path / "debug" / "bin"); - copy_files_into_directory(debug_binaries.libs, destination_path / "debug" / "lib"); - } -} - -void vcpkg::binary_import(const vcpkg_paths& paths, const fs::path& include_directory, const fs::path& project_directory, const BinaryParagraph& control_file_data) -{ - fs::path library_destination_path = paths.package_dir(control_file_data.spec); - fs::create_directory(library_destination_path); - place_library_files_in(include_directory, project_directory, library_destination_path); - - fs::path control_file_path = library_destination_path / "CONTROL"; - std::ofstream(control_file_path) << control_file_data; -} -- cgit v1.2.3 From f13b9cd24af72f4865ccfa0a64a1a43770da4833 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 16:20:32 -0800 Subject: Don't #include vcpkg.h in portsdiff.cpp --- toolsrc/src/commands_portsdiff.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/commands_portsdiff.cpp b/toolsrc/src/commands_portsdiff.cpp index fdbaec0ac..3789e3b42 100644 --- a/toolsrc/src/commands_portsdiff.cpp +++ b/toolsrc/src/commands_portsdiff.cpp @@ -1,6 +1,5 @@ #include "vcpkg_Commands.h" #include "vcpkg_System.h" -#include "vcpkg.h" #include #include #include "vcpkg_Maps.h" @@ -8,6 +7,7 @@ #include #include #include "Paragraphs.h" +#include "SourceParagraph.h" namespace vcpkg { -- cgit v1.2.3 From 2f0da1a854b0e433e92d37bd665feb8fea34ac15 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 7 Nov 2016 16:24:47 -0800 Subject: [box2d] Use vcpkg_build_msbuild instead of invoking msbuild/devenv directly. --- ports/box2d/portfile.cmake | 49 ++++++++++++++++++---------------------------- 1 file changed, 19 insertions(+), 30 deletions(-) diff --git a/ports/box2d/portfile.cmake b/ports/box2d/portfile.cmake index b7f101915..e35242bb7 100644 --- a/ports/box2d/portfile.cmake +++ b/ports/box2d/portfile.cmake @@ -1,10 +1,8 @@ include(${CMAKE_TRIPLET_FILE}) -# Get architecture params -set(PROJECT_ARCH "x64") -set(PROJECT_ARCH_BITS "${PROJECT_ARCH}") +# Get output directory +set(PROJECT_ARCH_BITS "x64") if(TRIPLET_SYSTEM_ARCH MATCHES "x86") - set(PROJECT_ARCH "Win32") set(PROJECT_ARCH_BITS "x32") elseif(TRIPLET_SYSTEM_ARCH MATCHES "arm") message(FATAL_ERROR "ARM not supported") @@ -47,36 +45,27 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/share/box2d/License.txt ${CURRENT_PACKAGES_D message(STATUS "Packaging license done") # Building: -set(PROJECT "./Box2D/Build/vs2015/Box2D.vcxproj") set(OUTPUTS_PATH "${SOURCE_PATH}/Box2D/Build/vs2015/bin/${PROJECT_ARCH_BITS}") -foreach(TYPE "Release" "Debug") - message(STATUS "Building ${TARGET_TRIPLET}-${TYPE}") - vcpkg_execute_required_process( - COMMAND "devenv.exe" - "./Box2D/Build/vs2015/Box2D.sln" - /Build "${TYPE}|${PROJECT_ARCH}" - /Project "${PROJECT}" - /Projectconfig "${TYPE}|${PROJECT_ARCH}" - WORKING_DIRECTORY ${SOURCE_PATH} - LOGNAME build-${TARGET_TRIPLET}-${TYPE} - ) - message(STATUS "Building ${TARGET_TRIPLET}-${TYPE} done") +vcpkg_build_msbuild(PROJECT_PATH ${SOURCE_PATH}/Box2D/Build/vs2015/Box2D.vcxproj) - set(TARGET_PATH "${CURRENT_PACKAGES_DIR}") - if(TYPE STREQUAL Debug) - set(TARGET_PATH "${CURRENT_PACKAGES_DIR}/debug") - endif(TYPE STREQUAL Debug) +message(STATUS "Packaging ${TARGET_TRIPLET}-Release lib") +file( + INSTALL ${OUTPUTS_PATH}/Release/ + DESTINATION ${CURRENT_PACKAGES_DIR}/lib + FILES_MATCHING PATTERN "*.lib" +) +file(RENAME ${CURRENT_PACKAGES_DIR}/lib/Box2D.lib ${CURRENT_PACKAGES_DIR}/lib/box2d.lib) +message(STATUS "Packaging ${TARGET_TRIPLET}-Release lib done") - message(STATUS "Packaging ${TARGET_TRIPLET}-${TYPE} lib") - file( - INSTALL ${OUTPUTS_PATH}/${TYPE}/ - DESTINATION ${TARGET_PATH}/lib - FILES_MATCHING PATTERN "*.lib" - ) - file(RENAME ${TARGET_PATH}/lib/Box2D.lib ${TARGET_PATH}/lib/box2d.lib) - message(STATUS "Packaging ${TARGET_TRIPLET}-${TYPE} lib done") -endforeach(TYPE "Release" "Debug") +message(STATUS "Packaging ${TARGET_TRIPLET}-Debug lib") +file( + INSTALL ${OUTPUTS_PATH}/Debug/ + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib + FILES_MATCHING PATTERN "*.lib" +) +file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/Box2D.lib ${CURRENT_PACKAGES_DIR}/debug/lib/box2d.lib) +message(STATUS "Packaging ${TARGET_TRIPLET}-Debug lib done") message(STATUS "Packaging headers") file( -- cgit v1.2.3 From 5c769e462b377ce06ad46998794a189f3a1b55bc Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 16:33:08 -0800 Subject: Remove unused #include --- toolsrc/src/vcpkg_Dependencies.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp index 0e45b28dd..28c5e291f 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg_Dependencies.cpp @@ -7,7 +7,6 @@ #include #include "vcpkg.h" #include "vcpkg_Maps.h" -#include "vcpkg_Sets.h" namespace vcpkg { namespace Dependencies { -- cgit v1.2.3 From 8be5e7c123d241cd4a71d03acdf43ceccf57ded2 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 16:38:49 -0800 Subject: Move Dependency-related functions from vcpkg.h to vcpkg_Dependencies.h --- toolsrc/include/vcpkg.h | 4 --- toolsrc/include/vcpkg_Dependencies.h | 3 +++ toolsrc/src/commands_installation.cpp | 2 +- toolsrc/src/vcpkg.cpp | 44 --------------------------------- toolsrc/src/vcpkg_Dependencies.cpp | 46 +++++++++++++++++++++++++++++++++++ 5 files changed, 50 insertions(+), 49 deletions(-) diff --git a/toolsrc/include/vcpkg.h b/toolsrc/include/vcpkg.h index 4e284241d..b9d646e70 100644 --- a/toolsrc/include/vcpkg.h +++ b/toolsrc/include/vcpkg.h @@ -1,7 +1,6 @@ #pragma once #include -#include #include #include "package_spec.h" #include "BinaryParagraph.h" @@ -18,9 +17,6 @@ namespace vcpkg StatusParagraphs database_load_check(const vcpkg_paths& paths); - std::vector get_unmet_package_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db); - std::vector get_unmet_package_build_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db); - void install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs& status_db); void deinstall_package(const vcpkg_paths& paths, const package_spec& spec, StatusParagraphs& status_db); diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 94aa51f99..d8d331f9c 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -10,4 +10,7 @@ namespace vcpkg {namespace Dependencies std::vector create_dependency_ordered_install_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); std::unordered_set find_unmet_dependencies(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); + + std::vector get_unmet_package_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db); + std::vector get_unmet_package_build_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db); }} diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_installation.cpp index b5f4e1a5d..d8ac974b3 100644 --- a/toolsrc/src/commands_installation.cpp +++ b/toolsrc/src/commands_installation.cpp @@ -141,7 +141,7 @@ namespace vcpkg Input::check_triplet(spec.target_triplet(), paths); // Explicitly load and use the portfile's build dependencies when resolving the build command (instead of a cached package's dependencies). - auto first_level_deps = get_unmet_package_build_dependencies(paths, spec, status_db); + auto first_level_deps = Dependencies::get_unmet_package_build_dependencies(paths, spec, status_db); std::vector first_level_deps_specs; for (auto&& dep : first_level_deps) { diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index 3e1f16179..bd02f5424 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -216,50 +216,6 @@ static void install_and_write_listfile(const vcpkg_paths& paths, const BinaryPar listfile.close(); } -// TODO: Refactoring between this function and install_package -std::vector vcpkg::get_unmet_package_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db) -{ - const fs::path packages_dir_control_file_path = paths.package_dir(spec) / "CONTROL"; - - auto control_contents_maybe = Files::get_contents(packages_dir_control_file_path); - if (auto control_contents = control_contents_maybe.get()) - { - std::vector> pghs; - try - { - pghs = Paragraphs::parse_paragraphs(*control_contents); - } - catch (std::runtime_error) - { - } - Checks::check_exit(pghs.size() == 1, "Invalid control file at %s", packages_dir_control_file_path.string()); - return BinaryParagraph(pghs[0]).depends; - } - - return get_unmet_package_build_dependencies(paths, spec, status_db); -} - -std::vector vcpkg::get_unmet_package_build_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db) -{ - const fs::path ports_dir_control_file_path = paths.port_dir(spec) / "CONTROL"; - auto control_contents_maybe = Files::get_contents(ports_dir_control_file_path); - if (auto control_contents = control_contents_maybe.get()) - { - std::vector> pghs; - try - { - pghs = Paragraphs::parse_paragraphs(*control_contents); - } - catch (std::runtime_error) - { - } - Checks::check_exit(pghs.size() == 1, "Invalid control file at %s", ports_dir_control_file_path.string()); - return filter_dependencies(SourceParagraph(pghs[0]).depends, spec.target_triplet()); - } - - Checks::exit_with_message("Could not find package named %s", spec); -} - void vcpkg::install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs& status_db) { StatusParagraph spgh; diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp index 28c5e291f..2e79a2499 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg_Dependencies.cpp @@ -7,6 +7,8 @@ #include #include "vcpkg.h" #include "vcpkg_Maps.h" +#include "vcpkg_Files.h" +#include "Paragraphs.h" namespace vcpkg { namespace Dependencies { @@ -61,4 +63,48 @@ namespace vcpkg { namespace Dependencies const Graphs::Graph dependency_graph = build_dependency_graph(paths, specs, status_db); return Maps::extract_key_set(dependency_graph.adjacency_list()); } + + // TODO: Refactoring between this function and install_package + std::vector get_unmet_package_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db) + { + const fs::path packages_dir_control_file_path = paths.package_dir(spec) / "CONTROL"; + + auto control_contents_maybe = Files::get_contents(packages_dir_control_file_path); + if (auto control_contents = control_contents_maybe.get()) + { + std::vector> pghs; + try + { + pghs = Paragraphs::parse_paragraphs(*control_contents); + } + catch (std::runtime_error) + { + } + Checks::check_exit(pghs.size() == 1, "Invalid control file at %s", packages_dir_control_file_path.string()); + return BinaryParagraph(pghs[0]).depends; + } + + return get_unmet_package_build_dependencies(paths, spec, status_db); + } + + std::vector get_unmet_package_build_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db) + { + const fs::path ports_dir_control_file_path = paths.port_dir(spec) / "CONTROL"; + auto control_contents_maybe = Files::get_contents(ports_dir_control_file_path); + if (auto control_contents = control_contents_maybe.get()) + { + std::vector> pghs; + try + { + pghs = Paragraphs::parse_paragraphs(*control_contents); + } + catch (std::runtime_error) + { + } + Checks::check_exit(pghs.size() == 1, "Invalid control file at %s", ports_dir_control_file_path.string()); + return filter_dependencies(SourceParagraph(pghs[0]).depends, spec.target_triplet()); + } + + Checks::exit_with_message("Could not find package named %s", spec); + } }} -- cgit v1.2.3 From d85e169c054c0702ec6cd2deedff58eaf49dcfab Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 17:05:32 -0800 Subject: [Dependencies] Make function static --- toolsrc/include/vcpkg_Dependencies.h | 1 - toolsrc/src/vcpkg_Dependencies.cpp | 48 ++++++++++++++++++------------------ 2 files changed, 24 insertions(+), 25 deletions(-) diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index d8d331f9c..d8709e0bb 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -11,6 +11,5 @@ namespace vcpkg {namespace Dependencies std::unordered_set find_unmet_dependencies(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); - std::vector get_unmet_package_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db); std::vector get_unmet_package_build_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db); }} diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp index 2e79a2499..953bd9925 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg_Dependencies.cpp @@ -12,6 +12,29 @@ namespace vcpkg { namespace Dependencies { + // TODO: Refactoring between this function and install_package + static std::vector get_single_level_unmet_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db) + { + const fs::path packages_dir_control_file_path = paths.package_dir(spec) / "CONTROL"; + + auto control_contents_maybe = Files::get_contents(packages_dir_control_file_path); + if (auto control_contents = control_contents_maybe.get()) + { + std::vector> pghs; + try + { + pghs = Paragraphs::parse_paragraphs(*control_contents); + } + catch (std::runtime_error) + { + } + Checks::check_exit(pghs.size() == 1, "Invalid control file at %s", packages_dir_control_file_path.string()); + return BinaryParagraph(pghs[0]).depends; + } + + return get_unmet_package_build_dependencies(paths, spec, status_db); + } + static Graphs::Graph build_dependency_graph(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db) { std::vector examine_stack(specs); @@ -29,7 +52,7 @@ namespace vcpkg { namespace Dependencies continue; } - std::vector dependencies_as_string = get_unmet_package_dependencies(paths, spec, status_db); + std::vector dependencies_as_string = get_single_level_unmet_dependencies(paths, spec, status_db); for (const std::string& dep_as_string : dependencies_as_string) { @@ -64,29 +87,6 @@ namespace vcpkg { namespace Dependencies return Maps::extract_key_set(dependency_graph.adjacency_list()); } - // TODO: Refactoring between this function and install_package - std::vector get_unmet_package_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db) - { - const fs::path packages_dir_control_file_path = paths.package_dir(spec) / "CONTROL"; - - auto control_contents_maybe = Files::get_contents(packages_dir_control_file_path); - if (auto control_contents = control_contents_maybe.get()) - { - std::vector> pghs; - try - { - pghs = Paragraphs::parse_paragraphs(*control_contents); - } - catch (std::runtime_error) - { - } - Checks::check_exit(pghs.size() == 1, "Invalid control file at %s", packages_dir_control_file_path.string()); - return BinaryParagraph(pghs[0]).depends; - } - - return get_unmet_package_build_dependencies(paths, spec, status_db); - } - std::vector get_unmet_package_build_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db) { const fs::path ports_dir_control_file_path = paths.port_dir(spec) / "CONTROL"; -- cgit v1.2.3 From 21f69a44bead8c4ffe6719131172512519afe3aa Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 17:06:46 -0800 Subject: [Dependencies] Function rename --- toolsrc/include/vcpkg_Dependencies.h | 2 +- toolsrc/src/commands_installation.cpp | 2 +- toolsrc/src/vcpkg_Dependencies.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index d8709e0bb..556ac8750 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -9,7 +9,7 @@ namespace vcpkg {namespace Dependencies { std::vector create_dependency_ordered_install_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); - std::unordered_set find_unmet_dependencies(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); + std::unordered_set get_unmet_dependencies(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); std::vector get_unmet_package_build_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db); }} diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_installation.cpp index d8ac974b3..917b4a219 100644 --- a/toolsrc/src/commands_installation.cpp +++ b/toolsrc/src/commands_installation.cpp @@ -148,7 +148,7 @@ namespace vcpkg first_level_deps_specs.push_back(package_spec::from_name_and_triplet(dep, spec.target_triplet()).get_or_throw()); } - std::unordered_set unmet_dependencies = Dependencies::find_unmet_dependencies(paths, first_level_deps_specs, status_db); + std::unordered_set unmet_dependencies = Dependencies::get_unmet_dependencies(paths, first_level_deps_specs, status_db); if (!unmet_dependencies.empty()) { System::println(System::color::error, "The build command requires all dependencies to be already installed."); diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp index 953bd9925..d3b9dbb7b 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg_Dependencies.cpp @@ -81,7 +81,7 @@ namespace vcpkg { namespace Dependencies return build_dependency_graph(paths, specs, status_db).find_topological_sort(); } - std::unordered_set find_unmet_dependencies(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db) + std::unordered_set get_unmet_dependencies(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db) { const Graphs::Graph dependency_graph = build_dependency_graph(paths, specs, status_db); return Maps::extract_key_set(dependency_graph.adjacency_list()); -- cgit v1.2.3 From 7a1bc07142577cce32ee88c8d8ef60b386d19b6a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 17:09:07 -0800 Subject: [Dependencies] Remove unused parameter --- toolsrc/include/vcpkg_Dependencies.h | 2 +- toolsrc/src/commands_installation.cpp | 2 +- toolsrc/src/vcpkg_Dependencies.cpp | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 556ac8750..8e6808ee3 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -11,5 +11,5 @@ namespace vcpkg {namespace Dependencies std::unordered_set get_unmet_dependencies(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); - std::vector get_unmet_package_build_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db); + std::vector get_unmet_package_build_dependencies(const vcpkg_paths& paths, const package_spec& spec); }} diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_installation.cpp index 917b4a219..3f40ba023 100644 --- a/toolsrc/src/commands_installation.cpp +++ b/toolsrc/src/commands_installation.cpp @@ -141,7 +141,7 @@ namespace vcpkg Input::check_triplet(spec.target_triplet(), paths); // Explicitly load and use the portfile's build dependencies when resolving the build command (instead of a cached package's dependencies). - auto first_level_deps = Dependencies::get_unmet_package_build_dependencies(paths, spec, status_db); + auto first_level_deps = Dependencies::get_unmet_package_build_dependencies(paths, spec); std::vector first_level_deps_specs; for (auto&& dep : first_level_deps) { diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp index d3b9dbb7b..10c3ce56f 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg_Dependencies.cpp @@ -13,7 +13,7 @@ namespace vcpkg { namespace Dependencies { // TODO: Refactoring between this function and install_package - static std::vector get_single_level_unmet_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db) + static std::vector get_single_level_unmet_dependencies(const vcpkg_paths& paths, const package_spec& spec) { const fs::path packages_dir_control_file_path = paths.package_dir(spec) / "CONTROL"; @@ -32,7 +32,7 @@ namespace vcpkg { namespace Dependencies return BinaryParagraph(pghs[0]).depends; } - return get_unmet_package_build_dependencies(paths, spec, status_db); + return get_unmet_package_build_dependencies(paths, spec); } static Graphs::Graph build_dependency_graph(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db) @@ -52,7 +52,7 @@ namespace vcpkg { namespace Dependencies continue; } - std::vector dependencies_as_string = get_single_level_unmet_dependencies(paths, spec, status_db); + std::vector dependencies_as_string = get_single_level_unmet_dependencies(paths, spec); for (const std::string& dep_as_string : dependencies_as_string) { @@ -87,7 +87,7 @@ namespace vcpkg { namespace Dependencies return Maps::extract_key_set(dependency_graph.adjacency_list()); } - std::vector get_unmet_package_build_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db) + std::vector get_unmet_package_build_dependencies(const vcpkg_paths& paths, const package_spec& spec) { const fs::path ports_dir_control_file_path = paths.port_dir(spec) / "CONTROL"; auto control_contents_maybe = Files::get_contents(ports_dir_control_file_path); -- cgit v1.2.3 From c91d8e41b60653b652b11c641f7a5b3d3eab7f6b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 17:31:41 -0800 Subject: Introduce vcpkg_info.h/cpp --- toolsrc/include/vcpkg.h | 2 -- toolsrc/include/vcpkg_info.h | 10 +++++++++ toolsrc/src/commands_help.cpp | 6 +++--- toolsrc/src/commands_installation.cpp | 3 ++- toolsrc/src/commands_update.cpp | 3 ++- toolsrc/src/main.cpp | 7 ++++--- toolsrc/src/vcpkg_info.cpp | 34 +++++++++++++++++++++++++++++++ toolsrc/src/vcpkg_version.cpp | 25 ----------------------- toolsrc/vcpkglib/vcpkglib.vcxproj | 3 ++- toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 9 +++++--- 10 files changed, 63 insertions(+), 39 deletions(-) create mode 100644 toolsrc/include/vcpkg_info.h create mode 100644 toolsrc/src/vcpkg_info.cpp delete mode 100644 toolsrc/src/vcpkg_version.cpp diff --git a/toolsrc/include/vcpkg.h b/toolsrc/include/vcpkg.h index b9d646e70..30d8adbf8 100644 --- a/toolsrc/include/vcpkg.h +++ b/toolsrc/include/vcpkg.h @@ -21,6 +21,4 @@ namespace vcpkg void deinstall_package(const vcpkg_paths& paths, const package_spec& spec, StatusParagraphs& status_db); void search_file(const vcpkg_paths& paths, const std::string& file_substr, const StatusParagraphs& status_db); - - const std::string& version(); } // namespace vcpkg diff --git a/toolsrc/include/vcpkg_info.h b/toolsrc/include/vcpkg_info.h new file mode 100644 index 000000000..01da06307 --- /dev/null +++ b/toolsrc/include/vcpkg_info.h @@ -0,0 +1,10 @@ +#pragma once + +#include + +namespace vcpkg { namespace Info +{ + const std::string& version(); + + const std::string& email(); +}} diff --git a/toolsrc/src/commands_help.cpp b/toolsrc/src/commands_help.cpp index 194e809b1..fd02d948e 100644 --- a/toolsrc/src/commands_help.cpp +++ b/toolsrc/src/commands_help.cpp @@ -1,6 +1,6 @@ #include "vcpkg_Commands.h" -#include "vcpkg.h" #include "vcpkg_System.h" +#include "vcpkg_info.h" namespace vcpkg { @@ -9,7 +9,7 @@ namespace vcpkg args.check_exact_arg_count(0); System::println("Vcpkg package management program version %s\n" "\n" - "See LICENSE.txt for license information.", vcpkg::version() + "See LICENSE.txt for license information.", Info::version() ); exit(EXIT_SUCCESS); } @@ -39,7 +39,7 @@ namespace vcpkg void contact_command(const vcpkg_cmd_arguments& args) { args.check_exact_arg_count(0); - System::println("Send an email to vcpkg@microsoft.com with any feedback."); + System::println("Send an email to %s with any feedback.", Info::email()); exit(EXIT_SUCCESS); } diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_installation.cpp index 3f40ba023..460fa1818 100644 --- a/toolsrc/src/commands_installation.cpp +++ b/toolsrc/src/commands_installation.cpp @@ -10,6 +10,7 @@ #include "vcpkg_Input.h" #include "vcpkg_Maps.h" #include "Paragraphs.h" +#include "vcpkg_info.h" namespace vcpkg { @@ -50,7 +51,7 @@ namespace vcpkg " Vcpkg version: %s\n" "\n" "Additionally, attach any relevant sections from the log files above." - , to_string(spec), version()); + , to_string(spec), Info::version()); TrackProperty("error", "build failed"); TrackProperty("build_error", to_string(spec)); exit(EXIT_FAILURE); diff --git a/toolsrc/src/commands_update.cpp b/toolsrc/src/commands_update.cpp index b448091f7..2d7444392 100644 --- a/toolsrc/src/commands_update.cpp +++ b/toolsrc/src/commands_update.cpp @@ -3,6 +3,7 @@ #include "vcpkg_System.h" #include "vcpkg_Files.h" #include "Paragraphs.h" +#include "vcpkg_info.h" namespace vcpkg { @@ -77,7 +78,7 @@ namespace vcpkg auto num1 = sscanf_s(version_contents->c_str(), "\"%d.%d.%d\"", &maj1, &min1, &rev1); int maj2, min2, rev2; - auto num2 = sscanf_s(version().c_str(), "%d.%d.%d-", &maj2, &min2, &rev2); + auto num2 = sscanf_s(Info::version().c_str(), "%d.%d.%d-", &maj2, &min2, &rev2); if (num1 == 3 && num2 == 3) { diff --git a/toolsrc/src/main.cpp b/toolsrc/src/main.cpp index 22c45e5ab..70527ca1d 100644 --- a/toolsrc/src/main.cpp +++ b/toolsrc/src/main.cpp @@ -13,6 +13,7 @@ #include "vcpkg_System.h" #include "vcpkg_Input.h" #include "Paragraphs.h" +#include "vcpkg_info.h" using namespace vcpkg; @@ -192,7 +193,7 @@ int wmain(const int argc, const wchar_t* const* const argv) Flush(); }); - TrackProperty("version", version()); + TrackProperty("version", Info::version()); const std::string trimmed_command_line = trim_path_from_command_line(Strings::utf16_to_utf8(GetCommandLineW())); TrackProperty("cmdline", trimmed_command_line); @@ -234,10 +235,10 @@ int wmain(const int argc, const wchar_t* const* const argv) std::cerr << "vcpkg.exe has crashed.\n" << "Please send an email to:\n" - << " vcpkg@microsoft.com\n" + << " " << Info::email() << "\n" << "containing a brief summary of what you were trying to do and the following data blob:\n" << "\n" - << "Version=" << version() << "\n" + << "Version=" << Info::version() << "\n" << "EXCEPTION='" << exc_msg << "'\n" << "CMD=\n"; for (int x = 0; x < argc; ++x) diff --git a/toolsrc/src/vcpkg_info.cpp b/toolsrc/src/vcpkg_info.cpp new file mode 100644 index 000000000..25c09d6da --- /dev/null +++ b/toolsrc/src/vcpkg_info.cpp @@ -0,0 +1,34 @@ +#include "vcpkg_info.h" +#include "metrics.h" + +#define STRINGIFY(X) #X +#define MACRO_TO_STRING(X) STRINGIFY(X) + +#define VCPKG_VERSION_AS_STRING MACRO_TO_STRING(VCPKG_VERSION)"" // Double quotes needed at the end to prevent blank token + +namespace vcpkg { namespace Info +{ + const std::string& version() + { + static const std::string s_version = +#include "../VERSION.txt" + + +#pragma warning( push ) +#pragma warning( disable : 4003) + // VCPKG_VERSION can be defined but have no value, which yields C4003. + + std::string(VCPKG_VERSION_AS_STRING) +#pragma warning( pop ) +#ifndef NDEBUG + + std::string("-debug") +#endif + + std::string(GetCompiledMetricsEnabled() ? "" : "-external"); + return s_version; + } + + const std::string& email() + { + static const std::string s_email = R"(vcpkg@microsoft.com)"; + return s_email; + } +}} diff --git a/toolsrc/src/vcpkg_version.cpp b/toolsrc/src/vcpkg_version.cpp deleted file mode 100644 index da52b7cab..000000000 --- a/toolsrc/src/vcpkg_version.cpp +++ /dev/null @@ -1,25 +0,0 @@ -#include "vcpkg.h" -#include "metrics.h" - -#define STRINGIFY(X) #X -#define MACRO_TO_STRING(X) STRINGIFY(X) - -#define VCPKG_VERSION_AS_STRING MACRO_TO_STRING(VCPKG_VERSION)"" // Double quotes needed at the end to prevent blank token - -const std::string& vcpkg::version() -{ - static const std::string s_version = -#include "../VERSION.txt" - - -#pragma warning( push ) -#pragma warning( disable : 4003) - // VCPKG_VERSION can be defined but have no value, which yields C4003. - + std::string(VCPKG_VERSION_AS_STRING) -#pragma warning( pop ) -#ifndef NDEBUG - + std::string("-debug") -#endif - + std::string(GetCompiledMetricsEnabled() ? "" : "-external"); - return s_version; -} diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index de8e3c8ca..766cdf6a8 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -133,6 +133,7 @@ + @@ -146,7 +147,7 @@ - + diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index 24a417c0d..705a65a33 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -15,9 +15,6 @@ - - Source Files - Source Files @@ -51,6 +48,9 @@ Source Files + + Source Files + @@ -86,5 +86,8 @@ Header Files + + Header Files + \ No newline at end of file -- cgit v1.2.3 From 8adaaea6fc7f2aa99f1ec8d894ad7036805bf76a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 17:32:27 -0800 Subject: [cache] Don't #include "vcpkg.h" --- toolsrc/src/commands_cache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/commands_cache.cpp b/toolsrc/src/commands_cache.cpp index 634a72a64..19c762caf 100644 --- a/toolsrc/src/commands_cache.cpp +++ b/toolsrc/src/commands_cache.cpp @@ -1,8 +1,8 @@ #include "vcpkg_Commands.h" #include "vcpkg_System.h" #include "vcpkg_Files.h" -#include "vcpkg.h" #include "Paragraphs.h" +#include "BinaryParagraph.h" namespace vcpkg { -- cgit v1.2.3 From 6071014cf94478ade2f2d4cd95d26d00e4cac19d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 17:33:23 -0800 Subject: Remove unused #includes --- toolsrc/src/commands_integration.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/toolsrc/src/commands_integration.cpp b/toolsrc/src/commands_integration.cpp index 6a11d6ec4..cd303c649 100644 --- a/toolsrc/src/commands_integration.cpp +++ b/toolsrc/src/commands_integration.cpp @@ -2,9 +2,7 @@ #include #include #include "vcpkg_Commands.h" -#include "vcpkg.h" #include -#include #include #include #include "vcpkg_Environment.h" -- cgit v1.2.3 From e7c6f90adc58382d200159ada063204d462937d0 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 17:34:22 -0800 Subject: Remove unused #include --- toolsrc/src/commands_other.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/toolsrc/src/commands_other.cpp b/toolsrc/src/commands_other.cpp index 894beae27..5f4128bb1 100644 --- a/toolsrc/src/commands_other.cpp +++ b/toolsrc/src/commands_other.cpp @@ -1,6 +1,5 @@ #include "vcpkg_Commands.h" #include "vcpkg_System.h" -#include "vcpkg.h" namespace vcpkg { -- cgit v1.2.3 From d78c1a974f1eabe8caf5df36bbd5b55b2dcd701d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 17:37:08 -0800 Subject: Move shorten_description to vcpkglib_helpers --- toolsrc/include/vcpkg.h | 2 -- toolsrc/include/vcpkglib_helpers.h | 2 ++ toolsrc/src/commands_list.cpp | 3 ++- toolsrc/src/commands_search.cpp | 3 ++- toolsrc/src/vcpkg.cpp | 8 -------- toolsrc/src/vcpkglib_helpers.cpp | 8 ++++++++ 6 files changed, 14 insertions(+), 12 deletions(-) diff --git a/toolsrc/include/vcpkg.h b/toolsrc/include/vcpkg.h index 30d8adbf8..3a8160c71 100644 --- a/toolsrc/include/vcpkg.h +++ b/toolsrc/include/vcpkg.h @@ -13,8 +13,6 @@ namespace vcpkg extern bool g_do_dry_run; - std::string shorten_description(const std::string& desc); - StatusParagraphs database_load_check(const vcpkg_paths& paths); void install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs& status_db); diff --git a/toolsrc/include/vcpkglib_helpers.h b/toolsrc/include/vcpkglib_helpers.h index 640fab555..019bb8c39 100644 --- a/toolsrc/include/vcpkglib_helpers.h +++ b/toolsrc/include/vcpkglib_helpers.h @@ -9,4 +9,6 @@ namespace vcpkg {namespace details std::string required_field(const std::unordered_map& fields, const std::string& fieldname); std::string remove_required_field(std::unordered_map* fields, const std::string& fieldname); + + std::string shorten_description(const std::string& desc); }} diff --git a/toolsrc/src/commands_list.cpp b/toolsrc/src/commands_list.cpp index 87aad1991..2d6b42008 100644 --- a/toolsrc/src/commands_list.cpp +++ b/toolsrc/src/commands_list.cpp @@ -1,6 +1,7 @@ #include "vcpkg_Commands.h" #include "vcpkg.h" #include "vcpkg_System.h" +#include "vcpkglib_helpers.h" namespace vcpkg { @@ -9,7 +10,7 @@ namespace vcpkg System::println("%-27s %-16s %s", pgh.package.displayname(), pgh.package.version, - shorten_description(pgh.package.description)); + details::shorten_description(pgh.package.description)); } void list_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) diff --git a/toolsrc/src/commands_search.cpp b/toolsrc/src/commands_search.cpp index 399709cf3..38c257f87 100644 --- a/toolsrc/src/commands_search.cpp +++ b/toolsrc/src/commands_search.cpp @@ -2,6 +2,7 @@ #include "vcpkg_System.h" #include "vcpkg.h" #include "Paragraphs.h" +#include "vcpkglib_helpers.h" namespace fs = std::tr2::sys; @@ -38,7 +39,7 @@ namespace vcpkg System::println("%-20s %-16s %s", source_paragraph.name, source_paragraph.version, - shorten_description(source_paragraph.description)); + details::shorten_description(source_paragraph.description)); } void search_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index bd02f5424..d9956e789 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -64,14 +64,6 @@ static StatusParagraphs load_current_database(const fs::path& vcpkg_dir_status_f return StatusParagraphs(std::move(status_pghs)); } -std::string vcpkg::shorten_description(const std::string& desc) -{ - auto simple_desc = std::regex_replace(desc.substr(0, 49), std::regex("\\n( |\\t)?"), ""); - if (desc.size() > 49) - simple_desc.append("..."); - return simple_desc; -} - StatusParagraphs vcpkg::database_load_check(const vcpkg_paths& paths) { auto updates_dir = paths.vcpkg_dir_updates; diff --git a/toolsrc/src/vcpkglib_helpers.cpp b/toolsrc/src/vcpkglib_helpers.cpp index 61dc4f4cc..d104bb19d 100644 --- a/toolsrc/src/vcpkglib_helpers.cpp +++ b/toolsrc/src/vcpkglib_helpers.cpp @@ -1,6 +1,7 @@ #include "vcpkg_Checks.h" #include "vcpkglib_helpers.h" #include +#include namespace vcpkg {namespace details { @@ -45,4 +46,11 @@ namespace vcpkg {namespace details return value; } + std::string shorten_description(const std::string& desc) + { + auto simple_desc = std::regex_replace(desc.substr(0, 49), std::regex("\\n( |\\t)?"), ""); + if (desc.size() > 49) + simple_desc.append("..."); + return simple_desc; + } }} -- cgit v1.2.3 From 97df2162fddb5e37c92ded2e8f6beebf68d534da Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 17:37:31 -0800 Subject: [search] Don't #include "vcpkg.h" --- toolsrc/src/commands_search.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/commands_search.cpp b/toolsrc/src/commands_search.cpp index 38c257f87..923368252 100644 --- a/toolsrc/src/commands_search.cpp +++ b/toolsrc/src/commands_search.cpp @@ -1,8 +1,8 @@ #include "vcpkg_Commands.h" #include "vcpkg_System.h" -#include "vcpkg.h" #include "Paragraphs.h" #include "vcpkglib_helpers.h" +#include "SourceParagraph.h" namespace fs = std::tr2::sys; -- cgit v1.2.3 From a1d9478103cfc88b1a3ea3960bdd7a75dea8d0d6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 17:38:39 -0800 Subject: Don't #include "vcpkg.h" --- toolsrc/src/main.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/toolsrc/src/main.cpp b/toolsrc/src/main.cpp index 70527ca1d..f937be7f1 100644 --- a/toolsrc/src/main.cpp +++ b/toolsrc/src/main.cpp @@ -5,7 +5,6 @@ #include #include #include -#include "vcpkg.h" #include "vcpkg_Commands.h" #include "metrics.h" #include -- cgit v1.2.3 From 7e7078285c6ebcbbedee6b3ca6ce21e3a8aaf0d6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 17:39:11 -0800 Subject: Remove unused #includes --- toolsrc/src/vcpkg_cmd_arguments.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/toolsrc/src/vcpkg_cmd_arguments.cpp b/toolsrc/src/vcpkg_cmd_arguments.cpp index a286ba9b7..d61e420ab 100644 --- a/toolsrc/src/vcpkg_cmd_arguments.cpp +++ b/toolsrc/src/vcpkg_cmd_arguments.cpp @@ -2,10 +2,8 @@ #include #include "vcpkg_cmd_arguments.h" #include "vcpkg_Commands.h" -#include "vcpkg_Graphs.h" #include #include "metrics.h" -#include "vcpkg.h" #include "vcpkg_System.h" namespace vcpkg -- cgit v1.2.3 From 42f4d9645548a5b7c31c051b88eb0f83c84d60e6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 17:39:43 -0800 Subject: [Dependencies] Don't #include "vcpkg.h" --- toolsrc/src/vcpkg_Dependencies.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp index 10c3ce56f..c054ec913 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg_Dependencies.cpp @@ -5,7 +5,6 @@ #include "package_spec.h" #include "StatusParagraphs.h" #include -#include "vcpkg.h" #include "vcpkg_Maps.h" #include "vcpkg_Files.h" #include "Paragraphs.h" -- cgit v1.2.3 From 7cbf4930414682ef252b9bc53ef0d113d427c69f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 17:40:29 -0800 Subject: [tests_paragraph] Don't #include "vcpkg.h" --- toolsrc/src/tests_paragraph.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/tests_paragraph.cpp b/toolsrc/src/tests_paragraph.cpp index 28309fd31..6d9e46fcf 100644 --- a/toolsrc/src/tests_paragraph.cpp +++ b/toolsrc/src/tests_paragraph.cpp @@ -1,6 +1,6 @@ #include "CppUnitTest.h" -#include "vcpkg.h" #include "Paragraphs.h" +#include "BinaryParagraph.h" #pragma comment(lib,"version") #pragma comment(lib,"winhttp") -- cgit v1.2.3 From 8c47be55e2c9bb8acb4dd7075b682982a928d0b1 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 17:40:58 -0800 Subject: [Environment] Dont' #include "vcpkg.h" --- toolsrc/src/vcpkg_Environment.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index d98b0f220..ed70e6881 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -2,7 +2,6 @@ #include #include "vcpkg_Environment.h" #include "vcpkg_Commands.h" -#include "vcpkg.h" #include "metrics.h" #include "vcpkg_System.h" -- cgit v1.2.3 From be25fd7331c5920eec76cdfdfaeb1a869627afb8 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 17:51:23 -0800 Subject: Remove unused #include --- toolsrc/include/BinaryParagraph.h | 1 - 1 file changed, 1 deletion(-) diff --git a/toolsrc/include/BinaryParagraph.h b/toolsrc/include/BinaryParagraph.h index dcb986423..3d9cfb9fb 100644 --- a/toolsrc/include/BinaryParagraph.h +++ b/toolsrc/include/BinaryParagraph.h @@ -2,7 +2,6 @@ #include #include "SourceParagraph.h" -#include "triplet.h" #include "package_spec.h" namespace vcpkg -- cgit v1.2.3 From d799762ea7a8e6790d06bfc64297f9896e12c3b4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 17:54:23 -0800 Subject: Move listfile_path() to vcpkg_paths.h --- toolsrc/include/vcpkg_paths.h | 2 ++ toolsrc/src/vcpkg.cpp | 13 ++++--------- toolsrc/src/vcpkg_paths.cpp | 5 +++++ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/toolsrc/include/vcpkg_paths.h b/toolsrc/include/vcpkg_paths.h index 046b6836c..8276242e9 100644 --- a/toolsrc/include/vcpkg_paths.h +++ b/toolsrc/include/vcpkg_paths.h @@ -2,6 +2,7 @@ #include #include "expected.h" #include "package_spec.h" +#include "BinaryParagraph.h" namespace vcpkg { @@ -13,6 +14,7 @@ namespace vcpkg fs::path package_dir(const package_spec& spec) const; fs::path port_dir(const package_spec& spec) const; + fs::path listfile_path(const BinaryParagraph& pgh) const; bool is_valid_triplet(const triplet& t) const; fs::path root; diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index d9956e789..729a0c8d5 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -123,11 +123,6 @@ StatusParagraphs vcpkg::database_load_check(const vcpkg_paths& paths) return current_status_db; } -static fs::path listfile_path(const vcpkg_paths& paths, const BinaryParagraph& pgh) -{ - return paths.vcpkg_dir_info / (pgh.fullstem() + ".list"); -} - static std::string get_fullpkgname_from_listfile(const fs::path& path) { auto ret = path.stem().generic_u8string(); @@ -149,7 +144,7 @@ static void write_update(const vcpkg_paths& paths, const StatusParagraph& p) static void install_and_write_listfile(const vcpkg_paths& paths, const BinaryParagraph& bpgh) { - std::fstream listfile(listfile_path(paths, bpgh), std::ios_base::out | std::ios_base::binary | std::ios_base::trunc); + std::fstream listfile(paths.listfile_path(bpgh), std::ios_base::out | std::ios_base::binary | std::ios_base::trunc); auto package_prefix_path = paths.package_dir(bpgh.spec); auto prefix_length = package_prefix_path.native().size(); @@ -308,7 +303,7 @@ void vcpkg::deinstall_package(const vcpkg_paths& paths, const package_spec& spec pkg.state = install_state_t::half_installed; write_update(paths, pkg); - std::fstream listfile(listfile_path(paths, pkg.package), std::ios_base::in | std::ios_base::binary); + std::fstream listfile(paths.listfile_path(pkg.package), std::ios_base::in | std::ios_base::binary); if (listfile) { std::vector dirs_touched; @@ -367,7 +362,7 @@ void vcpkg::deinstall_package(const vcpkg_paths& paths, const package_spec& spec } listfile.close(); - fs::remove(listfile_path(paths, pkg.package)); + fs::remove(paths.listfile_path(pkg.package)); } pkg.state = install_state_t::not_installed; @@ -384,7 +379,7 @@ void vcpkg::search_file(const vcpkg_paths& paths, const std::string& file_substr if (pgh->state != install_state_t::installed) continue; - std::fstream listfile(listfile_path(paths, pgh->package)); + std::fstream listfile(paths.listfile_path(pgh->package)); while (std::getline(listfile, line)) { if (line.empty()) diff --git a/toolsrc/src/vcpkg_paths.cpp b/toolsrc/src/vcpkg_paths.cpp index 1f9eb0bc5..28ab22ec3 100644 --- a/toolsrc/src/vcpkg_paths.cpp +++ b/toolsrc/src/vcpkg_paths.cpp @@ -55,6 +55,11 @@ namespace vcpkg return this->ports / spec.name(); } + fs::path vcpkg_paths::listfile_path(const BinaryParagraph& pgh) const + { + return this->vcpkg_dir_info / (pgh.fullstem() + ".list"); + } + bool vcpkg_paths::is_valid_triplet(const triplet& t) const { auto it = fs::directory_iterator(this->triplets); -- cgit v1.2.3 From 1a1507a6039ce44220447d2b1ab723d631515b07 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 17:56:40 -0800 Subject: Move search_file() to commands_own.cpp --- toolsrc/include/vcpkg.h | 2 -- toolsrc/src/commands_owns.cpp | 26 ++++++++++++++++++++++++++ toolsrc/src/vcpkg.cpp | 25 ------------------------- 3 files changed, 26 insertions(+), 27 deletions(-) diff --git a/toolsrc/include/vcpkg.h b/toolsrc/include/vcpkg.h index 3a8160c71..0797f7f74 100644 --- a/toolsrc/include/vcpkg.h +++ b/toolsrc/include/vcpkg.h @@ -17,6 +17,4 @@ namespace vcpkg void install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs& status_db); void deinstall_package(const vcpkg_paths& paths, const package_spec& spec, StatusParagraphs& status_db); - - void search_file(const vcpkg_paths& paths, const std::string& file_substr, const StatusParagraphs& status_db); } // namespace vcpkg diff --git a/toolsrc/src/commands_owns.cpp b/toolsrc/src/commands_owns.cpp index b3dab2e44..e5599ce01 100644 --- a/toolsrc/src/commands_owns.cpp +++ b/toolsrc/src/commands_owns.cpp @@ -1,9 +1,35 @@ #include "vcpkg_Commands.h" #include "vcpkg_System.h" #include "vcpkg.h" +#include namespace vcpkg { + static void search_file(const vcpkg_paths& paths, const std::string& file_substr, const StatusParagraphs& status_db) + { + std::string line; + + for (auto&& pgh : status_db) + { + if (pgh->state != install_state_t::installed) + continue; + + std::fstream listfile(paths.listfile_path(pgh->package)); + while (std::getline(listfile, line)) + { + if (line.empty()) + { + continue; + } + + if (line.find(file_substr) != std::string::npos) + { + System::println("%s: %s", pgh->package.displayname(), line); + } + } + } + } + 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")); diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index 729a0c8d5..00aea1e2e 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -369,28 +369,3 @@ void vcpkg::deinstall_package(const vcpkg_paths& paths, const package_spec& spec write_update(paths, pkg); System::println(System::color::success, "Package %s was successfully removed", pkg.package.displayname()); } - -void vcpkg::search_file(const vcpkg_paths& paths, const std::string& file_substr, const StatusParagraphs& status_db) -{ - std::string line; - - for (auto&& pgh : status_db) - { - if (pgh->state != install_state_t::installed) - continue; - - std::fstream listfile(paths.listfile_path(pgh->package)); - while (std::getline(listfile, line)) - { - if (line.empty()) - { - continue; - } - - if (line.find(file_substr) != std::string::npos) - { - System::println("%s: %s", pgh->package.displayname(), line); - } - } - } -} -- cgit v1.2.3 From eaebe2888ab97de74200904807ae884419ccc195 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 17:57:03 -0800 Subject: Remove unused #include directive --- toolsrc/include/vcpkg.h | 1 - 1 file changed, 1 deletion(-) diff --git a/toolsrc/include/vcpkg.h b/toolsrc/include/vcpkg.h index 0797f7f74..1d7f87d32 100644 --- a/toolsrc/include/vcpkg.h +++ b/toolsrc/include/vcpkg.h @@ -1,7 +1,6 @@ #pragma once #include -#include #include "package_spec.h" #include "BinaryParagraph.h" #include "StatusParagraphs.h" -- cgit v1.2.3 From 5e058c21928de5092242cb6e0c590c3a2d758c6c Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 7 Nov 2016 21:35:08 -0800 Subject: [qt5] Don't copy PDBs for tools. Skip plugins directory (it's empty?). --- ports/qt5/portfile.cmake | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake index d1181911b..f65bee4ba 100644 --- a/ports/qt5/portfile.cmake +++ b/ports/qt5/portfile.cmake @@ -115,31 +115,7 @@ file(REMOVE ${DEBUG_LIB_FILES}) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Gamepad.lib ${CURRENT_PACKAGES_DIR}/lib/Qt5Gamepad.lib) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Gamepad.prl ${CURRENT_PACKAGES_DIR}/lib/Qt5Gamepad.prl) file(GLOB BINARY_TOOLS "${CURRENT_PACKAGES_DIR}/bin/*.exe") -file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/plugins") -file(GLOB_RECURSE DEBUG_PLUGINS - "${CURRENT_PACKAGES_DIR}/plugins/*d.dll" - "${CURRENT_PACKAGES_DIR}/plugins/*d.pdb") -foreach(file ${DEBUG_PLUGINS}) - get_filename_component(file_n ${file} NAME) - file(RELATIVE_PATH file_rel "${CURRENT_PACKAGES_DIR}/plugins" ${file}) - get_filename_component(rel_dir ${file_rel} DIRECTORY) - file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/plugins/${rel_dir}") - file(RENAME ${file} "${CURRENT_PACKAGES_DIR}/debug/plugins/${rel_dir}/${file_n}") -endforeach() -foreach(BINARY ${BINARY_TOOLS}) - execute_process(COMMAND dumpbin /PDBPATH ${BINARY} - COMMAND findstr PDB - OUTPUT_VARIABLE PDB_LINE - ERROR_QUIET - RESULT_VARIABLE error_code - ) - if(NOT error_code AND PDB_LINE MATCHES "PDB file found at") - string(REGEX MATCH '.*' PDB_PATH ${PDB_LINE}) # Extract the path which is in single quotes - string(REPLACE ' "" PDB_PATH ${PDB_PATH}) # Remove single quotes - file(INSTALL ${PDB_PATH} DESTINATION ${CURRENT_PACKAGES_DIR}/tools) - file(REMOVE ${PDB_PATH}) - endif() -endforeach() + file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools) file(REMOVE ${BINARY_TOOLS}) -- cgit v1.2.3 From 68fe8b5391b5b59ccfc99244dc5c5032b4f823f2 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 7 Nov 2016 21:54:23 -0800 Subject: [openssl] Merge openssl-microsoft and openssl --- ports/openssl-microsoft/CONTROL | 3 - ports/openssl-microsoft/make-openssl.bat | 10 -- ports/openssl-microsoft/portfile.cmake | 111 ------------------- ports/openssl-microsoft/setVSvars.bat | 185 ------------------------------- ports/openssl/make-openssl.bat | 10 ++ ports/openssl/portfile-uwp.cmake | 113 +++++++++++++++++++ ports/openssl/portfile.cmake | 6 + ports/openssl/setVSvars.bat | 185 +++++++++++++++++++++++++++++++ 8 files changed, 314 insertions(+), 309 deletions(-) delete mode 100644 ports/openssl-microsoft/CONTROL delete mode 100644 ports/openssl-microsoft/make-openssl.bat delete mode 100644 ports/openssl-microsoft/portfile.cmake delete mode 100644 ports/openssl-microsoft/setVSvars.bat create mode 100644 ports/openssl/make-openssl.bat create mode 100644 ports/openssl/portfile-uwp.cmake create mode 100644 ports/openssl/setVSvars.bat diff --git a/ports/openssl-microsoft/CONTROL b/ports/openssl-microsoft/CONTROL deleted file mode 100644 index 8b67282ac..000000000 --- a/ports/openssl-microsoft/CONTROL +++ /dev/null @@ -1,3 +0,0 @@ -Source: openssl-microsoft -Version: 1.0.2-winrt-stable -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. This is Microsofts fork of openssl that supports Windows Phone and Store apps. diff --git a/ports/openssl-microsoft/make-openssl.bat b/ports/openssl-microsoft/make-openssl.bat deleted file mode 100644 index 4c038094d..000000000 --- a/ports/openssl-microsoft/make-openssl.bat +++ /dev/null @@ -1,10 +0,0 @@ -set build=%1 - -perl Configure no-asm no-hw no-dso VC-WINUNIVERSAL - -call ms\do_winuniversal.bat - -call ms\setVSvars.bat universal10.0%build% - -nmake -f ms\ntdll.mak - diff --git a/ports/openssl-microsoft/portfile.cmake b/ports/openssl-microsoft/portfile.cmake deleted file mode 100644 index 30d85abf7..000000000 --- a/ports/openssl-microsoft/portfile.cmake +++ /dev/null @@ -1,111 +0,0 @@ -# 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(${CMAKE_TRIPLET_FILE}) - -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Static building not supported yet") -endif() - -if (TARGET_TRIPLET MATCHES "arm-uwp") - set(UWP_PLATFORM "arm") -elseif (TARGET_TRIPLET MATCHES "x64-uwp") - set(UWP_PLATFORM "x64") -elseif (TARGET_TRIPLET MATCHES "x86-uwp") - set(UWP_PLATFORM "Win32") -else () - message(FATAL_ERROR "Only UWP DLL builds are supported at the moment") -endif() - -include(vcpkg_common_functions) - -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/openssl-OpenSSL_1_0_2_WinRT-stable) - -vcpkg_find_acquire_program(PERL) -get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) -set(ENV{PATH} "${PERL_EXE_PATH};$ENV{PATH}") - -vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/Microsoft/openssl/archive/OpenSSL_1_0_2_WinRT-stable.zip" - FILENAME "openssl-microsoft-1.0.2.zip" - SHA512 f265b7dbeca6b86815dbc14af9f2b6688407efd921eb335b1acf5a642dddb6b6334a794fe0939666d9db66976db11a67ad78a3ed74484708d3bf2040aae598d2 -) - -vcpkg_extract_source_archive(${ARCHIVE}) - -# file(REMOVE_RECURSE ${SOURCE_PATH}/tmp32dll) -# file(REMOVE_RECURSE ${SOURCE_PATH}/out32dll) -# file(REMOVE_RECURSE ${SOURCE_PATH}/inc32dll) - -file(COPY -${CMAKE_CURRENT_LIST_DIR}/setVSvars.bat -DESTINATION ${SOURCE_PATH}/ms) - -file(COPY -${CMAKE_CURRENT_LIST_DIR}/make-openssl.bat -DESTINATION ${SOURCE_PATH}) - -message(STATUS "Build ${TARGET_TRIPLET}") - -vcpkg_execute_required_process( - COMMAND ${SOURCE_PATH}/make-openssl.bat ${UWP_PLATFORM} - WORKING_DIRECTORY ${SOURCE_PATH} - LOGNAME make-openssl-${TARGET_TRIPLET} -) - - -message(STATUS "Build ${TARGET_TRIPLET} done") - - - -file( - COPY ${SOURCE_PATH}/inc32/openssl - DESTINATION ${CURRENT_PACKAGES_DIR}/include -) - -file(INSTALL ${SOURCE_PATH}/out32dll/libeay32.dll - DESTINATION ${CURRENT_PACKAGES_DIR}/bin) - -file(INSTALL ${SOURCE_PATH}/out32dll/libeay32.pdb - DESTINATION ${CURRENT_PACKAGES_DIR}/bin) - -file(INSTALL ${SOURCE_PATH}/out32dll/libeay32.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/lib) - -file(INSTALL ${SOURCE_PATH}/out32dll/ssleay32.dll - DESTINATION ${CURRENT_PACKAGES_DIR}/bin) - -file(INSTALL ${SOURCE_PATH}/out32dll/ssleay32.pdb - DESTINATION ${CURRENT_PACKAGES_DIR}/bin) - -file(INSTALL ${SOURCE_PATH}/out32dll/ssleay32.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/lib) - - - -file(INSTALL ${SOURCE_PATH}/out32dll/libeay32.dll - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) - -file(INSTALL ${SOURCE_PATH}/out32dll/libeay32.pdb - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) - -file(INSTALL ${SOURCE_PATH}/out32dll/libeay32.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) - -file(INSTALL ${SOURCE_PATH}/out32dll/ssleay32.dll - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) - -file(INSTALL ${SOURCE_PATH}/out32dll/ssleay32.pdb - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) - -file(INSTALL ${SOURCE_PATH}/out32dll/ssleay32.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) - - - -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/openssl-microsoft RENAME copyright) diff --git a/ports/openssl-microsoft/setVSvars.bat b/ports/openssl-microsoft/setVSvars.bat deleted file mode 100644 index 23259821e..000000000 --- a/ports/openssl-microsoft/setVSvars.bat +++ /dev/null @@ -1,185 +0,0 @@ -@echo off -call:set_%1 -exit /b -:set_universal10.0Win32 - call:setVar _VS14VC VisualStudio14VC - call "%_VS14VC%vcvarsall" x86 - set _VCPlatform=x86 - set _VCLibPlat= - call:setEnv - goto :eof - -:set_universal10.0x64 - call:setVar _VS14VC VisualStudio14VC - call "%_VS14VC%vcvarsall" x64 - set _VCPlatform=x64 - set _VCLibPlat=amd64 - call:setEnv - goto :eof - -:set_universal10.0arm - call:setVar _VS14VC VisualStudio14VC - call "%_VS14VC%vcvarsall" x86_arm - set _VCPlatform=ARM - set _VCLibPlat=ARM - call:setEnv - goto :eof - -:set_universal10.0arm64 - call:setVar _VS14VC VisualStudio14VC - call "%_VS14VC%vcvarsall" x86_arm64 - set _VCPlatform=ARM64 - set _VCLibPlat=ARM64 - call:setEnv - goto :eof - -:set_wp8.1arm - call:setVar _VS12VC VisualStudio12VC - call:setVar _WPKITS81 WindowsPhoneKits8.1 - call:setVar _VS14VC VisualStudio14VC - call "%_VS12VC%\vcvarsall" x86_arm - set PATH=%_VS12VC\Bin%;%PATH% - set INCLUDE=%_WPKITS81%\Include;%_WPKITS81%\Include\abi;%_WPKITS81%\Include\mincore;%_WPKITS81%\Include\minwin;%_WPKITS81%\Include\wrl;%INCLUDE% - set LIB=%_WPKITS81%\lib\ARM;%_VS12VC%\lib\store\ARM; - set LIBPATH=%LIBPATH%;%_VS12VC%\vcpackages;%WindowsSDK_ExecutablePath_x86%\..\..\Tools\MDILXAPCompile\WinMDs;%_VS14VC%\vcpackages; - goto :eof - -:set_wp8.1Win32 - call:setVar _VS12VC VisualStudio12VC - call:setVar _WPKITS81 WindowsPhoneKits8.1 - call:setVar _VS14VC VisualStudio14VC - call "%_VS12VC%\vcvarsall" x86 - set INCLUDE=%_WPKITS81%\Include;%_WPKITS81%\Include\abi;%_WPKITS81%\Include\mincore;%_WPKITS81%\Include\minwin;%_WPKITS81%\Include\wrl;%INCLUDE% - set LIB=%_WPKITS81%\lib\x86;%_VS12VC%\lib\store; - set LIBPATH=%LIBPATH%;%_VS12VC%\vcpackages;%WindowsSDK_ExecutablePath_x86%\..\..\Tools\MDILXAPCompile\WinMDs;%_VS14VC%\vcpackages; - goto :eof - -:set_wp8.0arm - call:setVar _VS11VC VisualStudio11VC - call:setVar _WPKITS80 WindowsPhoneKits8.0 - call "%_VS11VC%\WPSDK\WP80\vcvarsphoneall.bat" x86_arm - goto :eof - -:set_wp8.0Win32 - call:setVar _VS11VC VisualStudio11VC - call:setVar _WPKITS80 WindowsPhoneKits8.0 - call "%_VS11VC%\WPSDK\WP80\vcvarsphoneall.bat" x86 - goto :eof - -:set_ws8.1Win32 - call:setVar _VS12VC VisualStudio12VC - call:setVar _WSKITS81 WindowsKits8.1 - call:setVar _VS14VC VisualStudio14VC - call "%_VS12VC%\vcvarsall" x86 - set INCLUDE=%_VS12VC%\include;%_VS12VC%\atlmfc\include;%_WSKITS81%\Include\um;%_WSKITS81%\Include\shared;%_WSKITS81%\Include\winrt; - set LIB=%_VS12VC%\lib\store;%_VS12VC%\atlmfc\lib;%_WSKITS81%\lib\winv6.3\um\x86; - set LIBPATH=%_WSKITS81%\References\CommonConfiguration\Neutral;%_VS12VC%\atlmfc\lib;%_VS12VC%\lib\store;%_VS12VC%\vcpackages;%WindowsSDK_ExecutablePath_x86%\..\..\Tools\MDILXAPCompile\WinMDs;%_VS14VC%\vcpackages; - goto :eof - -:set_ws8.1x64 - call:setVar _VS12VC VisualStudio12VC - call:setVar _WSKITS81 WindowsKits8.1 - call:setVar _VS14VC VisualStudio14VC - call "%_VS12VC%\vcvarsall" x64 - set INCLUDE=%_VS12VC%\include;%_VS12VC%\atlmfc\include;%_WSKITS81%\Include\um;%_WSKITS81%\Include\shared;%_WSKITS81%\Include\winrt; - set LIB=%_VS12VC%\lib\store\amd64;%_VS12VC%\atlmfc\lib\amd64;%_WSKITS81%\lib\winv6.3\um\x64; - set LIBPATH=%_WSKITS81%\References\CommonConfiguration\Neutral;%_VS12VC%\atlmfc\lib\amd64;%_VS12VC%\lib\store;%_VS12VC%\vcpackages;%WindowsSDK_ExecutablePath_x86%\..\..\Tools\MDILXAPCompile\WinMDs;%_VS14VC%\vcpackages; - goto :eof - -:set_ws8.1arm - call:setVar _VS12VC VisualStudio12VC - call:setVar _WSKITS81 WindowsKits8.1 - call:setVar _VS14VC VisualStudio14VC - call "%_VS12VC%\vcvarsall" x86_arm - set INCLUDE=%_VS12VC%\include;%_VS12VC%\atlmfc\include;%_WSKITS81%\Include\um;%_WSKITS81%\Include\shared;%_WSKITS81%\Include\winrt; - set LIB=%_VS12VC%\lib\store\arm;%_VS12VC%\atlmfc\lib\arm;%_WSKITS81%\lib\winv6.3\um\arm; - set LIBPATH=%_WSKITS81%\References\CommonConfiguration\Neutral;%_VS12VC%\atlmfc\lib\arm;%_VS12VC%\lib\store;%_VS12VC%\vcpackages;%WindowsSDK_ExecutablePath_x86%\..\..\Tools\MDILXAPCompile\WinMDs;%_VS14VC%\vcpackages; - goto :eof - -:setVar - call:set%1 - if "!%1!"=="" echo warning: could not locate %2 - goto :eof - -:setRegVar - for /F "usebackq tokens=2*" %%A IN (`reg query %1 /v %2 2^>nul`) do ( - set %3=%%B - ) - goto :eof - -:setAppend - if exist %1%2 set %3=%1%2 - goto :eof - -:set_VS11VC - if not "%_VS11VC%"=="" goto :eof - call:setRegVar "HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0_Config\Setup\VC" ProductDir _VS11VC - if not "%_VS11VC%"=="" goto :eof - call:setRegVar "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\11.0\Setup\VC" ProductDir _VS11VC - if not "%_VS11VC%"=="" goto :eof - call:setAppend VSSDK110Install \..\VC _VS11VC - if not "%_VS11VC%"=="" goto :eof - call:setAppend VS110COMNTOOLS \..\..\VC _VS11VC - goto :eof - -:set_VS12VC - if not "%_VS12VC%"=="" goto :eof - call:setRegVar "HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0_Config\Setup\VC" ProductDir _VS12VC - if not "%_VS12VC%"=="" goto :eof - call:setRegVar "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0\Setup\VC" ProductDir _VS12VC - if not "%_VS12VC%"=="" goto :eof - call:setAppend VSSDK120Install \..\VC _VS12VC - if not "%_VS12VC%"=="" goto :eof - call:setAppend VS120COMNTOOLS \..\..\VC _VS12VC - goto :eof - -:set_VS14VC - if not "%_VS14VC%"=="" goto :eof - call:setRegVar "HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0_Config\Setup\VC" ProductDir _VS14VC - if not "%_VS14VC%"=="" goto :eof - call:setRegVar "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\Setup\VC" ProductDir _VS14VC - if not "%_VS14VC%"=="" goto :eof - call:setAppend VSSDK140Install \..\VC _VS14VC - if not "%_VS14VC%"=="" goto :eof - call:setAppend VS140COMNTOOLS \..\..\VC _VS14VC - goto :eof - -:set_WPKITS80 - if not "%_WPKITS80%"=="" goto :eof - call:setRegVar "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows Phone\v8.0" InstallationFolder _WPKITS80 - if not "%_WPKITS80%"=="" goto :eof - goto :eof - -:set_WPKITS81 - if not "%_WPKITS81%"=="" goto :eof - call:setRegVar "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows Phone\v8.1" InstallationFolder _WPKITS81 - if not "%_WPKITS81%"=="" goto :eof - goto :eof - -:set_WSKITS81 - if not "%_WSKITS81%"=="" goto :eof - call:setRegVar "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots" KitsRoot81 _WSKITS81 - if not "%_WSKITS81%"=="" goto :eof - goto :eof - -:set_WKITS10 - if not "%_WKITS10%"=="" goto :eof - call:setRegVar "HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0" InstallationFolder _WKITS10 - if not "%_WKITS10%"=="" goto :eof - goto :eof - -:set_WKITS10VER - if not "%_WKITS10VER%"=="" goto :eof - call:setRegVar "HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0" ProductVersion _WKITS10VER - echo %_WKITS10VER% - if not "%_WKITS10VER%"=="" goto :eof - goto :eof - -:setEnv - call:setVar _VS14VC VisualStudio14VC - call:setVar _WKITS10 WindowsKits10.0 - set PATH=%_VS14VCBin%;%PATH% - set "LIBPATH=%_WKITS10%UnionMetadata\Facade;%_VS14VC%vcpackages;%_WKITS10%references\windows.foundation.foundationcontract\1.0.0.0\;%_WKITS10%references\windows.foundation.universalapicontract\1.0.0.0\" - goto :eof - -:end diff --git a/ports/openssl/make-openssl.bat b/ports/openssl/make-openssl.bat new file mode 100644 index 000000000..4c038094d --- /dev/null +++ b/ports/openssl/make-openssl.bat @@ -0,0 +1,10 @@ +set build=%1 + +perl Configure no-asm no-hw no-dso VC-WINUNIVERSAL + +call ms\do_winuniversal.bat + +call ms\setVSvars.bat universal10.0%build% + +nmake -f ms\ntdll.mak + diff --git a/ports/openssl/portfile-uwp.cmake b/ports/openssl/portfile-uwp.cmake new file mode 100644 index 000000000..4e745ebba --- /dev/null +++ b/ports/openssl/portfile-uwp.cmake @@ -0,0 +1,113 @@ +# 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 static) + message(FATAL_ERROR "Static building not supported yet") +endif() + +if (NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + message(FATAL_ERROR "This portfile only supports UWP") +endif() + +if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") + set(UWP_PLATFORM "arm") +elseif (VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") + set(UWP_PLATFORM "x64") +elseif (VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") + set(UWP_PLATFORM "Win32") +else () + message(FATAL_ERROR "Unsupported architecture") +endif() + +include(vcpkg_common_functions) + +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/openssl-OpenSSL_1_0_2_WinRT-stable) + +vcpkg_find_acquire_program(PERL) +get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) +set(ENV{PATH} "${PERL_EXE_PATH};$ENV{PATH}") + +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/Microsoft/openssl/archive/OpenSSL_1_0_2_WinRT-stable.zip" + FILENAME "openssl-microsoft-1.0.2.zip" + SHA512 f265b7dbeca6b86815dbc14af9f2b6688407efd921eb335b1acf5a642dddb6b6334a794fe0939666d9db66976db11a67ad78a3ed74484708d3bf2040aae598d2 +) + +vcpkg_extract_source_archive(${ARCHIVE}) + +# file(REMOVE_RECURSE ${SOURCE_PATH}/tmp32dll) +# file(REMOVE_RECURSE ${SOURCE_PATH}/out32dll) +# file(REMOVE_RECURSE ${SOURCE_PATH}/inc32dll) + +file(COPY +${CMAKE_CURRENT_LIST_DIR}/setVSvars.bat +DESTINATION ${SOURCE_PATH}/ms) + +file(COPY +${CMAKE_CURRENT_LIST_DIR}/make-openssl.bat +DESTINATION ${SOURCE_PATH}) + +message(STATUS "Build ${TARGET_TRIPLET}") + +vcpkg_execute_required_process( + COMMAND ${SOURCE_PATH}/make-openssl.bat ${UWP_PLATFORM} + WORKING_DIRECTORY ${SOURCE_PATH} + LOGNAME make-openssl-${TARGET_TRIPLET} +) + + +message(STATUS "Build ${TARGET_TRIPLET} done") + + + +file( + COPY ${SOURCE_PATH}/inc32/openssl + DESTINATION ${CURRENT_PACKAGES_DIR}/include +) + +file(INSTALL ${SOURCE_PATH}/out32dll/libeay32.dll + DESTINATION ${CURRENT_PACKAGES_DIR}/bin) + +file(INSTALL ${SOURCE_PATH}/out32dll/libeay32.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/bin) + +file(INSTALL ${SOURCE_PATH}/out32dll/libeay32.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + +file(INSTALL ${SOURCE_PATH}/out32dll/ssleay32.dll + DESTINATION ${CURRENT_PACKAGES_DIR}/bin) + +file(INSTALL ${SOURCE_PATH}/out32dll/ssleay32.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/bin) + +file(INSTALL ${SOURCE_PATH}/out32dll/ssleay32.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + + + +file(INSTALL ${SOURCE_PATH}/out32dll/libeay32.dll + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) + +file(INSTALL ${SOURCE_PATH}/out32dll/libeay32.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) + +file(INSTALL ${SOURCE_PATH}/out32dll/libeay32.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + +file(INSTALL ${SOURCE_PATH}/out32dll/ssleay32.dll + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) + +file(INSTALL ${SOURCE_PATH}/out32dll/ssleay32.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) + +file(INSTALL ${SOURCE_PATH}/out32dll/ssleay32.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + + + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/openssl RENAME copyright) diff --git a/ports/openssl/portfile.cmake b/ports/openssl/portfile.cmake index 49d322095..c5ddb7489 100644 --- a/ports/openssl/portfile.cmake +++ b/ports/openssl/portfile.cmake @@ -1,4 +1,10 @@ include(${CMAKE_TRIPLET_FILE}) + +if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + include(${CMAKE_CURRENT_LIST_DIR}/portfile-uwp.cmake) + return() +endif() + include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/openssl-1.0.2h) vcpkg_find_acquire_program(PERL) diff --git a/ports/openssl/setVSvars.bat b/ports/openssl/setVSvars.bat new file mode 100644 index 000000000..23259821e --- /dev/null +++ b/ports/openssl/setVSvars.bat @@ -0,0 +1,185 @@ +@echo off +call:set_%1 +exit /b +:set_universal10.0Win32 + call:setVar _VS14VC VisualStudio14VC + call "%_VS14VC%vcvarsall" x86 + set _VCPlatform=x86 + set _VCLibPlat= + call:setEnv + goto :eof + +:set_universal10.0x64 + call:setVar _VS14VC VisualStudio14VC + call "%_VS14VC%vcvarsall" x64 + set _VCPlatform=x64 + set _VCLibPlat=amd64 + call:setEnv + goto :eof + +:set_universal10.0arm + call:setVar _VS14VC VisualStudio14VC + call "%_VS14VC%vcvarsall" x86_arm + set _VCPlatform=ARM + set _VCLibPlat=ARM + call:setEnv + goto :eof + +:set_universal10.0arm64 + call:setVar _VS14VC VisualStudio14VC + call "%_VS14VC%vcvarsall" x86_arm64 + set _VCPlatform=ARM64 + set _VCLibPlat=ARM64 + call:setEnv + goto :eof + +:set_wp8.1arm + call:setVar _VS12VC VisualStudio12VC + call:setVar _WPKITS81 WindowsPhoneKits8.1 + call:setVar _VS14VC VisualStudio14VC + call "%_VS12VC%\vcvarsall" x86_arm + set PATH=%_VS12VC\Bin%;%PATH% + set INCLUDE=%_WPKITS81%\Include;%_WPKITS81%\Include\abi;%_WPKITS81%\Include\mincore;%_WPKITS81%\Include\minwin;%_WPKITS81%\Include\wrl;%INCLUDE% + set LIB=%_WPKITS81%\lib\ARM;%_VS12VC%\lib\store\ARM; + set LIBPATH=%LIBPATH%;%_VS12VC%\vcpackages;%WindowsSDK_ExecutablePath_x86%\..\..\Tools\MDILXAPCompile\WinMDs;%_VS14VC%\vcpackages; + goto :eof + +:set_wp8.1Win32 + call:setVar _VS12VC VisualStudio12VC + call:setVar _WPKITS81 WindowsPhoneKits8.1 + call:setVar _VS14VC VisualStudio14VC + call "%_VS12VC%\vcvarsall" x86 + set INCLUDE=%_WPKITS81%\Include;%_WPKITS81%\Include\abi;%_WPKITS81%\Include\mincore;%_WPKITS81%\Include\minwin;%_WPKITS81%\Include\wrl;%INCLUDE% + set LIB=%_WPKITS81%\lib\x86;%_VS12VC%\lib\store; + set LIBPATH=%LIBPATH%;%_VS12VC%\vcpackages;%WindowsSDK_ExecutablePath_x86%\..\..\Tools\MDILXAPCompile\WinMDs;%_VS14VC%\vcpackages; + goto :eof + +:set_wp8.0arm + call:setVar _VS11VC VisualStudio11VC + call:setVar _WPKITS80 WindowsPhoneKits8.0 + call "%_VS11VC%\WPSDK\WP80\vcvarsphoneall.bat" x86_arm + goto :eof + +:set_wp8.0Win32 + call:setVar _VS11VC VisualStudio11VC + call:setVar _WPKITS80 WindowsPhoneKits8.0 + call "%_VS11VC%\WPSDK\WP80\vcvarsphoneall.bat" x86 + goto :eof + +:set_ws8.1Win32 + call:setVar _VS12VC VisualStudio12VC + call:setVar _WSKITS81 WindowsKits8.1 + call:setVar _VS14VC VisualStudio14VC + call "%_VS12VC%\vcvarsall" x86 + set INCLUDE=%_VS12VC%\include;%_VS12VC%\atlmfc\include;%_WSKITS81%\Include\um;%_WSKITS81%\Include\shared;%_WSKITS81%\Include\winrt; + set LIB=%_VS12VC%\lib\store;%_VS12VC%\atlmfc\lib;%_WSKITS81%\lib\winv6.3\um\x86; + set LIBPATH=%_WSKITS81%\References\CommonConfiguration\Neutral;%_VS12VC%\atlmfc\lib;%_VS12VC%\lib\store;%_VS12VC%\vcpackages;%WindowsSDK_ExecutablePath_x86%\..\..\Tools\MDILXAPCompile\WinMDs;%_VS14VC%\vcpackages; + goto :eof + +:set_ws8.1x64 + call:setVar _VS12VC VisualStudio12VC + call:setVar _WSKITS81 WindowsKits8.1 + call:setVar _VS14VC VisualStudio14VC + call "%_VS12VC%\vcvarsall" x64 + set INCLUDE=%_VS12VC%\include;%_VS12VC%\atlmfc\include;%_WSKITS81%\Include\um;%_WSKITS81%\Include\shared;%_WSKITS81%\Include\winrt; + set LIB=%_VS12VC%\lib\store\amd64;%_VS12VC%\atlmfc\lib\amd64;%_WSKITS81%\lib\winv6.3\um\x64; + set LIBPATH=%_WSKITS81%\References\CommonConfiguration\Neutral;%_VS12VC%\atlmfc\lib\amd64;%_VS12VC%\lib\store;%_VS12VC%\vcpackages;%WindowsSDK_ExecutablePath_x86%\..\..\Tools\MDILXAPCompile\WinMDs;%_VS14VC%\vcpackages; + goto :eof + +:set_ws8.1arm + call:setVar _VS12VC VisualStudio12VC + call:setVar _WSKITS81 WindowsKits8.1 + call:setVar _VS14VC VisualStudio14VC + call "%_VS12VC%\vcvarsall" x86_arm + set INCLUDE=%_VS12VC%\include;%_VS12VC%\atlmfc\include;%_WSKITS81%\Include\um;%_WSKITS81%\Include\shared;%_WSKITS81%\Include\winrt; + set LIB=%_VS12VC%\lib\store\arm;%_VS12VC%\atlmfc\lib\arm;%_WSKITS81%\lib\winv6.3\um\arm; + set LIBPATH=%_WSKITS81%\References\CommonConfiguration\Neutral;%_VS12VC%\atlmfc\lib\arm;%_VS12VC%\lib\store;%_VS12VC%\vcpackages;%WindowsSDK_ExecutablePath_x86%\..\..\Tools\MDILXAPCompile\WinMDs;%_VS14VC%\vcpackages; + goto :eof + +:setVar + call:set%1 + if "!%1!"=="" echo warning: could not locate %2 + goto :eof + +:setRegVar + for /F "usebackq tokens=2*" %%A IN (`reg query %1 /v %2 2^>nul`) do ( + set %3=%%B + ) + goto :eof + +:setAppend + if exist %1%2 set %3=%1%2 + goto :eof + +:set_VS11VC + if not "%_VS11VC%"=="" goto :eof + call:setRegVar "HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0_Config\Setup\VC" ProductDir _VS11VC + if not "%_VS11VC%"=="" goto :eof + call:setRegVar "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\11.0\Setup\VC" ProductDir _VS11VC + if not "%_VS11VC%"=="" goto :eof + call:setAppend VSSDK110Install \..\VC _VS11VC + if not "%_VS11VC%"=="" goto :eof + call:setAppend VS110COMNTOOLS \..\..\VC _VS11VC + goto :eof + +:set_VS12VC + if not "%_VS12VC%"=="" goto :eof + call:setRegVar "HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0_Config\Setup\VC" ProductDir _VS12VC + if not "%_VS12VC%"=="" goto :eof + call:setRegVar "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0\Setup\VC" ProductDir _VS12VC + if not "%_VS12VC%"=="" goto :eof + call:setAppend VSSDK120Install \..\VC _VS12VC + if not "%_VS12VC%"=="" goto :eof + call:setAppend VS120COMNTOOLS \..\..\VC _VS12VC + goto :eof + +:set_VS14VC + if not "%_VS14VC%"=="" goto :eof + call:setRegVar "HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0_Config\Setup\VC" ProductDir _VS14VC + if not "%_VS14VC%"=="" goto :eof + call:setRegVar "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\Setup\VC" ProductDir _VS14VC + if not "%_VS14VC%"=="" goto :eof + call:setAppend VSSDK140Install \..\VC _VS14VC + if not "%_VS14VC%"=="" goto :eof + call:setAppend VS140COMNTOOLS \..\..\VC _VS14VC + goto :eof + +:set_WPKITS80 + if not "%_WPKITS80%"=="" goto :eof + call:setRegVar "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows Phone\v8.0" InstallationFolder _WPKITS80 + if not "%_WPKITS80%"=="" goto :eof + goto :eof + +:set_WPKITS81 + if not "%_WPKITS81%"=="" goto :eof + call:setRegVar "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows Phone\v8.1" InstallationFolder _WPKITS81 + if not "%_WPKITS81%"=="" goto :eof + goto :eof + +:set_WSKITS81 + if not "%_WSKITS81%"=="" goto :eof + call:setRegVar "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots" KitsRoot81 _WSKITS81 + if not "%_WSKITS81%"=="" goto :eof + goto :eof + +:set_WKITS10 + if not "%_WKITS10%"=="" goto :eof + call:setRegVar "HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0" InstallationFolder _WKITS10 + if not "%_WKITS10%"=="" goto :eof + goto :eof + +:set_WKITS10VER + if not "%_WKITS10VER%"=="" goto :eof + call:setRegVar "HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0" ProductVersion _WKITS10VER + echo %_WKITS10VER% + if not "%_WKITS10VER%"=="" goto :eof + goto :eof + +:setEnv + call:setVar _VS14VC VisualStudio14VC + call:setVar _WKITS10 WindowsKits10.0 + set PATH=%_VS14VCBin%;%PATH% + set "LIBPATH=%_WKITS10%UnionMetadata\Facade;%_VS14VC%vcpackages;%_WKITS10%references\windows.foundation.foundationcontract\1.0.0.0\;%_WKITS10%references\windows.foundation.universalapicontract\1.0.0.0\" + goto :eof + +:end -- cgit v1.2.3 From 15f3aa7ce624894ee4a4e3b2efa6f96a9014d41d Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Tue, 8 Nov 2016 22:16:13 +1100 Subject: plugin fixes --- ports/qt5/portfile.cmake | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake index f65bee4ba..6b11a8abe 100644 --- a/ports/qt5/portfile.cmake +++ b/ports/qt5/portfile.cmake @@ -50,6 +50,7 @@ vcpkg_execute_required_process( -hostbindir ${CURRENT_PACKAGES_DIR}/tools -archdatadir ${CURRENT_PACKAGES_DIR}/share/qt5 -datadir ${CURRENT_PACKAGES_DIR}/share/qt5 + -plugindir ${CURRENT_PACKAGES_DIR}/plugins WORKING_DIRECTORY ${OUTPUT_PATH} LOGNAME configure-${TARGET_TRIPLET} ) @@ -115,9 +116,20 @@ file(REMOVE ${DEBUG_LIB_FILES}) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Gamepad.lib ${CURRENT_PACKAGES_DIR}/lib/Qt5Gamepad.lib) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Gamepad.prl ${CURRENT_PACKAGES_DIR}/lib/Qt5Gamepad.prl) file(GLOB BINARY_TOOLS "${CURRENT_PACKAGES_DIR}/bin/*.exe") - file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools) file(REMOVE ${BINARY_TOOLS}) +file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/plugins") +file(GLOB_RECURSE DEBUG_PLUGINS + "${CURRENT_PACKAGES_DIR}/plugins/*d.dll" + "${CURRENT_PACKAGES_DIR}/plugins/*d.pdb" +) +foreach(file ${DEBUG_PLUGINS}) + get_filename_component(file_n ${file} NAME) + file(RELATIVE_PATH file_rel "${CURRENT_PACKAGES_DIR}/plugins" ${file}) + get_filename_component(rel_dir ${file_rel} DIRECTORY) + file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/plugins/${rel_dir}") + file(RENAME ${file} "${CURRENT_PACKAGES_DIR}/debug/plugins/${rel_dir}/${file_n}") +endforeach() if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL dynamic) file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/bin/*.dll") -- cgit v1.2.3 From 292803804303fc22a653522f3db42875602dbdd9 Mon Sep 17 00:00:00 2001 From: Patrick Dehne Date: Tue, 8 Nov 2016 14:40:16 +0100 Subject: Cleanup leftover build artifacts before compile --- ports/openssl/portfile-uwp.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/openssl/portfile-uwp.cmake b/ports/openssl/portfile-uwp.cmake index 4e745ebba..34861c122 100644 --- a/ports/openssl/portfile-uwp.cmake +++ b/ports/openssl/portfile-uwp.cmake @@ -40,9 +40,9 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive(${ARCHIVE}) -# file(REMOVE_RECURSE ${SOURCE_PATH}/tmp32dll) -# file(REMOVE_RECURSE ${SOURCE_PATH}/out32dll) -# file(REMOVE_RECURSE ${SOURCE_PATH}/inc32dll) +file(REMOVE_RECURSE ${SOURCE_PATH}/tmp32dll) +file(REMOVE_RECURSE ${SOURCE_PATH}/out32dll) +file(REMOVE_RECURSE ${SOURCE_PATH}/inc32dll) file(COPY ${CMAKE_CURRENT_LIST_DIR}/setVSvars.bat -- cgit v1.2.3 From e9ddf167b19fb63dd4defaddcfe4cae2f6c223ca Mon Sep 17 00:00:00 2001 From: Eric Mittelette Date: Tue, 8 Nov 2016 13:32:17 -0800 Subject: decimal-for-cpp --- ports/decimal-for-cpp/CONTROL | 4 ++++ ports/decimal-for-cpp/portfile.cmake | 29 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 ports/decimal-for-cpp/CONTROL create mode 100644 ports/decimal-for-cpp/portfile.cmake diff --git a/ports/decimal-for-cpp/CONTROL b/ports/decimal-for-cpp/CONTROL new file mode 100644 index 000000000..40699840c --- /dev/null +++ b/ports/decimal-for-cpp/CONTROL @@ -0,0 +1,4 @@ +Source: decimalforcpp +Version:1.12 +Description: Decimal data type support, for COBOL-like fixed-point operations on currency values. + diff --git a/ports/decimal-for-cpp/portfile.cmake b/ports/decimal-for-cpp/portfile.cmake new file mode 100644 index 000000000..68ce555f8 --- /dev/null +++ b/ports/decimal-for-cpp/portfile.cmake @@ -0,0 +1,29 @@ +# 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} +# + +#header-only library + +include(vcpkg_common_functions) + +vcpkg_download_distfile(HEADER + URLS "https://github.com/vpiotr/decimal_for_cpp/blob/master/include/decimal.h" + FILENAME "decimal.h" + SHA512 46e29d76311df74422d240a4fd36e2689a9b58758da0415ef2a19d1703e35476403671f5801ce8665a8802511cec89e44a8868e144cee19986c2881f52ca6965 +) + +vcpkg_download_distfile(LICENSE + URLS "https://github.com/vpiotr/decimal_for_cpp/blob/master/doc/license.txt" + FILENAME "License.txt" + SHA512 8edf6bb6929008e69f4e17727ded4964f6e036ef66c2909c7070b75b14791023a9c7303ac6e61c0cc746649175ff96c0477aa7593c66b64a5f999f37a1cf7a58 +) + + +file(COPY ${HEADER} DESTINATION ${CURRENT_PACKAGES_DIR}/include ) +file(COPY ${LICENSE} DESTINATION ${CURRENT_PACKAGES_DIR}/share/decimal-for-cpp ) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/decimal-for-cpp/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/decimal-for-cpp/copyright) + -- cgit v1.2.3 From 6e9d17f73c01c3ad07875ca79196ed2f5e2d3896 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 8 Nov 2016 14:12:49 -0800 Subject: Introduce BUILD_INFO file. Significant change in the way static/dynamic is handled --- scripts/ports.cmake | 4 +++ toolsrc/include/BuildInfo.h | 28 +++++++++++++++++++ toolsrc/include/triplet.h | 8 ------ toolsrc/include/vcpkg_paths.h | 2 ++ toolsrc/src/BuildInfo.cpp | 46 +++++++++++++++++++++++++++++++ toolsrc/src/post_build_lint.cpp | 18 ++++++++---- toolsrc/src/triplet.cpp | 10 ------- toolsrc/src/vcpkg_paths.cpp | 5 ++++ toolsrc/vcpkglib/vcpkglib.vcxproj | 2 ++ toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 6 ++++ 10 files changed, 106 insertions(+), 23 deletions(-) create mode 100644 toolsrc/include/BuildInfo.h create mode 100644 toolsrc/src/BuildInfo.cpp diff --git a/scripts/ports.cmake b/scripts/ports.cmake index 44cb386be..8d86fa6fa 100644 --- a/scripts/ports.cmake +++ b/scripts/ports.cmake @@ -71,6 +71,10 @@ if(CMD MATCHES "^BUILD$") file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR} ${CURRENT_PACKAGES_DIR}) include(${CURRENT_PORT_DIR}/portfile.cmake) + + set(BUILD_INFO_FILE_PATH ${CURRENT_PACKAGES_DIR}/BUILD_INFO) + file(WRITE ${BUILD_INFO_FILE_PATH} "CRTLinkage: ${VCPKG_CRT_LINKAGE}\n") + file(APPEND ${BUILD_INFO_FILE_PATH} "LibraryLinkage: ${VCPKG_LIBRARY_LINKAGE}") elseif(CMD MATCHES "^CREATE$") file(TO_NATIVE_PATH ${VCPKG_ROOT_DIR} NATIVE_VCPKG_ROOT_DIR) file(TO_NATIVE_PATH ${DOWNLOADS} NATIVE_DOWNLOADS) diff --git a/toolsrc/include/BuildInfo.h b/toolsrc/include/BuildInfo.h new file mode 100644 index 000000000..2801cf49d --- /dev/null +++ b/toolsrc/include/BuildInfo.h @@ -0,0 +1,28 @@ +#pragma once + +#include +#include "Paragraphs.h" + +namespace fs = std::tr2::sys; + +namespace vcpkg +{ + enum class LinkageType + { + DYNAMIC, + STATIC, + UNKNOWN + }; + + LinkageType linkage_type_value_of(const std::string& as_string); + + struct BuildInfo + { + static BuildInfo create(const std::unordered_map& pgh); + + std::string crt_linkage; + std::string library_linkage; + }; + + BuildInfo read_build_info(const fs::path& filepath); +} diff --git a/toolsrc/include/triplet.h b/toolsrc/include/triplet.h index bc99a17df..32ea2e711 100644 --- a/toolsrc/include/triplet.h +++ b/toolsrc/include/triplet.h @@ -8,20 +8,12 @@ namespace vcpkg { static triplet from_canonical_name(const std::string& triplet_as_string); - enum class BuildType - { - DYNAMIC, - STATIC - }; - static const triplet X86_WINDOWS; static const triplet X64_WINDOWS; static const triplet X86_UWP; static const triplet X64_UWP; static const triplet ARM_UWP; - BuildType build_type() const; - const std::string& canonical_name() const; std::string architecture() const; diff --git a/toolsrc/include/vcpkg_paths.h b/toolsrc/include/vcpkg_paths.h index 8276242e9..2dc9c7636 100644 --- a/toolsrc/include/vcpkg_paths.h +++ b/toolsrc/include/vcpkg_paths.h @@ -14,7 +14,9 @@ namespace vcpkg fs::path package_dir(const package_spec& spec) const; fs::path port_dir(const package_spec& spec) const; + fs::path build_info_file_path(const package_spec& spec) const; fs::path listfile_path(const BinaryParagraph& pgh) const; + bool is_valid_triplet(const triplet& t) const; fs::path root; diff --git a/toolsrc/src/BuildInfo.cpp b/toolsrc/src/BuildInfo.cpp new file mode 100644 index 000000000..dc8d90e2e --- /dev/null +++ b/toolsrc/src/BuildInfo.cpp @@ -0,0 +1,46 @@ +#include "BuildInfo.h" +#include "vcpkg_Checks.h" +#include "vcpkglib_helpers.h" + +namespace vcpkg +{ + // + namespace BuildInfoRequiredField + { + static const std::string CRT_LINKAGE = "CRTLinkage"; + static const std::string LIBRARY_LINKAGE = "LibraryLinkage"; + } + + BuildInfo BuildInfo::create(const std::unordered_map& pgh) + { + BuildInfo build_info; + build_info.crt_linkage = details::required_field(pgh, BuildInfoRequiredField::CRT_LINKAGE); + build_info.library_linkage = details::required_field(pgh, BuildInfoRequiredField::LIBRARY_LINKAGE); + + return build_info; + } + + LinkageType linkage_type_value_of(const std::string& as_string) + + { + if (as_string == "dynamic") + { + return LinkageType::DYNAMIC; + } + + if (as_string == "static") + { + return LinkageType::STATIC; + } + + return LinkageType::UNKNOWN; + } + + BuildInfo read_build_info(const fs::path& filepath) + { + const std::vector> pghs = Paragraphs::get_paragraphs(filepath); + Checks::check_throw(pghs.size() == 1, "Invalid BUILD_INFO file for package"); + + return BuildInfo::create(pghs[0]); + } +} diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index 8301e74cc..4b784952a 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -5,6 +5,7 @@ #include #include "vcpkg_System.h" #include "coff_file_reader.h" +#include "BuildInfo.h" namespace fs = std::tr2::sys; @@ -495,6 +496,9 @@ namespace vcpkg void perform_all_checks(const package_spec& spec, const vcpkg_paths& paths) { System::println("-- Performing post-build validation"); + + BuildInfo build_info = read_build_info(paths.build_info_file_path(spec)); + size_t error_count = 0; error_count += check_for_files_in_include_directory(spec, paths); error_count += check_for_files_in_debug_include_directory(spec, paths); @@ -506,10 +510,9 @@ namespace vcpkg error_count += check_for_copyright_file(spec, paths); error_count += check_for_exes(spec, paths); - triplet::BuildType build_type = spec.target_triplet().build_type(); - switch (build_type) + switch (linkage_type_value_of(build_info.library_linkage)) { - case triplet::BuildType::DYNAMIC: + case LinkageType::DYNAMIC: { const std::vector debug_dlls = recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "debug" / "bin", ".dll"); const std::vector release_dlls = recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "bin", ".dll"); @@ -525,7 +528,7 @@ namespace vcpkg error_count += check_dll_architecture(spec.target_triplet().architecture(), dlls); break; } - case triplet::BuildType::STATIC: + case LinkageType::STATIC: { std::vector dlls; recursive_find_files_with_extension_in_dir(paths.packages / spec.dir(), ".dll", &dlls); @@ -534,7 +537,12 @@ namespace vcpkg error_count += check_bin_folders_are_not_present_in_static_build(spec, paths); break; } - + case LinkageType::UNKNOWN: + { + error_count += 1; + System::println(System::color::warning, "Unknown library_linkage architecture: [ %s ]", build_info.library_linkage); + break; + } default: Checks::unreachable(); } diff --git a/toolsrc/src/triplet.cpp b/toolsrc/src/triplet.cpp index af2ca2a72..a6816b445 100644 --- a/toolsrc/src/triplet.cpp +++ b/toolsrc/src/triplet.cpp @@ -64,14 +64,4 @@ namespace vcpkg auto it = std::find(this->m_canonical_name.cbegin(), this->m_canonical_name.cend(), '-'); return std::string(it + 1, this->m_canonical_name.cend()); } - - triplet::BuildType triplet::build_type() const - { - if (this->m_canonical_name.find("static") != std::string::npos) - { - return BuildType::STATIC; - } - - return BuildType::DYNAMIC; - } } diff --git a/toolsrc/src/vcpkg_paths.cpp b/toolsrc/src/vcpkg_paths.cpp index 28ab22ec3..5347b79d8 100644 --- a/toolsrc/src/vcpkg_paths.cpp +++ b/toolsrc/src/vcpkg_paths.cpp @@ -55,6 +55,11 @@ namespace vcpkg return this->ports / spec.name(); } + fs::path vcpkg_paths::build_info_file_path(const package_spec& spec) const + { + return this->package_dir(spec) / "BUILD_INFO"; + } + fs::path vcpkg_paths::listfile_path(const BinaryParagraph& pgh) const { return this->vcpkg_dir_info / (pgh.fullstem() + ".list"); diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index 766cdf6a8..10cc32935 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -123,6 +123,7 @@ + @@ -137,6 +138,7 @@ + diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index 705a65a33..e8856235c 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -51,6 +51,9 @@ Source Files + + Source Files + @@ -89,5 +92,8 @@ Header Files + + Header Files + \ No newline at end of file -- cgit v1.2.3 From 1808d461b0e8793445b87eb8ceed71d5ac7aca6e Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 8 Nov 2016 14:25:47 -0800 Subject: triplet is now automatically included before portfiles. Also remove trailing whitespaces from portfiles --- ports/ace/portfile.cmake | 13 ++++++------- ports/apr/portfile.cmake | 1 - ports/assimp/portfile.cmake | 1 - ports/bond/portfile.cmake | 1 - ports/boost/portfile.cmake | 1 - ports/box2d/portfile.cmake | 1 - ports/bullet3/portfile.cmake | 1 - ports/chakracore/portfile.cmake | 3 +-- ports/cpprestsdk/portfile.cmake | 3 +-- ports/cryptopp/portfile.cmake | 5 ++--- ports/curl/portfile.cmake | 1 - ports/double-conversion/portfile.cmake | 1 - ports/dxut/portfile.cmake | 1 - ports/expat/portfile.cmake | 1 - ports/fastlz/portfile.cmake | 1 - ports/fmt/portfile.cmake | 1 - ports/freeglut/portfile.cmake | 1 - ports/freetype/portfile.cmake | 1 - ports/geos/portfile.cmake | 1 - ports/gettext/portfile.cmake | 1 - ports/gflags/portfile.cmake | 5 ++--- ports/glbinding/portfile.cmake | 1 - ports/glew/portfile.cmake | 1 - ports/glfw3/portfile.cmake | 1 - ports/glog/portfile.cmake | 1 - ports/grpc/portfile.cmake | 1 - ports/gtest/portfile.cmake | 1 - ports/harfbuzz/portfile.cmake | 1 - ports/jxrlib/portfile.cmake | 1 - ports/libbson/portfile.cmake | 1 - ports/libccd/portfile.cmake | 1 - ports/libiconv/portfile.cmake | 1 - ports/libjpeg-turbo/portfile.cmake | 1 - ports/libmariadb/portfile.cmake | 23 +++++++++++------------ ports/libmysql/portfile.cmake | 7 +++---- ports/libodb-sqlite/portfile.cmake | 1 - ports/libodb/portfile.cmake | 1 - ports/libogg/portfile.cmake | 1 - ports/libpng/portfile.cmake | 1 - ports/libraw/portfile.cmake | 1 - ports/libtheora/portfile.cmake | 1 - ports/libuv/portfile.cmake | 1 - ports/libvorbis/portfile.cmake | 1 - ports/libwebp/portfile.cmake | 1 - ports/libwebsockets/portfile.cmake | 1 - ports/libxml2/portfile.cmake | 1 - ports/log4cplus/portfile.cmake | 1 - ports/lua/portfile.cmake | 1 - ports/mongo-c-driver/portfile.cmake | 1 - ports/mongo-cxx-driver/portfile.cmake | 3 +-- ports/mpg123/portfile.cmake | 1 - ports/mpir/portfile.cmake | 1 - ports/nanodbc/portfile.cmake | 5 ++--- ports/openal-soft/portfile.cmake | 1 - ports/opencv/portfile.cmake | 1 - ports/openjpeg/portfile.cmake | 1 - ports/openssl/portfile.cmake | 1 - ports/pcre/portfile.cmake | 1 - ports/pdcurses/portfile.cmake | 1 - ports/physfs/portfile.cmake | 1 - ports/ragel/portfile.cmake | 1 - ports/sdl2/portfile.cmake | 1 - ports/sery/portfile.cmake | 1 - ports/sqlite3/portfile.cmake | 1 - ports/tbb/portfile.cmake | 1 - ports/tiff/portfile.cmake | 1 - ports/tinyxml2/portfile.cmake | 1 - ports/wt/portfile.cmake | 1 - ports/zeromq/portfile.cmake | 1 - ports/zlib/portfile.cmake | 1 - ports/zziplib/portfile.cmake | 1 - scripts/ports.cmake | 1 + 72 files changed, 30 insertions(+), 100 deletions(-) diff --git a/ports/ace/portfile.cmake b/ports/ace/portfile.cmake index 4838afc42..4642f9944 100644 --- a/ports/ace/portfile.cmake +++ b/ports/ace/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) message(FATAL_ERROR "Static building not supported yet") endif() @@ -19,7 +18,7 @@ else () set(MSBUILD_PLATFORM ${TRIPLET_SYSTEM_ARCH}) endif() -# Add ace/config.h file +# Add ace/config.h file # see http://www.dre.vanderbilt.edu/~schmidt/DOC_ROOT/ACE/ACE-INSTALL.html#win32 file(WRITE ${SOURCE_PATH}/config.h "#include \"ace/config-windows.h\"") vcpkg_build_msbuild( @@ -27,16 +26,16 @@ vcpkg_build_msbuild( PLATFORM ${MSBUILD_PLATFORM} ) -# ACE itself does not define an install target, so it is not clear which -# headers are public and which not. For the moment we install everything +# ACE itself does not define an install target, so it is not clear which +# headers are public and which not. For the moment we install everything # that is in the source path and ends in .h, .inl function(install_ace_headers_subdirectory SOURCE_PATH RELATIVE_PATH) file(GLOB HEADER_FILES ${SOURCE_PATH}/${RELATIVE_PATH}/*.h ${SOURCE_PATH}/${RELATIVE_PATH}/*.inl) file(INSTALL ${HEADER_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include/ace/${RELATIVE_PATH}) endfunction() -# We manually install header found in the ace directory because in that case -# we are supposed to install also *cpp files, see ACE_wrappers\debian\libace-dev.install file +# We manually install header found in the ace directory because in that case +# we are supposed to install also *cpp files, see ACE_wrappers\debian\libace-dev.install file file(GLOB HEADER_FILES ${SOURCE_PATH}/*.h ${SOURCE_PATH}/*.inl ${SOURCE_PATH}/*.cpp) file(INSTALL ${HEADER_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include/ace/) @@ -65,7 +64,7 @@ function(install_ace_library SOURCE_PATH ACE_LIBRARY) ${LIB_PATH}/${ACE_LIBRARY}.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/bin ) - + file(INSTALL ${LIB_PATH}/${ACE_LIBRARY}d.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib diff --git a/ports/apr/portfile.cmake b/ports/apr/portfile.cmake index df96d4474..f65b44649 100644 --- a/ports/apr/portfile.cmake +++ b/ports/apr/portfile.cmake @@ -6,7 +6,6 @@ # CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} # -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/apr-1.5.2) vcpkg_download_distfile(ARCHIVE diff --git a/ports/assimp/portfile.cmake b/ports/assimp/portfile.cmake index e53384ff1..04d19cdd3 100644 --- a/ports/assimp/portfile.cmake +++ b/ports/assimp/portfile.cmake @@ -6,7 +6,6 @@ # CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} # -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE URLS "https://github.com/assimp/assimp/archive/v3.3.1.zip" diff --git a/ports/bond/portfile.cmake b/ports/bond/portfile.cmake index 7e28270f2..3b1ed7116 100644 --- a/ports/bond/portfile.cmake +++ b/ports/bond/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) message(FATAL_ERROR "Static building not supported yet") endif() diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake index 71fc8ba99..586f6dfcf 100644 --- a/ports/boost/portfile.cmake +++ b/ports/boost/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/boost_1_62_0) diff --git a/ports/box2d/portfile.cmake b/ports/box2d/portfile.cmake index e35242bb7..c0ed6c6c3 100644 --- a/ports/box2d/portfile.cmake +++ b/ports/box2d/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) # Get output directory set(PROJECT_ARCH_BITS "x64") diff --git a/ports/bullet3/portfile.cmake b/ports/bullet3/portfile.cmake index 7b530ec07..2cd60a45f 100644 --- a/ports/bullet3/portfile.cmake +++ b/ports/bullet3/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/bullet3-98d47809b4273d97ea06c9b2137ada10af581bb9) vcpkg_download_distfile(ARCHIVE diff --git a/ports/chakracore/portfile.cmake b/ports/chakracore/portfile.cmake index 989c76c60..43710e53c 100644 --- a/ports/chakracore/portfile.cmake +++ b/ports/chakracore/portfile.cmake @@ -1,5 +1,4 @@ -include(${CMAKE_TRIPLET_FILE}) -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) message(FATAL_ERROR "Static building not supported yet") endif() include(vcpkg_common_functions) diff --git a/ports/cpprestsdk/portfile.cmake b/ports/cpprestsdk/portfile.cmake index ed0a2176b..d1b5fa7f6 100644 --- a/ports/cpprestsdk/portfile.cmake +++ b/ports/cpprestsdk/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/cpprestsdk-2.9.0) @@ -12,7 +11,7 @@ vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} - PATCHES + PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001_cmake.patch ) diff --git a/ports/cryptopp/portfile.cmake b/ports/cryptopp/portfile.cmake index 1fc1e4ebd..bdd4f9a12 100644 --- a/ports/cryptopp/portfile.cmake +++ b/ports/cryptopp/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) message(FATAL_ERROR "Dynamic building not supported") # See note below endif() @@ -37,8 +36,8 @@ file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/cryptest.exe) file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/cryptest.exe) # Remove other files not required in package -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/cmake) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/cmake) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) # Handle copyright file(COPY ${SOURCE_PATH}/License.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/cryptopp) diff --git a/ports/curl/portfile.cmake b/ports/curl/portfile.cmake index 17063f382..54fa7922b 100644 --- a/ports/curl/portfile.cmake +++ b/ports/curl/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) message(FATAL_ERROR "Static building not supported yet") endif() diff --git a/ports/double-conversion/portfile.cmake b/ports/double-conversion/portfile.cmake index 670cb4310..05365d777 100644 --- a/ports/double-conversion/portfile.cmake +++ b/ports/double-conversion/portfile.cmake @@ -14,7 +14,6 @@ # CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} # -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/double-conversion-d4d68e4e788bec89d55a6a3e33af674087837c82) vcpkg_download_distfile(ARCHIVE diff --git a/ports/dxut/portfile.cmake b/ports/dxut/portfile.cmake index 8a13e9a2b..849ae133a 100644 --- a/ports/dxut/portfile.cmake +++ b/ports/dxut/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) message(FATAL_ERROR "Static building not supported yet") endif() diff --git a/ports/expat/portfile.cmake b/ports/expat/portfile.cmake index 883d6cffb..37180d97b 100644 --- a/ports/expat/portfile.cmake +++ b/ports/expat/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/expat-2.1.1) vcpkg_download_distfile(ARCHIVE_FILE diff --git a/ports/fastlz/portfile.cmake b/ports/fastlz/portfile.cmake index 33161b56a..5b28df291 100644 --- a/ports/fastlz/portfile.cmake +++ b/ports/fastlz/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/FastLZ-master) vcpkg_download_distfile(ARCHIVE diff --git a/ports/fmt/portfile.cmake b/ports/fmt/portfile.cmake index 26465b6b2..fab282959 100644 --- a/ports/fmt/portfile.cmake +++ b/ports/fmt/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) message(FATAL_ERROR "Dynamic building not supported yet") endif() diff --git a/ports/freeglut/portfile.cmake b/ports/freeglut/portfile.cmake index 3ef5be1fd..34413eb57 100644 --- a/ports/freeglut/portfile.cmake +++ b/ports/freeglut/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) message(FATAL_ERROR "Static building not supported yet") endif() diff --git a/ports/freetype/portfile.cmake b/ports/freetype/portfile.cmake index 621caea18..8d7bf158f 100644 --- a/ports/freetype/portfile.cmake +++ b/ports/freetype/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/freetype-2.6.3) vcpkg_download_distfile(ARCHIVE diff --git a/ports/geos/portfile.cmake b/ports/geos/portfile.cmake index b539b3f6f..60d907acd 100644 --- a/ports/geos/portfile.cmake +++ b/ports/geos/portfile.cmake @@ -6,7 +6,6 @@ # CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} # -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) #downloading 3.5 from their SVN repo and not the release tarball #because the 3.5 release did not build on windows, and fixes were backported diff --git a/ports/gettext/portfile.cmake b/ports/gettext/portfile.cmake index 1da88b0e9..f14f7a707 100644 --- a/ports/gettext/portfile.cmake +++ b/ports/gettext/portfile.cmake @@ -8,7 +8,6 @@ #Based on https://github.com/winlibs/gettext -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/gettext-0.19) vcpkg_download_distfile(ARCHIVE diff --git a/ports/gflags/portfile.cmake b/ports/gflags/portfile.cmake index 7ca94d9fd..b600d8832 100644 --- a/ports/gflags/portfile.cmake +++ b/ports/gflags/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) find_program(GIT git) @@ -64,8 +63,8 @@ file(WRITE ${CURRENT_PACKAGES_DIR}/share/gflags/gflags-export-release.cmake "${G file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/cmake) file(READ ${CURRENT_PACKAGES_DIR}/share/gflags/gflags-export.cmake GFLAGS_CONFIG_MODULE) -string(REPLACE "get_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)" - "get_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)\nget_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)" +string(REPLACE "get_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)" + "get_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)\nget_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)" GFLAGS_CONFIG_MODULE "${GFLAGS_CONFIG_MODULE}") file(WRITE ${CURRENT_PACKAGES_DIR}/share/gflags/gflags-export.cmake ${GFLAGS_CONFIG_MODULE}) diff --git a/ports/glbinding/portfile.cmake b/ports/glbinding/portfile.cmake index 38cc21542..cf578c0a5 100644 --- a/ports/glbinding/portfile.cmake +++ b/ports/glbinding/portfile.cmake @@ -6,7 +6,6 @@ # CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} # -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE diff --git a/ports/glew/portfile.cmake b/ports/glew/portfile.cmake index f048e8c41..8748f4a76 100644 --- a/ports/glew/portfile.cmake +++ b/ports/glew/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) message(FATAL_ERROR "Static building not supported yet") endif() diff --git a/ports/glfw3/portfile.cmake b/ports/glfw3/portfile.cmake index b947142d8..3f834f9b6 100644 --- a/ports/glfw3/portfile.cmake +++ b/ports/glfw3/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/glfw-3.2.1) vcpkg_download_distfile(ARCHIVE diff --git a/ports/glog/portfile.cmake b/ports/glog/portfile.cmake index 7811f185d..c9f6bfa43 100644 --- a/ports/glog/portfile.cmake +++ b/ports/glog/portfile.cmake @@ -6,7 +6,6 @@ # CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} # -include(${CMAKE_TRIPLET_FILE}) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) message(FATAL_ERROR "Static building not supported yet. Portfile needs modification and also blocked by flags") endif() diff --git a/ports/grpc/portfile.cmake b/ports/grpc/portfile.cmake index 89cf892a0..b8718ea10 100644 --- a/ports/grpc/portfile.cmake +++ b/ports/grpc/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) message(FATAL_ERROR "Static building not supported yet") endif() diff --git a/ports/gtest/portfile.cmake b/ports/gtest/portfile.cmake index f798310ad..b7bfd4b39 100644 --- a/ports/gtest/portfile.cmake +++ b/ports/gtest/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) message(FATAL_ERROR "Static building not supported yet") endif() diff --git a/ports/harfbuzz/portfile.cmake b/ports/harfbuzz/portfile.cmake index 1bb64f3e4..84aaed2a7 100644 --- a/ports/harfbuzz/portfile.cmake +++ b/ports/harfbuzz/portfile.cmake @@ -6,7 +6,6 @@ # CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} # -include(${CMAKE_TRIPLET_FILE}) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) message(FATAL_ERROR "Static building not supported yet. Portfile not modified for static and blocked on freetype.") endif() diff --git a/ports/jxrlib/portfile.cmake b/ports/jxrlib/portfile.cmake index 53bf30bb5..914adf14e 100644 --- a/ports/jxrlib/portfile.cmake +++ b/ports/jxrlib/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src) vcpkg_download_distfile(ARCHIVE diff --git a/ports/libbson/portfile.cmake b/ports/libbson/portfile.cmake index a7d347cae..50ebf5eca 100644 --- a/ports/libbson/portfile.cmake +++ b/ports/libbson/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) message(FATAL_ERROR "Static building not supported yet") endif() diff --git a/ports/libccd/portfile.cmake b/ports/libccd/portfile.cmake index 67eda1ccb..963000ec5 100644 --- a/ports/libccd/portfile.cmake +++ b/ports/libccd/portfile.cmake @@ -6,7 +6,6 @@ # CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} # -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libccd-16b9379fb6e8610566fe5e1396166daf7106f165) vcpkg_download_distfile(ARCHIVE diff --git a/ports/libiconv/portfile.cmake b/ports/libiconv/portfile.cmake index 15d324d23..cfb96391b 100644 --- a/ports/libiconv/portfile.cmake +++ b/ports/libiconv/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libiconv-1.14) vcpkg_download_distfile(ARCHIVE diff --git a/ports/libjpeg-turbo/portfile.cmake b/ports/libjpeg-turbo/portfile.cmake index 0ec4a0c9c..c9672332e 100644 --- a/ports/libjpeg-turbo/portfile.cmake +++ b/ports/libjpeg-turbo/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libjpeg-turbo-1.4.90) diff --git a/ports/libmariadb/portfile.cmake b/ports/libmariadb/portfile.cmake index ab40ab5c9..61e2ccee5 100644 --- a/ports/libmariadb/portfile.cmake +++ b/ports/libmariadb/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) message(FATAL_ERROR "Static building not supported yet") endif() @@ -26,27 +25,27 @@ vcpkg_install_cmake() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # fix libmariadb lib & dll directory. -file(MAKE_DIRECTORY +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) -file(RENAME - ${CURRENT_PACKAGES_DIR}/lib/mariadb/libmariadb.dll +file(RENAME + ${CURRENT_PACKAGES_DIR}/lib/mariadb/libmariadb.dll ${CURRENT_PACKAGES_DIR}/bin/libmariadb.dll) -file(RENAME - ${CURRENT_PACKAGES_DIR}/debug/lib/mariadb/libmariadb.dll +file(RENAME + ${CURRENT_PACKAGES_DIR}/debug/lib/mariadb/libmariadb.dll ${CURRENT_PACKAGES_DIR}/debug/bin/libmariadb.dll) -file(RENAME - ${CURRENT_PACKAGES_DIR}/lib/mariadb/libmariadb.lib +file(RENAME + ${CURRENT_PACKAGES_DIR}/lib/mariadb/libmariadb.lib ${CURRENT_PACKAGES_DIR}/lib/libmariadb.lib) -file(RENAME - ${CURRENT_PACKAGES_DIR}/debug/lib/mariadb/libmariadb.lib +file(RENAME + ${CURRENT_PACKAGES_DIR}/debug/lib/mariadb/libmariadb.lib ${CURRENT_PACKAGES_DIR}/debug/lib/libmariadb.lib) -file(REMOVE +file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/mariadb/mariadbclient.lib ${CURRENT_PACKAGES_DIR}/debug/lib/mariadb/mariadbclient.lib) # remove plugin folder -file(REMOVE_RECURSE +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/plugin ${CURRENT_PACKAGES_DIR}/debug/lib/plugin ${CURRENT_PACKAGES_DIR}/lib/mariadb diff --git a/ports/libmysql/portfile.cmake b/ports/libmysql/portfile.cmake index 9c2aafdc1..5f4f11a0c 100644 --- a/ports/libmysql/portfile.cmake +++ b/ports/libmysql/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) message(FATAL_ERROR "Static building not supported yet") endif() @@ -18,7 +17,7 @@ vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} - PATCHES + PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001_cmake.patch ) @@ -29,11 +28,11 @@ vcpkg_configure_cmake( vcpkg_install_cmake() # delete debug headers -file(REMOVE_RECURSE +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # delete useless vcruntime/scripts/bin/msg file -file(REMOVE_RECURSE +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share ${CURRENT_PACKAGES_DIR}/debug/share ${CURRENT_PACKAGES_DIR}/bin diff --git a/ports/libodb-sqlite/portfile.cmake b/ports/libodb-sqlite/portfile.cmake index 27d157bf5..a1228f4ed 100644 --- a/ports/libodb-sqlite/portfile.cmake +++ b/ports/libodb-sqlite/portfile.cmake @@ -6,7 +6,6 @@ # CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} # -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libodb-sqlite-2.4.0) vcpkg_download_distfile(ARCHIVE diff --git a/ports/libodb/portfile.cmake b/ports/libodb/portfile.cmake index 770cc0948..21d715499 100644 --- a/ports/libodb/portfile.cmake +++ b/ports/libodb/portfile.cmake @@ -6,7 +6,6 @@ # CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} # -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) include(CMakePackageConfigHelpers) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libodb-2.4.0) diff --git a/ports/libogg/portfile.cmake b/ports/libogg/portfile.cmake index d19bee8f7..4127a6aef 100644 --- a/ports/libogg/portfile.cmake +++ b/ports/libogg/portfile.cmake @@ -6,7 +6,6 @@ # CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} # -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) find_program(GIT git) diff --git a/ports/libpng/portfile.cmake b/ports/libpng/portfile.cmake index 61500e680..f7be6cca1 100644 --- a/ports/libpng/portfile.cmake +++ b/ports/libpng/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libpng-1.6.24) diff --git a/ports/libraw/portfile.cmake b/ports/libraw/portfile.cmake index 284b440e6..69c168a07 100644 --- a/ports/libraw/portfile.cmake +++ b/ports/libraw/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/LibRaw-0.17.2) vcpkg_download_distfile(ARCHIVE diff --git a/ports/libtheora/portfile.cmake b/ports/libtheora/portfile.cmake index fcaabf44f..0d63621e5 100644 --- a/ports/libtheora/portfile.cmake +++ b/ports/libtheora/portfile.cmake @@ -6,7 +6,6 @@ # CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} # -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libtheora-1.1.1) vcpkg_download_distfile(ARCHIVE diff --git a/ports/libuv/portfile.cmake b/ports/libuv/portfile.cmake index e8fdb1eaa..bf7e10b55 100644 --- a/ports/libuv/portfile.cmake +++ b/ports/libuv/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) message(FATAL_ERROR "Static building not supported yet") endif() diff --git a/ports/libvorbis/portfile.cmake b/ports/libvorbis/portfile.cmake index cff89d653..15cf48857 100644 --- a/ports/libvorbis/portfile.cmake +++ b/ports/libvorbis/portfile.cmake @@ -6,7 +6,6 @@ # CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} # -include(${CMAKE_TRIPLET_FILE}) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) message(FATAL_ERROR "Static building not supported yet") endif() diff --git a/ports/libwebp/portfile.cmake b/ports/libwebp/portfile.cmake index b9d77c6f6..d85e4fdaf 100644 --- a/ports/libwebp/portfile.cmake +++ b/ports/libwebp/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libwebp-0.5.1) vcpkg_download_distfile(ARCHIVE diff --git a/ports/libwebsockets/portfile.cmake b/ports/libwebsockets/portfile.cmake index 9622f0e01..f775692cf 100644 --- a/ports/libwebsockets/portfile.cmake +++ b/ports/libwebsockets/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) message(FATAL_ERROR "Static building not supported yet") endif() diff --git a/ports/libxml2/portfile.cmake b/ports/libxml2/portfile.cmake index 26a604897..f7e17e21b 100644 --- a/ports/libxml2/portfile.cmake +++ b/ports/libxml2/portfile.cmake @@ -6,7 +6,6 @@ # CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} # -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libxml2-2.9.4) vcpkg_download_distfile(ARCHIVE diff --git a/ports/log4cplus/portfile.cmake b/ports/log4cplus/portfile.cmake index 78620597a..1eb1a7a59 100644 --- a/ports/log4cplus/portfile.cmake +++ b/ports/log4cplus/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/log4cplus-REL_1_1_3-RC7) vcpkg_download_distfile(ARCHIVE diff --git a/ports/lua/portfile.cmake b/ports/lua/portfile.cmake index f8c1071f7..598b15c94 100644 --- a/ports/lua/portfile.cmake +++ b/ports/lua/portfile.cmake @@ -6,7 +6,6 @@ # CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} # -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/lua-5.3.3) vcpkg_download_distfile(ARCHIVE diff --git a/ports/mongo-c-driver/portfile.cmake b/ports/mongo-c-driver/portfile.cmake index 27b70b7f7..7fbd73be1 100644 --- a/ports/mongo-c-driver/portfile.cmake +++ b/ports/mongo-c-driver/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) message(FATAL_ERROR "Static building not supported yet. Portfile not modified and blocked by libbson.") endif() diff --git a/ports/mongo-cxx-driver/portfile.cmake b/ports/mongo-cxx-driver/portfile.cmake index 867275aea..16a3eb56a 100644 --- a/ports/mongo-cxx-driver/portfile.cmake +++ b/ports/mongo-cxx-driver/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) message(FATAL_ERROR "Static building not supported yet. Portfile not modified and blocked by libbson.") endif() @@ -24,7 +23,7 @@ vcpkg_configure_cmake( -DLIBMONGOC_DIR=${CURRENT_INSTALLED_DIR} ) -vcpkg_install_cmake() +vcpkg_install_cmake() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/cmake) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) diff --git a/ports/mpg123/portfile.cmake b/ports/mpg123/portfile.cmake index de04b9c88..8cf90bc29 100644 --- a/ports/mpg123/portfile.cmake +++ b/ports/mpg123/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) message(FATAL_ERROR "Static building not supported yet") endif() diff --git a/ports/mpir/portfile.cmake b/ports/mpir/portfile.cmake index 92cec4b23..f70ab0ed2 100644 --- a/ports/mpir/portfile.cmake +++ b/ports/mpir/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) message(FATAL_ERROR "Static building not supported yet") endif() diff --git a/ports/nanodbc/portfile.cmake b/ports/nanodbc/portfile.cmake index 9a949e7ac..d3139dec9 100644 --- a/ports/nanodbc/portfile.cmake +++ b/ports/nanodbc/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) message(FATAL_ERROR "Static building not supported yet") endif() @@ -14,7 +13,7 @@ vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} - PATCHES + PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001_cmake.patch ${CMAKE_CURRENT_LIST_DIR}/0002_msvc14_codecvt.patch ${CMAKE_CURRENT_LIST_DIR}/0003_export_def.patch @@ -29,7 +28,7 @@ vcpkg_configure_cmake( -DNANODBC_USE_UNICODE=ON ) -vcpkg_install_cmake() +vcpkg_install_cmake() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) diff --git a/ports/openal-soft/portfile.cmake b/ports/openal-soft/portfile.cmake index 397726cee..76272937d 100644 --- a/ports/openal-soft/portfile.cmake +++ b/ports/openal-soft/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) message(FATAL_ERROR "Static building not supported yet") endif() diff --git a/ports/opencv/portfile.cmake b/ports/opencv/portfile.cmake index b6665eedc..3559dcb23 100644 --- a/ports/opencv/portfile.cmake +++ b/ports/opencv/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) message(FATAL_ERROR "Static building not supported yet. Portfile not modified and blocked by libjpeg-turbo.") endif() diff --git a/ports/openjpeg/portfile.cmake b/ports/openjpeg/portfile.cmake index 9ce215bbc..dfa25881d 100644 --- a/ports/openjpeg/portfile.cmake +++ b/ports/openjpeg/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/openjpeg-2.1.2) vcpkg_download_distfile(ARCHIVE diff --git a/ports/openssl/portfile.cmake b/ports/openssl/portfile.cmake index 1d3d40b78..6ae754d6f 100644 --- a/ports/openssl/portfile.cmake +++ b/ports/openssl/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/openssl-1.0.2j) vcpkg_find_acquire_program(PERL) diff --git a/ports/pcre/portfile.cmake b/ports/pcre/portfile.cmake index 2a9c1ee76..0dcc8a97c 100644 --- a/ports/pcre/portfile.cmake +++ b/ports/pcre/portfile.cmake @@ -6,7 +6,6 @@ # CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} # -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/pcre-8.38) vcpkg_download_distfile(ARCHIVE diff --git a/ports/pdcurses/portfile.cmake b/ports/pdcurses/portfile.cmake index 2f3429d68..8ba0f99ba 100644 --- a/ports/pdcurses/portfile.cmake +++ b/ports/pdcurses/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) if(VCPKG_TARGET_ARCHITECTURE STREQUAL x64) message(FATAL_ERROR "64-bit builds are not supported for PDCurses.") diff --git a/ports/physfs/portfile.cmake b/ports/physfs/portfile.cmake index 80ed17d0f..b4768cc39 100644 --- a/ports/physfs/portfile.cmake +++ b/ports/physfs/portfile.cmake @@ -6,7 +6,6 @@ # CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} # -include(${CMAKE_TRIPLET_FILE}) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) message(FATAL_ERROR "Static building not supported yet") endif() diff --git a/ports/ragel/portfile.cmake b/ports/ragel/portfile.cmake index c5f91b5ca..8568f6bac 100644 --- a/ports/ragel/portfile.cmake +++ b/ports/ragel/portfile.cmake @@ -6,7 +6,6 @@ # CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} # -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ragel-6.9) vcpkg_download_distfile(ARCHIVE diff --git a/ports/sdl2/portfile.cmake b/ports/sdl2/portfile.cmake index d6e53b491..3fca78981 100644 --- a/ports/sdl2/portfile.cmake +++ b/ports/sdl2/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) message(FATAL_ERROR "Static building not supported yet") endif() diff --git a/ports/sery/portfile.cmake b/ports/sery/portfile.cmake index 9d7e5b770..86d76b33d 100644 --- a/ports/sery/portfile.cmake +++ b/ports/sery/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) message(FATAL_ERROR "Dynamic building not supported yet") endif() diff --git a/ports/sqlite3/portfile.cmake b/ports/sqlite3/portfile.cmake index a7999b68c..8302e9d3e 100644 --- a/ports/sqlite3/portfile.cmake +++ b/ports/sqlite3/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/sqlite-amalgamation-3150000) vcpkg_download_distfile(ARCHIVE diff --git a/ports/tbb/portfile.cmake b/ports/tbb/portfile.cmake index 06349b35c..752386282 100644 --- a/ports/tbb/portfile.cmake +++ b/ports/tbb/portfile.cmake @@ -6,7 +6,6 @@ # CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} # -include(${CMAKE_TRIPLET_FILE}) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) message(FATAL_ERROR "Static building not supported yet") endif() diff --git a/ports/tiff/portfile.cmake b/ports/tiff/portfile.cmake index 2266cfe35..6a6701caa 100644 --- a/ports/tiff/portfile.cmake +++ b/ports/tiff/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/tiff-4.0.6) vcpkg_download_distfile(ARCHIVE diff --git a/ports/tinyxml2/portfile.cmake b/ports/tinyxml2/portfile.cmake index a754b34e5..656f4783f 100644 --- a/ports/tinyxml2/portfile.cmake +++ b/ports/tinyxml2/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/tinyxml2-3.0.0) vcpkg_download_distfile(ARCHIVE diff --git a/ports/wt/portfile.cmake b/ports/wt/portfile.cmake index bacb09dda..66b1d5a33 100644 --- a/ports/wt/portfile.cmake +++ b/ports/wt/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/wt-3.3.6) diff --git a/ports/zeromq/portfile.cmake b/ports/zeromq/portfile.cmake index 3679a6b35..f27738488 100644 --- a/ports/zeromq/portfile.cmake +++ b/ports/zeromq/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libzmq-1a02b1b3f2fde6288579cbb0ff9a0b1f195e1812) vcpkg_download_distfile(ARCHIVE diff --git a/ports/zlib/portfile.cmake b/ports/zlib/portfile.cmake index 1d6d807d4..ef891f685 100644 --- a/ports/zlib/portfile.cmake +++ b/ports/zlib/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/zlib-1.2.8) vcpkg_download_distfile(ARCHIVE_FILE diff --git a/ports/zziplib/portfile.cmake b/ports/zziplib/portfile.cmake index 3e21be80b..2a7e18e56 100644 --- a/ports/zziplib/portfile.cmake +++ b/ports/zziplib/portfile.cmake @@ -1,4 +1,3 @@ -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/zziplib-0.13.62) vcpkg_download_distfile(ARCHIVE diff --git a/scripts/ports.cmake b/scripts/ports.cmake index 8d86fa6fa..762997491 100644 --- a/scripts/ports.cmake +++ b/scripts/ports.cmake @@ -70,6 +70,7 @@ if(CMD MATCHES "^BUILD$") endif() file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR} ${CURRENT_PACKAGES_DIR}) + include(${CMAKE_TRIPLET_FILE}) include(${CURRENT_PORT_DIR}/portfile.cmake) set(BUILD_INFO_FILE_PATH ${CURRENT_PACKAGES_DIR}/BUILD_INFO) -- cgit v1.2.3 From cadee66ca2d8048d7d6449ed0472d091350a617f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 8 Nov 2016 14:38:47 -0800 Subject: If portfile is not static-enabled yet, warn and then build dynamic The opposite if portfile is not dynamic enabled --- ports/ace/portfile.cmake | 3 ++- ports/bond/portfile.cmake | 3 ++- ports/chakracore/portfile.cmake | 3 ++- ports/cryptopp/portfile.cmake | 3 ++- ports/curl/portfile.cmake | 3 ++- ports/dxut/portfile.cmake | 3 ++- ports/fmt/portfile.cmake | 3 ++- ports/freeglut/portfile.cmake | 3 ++- ports/glew/portfile.cmake | 3 ++- ports/glog/portfile.cmake | 3 ++- ports/grpc/portfile.cmake | 3 ++- ports/gtest/portfile.cmake | 3 ++- ports/harfbuzz/portfile.cmake | 3 ++- ports/libbson/portfile.cmake | 3 ++- ports/libmariadb/portfile.cmake | 3 ++- ports/libmysql/portfile.cmake | 3 ++- ports/libuv/portfile.cmake | 3 ++- ports/libvorbis/portfile.cmake | 3 ++- ports/libwebsockets/portfile.cmake | 3 ++- ports/mongo-c-driver/portfile.cmake | 3 ++- ports/mongo-cxx-driver/portfile.cmake | 3 ++- ports/mpg123/portfile.cmake | 3 ++- ports/mpir/portfile.cmake | 3 ++- ports/nanodbc/portfile.cmake | 3 ++- ports/openal-soft/portfile.cmake | 3 ++- ports/opencv/portfile.cmake | 3 ++- ports/physfs/portfile.cmake | 3 ++- ports/sdl2/portfile.cmake | 3 ++- ports/sery/portfile.cmake | 3 ++- ports/tbb/portfile.cmake | 3 ++- 30 files changed, 60 insertions(+), 30 deletions(-) diff --git a/ports/ace/portfile.cmake b/ports/ace/portfile.cmake index 4642f9944..8301fb232 100644 --- a/ports/ace/portfile.cmake +++ b/ports/ace/portfile.cmake @@ -1,5 +1,6 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Static building not supported yet") + message(STATUS "Warning: Static building not supported yet. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ACE_wrappers/ace) diff --git a/ports/bond/portfile.cmake b/ports/bond/portfile.cmake index 3b1ed7116..8dbf7cf53 100644 --- a/ports/bond/portfile.cmake +++ b/ports/bond/portfile.cmake @@ -1,5 +1,6 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Static building not supported yet") + message(STATUS "Warning: Static building not supported yet. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/bond-53ea13692925bee4ba494ee9de3614f15c09d85d) diff --git a/ports/chakracore/portfile.cmake b/ports/chakracore/portfile.cmake index 43710e53c..ea4a3d7ff 100644 --- a/ports/chakracore/portfile.cmake +++ b/ports/chakracore/portfile.cmake @@ -1,5 +1,6 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Static building not supported yet") + message(STATUS "Warning: Static building not supported yet. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) find_program(POWERSHELL powershell) diff --git a/ports/cryptopp/portfile.cmake b/ports/cryptopp/portfile.cmake index bdd4f9a12..4847c208b 100644 --- a/ports/cryptopp/portfile.cmake +++ b/ports/cryptopp/portfile.cmake @@ -1,5 +1,6 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - message(FATAL_ERROR "Dynamic building not supported") # See note below + message(STATUS "Warning: Dynamic building not supported. Building static.") # See note below + set(VCPKG_LIBRARY_LINKAGE static) endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/cryptopp-CRYPTOPP_5_6_5) diff --git a/ports/curl/portfile.cmake b/ports/curl/portfile.cmake index 54fa7922b..8ad5ed7f7 100644 --- a/ports/curl/portfile.cmake +++ b/ports/curl/portfile.cmake @@ -1,5 +1,6 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Static building not supported yet") + message(STATUS "Warning: Static building not supported yet. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/curl-curl-7_51_0) diff --git a/ports/dxut/portfile.cmake b/ports/dxut/portfile.cmake index 849ae133a..774ef4d5f 100644 --- a/ports/dxut/portfile.cmake +++ b/ports/dxut/portfile.cmake @@ -1,5 +1,6 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Static building not supported yet") + message(STATUS "Warning: Static building not supported yet. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/DXUT-sept2016) diff --git a/ports/fmt/portfile.cmake b/ports/fmt/portfile.cmake index fab282959..6f9f42231 100644 --- a/ports/fmt/portfile.cmake +++ b/ports/fmt/portfile.cmake @@ -1,5 +1,6 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - message(FATAL_ERROR "Dynamic building not supported yet") + 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/fmt-3.0.0) diff --git a/ports/freeglut/portfile.cmake b/ports/freeglut/portfile.cmake index 34413eb57..8ea89d780 100644 --- a/ports/freeglut/portfile.cmake +++ b/ports/freeglut/portfile.cmake @@ -1,5 +1,6 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Static building not supported yet") + message(STATUS "Warning: Static building not supported yet. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE diff --git a/ports/glew/portfile.cmake b/ports/glew/portfile.cmake index 8748f4a76..fd3c5ef9a 100644 --- a/ports/glew/portfile.cmake +++ b/ports/glew/portfile.cmake @@ -1,5 +1,6 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Static building not supported yet") + message(STATUS "Warning: Static building not supported yet. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/glew-2.0.0) diff --git a/ports/glog/portfile.cmake b/ports/glog/portfile.cmake index c9f6bfa43..4895be694 100644 --- a/ports/glog/portfile.cmake +++ b/ports/glog/portfile.cmake @@ -7,7 +7,8 @@ # if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Static building not supported yet. Portfile needs modification and also blocked by flags") + message(STATUS "Warning: Static building not supported yet. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/glog-0472b91c5defdf90cff7292e3bf7bd86770a9a0a) diff --git a/ports/grpc/portfile.cmake b/ports/grpc/portfile.cmake index b8718ea10..a54af6e55 100644 --- a/ports/grpc/portfile.cmake +++ b/ports/grpc/portfile.cmake @@ -1,5 +1,6 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Static building not supported yet") + message(STATUS "Warning: Static building not supported yet. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) find_program(GIT git) diff --git a/ports/gtest/portfile.cmake b/ports/gtest/portfile.cmake index b7bfd4b39..e1d601d7b 100644 --- a/ports/gtest/portfile.cmake +++ b/ports/gtest/portfile.cmake @@ -1,5 +1,6 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Static building not supported yet") + message(STATUS "Warning: Static building not supported yet. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) diff --git a/ports/harfbuzz/portfile.cmake b/ports/harfbuzz/portfile.cmake index 84aaed2a7..2603fdf0a 100644 --- a/ports/harfbuzz/portfile.cmake +++ b/ports/harfbuzz/portfile.cmake @@ -7,7 +7,8 @@ # if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Static building not supported yet. Portfile not modified for static and blocked on freetype.") + message(STATUS "Warning: Static building not supported yet. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/harfbuzz-1.3.2) diff --git a/ports/libbson/portfile.cmake b/ports/libbson/portfile.cmake index 50ebf5eca..71846b643 100644 --- a/ports/libbson/portfile.cmake +++ b/ports/libbson/portfile.cmake @@ -1,5 +1,6 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Static building not supported yet") + message(STATUS "Warning: Static building not supported yet. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libbson-1.4.2) diff --git a/ports/libmariadb/portfile.cmake b/ports/libmariadb/portfile.cmake index 61e2ccee5..e6ccfa508 100644 --- a/ports/libmariadb/portfile.cmake +++ b/ports/libmariadb/portfile.cmake @@ -1,5 +1,6 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Static building not supported yet") + message(STATUS "Warning: Static building not supported yet. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mariadb-connector-c-2.3.1) diff --git a/ports/libmysql/portfile.cmake b/ports/libmysql/portfile.cmake index 5f4f11a0c..48412ccc7 100644 --- a/ports/libmysql/portfile.cmake +++ b/ports/libmysql/portfile.cmake @@ -1,5 +1,6 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Static building not supported yet") + message(STATUS "Warning: Static building not supported yet. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mysql-server-mysql-5.7.16) diff --git a/ports/libuv/portfile.cmake b/ports/libuv/portfile.cmake index bf7e10b55..5f5cd0474 100644 --- a/ports/libuv/portfile.cmake +++ b/ports/libuv/portfile.cmake @@ -1,5 +1,6 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Static building not supported yet") + message(STATUS "Warning: Static building not supported yet. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-src/libuv-1.9.1) diff --git a/ports/libvorbis/portfile.cmake b/ports/libvorbis/portfile.cmake index 15cf48857..66bfca07c 100644 --- a/ports/libvorbis/portfile.cmake +++ b/ports/libvorbis/portfile.cmake @@ -7,7 +7,8 @@ # if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Static building not supported yet") + message(STATUS "Warning: Static building not supported yet. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) find_program(GIT git) diff --git a/ports/libwebsockets/portfile.cmake b/ports/libwebsockets/portfile.cmake index f775692cf..27088bf87 100644 --- a/ports/libwebsockets/portfile.cmake +++ b/ports/libwebsockets/portfile.cmake @@ -1,5 +1,6 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Static building not supported yet") + message(STATUS "Warning: Static building not supported yet. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libwebsockets-2.0.0) diff --git a/ports/mongo-c-driver/portfile.cmake b/ports/mongo-c-driver/portfile.cmake index 7fbd73be1..1aa83f6bb 100644 --- a/ports/mongo-c-driver/portfile.cmake +++ b/ports/mongo-c-driver/portfile.cmake @@ -1,5 +1,6 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Static building not supported yet. Portfile not modified and blocked by libbson.") + message(STATUS "Warning: Static building not supported yet. Building dynamic.") #Blocked by libbson + set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mongo-c-driver-1.4.2) diff --git a/ports/mongo-cxx-driver/portfile.cmake b/ports/mongo-cxx-driver/portfile.cmake index 16a3eb56a..2972f1c5b 100644 --- a/ports/mongo-cxx-driver/portfile.cmake +++ b/ports/mongo-cxx-driver/portfile.cmake @@ -1,5 +1,6 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Static building not supported yet. Portfile not modified and blocked by libbson.") + message(STATUS "Warning: Static building not supported yet. Building dynamic.") #Blocked by libbson + set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mongo-cxx-driver-r3.0.2) diff --git a/ports/mpg123/portfile.cmake b/ports/mpg123/portfile.cmake index 8cf90bc29..0308bb17e 100644 --- a/ports/mpg123/portfile.cmake +++ b/ports/mpg123/portfile.cmake @@ -1,5 +1,6 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Static building not supported yet") + message(STATUS "Warning: Static building not supported yet. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mpg123-1.23.3) diff --git a/ports/mpir/portfile.cmake b/ports/mpir/portfile.cmake index f70ab0ed2..a3a704407 100644 --- a/ports/mpir/portfile.cmake +++ b/ports/mpir/portfile.cmake @@ -1,5 +1,6 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Static building not supported yet") + message(STATUS "Warning: Static building not supported yet. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mpir-2.7.2) diff --git a/ports/nanodbc/portfile.cmake b/ports/nanodbc/portfile.cmake index d3139dec9..fc735f03f 100644 --- a/ports/nanodbc/portfile.cmake +++ b/ports/nanodbc/portfile.cmake @@ -1,5 +1,6 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Static building not supported yet") + message(STATUS "Warning: Static building not supported yet. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/nanodbc-2.12.4) diff --git a/ports/openal-soft/portfile.cmake b/ports/openal-soft/portfile.cmake index 76272937d..bfb8b4ffb 100644 --- a/ports/openal-soft/portfile.cmake +++ b/ports/openal-soft/portfile.cmake @@ -1,5 +1,6 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Static building not supported yet") + message(STATUS "Warning: Static building not supported yet. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/openal-soft-1.17.2) diff --git a/ports/opencv/portfile.cmake b/ports/opencv/portfile.cmake index 3559dcb23..224c99c42 100644 --- a/ports/opencv/portfile.cmake +++ b/ports/opencv/portfile.cmake @@ -1,5 +1,6 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Static building not supported yet. Portfile not modified and blocked by libjpeg-turbo.") + message(STATUS "Warning: Static building not supported yet. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/opencv-92387b1ef8fad15196dd5f7fb4931444a68bc93a) diff --git a/ports/physfs/portfile.cmake b/ports/physfs/portfile.cmake index b4768cc39..082cc7740 100644 --- a/ports/physfs/portfile.cmake +++ b/ports/physfs/portfile.cmake @@ -7,7 +7,8 @@ # if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Static building not supported yet") + message(STATUS "Warning: Static building not supported yet. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/physfs-2.0.3) diff --git a/ports/sdl2/portfile.cmake b/ports/sdl2/portfile.cmake index 3fca78981..9e0957eda 100644 --- a/ports/sdl2/portfile.cmake +++ b/ports/sdl2/portfile.cmake @@ -1,5 +1,6 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Static building not supported yet") + message(STATUS "Warning: Static building not supported yet. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/SDL2-2.0.4) diff --git a/ports/sery/portfile.cmake b/ports/sery/portfile.cmake index 86d76b33d..d6ebad5b6 100644 --- a/ports/sery/portfile.cmake +++ b/ports/sery/portfile.cmake @@ -1,5 +1,6 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - message(FATAL_ERROR "Dynamic building not supported yet") + 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/Sery-1.0") diff --git a/ports/tbb/portfile.cmake b/ports/tbb/portfile.cmake index 752386282..fc761f113 100644 --- a/ports/tbb/portfile.cmake +++ b/ports/tbb/portfile.cmake @@ -7,7 +7,8 @@ # if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Static building not supported yet") + message(STATUS "Warning: Static building not supported yet. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) -- cgit v1.2.3 From e642767c84ce5007660efb622fc7c158540f34d4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 8 Nov 2016 14:45:30 -0800 Subject: Remove triplet inclusion from the template portfile --- scripts/templates/portfile.in.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/templates/portfile.in.cmake b/scripts/templates/portfile.in.cmake index 804d8d216..c848b6445 100644 --- a/scripts/templates/portfile.in.cmake +++ b/scripts/templates/portfile.in.cmake @@ -6,7 +6,6 @@ # CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} # -include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/@ROOT_NAME@) vcpkg_download_distfile(ARCHIVE -- cgit v1.2.3 From 218cae4503749134f4827b3e71fbf22a956d4dc3 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 8 Nov 2016 15:08:42 -0800 Subject: Skip BUILD_INFO file on install --- toolsrc/src/vcpkg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index 00aea1e2e..6e47df2c8 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -158,7 +158,7 @@ static void install_and_write_listfile(const vcpkg_paths& paths, const BinaryPar for (auto it = fs::recursive_directory_iterator(package_prefix_path); it != fs::recursive_directory_iterator(); ++it) { const auto& filename = it->path().filename(); - if (fs::is_regular_file(it->status()) && (filename == "CONTROL" || filename == "control")) + if (fs::is_regular_file(it->status()) && (_stricmp(filename.generic_string().c_str(), "CONTROL") == 0 || _stricmp(filename.generic_string().c_str(), "BUILD_INFO") == 0)) { // Do not copy the control file continue; -- cgit v1.2.3 From 048b4533d04974ac516e956100246ce68ad9cb8e Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 8 Nov 2016 16:05:53 -0800 Subject: [decimal-for-cpp] Minor portfile fixes --- ports/decimal-for-cpp/CONTROL | 2 +- ports/decimal-for-cpp/portfile.cmake | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ports/decimal-for-cpp/CONTROL b/ports/decimal-for-cpp/CONTROL index 40699840c..72f0355f8 100644 --- a/ports/decimal-for-cpp/CONTROL +++ b/ports/decimal-for-cpp/CONTROL @@ -1,4 +1,4 @@ -Source: decimalforcpp +Source: decimal-for-cpp Version:1.12 Description: Decimal data type support, for COBOL-like fixed-point operations on currency values. diff --git a/ports/decimal-for-cpp/portfile.cmake b/ports/decimal-for-cpp/portfile.cmake index 68ce555f8..3ad2aee46 100644 --- a/ports/decimal-for-cpp/portfile.cmake +++ b/ports/decimal-for-cpp/portfile.cmake @@ -11,19 +11,19 @@ include(vcpkg_common_functions) vcpkg_download_distfile(HEADER - URLS "https://github.com/vpiotr/decimal_for_cpp/blob/master/include/decimal.h" + URLS "https://raw.githubusercontent.com/vpiotr/decimal_for_cpp/98287a0f0f48aaed2cc146d7682396ae08ed0aea/include/decimal.h" FILENAME "decimal.h" - SHA512 46e29d76311df74422d240a4fd36e2689a9b58758da0415ef2a19d1703e35476403671f5801ce8665a8802511cec89e44a8868e144cee19986c2881f52ca6965 + SHA512 9de1208760c74ff1e6b1a74957dabae33981d2f5d0ec402b48f27f4dc24c950ea69219a9ee9831959a8669a9c7908093d833a227924f1955cbe444a9f43c5f3a ) vcpkg_download_distfile(LICENSE - URLS "https://github.com/vpiotr/decimal_for_cpp/blob/master/doc/license.txt" - FILENAME "License.txt" - SHA512 8edf6bb6929008e69f4e17727ded4964f6e036ef66c2909c7070b75b14791023a9c7303ac6e61c0cc746649175ff96c0477aa7593c66b64a5f999f37a1cf7a58 + URLS "https://raw.githubusercontent.com/vpiotr/decimal_for_cpp/98287a0f0f48aaed2cc146d7682396ae08ed0aea/doc/license.txt" + FILENAME "decimal-for-cpp-License.txt" + SHA512 0b2be46b07a0536404887fae9665d6532ffd4cbfefbec42926c14e055f538c1f3a73b6e61ab7fa1584e634ad99304133d18855197df0a914cbb835674cc67677 ) -file(COPY ${HEADER} DESTINATION ${CURRENT_PACKAGES_DIR}/include ) -file(COPY ${LICENSE} DESTINATION ${CURRENT_PACKAGES_DIR}/share/decimal-for-cpp ) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/decimal-for-cpp/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/decimal-for-cpp/copyright) +file(COPY ${HEADER} DESTINATION ${CURRENT_PACKAGES_DIR}/include) +file(COPY ${LICENSE} DESTINATION ${CURRENT_PACKAGES_DIR}/share/decimal-for-cpp) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/decimal-for-cpp/decimal-for-cpp-License.txt ${CURRENT_PACKAGES_DIR}/share/decimal-for-cpp/copyright) -- cgit v1.2.3 From 097626c317bdf3efa16073c19aac4d0c226bb1ee Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 8 Nov 2016 19:02:59 -0800 Subject: Use /DEPENDENTS instead of /IMPORTS in applocal.ps1 --- scripts/buildsystems/msbuild/applocal.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/buildsystems/msbuild/applocal.ps1 b/scripts/buildsystems/msbuild/applocal.ps1 index 70528e078..ddb4a07f9 100644 --- a/scripts/buildsystems/msbuild/applocal.ps1 +++ b/scripts/buildsystems/msbuild/applocal.ps1 @@ -5,7 +5,7 @@ function resolve($targetBinary) { $targetBinaryPath = Resolve-Path $targetBinary $targetBinaryDir = Split-Path $targetBinaryPath -parent - $a = $(link /dump /imports $targetBinary | ? { $_ -match "^ [^ ].*\.dll" } | % { $_ -replace "^ ","" }) + $a = $(dumpbin /DEPENDENTS $targetBinary | ? { $_ -match "^ [^ ].*\.dll" } | % { $_ -replace "^ ","" }) $a | % { if (Test-Path "$installedDir\$_") { if (Test-Path "$targetBinaryDir\$_") { -- cgit v1.2.3 From a9d732f206936c82d07f8d4b5ef0aaa461bb2073 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 8 Nov 2016 19:33:50 -0800 Subject: Reorder post-build checks related to lib files --- toolsrc/src/post_build_lint.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index 4b784952a..634e85c05 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -510,6 +510,17 @@ namespace vcpkg error_count += check_for_copyright_file(spec, paths); error_count += check_for_exes(spec, paths); + const std::vector debug_libs = recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "debug" / "lib", ".lib"); + const std::vector release_libs = recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "lib", ".lib"); + + error_count += check_matching_debug_and_release_binaries(debug_libs, release_libs); + + std::vector libs; + libs.insert(libs.cend(), debug_libs.cbegin(), debug_libs.cend()); + libs.insert(libs.cend(), release_libs.cbegin(), release_libs.cend()); + + error_count += check_lib_architecture(spec.target_triplet().architecture(), libs); + switch (linkage_type_value_of(build_info.library_linkage)) { case LinkageType::DYNAMIC: @@ -550,16 +561,6 @@ namespace vcpkg error_count += check_no_subdirectories(paths.packages / spec.dir() / "lib"); error_count += check_no_subdirectories(paths.packages / spec.dir() / "debug" / "lib"); #endif - const std::vector debug_libs = recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "debug" / "lib", ".lib"); - const std::vector release_libs = recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "lib", ".lib"); - - error_count += check_matching_debug_and_release_binaries(debug_libs, release_libs); - - std::vector libs; - libs.insert(libs.cend(), debug_libs.cbegin(), debug_libs.cend()); - libs.insert(libs.cend(), release_libs.cbegin(), release_libs.cend()); - - error_count += check_lib_architecture(spec.target_triplet().architecture(), libs); error_count += check_no_empty_folders(paths.packages / spec.dir()); -- cgit v1.2.3 From 89447c156d3b99ba63499aa4b8f23b985ccd6474 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 9 Nov 2016 01:27:49 -0800 Subject: Add checks for crt linkage (currently disabled) --- toolsrc/include/BuildInfo.h | 36 +++++++++++++ toolsrc/src/BuildInfo.cpp | 72 +++++++++++++++++++++++++ toolsrc/src/post_build_lint.cpp | 116 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 224 insertions(+) diff --git a/toolsrc/include/BuildInfo.h b/toolsrc/include/BuildInfo.h index 2801cf49d..870001474 100644 --- a/toolsrc/include/BuildInfo.h +++ b/toolsrc/include/BuildInfo.h @@ -16,6 +16,42 @@ namespace vcpkg LinkageType linkage_type_value_of(const std::string& as_string); + std::string to_string(const LinkageType& build_info); + + enum class ConfigurationType + { + DEBUG = 1, + RELEASE = 2 + }; + + std::string to_string(const ConfigurationType& conf); + + struct BuildType + { + static BuildType value_of(const ConfigurationType& config, const LinkageType& linkage); + + static const BuildType DEBUG_STATIC; + static const BuildType DEBUG_DYNAMIC; + static const BuildType RELEASE_STATIC; + static const BuildType RELEASE_DYNAMIC; + + const ConfigurationType config; + const LinkageType linkage; + + BuildType() = delete; + + std::string toString() const; + + private: + BuildType(const ConfigurationType& config, const LinkageType& linkage) : config(config), linkage(linkage) + { + } + }; + + bool operator ==(const BuildType& lhs, const BuildType& rhs); + + bool operator !=(const BuildType& lhs, const BuildType& rhs); + struct BuildInfo { static BuildInfo create(const std::unordered_map& pgh); diff --git a/toolsrc/src/BuildInfo.cpp b/toolsrc/src/BuildInfo.cpp index dc8d90e2e..2e74eefc3 100644 --- a/toolsrc/src/BuildInfo.cpp +++ b/toolsrc/src/BuildInfo.cpp @@ -4,6 +4,21 @@ namespace vcpkg { + std::string BuildType::toString() const + { + return Strings::format("[%s,%s]", to_string(config), to_string(linkage)); + } + + bool operator==(const BuildType& lhs, const BuildType& rhs) + { + return lhs.config == rhs.config && lhs.linkage == rhs.linkage; + } + + bool operator!=(const BuildType& lhs, const BuildType& rhs) + { + return !(lhs == rhs); + } + // namespace BuildInfoRequiredField { @@ -20,6 +35,11 @@ namespace vcpkg return build_info; } + const BuildType BuildType::DEBUG_STATIC = BuildType(ConfigurationType::DEBUG, LinkageType::STATIC); + const BuildType BuildType::DEBUG_DYNAMIC = BuildType(ConfigurationType::DEBUG, LinkageType::DYNAMIC); + const BuildType BuildType::RELEASE_STATIC = BuildType(ConfigurationType::RELEASE, LinkageType::STATIC); + const BuildType BuildType::RELEASE_DYNAMIC = BuildType(ConfigurationType::RELEASE, LinkageType::DYNAMIC); + LinkageType linkage_type_value_of(const std::string& as_string) { @@ -36,6 +56,58 @@ namespace vcpkg return LinkageType::UNKNOWN; } + std::string to_string(const LinkageType& build_info) + { + switch (build_info) + { + case LinkageType::STATIC: + return "static"; + case LinkageType::DYNAMIC: + return "dynamic"; + default: + Checks::unreachable(); + } + } + + std::string to_string(const ConfigurationType& conf) + + { + switch (conf) + { + case ConfigurationType::DEBUG: + return "Debug"; + case ConfigurationType::RELEASE: + return "Release"; + default: + Checks::unreachable(); + } + } + + BuildType BuildType::value_of(const ConfigurationType& config, const LinkageType& linkage) + { + if (config == ConfigurationType::DEBUG && linkage == LinkageType::STATIC) + { + return DEBUG_STATIC; + } + + if (config == ConfigurationType::DEBUG && linkage == LinkageType::DYNAMIC) + { + return DEBUG_DYNAMIC; + } + + if (config == ConfigurationType::RELEASE && linkage == LinkageType::STATIC) + { + return RELEASE_STATIC; + } + + if (config == ConfigurationType::RELEASE && linkage == LinkageType::DYNAMIC) + { + return RELEASE_DYNAMIC; + } + + Checks::unreachable(); + } + BuildInfo read_build_info(const fs::path& filepath) { const std::vector> pghs = Paragraphs::get_paragraphs(filepath); diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index 634e85c05..9cd88bff1 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -6,6 +6,7 @@ #include "vcpkg_System.h" #include "coff_file_reader.h" #include "BuildInfo.h" +#include namespace fs = std::tr2::sys; @@ -488,6 +489,116 @@ namespace vcpkg return lint_status::SUCCESS; } + struct BuildInfo_and_files + { + explicit BuildInfo_and_files(const BuildType& build_type) : build_type(build_type) + { + } + + BuildType build_type; + std::vector files; + }; + + static lint_status check_crt_linkage_of_libs(const BuildType& expected_build_type, const std::vector& libs) + { + static const std::regex DEBUG_STATIC_CRT(R"(/DEFAULTLIB:LIBCMTD)"); + static const std::regex DEBUG_DYNAMIC_CRT(R"(/DEFAULTLIB:MSVCRTD)"); + + static const std::regex RELEASE_STATIC_CRT(R"(/DEFAULTLIB:LIBCMT[^D])"); + static const std::regex RELEASE_DYNAMIC_CRT(R"(/DEFAULTLIB:MSVCRT[^D])"); + + lint_status output_status = lint_status::SUCCESS; + + std::vector libs_with_no_crts; + std::vector libs_with_multiple_crts; + + BuildInfo_and_files libs_with_debug_static_crt(BuildType::DEBUG_STATIC); + BuildInfo_and_files libs_with_debug_dynamic_crt(BuildType::DEBUG_DYNAMIC); + BuildInfo_and_files libs_with_release_static_crt(BuildType::RELEASE_STATIC); + BuildInfo_and_files libs_with_release_dynamic_crt(BuildType::RELEASE_DYNAMIC); + + for (const fs::path& lib : libs) + { + const std::wstring cmd_line = Strings::wformat(LR"("%s" /directives "%s")", DUMPBIN_EXE.native(), lib.native()); + System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd_line); + Checks::check_exit(ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line)); + + bool found_debug_static_crt = std::regex_search(ec_data.output.cbegin(), ec_data.output.cend(), DEBUG_STATIC_CRT); + bool found_debug_dynamic_crt = std::regex_search(ec_data.output.cbegin(), ec_data.output.cend(), DEBUG_DYNAMIC_CRT); + bool found_release_static_crt = std::regex_search(ec_data.output.cbegin(), ec_data.output.cend(), RELEASE_STATIC_CRT); + bool found_release_dynamic_crt = std::regex_search(ec_data.output.cbegin(), ec_data.output.cend(), RELEASE_DYNAMIC_CRT); + + const size_t crts_found_count = found_debug_static_crt + found_debug_dynamic_crt + found_release_static_crt + found_release_dynamic_crt; + + if (crts_found_count == 0) + { + libs_with_no_crts.push_back(lib); + continue; + } + + if (crts_found_count > 1) + { + libs_with_multiple_crts.push_back(lib); + continue; + } + + // now we have exactly 1 crt + if (found_debug_static_crt) + { + libs_with_debug_static_crt.files.push_back(lib); + continue; + } + if (found_debug_dynamic_crt) + { + libs_with_debug_dynamic_crt.files.push_back(lib); + continue; + } + + if (found_release_static_crt) + { + libs_with_release_static_crt.files.push_back(lib); + continue; + } + + libs_with_release_dynamic_crt.files.push_back(lib); + } + + if (!libs_with_no_crts.empty()) + { + System::println(System::color::warning, "Could not detect the crt linkage in the following libs:"); + print_vector_of_files(libs_with_no_crts); + output_status = lint_status::ERROR_DETECTED; + } + + if (!libs_with_multiple_crts.empty()) + { + System::println(System::color::warning, "Detected multiple crt linkages for the following libs:"); + print_vector_of_files(libs_with_multiple_crts); + output_status = lint_status::ERROR_DETECTED; + } + + std::vector group_for_iteration = { + libs_with_debug_static_crt, libs_with_debug_dynamic_crt, + libs_with_release_static_crt, libs_with_release_dynamic_crt}; + + for (const BuildInfo_and_files& bif : group_for_iteration) + { + if (!bif.files.empty() && bif.build_type != expected_build_type) + { + System::println(System::color::warning, "Expected %s crt linkage, but the following libs had %s crt linkage:", expected_build_type.toString(), bif.build_type.toString()); + print_vector_of_files(bif.files); + output_status = lint_status::ERROR_DETECTED; + } + } + + if (output_status == lint_status::ERROR_DETECTED) + { + System::println(System::color::warning, "To inspect the lib files, use:\n dumpbin.exe /directives mylibfile.lib"); + } + + return output_status; + } + static void operator +=(size_t& left, const lint_status& right) { left += static_cast(right); @@ -546,6 +657,11 @@ namespace vcpkg error_count += check_no_dlls_present(dlls); error_count += check_bin_folders_are_not_present_in_static_build(spec, paths); + +#if 0 + error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::DEBUG, linkage_type_value_of(build_info.crt_linkage)), debug_libs); + error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::RELEASE, linkage_type_value_of(build_info.crt_linkage)), release_libs); +#endif break; } case LinkageType::UNKNOWN: -- cgit v1.2.3 From 083e0a611f33496714b7e31161887e8026a29411 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 9 Nov 2016 14:46:10 -0800 Subject: [boost] Fix portfile to properly select static library/crt linkage --- ports/boost/portfile.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake index 586f6dfcf..cb4b6a26c 100644 --- a/ports/boost/portfile.cmake +++ b/ports/boost/portfile.cmake @@ -41,13 +41,13 @@ set(B2_OPTIONS if (VCPKG_CRT_LINKAGE STREQUAL dynamic) list(APPEND B2_OPTIONS runtime-link=shared) -elseif() +else() list(APPEND B2_OPTIONS runtime-link=static) endif() if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) list(APPEND B2_OPTIONS link=shared) -elseif() +else() list(APPEND B2_OPTIONS link=static) endif() @@ -109,7 +109,7 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/stage/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/bin FILES_MATCHING PATTERN "*.dll") -elseif() +else() message(STATUS ${VCPKG_LIBRARY_LINKAGE}) endif() message(STATUS "Packaging ${TARGET_TRIPLET}-rel done") @@ -122,7 +122,7 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/stage/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin FILES_MATCHING PATTERN "*.dll") -elseif() +else() message(STATUS ${VCPKG_LIBRARY_LINKAGE}) endif() message(STATUS "Packaging ${TARGET_TRIPLET}-dbg done") -- cgit v1.2.3 From bdcdb4408d9a42fde175ff755b913903b8c414b7 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 9 Nov 2016 15:21:52 -0800 Subject: [qt5] Version bump for plugin changes --- ports/qt5/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/qt5/CONTROL b/ports/qt5/CONTROL index 1629819e8..accc2ba07 100644 --- a/ports/qt5/CONTROL +++ b/ports/qt5/CONTROL @@ -1,4 +1,4 @@ Source: qt5 -Version: 5.7 +Version: 5.7-1 Build-Depends: Description: Qt5 application framework main components. Webengine, examples and tests not included. -- cgit v1.2.3 From 8a03628d9d41382754c17cbc2f0b459a91722044 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 9 Nov 2016 15:40:37 -0800 Subject: [boost] Bump to 1.62-2 after the crt-linkage fix --- ports/boost/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/boost/CONTROL b/ports/boost/CONTROL index 4c4942752..4e8647516 100644 --- a/ports/boost/CONTROL +++ b/ports/boost/CONTROL @@ -1,3 +1,3 @@ Source: boost -Version: 1.62-1 +Version: 1.62-2 Description: Peer-reviewed portable C++ source libraries -- cgit v1.2.3 From cd22281a945cd9d011f6937dfaf62f603c2d2d81 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 9 Nov 2016 15:54:25 -0800 Subject: [boost] Remove unneeded messages from portfile --- ports/boost/portfile.cmake | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake index cb4b6a26c..15a16af04 100644 --- a/ports/boost/portfile.cmake +++ b/ports/boost/portfile.cmake @@ -109,8 +109,6 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/stage/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/bin FILES_MATCHING PATTERN "*.dll") -else() - message(STATUS ${VCPKG_LIBRARY_LINKAGE}) endif() message(STATUS "Packaging ${TARGET_TRIPLET}-rel done") @@ -122,8 +120,6 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/stage/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin FILES_MATCHING PATTERN "*.dll") -else() - message(STATUS ${VCPKG_LIBRARY_LINKAGE}) endif() message(STATUS "Packaging ${TARGET_TRIPLET}-dbg done") -- cgit v1.2.3 From e291ec68456f13af3df7b5616cf32d4674fb289d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 9 Nov 2016 16:42:46 -0800 Subject: [build-checks] Finding no crt is no longer an error --- toolsrc/src/post_build_lint.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index 9cd88bff1..62f97b88e 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -509,7 +509,6 @@ namespace vcpkg lint_status output_status = lint_status::SUCCESS; - std::vector libs_with_no_crts; std::vector libs_with_multiple_crts; BuildInfo_and_files libs_with_debug_static_crt(BuildType::DEBUG_STATIC); @@ -532,7 +531,7 @@ namespace vcpkg if (crts_found_count == 0) { - libs_with_no_crts.push_back(lib); + // It can be valid for no crt to be detected. For example: openssl continue; } @@ -563,13 +562,6 @@ namespace vcpkg libs_with_release_dynamic_crt.files.push_back(lib); } - if (!libs_with_no_crts.empty()) - { - System::println(System::color::warning, "Could not detect the crt linkage in the following libs:"); - print_vector_of_files(libs_with_no_crts); - output_status = lint_status::ERROR_DETECTED; - } - if (!libs_with_multiple_crts.empty()) { System::println(System::color::warning, "Detected multiple crt linkages for the following libs:"); @@ -658,10 +650,8 @@ namespace vcpkg error_count += check_bin_folders_are_not_present_in_static_build(spec, paths); -#if 0 error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::DEBUG, linkage_type_value_of(build_info.crt_linkage)), debug_libs); error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::RELEASE, linkage_type_value_of(build_info.crt_linkage)), release_libs); -#endif break; } case LinkageType::UNKNOWN: -- cgit v1.2.3 From 968fb2768d7ba8ab7c5c5f352cd63d18dcc3bde3 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 9 Nov 2016 17:15:50 -0800 Subject: Rename struct --- toolsrc/src/post_build_lint.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index 62f97b88e..1f1351ffd 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -489,9 +489,9 @@ namespace vcpkg return lint_status::SUCCESS; } - struct BuildInfo_and_files + struct BuildType_and_files { - explicit BuildInfo_and_files(const BuildType& build_type) : build_type(build_type) + explicit BuildType_and_files(const BuildType& build_type) : build_type(build_type) { } @@ -511,10 +511,10 @@ namespace vcpkg std::vector libs_with_multiple_crts; - BuildInfo_and_files libs_with_debug_static_crt(BuildType::DEBUG_STATIC); - BuildInfo_and_files libs_with_debug_dynamic_crt(BuildType::DEBUG_DYNAMIC); - BuildInfo_and_files libs_with_release_static_crt(BuildType::RELEASE_STATIC); - BuildInfo_and_files libs_with_release_dynamic_crt(BuildType::RELEASE_DYNAMIC); + BuildType_and_files libs_with_debug_static_crt(BuildType::DEBUG_STATIC); + BuildType_and_files libs_with_debug_dynamic_crt(BuildType::DEBUG_DYNAMIC); + BuildType_and_files libs_with_release_static_crt(BuildType::RELEASE_STATIC); + BuildType_and_files libs_with_release_dynamic_crt(BuildType::RELEASE_DYNAMIC); for (const fs::path& lib : libs) { @@ -569,11 +569,11 @@ namespace vcpkg output_status = lint_status::ERROR_DETECTED; } - std::vector group_for_iteration = { + std::vector group_for_iteration = { libs_with_debug_static_crt, libs_with_debug_dynamic_crt, libs_with_release_static_crt, libs_with_release_dynamic_crt}; - for (const BuildInfo_and_files& bif : group_for_iteration) + for (const BuildType_and_files& bif : group_for_iteration) { if (!bif.files.empty() && bif.build_type != expected_build_type) { -- cgit v1.2.3 From bf7978dcf962c8ff37b3319121e60eb1629be684 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 9 Nov 2016 18:44:11 -0800 Subject: [post-build-checks] Rework crt linkage checks --- toolsrc/include/BuildInfo.h | 25 +++++++++-- toolsrc/src/BuildInfo.cpp | 31 +++++++++++--- toolsrc/src/post_build_lint.cpp | 94 +++++++++-------------------------------- 3 files changed, 64 insertions(+), 86 deletions(-) diff --git a/toolsrc/include/BuildInfo.h b/toolsrc/include/BuildInfo.h index 870001474..235c83837 100644 --- a/toolsrc/include/BuildInfo.h +++ b/toolsrc/include/BuildInfo.h @@ -2,6 +2,7 @@ #include #include "Paragraphs.h" +#include namespace fs = std::tr2::sys; @@ -35,17 +36,33 @@ namespace vcpkg static const BuildType RELEASE_STATIC; static const BuildType RELEASE_DYNAMIC; - const ConfigurationType config; - const LinkageType linkage; + static constexpr int length() + { + return 4; + } + + static const std::vector& values() + { + static const std::vector v = {DEBUG_STATIC, DEBUG_DYNAMIC, RELEASE_STATIC, RELEASE_DYNAMIC}; + return v; + } BuildType() = delete; - std::string toString() const; + const ConfigurationType& config() const; + const LinkageType& linkage() const; + const std::regex& crt_regex() const; + const std::string& toString() const; private: - BuildType(const ConfigurationType& config, const LinkageType& linkage) : config(config), linkage(linkage) + BuildType(const ConfigurationType& config, const LinkageType& linkage, const std::string& crt_regex_as_string) + : m_config(config), m_linkage(linkage), m_crt_regex_as_string(crt_regex_as_string) { } + + ConfigurationType m_config; + LinkageType m_linkage; + std::string m_crt_regex_as_string; }; bool operator ==(const BuildType& lhs, const BuildType& rhs); diff --git a/toolsrc/src/BuildInfo.cpp b/toolsrc/src/BuildInfo.cpp index 2e74eefc3..4b533ca8f 100644 --- a/toolsrc/src/BuildInfo.cpp +++ b/toolsrc/src/BuildInfo.cpp @@ -4,14 +4,31 @@ namespace vcpkg { - std::string BuildType::toString() const + const ConfigurationType& BuildType::config() const { - return Strings::format("[%s,%s]", to_string(config), to_string(linkage)); + return this->m_config; + } + + const LinkageType& BuildType::linkage() const + { + return this->m_linkage; + } + + const std::regex& BuildType::crt_regex() const + { + static const std::regex r(this->m_crt_regex_as_string); + return r; + } + + const std::string& BuildType::toString() const + { + static const std::string s = Strings::format("[%s,%s]", to_string(this->m_config), to_string(this->m_linkage)); + return s; } bool operator==(const BuildType& lhs, const BuildType& rhs) { - return lhs.config == rhs.config && lhs.linkage == rhs.linkage; + return lhs.config() == rhs.config() && lhs.linkage() == rhs.linkage(); } bool operator!=(const BuildType& lhs, const BuildType& rhs) @@ -35,10 +52,10 @@ namespace vcpkg return build_info; } - const BuildType BuildType::DEBUG_STATIC = BuildType(ConfigurationType::DEBUG, LinkageType::STATIC); - const BuildType BuildType::DEBUG_DYNAMIC = BuildType(ConfigurationType::DEBUG, LinkageType::DYNAMIC); - const BuildType BuildType::RELEASE_STATIC = BuildType(ConfigurationType::RELEASE, LinkageType::STATIC); - const BuildType BuildType::RELEASE_DYNAMIC = BuildType(ConfigurationType::RELEASE, LinkageType::DYNAMIC); + const BuildType BuildType::DEBUG_STATIC = BuildType(ConfigurationType::DEBUG, LinkageType::STATIC, R"(/DEFAULTLIB:LIBCMTD)"); + const BuildType BuildType::DEBUG_DYNAMIC = BuildType(ConfigurationType::DEBUG, LinkageType::DYNAMIC, R"(/DEFAULTLIB:MSVCRTD)"); + const BuildType BuildType::RELEASE_STATIC = BuildType(ConfigurationType::RELEASE, LinkageType::STATIC, R"(/DEFAULTLIB:LIBCMT[^D])"); + const BuildType BuildType::RELEASE_DYNAMIC = BuildType(ConfigurationType::RELEASE, LinkageType::DYNAMIC, R"(/DEFAULTLIB:MSVCRT[^D])"); LinkageType linkage_type_value_of(const std::string& as_string) diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index 1f1351ffd..c7bdf7d21 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -489,32 +489,18 @@ namespace vcpkg return lint_status::SUCCESS; } - struct BuildType_and_files + struct BuildType_and_file { - explicit BuildType_and_files(const BuildType& build_type) : build_type(build_type) - { - } - + fs::path file; BuildType build_type; - std::vector files; }; static lint_status check_crt_linkage_of_libs(const BuildType& expected_build_type, const std::vector& libs) { - static const std::regex DEBUG_STATIC_CRT(R"(/DEFAULTLIB:LIBCMTD)"); - static const std::regex DEBUG_DYNAMIC_CRT(R"(/DEFAULTLIB:MSVCRTD)"); - - static const std::regex RELEASE_STATIC_CRT(R"(/DEFAULTLIB:LIBCMT[^D])"); - static const std::regex RELEASE_DYNAMIC_CRT(R"(/DEFAULTLIB:MSVCRT[^D])"); + std::vector bad_build_types = BuildType::values(); + bad_build_types.erase(std::remove(bad_build_types.begin(), bad_build_types.end(), expected_build_type), bad_build_types.end()); - lint_status output_status = lint_status::SUCCESS; - - std::vector libs_with_multiple_crts; - - BuildType_and_files libs_with_debug_static_crt(BuildType::DEBUG_STATIC); - BuildType_and_files libs_with_debug_dynamic_crt(BuildType::DEBUG_DYNAMIC); - BuildType_and_files libs_with_release_static_crt(BuildType::RELEASE_STATIC); - BuildType_and_files libs_with_release_dynamic_crt(BuildType::RELEASE_DYNAMIC); + std::vector libs_with_invalid_crt; for (const fs::path& lib : libs) { @@ -522,73 +508,31 @@ namespace vcpkg System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd_line); Checks::check_exit(ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line)); - bool found_debug_static_crt = std::regex_search(ec_data.output.cbegin(), ec_data.output.cend(), DEBUG_STATIC_CRT); - bool found_debug_dynamic_crt = std::regex_search(ec_data.output.cbegin(), ec_data.output.cend(), DEBUG_DYNAMIC_CRT); - bool found_release_static_crt = std::regex_search(ec_data.output.cbegin(), ec_data.output.cend(), RELEASE_STATIC_CRT); - bool found_release_dynamic_crt = std::regex_search(ec_data.output.cbegin(), ec_data.output.cend(), RELEASE_DYNAMIC_CRT); - - const size_t crts_found_count = found_debug_static_crt + found_debug_dynamic_crt + found_release_static_crt + found_release_dynamic_crt; - - if (crts_found_count == 0) - { - // It can be valid for no crt to be detected. For example: openssl - continue; - } - - if (crts_found_count > 1) - { - libs_with_multiple_crts.push_back(lib); - continue; - } - - // now we have exactly 1 crt - if (found_debug_static_crt) - { - libs_with_debug_static_crt.files.push_back(lib); - continue; - } - if (found_debug_dynamic_crt) + for (const BuildType& bad_build_type : bad_build_types) { - libs_with_debug_dynamic_crt.files.push_back(lib); - continue; - } - - if (found_release_static_crt) - { - libs_with_release_static_crt.files.push_back(lib); - continue; + if (std::regex_search(ec_data.output.cbegin(), ec_data.output.cend(), bad_build_type.crt_regex())) + { + libs_with_invalid_crt.push_back({lib, bad_build_type}); + break; + } } - - libs_with_release_dynamic_crt.files.push_back(lib); } - if (!libs_with_multiple_crts.empty()) + if (!libs_with_invalid_crt.empty()) { - System::println(System::color::warning, "Detected multiple crt linkages for the following libs:"); - print_vector_of_files(libs_with_multiple_crts); - output_status = lint_status::ERROR_DETECTED; - } - - std::vector group_for_iteration = { - libs_with_debug_static_crt, libs_with_debug_dynamic_crt, - libs_with_release_static_crt, libs_with_release_dynamic_crt}; - - for (const BuildType_and_files& bif : group_for_iteration) - { - if (!bif.files.empty() && bif.build_type != expected_build_type) + System::println(System::color::warning, "Expected %s crt linkage, but the following libs had invalid crt linkage:", expected_build_type.toString()); + System::println(""); + for (const BuildType_and_file btf : libs_with_invalid_crt) { - System::println(System::color::warning, "Expected %s crt linkage, but the following libs had %s crt linkage:", expected_build_type.toString(), bif.build_type.toString()); - print_vector_of_files(bif.files); - output_status = lint_status::ERROR_DETECTED; + System::println(" %s: %s", btf.file.generic_string(), btf.build_type.toString()); } - } + System::println(""); - if (output_status == lint_status::ERROR_DETECTED) - { System::println(System::color::warning, "To inspect the lib files, use:\n dumpbin.exe /directives mylibfile.lib"); + return lint_status::ERROR_DETECTED; } - return output_status; + return lint_status::SUCCESS; } static void operator +=(size_t& left, const lint_status& right) -- cgit v1.2.3 From 6e30c933f16870f84709e46b117b0e253f856135 Mon Sep 17 00:00:00 2001 From: sdcb Date: Thu, 10 Nov 2016 11:13:56 +0800 Subject: [qt5] remove the empty plugins/gamepads folder (which caused a installation failure). --- ports/qt5/portfile.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake index 6b11a8abe..f2e19d4c6 100644 --- a/ports/qt5/portfile.cmake +++ b/ports/qt5/portfile.cmake @@ -144,4 +144,6 @@ vcpkg_execute_required_process( file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5 RENAME copyright) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/plugins/gamepads) + vcpkg_copy_pdbs() -- cgit v1.2.3 From 02b7c87e6e77dde6ade191ee92befba854bd9d07 Mon Sep 17 00:00:00 2001 From: sdcb Date: Thu, 10 Nov 2016 15:48:32 +0800 Subject: [chakracore] Upgrade version to official lastest 1.3.0 --- ports/chakracore/CONTROL | 2 +- ports/chakracore/portfile.cmake | 15 ++++----------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/ports/chakracore/CONTROL b/ports/chakracore/CONTROL index c0ea61800..addb84aa2 100644 --- a/ports/chakracore/CONTROL +++ b/ports/chakracore/CONTROL @@ -1,3 +1,3 @@ Source: chakracore -Version: 1.2.0.0 +Version: 1.3.0 Description: Core part of the Chakra Javascript engine \ No newline at end of file diff --git a/ports/chakracore/portfile.cmake b/ports/chakracore/portfile.cmake index ea4a3d7ff..b937b17b4 100644 --- a/ports/chakracore/portfile.cmake +++ b/ports/chakracore/portfile.cmake @@ -5,21 +5,14 @@ endif() include(vcpkg_common_functions) find_program(POWERSHELL powershell) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ChakraCore-1.2.0.0) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ChakraCore-1.3.0) vcpkg_download_distfile(ARCHIVE_FILE - URLS "https://github.com/Microsoft/ChakraCore/archive/v1.2.0.0.tar.gz" - FILENAME "ChakraCore-1.2.0.0.tar.gz" - SHA512 53e487028a30605a4e2589c40b65da060ca4884617fdba8877557e4db75f911be4433d260132cce3526647622bdc742a0aacda1443a16dfed3d3fdd442539528 + URLS "https://github.com/Microsoft/ChakraCore/archive/v1.3.0.tar.gz" + FILENAME "ChakraCore-1.3.0.tar.gz" + SHA512 d00757e25f5c62bfc29721bd8f715df8dbaf0ac14c1dbdb0735227535cb4f2a209ec3957f24bb6a7e2bced540475bbf3e54712a930fb517fdfd5adb4d56cea07 ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) -message(STATUS "Patching JavascriptPromise.cpp for https://github.com/Microsoft/ChakraCore/issues/1429") -vcpkg_execute_required_process( - COMMAND ${POWERSHELL} -command (gc lib/runtime/library/JavascriptPromise.cpp -encoding utf7) -replace('«', '^<^<') -replace('»', '^>^>') | Set-Content lib/runtime/library/JavascriptPromise.cpp - WORKING_DIRECTORY ${SOURCE_PATH} -) -message(STATUS "Patching done.") - vcpkg_build_msbuild( PROJECT_PATH ${SOURCE_PATH}/Build/Chakra.Core.sln ) -- cgit v1.2.3 From 59a879be2b99dc0e9aff31ce4e2709f533a2f892 Mon Sep 17 00:00:00 2001 From: sdcb Date: Thu, 10 Nov 2016 15:50:57 +0800 Subject: [chakracore] Delete useless code: find_program(powershell). --- ports/chakracore/portfile.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/chakracore/portfile.cmake b/ports/chakracore/portfile.cmake index b937b17b4..bdba23809 100644 --- a/ports/chakracore/portfile.cmake +++ b/ports/chakracore/portfile.cmake @@ -3,7 +3,6 @@ set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) -find_program(POWERSHELL powershell) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ChakraCore-1.3.0) vcpkg_download_distfile(ARCHIVE_FILE -- cgit v1.2.3 From 22f681c82d584a9962a0133ef086326f41df9cc1 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 10 Nov 2016 00:04:44 -0800 Subject: Make crt search case insensitive --- toolsrc/src/BuildInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/BuildInfo.cpp b/toolsrc/src/BuildInfo.cpp index 4b533ca8f..5fcf8ac09 100644 --- a/toolsrc/src/BuildInfo.cpp +++ b/toolsrc/src/BuildInfo.cpp @@ -16,7 +16,7 @@ namespace vcpkg const std::regex& BuildType::crt_regex() const { - static const std::regex r(this->m_crt_regex_as_string); + static const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); return r; } -- cgit v1.2.3 From eb7ca47d4839a6bf8cea36cba8507750cd5d7746 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 10 Nov 2016 11:04:33 -0800 Subject: Add checks for outdated crts --- toolsrc/include/BuildInfo.h | 42 +++++++++++++++++++++++++++++++----- toolsrc/src/BuildInfo.cpp | 21 +++++++++++++++++- toolsrc/src/post_build_lint.cpp | 47 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 104 insertions(+), 6 deletions(-) diff --git a/toolsrc/include/BuildInfo.h b/toolsrc/include/BuildInfo.h index 235c83837..5a85d92d8 100644 --- a/toolsrc/include/BuildInfo.h +++ b/toolsrc/include/BuildInfo.h @@ -36,11 +36,6 @@ namespace vcpkg static const BuildType RELEASE_STATIC; static const BuildType RELEASE_DYNAMIC; - static constexpr int length() - { - return 4; - } - static const std::vector& values() { static const std::vector v = {DEBUG_STATIC, DEBUG_DYNAMIC, RELEASE_STATIC, RELEASE_DYNAMIC}; @@ -69,6 +64,43 @@ namespace vcpkg bool operator !=(const BuildType& lhs, const BuildType& rhs); + struct OutdatedDynamicCrt + { + static const OutdatedDynamicCrt MSVCP100_DLL; + static const OutdatedDynamicCrt MSVCP100D_DLL; + static const OutdatedDynamicCrt MSVCP110_DLL; + static const OutdatedDynamicCrt MSVCP110_WIN_DLL; + static const OutdatedDynamicCrt MSVCP120_DLL; + static const OutdatedDynamicCrt MSVCP120_CLR0400_DLL; + static const OutdatedDynamicCrt MSVCP60_DLL; + static const OutdatedDynamicCrt MSVCP_WIN_DLL; + + static const std::vector& values() + { + static const std::vector v = { + MSVCP100_DLL, MSVCP100D_DLL, + MSVCP110_DLL,MSVCP110_WIN_DLL, + MSVCP120_DLL, MSVCP120_CLR0400_DLL, + MSVCP60_DLL, MSVCP_WIN_DLL + }; + return v; + } + + OutdatedDynamicCrt() = delete; + + const std::regex& crt_regex() const; + const std::string& toString() const; + + private: + explicit OutdatedDynamicCrt(const std::string& dll_name, const std::string& crt_regex_as_string) + : m_dll_name(dll_name), m_crt_regex_as_string(crt_regex_as_string) + { + } + + std::string m_dll_name; + std::string m_crt_regex_as_string; + }; + struct BuildInfo { static BuildInfo create(const std::unordered_map& pgh); diff --git a/toolsrc/src/BuildInfo.cpp b/toolsrc/src/BuildInfo.cpp index 5fcf8ac09..f262df56f 100644 --- a/toolsrc/src/BuildInfo.cpp +++ b/toolsrc/src/BuildInfo.cpp @@ -87,7 +87,6 @@ namespace vcpkg } std::string to_string(const ConfigurationType& conf) - { switch (conf) { @@ -132,4 +131,24 @@ namespace vcpkg return BuildInfo::create(pghs[0]); } + + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP100_DLL = OutdatedDynamicCrt("msvcp100.dll", R"(msvcp100\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP100D_DLL = OutdatedDynamicCrt("msvcp100d.dll", R"(msvcp100d\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP110_DLL = OutdatedDynamicCrt("msvcp110.dll", R"(msvcp110\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP110_WIN_DLL = OutdatedDynamicCrt("msvcp110_win.dll", R"(msvcp110_win\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP120_DLL = OutdatedDynamicCrt("msvcp120.dll", R"(msvcp120\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP120_CLR0400_DLL = OutdatedDynamicCrt("msvcp120_clr0400.dll", R"(msvcp120_clr0400\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP60_DLL = OutdatedDynamicCrt("msvcp60.dll", R"(msvcp60\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP_WIN_DLL = OutdatedDynamicCrt("msvcp60.dll", R"(msvcp60\.dll)");; + + const std::regex& OutdatedDynamicCrt::crt_regex() const + { + static const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); + return r; + } + + const std::string& OutdatedDynamicCrt::toString() const + { + return this->m_dll_name; + } } diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index c7bdf7d21..1a5f22f0a 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -535,6 +535,51 @@ namespace vcpkg return lint_status::SUCCESS; } + struct OutdatedDynamicCrt_and_file + { + fs::path file; + OutdatedDynamicCrt outdated_crt; + }; + + static lint_status check_outdated_crt_linkage_of_dlls(const std::vector& dlls) + { + const std::vector outdated_crts = OutdatedDynamicCrt::values(); + + std::vector dlls_with_outdated_crt; + + for (const fs::path& dll : dlls) + { + const std::wstring cmd_line = Strings::wformat(LR"("%s" /dependents "%s")", DUMPBIN_EXE.native(), dll.native()); + System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd_line); + Checks::check_exit(ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line)); + + for (const OutdatedDynamicCrt& outdated_crt : outdated_crts) + { + if (std::regex_search(ec_data.output.cbegin(), ec_data.output.cend(), outdated_crt.crt_regex())) + { + dlls_with_outdated_crt.push_back({dll, outdated_crt}); + break; + } + } + } + + if (!dlls_with_outdated_crt.empty()) + { + System::println(System::color::warning, "Detected outdated dynamic CRT in the following files:"); + System::println(""); + for (const OutdatedDynamicCrt_and_file btf : dlls_with_outdated_crt) + { + System::println(" %s: %s", btf.file.generic_string(), btf.outdated_crt.toString()); + } + System::println(""); + + System::println(System::color::warning, "To inspect the dll files, use:\n dumpbin.exe /dependents mydllfile.dll"); + return lint_status::ERROR_DETECTED; + } + + return lint_status::SUCCESS; + } + static void operator +=(size_t& left, const lint_status& right) { left += static_cast(right); @@ -584,6 +629,8 @@ namespace vcpkg error_count += check_exports_of_dlls(dlls); error_count += check_uwp_bit_of_dlls(spec.target_triplet().system(), dlls); error_count += check_dll_architecture(spec.target_triplet().architecture(), dlls); + + error_count += check_outdated_crt_linkage_of_dlls(dlls); break; } case LinkageType::STATIC: -- cgit v1.2.3 From 7220f54e302ce4792868c4ff59b8146c54d2e88c Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 10 Nov 2016 11:48:36 -0800 Subject: [vcpkg] Correct unsigned/signed mismatch '<' --- toolsrc/src/vcpkg_Strings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/vcpkg_Strings.cpp b/toolsrc/src/vcpkg_Strings.cpp index c53cba1fc..19ba8595f 100644 --- a/toolsrc/src/vcpkg_Strings.cpp +++ b/toolsrc/src/vcpkg_Strings.cpp @@ -77,7 +77,7 @@ namespace vcpkg {namespace Strings output.append(v.at(0)); - for (int i = 1; i < size; ++i) + for (size_t i = 1; i < size; ++i) { output.append(delimiter); output.append(v.at(i)); -- cgit v1.2.3 From ea6ac1bd453ae940913bff930d88c0240125a0fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Fri, 11 Nov 2016 01:11:31 +0100 Subject: [zeromq] Fix source path --- ports/zeromq/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/zeromq/portfile.cmake b/ports/zeromq/portfile.cmake index f27738488..9abd4ed74 100644 --- a/ports/zeromq/portfile.cmake +++ b/ports/zeromq/portfile.cmake @@ -1,5 +1,5 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libzmq-1a02b1b3f2fde6288579cbb0ff9a0b1f195e1812) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/zeromq-4.2.0) vcpkg_download_distfile(ARCHIVE URLS "https://github.com/zeromq/libzmq/releases/download/v4.2.0/zeromq-4.2.0.tar.gz" FILENAME "zeromq-4.2.0.tar.gz" -- cgit v1.2.3 From 60c61d9305e6e5cddbd130863c2ded67ad7cc0c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Fri, 11 Nov 2016 01:15:14 +0100 Subject: Add /m switch to vcpkg_build_msbuild.cmake (https://github.com/Microsoft/vcpkg/issues/258#issuecomment-259018977) --- scripts/cmake/vcpkg_build_msbuild.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/cmake/vcpkg_build_msbuild.cmake b/scripts/cmake/vcpkg_build_msbuild.cmake index 5b422fe5e..df255c745 100644 --- a/scripts/cmake/vcpkg_build_msbuild.cmake +++ b/scripts/cmake/vcpkg_build_msbuild.cmake @@ -55,6 +55,7 @@ function(vcpkg_build_msbuild) /p:Configuration=${_csc_RELEASE_CONFIGURATION} /p:Platform=${_csc_PLATFORM} /p:VCPkgLocalAppDataDisabled=true + /m WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel LOGNAME build-${TARGET_TRIPLET}-rel ) @@ -66,7 +67,8 @@ function(vcpkg_build_msbuild) /p:Configuration=${_csc_DEBUG_CONFIGURATION} /p:Platform=${_csc_PLATFORM} /p:VCPkgLocalAppDataDisabled=true + /m WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg LOGNAME build-${TARGET_TRIPLET}-dbg ) -endfunction() \ No newline at end of file +endfunction() -- cgit v1.2.3 From 34c585901ed8c32d8c7b1243225c1eee97ab3026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Fri, 11 Nov 2016 01:14:01 +0100 Subject: Add /m switch to vcpkg_install_cmake (https://github.com/Microsoft/vcpkg/issues/258#issuecomment-259839046) --- scripts/cmake/vcpkg_install_cmake.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/cmake/vcpkg_install_cmake.cmake b/scripts/cmake/vcpkg_install_cmake.cmake index 14f1bc94d..30aff0fe1 100644 --- a/scripts/cmake/vcpkg_install_cmake.cmake +++ b/scripts/cmake/vcpkg_install_cmake.cmake @@ -1,7 +1,7 @@ function(vcpkg_install_cmake) message(STATUS "Package ${TARGET_TRIPLET}-rel") vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} --build . --config Release --target install + COMMAND ${CMAKE_COMMAND} --build . --config Release --target install -- /m WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel LOGNAME package-${TARGET_TRIPLET}-rel ) @@ -9,7 +9,7 @@ function(vcpkg_install_cmake) message(STATUS "Package ${TARGET_TRIPLET}-dbg") vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} --build . --config Debug --target install + COMMAND ${CMAKE_COMMAND} --build . --config Debug --target install -- /m WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg LOGNAME package-${TARGET_TRIPLET}-dbg ) -- cgit v1.2.3 From d852d3b6f230a55878d7be26fba210cfc67689d1 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 10 Nov 2016 16:28:10 -0800 Subject: Add more blacklisted outdated crts --- toolsrc/include/BuildInfo.h | 20 +++++++++++++++++++- toolsrc/src/BuildInfo.cpp | 10 ++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/toolsrc/include/BuildInfo.h b/toolsrc/include/BuildInfo.h index 5a85d92d8..22b4bed7d 100644 --- a/toolsrc/include/BuildInfo.h +++ b/toolsrc/include/BuildInfo.h @@ -66,6 +66,7 @@ namespace vcpkg struct OutdatedDynamicCrt { + // Old CPP static const OutdatedDynamicCrt MSVCP100_DLL; static const OutdatedDynamicCrt MSVCP100D_DLL; static const OutdatedDynamicCrt MSVCP110_DLL; @@ -75,13 +76,30 @@ namespace vcpkg static const OutdatedDynamicCrt MSVCP60_DLL; static const OutdatedDynamicCrt MSVCP_WIN_DLL; + // Old C + static const OutdatedDynamicCrt MSVCR100_DLL; + static const OutdatedDynamicCrt MSVCR100D_DLL; + static const OutdatedDynamicCrt MSVCR100_CLR0400_DLL; + static const OutdatedDynamicCrt MSVCR110_DLL; + static const OutdatedDynamicCrt MSVCR120_DLL; + static const OutdatedDynamicCrt MSVCR120_CLR0400_DLL; + static const OutdatedDynamicCrt MSVCRT_DLL; + static const OutdatedDynamicCrt MSVCRT20_DLL; + static const OutdatedDynamicCrt MSVCRT40_DLL; + static const std::vector& values() { static const std::vector v = { MSVCP100_DLL, MSVCP100D_DLL, MSVCP110_DLL,MSVCP110_WIN_DLL, MSVCP120_DLL, MSVCP120_CLR0400_DLL, - MSVCP60_DLL, MSVCP_WIN_DLL + MSVCP60_DLL, + MSVCP_WIN_DLL, + + MSVCR100_DLL, MSVCR100D_DLL, MSVCR100_CLR0400_DLL, + MSVCR110_DLL, + MSVCR120_DLL, MSVCR120_CLR0400_DLL, + MSVCRT_DLL, MSVCRT20_DLL,MSVCRT40_DLL }; return v; } diff --git a/toolsrc/src/BuildInfo.cpp b/toolsrc/src/BuildInfo.cpp index f262df56f..1f802869f 100644 --- a/toolsrc/src/BuildInfo.cpp +++ b/toolsrc/src/BuildInfo.cpp @@ -141,6 +141,16 @@ namespace vcpkg const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP60_DLL = OutdatedDynamicCrt("msvcp60.dll", R"(msvcp60\.dll)"); const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP_WIN_DLL = OutdatedDynamicCrt("msvcp60.dll", R"(msvcp60\.dll)");; + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR100_DLL = OutdatedDynamicCrt("msvcr100.dll", R"(msvcr100\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR100D_DLL = OutdatedDynamicCrt("msvcr100d.dll", R"(msvcr100d\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR100_CLR0400_DLL = OutdatedDynamicCrt("msvcr100_clr0400.dll", R"(msvcr100_clr0400\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR110_DLL = OutdatedDynamicCrt("msvcr110.dll", R"(msvcr110\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR120_DLL = OutdatedDynamicCrt("msvcr120.dll", R"(msvcr120\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR120_CLR0400_DLL = OutdatedDynamicCrt("msvcr120_clr0400.dll", R"(msvcr120_clr0400\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCRT_DLL = OutdatedDynamicCrt("msvcrt.dll", R"(msvcrt\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCRT20_DLL = OutdatedDynamicCrt("msvcrt20.dll", R"(msvcrt20\.dll)");; + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCRT40_DLL = OutdatedDynamicCrt("msvcrt40.dll", R"(msvcrt40\.dll)");; + const std::regex& OutdatedDynamicCrt::crt_regex() const { static const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); -- cgit v1.2.3 From bb0fc030d5ea0c0d872b0446e43e28ae927d6885 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 10 Nov 2016 17:52:19 -0800 Subject: [tiff] Disable non-essential components. Fixes #259. --- ports/tiff/add-component-options.patch | 43 ++++++++++++++++++++++++++++++++++ ports/tiff/portfile.cmake | 28 ++++++++++------------ 2 files changed, 56 insertions(+), 15 deletions(-) create mode 100644 ports/tiff/add-component-options.patch diff --git a/ports/tiff/add-component-options.patch b/ports/tiff/add-component-options.patch new file mode 100644 index 000000000..513d37ad6 --- /dev/null +++ b/ports/tiff/add-component-options.patch @@ -0,0 +1,43 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1ee6fd4..439e26a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -122,6 +122,11 @@ set(EXTRA_DIST + nmake.opt + libtiff-4.pc.in) + ++option(BUILD_TOOLS "Build tool executables" ON) ++option(BUILD_DOCS "Build docs" ON) ++option(BUILD_CONTRIB "Build contributed executables" ON) ++option(BUILD_TESTS "Build tests" ON) ++ + # These are annoyingly verbose, produce false positives or don't work + # nicely with all supported compiler versions, so are disabled unless + # explicitly enabled. +@@ -719,12 +724,20 @@ endif() + # Process subdirectories + add_subdirectory(port) + add_subdirectory(libtiff) +-add_subdirectory(tools) +-add_subdirectory(test) +-add_subdirectory(contrib) +-add_subdirectory(build) +-add_subdirectory(man) +-add_subdirectory(html) ++if(BUILD_TOOLS) ++ add_subdirectory(tools) ++endif() ++if(BUILD_TESTS) ++ add_subdirectory(test) ++endif() ++if(BUILD_CONTRIB) ++ add_subdirectory(contrib) ++endif() ++if(BUILD_DOCS) ++ add_subdirectory(build) ++ add_subdirectory(man) ++ add_subdirectory(html) ++endif() + + #message(STATUS "EXTRA_DIST: ${EXTRA_DIST}") + diff --git a/ports/tiff/portfile.cmake b/ports/tiff/portfile.cmake index 6a6701caa..f9137601a 100644 --- a/ports/tiff/portfile.cmake +++ b/ports/tiff/portfile.cmake @@ -7,9 +7,19 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES add-component-options.patch +) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} - OPTIONS -Dcxx=OFF + OPTIONS + -Dcxx=OFF + -DBUILD_TOOLS=OFF + -DBUILD_DOCS=OFF + -DBUILD_CONTRIB=OFF + -DBUILD_TESTS=OFF ) vcpkg_install_cmake() @@ -19,22 +29,10 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share ${CURRENT_PACKAGES_DIR}/share ) -file(COPY +file(INSTALL ${SOURCE_PATH}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/tiff + RENAME copyright ) -file(RENAME - ${CURRENT_PACKAGES_DIR}/share/tiff/COPYRIGHT - ${CURRENT_PACKAGES_DIR}/share/tiff/c2 -) -file(RENAME - ${CURRENT_PACKAGES_DIR}/share/tiff/c2 - ${CURRENT_PACKAGES_DIR}/share/tiff/copyright -) -file(GLOB EXES ${CURRENT_PACKAGES_DIR}/bin/*.exe ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe) -file(REMOVE ${EXES}) -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) -endif() vcpkg_copy_pdbs() -- cgit v1.2.3 From b56819ec88f85d401160197b578b508916ac9962 Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Thu, 10 Nov 2016 22:04:45 -0500 Subject: fixed fmt port --- ports/fmt/portfile.cmake | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/ports/fmt/portfile.cmake b/ports/fmt/portfile.cmake index 6f9f42231..471fab2d2 100644 --- a/ports/fmt/portfile.cmake +++ b/ports/fmt/portfile.cmake @@ -1,7 +1,7 @@ -if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - message(STATUS "Warning: Dynamic building not supported yet. Building static.") - set(VCPKG_LIBRARY_LINKAGE static) -endif() +#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/fmt-3.0.0) vcpkg_download_distfile(ARCHIVE_FILE @@ -14,6 +14,7 @@ vcpkg_extract_source_archive(${ARCHIVE_FILE}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS + -DFMT_CMAKE_DIR=share/fmt -DFMT_TEST=OFF -DFMT_DOC=OFF ) @@ -21,16 +22,20 @@ vcpkg_configure_cmake( vcpkg_install_cmake() file(INSTALL ${SOURCE_PATH}/LICENSE.rst DESTINATION ${CURRENT_PACKAGES_DIR}/share/fmt RENAME copyright) +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin) + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) + file(RENAME ${CURRENT_PACKAGES_DIR}/lib/fmt.dll ${CURRENT_PACKAGES_DIR}/bin/fmt.dll) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fmt.dll ${CURRENT_PACKAGES_DIR}/debug/bin/fmt.dll) + +endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE ${CURRENT_PACKAGES_DIR}/include/fmt/format.cc) file(REMOVE ${CURRENT_PACKAGES_DIR}/include/fmt/ostream.cc) -file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake/fmt/fmt-config-version.cmake ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-config-version.cmake) -file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake/fmt/fmt-config.cmake ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-config.cmake) -file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake/fmt/fmt-targets-release.cmake ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-release.cmake) -file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake/fmt/fmt-targets.cmake ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets.cmake) -file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/cmake) -file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/cmake/fmt/fmt-targets.cmake ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/cmake) +file(RENAME ${CURRENT_PACKAGES_DIR}/debug/share/fmt/fmt-targets-debug.cmake ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake) +file(READ ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake FMT_DEBUG_MODULE) +string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" FMT_DEBUG_MODULE "${FMT_DEBUG_MODULE}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake "${FMT_DEBUG_MODULE}") +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) vcpkg_copy_pdbs() -- cgit v1.2.3 From ae5db90ff2736ec15482db8fbbd34438f9a0f2df Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Thu, 10 Nov 2016 19:42:23 +0100 Subject: Add Templatized C++ Command Line Parser (TCLAP) header-only library port --- ports/tclap/CONTROL | 3 +++ ports/tclap/portfile.cmake | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 ports/tclap/CONTROL create mode 100644 ports/tclap/portfile.cmake diff --git a/ports/tclap/CONTROL b/ports/tclap/CONTROL new file mode 100644 index 000000000..1e086a845 --- /dev/null +++ b/ports/tclap/CONTROL @@ -0,0 +1,3 @@ +Source: tclap +Version: 1.2.1 +Description: Templatized command-line argument parser for C++ diff --git a/ports/tclap/portfile.cmake b/ports/tclap/portfile.cmake new file mode 100644 index 000000000..8f41d076f --- /dev/null +++ b/ports/tclap/portfile.cmake @@ -0,0 +1,18 @@ +#header-only library +include(vcpkg_common_functions) +set(SOURCE_PATH "${CURRENT_BUILDTREES_DIR}/src/tclap-1.2.1") +vcpkg_download_distfile(ARCHIVE + URLS "http://downloads.sourceforge.net/project/tclap/tclap-1.2.1.tar.gz" + FILENAME "tclap-1.2.1.tar.gz" + SHA512 8bd6ee724600880840048c7b36f02d31b1aa4910b17f80fb04aef89b1f1917856d9979ec488edbd457b66d9d689aea97540abb842a8b902bbd75c66a6e07b9b1 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +# Copy all header files +file(COPY "${SOURCE_PATH}/include/tclap" + DESTINATION "${CURRENT_PACKAGES_DIR}/include" + FILES_MATCHING PATTERN "*.h") + +# Handle copyright +file(COPY "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/tclap") +file(RENAME "${CURRENT_PACKAGES_DIR}/share/tclap/COPYING" "${CURRENT_PACKAGES_DIR}/share/tclap/copyright") -- cgit v1.2.3 From 981ea2799eeb197d0c3c386479b734f09e6b724f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Fri, 11 Nov 2016 12:29:12 +0100 Subject: Fix tiff patch path --- ports/tiff/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/tiff/portfile.cmake b/ports/tiff/portfile.cmake index f9137601a..345024fe0 100644 --- a/ports/tiff/portfile.cmake +++ b/ports/tiff/portfile.cmake @@ -9,7 +9,7 @@ vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} - PATCHES add-component-options.patch + PATCHES ${CMAKE_CURRENT_LIST_DIR}/add-component-options.patch ) vcpkg_configure_cmake( -- cgit v1.2.3 From 637dac384c66096ae9b4f2b0b78abd22edb338e3 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 11 Nov 2016 16:17:39 -0800 Subject: [vcpkg-cmake-toolchain] Avoid IN_LIST to reduce required cmake version --- scripts/buildsystems/vcpkg.cmake | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 257007e45..6384de7d3 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -53,13 +53,14 @@ if(NOT VCPKG_TOOLCHAIN) if(OVERRIDE_ADD_EXECUTABLE) function(add_executable name) _add_executable(${ARGV}) - if(NOT "IMPORTED" IN_LIST ARGV) - add_custom_command(TARGET ${name} POST_BUILD - COMMAND powershell -noprofile -executionpolicy UnRestricted -file ${_VCPKG_TOOLCHAIN_DIR}/msbuild/applocal.ps1 - -targetBinary $ - -installedDir "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$:/debug>/bin" - -OutVariable out - ) + list(FIND ARGV "IMPORTED" IMPORTED_IDX) + if(IMPORTED_IDX EQUAL -1) + add_custom_command(TARGET ${name} POST_BUILD + COMMAND powershell -noprofile -executionpolicy UnRestricted -file ${_VCPKG_TOOLCHAIN_DIR}/msbuild/applocal.ps1 + -targetBinary $ + -installedDir "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$:/debug>/bin" + -OutVariable out + ) endif() endfunction() endif() -- cgit v1.2.3 From f6bbbfd4d4cc4834371abfd04aa12bda581c0c90 Mon Sep 17 00:00:00 2001 From: David Ludwig Date: Sat, 12 Nov 2016 15:32:30 -0500 Subject: Update SDL2 port to 2.0.5 (its latest release; up from 2.0.4) --- ports/sdl2/CONTROL | 2 +- ports/sdl2/portfile.cmake | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/sdl2/CONTROL b/ports/sdl2/CONTROL index 5a05183f2..7f10c1954 100644 --- a/ports/sdl2/CONTROL +++ b/ports/sdl2/CONTROL @@ -1,3 +1,3 @@ Source: sdl2 -Version: 2.0.4 +Version: 2.0.5 Description: Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. \ No newline at end of file diff --git a/ports/sdl2/portfile.cmake b/ports/sdl2/portfile.cmake index 9e0957eda..6fcb94c8b 100644 --- a/ports/sdl2/portfile.cmake +++ b/ports/sdl2/portfile.cmake @@ -3,11 +3,11 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/SDL2-2.0.4) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/SDL2-2.0.5) vcpkg_download_distfile(ARCHIVE_FILE - URLS "http://libsdl.org/release/SDL2-2.0.4.tar.gz" - FILENAME "SDL2-2.0.4.tar.gz" - SHA512 dd0a95878639856c0f4b8a579ace8071379ab64519fa139b22d3ed857a0f0db87a75bc8480c7207e02fbffd1fdbd448e3c0b882c451675b0e2f1a945af02e1d6 + URLS "http://libsdl.org/release/SDL2-2.0.5.tar.gz" + FILENAME "SDL2-2.0.5.tar.gz" + SHA512 6401f5df08c08316c09bc6ac5b28345c5184bb25770baa5c94c0a582ae130ddf73bb736e44bb31f4e427c1ddbbeec4755a6a5f530b6b4c3d0f13ebc78ddc1750 ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) -- cgit v1.2.3 From df207430c90ee56a2277525a2fd879bc27f628e8 Mon Sep 17 00:00:00 2001 From: John Camp Date: Sun, 13 Nov 2016 12:36:55 -0500 Subject: Remove unused cmake variable --- ports/pdcurses/portfile.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/pdcurses/portfile.cmake b/ports/pdcurses/portfile.cmake index 8ba0f99ba..ab5a14e2e 100644 --- a/ports/pdcurses/portfile.cmake +++ b/ports/pdcurses/portfile.cmake @@ -17,7 +17,6 @@ vcpkg_extract_source_archive(${ARCHIVE}) set(PDC_NMAKE_CMD ${NMAKE} -f vcwin32.mak WIDE=Y UTF8=Y) set(PDC_NMAKE_CWD ${SOURCE_PATH}/win32) set(PDC_PDCLIB ${SOURCE_PATH}/win32/pdcurses) -set(PDC_OUTPUT bin) if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") set(PDC_NMAKE_CMD ${PDC_NMAKE_CMD} DLL=Y) -- cgit v1.2.3 From 64808e17fe6e02e9a86412491c72a9619dccba8a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 14 Nov 2016 00:43:47 -0800 Subject: [boost] Add renaming code for static libs (commented-out for now) --- ports/boost/portfile.cmake | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake index 15a16af04..75a388956 100644 --- a/ports/boost/portfile.cmake +++ b/ports/boost/portfile.cmake @@ -109,6 +109,15 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/stage/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/bin FILES_MATCHING PATTERN "*.dll") +else() + # file(GLOB RELEASE_LIBS ${CURRENT_PACKAGES_DIR}/lib/libboost*.lib) + # foreach(LIB ${RELEASE_LIBS}) + # get_filename_component(OLD_FILENAME ${LIB} NAME) + # get_filename_component(DIRECTORY_OF_LIB_FILE ${LIB} DIRECTORY) + # string(REPLACE "libboost_" "boost_" NEW_FILENAME ${OLD_FILENAME}) + # string(REPLACE "-s-" "-" NEW_FILENAME ${NEW_FILENAME}) + # file(RENAME ${DIRECTORY_OF_LIB_FILE}/${OLD_FILENAME} ${DIRECTORY_OF_LIB_FILE}/${NEW_FILENAME}) + # endforeach() endif() message(STATUS "Packaging ${TARGET_TRIPLET}-rel done") @@ -120,6 +129,15 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/stage/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin FILES_MATCHING PATTERN "*.dll") +else() + # file(GLOB DEBUG_LIBS ${CURRENT_PACKAGES_DIR}/debug/lib/libboost*.lib) + # foreach(LIB ${DEBUG_LIBS}) + # get_filename_component(OLD_FILENAME ${LIB} NAME) + # get_filename_component(DIRECTORY_OF_LIB_FILE ${LIB} DIRECTORY) + # string(REPLACE "libboost_" "boost_" NEW_FILENAME ${OLD_FILENAME}) + # string(REPLACE "-sgd-" "-gd-" NEW_FILENAME ${NEW_FILENAME}) + # file(RENAME ${DIRECTORY_OF_LIB_FILE}/${OLD_FILENAME} ${DIRECTORY_OF_LIB_FILE}/${NEW_FILENAME}) + # endforeach() endif() message(STATUS "Packaging ${TARGET_TRIPLET}-dbg done") -- cgit v1.2.3 From 202c113a7cdd917a4c90ef0b5b973cda1a985dca Mon Sep 17 00:00:00 2001 From: sdcb Date: Mon, 14 Nov 2016 17:37:16 +0800 Subject: Fix xinputgamepadd.dll directory issue. --- ports/qt5/portfile.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake index f2e19d4c6..84d640a86 100644 --- a/ports/qt5/portfile.cmake +++ b/ports/qt5/portfile.cmake @@ -130,6 +130,12 @@ foreach(file ${DEBUG_PLUGINS}) file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/plugins/${rel_dir}") file(RENAME ${file} "${CURRENT_PACKAGES_DIR}/debug/plugins/${rel_dir}/${file_n}") endforeach() +file(RENAME + ${CURRENT_PACKAGES_DIR}/debug/plugins/gamepads/xinputgamepadd.dll + ${CURRENT_PACKAGES_DIR}/plugins/gamepads/xinputgamepad.dll) +file(RENAME + ${CURRENT_PACKAGES_DIR}/debug/plugins/gamepads/xinputgamepadd.pdb + ${CURRENT_PACKAGES_DIR}/plugins/gamepads/xinputgamepad.pdb) if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL dynamic) file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/bin/*.dll") @@ -144,6 +150,4 @@ vcpkg_execute_required_process( file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5 RENAME copyright) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/plugins/gamepads) - vcpkg_copy_pdbs() -- cgit v1.2.3 From daa83822085ee79eec3f68d5111f11457972267e Mon Sep 17 00:00:00 2001 From: sdcb Date: Mon, 14 Nov 2016 17:39:22 +0800 Subject: Fix the xinputgamepad.dll directory issue. --- ports/qt5/portfile.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake index 84d640a86..85ebb107b 100644 --- a/ports/qt5/portfile.cmake +++ b/ports/qt5/portfile.cmake @@ -131,10 +131,10 @@ foreach(file ${DEBUG_PLUGINS}) file(RENAME ${file} "${CURRENT_PACKAGES_DIR}/debug/plugins/${rel_dir}/${file_n}") endforeach() file(RENAME - ${CURRENT_PACKAGES_DIR}/debug/plugins/gamepads/xinputgamepadd.dll + ${CURRENT_PACKAGES_DIR}/debug/plugins/gamepads/xinputgamepad.dll ${CURRENT_PACKAGES_DIR}/plugins/gamepads/xinputgamepad.dll) file(RENAME - ${CURRENT_PACKAGES_DIR}/debug/plugins/gamepads/xinputgamepadd.pdb + ${CURRENT_PACKAGES_DIR}/debug/plugins/gamepads/xinputgamepad.pdb ${CURRENT_PACKAGES_DIR}/plugins/gamepads/xinputgamepad.pdb) if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL dynamic) -- cgit v1.2.3 From abe8d017dfb40c97451e493aa569c8178b8f10e2 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 14 Nov 2016 15:47:53 +0100 Subject: [glfw3] Fix paths in cmake config files --- ports/glfw3/portfile.cmake | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ports/glfw3/portfile.cmake b/ports/glfw3/portfile.cmake index 3f834f9b6..8ec382fda 100644 --- a/ports/glfw3/portfile.cmake +++ b/ports/glfw3/portfile.cmake @@ -34,7 +34,13 @@ vcpkg_install_cmake() file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake/glfw3 ${CURRENT_PACKAGES_DIR}/share/glfw3) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/cmake) -file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/cmake/glfw3/glfw3Targets-debug.cmake ${CURRENT_PACKAGES_DIR}/share/glfw3/glfw3Targets-debug.cmake) +file(READ ${CURRENT_PACKAGES_DIR}/share/glfw3/glfw3Targets.cmake _contents) +string(REPLACE "get_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)\n\n" "\n" _contents "${_contents}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/glfw3/glfw3Targets.cmake ${_contents}) + +file(READ ${CURRENT_PACKAGES_DIR}/debug/lib/cmake/glfw3/glfw3Targets-debug.cmake _contents) +string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" _contents "${_contents}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/glfw3/glfw3Targets-debug.cmake "${_contents}") file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) @@ -43,6 +49,13 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) file(RENAME ${CURRENT_PACKAGES_DIR}/lib/glfw3.dll ${CURRENT_PACKAGES_DIR}/bin/glfw3.dll) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/glfw3.dll ${CURRENT_PACKAGES_DIR}/debug/bin/glfw3.dll) + foreach(_conf release + debug) + file(READ ${CURRENT_PACKAGES_DIR}/share/glfw3/glfw3Targets-${_conf}.cmake _contents) + string(REPLACE "lib/glfw3.dll" "bin/glfw3.dll" _contents "${_contents}") + file(WRITE ${CURRENT_PACKAGES_DIR}/share/glfw3/glfw3Targets-${_conf}.cmake "${_contents}") + endforeach() + endif() file(COPY ${SOURCE_PATH}/COPYING.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/glfw3) -- cgit v1.2.3 From 13645a66b8610ab39997f968b95c3c142719e906 Mon Sep 17 00:00:00 2001 From: sdcb Date: Tue, 15 Nov 2016 14:10:11 +0800 Subject: Add signalrclient. --- ports/signalrclient/0001_cmake.patch | 47 ++++++++++++++++++++++++++++++++++++ ports/signalrclient/CONTROL | 4 +++ ports/signalrclient/portfile.cmake | 34 ++++++++++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 ports/signalrclient/0001_cmake.patch create mode 100644 ports/signalrclient/CONTROL create mode 100644 ports/signalrclient/portfile.cmake diff --git a/ports/signalrclient/0001_cmake.patch b/ports/signalrclient/0001_cmake.patch new file mode 100644 index 000000000..0177d5d9b --- /dev/null +++ b/ports/signalrclient/0001_cmake.patch @@ -0,0 +1,47 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0d78e1c..c952b2f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -16,4 +16,21 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) + + add_subdirectory(src/signalrclient) +-add_subdirectory(test) ++#add_subdirectory(test) ++ ++set(HEADERS ++ include/signalrclient/_exports.h ++ include/signalrclient/connection.h ++ include/signalrclient/connection_state.h ++ include/signalrclient/hub_connection.h ++ include/signalrclient/hub_exception.h ++ include/signalrclient/hub_proxy.h ++ include/signalrclient/log_writer.h ++ include/signalrclient/trace_level.h ++ include/signalrclient/transport_type.h ++ include/signalrclient/web_exception.h) ++ ++install( ++ FILES ${HEADERS} ++ DESTINATION "include/signalrclient" ++) +\ No newline at end of file +diff --git a/src/signalrclient/CMakeLists.txt b/src/signalrclient/CMakeLists.txt +index 76a5e1b..47e7dc3 100644 +--- a/src/signalrclient/CMakeLists.txt ++++ b/src/signalrclient/CMakeLists.txt +@@ -24,4 +24,13 @@ set (SOURCES + + add_library (signalrclient SHARED ${SOURCES}) + ++add_definitions(-DUNICODE -D_UNICODE) ++ + target_link_libraries(signalrclient ${CPPREST_SO}) ++ ++install( ++ TARGETS signalrclient ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib ++ RUNTIME DESTINATION bin ++) +\ No newline at end of file diff --git a/ports/signalrclient/CONTROL b/ports/signalrclient/CONTROL new file mode 100644 index 000000000..a5673e964 --- /dev/null +++ b/ports/signalrclient/CONTROL @@ -0,0 +1,4 @@ +Source: signalrclient +Version: 1.0.0-beta1 +Build-Depends: cpprestsdk +Description: C++ client for SignalR. \ No newline at end of file diff --git a/ports/signalrclient/portfile.cmake b/ports/signalrclient/portfile.cmake new file mode 100644 index 000000000..4b4fc3344 --- /dev/null +++ b/ports/signalrclient/portfile.cmake @@ -0,0 +1,34 @@ +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(STATUS "Warning: Static building not supported yet. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) +endif() +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/SignalR-Client-Cpp-1.0.0-beta1) + +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/aspnet/SignalR-Client-Cpp/archive/1.0.0-beta1.tar.gz" + FILENAME "SignalR-Client-Cpp-1.0.0-beta1.tar.gz" + SHA512 e0090415aa724087dbe2a317a4642d6359b134e00e836ea70c71bc9186dc8d6bba097666711ab18d9b0a390e1e5f59be2f55279b6859ac20d558b901bf5fe2f2 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/0001_cmake.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DCPPREST_SO=${CURRENT_INSTALLED_DIR}/lib/cpprest_2_9.lib + -DCPPREST_INCLUDE_DIR=${CURRENT_INSTALLED_DIR}/include +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# copy license +file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/signalrclient) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/signalrclient/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/signalrclient/copyright) \ No newline at end of file -- cgit v1.2.3 From 10f140355596d6fc134bfb28bed257d6461866d3 Mon Sep 17 00:00:00 2001 From: John Camp Date: Tue, 15 Nov 2016 14:33:02 -0500 Subject: Adds PDBs and 64-bit builds to PDCurses --- ports/pdcurses/portfile.cmake | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ports/pdcurses/portfile.cmake b/ports/pdcurses/portfile.cmake index ab5a14e2e..658e4ed19 100644 --- a/ports/pdcurses/portfile.cmake +++ b/ports/pdcurses/portfile.cmake @@ -1,8 +1,4 @@ -if(VCPKG_TARGET_ARCHITECTURE STREQUAL x64) - message(FATAL_ERROR "64-bit builds are not supported for PDCurses.") -endif() - include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src) find_program(NMAKE nmake) @@ -14,10 +10,16 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) -set(PDC_NMAKE_CMD ${NMAKE} -f vcwin32.mak WIDE=Y UTF8=Y) +set(PDC_NMAKE_CMD ${NMAKE} /A -f vcwin32.mak WIDE=Y UTF8=Y) set(PDC_NMAKE_CWD ${SOURCE_PATH}/win32) set(PDC_PDCLIB ${SOURCE_PATH}/win32/pdcurses) +file(READ ${SOURCE_PATH}/win32/vcwin32.mak PDC_MAK) +string(REPLACE "-Z7" "-ZI -Fdpdcurses.pdb" PDC_MAK ${PDC_MAK}) +string(REPLACE " -pdb:none" "" PDC_MAK ${PDC_MAK}) +string(REPLACE "/MACHINE:IX86 " "" PDC_MAK ${PDC_MAK}) +file(WRITE ${SOURCE_PATH}/win32/vcwin32.mak ${PDC_MAK}) + if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") set(PDC_NMAKE_CMD ${PDC_NMAKE_CMD} DLL=Y) endif() -- cgit v1.2.3 From 51b98484d751aabf48842dbdd92158ebb1b740d1 Mon Sep 17 00:00:00 2001 From: John Camp Date: Tue, 15 Nov 2016 14:50:38 -0500 Subject: Write to and use separate .mak file Allows future changes to not be affected by cached buildtree --- ports/pdcurses/portfile.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/pdcurses/portfile.cmake b/ports/pdcurses/portfile.cmake index 658e4ed19..93cc146f7 100644 --- a/ports/pdcurses/portfile.cmake +++ b/ports/pdcurses/portfile.cmake @@ -10,7 +10,7 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) -set(PDC_NMAKE_CMD ${NMAKE} /A -f vcwin32.mak WIDE=Y UTF8=Y) +set(PDC_NMAKE_CMD ${NMAKE} /A -f vcpkg.mak WIDE=Y UTF8=Y) set(PDC_NMAKE_CWD ${SOURCE_PATH}/win32) set(PDC_PDCLIB ${SOURCE_PATH}/win32/pdcurses) @@ -18,7 +18,7 @@ file(READ ${SOURCE_PATH}/win32/vcwin32.mak PDC_MAK) string(REPLACE "-Z7" "-ZI -Fdpdcurses.pdb" PDC_MAK ${PDC_MAK}) string(REPLACE " -pdb:none" "" PDC_MAK ${PDC_MAK}) string(REPLACE "/MACHINE:IX86 " "" PDC_MAK ${PDC_MAK}) -file(WRITE ${SOURCE_PATH}/win32/vcwin32.mak ${PDC_MAK}) +file(WRITE ${SOURCE_PATH}/win32/vcpkg.mak ${PDC_MAK}) if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") set(PDC_NMAKE_CMD ${PDC_NMAKE_CMD} DLL=Y) -- cgit v1.2.3 From a72be4b6b9b63a7a11f507782c1c26fdd2b18ad0 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 15 Nov 2016 11:54:02 -0800 Subject: [boost] The #define BOOST_ALL_DYN_LINK should be added only in dynamic linkage --- ports/boost/CONTROL | 2 +- ports/boost/portfile.cmake | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ports/boost/CONTROL b/ports/boost/CONTROL index 4e8647516..5d074197e 100644 --- a/ports/boost/CONTROL +++ b/ports/boost/CONTROL @@ -1,3 +1,3 @@ Source: boost -Version: 1.62-2 +Version: 1.62-3 Description: Peer-reviewed portable C++ source libraries diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake index 75a388956..5f9b29c32 100644 --- a/ports/boost/portfile.cmake +++ b/ports/boost/portfile.cmake @@ -90,14 +90,14 @@ message(STATUS "Packaging headers") file( COPY ${SOURCE_PATH}/boost DESTINATION ${CURRENT_PACKAGES_DIR}/include - PATTERN "config/user.hpp" EXCLUDE -) -file(COPY ${SOURCE_PATH}/boost/config/user.hpp - DESTINATION ${CURRENT_PACKAGES_DIR}/include/boost/config/ -) -file(APPEND ${CURRENT_PACKAGES_DIR}/include/boost/config/user.hpp - "\n#define BOOST_ALL_DYN_LINK\n" ) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(APPEND ${CURRENT_PACKAGES_DIR}/include/boost/config/user.hpp + "\n#define BOOST_ALL_DYN_LINK\n" + ) +endif() + file(INSTALL ${SOURCE_PATH}/LICENSE_1_0.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/boost RENAME copyright) message(STATUS "Packaging headers done") -- cgit v1.2.3 From 2584f3e3def7f09bc373117985013ac019aa76d6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 15 Nov 2016 11:56:46 -0800 Subject: Major refactor/rework of dependency resolution --- toolsrc/include/StatusParagraphs.h | 4 ++ toolsrc/include/vcpkg.h | 9 +++ toolsrc/include/vcpkg_Dependencies.h | 17 ++++-- toolsrc/src/commands_installation.cpp | 100 ++++++++++++++++--------------- toolsrc/src/vcpkg.cpp | 36 +++++++++++ toolsrc/src/vcpkg_Dependencies.cpp | 110 ++++++++++++---------------------- 6 files changed, 153 insertions(+), 123 deletions(-) diff --git a/toolsrc/include/StatusParagraphs.h b/toolsrc/include/StatusParagraphs.h index 9446d432c..7a0f2177d 100644 --- a/toolsrc/include/StatusParagraphs.h +++ b/toolsrc/include/StatusParagraphs.h @@ -13,6 +13,10 @@ namespace vcpkg using iterator = container::reverse_iterator; using const_iterator = container::const_reverse_iterator; + const_iterator find(const package_spec& spec) const + { + return find(spec.name(), spec.target_triplet()); + } const_iterator find(const std::string& name, const triplet& target_triplet) const; iterator find(const std::string& name, const triplet& target_triplet); iterator find_installed(const std::string& name, const triplet& target_triplet); diff --git a/toolsrc/include/vcpkg.h b/toolsrc/include/vcpkg.h index 1d7f87d32..81b4d45ba 100644 --- a/toolsrc/include/vcpkg.h +++ b/toolsrc/include/vcpkg.h @@ -16,4 +16,13 @@ namespace vcpkg void install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs& status_db); void deinstall_package(const vcpkg_paths& paths, const package_spec& spec, StatusParagraphs& status_db); + + expected try_load_port(const fs::path& control_path); + inline expected try_load_port(const vcpkg_paths& paths, const std::string& name) + { + return try_load_port(paths.ports / name); + } + + expected try_load_cached_package(const vcpkg_paths& paths, const package_spec& spec); + } // namespace vcpkg diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 8e6808ee3..b556eb7d8 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -2,14 +2,23 @@ #include #include "package_spec.h" #include "StatusParagraphs.h" -#include #include "vcpkg_paths.h" namespace vcpkg {namespace Dependencies { - std::vector create_dependency_ordered_install_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); + enum class install_plan_kind + { + BUILD_AND_INSTALL, + INSTALL, + ALREADY_INSTALLED + }; - std::unordered_set get_unmet_dependencies(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); + struct install_plan_action + { + install_plan_kind plan; + std::unique_ptr bpgh; + std::unique_ptr spgh; + }; - std::vector get_unmet_package_build_dependencies(const vcpkg_paths& paths, const package_spec& spec); + std::vector> create_install_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); }} diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_installation.cpp index 460fa1818..b900b56c8 100644 --- a/toolsrc/src/commands_installation.cpp +++ b/toolsrc/src/commands_installation.cpp @@ -9,7 +9,6 @@ #include "vcpkg_Dependencies.h" #include "vcpkg_Input.h" #include "vcpkg_Maps.h" -#include "Paragraphs.h" #include "vcpkg_info.h" namespace vcpkg @@ -21,17 +20,15 @@ namespace vcpkg std::ofstream(binary_control_file) << bpgh; } - static void build_internal(const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir) + static void build_internal(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir) { - auto pghs = Paragraphs::get_paragraphs(port_dir / "CONTROL"); - Checks::check_exit(pghs.size() == 1, "Error: invalid control file"); - SourceParagraph source_paragraph(pghs[0]); + Checks::check_exit(spec.name() == source_paragraph.name, "inconsistent arguments to build_internal()"); + auto&& target_triplet = spec.target_triplet(); const fs::path ports_cmake_script_path = paths.ports_cmake; - auto&& target_triplet = spec.target_triplet(); 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(spec.name()), + 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()); @@ -65,11 +62,6 @@ namespace vcpkg // delete_directory(port_buildtrees_dir); } - static void build_internal(const package_spec& spec, const vcpkg_paths& paths) - { - return build_internal(spec, paths, paths.ports / spec.name()); - } - 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"); @@ -78,49 +70,47 @@ namespace vcpkg std::vector specs = Input::check_and_get_package_specs(args.command_arguments, default_target_triplet, example.c_str()); Input::check_triplets(specs, paths); - std::vector install_plan = Dependencies::create_dependency_ordered_install_plan(paths, specs, status_db); + auto install_plan = Dependencies::create_install_plan(paths, specs, status_db); Checks::check_exit(!install_plan.empty(), "Install plan cannot be empty"); - std::string specs_string = to_string(install_plan[0]); + + std::string specs_string = to_string(install_plan[0].first); for (size_t i = 1; i < install_plan.size(); ++i) { specs_string.push_back(','); - specs_string.append(to_string(install_plan[i])); + specs_string.append(to_string(install_plan[i].first)); } TrackProperty("installplan", specs_string); Environment::ensure_utilities_on_path(paths); - for (const package_spec& spec : install_plan) + for (const auto& action : install_plan) { - if (status_db.find_installed(spec.name(), spec.target_triplet()) != status_db.end()) - { - System::println(System::color::success, "Package %s is already installed", spec); - continue; - } - - fs::path package_path = paths.package_dir(spec); - - expected file_contents = Files::get_contents(package_path / "CONTROL"); - try { - if (file_contents.error_code()) + if (action.second.plan == Dependencies::install_plan_kind::ALREADY_INSTALLED) { - build_internal(spec, paths); - file_contents = Files::get_contents(package_path / "CONTROL"); - if (file_contents.error_code()) + if (std::find(specs.begin(), specs.end(), action.first) != specs.end()) { - file_contents.get_or_throw(); + System::println(System::color::success, "Package %s is already installed", action.first); } } - - auto pghs = Paragraphs::parse_paragraphs(file_contents.get_or_throw()); - Checks::check_throw(pghs.size() == 1, "multiple paragraphs in control file"); - install_package(paths, BinaryParagraph(pghs[0]), status_db); - System::println(System::color::success, "Package %s is installed", spec); + else if (action.second.plan == Dependencies::install_plan_kind::BUILD_AND_INSTALL) + { + build_internal(*action.second.spgh, action.first, paths, paths.port_dir(action.first)); + auto bpgh = try_load_cached_package(paths, action.first).get_or_throw(); + install_package(paths, bpgh, status_db); + System::println(System::color::success, "Package %s is installed", action.first); + } + else if (action.second.plan == Dependencies::install_plan_kind::INSTALL) + { + install_package(paths, *action.second.bpgh, status_db); + System::println(System::color::success, "Package %s is installed", action.first); + } + else + Checks::unreachable(); } catch (const std::exception& e) { - System::println(System::color::error, "Error: Could not install package %s: %s", spec, e.what()); + System::println(System::color::error, "Error: Could not install package %s: %s", action.first, e.what()); exit(EXIT_FAILURE); } } @@ -142,29 +132,41 @@ namespace vcpkg Input::check_triplet(spec.target_triplet(), paths); // Explicitly load and use the portfile's build dependencies when resolving the build command (instead of a cached package's dependencies). - auto first_level_deps = Dependencies::get_unmet_package_build_dependencies(paths, spec); + auto 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()); + auto& spgh = *maybe_spgh.get(); + + auto first_level_deps = filter_dependencies(spgh.depends, spec.target_triplet()); + std::vector first_level_deps_specs; for (auto&& dep : first_level_deps) { first_level_deps_specs.push_back(package_spec::from_name_and_triplet(dep, spec.target_triplet()).get_or_throw()); } - std::unordered_set unmet_dependencies = Dependencies::get_unmet_dependencies(paths, first_level_deps_specs, status_db); + auto 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(), [](auto& p) + { + return p.second.plan == Dependencies::install_plan_kind::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& p : unmet_dependencies) + for (const auto& p : unmet_dependencies) { - System::println(" %s", to_string(p)); + System::println(" %s", to_string(p.first)); } System::println(""); exit(EXIT_FAILURE); } Environment::ensure_utilities_on_path(paths); - build_internal(spec, paths); + build_internal(spgh, spec, paths, paths.port_dir(spec)); exit(EXIT_SUCCESS); } @@ -173,17 +175,21 @@ namespace vcpkg 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.c_str()); - expected current_spec = package_spec::from_string(args.command_arguments[0], default_target_triplet); - if (auto spec = current_spec.get()) + 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); - build_internal(*spec, paths, port_dir); - exit(EXIT_SUCCESS); + auto 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", current_spec.error_code().message(), args.command_arguments[0]); + 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).c_str()); exit(EXIT_FAILURE); } diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index 6e47df2c8..db85eee8f 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -369,3 +369,39 @@ void vcpkg::deinstall_package(const vcpkg_paths& paths, const package_spec& spec write_update(paths, pkg); System::println(System::color::success, "Package %s was successfully removed", pkg.package.displayname()); } + +expected vcpkg::try_load_port(const fs::path& path) +{ + try + { + auto pghs = Paragraphs::get_paragraphs(path / "CONTROL"); + Checks::check_exit(pghs.size() == 1, "Invalid control file at %s\\CONTROL", path.string()); + return SourceParagraph(pghs[0]); + } + catch (std::runtime_error const&) + { + } + + return std::errc::no_such_file_or_directory; +} + +expected vcpkg::try_load_cached_package(const vcpkg_paths& paths, const package_spec& spec) +{ + const fs::path path = paths.package_dir(spec) / "CONTROL"; + + auto control_contents_maybe = Files::get_contents(path); + if (auto control_contents = control_contents_maybe.get()) + { + std::vector> pghs; + try + { + pghs = Paragraphs::parse_paragraphs(*control_contents); + } + catch (std::runtime_error) + { + } + Checks::check_exit(pghs.size() == 1, "Invalid control file at %s", path.string()); + return BinaryParagraph(pghs[0]); + } + return control_contents_maybe.error_code(); +} diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp index c054ec913..3142b44ba 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg_Dependencies.cpp @@ -7,40 +7,17 @@ #include #include "vcpkg_Maps.h" #include "vcpkg_Files.h" -#include "Paragraphs.h" +#include "vcpkg.h" namespace vcpkg { namespace Dependencies { - // TODO: Refactoring between this function and install_package - static std::vector get_single_level_unmet_dependencies(const vcpkg_paths& paths, const package_spec& spec) + std::vector> create_install_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db) { - const fs::path packages_dir_control_file_path = paths.package_dir(spec) / "CONTROL"; - - auto control_contents_maybe = Files::get_contents(packages_dir_control_file_path); - if (auto control_contents = control_contents_maybe.get()) - { - std::vector> pghs; - try - { - pghs = Paragraphs::parse_paragraphs(*control_contents); - } - catch (std::runtime_error) - { - } - Checks::check_exit(pghs.size() == 1, "Invalid control file at %s", packages_dir_control_file_path.string()); - return BinaryParagraph(pghs[0]).depends; - } - - return get_unmet_package_build_dependencies(paths, spec); - } - - static Graphs::Graph build_dependency_graph(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db) - { - std::vector examine_stack(specs); - std::unordered_set was_examined; // Examine = we have checked its immediate (non-recursive) dependencies + std::unordered_map was_examined; // Examine = we have checked its immediate (non-recursive) dependencies Graphs::Graph graph; - graph.add_vertices(examine_stack); + graph.add_vertices(specs); + std::vector examine_stack(specs); while (!examine_stack.empty()) { const package_spec spec = examine_stack.back(); @@ -51,59 +28,48 @@ namespace vcpkg { namespace Dependencies continue; } - std::vector dependencies_as_string = get_single_level_unmet_dependencies(paths, spec); + auto process_dependencies = [&](const std::vector& dependencies_as_string) + { + for (const std::string& dep_as_string : dependencies_as_string) + { + const package_spec current_dep = package_spec::from_name_and_triplet(dep_as_string, spec.target_triplet()).get_or_throw(); + graph.add_edge(spec, current_dep); + if (was_examined.find(current_dep) == was_examined.end()) + { + examine_stack.push_back(std::move(current_dep)); + } + } + }; - for (const std::string& dep_as_string : dependencies_as_string) + auto it = status_db.find(spec); + if (it != status_db.end() && (*it)->want == want_t::install) { - const package_spec current_dep = package_spec::from_name_and_triplet(dep_as_string, spec.target_triplet()).get_or_throw(); - auto it = status_db.find(current_dep.name(), current_dep.target_triplet()); - if (it != status_db.end() && (*it)->want == want_t::install) - { - continue; - } + was_examined.emplace(spec, install_plan_action{install_plan_kind::ALREADY_INSTALLED, nullptr, nullptr}); + continue; + } - graph.add_edge(spec, current_dep); - if (was_examined.find(current_dep) == was_examined.end()) - { - examine_stack.push_back(std::move(current_dep)); - } + expected maybe_bpgh = try_load_cached_package(paths, spec); + if (BinaryParagraph* bpgh = maybe_bpgh.get()) + { + process_dependencies(bpgh->depends); + was_examined.emplace(spec, install_plan_action{install_plan_kind::INSTALL, std::make_unique(std::move(*bpgh)), nullptr}); + continue; } - was_examined.insert(spec); + expected maybe_spgh = try_load_port(paths, spec.name()); + SourceParagraph* spgh = maybe_spgh.get(); + Checks::check_exit(spgh != nullptr, "Cannot find package"); + process_dependencies(filter_dependencies(spgh->depends, spec.target_triplet())); + was_examined.emplace(spec, install_plan_action{install_plan_kind::BUILD_AND_INSTALL, nullptr, std::make_unique(std::move(*spgh))}); } - return graph; - } - - std::vector create_dependency_ordered_install_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db) - { - return build_dependency_graph(paths, specs, status_db).find_topological_sort(); - } - - std::unordered_set get_unmet_dependencies(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db) - { - const Graphs::Graph dependency_graph = build_dependency_graph(paths, specs, status_db); - return Maps::extract_key_set(dependency_graph.adjacency_list()); - } + std::vector> ret; - std::vector get_unmet_package_build_dependencies(const vcpkg_paths& paths, const package_spec& spec) - { - const fs::path ports_dir_control_file_path = paths.port_dir(spec) / "CONTROL"; - auto control_contents_maybe = Files::get_contents(ports_dir_control_file_path); - if (auto control_contents = control_contents_maybe.get()) + std::vector pkgs = graph.find_topological_sort(); + for (package_spec& pkg : pkgs) { - std::vector> pghs; - try - { - pghs = Paragraphs::parse_paragraphs(*control_contents); - } - catch (std::runtime_error) - { - } - Checks::check_exit(pghs.size() == 1, "Invalid control file at %s", ports_dir_control_file_path.string()); - return filter_dependencies(SourceParagraph(pghs[0]).depends, spec.target_triplet()); + ret.emplace_back(pkg, std::move(was_examined[pkg])); } - - Checks::exit_with_message("Could not find package named %s", spec); + return ret; } }} -- cgit v1.2.3 From 2b204e673914b20e662ed17f667c267690fd6b52 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 15 Nov 2016 11:56:46 -0800 Subject: Use custom struct instead of std::pair --- toolsrc/include/vcpkg_Dependencies.h | 8 +++++++- toolsrc/src/commands_installation.cpp | 34 +++++++++++++++++----------------- toolsrc/src/vcpkg_Dependencies.cpp | 10 +++++----- 3 files changed, 29 insertions(+), 23 deletions(-) diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index b556eb7d8..909c27771 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -20,5 +20,11 @@ namespace vcpkg {namespace Dependencies std::unique_ptr spgh; }; - std::vector> create_install_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); + struct package_spec_with_install_plan + { + package_spec spec; + install_plan_action install_plan; + }; + + std::vector create_install_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); }} diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_installation.cpp index b900b56c8..4535484b6 100644 --- a/toolsrc/src/commands_installation.cpp +++ b/toolsrc/src/commands_installation.cpp @@ -73,11 +73,11 @@ namespace vcpkg auto install_plan = Dependencies::create_install_plan(paths, specs, status_db); Checks::check_exit(!install_plan.empty(), "Install plan cannot be empty"); - std::string specs_string = to_string(install_plan[0].first); + std::string specs_string = to_string(install_plan[0].spec); for (size_t i = 1; i < install_plan.size(); ++i) { specs_string.push_back(','); - specs_string.append(to_string(install_plan[i].first)); + specs_string.append(to_string(install_plan[i].spec)); } TrackProperty("installplan", specs_string); Environment::ensure_utilities_on_path(paths); @@ -86,31 +86,31 @@ namespace vcpkg { try { - if (action.second.plan == Dependencies::install_plan_kind::ALREADY_INSTALLED) + if (action.install_plan.plan == Dependencies::install_plan_kind::ALREADY_INSTALLED) { - if (std::find(specs.begin(), specs.end(), action.first) != specs.end()) + if (std::find(specs.begin(), specs.end(), action.spec) != specs.end()) { - System::println(System::color::success, "Package %s is already installed", action.first); + System::println(System::color::success, "Package %s is already installed", action.spec); } } - else if (action.second.plan == Dependencies::install_plan_kind::BUILD_AND_INSTALL) + else if (action.install_plan.plan == Dependencies::install_plan_kind::BUILD_AND_INSTALL) { - build_internal(*action.second.spgh, action.first, paths, paths.port_dir(action.first)); - auto bpgh = try_load_cached_package(paths, action.first).get_or_throw(); + build_internal(*action.install_plan.spgh, action.spec, paths, paths.port_dir(action.spec)); + auto 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.first); + System::println(System::color::success, "Package %s is installed", action.spec); } - else if (action.second.plan == Dependencies::install_plan_kind::INSTALL) + else if (action.install_plan.plan == Dependencies::install_plan_kind::INSTALL) { - install_package(paths, *action.second.bpgh, status_db); - System::println(System::color::success, "Package %s is installed", action.first); + install_package(paths, *action.install_plan.bpgh, status_db); + System::println(System::color::success, "Package %s is installed", action.spec); } else Checks::unreachable(); } catch (const std::exception& e) { - System::println(System::color::error, "Error: Could not install package %s: %s", action.first, e.what()); + System::println(System::color::error, "Error: Could not install package %s: %s", action.spec, e.what()); exit(EXIT_FAILURE); } } @@ -144,11 +144,11 @@ namespace vcpkg first_level_deps_specs.push_back(package_spec::from_name_and_triplet(dep, spec.target_triplet()).get_or_throw()); } - auto unmet_dependencies = Dependencies::create_install_plan(paths, first_level_deps_specs, status_db); + 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(), [](auto& p) + std::remove_if(unmet_dependencies.begin(), unmet_dependencies.end(), [](const Dependencies::package_spec_with_install_plan& p) { - return p.second.plan == Dependencies::install_plan_kind::ALREADY_INSTALLED; + return p.install_plan.plan == Dependencies::install_plan_kind::ALREADY_INSTALLED; }), unmet_dependencies.end()); @@ -159,7 +159,7 @@ namespace vcpkg System::println(""); for (const auto& p : unmet_dependencies) { - System::println(" %s", to_string(p.first)); + System::println(" %s", to_string(p.spec)); } System::println(""); exit(EXIT_FAILURE); diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp index 3142b44ba..2b7e132cc 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg_Dependencies.cpp @@ -11,7 +11,7 @@ namespace vcpkg { namespace Dependencies { - std::vector> create_install_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db) + std::vector create_install_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db) { std::unordered_map was_examined; // Examine = we have checked its immediate (non-recursive) dependencies Graphs::Graph graph; @@ -63,12 +63,12 @@ namespace vcpkg { namespace Dependencies was_examined.emplace(spec, install_plan_action{install_plan_kind::BUILD_AND_INSTALL, nullptr, std::make_unique(std::move(*spgh))}); } - std::vector> ret; + std::vector ret; - std::vector pkgs = graph.find_topological_sort(); - for (package_spec& pkg : pkgs) + const std::vector pkgs = graph.find_topological_sort(); + for (const package_spec& pkg : pkgs) { - ret.emplace_back(pkg, std::move(was_examined[pkg])); + ret.push_back({ pkg, std::move(was_examined[pkg]) }); } return ret; } -- cgit v1.2.3 From b64b0cbc8a34e5761fbf7fda75fda49906f116ea Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 15 Nov 2016 11:56:46 -0800 Subject: Renames and cleanup --- toolsrc/include/vcpkg_Dependencies.h | 6 ++--- toolsrc/src/commands_installation.cpp | 41 +++++++++++++++++++---------------- toolsrc/src/vcpkg_Dependencies.cpp | 6 ++--- 3 files changed, 28 insertions(+), 25 deletions(-) diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 909c27771..3616e6be9 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -6,7 +6,7 @@ namespace vcpkg {namespace Dependencies { - enum class install_plan_kind + enum class install_plan_type { BUILD_AND_INSTALL, INSTALL, @@ -15,7 +15,7 @@ namespace vcpkg {namespace Dependencies struct install_plan_action { - install_plan_kind plan; + install_plan_type type; std::unique_ptr bpgh; std::unique_ptr spgh; }; @@ -23,7 +23,7 @@ namespace vcpkg {namespace Dependencies struct package_spec_with_install_plan { package_spec spec; - install_plan_action install_plan; + install_plan_action plan; }; std::vector create_install_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_installation.cpp index 4535484b6..0f0cfc954 100644 --- a/toolsrc/src/commands_installation.cpp +++ b/toolsrc/src/commands_installation.cpp @@ -13,9 +13,12 @@ namespace vcpkg { + using Dependencies::package_spec_with_install_plan; + using Dependencies::install_plan_type; + static void create_binary_control_file(const vcpkg_paths& paths, const SourceParagraph& source_paragraph, const triplet& target_triplet) { - auto bpgh = BinaryParagraph(source_paragraph, 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; } @@ -23,7 +26,7 @@ namespace vcpkg 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()"); - auto&& target_triplet = spec.target_triplet(); + 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")", @@ -70,7 +73,7 @@ namespace vcpkg std::vector specs = Input::check_and_get_package_specs(args.command_arguments, default_target_triplet, example.c_str()); Input::check_triplets(specs, paths); - auto install_plan = Dependencies::create_install_plan(paths, specs, status_db); + std::vector install_plan = Dependencies::create_install_plan(paths, specs, status_db); Checks::check_exit(!install_plan.empty(), "Install plan cannot be empty"); std::string specs_string = to_string(install_plan[0].spec); @@ -82,27 +85,27 @@ namespace vcpkg TrackProperty("installplan", specs_string); Environment::ensure_utilities_on_path(paths); - for (const auto& action : install_plan) + for (const package_spec_with_install_plan& action : install_plan) { try { - if (action.install_plan.plan == Dependencies::install_plan_kind::ALREADY_INSTALLED) + if (action.plan.type == install_plan_type::ALREADY_INSTALLED) { if (std::find(specs.begin(), specs.end(), action.spec) != specs.end()) { System::println(System::color::success, "Package %s is already installed", action.spec); } } - else if (action.install_plan.plan == Dependencies::install_plan_kind::BUILD_AND_INSTALL) + else if (action.plan.type == install_plan_type::BUILD_AND_INSTALL) { - build_internal(*action.install_plan.spgh, action.spec, paths, paths.port_dir(action.spec)); - auto bpgh = try_load_cached_package(paths, action.spec).get_or_throw(); + 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); } - else if (action.install_plan.plan == Dependencies::install_plan_kind::INSTALL) + else if (action.plan.type == install_plan_type::INSTALL) { - install_package(paths, *action.install_plan.bpgh, status_db); + install_package(paths, *action.plan.bpgh, status_db); System::println(System::color::success, "Package %s is installed", action.spec); } else @@ -132,23 +135,23 @@ namespace vcpkg Input::check_triplet(spec.target_triplet(), paths); // Explicitly load and use the portfile's build dependencies when resolving the build command (instead of a cached package's dependencies). - auto maybe_spgh = try_load_port(paths, spec.name()); + 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()); - auto& spgh = *maybe_spgh.get(); + const SourceParagraph& spgh = *maybe_spgh.get(); - auto first_level_deps = filter_dependencies(spgh.depends, spec.target_triplet()); + const std::vector first_level_deps = filter_dependencies(spgh.depends, spec.target_triplet()); std::vector first_level_deps_specs; - for (auto&& dep : first_level_deps) + 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); + 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 Dependencies::package_spec_with_install_plan& p) + std::remove_if(unmet_dependencies.begin(), unmet_dependencies.end(), [](const package_spec_with_install_plan& p) { - return p.install_plan.plan == Dependencies::install_plan_kind::ALREADY_INSTALLED; + return p.plan.type == install_plan_type::ALREADY_INSTALLED; }), unmet_dependencies.end()); @@ -157,7 +160,7 @@ namespace vcpkg 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 auto& p : unmet_dependencies) + for (const package_spec_with_install_plan& p : unmet_dependencies) { System::println(" %s", to_string(p.spec)); } @@ -181,7 +184,7 @@ namespace vcpkg Input::check_triplet(spec->target_triplet(), paths); Environment::ensure_utilities_on_path(paths); const fs::path port_dir = args.command_arguments.at(1); - auto maybe_spgh = try_load_port(port_dir); + const expected maybe_spgh = try_load_port(port_dir); if (auto spgh = maybe_spgh.get()) { build_internal(*spgh, *spec, paths, port_dir); diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp index 2b7e132cc..41172ba0f 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg_Dependencies.cpp @@ -44,7 +44,7 @@ namespace vcpkg { namespace Dependencies auto it = status_db.find(spec); if (it != status_db.end() && (*it)->want == want_t::install) { - was_examined.emplace(spec, install_plan_action{install_plan_kind::ALREADY_INSTALLED, nullptr, nullptr}); + was_examined.emplace(spec, install_plan_action{install_plan_type::ALREADY_INSTALLED, nullptr, nullptr}); continue; } @@ -52,7 +52,7 @@ namespace vcpkg { namespace Dependencies if (BinaryParagraph* bpgh = maybe_bpgh.get()) { process_dependencies(bpgh->depends); - was_examined.emplace(spec, install_plan_action{install_plan_kind::INSTALL, std::make_unique(std::move(*bpgh)), nullptr}); + was_examined.emplace(spec, install_plan_action{install_plan_type::INSTALL, std::make_unique(std::move(*bpgh)), nullptr}); continue; } @@ -60,7 +60,7 @@ namespace vcpkg { namespace Dependencies SourceParagraph* spgh = maybe_spgh.get(); Checks::check_exit(spgh != nullptr, "Cannot find package"); process_dependencies(filter_dependencies(spgh->depends, spec.target_triplet())); - was_examined.emplace(spec, install_plan_action{install_plan_kind::BUILD_AND_INSTALL, nullptr, std::make_unique(std::move(*spgh))}); + was_examined.emplace(spec, install_plan_action{install_plan_type::BUILD_AND_INSTALL, nullptr, std::make_unique(std::move(*spgh))}); } std::vector ret; -- cgit v1.2.3 From 727e4ed6faabead764c4dbffaa5b57f5cfb4017a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 15 Nov 2016 11:56:46 -0800 Subject: [Graph] Now uses set instead of vector --- toolsrc/include/vcpkg_Graphs.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/toolsrc/include/vcpkg_Graphs.h b/toolsrc/include/vcpkg_Graphs.h index 81b189f0e..9444ac45b 100644 --- a/toolsrc/include/vcpkg_Graphs.h +++ b/toolsrc/include/vcpkg_Graphs.h @@ -1,6 +1,7 @@ #pragma once #include +#include namespace vcpkg { namespace Graphs { @@ -21,7 +22,7 @@ namespace vcpkg { namespace Graphs { static void find_topological_sort_internal(V vertex, ExplorationStatus& status, - const std::unordered_map>& adjacency_list, + const std::unordered_map>& adjacency_list, std::unordered_map& exploration_status, std::vector& sorted) { @@ -63,7 +64,7 @@ namespace vcpkg { namespace Graphs void add_edge(V u, V v) { this->vertices[v]; - this->vertices[u].push_back(v); + this->vertices[u].insert(v); } std::vector find_topological_sort() const @@ -108,12 +109,12 @@ namespace vcpkg { namespace Graphs return indegrees; } - const std::unordered_map>& adjacency_list() const + const std::unordered_map>& adjacency_list() const { return this->vertices; } private: - std::unordered_map> vertices; + std::unordered_map> vertices; }; }} -- cgit v1.2.3 From 7811ef602ecd963ae333e3427c82629d1c8e9f34 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 15 Nov 2016 14:52:52 -0800 Subject: [boost] Rename lib files in static builds --- ports/boost/CONTROL | 2 +- ports/boost/portfile.cmake | 32 ++++++++++++++++---------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/ports/boost/CONTROL b/ports/boost/CONTROL index 5d074197e..c96b8cf35 100644 --- a/ports/boost/CONTROL +++ b/ports/boost/CONTROL @@ -1,3 +1,3 @@ Source: boost -Version: 1.62-3 +Version: 1.62-4 Description: Peer-reviewed portable C++ source libraries diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake index 5f9b29c32..7394e70ea 100644 --- a/ports/boost/portfile.cmake +++ b/ports/boost/portfile.cmake @@ -110,14 +110,14 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) DESTINATION ${CURRENT_PACKAGES_DIR}/bin FILES_MATCHING PATTERN "*.dll") else() - # file(GLOB RELEASE_LIBS ${CURRENT_PACKAGES_DIR}/lib/libboost*.lib) - # foreach(LIB ${RELEASE_LIBS}) - # get_filename_component(OLD_FILENAME ${LIB} NAME) - # get_filename_component(DIRECTORY_OF_LIB_FILE ${LIB} DIRECTORY) - # string(REPLACE "libboost_" "boost_" NEW_FILENAME ${OLD_FILENAME}) - # string(REPLACE "-s-" "-" NEW_FILENAME ${NEW_FILENAME}) - # file(RENAME ${DIRECTORY_OF_LIB_FILE}/${OLD_FILENAME} ${DIRECTORY_OF_LIB_FILE}/${NEW_FILENAME}) - # endforeach() + file(GLOB RELEASE_LIBS ${CURRENT_PACKAGES_DIR}/lib/libboost*.lib) + foreach(LIB ${RELEASE_LIBS}) + get_filename_component(OLD_FILENAME ${LIB} NAME) + get_filename_component(DIRECTORY_OF_LIB_FILE ${LIB} DIRECTORY) + string(REPLACE "libboost_" "boost_" NEW_FILENAME ${OLD_FILENAME}) + string(REPLACE "-s-" "-" NEW_FILENAME ${NEW_FILENAME}) + file(RENAME ${DIRECTORY_OF_LIB_FILE}/${OLD_FILENAME} ${DIRECTORY_OF_LIB_FILE}/${NEW_FILENAME}) + endforeach() endif() message(STATUS "Packaging ${TARGET_TRIPLET}-rel done") @@ -130,14 +130,14 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin FILES_MATCHING PATTERN "*.dll") else() - # file(GLOB DEBUG_LIBS ${CURRENT_PACKAGES_DIR}/debug/lib/libboost*.lib) - # foreach(LIB ${DEBUG_LIBS}) - # get_filename_component(OLD_FILENAME ${LIB} NAME) - # get_filename_component(DIRECTORY_OF_LIB_FILE ${LIB} DIRECTORY) - # string(REPLACE "libboost_" "boost_" NEW_FILENAME ${OLD_FILENAME}) - # string(REPLACE "-sgd-" "-gd-" NEW_FILENAME ${NEW_FILENAME}) - # file(RENAME ${DIRECTORY_OF_LIB_FILE}/${OLD_FILENAME} ${DIRECTORY_OF_LIB_FILE}/${NEW_FILENAME}) - # endforeach() + file(GLOB DEBUG_LIBS ${CURRENT_PACKAGES_DIR}/debug/lib/libboost*.lib) + foreach(LIB ${DEBUG_LIBS}) + get_filename_component(OLD_FILENAME ${LIB} NAME) + get_filename_component(DIRECTORY_OF_LIB_FILE ${LIB} DIRECTORY) + string(REPLACE "libboost_" "boost_" NEW_FILENAME ${OLD_FILENAME}) + string(REPLACE "-sgd-" "-gd-" NEW_FILENAME ${NEW_FILENAME}) + file(RENAME ${DIRECTORY_OF_LIB_FILE}/${OLD_FILENAME} ${DIRECTORY_OF_LIB_FILE}/${NEW_FILENAME}) + endforeach() endif() message(STATUS "Packaging ${TARGET_TRIPLET}-dbg done") -- cgit v1.2.3 From a882cfe14f28979e453e92786b1a3ff82a28904b Mon Sep 17 00:00:00 2001 From: Geert Van Laethem Date: Tue, 15 Nov 2016 15:26:16 +0100 Subject: possible fix for issue #223 --- toolsrc/src/coff_file_reader.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/toolsrc/src/coff_file_reader.cpp b/toolsrc/src/coff_file_reader.cpp index f46150979..0b14abcc8 100644 --- a/toolsrc/src/coff_file_reader.cpp +++ b/toolsrc/src/coff_file_reader.cpp @@ -8,7 +8,7 @@ using namespace std; -namespace vcpkg {namespace COFFFileReader +namespace vcpkg { namespace COFFFileReader { template static T reinterpret_bytes(const char* data) @@ -36,7 +36,7 @@ namespace vcpkg {namespace COFFFileReader static void verify_equal_strings(const char* expected, const char* actual, int size, const char* label) { - Checks::check_exit(memcmp(expected, actual, size) == 0, "Incorrect string (%s) found. Expected: %s but found %s", label, expected, actual); + Checks::check_exit(memcmp(expected, actual, size) == 0, "Incorrect string (%s) found. Expected: (%s) but found (%s)", label, expected, actual); } static void read_and_verify_PE_signature(fstream& fs) @@ -113,8 +113,11 @@ namespace vcpkg {namespace COFFFileReader ret.data.resize(HEADER_SIZE); fs.read(&ret.data[0], HEADER_SIZE); - const std::string header_end = ret.data.substr(HEADER_END_OFFSET, HEADER_END_SIZE); - verify_equal_strings(HEADER_END, header_end.c_str(), HEADER_END_SIZE, "LIB HEADER_END"); + if (ret.data[0] != '\0') + { + const std::string header_end = ret.data.substr(HEADER_END_OFFSET, HEADER_END_SIZE); + verify_equal_strings(HEADER_END, header_end.c_str(), HEADER_END_SIZE, "LIB HEADER_END"); + } return ret; } @@ -251,10 +254,13 @@ namespace vcpkg {namespace COFFFileReader for (uint32_t i = 0; i < archive_member_count; i++) { const archive_member_header header = archive_member_header::read(fs); - const uint16_t first_two_bytes = peek_value_from_stream(fs); - const bool isImportHeader = getMachineType(first_two_bytes) == MachineType::UNKNOWN; - const MachineType machine = isImportHeader ? import_header::peek(fs).machineType() : coff_file_header::peek(fs).machineType(); - machine_types.insert(machine); + if (header.data[0] != '\0') + { + const uint16_t first_two_bytes = peek_value_from_stream(fs); + const bool isImportHeader = getMachineType(first_two_bytes) == MachineType::UNKNOWN; + const MachineType machine = isImportHeader ? import_header::peek(fs).machineType() : coff_file_header::peek(fs).machineType(); + machine_types.insert(machine); + } skip_archive_member(fs, header.member_size()); } -- cgit v1.2.3 From 46761d7e340eca3302a4b66137463f3902a8a30a Mon Sep 17 00:00:00 2001 From: John Camp Date: Tue, 15 Nov 2016 19:50:29 -0500 Subject: Return to C7 debugging output --- ports/pdcurses/portfile.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/pdcurses/portfile.cmake b/ports/pdcurses/portfile.cmake index 93cc146f7..4c43e68d2 100644 --- a/ports/pdcurses/portfile.cmake +++ b/ports/pdcurses/portfile.cmake @@ -15,7 +15,6 @@ set(PDC_NMAKE_CWD ${SOURCE_PATH}/win32) set(PDC_PDCLIB ${SOURCE_PATH}/win32/pdcurses) file(READ ${SOURCE_PATH}/win32/vcwin32.mak PDC_MAK) -string(REPLACE "-Z7" "-ZI -Fdpdcurses.pdb" PDC_MAK ${PDC_MAK}) string(REPLACE " -pdb:none" "" PDC_MAK ${PDC_MAK}) string(REPLACE "/MACHINE:IX86 " "" PDC_MAK ${PDC_MAK}) file(WRITE ${SOURCE_PATH}/win32/vcpkg.mak ${PDC_MAK}) -- cgit v1.2.3 From 4f0b17e3163e8dfdd8efb28d8f4c1c059b630a2c Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 15 Nov 2016 17:01:54 -0800 Subject: [signalrclient] Enable static builds --- ports/signalrclient/0001_cmake.patch | 50 ++++++++++++++++++++++++++++-------- ports/signalrclient/portfile.cmake | 10 ++++---- 2 files changed, 44 insertions(+), 16 deletions(-) diff --git a/ports/signalrclient/0001_cmake.patch b/ports/signalrclient/0001_cmake.patch index 0177d5d9b..809667960 100644 --- a/ports/signalrclient/0001_cmake.patch +++ b/ports/signalrclient/0001_cmake.patch @@ -1,16 +1,37 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 0d78e1c..c952b2f 100644 +index 8c73730..4cd9074 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -16,4 +16,21 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) +@@ -1,7 +1,9 @@ + cmake_minimum_required (VERSION 2.8.11) + project (signalrclient) + ++if(NOT WIN32) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fPIC -L -lcpprest") ++endif() + + set(CPPREST_INCLUDE_DIR "" CACHE FILEPATH "Path to casablanca include dir") + +@@ -16,4 +18,32 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) add_subdirectory(src/signalrclient) -add_subdirectory(test) -+#add_subdirectory(test) ++if(NOT DISABLE_TESTS) ++ add_subdirectory(test) ++endif() ++ ++if(BUILD_SHARED_LIBS) ++ install(FILES include/signalrclient/_exports.h DESTINATION include/signalrclient) ++else() ++ file(READ include/signalrclient/_exports.h EXPORTS_H) ++ string(REPLACE "#ifdef NO_SIGNALRCLIENT_EXPORTS" "#if 1" EXPORTS_H_2 ${EXPORTS_H}) ++ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/_exports.h ${EXPORTS_H_2}) + -+set(HEADERS -+ include/signalrclient/_exports.h ++ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/_exports.h DESTINATION include/signalrclient) ++endif() ++ ++set(HEADERS + include/signalrclient/connection.h + include/signalrclient/connection_state.h + include/signalrclient/hub_connection.h @@ -25,17 +46,25 @@ index 0d78e1c..c952b2f 100644 + FILES ${HEADERS} + DESTINATION "include/signalrclient" +) -\ No newline at end of file diff --git a/src/signalrclient/CMakeLists.txt b/src/signalrclient/CMakeLists.txt -index 76a5e1b..47e7dc3 100644 +index 76a5e1b..db141eb 100644 --- a/src/signalrclient/CMakeLists.txt +++ b/src/signalrclient/CMakeLists.txt -@@ -24,4 +24,13 @@ set (SOURCES - - add_library (signalrclient SHARED ${SOURCES}) +@@ -22,6 +22,21 @@ set (SOURCES + websocket_transport.cpp + ) +-add_library (signalrclient SHARED ${SOURCES}) ++if(BUILD_SHARED_LIBS) ++ add_definitions(-DSIGNALRCLIENT_EXPORTS) ++else() ++ add_definitions(-DNO_SIGNALRCLIENT_EXPORTS) ++endif() ++ +add_definitions(-DUNICODE -D_UNICODE) + ++add_library (signalrclient ${SOURCES}) + target_link_libraries(signalrclient ${CPPREST_SO}) + +install( @@ -44,4 +73,3 @@ index 76a5e1b..47e7dc3 100644 + ARCHIVE DESTINATION lib + RUNTIME DESTINATION bin +) -\ No newline at end of file diff --git a/ports/signalrclient/portfile.cmake b/ports/signalrclient/portfile.cmake index 4b4fc3344..22e91acab 100644 --- a/ports/signalrclient/portfile.cmake +++ b/ports/signalrclient/portfile.cmake @@ -1,7 +1,3 @@ -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(STATUS "Warning: Static building not supported yet. Building dynamic.") - set(VCPKG_LIBRARY_LINKAGE dynamic) -endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/SignalR-Client-Cpp-1.0.0-beta1) @@ -20,9 +16,13 @@ vcpkg_apply_patches( vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} - OPTIONS + OPTIONS_DEBUG + -DCPPREST_SO=${CURRENT_INSTALLED_DIR}/debug/lib/cpprest_2_9.lib + OPTIONS_RELEASE -DCPPREST_SO=${CURRENT_INSTALLED_DIR}/lib/cpprest_2_9.lib + OPTIONS -DCPPREST_INCLUDE_DIR=${CURRENT_INSTALLED_DIR}/include + -DDISABLE_TESTS=ON ) vcpkg_install_cmake() -- cgit v1.2.3 From 45dbe92e9be6683a23e954a0106f54645377c191 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 15 Nov 2016 17:06:00 -0800 Subject: Add comment about freeglut in coff_file_reader.cpp --- toolsrc/src/coff_file_reader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolsrc/src/coff_file_reader.cpp b/toolsrc/src/coff_file_reader.cpp index 0b14abcc8..5a53dcae6 100644 --- a/toolsrc/src/coff_file_reader.cpp +++ b/toolsrc/src/coff_file_reader.cpp @@ -113,7 +113,7 @@ namespace vcpkg { namespace COFFFileReader ret.data.resize(HEADER_SIZE); fs.read(&ret.data[0], HEADER_SIZE); - if (ret.data[0] != '\0') + if (ret.data[0] != '\0') // Due to freeglut. github issue #223 { const std::string header_end = ret.data.substr(HEADER_END_OFFSET, HEADER_END_SIZE); verify_equal_strings(HEADER_END, header_end.c_str(), HEADER_END_SIZE, "LIB HEADER_END"); @@ -254,7 +254,7 @@ namespace vcpkg { namespace COFFFileReader for (uint32_t i = 0; i < archive_member_count; i++) { const archive_member_header header = archive_member_header::read(fs); - if (header.data[0] != '\0') + if (header.data[0] != '\0') // Due to freeglut. github issue #223 { const uint16_t first_two_bytes = peek_value_from_stream(fs); const bool isImportHeader = getMachineType(first_two_bytes) == MachineType::UNKNOWN; -- cgit v1.2.3 From 628420bf8e18901d47d502ae9b185c38beb58b92 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 15 Nov 2016 17:39:33 -0800 Subject: [freeglut] Enable static building. Fix pdb copying issues --- ports/freeglut/portfile.cmake | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/ports/freeglut/portfile.cmake b/ports/freeglut/portfile.cmake index 8ea89d780..67c0b402b 100644 --- a/ports/freeglut/portfile.cmake +++ b/ports/freeglut/portfile.cmake @@ -1,7 +1,3 @@ -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(STATUS "Warning: Static building not supported yet. Building dynamic.") - set(VCPKG_LIBRARY_LINKAGE dynamic) -endif() include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE URLS "http://downloads.sourceforge.net/project/freeglut/freeglut/3.0.0/freeglut-3.0.0.tar.gz" @@ -10,11 +6,21 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(FREEGLUT_STATIC OFF) + set(FREEGLUT_DYNAMIC ON) +else() + set(FREEGLUT_STATIC ON) + set(FREEGLUT_DYNAMIC OFF) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/freeglut-3.0.0 OPTIONS - -DFREEGLUT_BUILD_STATIC_LIBS=OFF + -DFREEGLUT_BUILD_STATIC_LIBS=${FREEGLUT_STATIC} + -DFREEGLUT_BUILD_SHARED_LIBS=${FREEGLUT_DYNAMIC} -DFREEGLUT_BUILD_DEMOS=OFF + -DINSTALL_PDB=OFF # Installing pdbs failed on debug static. So, disable it and let vcpkg_copy_pdbs() do it ) vcpkg_install_cmake() @@ -24,3 +30,5 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright file(COPY ${CURRENT_BUILDTREES_DIR}/src/freeglut-3.0.0/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/freeglut) file(RENAME ${CURRENT_PACKAGES_DIR}/share/freeglut/COPYING ${CURRENT_PACKAGES_DIR}/share/freeglut/copyright) + +vcpkg_copy_pdbs() \ No newline at end of file -- cgit v1.2.3 From e969c5c8eb2429436de35eab3cbe34133566a380 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 15 Nov 2016 17:41:31 -0800 Subject: Remove unused #includes --- toolsrc/src/coff_file_reader.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/toolsrc/src/coff_file_reader.cpp b/toolsrc/src/coff_file_reader.cpp index 5a53dcae6..db8524faa 100644 --- a/toolsrc/src/coff_file_reader.cpp +++ b/toolsrc/src/coff_file_reader.cpp @@ -1,7 +1,5 @@ #include "coff_file_reader.h" #include -#include -#include #include "vcpkg_Checks.h" #include #include -- cgit v1.2.3 From 31b8eee587c4a29894247833198d5e1e15ba9bba Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 15 Nov 2016 17:42:42 -0800 Subject: Use the already loaded status_db --- toolsrc/src/commands_update.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/commands_update.cpp b/toolsrc/src/commands_update.cpp index 2d7444392..82e3b7e52 100644 --- a/toolsrc/src/commands_update.cpp +++ b/toolsrc/src/commands_update.cpp @@ -37,7 +37,7 @@ namespace vcpkg std::string packages_list; std::vector packages_output; - for (auto&& pgh : database_load_check(paths)) + for (auto&& pgh : status_db) { if (pgh->state == install_state_t::not_installed && pgh->want == want_t::purge) continue; -- cgit v1.2.3 From 8a724376746f9550b175a87f0b57c6e6e2d37c5f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 15 Nov 2016 17:43:09 -0800 Subject: Remove unused #include --- toolsrc/include/vcpkg_Strings.h | 1 - 1 file changed, 1 deletion(-) diff --git a/toolsrc/include/vcpkg_Strings.h b/toolsrc/include/vcpkg_Strings.h index d55a01224..859da5658 100644 --- a/toolsrc/include/vcpkg_Strings.h +++ b/toolsrc/include/vcpkg_Strings.h @@ -1,6 +1,5 @@ #pragma once -#include #include namespace vcpkg {namespace Strings {namespace details -- cgit v1.2.3 From b88c51bb7eada62c86ecc0aeed49e4fb7e9f754d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 15 Nov 2016 17:53:23 -0800 Subject: [expected.h] Add missing #include --- toolsrc/include/expected.h | 1 + 1 file changed, 1 insertion(+) diff --git a/toolsrc/include/expected.h b/toolsrc/include/expected.h index affabcc02..cbb513b22 100644 --- a/toolsrc/include/expected.h +++ b/toolsrc/include/expected.h @@ -1,5 +1,6 @@ #pragma once +#include #include "vcpkg_Checks.h" namespace vcpkg -- cgit v1.2.3 From 42df44ca7bba06dfadb6ac7a0e2c7fe611cd6121 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 15 Nov 2016 17:54:44 -0800 Subject: Add #else to avoid warning --- toolsrc/src/vcpkg_Checks.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/toolsrc/src/vcpkg_Checks.cpp b/toolsrc/src/vcpkg_Checks.cpp index 453ba81fd..817ac9e96 100644 --- a/toolsrc/src/vcpkg_Checks.cpp +++ b/toolsrc/src/vcpkg_Checks.cpp @@ -10,8 +10,9 @@ namespace vcpkg {namespace Checks System::println(System::color::error, "Error: Unreachable code was reached"); #ifndef NDEBUG std::abort(); -#endif +#else exit(EXIT_FAILURE); +#endif } void exit_with_message(const char* errorMessage) -- cgit v1.2.3 From aff26af2f4d740bd2cabbc0fa694b813615a6b0b Mon Sep 17 00:00:00 2001 From: sdcb Date: Wed, 16 Nov 2016 15:10:40 +0800 Subject: Add poco. --- ports/poco/CONTROL | 4 +++ ports/poco/config_h.patch | 13 ++++++++++ ports/poco/portfile.cmake | 66 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 ports/poco/CONTROL create mode 100644 ports/poco/config_h.patch create mode 100644 ports/poco/portfile.cmake diff --git a/ports/poco/CONTROL b/ports/poco/CONTROL new file mode 100644 index 000000000..ee43ac2d3 --- /dev/null +++ b/ports/poco/CONTROL @@ -0,0 +1,4 @@ +Source: poco +Version: 1.7.6 +Build-Depends: openssl, libmariadb +Description: Modern, powerful open source C++ class libraries for building network and internet-based applications that run on desktop, server, mobile and embedded systems. \ No newline at end of file diff --git a/ports/poco/config_h.patch b/ports/poco/config_h.patch new file mode 100644 index 000000000..1387fd0c9 --- /dev/null +++ b/ports/poco/config_h.patch @@ -0,0 +1,13 @@ +diff --git a/Foundation/include/Poco/Config.h b/Foundation/include/Poco/Config.h +index 003b6dc..55b8eed 100644 +--- a/Foundation/include/Poco/Config.h ++++ b/Foundation/include/Poco/Config.h +@@ -31,7 +31,7 @@ + + + // Define to disable implicit linking +-// #define POCO_NO_AUTOMATIC_LIBS ++#define POCO_NO_AUTOMATIC_LIBS + + + // Define to disable automatic initialization diff --git a/ports/poco/portfile.cmake b/ports/poco/portfile.cmake new file mode 100644 index 000000000..e32126f60 --- /dev/null +++ b/ports/poco/portfile.cmake @@ -0,0 +1,66 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/poco-1.7.6-all) + +vcpkg_download_distfile(ARCHIVE + URLS "https://pocoproject.org/releases/poco-1.7.6/poco-1.7.6-all.zip" + FILENAME "poco-1.7.6-all.zip" + SHA512 ed15c6ab69157d3caf3f5fcd861396ddbe3a98c1f3d513c2670e81601c176fb17549791836bd50014d9fb58aa3983e262312848f197e9c487af962cc27556df5 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/config_h.patch +) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + set(POCO_STATIC ON) + set(POCO_MT ON) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DPOCO_STATIC=${POCO_STATIC} + -DPOCO_MT=${POCO_MT} + + -DFORCE_OPENSSL=ON + -DENABLE_TESTS=OFF + -DENABLE_MSVC_MP=ON + -DPOCO_UNBUNDLED=OFF # OFF means: using internal copy of sqlite, libz, pcre, expat, ... +) + +vcpkg_install_cmake() + +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools) +file(RENAME ${CURRENT_PACKAGES_DIR}/bin/cpspc.exe ${CURRENT_PACKAGES_DIR}/tools/cpspc.exe) +file(RENAME ${CURRENT_PACKAGES_DIR}/bin/f2cpsp.exe ${CURRENT_PACKAGES_DIR}/tools/f2cpsp.exe) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/bin + ${CURRENT_PACKAGES_DIR}/debug/bin) +endif() + +file(REMOVE + ${CURRENT_PACKAGES_DIR}/bin/cpspc.pdb + ${CURRENT_PACKAGES_DIR}/bin/f2cpsp.pdb + ${CURRENT_PACKAGES_DIR}/debug/bin/cpspc.exe + ${CURRENT_PACKAGES_DIR}/debug/bin/cpspc.pdb + ${CURRENT_PACKAGES_DIR}/debug/bin/f2cpsp.exe + ${CURRENT_PACKAGES_DIR}/debug/bin/f2cpsp.pdb) + +file(REMOVE + ${CURRENT_PACKAGES_DIR}/bin/vcruntime140.dll + ${CURRENT_PACKAGES_DIR}/bin/msvcp140.dll + ${CURRENT_PACKAGES_DIR}/debug/bin/vcruntime140.dll + ${CURRENT_PACKAGES_DIR}/debug/bin/msvcp140.dll) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/cmake) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) + +# copy license +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/poco) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/poco/LICENSE ${CURRENT_PACKAGES_DIR}/share/poco/copyright) \ No newline at end of file -- cgit v1.2.3 From 2a571bf242902400f4a39a4d1935102519885c3f Mon Sep 17 00:00:00 2001 From: charlie barto Date: Wed, 16 Nov 2016 03:17:07 -0500 Subject: update Eigen3 to version 3.3.0 --- ports/eigen3/CONTROL | 2 +- ports/eigen3/portfile.cmake | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/eigen3/CONTROL b/ports/eigen3/CONTROL index 88ae596fb..aa5c5542d 100644 --- a/ports/eigen3/CONTROL +++ b/ports/eigen3/CONTROL @@ -1,3 +1,3 @@ Source: eigen3 -Version: 3.2.10-2 +Version: 3.3.0 Description: C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms. diff --git a/ports/eigen3/portfile.cmake b/ports/eigen3/portfile.cmake index 706ed9f4c..0a1e88e47 100644 --- a/ports/eigen3/portfile.cmake +++ b/ports/eigen3/portfile.cmake @@ -1,10 +1,10 @@ #header-only library include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/eigen-eigen-b9cd8366d4e8) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/eigen-eigen-26667be4f70b) vcpkg_download_distfile(ARCHIVE - URLS "http://bitbucket.org/eigen/eigen/get/3.2.10.tar.bz2" - FILENAME "eigen-3.2.10.tar.bz2" - SHA512 413c01a5b1b5d2e4366bc9289b1d613b21157e702b1c0d544e41ba5726acfbe0b60921ded37926010e9ce3642939e3ad39038e053d392b90a7a6302955ec5058 + URLS "http://bitbucket.org/eigen/eigen/get/3.3.0.tar.bz2" + FILENAME "eigen-3.3.0.tar.bz2" + SHA512 a1919accc9fcf64eca17b3e60a78eefeb1a187c261c28b8480604f36cf366cd6323e966d6b948f8a4ce0ae3213a3815bccd34661d1d8fb33315def4304bf163e ) vcpkg_extract_source_archive(${ARCHIVE}) -- cgit v1.2.3 From 857f76b6b9f39c383c43b6b018882149d1d27b3a Mon Sep 17 00:00:00 2001 From: sdcb Date: Wed, 16 Nov 2016 17:40:45 +0800 Subject: [poco] Remove useless depends, Add 7zip, drop POCO_MT. --- ports/poco/CONTROL | 2 +- ports/poco/portfile.cmake | 42 +++++++++++++++++++----------------------- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/ports/poco/CONTROL b/ports/poco/CONTROL index ee43ac2d3..71e55eb6c 100644 --- a/ports/poco/CONTROL +++ b/ports/poco/CONTROL @@ -1,4 +1,4 @@ Source: poco Version: 1.7.6 -Build-Depends: openssl, libmariadb +Build-Depends: Description: Modern, powerful open source C++ class libraries for building network and internet-based applications that run on desktop, server, mobile and embedded systems. \ No newline at end of file diff --git a/ports/poco/portfile.cmake b/ports/poco/portfile.cmake index e32126f60..cb5b7f139 100644 --- a/ports/poco/portfile.cmake +++ b/ports/poco/portfile.cmake @@ -1,10 +1,10 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/poco-1.7.6-all) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/poco-poco-1.7.6-release) vcpkg_download_distfile(ARCHIVE - URLS "https://pocoproject.org/releases/poco-1.7.6/poco-1.7.6-all.zip" - FILENAME "poco-1.7.6-all.zip" - SHA512 ed15c6ab69157d3caf3f5fcd861396ddbe3a98c1f3d513c2670e81601c176fb17549791836bd50014d9fb58aa3983e262312848f197e9c487af962cc27556df5 + URLS "https://github.com/pocoproject/poco/archive/poco-1.7.6-release.tar.gz" + FILENAME "poco-poco-1.7.6-release.tar.gz" + SHA512 a02b7ff66acf080942517b3b8644d6e5c7136c5edc6e58fd13083a74b97b5619253fc9db7863284a565226f95410ad4da1fa9738d14885f560aeb03c1f7c18aa ) vcpkg_extract_source_archive(${ARCHIVE}) @@ -16,18 +16,14 @@ vcpkg_apply_patches( if (VCPKG_LIBRARY_LINKAGE STREQUAL static) set(POCO_STATIC ON) - set(POCO_MT ON) endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS -DPOCO_STATIC=${POCO_STATIC} - -DPOCO_MT=${POCO_MT} - - -DFORCE_OPENSSL=ON + -DENABLE_SEVENZIP=ON -DENABLE_TESTS=OFF - -DENABLE_MSVC_MP=ON -DPOCO_UNBUNDLED=OFF # OFF means: using internal copy of sqlite, libz, pcre, expat, ... ) @@ -41,22 +37,22 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) +else() + file(REMOVE + ${CURRENT_PACKAGES_DIR}/bin/cpspc.pdb + ${CURRENT_PACKAGES_DIR}/bin/f2cpsp.pdb + ${CURRENT_PACKAGES_DIR}/debug/bin/cpspc.exe + ${CURRENT_PACKAGES_DIR}/debug/bin/cpspc.pdb + ${CURRENT_PACKAGES_DIR}/debug/bin/f2cpsp.exe + ${CURRENT_PACKAGES_DIR}/debug/bin/f2cpsp.pdb) + + file(REMOVE + ${CURRENT_PACKAGES_DIR}/bin/vcruntime140.dll + ${CURRENT_PACKAGES_DIR}/bin/msvcp140.dll + ${CURRENT_PACKAGES_DIR}/debug/bin/vcruntime140.dll + ${CURRENT_PACKAGES_DIR}/debug/bin/msvcp140.dll) endif() -file(REMOVE - ${CURRENT_PACKAGES_DIR}/bin/cpspc.pdb - ${CURRENT_PACKAGES_DIR}/bin/f2cpsp.pdb - ${CURRENT_PACKAGES_DIR}/debug/bin/cpspc.exe - ${CURRENT_PACKAGES_DIR}/debug/bin/cpspc.pdb - ${CURRENT_PACKAGES_DIR}/debug/bin/f2cpsp.exe - ${CURRENT_PACKAGES_DIR}/debug/bin/f2cpsp.pdb) - -file(REMOVE - ${CURRENT_PACKAGES_DIR}/bin/vcruntime140.dll - ${CURRENT_PACKAGES_DIR}/bin/msvcp140.dll - ${CURRENT_PACKAGES_DIR}/debug/bin/vcruntime140.dll - ${CURRENT_PACKAGES_DIR}/debug/bin/msvcp140.dll) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/cmake) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) -- cgit v1.2.3 From a0308feeb906e216d3a568f09ce889cfe60e9244 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Wed, 16 Nov 2016 16:10:35 +0100 Subject: Add JsonCpp port --- ports/jsoncpp/CONTROL | 3 +++ ports/jsoncpp/portfile.cmake | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 ports/jsoncpp/CONTROL create mode 100644 ports/jsoncpp/portfile.cmake diff --git a/ports/jsoncpp/CONTROL b/ports/jsoncpp/CONTROL new file mode 100644 index 000000000..d4ac63bd3 --- /dev/null +++ b/ports/jsoncpp/CONTROL @@ -0,0 +1,3 @@ +Source: jsoncpp +Version: 1.7.7 +Description: jsoncpp is an implementation of a JSON reader and writer in C++. JSON (JavaScript Object Notation) is a lightweight data-interchange format that it is easy to parse and redeable for human. diff --git a/ports/jsoncpp/portfile.cmake b/ports/jsoncpp/portfile.cmake new file mode 100644 index 000000000..68dfcc42a --- /dev/null +++ b/ports/jsoncpp/portfile.cmake @@ -0,0 +1,41 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/jsoncpp-1.7.7) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/open-source-parsers/jsoncpp/archive/1.7.7.zip" + FILENAME "jsoncpp-1.7.7.zip" + SHA512 3801faab0b1982bc41dac3049e0f7d24ea3dc759b77afc1ca7365b95a36460f87a74a0f5c6efd4c4a315ea2ca904b38f454b0a70133cda339c4a01ae8049cecb +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS -DJSONCPP_WITH_CMAKE_PACKAGE:BOOL=ON + -DBUILD_STATIC_LIBS:BOOL=OFF + -DBUILD_SHARED_LIBS:BOOL=ON +) + +vcpkg_install_cmake() + +# Fix CMake files +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) +file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake/jsoncpp ${CURRENT_PACKAGES_DIR}/share/jsoncpp) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/cmake) +file(READ ${CURRENT_PACKAGES_DIR}/share/jsoncpp/jsoncppConfig.cmake _contents) +string(REPLACE "get_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)\n\n" "\n" _contents "${_contents}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/jsoncpp/jsoncppConfig.cmake ${_contents}) + +file(READ ${CURRENT_PACKAGES_DIR}/debug/lib/cmake/jsoncpp/jsoncppConfig-debug.cmake _contents) +string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" _contents "${_contents}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/jsoncpp/jsoncppConfig-debug.cmake "${_contents}") + +# Remove useless files in debug +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig) + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/jsoncpp) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/jsoncpp/LICENSE ${CURRENT_PACKAGES_DIR}/share/jsoncpp/copyright) + +# Copy pdb files +vcpkg_copy_pdbs() -- cgit v1.2.3 From d56ab64fdeab2dee76710600d737cd86d31a00cf Mon Sep 17 00:00:00 2001 From: charlie barto Date: Wed, 16 Nov 2016 12:38:30 -0500 Subject: added x64 as a prefix to search for cl.exe in the toolchain file, this makes things work with VS '15' if you manually specify the triplet --- scripts/buildsystems/vcpkg.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 6384de7d3..aafeb531c 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -14,7 +14,7 @@ if(NOT VCPKG_TOOLCHAIN) set(_VCPKG_TARGET_TRIPLET_ARCH x86) else() find_program(_VCPKG_CL cl) - if(_VCPKG_CL MATCHES "amd64/cl.exe$") + if(_VCPKG_CL MATCHES "amd64/cl.exe$" OR _VCPKG_CL MATCHES "x64/cl.exe$") set(_VCPKG_TARGET_TRIPLET_ARCH x64) elseif(_VCPKG_CL MATCHES "arm/cl.exe$") set(_VCPKG_TARGET_TRIPLET_ARCH arm) -- cgit v1.2.3 From 4953992865d70341fe31dfbcc2a8a3453aedbb42 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 16 Nov 2016 13:13:08 -0800 Subject: [jsoncpp] Enable static linking --- ports/jsoncpp/portfile.cmake | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ports/jsoncpp/portfile.cmake b/ports/jsoncpp/portfile.cmake index 68dfcc42a..f4b89adca 100644 --- a/ports/jsoncpp/portfile.cmake +++ b/ports/jsoncpp/portfile.cmake @@ -7,11 +7,19 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(JSONCPP_STATIC OFF) + set(JSONCPP_DYNAMIC ON) +else() + set(JSONCPP_STATIC ON) + set(JSONCPP_DYNAMIC OFF) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS -DJSONCPP_WITH_CMAKE_PACKAGE:BOOL=ON - -DBUILD_STATIC_LIBS:BOOL=OFF - -DBUILD_SHARED_LIBS:BOOL=ON + -DBUILD_STATIC_LIBS:BOOL=${JSONCPP_STATIC} + -DBUILD_SHARED_LIBS:BOOL=${JSONCPP_DYNAMIC} ) vcpkg_install_cmake() -- cgit v1.2.3 From 5e92169aaa1390279354feb013a0ae52fbc08c78 Mon Sep 17 00:00:00 2001 From: Silvio Date: Wed, 16 Nov 2016 22:54:29 +0100 Subject: [libwebp] Fix debug postfix and build Add a debug postfix to libwebp, to simplify finding the debug library in CMake, consistently with most other libraries in vcpkg. Add the mux directory that was not built in the CMake-based build system. --- ports/libwebp/0002-add-missing-directory-to-cmake.patch | 12 ++++++++++++ ports/libwebp/portfile.cmake | 2 ++ 2 files changed, 14 insertions(+) create mode 100644 ports/libwebp/0002-add-missing-directory-to-cmake.patch diff --git a/ports/libwebp/0002-add-missing-directory-to-cmake.patch b/ports/libwebp/0002-add-missing-directory-to-cmake.patch new file mode 100644 index 000000000..a1d230479 --- /dev/null +++ b/ports/libwebp/0002-add-missing-directory-to-cmake.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9172f66..df46bd1 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -249,6 +249,7 @@ parse_Makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/src/dec "${WEBP_SRCS}") + parse_Makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/src/demux "${WEBP_SRCS}") + parse_Makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/src/dsp "${WEBP_SRCS}") + parse_Makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/src/enc "${WEBP_SRCS}") ++parse_Makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/src/mux "${WEBP_SRCS}") + parse_Makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/src/utils "${WEBP_SRCS}") + + # Remove the files specific to SIMD we don't user. diff --git a/ports/libwebp/portfile.cmake b/ports/libwebp/portfile.cmake index d85e4fdaf..8b4c653a9 100644 --- a/ports/libwebp/portfile.cmake +++ b/ports/libwebp/portfile.cmake @@ -10,12 +10,14 @@ vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001-add-install-to-cmake.patch + ${CMAKE_CURRENT_LIST_DIR}/0002-add-missing-directory-to-cmake.patch ) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} # dllexport support seem to be broken OPTIONS -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS:BOOL=ON + -DCMAKE_DEBUG_POSTFIX=d ) vcpkg_install_cmake() -- cgit v1.2.3 From 50d52d49bca2c67cf8982c58977f7b7c3b3ccde6 Mon Sep 17 00:00:00 2001 From: Silvio Date: Wed, 16 Nov 2016 23:09:42 +0100 Subject: [jxrlib] Add debug postfix and do not install SKD header Add a debug postfix to jxrlib, to simplify finding the debug library in CMake, consistently with most other libraries in vcpkg. Do not use or install guiddef.h, that is an header of Windows SDK of which jxrlib includes a copy for non-Windows platforms. --- ports/jxrlib/CMakeLists.txt | 3 +++ ports/jxrlib/portfile.cmake | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/ports/jxrlib/CMakeLists.txt b/ports/jxrlib/CMakeLists.txt index e1df20dad..d9ac84fb6 100644 --- a/ports/jxrlib/CMakeLists.txt +++ b/ports/jxrlib/CMakeLists.txt @@ -8,6 +8,9 @@ project(jxrlib C) # Need shared libs for ABI option(BUILD_SHARED_LIBS "Build shared libraries" ON) +# Add a debug postfix +set(CMAKE_DEBUG_POSTFIX "d") + # helper macro to preserve original Makefile convention macro(JXR_MAKE_OBJ SET_NAME) foreach(src ${SRC_${SET_NAME}}) diff --git a/ports/jxrlib/portfile.cmake b/ports/jxrlib/portfile.cmake index 914adf14e..57c9dc1fe 100644 --- a/ports/jxrlib/portfile.cmake +++ b/ports/jxrlib/portfile.cmake @@ -9,6 +9,10 @@ vcpkg_extract_source_archive(${ARCHIVE}) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +# The file guiddef.h is part of the Windows SDK, +# we then remove the local copy shipped with jxrlib +file(REMOVE ${SOURCE_PATH}/common/include/guiddef.h) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS:BOOL=ON -- cgit v1.2.3 From b93702f1581d012017fb4deccd8b77c96cea8f4c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 16 Nov 2016 15:32:26 -0800 Subject: [libwebp] Bump version --- ports/libwebp/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/libwebp/CONTROL b/ports/libwebp/CONTROL index 43840c45b..608ba2f59 100644 --- a/ports/libwebp/CONTROL +++ b/ports/libwebp/CONTROL @@ -1,3 +1,3 @@ Source: libwebp -Version: 0.5.1 +Version: 0.5.1-1 Description: Lossy compression of digital photographic images. -- cgit v1.2.3 From 592201dfc04734c83b83f1c9f6313a270564c8ec Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 16 Nov 2016 15:32:53 -0800 Subject: [jxrlib] Bump version --- ports/jxrlib/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/jxrlib/CONTROL b/ports/jxrlib/CONTROL index f579d783e..7c3d5d603 100644 --- a/ports/jxrlib/CONTROL +++ b/ports/jxrlib/CONTROL @@ -1,3 +1,3 @@ Source: jxrlib -Version: 1.1 +Version: 1.1-1 Description: Open source implementation of the jpegxr image format standard. -- cgit v1.2.3 From 21c4404d393ec7fdb6513eaba01e63073e5f8e33 Mon Sep 17 00:00:00 2001 From: charlie barto Date: Wed, 16 Nov 2016 19:08:47 -0500 Subject: more glfw3 path fixes --- ports/glfw3/portfile.cmake | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ports/glfw3/portfile.cmake b/ports/glfw3/portfile.cmake index 8ec382fda..69f496969 100644 --- a/ports/glfw3/portfile.cmake +++ b/ports/glfw3/portfile.cmake @@ -12,9 +12,9 @@ if(NOT EXISTS ${CURRENT_BUILDTREES_DIR}/patch.stamp) string(REPLACE "\"@GLFW_LIB_NAME@\"" "NAMES @GLFW_LIB_NAME@ @GLFW_LIB_NAME@dll" CONFIG ${CONFIG} ) - string(REPLACE "@PACKAGE_CMAKE_INSTALL_PREFIX@" "@PACKAGE_CMAKE_INSTALL_PREFIX@/../.." - CONFIG ${CONFIG} - ) + #string(REPLACE "@PACKAGE_CMAKE_INSTALL_PREFIX@" "@PACKAGE_CMAKE_INSTALL_PREFIX@/../.." + # CONFIG ${CONFIG} + #) file(WRITE ${SOURCE_PATH}/src/glfw3Config.cmake.in ${CONFIG}) file(APPEND ${SOURCE_PATH}/src/glfw3Config.cmake.in "set(GLFW3_LIBRARIES \${GLFW3_LIBRARY})\n") file(WRITE ${CURRENT_BUILDTREES_DIR}/patch.stamp) @@ -35,7 +35,8 @@ file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake/glfw3 ${CURRENT_PACKAGES_DIR}/share/glfw3) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/cmake) file(READ ${CURRENT_PACKAGES_DIR}/share/glfw3/glfw3Targets.cmake _contents) -string(REPLACE "get_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)\n\n" "\n" _contents "${_contents}") +set(pattern "get_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)\n") +string(REPLACE "${pattern}${pattern}${pattern}" "${pattern}${pattern}" _contents "${_contents}") file(WRITE ${CURRENT_PACKAGES_DIR}/share/glfw3/glfw3Targets.cmake ${_contents}) file(READ ${CURRENT_PACKAGES_DIR}/debug/lib/cmake/glfw3/glfw3Targets-debug.cmake _contents) -- cgit v1.2.3 From 1574180d03f6ce2f0530c536ed0d4cbd60597e89 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 16 Nov 2016 17:46:41 -0800 Subject: [boost] --toolset=msvc should be toolset=msvc (no dashes) --- ports/boost/portfile.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake index 7394e70ea..f113fc30e 100644 --- a/ports/boost/portfile.cmake +++ b/ports/boost/portfile.cmake @@ -31,11 +31,11 @@ endif() message(STATUS "Bootstrapping done") set(B2_OPTIONS - --toolset=msvc + toolset=msvc + threading=multi -j$ENV{NUMBER_OF_PROCESSORS} -q - --without-python - threading=multi + --without-python --debug-configuration ) -- cgit v1.2.3 From 9c92984ff67ff204415f8973414873c772f0b346 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 16 Nov 2016 17:54:34 -0800 Subject: [boost] Add --hash --- ports/boost/portfile.cmake | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake index f113fc30e..3ddea1a68 100644 --- a/ports/boost/portfile.cmake +++ b/ports/boost/portfile.cmake @@ -31,12 +31,15 @@ endif() message(STATUS "Bootstrapping done") set(B2_OPTIONS - toolset=msvc - threading=multi -j$ENV{NUMBER_OF_PROCESSORS} -q - --without-python --debug-configuration + --hash + + --without-python + toolset=msvc + threading=multi + ) if (VCPKG_CRT_LINKAGE STREQUAL dynamic) -- cgit v1.2.3 From be0899d28bc415236e7f38501ac0dc9741ac89c6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 16 Nov 2016 18:10:22 -0800 Subject: [boost] Attempt to fix sporadic failures --- ports/boost/portfile.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake index 3ddea1a68..5dfdfb617 100644 --- a/ports/boost/portfile.cmake +++ b/ports/boost/portfile.cmake @@ -32,14 +32,12 @@ message(STATUS "Bootstrapping done") set(B2_OPTIONS -j$ENV{NUMBER_OF_PROCESSORS} - -q --debug-configuration --hash --without-python toolset=msvc threading=multi - ) if (VCPKG_CRT_LINKAGE STREQUAL dynamic) @@ -66,7 +64,8 @@ endif() file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) message(STATUS "Building ${TARGET_TRIPLET}-rel") -vcpkg_execute_required_process( +vcpkg_execute_required_process_repeat( + COUNT 2 COMMAND "${SOURCE_PATH}/b2.exe" --stagedir=${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/stage --build-dir=${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel @@ -78,7 +77,8 @@ vcpkg_execute_required_process( ) message(STATUS "Building ${TARGET_TRIPLET}-rel done") message(STATUS "Building ${TARGET_TRIPLET}-dbg") -vcpkg_execute_required_process( +vcpkg_execute_required_process_repeat( + COUNT 2 COMMAND "${SOURCE_PATH}/b2.exe" --stagedir=${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/stage --build-dir=${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg -- cgit v1.2.3 From 3588f534dbc97f74b90ca8c7d1e9713281ae8b81 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 16 Nov 2016 18:56:56 -0800 Subject: [boost] Use --layout=system to make the output binary names simpler --- ports/boost/CONTROL | 2 +- ports/boost/portfile.cmake | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ports/boost/CONTROL b/ports/boost/CONTROL index c96b8cf35..1aed7aa95 100644 --- a/ports/boost/CONTROL +++ b/ports/boost/CONTROL @@ -1,3 +1,3 @@ Source: boost -Version: 1.62-4 +Version: 1.62-5 Description: Peer-reviewed portable C++ source libraries diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake index 5dfdfb617..d3df2b8e7 100644 --- a/ports/boost/portfile.cmake +++ b/ports/boost/portfile.cmake @@ -36,6 +36,7 @@ set(B2_OPTIONS --hash --without-python + --layout=system toolset=msvc threading=multi ) @@ -118,7 +119,6 @@ else() get_filename_component(OLD_FILENAME ${LIB} NAME) get_filename_component(DIRECTORY_OF_LIB_FILE ${LIB} DIRECTORY) string(REPLACE "libboost_" "boost_" NEW_FILENAME ${OLD_FILENAME}) - string(REPLACE "-s-" "-" NEW_FILENAME ${NEW_FILENAME}) file(RENAME ${DIRECTORY_OF_LIB_FILE}/${OLD_FILENAME} ${DIRECTORY_OF_LIB_FILE}/${NEW_FILENAME}) endforeach() endif() @@ -138,7 +138,6 @@ else() get_filename_component(OLD_FILENAME ${LIB} NAME) get_filename_component(DIRECTORY_OF_LIB_FILE ${LIB} DIRECTORY) string(REPLACE "libboost_" "boost_" NEW_FILENAME ${OLD_FILENAME}) - string(REPLACE "-sgd-" "-gd-" NEW_FILENAME ${NEW_FILENAME}) file(RENAME ${DIRECTORY_OF_LIB_FILE}/${OLD_FILENAME} ${DIRECTORY_OF_LIB_FILE}/${NEW_FILENAME}) endforeach() endif() -- cgit v1.2.3 From 56c3febc9de168df0707269e48d31701f60e7673 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 16 Nov 2016 19:26:37 -0800 Subject: [boost] Also rename lib files in dynamic builds (conditionally) i.e. for libboost_xxx.lib, if boost_xxx.lib exists, delete libboost_xxx.lib otherwise rename it to boost_xxx.lib --- ports/boost/CONTROL | 2 +- ports/boost/portfile.cmake | 34 ++++++++++++++++++---------------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/ports/boost/CONTROL b/ports/boost/CONTROL index 1aed7aa95..57dfe58e3 100644 --- a/ports/boost/CONTROL +++ b/ports/boost/CONTROL @@ -1,3 +1,3 @@ Source: boost -Version: 1.62-5 +Version: 1.62-6 Description: Peer-reviewed portable C++ source libraries diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake index d3df2b8e7..7cc0d60b0 100644 --- a/ports/boost/portfile.cmake +++ b/ports/boost/portfile.cmake @@ -101,10 +101,24 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) "\n#define BOOST_ALL_DYN_LINK\n" ) endif() +file(APPEND ${CURRENT_PACKAGES_DIR}/include/boost/config/user.hpp "\n#define BOOST_AUTO_LINK_NOMANGLE\n") file(INSTALL ${SOURCE_PATH}/LICENSE_1_0.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/boost RENAME copyright) message(STATUS "Packaging headers done") +function(boost_remove_lib_prefix_from_lib_files LIBS) + foreach(LIB ${${LIBS}}) + get_filename_component(OLD_FILENAME ${LIB} NAME) + get_filename_component(DIRECTORY_OF_LIB_FILE ${LIB} DIRECTORY) + string(REPLACE "libboost_" "boost_" NEW_FILENAME ${OLD_FILENAME}) + if (EXISTS ${DIRECTORY_OF_LIB_FILE}/${NEW_FILENAME}) + file(REMOVE ${DIRECTORY_OF_LIB_FILE}/${OLD_FILENAME}) + else() + file(RENAME ${DIRECTORY_OF_LIB_FILE}/${OLD_FILENAME} ${DIRECTORY_OF_LIB_FILE}/${NEW_FILENAME}) + endif() + endforeach() +endfunction() + message(STATUS "Packaging ${TARGET_TRIPLET}-rel") file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/stage/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/lib @@ -113,15 +127,9 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/stage/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/bin FILES_MATCHING PATTERN "*.dll") -else() - file(GLOB RELEASE_LIBS ${CURRENT_PACKAGES_DIR}/lib/libboost*.lib) - foreach(LIB ${RELEASE_LIBS}) - get_filename_component(OLD_FILENAME ${LIB} NAME) - get_filename_component(DIRECTORY_OF_LIB_FILE ${LIB} DIRECTORY) - string(REPLACE "libboost_" "boost_" NEW_FILENAME ${OLD_FILENAME}) - file(RENAME ${DIRECTORY_OF_LIB_FILE}/${OLD_FILENAME} ${DIRECTORY_OF_LIB_FILE}/${NEW_FILENAME}) - endforeach() endif() +file(GLOB RELEASE_LIBS ${CURRENT_PACKAGES_DIR}/lib/libboost*.lib) +boost_remove_lib_prefix_from_lib_files(RELEASE_LIBS) message(STATUS "Packaging ${TARGET_TRIPLET}-rel done") message(STATUS "Packaging ${TARGET_TRIPLET}-dbg") @@ -132,15 +140,9 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/stage/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin FILES_MATCHING PATTERN "*.dll") -else() - file(GLOB DEBUG_LIBS ${CURRENT_PACKAGES_DIR}/debug/lib/libboost*.lib) - foreach(LIB ${DEBUG_LIBS}) - get_filename_component(OLD_FILENAME ${LIB} NAME) - get_filename_component(DIRECTORY_OF_LIB_FILE ${LIB} DIRECTORY) - string(REPLACE "libboost_" "boost_" NEW_FILENAME ${OLD_FILENAME}) - file(RENAME ${DIRECTORY_OF_LIB_FILE}/${OLD_FILENAME} ${DIRECTORY_OF_LIB_FILE}/${NEW_FILENAME}) - endforeach() endif() +file(GLOB DEBUG_LIBS ${CURRENT_PACKAGES_DIR}/debug/lib/libboost*.lib) +boost_remove_lib_prefix_from_lib_files(DEBUG_LIBS) message(STATUS "Packaging ${TARGET_TRIPLET}-dbg done") vcpkg_copy_pdbs() -- cgit v1.2.3 From 1cc7a472afc93b88f9fe910b703d7216bfa7979e Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Fri, 11 Nov 2016 00:55:55 -0500 Subject: added libpq port --- ports/libpq/CMakeLists.txt | 74 ++++++++++++++++++++++++++++++++++++++++++++++ ports/libpq/CONTROL | 3 ++ ports/libpq/portfile.cmake | 29 ++++++++++++++++++ 3 files changed, 106 insertions(+) create mode 100644 ports/libpq/CMakeLists.txt create mode 100644 ports/libpq/CONTROL create mode 100644 ports/libpq/portfile.cmake diff --git a/ports/libpq/CMakeLists.txt b/ports/libpq/CMakeLists.txt new file mode 100644 index 000000000..a9e18d4d6 --- /dev/null +++ b/ports/libpq/CMakeLists.txt @@ -0,0 +1,74 @@ +cmake_minimum_required(VERSION 3.5) +project(libpq VERSION 9.6.1 LANGUAGES C) + +find_package(OpenSSL REQUIRED) +set(CMAKE_DEBUG_POSTFIX "d") +configure_file(${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config.h.win32 ${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config.h) +configure_file(${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config_ext.h.win32 ${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config_ext.h) +configure_file(${CMAKE_CURRENT_LIST_DIR}/src/include/port/win32.h ${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config_os.h) +file(WRITE src/interfaces/libpq/pg_config_paths.h "#define SYSCONFDIR \"\"") +set(INSTALL_INCLUDES ON CACHE BOOL "Install include files") +set(pg_port_src + src/port/getaddrinfo.c + src/port/pgstrcasecmp.c + src/port/pqsignal.c + src/port/thread.c + src/port/inet_aton.c + src/port/crypt.c + src/port/noblock.c + src/port/chklocale.c + src/port/inet_net_ntop.c + src/port/snprintf.c + src/port/strlcpy.c + src/port/dirent.c + src/port/dirmod.c + src/port/pgsleep.c + src/port/open.c + src/port/system.c + src/port/win32error.c + src/port/win32setlocale.c +) +set(pg_backend_src + src/backend/libpq/md5.c + src/backend/libpq/ip.c + src/backend/utils/mb/wchar.c + src/backend/utils/mb/encnames.c +) +set(pg_libpq_src + src/interfaces/libpq/fe-auth.c + src/interfaces/libpq/fe-connect.c + src/interfaces/libpq/fe-exec.c + src/interfaces/libpq/fe-lobj.c + src/interfaces/libpq/fe-misc.c + src/interfaces/libpq/fe-print.c + src/interfaces/libpq/fe-protocol2.c + src/interfaces/libpq/fe-protocol3.c + src/interfaces/libpq/fe-secure-openssl.c + src/interfaces/libpq/fe-secure.c + src/interfaces/libpq/libpq-events.c + src/interfaces/libpq/pqexpbuffer.c + src/interfaces/libpq/pthread-win32.c + src/interfaces/libpq/win32.c + src/interfaces/libpq/libpq-dist.rc + src/interfaces/libpq/libpqddll.def + src/interfaces/libpq/libpqdll.def +) +set(pg_libpq_interface + src/include/postgres_ext.h + src/include/pg_config_ext.h + src/interfaces/libpq/libpq-fe.h + ) +set(CMAKE_INCLUDE_CURRENT_DIR ON) +add_library(libpq ${pg_port_src} ${pg_backend_src} ${pg_libpq_src}) +target_compile_definitions(libpq PRIVATE -DFRONTEND -DENABLE_THREAD_SAFETY -DUSE_OPENSSL -D_CRT_SECURE_NO_WARNINGS) +target_link_libraries(libpq PRIVATE OpenSSL::SSL ws2_32 secur32 advapi32 shell32) +target_include_directories(libpq PRIVATE src/include src/include/port/win32 src/include/port/win32_msvc src/port) + +install(TARGETS libpq + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin + ) +if(INSTALL_INCLUDES) + install(FILES ${pg_libpq_interface} DESTINATION include) +endif() \ No newline at end of file diff --git a/ports/libpq/CONTROL b/ports/libpq/CONTROL new file mode 100644 index 000000000..7007a2e1a --- /dev/null +++ b/ports/libpq/CONTROL @@ -0,0 +1,3 @@ +Source: libpq +Version: 9.6.1 +Description: The official database access API of postgresql diff --git a/ports/libpq/portfile.cmake b/ports/libpq/portfile.cmake new file mode 100644 index 000000000..966bef79d --- /dev/null +++ b/ports/libpq/portfile.cmake @@ -0,0 +1,29 @@ +# 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/postgresql-9.6.1) +vcpkg_download_distfile(ARCHIVE + URLS "https://ftp.postgresql.org/pub/source/v9.6.1/postgresql-9.6.1.tar.bz2" + FILENAME "postgresql-9.6.1.tar.bz2" + SHA512 f27af67f9a96f6327150330bf091a803e10eabbac4e488cf5e4d72907e2eb1dbde7282fe0b89fd75711fd8bdcdb3688b5a9eac1e4d6871f4e8681c9c8b0e7c45 +) +vcpkg_extract_source_archive(${ARCHIVE}) +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 -DINSTALL_INCLUDES=OFF +) + +vcpkg_install_cmake() + +# Handle copyright +file(COPY ${SOURCE_PATH}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/libpq) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/libpq/COPYRIGHT ${CURRENT_PACKAGES_DIR}/share/libpq/copyright) -- cgit v1.2.3 From 6c22b89959f3b46cacbdb2f34bfadb45def46e7e Mon Sep 17 00:00:00 2001 From: charlie barto Date: Mon, 14 Nov 2016 23:52:22 -0500 Subject: updated dependencies for libpq --- ports/libpq/CONTROL | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/libpq/CONTROL b/ports/libpq/CONTROL index 7007a2e1a..386588680 100644 --- a/ports/libpq/CONTROL +++ b/ports/libpq/CONTROL @@ -1,3 +1,4 @@ Source: libpq Version: 9.6.1 Description: The official database access API of postgresql +Build-Depends: openssl \ No newline at end of file -- cgit v1.2.3 From 2418a15b0d225fb733fdd89fec8c1d2a5901f381 Mon Sep 17 00:00:00 2001 From: charlie barto Date: Wed, 16 Nov 2016 00:48:57 -0500 Subject: install pg_config.h --- ports/libpq/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/libpq/CMakeLists.txt b/ports/libpq/CMakeLists.txt index a9e18d4d6..93a1e9179 100644 --- a/ports/libpq/CMakeLists.txt +++ b/ports/libpq/CMakeLists.txt @@ -56,6 +56,7 @@ set(pg_libpq_src set(pg_libpq_interface src/include/postgres_ext.h src/include/pg_config_ext.h + src/include/pg_config.h src/interfaces/libpq/libpq-fe.h ) set(CMAKE_INCLUDE_CURRENT_DIR ON) -- cgit v1.2.3 From 79ff44494815c01eac11bfddb0e7a9c26b3e8669 Mon Sep 17 00:00:00 2001 From: charlie barto Date: Wed, 16 Nov 2016 02:34:25 -0500 Subject: removed debug suffix from libpq --- ports/libpq/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/libpq/CMakeLists.txt b/ports/libpq/CMakeLists.txt index 93a1e9179..0fab91724 100644 --- a/ports/libpq/CMakeLists.txt +++ b/ports/libpq/CMakeLists.txt @@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 3.5) project(libpq VERSION 9.6.1 LANGUAGES C) find_package(OpenSSL REQUIRED) -set(CMAKE_DEBUG_POSTFIX "d") configure_file(${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config.h.win32 ${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config.h) configure_file(${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config_ext.h.win32 ${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config_ext.h) configure_file(${CMAKE_CURRENT_LIST_DIR}/src/include/port/win32.h ${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config_os.h) -- cgit v1.2.3 From a77bed25fc0a2a38188e555cd6d9c7f7b11040ce Mon Sep 17 00:00:00 2001 From: charlie barto Date: Wed, 16 Nov 2016 02:57:26 -0500 Subject: revert debug rename, it was a stupid idea --- ports/libpq/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/libpq/CMakeLists.txt b/ports/libpq/CMakeLists.txt index 0fab91724..66c84b639 100644 --- a/ports/libpq/CMakeLists.txt +++ b/ports/libpq/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.5) project(libpq VERSION 9.6.1 LANGUAGES C) - +set(CMAKE_DEBUG_POSTFIX "d") find_package(OpenSSL REQUIRED) configure_file(${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config.h.win32 ${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config.h) configure_file(${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config_ext.h.win32 ${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config_ext.h) -- cgit v1.2.3 From da65430a30bb5d45e8b03794381a8a0f9401ec77 Mon Sep 17 00:00:00 2001 From: charlie barto Date: Wed, 16 Nov 2016 03:02:01 -0500 Subject: made libpq copy pdb files --- ports/libpq/portfile.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/libpq/portfile.cmake b/ports/libpq/portfile.cmake index 966bef79d..14748a1da 100644 --- a/ports/libpq/portfile.cmake +++ b/ports/libpq/portfile.cmake @@ -27,3 +27,5 @@ vcpkg_install_cmake() # Handle copyright file(COPY ${SOURCE_PATH}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/libpq) file(RENAME ${CURRENT_PACKAGES_DIR}/share/libpq/COPYRIGHT ${CURRENT_PACKAGES_DIR}/share/libpq/copyright) + +vcpkg_copy_pdbs() \ No newline at end of file -- cgit v1.2.3 From b81c91489841cb3315b4111f5c9c077a36386151 Mon Sep 17 00:00:00 2001 From: charlie barto Date: Wed, 16 Nov 2016 12:12:04 -0500 Subject: used export all symbols instead of pq's .def files, this is so that we don't have to change the sources depending on debug or release config --- ports/libpq/CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ports/libpq/CMakeLists.txt b/ports/libpq/CMakeLists.txt index 66c84b639..be42c8d32 100644 --- a/ports/libpq/CMakeLists.txt +++ b/ports/libpq/CMakeLists.txt @@ -49,8 +49,6 @@ set(pg_libpq_src src/interfaces/libpq/pthread-win32.c src/interfaces/libpq/win32.c src/interfaces/libpq/libpq-dist.rc - src/interfaces/libpq/libpqddll.def - src/interfaces/libpq/libpqdll.def ) set(pg_libpq_interface src/include/postgres_ext.h @@ -63,7 +61,7 @@ add_library(libpq ${pg_port_src} ${pg_backend_src} ${pg_libpq_src}) target_compile_definitions(libpq PRIVATE -DFRONTEND -DENABLE_THREAD_SAFETY -DUSE_OPENSSL -D_CRT_SECURE_NO_WARNINGS) target_link_libraries(libpq PRIVATE OpenSSL::SSL ws2_32 secur32 advapi32 shell32) target_include_directories(libpq PRIVATE src/include src/include/port/win32 src/include/port/win32_msvc src/port) - +set_target_properties(libpq PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) install(TARGETS libpq ARCHIVE DESTINATION lib LIBRARY DESTINATION lib -- cgit v1.2.3 From dcca77cd67993185e91739545d105f5141f15ea7 Mon Sep 17 00:00:00 2001 From: Charlie Barto Date: Thu, 17 Nov 2016 03:01:38 -0500 Subject: install types and genbki, this seems to be needed for cmake's findpostgresql --- ports/libpq/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ports/libpq/CMakeLists.txt b/ports/libpq/CMakeLists.txt index be42c8d32..19b8787b9 100644 --- a/ports/libpq/CMakeLists.txt +++ b/ports/libpq/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.5) project(libpq VERSION 9.6.1 LANGUAGES C) -set(CMAKE_DEBUG_POSTFIX "d") +#set(CMAKE_DEBUG_POSTFIX "d") find_package(OpenSSL REQUIRED) configure_file(${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config.h.win32 ${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config.h) configure_file(${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config_ext.h.win32 ${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config_ext.h) @@ -56,6 +56,10 @@ set(pg_libpq_interface src/include/pg_config.h src/interfaces/libpq/libpq-fe.h ) +set(pg_libpq_catalog_interface + src/include/catalog/pg_type.h + src/include/catalog/genbki.h +) set(CMAKE_INCLUDE_CURRENT_DIR ON) add_library(libpq ${pg_port_src} ${pg_backend_src} ${pg_libpq_src}) target_compile_definitions(libpq PRIVATE -DFRONTEND -DENABLE_THREAD_SAFETY -DUSE_OPENSSL -D_CRT_SECURE_NO_WARNINGS) @@ -69,4 +73,5 @@ install(TARGETS libpq ) if(INSTALL_INCLUDES) install(FILES ${pg_libpq_interface} DESTINATION include) + install(FILES ${pg_libpq_catalog_interface} DESTINATION include/catalog) endif() \ No newline at end of file -- cgit v1.2.3 From cb488d840739c8cf460d5f6ad5c566afaec51fd4 Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Fri, 11 Nov 2016 00:55:55 -0500 Subject: added libpq port --- ports/libpq/CMakeLists.txt | 2 +- ports/libpq/CONTROL | 2 +- ports/libpq/portfile.cmake | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/libpq/CMakeLists.txt b/ports/libpq/CMakeLists.txt index 19b8787b9..8d222924a 100644 --- a/ports/libpq/CMakeLists.txt +++ b/ports/libpq/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.5) project(libpq VERSION 9.6.1 LANGUAGES C) -#set(CMAKE_DEBUG_POSTFIX "d") + find_package(OpenSSL REQUIRED) configure_file(${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config.h.win32 ${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config.h) configure_file(${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config_ext.h.win32 ${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config_ext.h) diff --git a/ports/libpq/CONTROL b/ports/libpq/CONTROL index 386588680..580a06857 100644 --- a/ports/libpq/CONTROL +++ b/ports/libpq/CONTROL @@ -1,4 +1,4 @@ Source: libpq Version: 9.6.1 Description: The official database access API of postgresql -Build-Depends: openssl \ No newline at end of file +Build-Depends: openssl diff --git a/ports/libpq/portfile.cmake b/ports/libpq/portfile.cmake index 14748a1da..6d5d91055 100644 --- a/ports/libpq/portfile.cmake +++ b/ports/libpq/portfile.cmake @@ -28,4 +28,4 @@ vcpkg_install_cmake() file(COPY ${SOURCE_PATH}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/libpq) file(RENAME ${CURRENT_PACKAGES_DIR}/share/libpq/COPYRIGHT ${CURRENT_PACKAGES_DIR}/share/libpq/copyright) -vcpkg_copy_pdbs() \ No newline at end of file +vcpkg_copy_pdbs() -- cgit v1.2.3 From 5ace53834827430e2353e79cfeafef0dafd9f07b Mon Sep 17 00:00:00 2001 From: charlie barto Date: Wed, 16 Nov 2016 02:57:26 -0500 Subject: revert debug rename, it was a stupid idea --- ports/libpq/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/libpq/CMakeLists.txt b/ports/libpq/CMakeLists.txt index 8d222924a..c03cf40eb 100644 --- a/ports/libpq/CMakeLists.txt +++ b/ports/libpq/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.5) project(libpq VERSION 9.6.1 LANGUAGES C) - +set(CMAKE_DEBUG_POSTFIX "d") find_package(OpenSSL REQUIRED) configure_file(${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config.h.win32 ${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config.h) configure_file(${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config_ext.h.win32 ${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config_ext.h) -- cgit v1.2.3 From 89b42cce9095184f280d2db18859f39be003efd2 Mon Sep 17 00:00:00 2001 From: charlie barto Date: Wed, 16 Nov 2016 03:02:01 -0500 Subject: made libpq copy pdb files --- ports/libpq/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/libpq/portfile.cmake b/ports/libpq/portfile.cmake index 6d5d91055..67a45dba0 100644 --- a/ports/libpq/portfile.cmake +++ b/ports/libpq/portfile.cmake @@ -28,4 +28,5 @@ vcpkg_install_cmake() file(COPY ${SOURCE_PATH}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/libpq) file(RENAME ${CURRENT_PACKAGES_DIR}/share/libpq/COPYRIGHT ${CURRENT_PACKAGES_DIR}/share/libpq/copyright) + vcpkg_copy_pdbs() -- cgit v1.2.3 From 901db2357ad7c7d12e7963f46958c447563a5efe Mon Sep 17 00:00:00 2001 From: Charlie Barto Date: Thu, 17 Nov 2016 03:20:16 -0500 Subject: remove debug postfix again, missed in rebase --- ports/libpq/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/libpq/CMakeLists.txt b/ports/libpq/CMakeLists.txt index c03cf40eb..8d222924a 100644 --- a/ports/libpq/CMakeLists.txt +++ b/ports/libpq/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.5) project(libpq VERSION 9.6.1 LANGUAGES C) -set(CMAKE_DEBUG_POSTFIX "d") + find_package(OpenSSL REQUIRED) configure_file(${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config.h.win32 ${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config.h) configure_file(${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config_ext.h.win32 ${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config_ext.h) -- cgit v1.2.3 From 22108321c032c7417e98ba6afc0d72f91042a40a Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 17 Nov 2016 00:28:54 -0800 Subject: [pcre] [poco] Hardcode value of PCRE_STATIC into the pcre headers. Switch poco to use unbundled libs. --- ports/pcre/CONTROL | 2 +- ports/pcre/portfile.cmake | 10 ++++++++++ ports/poco/CONTROL | 4 ++-- ports/poco/portfile.cmake | 7 +------ 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/ports/pcre/CONTROL b/ports/pcre/CONTROL index eb6863b38..cf6d6c2a5 100644 --- a/ports/pcre/CONTROL +++ b/ports/pcre/CONTROL @@ -1,4 +1,4 @@ Source: pcre -Version: 8.38 +Version: 8.38-1 Description: Perl Compatible Regular Expresions Build-Depends: zlib diff --git a/ports/pcre/portfile.cmake b/ports/pcre/portfile.cmake index 0dcc8a97c..8fd6c8819 100644 --- a/ports/pcre/portfile.cmake +++ b/ports/pcre/portfile.cmake @@ -32,6 +32,16 @@ vcpkg_configure_cmake( vcpkg_install_cmake() +foreach(FILE ${CURRENT_PACKAGES_DIR}/include/pcre.h ${CURRENT_PACKAGES_DIR}/include/pcreposix.h) + file(READ ${FILE} PCRE_H) + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + string(REPLACE "defined(PCRE_STATIC)" "1" PCRE_H "${PCRE_H}") + else() + string(REPLACE "defined(PCRE_STATIC)" "0" PCRE_H "${PCRE_H}") + endif() + file(WRITE ${FILE} "${PCRE_H}") +endforeach() + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) diff --git a/ports/poco/CONTROL b/ports/poco/CONTROL index 71e55eb6c..2265e1f08 100644 --- a/ports/poco/CONTROL +++ b/ports/poco/CONTROL @@ -1,4 +1,4 @@ Source: poco -Version: 1.7.6 -Build-Depends: +Version: 1.7.6-1 +Build-Depends: zlib, pcre, sqlite3, expat Description: Modern, powerful open source C++ class libraries for building network and internet-based applications that run on desktop, server, mobile and embedded systems. \ No newline at end of file diff --git a/ports/poco/portfile.cmake b/ports/poco/portfile.cmake index cb5b7f139..d89323a2a 100644 --- a/ports/poco/portfile.cmake +++ b/ports/poco/portfile.cmake @@ -14,17 +14,12 @@ vcpkg_apply_patches( ${CMAKE_CURRENT_LIST_DIR}/config_h.patch ) -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - set(POCO_STATIC ON) -endif() - vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS - -DPOCO_STATIC=${POCO_STATIC} -DENABLE_SEVENZIP=ON -DENABLE_TESTS=OFF - -DPOCO_UNBUNDLED=OFF # OFF means: using internal copy of sqlite, libz, pcre, expat, ... + -DPOCO_UNBUNDLED=ON # OFF means: using internal copy of sqlite, libz, pcre, expat, ... ) vcpkg_install_cmake() -- cgit v1.2.3 From 039cee135248e7667c4a8a8f5f8ec195bc726231 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 17 Nov 2016 00:35:33 -0800 Subject: [poco] Revert removal of POCO_STATIC, I misread it as PCRE_STATIC :) --- ports/poco/portfile.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ports/poco/portfile.cmake b/ports/poco/portfile.cmake index d89323a2a..a707936c4 100644 --- a/ports/poco/portfile.cmake +++ b/ports/poco/portfile.cmake @@ -14,9 +14,16 @@ vcpkg_apply_patches( ${CMAKE_CURRENT_LIST_DIR}/config_h.patch ) +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + set(POCO_STATIC ON) +else() + set(POCO_STATIC OFF) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS + -DPOCO_STATIC=${POCO_STATIC} -DENABLE_SEVENZIP=ON -DENABLE_TESTS=OFF -DPOCO_UNBUNDLED=ON # OFF means: using internal copy of sqlite, libz, pcre, expat, ... -- cgit v1.2.3 From a9223bd8df10483c9e5497c55c99fdf26cd2a6c2 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 17 Nov 2016 15:20:18 -0800 Subject: [coff] Variable rename --- toolsrc/src/coff_file_reader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolsrc/src/coff_file_reader.cpp b/toolsrc/src/coff_file_reader.cpp index db8524faa..c6bfc33d2 100644 --- a/toolsrc/src/coff_file_reader.cpp +++ b/toolsrc/src/coff_file_reader.cpp @@ -195,8 +195,8 @@ namespace vcpkg { namespace COFFFileReader { static const size_t ALIGNMENT_SIZE = 2; - const fpos_t new_offset = align_to(member_size, ALIGNMENT_SIZE); - fs.seekg(new_offset, ios_base::cur); + const fpos_t advance_by = align_to(member_size, ALIGNMENT_SIZE); + fs.seekg(advance_by, ios_base::cur); } static void read_and_verify_archive_file_signature(fstream& fs) -- cgit v1.2.3 From 6c2ce4981f7e463c8187aa62c461da564977cea3 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 17 Nov 2016 15:21:22 -0800 Subject: [coff] Function rename --- toolsrc/src/coff_file_reader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolsrc/src/coff_file_reader.cpp b/toolsrc/src/coff_file_reader.cpp index c6bfc33d2..5dd32bcd5 100644 --- a/toolsrc/src/coff_file_reader.cpp +++ b/toolsrc/src/coff_file_reader.cpp @@ -54,7 +54,7 @@ namespace vcpkg { namespace COFFFileReader fs.seekg(offset_to_PE_signature + PE_SIGNATURE_SIZE, ios_base::beg); } - static fpos_t align_to(const fpos_t unaligned_offset, const int alignment_size) + static fpos_t align_offset_to_size(const fpos_t unaligned_offset, const int alignment_size) { fpos_t aligned_offset = unaligned_offset - 1; aligned_offset /= alignment_size; @@ -195,7 +195,7 @@ namespace vcpkg { namespace COFFFileReader { static const size_t ALIGNMENT_SIZE = 2; - const fpos_t advance_by = align_to(member_size, ALIGNMENT_SIZE); + const fpos_t advance_by = align_offset_to_size(member_size, ALIGNMENT_SIZE); fs.seekg(advance_by, ios_base::cur); } -- cgit v1.2.3 From c82847682397ed084aec0a69074a3985f7fb18f9 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 17 Nov 2016 15:42:20 -0800 Subject: Add (undocumented) --checks-only option to the build command --- toolsrc/src/commands_installation.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_installation.cpp index 0f0cfc954..f7af2ef7c 100644 --- a/toolsrc/src/commands_installation.cpp +++ b/toolsrc/src/commands_installation.cpp @@ -13,9 +13,11 @@ namespace vcpkg { - using Dependencies::package_spec_with_install_plan; + 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); @@ -129,11 +131,19 @@ namespace vcpkg // Allowing only 1 package for now. args.check_exact_arg_count(1, example.c_str()); + 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.c_str()); 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()) + { + 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()); -- cgit v1.2.3 From 9ab1ea53313b7db5c6fc695643dc896b294238c9 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 17 Nov 2016 15:43:47 -0800 Subject: [coff] member_size() now returns already aligned size --- toolsrc/src/coff_file_reader.cpp | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/toolsrc/src/coff_file_reader.cpp b/toolsrc/src/coff_file_reader.cpp index 5dd32bcd5..1766cf8e9 100644 --- a/toolsrc/src/coff_file_reader.cpp +++ b/toolsrc/src/coff_file_reader.cpp @@ -54,13 +54,13 @@ namespace vcpkg { namespace COFFFileReader fs.seekg(offset_to_PE_signature + PE_SIGNATURE_SIZE, ios_base::beg); } - static fpos_t align_offset_to_size(const fpos_t unaligned_offset, const int alignment_size) + static fpos_t align_to_size(const uint64_t unaligned, const uint64_t alignment_size) { - fpos_t aligned_offset = unaligned_offset - 1; - aligned_offset /= alignment_size; - aligned_offset += 1; - aligned_offset *= alignment_size; - return aligned_offset; + fpos_t aligned = unaligned - 1; + aligned /= alignment_size; + aligned += 1; + aligned *= alignment_size; + return aligned; } struct coff_file_header @@ -129,12 +129,16 @@ namespace vcpkg { namespace COFFFileReader uint64_t member_size() const { + static const size_t ALIGNMENT_SIZE = 2; + static const size_t HEADER_SIZE_OFFSET = 48; static const size_t HEADER_SIZE_FIELD_SIZE = 10; const std::string as_string = data.substr(HEADER_SIZE_OFFSET, HEADER_SIZE_FIELD_SIZE); // This is in ASCII decimal representation const uint64_t value = std::strtoull(as_string.c_str(), nullptr, 10); - return value; + + const uint64_t aligned = align_to_size(value, ALIGNMENT_SIZE); + return aligned; } std::string data; @@ -191,14 +195,6 @@ namespace vcpkg { namespace COFFFileReader std::string data; }; - static void skip_archive_member(fstream& fs, uint64_t member_size) - { - static const size_t ALIGNMENT_SIZE = 2; - - const fpos_t advance_by = align_offset_to_size(member_size, ALIGNMENT_SIZE); - fs.seekg(advance_by, ios_base::cur); - } - static void read_and_verify_archive_file_signature(fstream& fs) { static const char* FILE_START = "!\n"; @@ -232,19 +228,19 @@ namespace vcpkg { namespace COFFFileReader // First Linker Member const archive_member_header first_linker_member_header = archive_member_header::read(fs); Checks::check_exit(first_linker_member_header.name().substr(0, 2) == "/ ", "Could not find proper first linker member"); - skip_archive_member(fs, first_linker_member_header.member_size()); + fs.seekg(first_linker_member_header.member_size(), ios_base::cur); const archive_member_header second_linker_member_header = archive_member_header::read(fs); Checks::check_exit(second_linker_member_header.name().substr(0, 2) == "/ ", "Could not find proper second linker member"); // The first 4 bytes contains the number of archive members const uint32_t archive_member_count = peek_value_from_stream(fs); - skip_archive_member(fs, second_linker_member_header.member_size()); + fs.seekg(second_linker_member_header.member_size(), ios_base::cur); bool hasLongnameMemberHeader = peek_value_from_stream(fs) == 0x2F2F; if (hasLongnameMemberHeader) { const archive_member_header longnames_member_header = archive_member_header::read(fs); - skip_archive_member(fs, longnames_member_header.member_size()); + fs.seekg(longnames_member_header.member_size(), ios_base::cur); } std::set machine_types; @@ -259,7 +255,7 @@ namespace vcpkg { namespace COFFFileReader const MachineType machine = isImportHeader ? import_header::peek(fs).machineType() : coff_file_header::peek(fs).machineType(); machine_types.insert(machine); } - skip_archive_member(fs, header.member_size()); + fs.seekg(header.member_size(), ios_base::cur); } return {std::vector(machine_types.cbegin(), machine_types.cend())}; -- cgit v1.2.3 From f0ef09c3fcd78936b8219a7530f17b21911cc8cd Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 17 Nov 2016 16:19:46 -0800 Subject: [coff] Introduce marker_t. Eliminate one of the peek functions --- toolsrc/src/coff_file_reader.cpp | 51 ++++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 15 deletions(-) diff --git a/toolsrc/src/coff_file_reader.cpp b/toolsrc/src/coff_file_reader.cpp index 1766cf8e9..9ea79bf99 100644 --- a/toolsrc/src/coff_file_reader.cpp +++ b/toolsrc/src/coff_file_reader.cpp @@ -173,14 +173,6 @@ namespace vcpkg { namespace COFFFileReader return ret; } - static import_header peek(fstream& fs) - { - auto original_pos = fs.tellg().seekpos(); - import_header ret = read(fs); - fs.seekg(original_pos); - return ret; - } - MachineType machineType() const { static const size_t MACHINE_TYPE_OFFSET = 6; @@ -218,6 +210,27 @@ namespace vcpkg { namespace COFFFileReader return {machine}; } + struct marker_t + { + void set_to_current_pos(fstream& fs) + { + this->m_absolute_position = fs.tellg().seekpos(); + } + + void seek_to_marker(fstream& fs) const + { + fs.seekg(this->m_absolute_position, ios_base::beg); + } + + void advance_by(const uint64_t offset) + { + this->m_absolute_position += offset; + } + + private: + fpos_t m_absolute_position = 0; + }; + lib_info read_lib(const fs::path path) { std::fstream fs(path, std::ios::in | std::ios::binary | std::ios::ate); @@ -225,23 +238,30 @@ namespace vcpkg { namespace COFFFileReader read_and_verify_archive_file_signature(fs); + marker_t marker; + marker.set_to_current_pos(fs); + // First Linker Member const archive_member_header first_linker_member_header = archive_member_header::read(fs); Checks::check_exit(first_linker_member_header.name().substr(0, 2) == "/ ", "Could not find proper first linker member"); - fs.seekg(first_linker_member_header.member_size(), ios_base::cur); + marker.advance_by(archive_member_header::HEADER_SIZE + first_linker_member_header.member_size()); + marker.seek_to_marker(fs); const archive_member_header second_linker_member_header = archive_member_header::read(fs); Checks::check_exit(second_linker_member_header.name().substr(0, 2) == "/ ", "Could not find proper second linker member"); // The first 4 bytes contains the number of archive members - const uint32_t archive_member_count = peek_value_from_stream(fs); - fs.seekg(second_linker_member_header.member_size(), ios_base::cur); + const uint32_t archive_member_count = read_value_from_stream(fs); + marker.advance_by(archive_member_header::HEADER_SIZE + second_linker_member_header.member_size()); + marker.seek_to_marker(fs); - bool hasLongnameMemberHeader = peek_value_from_stream(fs) == 0x2F2F; + bool hasLongnameMemberHeader = read_value_from_stream(fs) == 0x2F2F; if (hasLongnameMemberHeader) { + marker.seek_to_marker(fs); const archive_member_header longnames_member_header = archive_member_header::read(fs); - fs.seekg(longnames_member_header.member_size(), ios_base::cur); + marker.advance_by(archive_member_header::HEADER_SIZE + longnames_member_header.member_size()); } + marker.seek_to_marker(fs); std::set machine_types; // Next we have the obj and pseudo-object files @@ -252,10 +272,11 @@ namespace vcpkg { namespace COFFFileReader { const uint16_t first_two_bytes = peek_value_from_stream(fs); const bool isImportHeader = getMachineType(first_two_bytes) == MachineType::UNKNOWN; - const MachineType machine = isImportHeader ? import_header::peek(fs).machineType() : coff_file_header::peek(fs).machineType(); + const MachineType machine = isImportHeader ? import_header::read(fs).machineType() : coff_file_header::peek(fs).machineType(); machine_types.insert(machine); } - fs.seekg(header.member_size(), ios_base::cur); + marker.advance_by(archive_member_header::HEADER_SIZE + header.member_size()); + marker.seek_to_marker(fs); } return {std::vector(machine_types.cbegin(), machine_types.cend())}; -- cgit v1.2.3 From c6ac0e5ca74a719a6990f6bba5002883900ad85c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 17 Nov 2016 16:22:22 -0800 Subject: [coff] Eliminate another peek() function --- toolsrc/src/coff_file_reader.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/toolsrc/src/coff_file_reader.cpp b/toolsrc/src/coff_file_reader.cpp index 9ea79bf99..6a2a57159 100644 --- a/toolsrc/src/coff_file_reader.cpp +++ b/toolsrc/src/coff_file_reader.cpp @@ -75,14 +75,6 @@ namespace vcpkg { namespace COFFFileReader return ret; } - static coff_file_header peek(fstream& fs) - { - auto original_pos = fs.tellg().seekpos(); - coff_file_header ret = read(fs); - fs.seekg(original_pos); - return ret; - } - MachineType machineType() const { static const size_t MACHINE_TYPE_OFFSET = 0; @@ -272,7 +264,7 @@ namespace vcpkg { namespace COFFFileReader { const uint16_t first_two_bytes = peek_value_from_stream(fs); const bool isImportHeader = getMachineType(first_two_bytes) == MachineType::UNKNOWN; - const MachineType machine = isImportHeader ? import_header::read(fs).machineType() : coff_file_header::peek(fs).machineType(); + const MachineType machine = isImportHeader ? import_header::read(fs).machineType() : coff_file_header::read(fs).machineType(); machine_types.insert(machine); } marker.advance_by(archive_member_header::HEADER_SIZE + header.member_size()); -- cgit v1.2.3 From 7805de1a5686f192bc4b174f3a98098505788d5b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 17 Nov 2016 16:28:09 -0800 Subject: [coff] Use peek_value() --- toolsrc/src/coff_file_reader.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/toolsrc/src/coff_file_reader.cpp b/toolsrc/src/coff_file_reader.cpp index 6a2a57159..763443e6e 100644 --- a/toolsrc/src/coff_file_reader.cpp +++ b/toolsrc/src/coff_file_reader.cpp @@ -246,14 +246,13 @@ namespace vcpkg { namespace COFFFileReader marker.advance_by(archive_member_header::HEADER_SIZE + second_linker_member_header.member_size()); marker.seek_to_marker(fs); - bool hasLongnameMemberHeader = read_value_from_stream(fs) == 0x2F2F; + bool hasLongnameMemberHeader = peek_value_from_stream(fs) == 0x2F2F; if (hasLongnameMemberHeader) { - marker.seek_to_marker(fs); const archive_member_header longnames_member_header = archive_member_header::read(fs); marker.advance_by(archive_member_header::HEADER_SIZE + longnames_member_header.member_size()); + marker.seek_to_marker(fs); } - marker.seek_to_marker(fs); std::set machine_types; // Next we have the obj and pseudo-object files -- cgit v1.2.3 From ca5989fb1f8aa0749213cba203e1a87d47bd44a8 Mon Sep 17 00:00:00 2001 From: Charlie Barto Date: Thu, 17 Nov 2016 22:53:37 -0500 Subject: add support for SOCI --- ports/libpq/CMakeLists.txt | 1 + ports/soci/CONTROL | 3 +++ ports/soci/portfile.cmake | 50 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 ports/soci/CONTROL create mode 100644 ports/soci/portfile.cmake diff --git a/ports/libpq/CMakeLists.txt b/ports/libpq/CMakeLists.txt index 8d222924a..517039d8f 100644 --- a/ports/libpq/CMakeLists.txt +++ b/ports/libpq/CMakeLists.txt @@ -73,5 +73,6 @@ install(TARGETS libpq ) if(INSTALL_INCLUDES) install(FILES ${pg_libpq_interface} DESTINATION include) + install(DIRECTORY src/include/libpq DESTINATION include) install(FILES ${pg_libpq_catalog_interface} DESTINATION include/catalog) endif() \ No newline at end of file diff --git a/ports/soci/CONTROL b/ports/soci/CONTROL new file mode 100644 index 000000000..5480bb712 --- /dev/null +++ b/ports/soci/CONTROL @@ -0,0 +1,3 @@ +Source: soci +Version: 2016.10.22 +Description: SOCI database access library diff --git a/ports/soci/portfile.cmake b/ports/soci/portfile.cmake new file mode 100644 index 000000000..885c3c634 --- /dev/null +++ b/ports/soci/portfile.cmake @@ -0,0 +1,50 @@ +# 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/soci-6eb1a3e9775ab7cdbf0f7f5aa5891792313cd8d9) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/SOCI/soci/archive/6eb1a3e9775ab7cdbf0f7f5aa5891792313cd8d9.zip" + FILENAME "soci-master-2016.10.22.zip" + SHA512 6bb0f7d3442de627089760485d3e663f12873b4871c4b4b4dfac5d380bad014865ac8382f7356e02514e9140f187dea8dcf8d6c25ac9c3e827e9fa69e9ed13b5 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + set(PORT_EXTRA_OPTIONS -DSOCI_STATIC=ON + -DSOCI_SHARED=OFF) +elseif(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(PORT_EXTRA_OPTIONS -DSOCI_STATIC=OFF + -DSOCI_SHARED=ON) +endif() +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DSOCI_TESTS=OFF + -DSOCI_CXX_C11=ON + -DLIBDIR=lib +) + +vcpkg_install_cmake() + +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/soci) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(RENAME ${CURRENT_PACKAGES_DIR}/cmake/SOCI.cmake ${CURRENT_PACKAGES_DIR}/share/soci/SOCIConfig.cmake) +file(RENAME ${CURRENT_PACKAGES_DIR}/cmake/SOCI-release.cmake ${CURRENT_PACKAGES_DIR}/share/soci/SOCI-release.cmake) +file(RENAME ${CURRENT_PACKAGES_DIR}/debug/cmake/SOCI-debug.cmake ${CURRENT_PACKAGES_DIR}/share/soci/SOCI-debug.cmake) +file(READ ${CURRENT_PACKAGES_DIR}/share/soci/SOCIConfig.cmake CONFIG_FILE) +set(pattern "get_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)\n") +string(REPLACE "${pattern}" "${pattern}${pattern}" CONFIG_FILE ${CONFIG_FILE}) +file(WRITE ${CURRENT_PACKAGES_DIR}/share/soci/SOCIConfig.cmake ${CONFIG_FILE}) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/cmake) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/cmake) +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE_1_0.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/soci) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/soci/LICENSE_1_0.txt ${CURRENT_PACKAGES_DIR}/share/soci/copyright) + +vcpkg_copy_pdbs() \ No newline at end of file -- cgit v1.2.3 From f3cb18292c2624279606f9e1098b6fc7c3f569a8 Mon Sep 17 00:00:00 2001 From: sdcb Date: Fri, 18 Nov 2016 13:46:18 +0800 Subject: Fix poco-pcre debug link issue Should fix: https://github.com/Microsoft/vcpkg/issues/302 --- ports/poco/CONTROL | 2 +- ports/poco/find_pcre.patch | 13 +++++++++++++ ports/poco/portfile.cmake | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 ports/poco/find_pcre.patch diff --git a/ports/poco/CONTROL b/ports/poco/CONTROL index 2265e1f08..6f4f7e3b1 100644 --- a/ports/poco/CONTROL +++ b/ports/poco/CONTROL @@ -1,4 +1,4 @@ Source: poco -Version: 1.7.6-1 +Version: 1.7.6-2 Build-Depends: zlib, pcre, sqlite3, expat Description: Modern, powerful open source C++ class libraries for building network and internet-based applications that run on desktop, server, mobile and embedded systems. \ No newline at end of file diff --git a/ports/poco/find_pcre.patch b/ports/poco/find_pcre.patch new file mode 100644 index 000000000..b846660f7 --- /dev/null +++ b/ports/poco/find_pcre.patch @@ -0,0 +1,13 @@ +diff --git a/cmake/FindPCRE.cmake b/cmake/FindPCRE.cmake +index 03f07df..4da1895 100644 +--- a/cmake/FindPCRE.cmake ++++ b/cmake/FindPCRE.cmake +@@ -16,7 +16,7 @@ ENDIF (PCRE_INCLUDE_DIRS) + + FIND_PATH(PCRE_INCLUDE_DIR pcre.h) + +-SET(PCRE_NAMES pcre) ++SET(PCRE_NAMES pcred pcre) + FIND_LIBRARY(PCRE_LIBRARY NAMES ${PCRE_NAMES} ) + + # handle the QUIETLY and REQUIRED arguments and set PCRE_FOUND to TRUE if diff --git a/ports/poco/portfile.cmake b/ports/poco/portfile.cmake index a707936c4..413f19c7e 100644 --- a/ports/poco/portfile.cmake +++ b/ports/poco/portfile.cmake @@ -12,6 +12,7 @@ vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES ${CMAKE_CURRENT_LIST_DIR}/config_h.patch + ${CMAKE_CURRENT_LIST_DIR}/find_pcre.patch ) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) -- cgit v1.2.3 From ba28195eb8ead2724400c6d0cdf123dbfadadffb Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 17 Nov 2016 17:36:30 -0800 Subject: [coff] Read the second linker offsets to deduce the real offset count Those that start with 0 are ignored --- toolsrc/src/coff_file_reader.cpp | 46 +++++++++++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 8 deletions(-) diff --git a/toolsrc/src/coff_file_reader.cpp b/toolsrc/src/coff_file_reader.cpp index 763443e6e..e8bb6089c 100644 --- a/toolsrc/src/coff_file_reader.cpp +++ b/toolsrc/src/coff_file_reader.cpp @@ -136,6 +136,38 @@ namespace vcpkg { namespace COFFFileReader std::string data; }; + struct offsets_array + { + static offsets_array read(fstream& fs, const uint32_t offset_count) + { + static const size_t OFFSET_WIDTH = 4; + + std::string raw_offsets; + const size_t raw_offset_size = offset_count * OFFSET_WIDTH; + raw_offsets.resize(raw_offset_size); + fs.read(&raw_offsets[0], raw_offset_size); + + offsets_array ret; + for (uint32_t i = 0; i < offset_count; ++i) + { + const std::string value_as_string = raw_offsets.substr(OFFSET_WIDTH * i, OFFSET_WIDTH * (i + 1)); + const uint32_t value = reinterpret_bytes(value_as_string.c_str()); + + // Ignore offsets that point to offset 0. See vcpkg github #223 #288 #292 + if (value != 0) + { + ret.data.push_back(value); + } + } + + // Sort the offsets, because it is possible for them to be unsorted. See vcpkg github #292 + std::sort(ret.data.begin(), ret.data.end()); + return ret; + } + + std::vector data; + }; + struct import_header { static const size_t HEADER_SIZE = 20; @@ -243,6 +275,7 @@ namespace vcpkg { namespace COFFFileReader Checks::check_exit(second_linker_member_header.name().substr(0, 2) == "/ ", "Could not find proper second linker member"); // The first 4 bytes contains the number of archive members const uint32_t archive_member_count = read_value_from_stream(fs); + const offsets_array offsets = offsets_array::read(fs, archive_member_count); marker.advance_by(archive_member_header::HEADER_SIZE + second_linker_member_header.member_size()); marker.seek_to_marker(fs); @@ -256,16 +289,13 @@ namespace vcpkg { namespace COFFFileReader std::set machine_types; // Next we have the obj and pseudo-object files - for (uint32_t i = 0; i < archive_member_count; i++) + for (uint32_t i = 0; i < offsets.data.size(); i++) { const archive_member_header header = archive_member_header::read(fs); - if (header.data[0] != '\0') // Due to freeglut. github issue #223 - { - const uint16_t first_two_bytes = peek_value_from_stream(fs); - const bool isImportHeader = getMachineType(first_two_bytes) == MachineType::UNKNOWN; - const MachineType machine = isImportHeader ? import_header::read(fs).machineType() : coff_file_header::read(fs).machineType(); - machine_types.insert(machine); - } + const uint16_t first_two_bytes = peek_value_from_stream(fs); + const bool isImportHeader = getMachineType(first_two_bytes) == MachineType::UNKNOWN; + const MachineType machine = isImportHeader ? import_header::read(fs).machineType() : coff_file_header::read(fs).machineType(); + machine_types.insert(machine); marker.advance_by(archive_member_header::HEADER_SIZE + header.member_size()); marker.seek_to_marker(fs); } -- cgit v1.2.3 From 26a8ed58becf42c2c448aa9ee7621ed2c26319fc Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 18 Nov 2016 13:36:45 -0800 Subject: [coff] Use the offsets_array to go to archive members. Fixes #292 --- toolsrc/src/coff_file_reader.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/toolsrc/src/coff_file_reader.cpp b/toolsrc/src/coff_file_reader.cpp index e8bb6089c..3bf7922f5 100644 --- a/toolsrc/src/coff_file_reader.cpp +++ b/toolsrc/src/coff_file_reader.cpp @@ -236,6 +236,11 @@ namespace vcpkg { namespace COFFFileReader struct marker_t { + void set_to_offset(const fpos_t position) + { + this->m_absolute_position = position; + } + void set_to_current_pos(fstream& fs) { this->m_absolute_position = fs.tellg().seekpos(); @@ -289,15 +294,14 @@ namespace vcpkg { namespace COFFFileReader std::set machine_types; // Next we have the obj and pseudo-object files - for (uint32_t i = 0; i < offsets.data.size(); i++) + for (const uint32_t offset : offsets.data) { - const archive_member_header header = archive_member_header::read(fs); + marker.set_to_offset(offset + archive_member_header::HEADER_SIZE); // Skip the header, no need to read it. + marker.seek_to_marker(fs); const uint16_t first_two_bytes = peek_value_from_stream(fs); const bool isImportHeader = getMachineType(first_two_bytes) == MachineType::UNKNOWN; const MachineType machine = isImportHeader ? import_header::read(fs).machineType() : coff_file_header::read(fs).machineType(); machine_types.insert(machine); - marker.advance_by(archive_member_header::HEADER_SIZE + header.member_size()); - marker.seek_to_marker(fs); } return {std::vector(machine_types.cbegin(), machine_types.cend())}; -- cgit v1.2.3 From de9728cfe10c73b2cd9bd8ff0d09a596bb777659 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 18 Nov 2016 20:29:35 -0800 Subject: [libuv] Update to 1.10.1 --- ports/libuv/CONTROL | 2 +- ports/libuv/portfile.cmake | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/libuv/CONTROL b/ports/libuv/CONTROL index 32d44cf39..6401d169d 100644 --- a/ports/libuv/CONTROL +++ b/ports/libuv/CONTROL @@ -1,3 +1,3 @@ Source: libuv -Version: 1.9.1 +Version: 1.10.1 Description: libuv is a multi-platform support library with a focus on asynchronous I/O. \ No newline at end of file diff --git a/ports/libuv/portfile.cmake b/ports/libuv/portfile.cmake index 5f5cd0474..334a72a6d 100644 --- a/ports/libuv/portfile.cmake +++ b/ports/libuv/portfile.cmake @@ -3,11 +3,11 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-src/libuv-1.9.1) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-src/libuv-1.10.1) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/libuv/libuv/archive/v1.9.1.zip" - FILENAME "libuv-v1.9.1.zip" - SHA512 3eb8711e3612fb3f5a1ddeb4614b2bec29c022ac5c6c2590bc5239825d758a73be0819c52747956a029859ef4e416bf3fce16665bac2c6c4890f736b47c38226 + URLS "https://github.com/libuv/libuv/archive/v1.10.1.zip" + FILENAME "libuv-v1.10.1.zip" + SHA512 5a1e4b8e4584fccbc3df5bb46cf0efd7165169709d9b2a0e06fe534afbf7a262500cf665441ef64f8f7029b535f722119ab0faa4fb1367b05452d88a3e02bd2b ) if(NOT EXISTS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-src) -- cgit v1.2.3 From 447160a19e8881d46b7e77ad8893f6445c3c74f2 Mon Sep 17 00:00:00 2001 From: Charlie Barto Date: Sat, 19 Nov 2016 01:33:31 -0500 Subject: add support for VS 2017 --- scripts/buildsystems/vcpkg.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index aafeb531c..54960a138 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -12,6 +12,12 @@ if(NOT VCPKG_TOOLCHAIN) set(_VCPKG_TARGET_TRIPLET_ARCH arm) elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 14 2015$") set(_VCPKG_TARGET_TRIPLET_ARCH x86) + elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 15 2017 Win64$") + set(_VCPKG_TARGET_TRIPLET_ARCH x64) + elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 15 2017 ARM") + set(_VCPKG_TARGET_TRIPLET_ARCH arm) + elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 15 2017") + set(_VCPKG_TARGET_TRIPLET_ARCH x86) else() find_program(_VCPKG_CL cl) if(_VCPKG_CL MATCHES "amd64/cl.exe$" OR _VCPKG_CL MATCHES "x64/cl.exe$") -- cgit v1.2.3 From f04288b88fdb265ad8e8353e9052af946bc9b043 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sat, 19 Nov 2016 15:45:34 -0800 Subject: [libuv] Add branching for dynamic/static building --- ports/libuv/portfile.cmake | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ports/libuv/portfile.cmake b/ports/libuv/portfile.cmake index 334a72a6d..0c74a2f8c 100644 --- a/ports/libuv/portfile.cmake +++ b/ports/libuv/portfile.cmake @@ -53,16 +53,22 @@ endif() set(ENV{GYP_MSVS_VERSION} 2015) set(ENV{PYTHON} ${PYTHON2}) +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(LIBUV_LINKAGE shared) +else() + set(LIBUV_LINKAGE static) +endif() + if(TRIPLET_SYSTEM_ARCH MATCHES "x86|x64") message(STATUS "Building Release") vcpkg_execute_required_process( - COMMAND cmd /c vcbuild.bat release ${TRIPLET_SYSTEM_ARCH} shared + COMMAND cmd /c vcbuild.bat release ${TRIPLET_SYSTEM_ARCH} ${LIBUV_LINKAGE} WORKING_DIRECTORY ${SOURCE_PATH} LOGNAME ${TARGET_TRIPLET}-build-rel ) message(STATUS "Building Debug") vcpkg_execute_required_process( - COMMAND cmd /c vcbuild.bat debug ${TRIPLET_SYSTEM_ARCH} shared + COMMAND cmd /c vcbuild.bat debug ${TRIPLET_SYSTEM_ARCH} ${LIBUV_LINKAGE} WORKING_DIRECTORY ${SOURCE_PATH} LOGNAME ${TARGET_TRIPLET}-build-dbg ) -- cgit v1.2.3 From b706e4b93a23fa26580eea3089226e9ff0fc85e4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sat, 19 Nov 2016 16:16:28 -0800 Subject: [libuv] Enable static building --- ports/libuv/portfile.cmake | 48 ++++++++++++++++------------------------------ 1 file changed, 17 insertions(+), 31 deletions(-) diff --git a/ports/libuv/portfile.cmake b/ports/libuv/portfile.cmake index 0c74a2f8c..f71ba9f88 100644 --- a/ports/libuv/portfile.cmake +++ b/ports/libuv/portfile.cmake @@ -1,7 +1,3 @@ -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(STATUS "Warning: Static building not supported yet. Building dynamic.") - set(VCPKG_LIBRARY_LINKAGE dynamic) -endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-src/libuv-1.10.1) vcpkg_download_distfile(ARCHIVE @@ -76,15 +72,7 @@ else() message(FATAL_ERROR "Unsupported platform") endif() -file(MAKE_DIRECTORY - ${CURRENT_PACKAGES_DIR}/include - ${CURRENT_PACKAGES_DIR}/lib - ${CURRENT_PACKAGES_DIR}/bin - ${CURRENT_PACKAGES_DIR}/debug/lib - ${CURRENT_PACKAGES_DIR}/debug/bin - ${CURRENT_PACKAGES_DIR}/share/libuv - ) - +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/include) file(COPY ${SOURCE_PATH}/include/tree.h ${SOURCE_PATH}/include/uv.h @@ -94,23 +82,21 @@ file(COPY ${SOURCE_PATH}/include/uv-win.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) -file(COPY - ${SOURCE_PATH}/Debug/libuv.dll - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) -file(COPY - ${SOURCE_PATH}/Debug/libuv.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) -file(COPY - ${SOURCE_PATH}/Release/libuv.dll - DESTINATION ${CURRENT_PACKAGES_DIR}/bin) -file(COPY - ${SOURCE_PATH}/Release/libuv.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/lib) -file(COPY - ${SOURCE_PATH}/LICENSE - DESTINATION ${CURRENT_PACKAGES_DIR}/share/libuv) +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/lib ${CURRENT_PACKAGES_DIR}/debug/lib) +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) + file(COPY ${SOURCE_PATH}/Debug/libuv.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + file(COPY ${SOURCE_PATH}/Release/libuv.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + file(COPY ${SOURCE_PATH}/Debug/libuv.dll DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) + file(COPY ${SOURCE_PATH}/Release/libuv.dll DESTINATION ${CURRENT_PACKAGES_DIR}/bin) +else() + file(COPY ${SOURCE_PATH}/Debug/lib/libuv.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + file(COPY ${SOURCE_PATH}/Release/lib/libuv.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) +endif() + + +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/libuv) +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libuv) -file(RENAME - ${CURRENT_PACKAGES_DIR}/share/libuv/LICENSE - ${CURRENT_PACKAGES_DIR}/share/libuv/copyright) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/libuv/LICENSE ${CURRENT_PACKAGES_DIR}/share/libuv/copyright) vcpkg_copy_pdbs() -- cgit v1.2.3 From 2538bdac5a8932c93efe5b87666e373c8c817ca4 Mon Sep 17 00:00:00 2001 From: sdcb Date: Mon, 21 Nov 2016 11:19:08 +0800 Subject: Upgrade libbson to 1.5.0-rc6 Add support for libbson-static build. Do not use the patch file for libbson. --- ports/libbson/0001_cmake.patch | 35 ----------------------------------- ports/libbson/CONTROL | 2 +- ports/libbson/portfile.cmake | 40 +++++++++++++++++++++++++--------------- 3 files changed, 26 insertions(+), 51 deletions(-) delete mode 100644 ports/libbson/0001_cmake.patch diff --git a/ports/libbson/0001_cmake.patch b/ports/libbson/0001_cmake.patch deleted file mode 100644 index af1f1a598..000000000 --- a/ports/libbson/0001_cmake.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index d09a298..e64a6cd 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -12,7 +12,6 @@ include(CheckIncludeFile) - include(CheckStructHasMember) - include(CheckSymbolExists) - include(TestBigEndian) --include(InstallRequiredSystemLibraries) - - set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/build/cmake) - -@@ -47,13 +46,6 @@ TEST_BIG_ENDIAN(BSON_BIG_ENDIAN) - set (BSON_PTHREAD_ONCE_INIT_NEEDS_BRACES 0) - set (BSON_HAVE_DECIMAL128 0) - --#librt needed on linux for clock_gettime --find_library(RT_LIBRARY rt) --if (RT_LIBRARY) -- #set required libraries for CHECK_FUNCTION_EXISTS -- set(CMAKE_REQUIRED_LIBRARIES ${RT_LIBRARY}) --endif() -- - # See https://public.kitware.com/Bug/view.php?id=15659 - CHECK_SYMBOL_EXISTS(snprintf stdio.h BSON_HAVE_SNPRINTF) - if (NOT BSON_HAVE_SNPRINTF) -@@ -314,7 +306,7 @@ install( - ) - install( - FILES ${HEADERS} -- DESTINATION "include/libbson-${BSON_API_VERSION}" -+ DESTINATION "include" - ) - - set(VERSION "${BSON_VERSION}") diff --git a/ports/libbson/CONTROL b/ports/libbson/CONTROL index 71f48c354..089e34672 100644 --- a/ports/libbson/CONTROL +++ b/ports/libbson/CONTROL @@ -1,3 +1,3 @@ Source: libbson -Version: 1.4.2 +Version: 1.5.0-rc6 Description: libbson is a library providing useful routines related to building, parsing, and iterating BSON documents. \ No newline at end of file diff --git a/ports/libbson/portfile.cmake b/ports/libbson/portfile.cmake index 71846b643..7f219a4c7 100644 --- a/ports/libbson/portfile.cmake +++ b/ports/libbson/portfile.cmake @@ -1,28 +1,38 @@ -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(STATUS "Warning: Static building not supported yet. Building dynamic.") - set(VCPKG_LIBRARY_LINKAGE dynamic) -endif() include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libbson-1.4.2) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libbson-1.5.0-rc6) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/mongodb/libbson/releases/download/1.4.2/libbson-1.4.2.tar.gz" - FILENAME "libbson-1.4.2.tar.gz" - SHA512 4cc8f833978483af3dcbc30bede33f2a9b448930fabf7be2d5581c8368e875dc1707d31eae209c747e69be1f82fa525c7362c5ac9c4e0b6b3f3346dd5147860e + URLS "https://github.com/mongodb/libbson/archive/1.5.0-rc6.tar.gz" + FILENAME "libbson-1.5.0-rc6.tar.gz" + SHA512 15cf590b488f7de8d614ddcc2c1536b05b607311f3cd3353418469c7a62177124fb4fb1c53f51b0de4c7491b21051c1ec47fbc12856cc69e37baebb3d65897c5 ) vcpkg_extract_source_archive(${ARCHIVE}) -vcpkg_apply_patches( - SOURCE_PATH ${SOURCE_PATH} - PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001_cmake.patch -) - vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DENABLE_TESTS=OFF + -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=ON ) vcpkg_install_cmake() + +file(RENAME + ${CURRENT_PACKAGES_DIR}/include/libbson-1.0 + ${CURRENT_PACKAGES_DIR}/temp) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include) +file(RENAME ${CURRENT_PACKAGES_DIR}/temp ${CURRENT_PACKAGES_DIR}/include) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libbson) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/libbson/COPYING ${CURRENT_PACKAGES_DIR}/share/libbson/copyright) \ No newline at end of file +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/bson-1.0.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/bson-1.0.lib) +else() + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/bson-static-1.0.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/bson-static-1.0.lib) +endif() + +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libbson RENAME copyright) \ No newline at end of file -- cgit v1.2.3 From 51a9334d1b16cf00f3e547eb9e6b162ac34c526e Mon Sep 17 00:00:00 2001 From: sdcb Date: Mon, 21 Nov 2016 11:53:06 +0800 Subject: Fix static build runtime error. --- ports/libbson/portfile.cmake | 7 +++++++ ports/libbson/static.patch | 13 +++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 ports/libbson/static.patch diff --git a/ports/libbson/portfile.cmake b/ports/libbson/portfile.cmake index 7f219a4c7..4f8dc0e25 100644 --- a/ports/libbson/portfile.cmake +++ b/ports/libbson/portfile.cmake @@ -30,6 +30,13 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/bson-1.0.lib) file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/bson-1.0.lib) + + # drop the __declspec(dllimport) when building static + vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/static.patch + ) else() file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/bson-static-1.0.lib) file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/bson-static-1.0.lib) diff --git a/ports/libbson/static.patch b/ports/libbson/static.patch new file mode 100644 index 000000000..adb52fa4f --- /dev/null +++ b/ports/libbson/static.patch @@ -0,0 +1,13 @@ +diff --git a/bson-macros.h b/bson-macros.h +index 909bf6c..0a1f612 100644 +--- a/bson-macros.h ++++ b/bson-macros.h +@@ -69,7 +69,7 @@ + # ifdef BSON_COMPILATION + # define BSON_API __declspec(dllexport) + # else +-# define BSON_API __declspec(dllimport) ++# define BSON_API + # endif + #elif defined(__GNUC__) + # define BSON_API __attribute__ ((visibility ("default"))) -- cgit v1.2.3 From b63d35b10ba2cc0b0569c7a18509fb71ff6f6ca5 Mon Sep 17 00:00:00 2001 From: sdcb Date: Mon, 21 Nov 2016 13:51:48 +0800 Subject: [mongo-c-driver] Upgrade to 1.5.0-rc6 Enable building static library. Exclude test and examples. --- ports/libbson/portfile.cmake | 7 ++++++ ports/mongo-c-driver/CONTROL | 4 ++-- ports/mongo-c-driver/portfile.cmake | 47 +++++++++++++++++++++++++------------ 3 files changed, 41 insertions(+), 17 deletions(-) diff --git a/ports/libbson/portfile.cmake b/ports/libbson/portfile.cmake index 4f8dc0e25..7642c3437 100644 --- a/ports/libbson/portfile.cmake +++ b/ports/libbson/portfile.cmake @@ -31,6 +31,13 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/bson-1.0.lib) file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/bson-1.0.lib) + file(RENAME + ${CURRENT_PACKAGES_DIR}/lib/bson-static-1.0.lib + ${CURRENT_PACKAGES_DIR}/lib/bson-1.0.lib) + file(RENAME + ${CURRENT_PACKAGES_DIR}/debug/lib/bson-static-1.0.lib + ${CURRENT_PACKAGES_DIR}/debug/lib/bson-1.0.lib) + # drop the __declspec(dllimport) when building static vcpkg_apply_patches( SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include diff --git a/ports/mongo-c-driver/CONTROL b/ports/mongo-c-driver/CONTROL index b0cec868c..6288a1fa7 100644 --- a/ports/mongo-c-driver/CONTROL +++ b/ports/mongo-c-driver/CONTROL @@ -1,4 +1,4 @@ Source: mongo-c-driver -Version: 1.4.2 -Build-Depends: libbson +Version: 1.5.0-rc6 +Build-Depends: libbson, openssl Description: Client library written in C for MongoDB. \ No newline at end of file diff --git a/ports/mongo-c-driver/portfile.cmake b/ports/mongo-c-driver/portfile.cmake index 1aa83f6bb..f9a247499 100644 --- a/ports/mongo-c-driver/portfile.cmake +++ b/ports/mongo-c-driver/portfile.cmake @@ -1,30 +1,47 @@ -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(STATUS "Warning: Static building not supported yet. Building dynamic.") #Blocked by libbson - set(VCPKG_LIBRARY_LINKAGE dynamic) -endif() include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mongo-c-driver-1.4.2) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mongo-c-driver-1.5.0-rc6) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/mongodb/mongo-c-driver/releases/download/1.4.2/mongo-c-driver-1.4.2.tar.gz" - FILENAME "mongo-c-driver-1.4.2.tar.gz" - SHA512 402b9d0f2ae957a07336c9a6d971440472acef8e17a3ba5e89635ca454a13d4b7cf5f9b71151ed6182c012efb5fac6684acfc00443c6bca07cdd04b9f7eddaeb + URLS "https://github.com/mongodb/mongo-c-driver/archive/1.5.0-rc6.tar.gz" + FILENAME "mongo-c-driver-1.5.0-rc6.tar.gz" + SHA512 708caf4e963bad97b4802456c6f5809a0ba8c24fe5faaf0e91aa889a0690df4324005f8d324b3bfc80ffc76f1594612a8d391d7421dd914c58369c24cf8cc965 ) vcpkg_extract_source_archive(${ARCHIVE}) -vcpkg_apply_patches( - SOURCE_PATH ${SOURCE_PATH} - PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001_cmake.patch -) - vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS -DBSON_ROOT_DIR=${CURRENT_INSTALLED_DIR} + -DENABLE_TESTS=OFF + -DENABLE_EXAMPLES=OFF + -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=ON ) vcpkg_install_cmake() + +file(RENAME + ${CURRENT_PACKAGES_DIR}/include/libmongoc-1.0 + ${CURRENT_PACKAGES_DIR}/temp) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include) +file(RENAME ${CURRENT_PACKAGES_DIR}/temp ${CURRENT_PACKAGES_DIR}/include) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver/COPYING ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver/copyright) \ No newline at end of file +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/mongoc-1.0.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/mongoc-1.0.lib) + + file(RENAME + ${CURRENT_PACKAGES_DIR}/lib/mongoc-static-1.0.lib + ${CURRENT_PACKAGES_DIR}/lib/mongoc-1.0.lib) + file(RENAME + ${CURRENT_PACKAGES_DIR}/debug/lib/mongoc-static-1.0.lib + ${CURRENT_PACKAGES_DIR}/debug/lib/mongoc-1.0.lib) +else() + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/mongoc-static-1.0.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/mongoc-static-1.0.lib) +endif() + +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver RENAME copyright) \ No newline at end of file -- cgit v1.2.3 From 6fc5aeae74b9ccee2c34d2b8e22a8ec73d99e8f1 Mon Sep 17 00:00:00 2001 From: sdcb Date: Mon, 21 Nov 2016 13:59:42 +0800 Subject: [mongo-c-driver] openssl is optional dependency. --- ports/mongo-c-driver/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/mongo-c-driver/CONTROL b/ports/mongo-c-driver/CONTROL index 6288a1fa7..330ff27af 100644 --- a/ports/mongo-c-driver/CONTROL +++ b/ports/mongo-c-driver/CONTROL @@ -1,4 +1,4 @@ Source: mongo-c-driver Version: 1.5.0-rc6 -Build-Depends: libbson, openssl +Build-Depends: libbson Description: Client library written in C for MongoDB. \ No newline at end of file -- cgit v1.2.3 From 260f5f20c3eb741e6b4e91eb46cc18253615a56f Mon Sep 17 00:00:00 2001 From: sdcb Date: Mon, 21 Nov 2016 17:41:25 +0800 Subject: [mongo-cxx-driver] Upgrade to 3.0.3 Enable static build Disable test and example --- ports/mongo-cxx-driver/0001_cmake.patch | 64 --------- ports/mongo-cxx-driver/CONTROL | 2 +- .../disable_test_and_example.patch | 149 +++++++++++++++++++++ ports/mongo-cxx-driver/portfile.cmake | 73 ++++++++-- 4 files changed, 209 insertions(+), 79 deletions(-) delete mode 100644 ports/mongo-cxx-driver/0001_cmake.patch create mode 100644 ports/mongo-cxx-driver/disable_test_and_example.patch diff --git a/ports/mongo-cxx-driver/0001_cmake.patch b/ports/mongo-cxx-driver/0001_cmake.patch deleted file mode 100644 index 6e93e4755..000000000 --- a/ports/mongo-cxx-driver/0001_cmake.patch +++ /dev/null @@ -1,64 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 695f64c..87807d6 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -59,7 +59,6 @@ set(CMAKE_CXX_EXTENSIONS OFF) - - # Include the required modules - include(GenerateExportHeader) --include(InstallRequiredSystemLibraries) - - # If the user did not customize the install prefix, - # set it to live under build so we don't inadverently pollute /usr/local -diff --git a/cmake/FindLibBSON.cmake b/cmake/FindLibBSON.cmake -index 52f5de0..7a0be52 100644 ---- a/cmake/FindLibBSON.cmake -+++ b/cmake/FindLibBSON.cmake -@@ -26,7 +26,7 @@ if(LIBBSON_DIR) - # Trust the user's override path by default - set(LIBBSON_LIBRARIES bson-1.0 CACHE INTERNAL "") - set(LIBBSON_LIBRARY_DIRS ${LIBBSON_DIR}/lib CACHE INTERNAL "") -- set(LIBBSON_INCLUDE_DIRS ${LIBBSON_DIR}/include/libbson-1.0 CACHE INTERNAL "") -+ set(LIBBSON_INCLUDE_DIRS ${LIBBSON_DIR}/include CACHE INTERNAL "") - find_package_handle_standard_args(LIBBSON DEFAULT_MSG LIBBSON_LIBRARIES LIBBSON_LIBRARY_DIRS LIBBSON_INCLUDE_DIRS) - elseif (PKG_CONFIG_FOUND) - # The best we can do until libbson starts installing a libbson-config.cmake file -diff --git a/cmake/FindLibMongoC.cmake b/cmake/FindLibMongoC.cmake -index 830de11..7e0bc76 100644 ---- a/cmake/FindLibMongoC.cmake -+++ b/cmake/FindLibMongoC.cmake -@@ -26,7 +26,7 @@ if(LIBMONGOC_DIR) - # Trust the user's override path by default - set(LIBMONGOC_LIBRARIES mongoc-1.0 CACHE INTERNAL "") - set(LIBMONGOC_LIBRARY_DIRS ${LIBMONGOC_DIR}/lib CACHE INTERNAL "") -- set(LIBMONGOC_INCLUDE_DIRS ${LIBMONGOC_DIR}/include/libmongoc-1.0 CACHE INTERNAL "") -+ set(LIBMONGOC_INCLUDE_DIRS ${LIBMONGOC_DIR}/include CACHE INTERNAL "") - find_package_handle_standard_args(LIBMONGOC DEFAULT_MSG LIBMONGOC_LIBRARIES LIBMONGOC_LIBRARY_DIRS LIBMONGOC_INCLUDE_DIRS) - elseif (PKG_CONFIG_FOUND) - # The best we can do until libMONGOC starts installing a libmongoc-config.cmake file -diff --git a/src/bsoncxx/CMakeLists.txt b/src/bsoncxx/CMakeLists.txt -index cea1bc9..481529c 100644 ---- a/src/bsoncxx/CMakeLists.txt -+++ b/src/bsoncxx/CMakeLists.txt -@@ -60,7 +60,7 @@ endif() - - set(BSONCXX_VERSION ${BSONCXX_VERSION_MAJOR}.${BSONCXX_VERSION_MINOR}.${BSONCXX_VERSION_PATCH}${BSONCXX_VERSION_EXTRA}) - set(BSONCXX_INLINE_NAMESPACE "v${BSONCXX_ABI_VERSION}") --set(BSONCXX_HEADER_INSTALL_DIR "include/bsoncxx/${BSONCXX_INLINE_NAMESPACE}" CACHE INTERNAL "") -+set(BSONCXX_HEADER_INSTALL_DIR "include" CACHE INTERNAL "") - - set(LIBBSON_REQUIRED_VERSION 1.3.4) - set(LIBBSON_REQUIRED_ABI_VERSION 1.0) -diff --git a/src/mongocxx/CMakeLists.txt b/src/mongocxx/CMakeLists.txt -index fdbe61a..7d5c2c9 100644 ---- a/src/mongocxx/CMakeLists.txt -+++ b/src/mongocxx/CMakeLists.txt -@@ -32,7 +32,7 @@ set(MONGOCXX_ABI_VERSION _noabi) - - set(MONGOCXX_VERSION ${MONGOCXX_VERSION_MAJOR}.${MONGOCXX_VERSION_MINOR}.${MONGOCXX_VERSION_PATCH}${MONGOCXX_VERSION_EXTRA}) - set(MONGOCXX_INLINE_NAMESPACE "v${MONGOCXX_ABI_VERSION}") --set(MONGOCXX_HEADER_INSTALL_DIR "include/mongocxx/${MONGOCXX_INLINE_NAMESPACE}" CACHE INTERNAL "") -+set(MONGOCXX_HEADER_INSTALL_DIR "include" CACHE INTERNAL "") - - add_subdirectory(config) - diff --git a/ports/mongo-cxx-driver/CONTROL b/ports/mongo-cxx-driver/CONTROL index 1e2611b13..41c958400 100644 --- a/ports/mongo-cxx-driver/CONTROL +++ b/ports/mongo-cxx-driver/CONTROL @@ -1,4 +1,4 @@ Source: mongo-cxx-driver -Version: 3.0.2 +Version: 3.0.3 Build-Depends: boost,libbson,mongo-c-driver Description: MongoDB C++ Driver. \ No newline at end of file diff --git a/ports/mongo-cxx-driver/disable_test_and_example.patch b/ports/mongo-cxx-driver/disable_test_and_example.patch new file mode 100644 index 000000000..d542628f7 --- /dev/null +++ b/ports/mongo-cxx-driver/disable_test_and_example.patch @@ -0,0 +1,149 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4538920..e783ff5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -74,66 +74,66 @@ endif() + + set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +-add_custom_target(hugo_dir +- COMMAND ${CMAKE_COMMAND} -E make_directory hugo +-) +- +-add_custom_target(hugo +- DEPENDS hugo_dir +- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/docs +- COMMAND hugo +- VERBATIM +-) +- +-add_custom_target(hugo-deploy +- DEPENDS hugo +- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} +- COMMAND etc/deploy-to-ghpages.pl --hugo git@github.com:mongodb/mongo-cxx-driver +- VERBATIM +-) +- +-add_custom_target(docs_dir_current +- COMMAND ${CMAKE_COMMAND} -E make_directory docs/api/current +-) +- +-add_custom_target(doxygen-current +- DEPENDS docs_dir_current +- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} +- COMMAND doxygen ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile +- VERBATIM +-) +- +-add_custom_target(doxygen-all +- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} +- COMMAND etc/generate-all-apidocs.pl +- VERBATIM +-) +- +-add_custom_target(doxygen-deploy +- DEPENDS doxygen-all +- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} +- COMMAND etc/deploy-to-ghpages.pl --doxygen git@github.com:mongodb/mongo-cxx-driver +- VERBATIM +-) +- +-add_custom_target(format +- python ${CMAKE_SOURCE_DIR}/etc/clang_format.py format +- VERBATIM +-) +- +-add_custom_target(format-lint +- python ${CMAKE_SOURCE_DIR}/etc/clang_format.py lint +- VERBATIM +-) +- +-add_custom_target(docs +- DEPENDS hugo doxygen-current +-) +- +-set(THIRD_PARTY_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/third_party) ++#add_custom_target(hugo_dir ++# COMMAND ${CMAKE_COMMAND} -E make_directory hugo ++#) ++# ++#add_custom_target(hugo ++# DEPENDS hugo_dir ++# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/docs ++# COMMAND hugo ++# VERBATIM ++#) ++# ++#add_custom_target(hugo-deploy ++# DEPENDS hugo ++# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ++# COMMAND etc/deploy-to-ghpages.pl --hugo git@github.com:mongodb/mongo-cxx-driver ++# VERBATIM ++#) ++# ++#add_custom_target(docs_dir_current ++# COMMAND ${CMAKE_COMMAND} -E make_directory docs/api/current ++#) ++# ++#add_custom_target(doxygen-current ++# DEPENDS docs_dir_current ++# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ++# COMMAND doxygen ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile ++# VERBATIM ++#) ++# ++#add_custom_target(doxygen-all ++# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ++# COMMAND etc/generate-all-apidocs.pl ++# VERBATIM ++#) ++# ++#add_custom_target(doxygen-deploy ++# DEPENDS doxygen-all ++# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ++# COMMAND etc/deploy-to-ghpages.pl --doxygen git@github.com:mongodb/mongo-cxx-driver ++# VERBATIM ++#) ++# ++#add_custom_target(format ++# python ${CMAKE_SOURCE_DIR}/etc/clang_format.py format ++# VERBATIM ++#) ++# ++#add_custom_target(format-lint ++# python ${CMAKE_SOURCE_DIR}/etc/clang_format.py lint ++# VERBATIM ++#) ++# ++#add_custom_target(docs ++# DEPENDS hugo doxygen-current ++#) ++# ++#set(THIRD_PARTY_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/third_party) + + enable_testing() + + add_subdirectory(src) + +-add_subdirectory(examples EXCLUDE_FROM_ALL) ++#add_subdirectory(examples EXCLUDE_FROM_ALL) +diff --git a/src/bsoncxx/CMakeLists.txt b/src/bsoncxx/CMakeLists.txt +index 010f5e4..a9a7ada 100644 +--- a/src/bsoncxx/CMakeLists.txt ++++ b/src/bsoncxx/CMakeLists.txt +@@ -202,4 +202,4 @@ install( + DESTINATION lib/cmake/libbsoncxx-${BSONCXX_VERSION} + ) + +-add_subdirectory(test) ++#add_subdirectory(test) +diff --git a/src/mongocxx/CMakeLists.txt b/src/mongocxx/CMakeLists.txt +index 12d188b..2ef54e4 100644 +--- a/src/mongocxx/CMakeLists.txt ++++ b/src/mongocxx/CMakeLists.txt +@@ -209,4 +209,4 @@ install( + DESTINATION lib/cmake/libmongocxx-${MONGOCXX_VERSION} + ) + +-add_subdirectory(test) ++#add_subdirectory(test) diff --git a/ports/mongo-cxx-driver/portfile.cmake b/ports/mongo-cxx-driver/portfile.cmake index 2972f1c5b..f37913cdc 100644 --- a/ports/mongo-cxx-driver/portfile.cmake +++ b/ports/mongo-cxx-driver/portfile.cmake @@ -1,20 +1,16 @@ -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(STATUS "Warning: Static building not supported yet. Building dynamic.") #Blocked by libbson - set(VCPKG_LIBRARY_LINKAGE dynamic) -endif() include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mongo-cxx-driver-r3.0.2) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mongo-cxx-driver-r3.0.3) vcpkg_download_distfile(ARCHIVE - URLS "https://codeload.github.com/mongodb/mongo-cxx-driver/zip/r3.0.2" - FILENAME "mongo-cxx-driver-r3.0.2.zip" - SHA512 f3f1902df22ad58090ec2d4f22c9746d32b12552934d0eaf686b7e3b2e65ac9eeff9e28944cde75c5f5834735e8b76f879e1ca0e7095195f22e3ce6dd92b4524 + URLS "https://github.com/mongodb/mongo-cxx-driver/archive/r3.0.3.tar.gz" + FILENAME "mongo-cxx-driver-r3.0.3.tar.gz" + SHA512 29f7ae77dab160c4279eb2eba8e960b25afc7118bf82570d240f5c68e1e17b10dc99910c855888467c304d70399f2d02031463b0c168a95ad0b9323742ccfd35 ) vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} - PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001_cmake.patch + PATCHES ${CMAKE_CURRENT_LIST_DIR}/disable_test_and_example.patch ) vcpkg_configure_cmake( @@ -22,13 +18,62 @@ vcpkg_configure_cmake( OPTIONS -DLIBBSON_DIR=${CURRENT_INSTALLED_DIR} -DLIBMONGOC_DIR=${CURRENT_INSTALLED_DIR} + -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=ON ) vcpkg_install_cmake() -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/cmake) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(RENAME + ${CURRENT_PACKAGES_DIR}/include/bsoncxx/v_noabi/bsoncxx + ${CURRENT_PACKAGES_DIR}/temp) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/bsoncxx) +file(RENAME ${CURRENT_PACKAGES_DIR}/temp ${CURRENT_PACKAGES_DIR}/include/bsoncxx) + +file(RENAME + ${CURRENT_PACKAGES_DIR}/include/mongocxx/v_noabi/mongocxx + ${CURRENT_PACKAGES_DIR}/temp) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/mongocxx) +file(RENAME ${CURRENT_PACKAGES_DIR}/temp ${CURRENT_PACKAGES_DIR}/include/mongocxx) + +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/lib/cmake + ${CURRENT_PACKAGES_DIR}/debug/lib/cmake + + ${CURRENT_PACKAGES_DIR}/include/bsoncxx/cmake + ${CURRENT_PACKAGES_DIR}/include/bsoncxx/config/private + ${CURRENT_PACKAGES_DIR}/include/bsoncxx/private + ${CURRENT_PACKAGES_DIR}/include/bsoncxx/test + ${CURRENT_PACKAGES_DIR}/include/bsoncxx/third_party + + ${CURRENT_PACKAGES_DIR}/include/mongocxx/cmake + ${CURRENT_PACKAGES_DIR}/include/mongocxx/config/private + ${CURRENT_PACKAGES_DIR}/include/mongocxx/test + ${CURRENT_PACKAGES_DIR}/include/mongocxx/test_util + ${CURRENT_PACKAGES_DIR}/include/mongocxx/private + ${CURRENT_PACKAGES_DIR}/include/mongocxx/exception/private + + ${CURRENT_PACKAGES_DIR}/debug/include) + + +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/bsoncxx.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/bsoncxx.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/mongocxx.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/mongocxx.lib) + + file(RENAME + ${CURRENT_PACKAGES_DIR}/lib/libbsoncxx.lib + ${CURRENT_PACKAGES_DIR}/lib/bsoncxx.lib) + file(RENAME + ${CURRENT_PACKAGES_DIR}/debug/lib/libmongocxx.lib + ${CURRENT_PACKAGES_DIR}/debug/lib/mongocxx.lib) +else() + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/libbsoncxx.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/libbsoncxx.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/libmongocxx.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/libmongocxx.lib) +endif() -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/mongo-cxx-driver) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/mongo-cxx-driver/LICENSE ${CURRENT_PACKAGES_DIR}/share/mongo-cxx-driver/copyright) \ No newline at end of file +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/mongo-cxx-driver RENAME copyright) \ No newline at end of file -- cgit v1.2.3 From 686fef9bfe27665f7427812529bcb4143afa45ff Mon Sep 17 00:00:00 2001 From: sdcb Date: Mon, 21 Nov 2016 18:04:18 +0800 Subject: [mongo-cxx-driver] there is a failure on link stage, cannot build static, warn and then build dynamic --- ports/mongo-cxx-driver/portfile.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ports/mongo-cxx-driver/portfile.cmake b/ports/mongo-cxx-driver/portfile.cmake index f37913cdc..dc6a13caf 100644 --- a/ports/mongo-cxx-driver/portfile.cmake +++ b/ports/mongo-cxx-driver/portfile.cmake @@ -1,3 +1,8 @@ +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(STATUS "Warning: Static building not supported yet. Building dynamic.") #Blocked by build failure + set(VCPKG_LIBRARY_LINKAGE dynamic) +endif() + include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mongo-cxx-driver-r3.0.3) -- cgit v1.2.3 From 6b713035fb164732b888576250f5d5dd5b607166 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Thu, 17 Nov 2016 16:43:08 +0100 Subject: [libjpeg-turbo] Fix static libraries name The libraries with the "-static" suffix are not found by CMake --- ports/libjpeg-turbo/portfile.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ports/libjpeg-turbo/portfile.cmake b/ports/libjpeg-turbo/portfile.cmake index c9672332e..aaa01547c 100644 --- a/ports/libjpeg-turbo/portfile.cmake +++ b/ports/libjpeg-turbo/portfile.cmake @@ -38,6 +38,14 @@ vcpkg_configure_cmake( vcpkg_install_cmake() +# Rename libraries for static builds +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(RENAME "${CURRENT_PACKAGES_DIR}/lib/jpeg-static.lib" "${CURRENT_PACKAGES_DIR}/lib/jpeg.lib") + file(RENAME "${CURRENT_PACKAGES_DIR}/lib/turbojpeg-static.lib" "${CURRENT_PACKAGES_DIR}/lib/turbojpeg.lib") + file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/jpeg-static.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/jpeg.lib") + file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/turbojpeg-static.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/turbojpeg.lib") +endif() + file(COPY ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/libjpeg-turbo -- cgit v1.2.3 From 1d2761ec40e6960be7e4289e959a32f69cea1794 Mon Sep 17 00:00:00 2001 From: codicodi Date: Mon, 21 Nov 2016 20:39:50 +0100 Subject: Bump fmt version to 3.0.1 --- ports/fmt/CONTROL | 2 +- ports/fmt/portfile.cmake | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/fmt/CONTROL b/ports/fmt/CONTROL index a84adbfc3..b54c468b3 100644 --- a/ports/fmt/CONTROL +++ b/ports/fmt/CONTROL @@ -1,3 +1,3 @@ Source: fmt -Version: 3.0.0-1 +Version: 3.0.1 Description: Formatting library for C++. It can be used as a safe alternative to printf or as a fast alternative to IOStreams. diff --git a/ports/fmt/portfile.cmake b/ports/fmt/portfile.cmake index 471fab2d2..152b878a7 100644 --- a/ports/fmt/portfile.cmake +++ b/ports/fmt/portfile.cmake @@ -3,11 +3,11 @@ # set(VCPKG_LIBRARY_LINKAGE static) #endif() include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/fmt-3.0.0) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/fmt-3.0.1) vcpkg_download_distfile(ARCHIVE_FILE - URLS "https://github.com/fmtlib/fmt/archive/3.0.0.tar.gz" - FILENAME "fmt-3.0.0.tar.gz" - SHA512 20c9b1ffe8b46cb5d22015122fc698a75ad854709d3de1a1316b6040d86f54bada4e6d7263f2f1fd94cb13ac37ee9447c162c6aec3f3af650455e8a8a9804871 + URLS "https://github.com/fmtlib/fmt/archive/3.0.1.tar.gz" + FILENAME "fmt-3.0.1.tar.gz" + SHA512 daf5dfb2fe63eb611983fa248bd2182c6202cf1c4f0fc236f357040fce8e87ad531cdf59090306bb313ea333d546e516f467b385e05094e696d0ca091310aad6 ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) -- cgit v1.2.3 From 1b7f21a3e9cb6eb3ccd1a7c22a7813150466ed6c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 21 Nov 2016 12:50:23 -0800 Subject: [post-build-checks] Add check about no lib files --- toolsrc/src/post_build_lint.cpp | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index 1a5f22f0a..1e7e87e6e 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -7,6 +7,9 @@ #include "coff_file_reader.h" #include "BuildInfo.h" #include +#include +#include +#include "vcpkg_Maps.h" namespace fs = std::tr2::sys; @@ -417,6 +420,17 @@ namespace vcpkg return lint_status::ERROR_DETECTED; } + static lint_status check_lib_files_are_available_if_dlls_are_available(const size_t lib_count, const size_t dll_count, const fs::path& lib_dir) + { + if (lib_count == 0 && dll_count != 0) + { + System::println(System::color::warning, "Import libs were not present in %s", lib_dir.generic_string()); + return lint_status::ERROR_DETECTED; + } + + return lint_status::SUCCESS; + } + static lint_status check_no_subdirectories(const fs::path& dir) { const std::vector subdirectories = recursive_find_matching_paths_in_dir(dir, [&](const fs::path& current) @@ -602,8 +616,13 @@ namespace vcpkg error_count += check_for_copyright_file(spec, paths); error_count += check_for_exes(spec, paths); - const std::vector debug_libs = recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "debug" / "lib", ".lib"); - const std::vector release_libs = recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "lib", ".lib"); + const fs::path debug_lib_dir = paths.packages / spec.dir() / "debug" / "lib"; + const fs::path release_lib_dir = paths.packages / spec.dir() / "lib"; + const fs::path debug_bin_dir = paths.packages / spec.dir() / "debug" / "bin"; + const fs::path release_bin_dir = paths.packages / spec.dir() / "bin"; + + const std::vector debug_libs = recursive_find_files_with_extension_in_dir(debug_lib_dir, ".lib"); + const std::vector release_libs = recursive_find_files_with_extension_in_dir(release_lib_dir, ".lib"); error_count += check_matching_debug_and_release_binaries(debug_libs, release_libs); @@ -617,11 +636,14 @@ namespace vcpkg { case LinkageType::DYNAMIC: { - const std::vector debug_dlls = recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "debug" / "bin", ".dll"); - const std::vector release_dlls = recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "bin", ".dll"); + const std::vector debug_dlls = recursive_find_files_with_extension_in_dir(debug_bin_dir, ".dll"); + const std::vector release_dlls = recursive_find_files_with_extension_in_dir(release_bin_dir, ".dll"); error_count += check_matching_debug_and_release_binaries(debug_dlls, release_dlls); + error_count += check_lib_files_are_available_if_dlls_are_available(debug_libs.size(), debug_dlls.size(), debug_lib_dir); + error_count += check_lib_files_are_available_if_dlls_are_available(release_libs.size(), release_dlls.size(), release_lib_dir); + std::vector dlls; dlls.insert(dlls.cend(), debug_dlls.cbegin(), debug_dlls.cend()); dlls.insert(dlls.cend(), release_dlls.cbegin(), release_dlls.cend()); -- cgit v1.2.3 From 4e3269e7fcbcf20bb28f07ab9543fce7c336689d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 21 Nov 2016 12:57:39 -0800 Subject: Remove unused #includes --- toolsrc/src/post_build_lint.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index 1e7e87e6e..9ae91748e 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -7,9 +7,6 @@ #include "coff_file_reader.h" #include "BuildInfo.h" #include -#include -#include -#include "vcpkg_Maps.h" namespace fs = std::tr2::sys; -- cgit v1.2.3 From 28d3238a8824999df650d8bd9634c09bb8faed72 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 21 Nov 2016 13:01:24 -0800 Subject: [soci] Formatting --- ports/soci/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/soci/portfile.cmake b/ports/soci/portfile.cmake index 885c3c634..619d88ebb 100644 --- a/ports/soci/portfile.cmake +++ b/ports/soci/portfile.cmake @@ -19,7 +19,7 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL static) set(PORT_EXTRA_OPTIONS -DSOCI_STATIC=ON -DSOCI_SHARED=OFF) elseif(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - set(PORT_EXTRA_OPTIONS -DSOCI_STATIC=OFF + set(PORT_EXTRA_OPTIONS -DSOCI_STATIC=OFF -DSOCI_SHARED=ON) endif() vcpkg_configure_cmake( -- cgit v1.2.3 From 772528f112f7bddbc09c4519a034f1da7a41cec4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 21 Nov 2016 13:05:45 -0800 Subject: [soci] Fix to correctly set SOCI_STATIC and SOCI_SHARED --- ports/soci/portfile.cmake | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ports/soci/portfile.cmake b/ports/soci/portfile.cmake index 619d88ebb..ddd37aef2 100644 --- a/ports/soci/portfile.cmake +++ b/ports/soci/portfile.cmake @@ -15,19 +15,22 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - set(PORT_EXTRA_OPTIONS -DSOCI_STATIC=ON - -DSOCI_SHARED=OFF) -elseif(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - set(PORT_EXTRA_OPTIONS -DSOCI_STATIC=OFF - -DSOCI_SHARED=ON) +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(SOCI_STATIC OFF) + set(SOCI_DYNAMIC ON) +elseif(VCPKG_LIBRARY_LINKAGE STREQUAL static) + set(SOCI_STATIC ON) + set(SOCI_DYNAMIC OFF) endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS -DSOCI_TESTS=OFF -DSOCI_CXX_C11=ON -DLIBDIR=lib + -DSOCI_STATIC=${SOCI_STATIC} + -DSOCI_SHARED=${SOCI_DYNAMIC} ) vcpkg_install_cmake() -- cgit v1.2.3 From 971e1dfd0dd67d886615a82e085a94fd1c39f84a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=BCller?= Date: Mon, 21 Nov 2016 22:39:34 +0100 Subject: Fix libxml2 port when building with static linkage --- ports/libxml2/portfile.cmake | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/ports/libxml2/portfile.cmake b/ports/libxml2/portfile.cmake index f7e17e21b..8bddd6c54 100644 --- a/ports/libxml2/portfile.cmake +++ b/ports/libxml2/portfile.cmake @@ -41,7 +41,11 @@ set(CONFIGURE_COMMAND_TEMPLATE cscript configure.js message(STATUS "Configuring ${TARGET_TRIPLET}-rel") -set(CRUNTIME /MD) +if(VCPKG_CRT_LINKAGE STREQUAL dynamic) + set(CRUNTIME /MD) +else() + set(CRUNTIME /MT) +endif() set(DEBUGMODE no) set(LIB_DIR ${CURRENT_INSTALLED_DIR}/lib) set(INCLUDE_DIR ${CURRENT_INSTALLED_DIR}/include) @@ -82,7 +86,11 @@ message(STATUS "Installing ${TARGET_TRIPLET}-rel done") message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") -set(CRUNTIME /MDd) +if(VCPKG_CRT_LINKAGE STREQUAL dynamic) + set(CRUNTIME /MDd) +else() + set(CRUNTIME /MTd) +endif() set(DEBUGMODE yes) set(LIB_DIR ${CURRENT_INSTALLED_DIR}/debug/lib) set(INSTALL_DIR ${CURRENT_PACKAGES_DIR}/debug) @@ -117,6 +125,15 @@ message(STATUS "Installing ${TARGET_TRIPLET}-dbg done") # Cleanup # +# You have to define LIBXML_STATIC or not, depending on how you link +file(READ ${CURRENT_PACKAGES_DIR}/include/libxml2/libxml/xmlexports.h XMLEXPORTS_H) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + string(REPLACE "!defined(LIBXML_STATIC)" "0" XMLEXPORTS_H "${XMLEXPORTS_H}") +else() + string(REPLACE "!defined(LIBXML_STATIC)" "1" XMLEXPORTS_H "${XMLEXPORTS_H}") +endif() +file(WRITE ${CURRENT_PACKAGES_DIR}/include/libxml2/libxml/xmlexports.h "${XMLEXPORTS_H}") + # Remove tools and debug include directories file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/tools) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/tools) -- cgit v1.2.3 From adc2a901b136dee5947c7c9e08cd9e4662f1af8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=BCller?= Date: Mon, 21 Nov 2016 22:40:45 +0100 Subject: Add libxslt port --- ports/libxslt/0001-Fix-makefile-imports.patch | 40 ++++++ ports/libxslt/CONTROL | 4 + ports/libxslt/portfile.cmake | 170 ++++++++++++++++++++++++++ 3 files changed, 214 insertions(+) create mode 100644 ports/libxslt/0001-Fix-makefile-imports.patch create mode 100644 ports/libxslt/CONTROL create mode 100644 ports/libxslt/portfile.cmake diff --git a/ports/libxslt/0001-Fix-makefile-imports.patch b/ports/libxslt/0001-Fix-makefile-imports.patch new file mode 100644 index 000000000..33b333cc0 --- /dev/null +++ b/ports/libxslt/0001-Fix-makefile-imports.patch @@ -0,0 +1,40 @@ +--- + win32/Makefile.msvc | 17 +++++++++-------- + 1 file changed, 9 insertions(+), 8 deletions(-) + +diff --git a/win32/Makefile.msvc b/win32/Makefile.msvc +index 23a02d2..b02af8e 100644 +--- a/win32/Makefile.msvc ++++ b/win32/Makefile.msvc +@@ -59,7 +59,14 @@ CFLAGS = $(CFLAGS) /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE + LD = link.exe + LDFLAGS = /nologo + LDFLAGS = $(LDFLAGS) /LIBPATH:$(BINDIR) /LIBPATH:$(LIBPREFIX) +-LIBS = wsock32.lib ++# The libraries are needed for static builds (the makefile builds all tools and dlls) ++LIBS = wsock32.lib libiconv.lib libcharset.lib ++!if "$(DEBUG)" == "1" ++LIBS = $(LIBS) zlibd.lib ++!else ++LIBS = $(LIBS) zlib.lib ++!endif ++ + + # The archiver and its options. + AR = lib.exe +@@ -309,13 +316,7 @@ $(UTILS_INTDIR) : + # An implicit rule for xsltproc and friends. + APPLIBS = $(LIBS) + !if "$(STATIC)" == "1" +-APPLIBS = $(LIBS) libxml2_a.lib +-!if "$(WITH_ICONV)" == "1" +-APPLIBS = $(APPLIBS) iconv.lib +-!endif +-!if "$(WITH_ZLIB)" == "1" +-APPLIBS = $(APPLIBS) zlib.lib +-!endif ++APPLIBS = $(LIBS) libxml2.lib + {$(UTILS_SRCDIR)}.c{$(BINDIR)}.exe: + $(CC) /D "LIBXML_STATIC" /D "LIBXSLT_STATIC" /D "LIBEXSLT_STATIC" \ + $(CFLAGS) /Fo$(UTILS_INTDIR)\ /c $< +-- diff --git a/ports/libxslt/CONTROL b/ports/libxslt/CONTROL new file mode 100644 index 000000000..c329b8705 --- /dev/null +++ b/ports/libxslt/CONTROL @@ -0,0 +1,4 @@ +Source: libxslt +Version: 1.1.29 +Description: Libxslt is a XSLT library implemented in C for XSLT 1.0 and most of EXSLT +Build-Depends: libxml2 diff --git a/ports/libxslt/portfile.cmake b/ports/libxslt/portfile.cmake new file mode 100644 index 000000000..ab556701f --- /dev/null +++ b/ports/libxslt/portfile.cmake @@ -0,0 +1,170 @@ +# 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/libxslt-1.1.29) +vcpkg_download_distfile(ARCHIVE + URLS "ftp://xmlsoft.org/libxslt/libxslt-1.1.29.tar.gz" + FILENAME "libxslt-1.1.29.tar.gz" + SHA512 a1ce555a74a9dabe65e8f64bb66e27e77760fd76940d88f2d59f58dd63ca73c8ae59f3fcbd8e76c8f92ff992fb0c09328528c20ea38ccac83e63252106bf5f31 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +find_program(NMAKE nmake) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH}/ + PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001-Fix-makefile-imports.patch +) + +set(SCRIPTS_DIR ${SOURCE_PATH}/win32) + +set(CONFIGURE_COMMAND_TEMPLATE cscript configure.js + cruntime=@CRUNTIME@ + debug=@DEBUGMODE@ + prefix=@INSTALL_DIR@ + include=@INCLUDE_DIR@ + lib=@LIB_DIR@ + bindir=$(PREFIX)\\tools\\ + sodir=$(PREFIX)\\bin\\ +) + +# Create some directories ourselves, because the makefile doesn't +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin) +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) + +# +# Release +# + +message(STATUS "Configuring ${TARGET_TRIPLET}-rel") + +if(VCPKG_CRT_LINKAGE STREQUAL dynamic) + set(CRUNTIME /MD) +else() + set(CRUNTIME /MT) +endif() +set(DEBUGMODE no) +set(LIB_DIR ${CURRENT_INSTALLED_DIR}/lib) +set(INCLUDE_DIR ${CURRENT_INSTALLED_DIR}/include) +set(INSTALL_DIR ${CURRENT_PACKAGES_DIR}) +file(TO_NATIVE_PATH "${LIB_DIR}" LIB_DIR) +file(TO_NATIVE_PATH "${INCLUDE_DIR}" INCLUDE_DIR) +file(TO_NATIVE_PATH "${INSTALL_DIR}" INSTALL_DIR) +string(CONFIGURE "${CONFIGURE_COMMAND_TEMPLATE}" CONFIGURE_COMMAND) +vcpkg_execute_required_process( + COMMAND ${CONFIGURE_COMMAND} + WORKING_DIRECTORY ${SCRIPTS_DIR} + LOGNAME config-${TARGET_TRIPLET}-rel +) +message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") + +message(STATUS "Building ${TARGET_TRIPLET}-rel") +vcpkg_execute_required_process( + COMMAND ${NMAKE} /f Makefile.msvc rebuild + WORKING_DIRECTORY ${SCRIPTS_DIR} + LOGNAME build-${TARGET_TRIPLET}-rel +) +message(STATUS "Building ${TARGET_TRIPLET}-rel done") + +message(STATUS "Installing ${TARGET_TRIPLET}-rel") +vcpkg_execute_required_process( + COMMAND ${NMAKE} /f Makefile.msvc install + WORKING_DIRECTORY ${SCRIPTS_DIR} + LOGNAME install-${TARGET_TRIPLET}-rel +) +message(STATUS "Installing ${TARGET_TRIPLET}-rel done") + + +# +# Debug +# + +message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") + +if(VCPKG_CRT_LINKAGE STREQUAL dynamic) + set(CRUNTIME /MDd) +else() + set(CRUNTIME /MTd) +endif() +set(DEBUGMODE yes) +set(LIB_DIR ${CURRENT_INSTALLED_DIR}/debug/lib) +set(INSTALL_DIR ${CURRENT_PACKAGES_DIR}/debug) +file(TO_NATIVE_PATH "${LIB_DIR}" LIB_DIR) +file(TO_NATIVE_PATH "${INSTALL_DIR}" INSTALL_DIR) +string(CONFIGURE "${CONFIGURE_COMMAND_TEMPLATE}" CONFIGURE_COMMAND) + +vcpkg_execute_required_process( + COMMAND ${CONFIGURE_COMMAND} + WORKING_DIRECTORY ${SCRIPTS_DIR} + LOGNAME config-${TARGET_TRIPLET}-dbg +) +message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") + +message(STATUS "Building ${TARGET_TRIPLET}-dbg") +vcpkg_execute_required_process( + COMMAND ${NMAKE} /f Makefile.msvc rebuild + WORKING_DIRECTORY ${SCRIPTS_DIR} + LOGNAME build-${TARGET_TRIPLET}-dbg +) +message(STATUS "Building ${TARGET_TRIPLET}-dbg done") + +message(STATUS "Installing ${TARGET_TRIPLET}-dbg") +vcpkg_execute_required_process( + COMMAND ${NMAKE} /f Makefile.msvc install + WORKING_DIRECTORY ${SCRIPTS_DIR} + LOGNAME install-${TARGET_TRIPLET}-dbg +) +message(STATUS "Installing ${TARGET_TRIPLET}-dbg done") + +# +# Cleanup +# + +# You have to define LIB(E)XSLT_STATIC or not, depending on how you link +file(READ ${CURRENT_PACKAGES_DIR}/include/libxslt/xsltexports.h XSLTEXPORTS_H) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + string(REPLACE "!defined(LIBXSLT_STATIC)" "0" XSLTEXPORTS_H "${XSLTEXPORTS_H}") +else() + string(REPLACE "!defined(LIBXSLT_STATIC)" "1" XSLTEXPORTS_H "${XSLTEXPORTS_H}") +endif() +file(WRITE ${CURRENT_PACKAGES_DIR}/include/libxslt/xsltexports.h "${XSLTEXPORTS_H}") + +file(READ ${CURRENT_PACKAGES_DIR}/include/libexslt/exsltexports.h EXSLTEXPORTS_H) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + string(REPLACE "!defined(LIBEXSLT_STATIC)" "0" EXSLTEXPORTS_H "${EXSLTEXPORTS_H}") +else() + string(REPLACE "!defined(LIBEXSLT_STATIC)" "1" EXSLTEXPORTS_H "${EXSLTEXPORTS_H}") +endif() +file(WRITE ${CURRENT_PACKAGES_DIR}/include/libexslt/exsltexports.h "${EXSLTEXPORTS_H}") + +# Remove tools and debug include directories +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/tools) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/tools) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# The makefile builds both static and dynamic libraries, so remove the ones we don't want +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/libxslt_a.lib ${CURRENT_PACKAGES_DIR}/lib/libexslt_a.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/libxslt_a.lib ${CURRENT_PACKAGES_DIR}/debug/lib/libexslt_a.lib) +else() + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/libxslt.lib ${CURRENT_PACKAGES_DIR}/lib/libexslt.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/libxslt.lib ${CURRENT_PACKAGES_DIR}/debug/lib/libexslt.lib) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) + # Rename the libs to match the dynamic lib names + file(RENAME ${CURRENT_PACKAGES_DIR}/lib/libxslt_a.lib ${CURRENT_PACKAGES_DIR}/lib/libxslt.lib) + file(RENAME ${CURRENT_PACKAGES_DIR}/lib/libexslt_a.lib ${CURRENT_PACKAGES_DIR}/lib/libexslt.lib) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libxslt_a.lib ${CURRENT_PACKAGES_DIR}/debug/lib/libxslt.lib) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libexslt_a.lib ${CURRENT_PACKAGES_DIR}/debug/lib/libexslt.lib) +endif() + +# Handle copyright +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libxslt) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/libxslt/COPYING ${CURRENT_PACKAGES_DIR}/share/libxslt/copyright) + +vcpkg_copy_pdbs() \ No newline at end of file -- cgit v1.2.3 From a1405500b4f1ebb4e0503fa31672601d29ea3ee2 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 21 Nov 2016 13:14:11 -0800 Subject: [soci] Fix setting LIBDIR instead of SOCI_LIBDIR --- ports/soci/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/soci/portfile.cmake b/ports/soci/portfile.cmake index ddd37aef2..0358297c5 100644 --- a/ports/soci/portfile.cmake +++ b/ports/soci/portfile.cmake @@ -28,7 +28,7 @@ vcpkg_configure_cmake( OPTIONS -DSOCI_TESTS=OFF -DSOCI_CXX_C11=ON - -DLIBDIR=lib + -DSOCI_LIBDIR=lib # This is to always have output in the lib folder and not lib64 for 64-bit builds -DSOCI_STATIC=${SOCI_STATIC} -DSOCI_SHARED=${SOCI_DYNAMIC} ) -- cgit v1.2.3 From a65f4c3c0b36ee494df0cada4ebfdcf342218cf1 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 21 Nov 2016 18:10:21 -0800 Subject: [bootstrap] Use "unknownhash" if git is not available. Resolves #305 --- scripts/bootstrap.ps1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index 182155146..bcb570b39 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -7,9 +7,12 @@ param( $scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition $vcpkgRootDir = & $scriptsDir\findFileRecursivelyUp.ps1 $scriptsDir .vcpkg-root -$gitHash = git rev-parse HEAD +$gitHash = "unknownhash" +if (Get-Command "git.exe" -ErrorAction SilentlyContinue) +{ + $gitHash = git rev-parse HEAD +} Write-Verbose("Git hash is " + $gitHash) -$gitStartOfHash = $gitHash.substring(0,6) $vcpkgSourcesPath = "$vcpkgRootDir\toolsrc" Write-Verbose("vcpkg Path " + $vcpkgSourcesPath) -- cgit v1.2.3 From 9d3a91cce2d9a437ca508b9400c9f0b005f90231 Mon Sep 17 00:00:00 2001 From: sdcb Date: Tue, 22 Nov 2016 15:33:24 +0800 Subject: [mongo-cxx-driver] fix static build note: Actually, static build is perfectly fine but the cmake always build static and dynamic library togather, in the static environment, dynamic build will fail due link error. I twisted a patch to the CMakeLists.txt to make dynamic build happy when building static. --- ports/mongo-cxx-driver/disable_shared.patch | 46 +++++++++++++++++++++++++++++ ports/mongo-cxx-driver/portfile.cmake | 14 +++++---- 2 files changed, 54 insertions(+), 6 deletions(-) create mode 100644 ports/mongo-cxx-driver/disable_shared.patch diff --git a/ports/mongo-cxx-driver/disable_shared.patch b/ports/mongo-cxx-driver/disable_shared.patch new file mode 100644 index 000000000..46a258326 --- /dev/null +++ b/ports/mongo-cxx-driver/disable_shared.patch @@ -0,0 +1,46 @@ +diff --git a/src/bsoncxx/CMakeLists.txt b/src/bsoncxx/CMakeLists.txt +index a9a7ada..f4534b1 100644 +--- a/src/bsoncxx/CMakeLists.txt ++++ b/src/bsoncxx/CMakeLists.txt +@@ -117,9 +117,15 @@ if (WIN32) + ) + endif() + +-add_library(bsoncxx SHARED +- ${bsoncxx_sources} +-) ++if(ENABLE_SHARED) ++ add_library(bsoncxx SHARED ++ ${bsoncxx_sources} ++ ) ++else() ++ add_library(bsoncxx SHARED ++ exception/error_code.cpp ++ ) ++endif() + + set(bsoncxx_libs ${LIBBSON_LIBRARIES}) + +diff --git a/src/mongocxx/CMakeLists.txt b/src/mongocxx/CMakeLists.txt +index 2ef54e4..a2c8ca4 100644 +--- a/src/mongocxx/CMakeLists.txt ++++ b/src/mongocxx/CMakeLists.txt +@@ -134,9 +134,15 @@ set_target_properties(mongocxx_mocked PROPERTIES + VERSION ${MONGOCXX_VERSION} + ) + +-add_library(mongocxx SHARED +- ${mongocxx_sources} +-) ++if(ENABLE_SHARED) ++ add_library(mongocxx SHARED ++ ${mongocxx_sources} ++ ) ++else() ++ add_library(mongocxx SHARED ++ exception/error_code.cpp ++ ) ++endif() + + set_target_properties (mongocxx PROPERTIES + OUTPUT_NAME mongocxx diff --git a/ports/mongo-cxx-driver/portfile.cmake b/ports/mongo-cxx-driver/portfile.cmake index dc6a13caf..5ea949abb 100644 --- a/ports/mongo-cxx-driver/portfile.cmake +++ b/ports/mongo-cxx-driver/portfile.cmake @@ -1,8 +1,3 @@ -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(STATUS "Warning: Static building not supported yet. Building dynamic.") #Blocked by build failure - set(VCPKG_LIBRARY_LINKAGE dynamic) -endif() - include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mongo-cxx-driver-r3.0.3) @@ -15,15 +10,22 @@ vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} - PATCHES ${CMAKE_CURRENT_LIST_DIR}/disable_test_and_example.patch + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/disable_test_and_example.patch + ${CMAKE_CURRENT_LIST_DIR}/disable_shared.patch ) +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(ENABLE_SHARED ON) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS -DLIBBSON_DIR=${CURRENT_INSTALLED_DIR} -DLIBMONGOC_DIR=${CURRENT_INSTALLED_DIR} -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=ON + -DENABLE_SHARED=${ENABLE_SHARED} ) vcpkg_install_cmake() -- cgit v1.2.3 From db2b51c06aed2a10a20470dfeb758ba7fc36d658 Mon Sep 17 00:00:00 2001 From: sdcb Date: Tue, 22 Nov 2016 16:27:42 +0800 Subject: define MONGOCXX_STATIC in export.hpp --- ports/mongo-cxx-driver/portfile.cmake | 7 +++++++ ports/mongo-cxx-driver/static.patch | 12 ++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 ports/mongo-cxx-driver/static.patch diff --git a/ports/mongo-cxx-driver/portfile.cmake b/ports/mongo-cxx-driver/portfile.cmake index 5ea949abb..7c3247d48 100644 --- a/ports/mongo-cxx-driver/portfile.cmake +++ b/ports/mongo-cxx-driver/portfile.cmake @@ -76,6 +76,13 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libmongocxx.lib ${CURRENT_PACKAGES_DIR}/debug/lib/mongocxx.lib) + + # define MONGOCXX_STATIC in config/export.hpp + vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/static.patch + ) else() file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/libbsoncxx.lib) file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/libbsoncxx.lib) diff --git a/ports/mongo-cxx-driver/static.patch b/ports/mongo-cxx-driver/static.patch new file mode 100644 index 000000000..a485efe3d --- /dev/null +++ b/ports/mongo-cxx-driver/static.patch @@ -0,0 +1,12 @@ +diff --git a/mongocxx/config/export.hpp b/mongocxx/config/export.hpp +index 61a3e74..7fc951c 100644 +--- a/mongocxx/config/export.hpp ++++ b/mongocxx/config/export.hpp +@@ -2,6 +2,7 @@ + #ifndef MONGOCXX_API_H + #define MONGOCXX_API_H + ++#define MONGOCXX_STATIC + #ifdef MONGOCXX_STATIC + # define MONGOCXX_API + # define MONGOCXX_PRIVATE -- cgit v1.2.3 From 7ebd074e064dbbad24c0d04da62c429ce6290471 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=BCller?= Date: Tue, 22 Nov 2016 09:44:37 +0100 Subject: Use different output folder for every triplet, and add debug info to release builds --- ports/libxml2/0001-Fix-makefile-imports.patch | 27 ---------- ports/libxml2/0001-Fix-makefile.patch | 60 ++++++++++++++++++++++ ports/libxml2/portfile.cmake | 16 ++++-- ports/libxslt/0001-Fix-makefile-imports.patch | 40 --------------- ports/libxslt/0001-Fix-makefile.patch | 73 +++++++++++++++++++++++++++ ports/libxslt/portfile.cmake | 16 ++++-- 6 files changed, 155 insertions(+), 77 deletions(-) delete mode 100644 ports/libxml2/0001-Fix-makefile-imports.patch create mode 100644 ports/libxml2/0001-Fix-makefile.patch delete mode 100644 ports/libxslt/0001-Fix-makefile-imports.patch create mode 100644 ports/libxslt/0001-Fix-makefile.patch diff --git a/ports/libxml2/0001-Fix-makefile-imports.patch b/ports/libxml2/0001-Fix-makefile-imports.patch deleted file mode 100644 index ae40648b9..000000000 --- a/ports/libxml2/0001-Fix-makefile-imports.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git "a/win32/Makefile.msvc" "b/win32/Makefile.msvc" -index d16c1a2..09d2291 100644 ---- "a/win32/Makefile.msvc" -+++ "b/win32/Makefile.msvc" -@@ -72,7 +72,7 @@ LIBS = - LIBS = $(LIBS) wsock32.lib ws2_32.lib - !endif - !if "$(WITH_ICONV)" == "1" --LIBS = $(LIBS) iconv.lib -+LIBS = $(LIBS) libiconv.lib libcharset.lib - !endif - !if "$(WITH_ICU)" == "1" - LIBS = $(LIBS) icu.lib -@@ -80,7 +80,11 @@ LIBS = $(LIBS) icu.lib - !if "$(WITH_ZLIB)" == "1" - # could be named differently zdll or zlib - # LIBS = $(LIBS) zdll.lib --LIBS = $(LIBS) zlib.lib -+!if "$(DEBUG)" == "1" -+LIBS = $(LIBS) zlibd.lib -+!else -+LIBS = $(LIBS) zlib.lib -+!endif - !endif - !if "$(WITH_LZMA)" == "1" - LIBS = $(LIBS) liblzma.lib - \ No newline at end of file diff --git a/ports/libxml2/0001-Fix-makefile.patch b/ports/libxml2/0001-Fix-makefile.patch new file mode 100644 index 000000000..0e6c774dd --- /dev/null +++ b/ports/libxml2/0001-Fix-makefile.patch @@ -0,0 +1,60 @@ +--- + win32/Makefile.msvc | 22 ++++++++++++---------- + 1 file changed, 12 insertions(+), 10 deletions(-) + +diff --git a/win32/Makefile.msvc b/win32/Makefile.msvc +index d16c1a2..de9e22e 100644 +--- a/win32/Makefile.msvc ++++ b/win32/Makefile.msvc +@@ -28,11 +28,11 @@ XML_A = $(XML_BASENAME)_a.lib + XML_A_DLL = $(XML_BASENAME)_a_dll.lib + + # Place where we let the compiler put its output. +-BINDIR = bin.msvc +-XML_INTDIR = int.msvc +-XML_INTDIR_A = int.a.msvc +-XML_INTDIR_A_DLL = int.a.dll.msvc +-UTILS_INTDIR = int.utils.msvc ++BINDIR = $(OUTDIR)\bin.msvc ++XML_INTDIR = $(OUTDIR)\int.msvc ++XML_INTDIR_A = $(OUTDIR)\int.a.msvc ++XML_INTDIR_A_DLL = $(OUTDIR)\int.a.dll.msvc ++UTILS_INTDIR = $(OUTDIR)\int.utils.msvc + + # The preprocessor and its options. + CPP = cl.exe /EP +@@ -72,16 +72,18 @@ LIBS = + LIBS = $(LIBS) wsock32.lib ws2_32.lib + !endif + !if "$(WITH_ICONV)" == "1" +-LIBS = $(LIBS) iconv.lib ++LIBS = $(LIBS) libiconv.lib libcharset.lib + !endif + !if "$(WITH_ICU)" == "1" + LIBS = $(LIBS) icu.lib + !endif + !if "$(WITH_ZLIB)" == "1" +-# could be named differently zdll or zlib +-# LIBS = $(LIBS) zdll.lib ++!if "$(DEBUG)" == "1" ++LIBS = $(LIBS) zlibd.lib ++!else + LIBS = $(LIBS) zlib.lib + !endif ++!endif + !if "$(WITH_LZMA)" == "1" + LIBS = $(LIBS) liblzma.lib + !endif +@@ -101,10 +103,10 @@ ARFLAGS = /nologo + CFLAGS = $(CFLAGS) /D "_DEBUG" /Od /Z7 + LDFLAGS = $(LDFLAGS) /DEBUG + !else + CFLAGS = $(CFLAGS) /D "NDEBUG" /O2 + # commented out as this break VC10 c.f. 634846 + # LDFLAGS = $(LDFLAGS) /OPT:NOWIN98 +-LDFLAGS = $(LDFLAGS) ++LDFLAGS = $(LDFLAGS) /DEBUG /OPT:REF /OPT:ICF + !endif + + # Libxml object files. +-- diff --git a/ports/libxml2/portfile.cmake b/ports/libxml2/portfile.cmake index 8bddd6c54..bb4e043b3 100644 --- a/ports/libxml2/portfile.cmake +++ b/ports/libxml2/portfile.cmake @@ -19,7 +19,7 @@ find_program(NMAKE nmake) vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH}/ - PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001-Fix-makefile-imports.patch + PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001-Fix-makefile.patch ) set(SCRIPTS_DIR ${SOURCE_PATH}/win32) @@ -61,11 +61,14 @@ vcpkg_execute_required_process( WORKING_DIRECTORY ${SCRIPTS_DIR} LOGNAME config-${TARGET_TRIPLET}-rel ) +# Handle build output directory +file(TO_NATIVE_PATH "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" OUTDIR) +file(MAKE_DIRECTORY "${OUTDIR}") message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") message(STATUS "Building ${TARGET_TRIPLET}-rel") vcpkg_execute_required_process( - COMMAND ${NMAKE} /f Makefile.msvc rebuild + COMMAND ${NMAKE} /f Makefile.msvc rebuild OUTDIR=${OUTDIR} WORKING_DIRECTORY ${SCRIPTS_DIR} LOGNAME build-${TARGET_TRIPLET}-rel ) @@ -73,7 +76,7 @@ message(STATUS "Building ${TARGET_TRIPLET}-rel done") message(STATUS "Installing ${TARGET_TRIPLET}-rel") vcpkg_execute_required_process( - COMMAND ${NMAKE} /f Makefile.msvc install + COMMAND ${NMAKE} /f Makefile.msvc install OUTDIR=${OUTDIR} WORKING_DIRECTORY ${SCRIPTS_DIR} LOGNAME install-${TARGET_TRIPLET}-rel ) @@ -103,11 +106,14 @@ vcpkg_execute_required_process( WORKING_DIRECTORY ${SCRIPTS_DIR} LOGNAME config-${TARGET_TRIPLET}-dbg ) +# Handle build output directory +file(TO_NATIVE_PATH "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg" OUTDIR) +file(MAKE_DIRECTORY "${OUTDIR}") message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") message(STATUS "Building ${TARGET_TRIPLET}-dbg") vcpkg_execute_required_process( - COMMAND ${NMAKE} /f Makefile.msvc rebuild + COMMAND ${NMAKE} /f Makefile.msvc rebuild OUTDIR=${OUTDIR} WORKING_DIRECTORY ${SCRIPTS_DIR} LOGNAME build-${TARGET_TRIPLET}-dbg ) @@ -115,7 +121,7 @@ message(STATUS "Building ${TARGET_TRIPLET}-dbg done") message(STATUS "Installing ${TARGET_TRIPLET}-dbg") vcpkg_execute_required_process( - COMMAND ${NMAKE} /f Makefile.msvc install + COMMAND ${NMAKE} /f Makefile.msvc install OUTDIR=${OUTDIR} WORKING_DIRECTORY ${SCRIPTS_DIR} LOGNAME install-${TARGET_TRIPLET}-dbg ) diff --git a/ports/libxslt/0001-Fix-makefile-imports.patch b/ports/libxslt/0001-Fix-makefile-imports.patch deleted file mode 100644 index 33b333cc0..000000000 --- a/ports/libxslt/0001-Fix-makefile-imports.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- - win32/Makefile.msvc | 17 +++++++++-------- - 1 file changed, 9 insertions(+), 8 deletions(-) - -diff --git a/win32/Makefile.msvc b/win32/Makefile.msvc -index 23a02d2..b02af8e 100644 ---- a/win32/Makefile.msvc -+++ b/win32/Makefile.msvc -@@ -59,7 +59,14 @@ CFLAGS = $(CFLAGS) /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE - LD = link.exe - LDFLAGS = /nologo - LDFLAGS = $(LDFLAGS) /LIBPATH:$(BINDIR) /LIBPATH:$(LIBPREFIX) --LIBS = wsock32.lib -+# The libraries are needed for static builds (the makefile builds all tools and dlls) -+LIBS = wsock32.lib libiconv.lib libcharset.lib -+!if "$(DEBUG)" == "1" -+LIBS = $(LIBS) zlibd.lib -+!else -+LIBS = $(LIBS) zlib.lib -+!endif -+ - - # The archiver and its options. - AR = lib.exe -@@ -309,13 +316,7 @@ $(UTILS_INTDIR) : - # An implicit rule for xsltproc and friends. - APPLIBS = $(LIBS) - !if "$(STATIC)" == "1" --APPLIBS = $(LIBS) libxml2_a.lib --!if "$(WITH_ICONV)" == "1" --APPLIBS = $(APPLIBS) iconv.lib --!endif --!if "$(WITH_ZLIB)" == "1" --APPLIBS = $(APPLIBS) zlib.lib --!endif -+APPLIBS = $(LIBS) libxml2.lib - {$(UTILS_SRCDIR)}.c{$(BINDIR)}.exe: - $(CC) /D "LIBXML_STATIC" /D "LIBXSLT_STATIC" /D "LIBEXSLT_STATIC" \ - $(CFLAGS) /Fo$(UTILS_INTDIR)\ /c $< --- diff --git a/ports/libxslt/0001-Fix-makefile.patch b/ports/libxslt/0001-Fix-makefile.patch new file mode 100644 index 000000000..73d627860 --- /dev/null +++ b/ports/libxslt/0001-Fix-makefile.patch @@ -0,0 +1,73 @@ +--- + win32/Makefile.msvc | 29 +++++++++++++++-------------- + 1 file changed, 15 insertions(+), 14 deletions(-) + +diff --git a/win32/Makefile.msvc b/win32/Makefile.msvc +index 23a02d2..b13dd26 100644 +--- a/win32/Makefile.msvc ++++ b/win32/Makefile.msvc +@@ -22,7 +22,7 @@ BASEDIR = .. + XSLT_SRCDIR = $(BASEDIR)\libxslt + EXSLT_SRCDIR = $(BASEDIR)\libexslt + UTILS_SRCDIR = $(BASEDIR)\xsltproc +-BINDIR = bin.msvc ++BINDIR = $(OUTDIR)\bin.msvc + + # Names of various input and output components. + XSLT_NAME = xslt +@@ -39,11 +39,11 @@ EXSLT_DEF = $(EXSLT_BASENAME).def + EXSLT_A = $(EXSLT_BASENAME)_a.lib + + # Places where intermediate files produced by the compiler go +-XSLT_INTDIR = int.xslt.msvc +-XSLT_INTDIR_A = int.xslta.msvc +-EXSLT_INTDIR = int.exslt.msvc +-EXSLT_INTDIR_A = int.exslta.msvc +-UTILS_INTDIR = int.utils.msvc ++XSLT_INTDIR = $(OUTDIR)\int.xslt.msvc ++XSLT_INTDIR_A = $(OUTDIR)\int.xslta.msvc ++EXSLT_INTDIR = $(OUTDIR)\int.exslt.msvc ++EXSLT_INTDIR_A = $(OUTDIR)\int.exslta.msvc ++UTILS_INTDIR = $(OUTDIR)\int.utils.msvc + + # The preprocessor and its options. + CPP = cl.exe /EP +@@ -59,7 +59,13 @@ CFLAGS = $(CFLAGS) /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE + LD = link.exe + LDFLAGS = /nologo + LDFLAGS = $(LDFLAGS) /LIBPATH:$(BINDIR) /LIBPATH:$(LIBPREFIX) +-LIBS = wsock32.lib ++# The libraries are needed for static builds (the makefile builds all tools and dlls) ++LIBS = wsock32.lib libiconv.lib libcharset.lib ++!if "$(DEBUG)" == "1" ++LIBS = $(LIBS) zlibd.lib ++!else ++LIBS = $(LIBS) zlib.lib ++!endif + + # The archiver and its options. + AR = lib.exe +@@ -71,6 +77,7 @@ CFLAGS = $(CFLAGS) /D "_DEBUG" /Od /Z7 + LDFLAGS = $(LDFLAGS) /DEBUG + !else + CFLAGS = $(CFLAGS) /D "NDEBUG" /O2 ++LDFLAGS = $(LDFLAGS) /DEBUG /OPT:REF /OPT:ICF + !endif + + # Libxslt object files. +@@ -309,13 +316,7 @@ $(UTILS_INTDIR) : + # An implicit rule for xsltproc and friends. + APPLIBS = $(LIBS) + !if "$(STATIC)" == "1" +-APPLIBS = $(LIBS) libxml2_a.lib +-!if "$(WITH_ICONV)" == "1" +-APPLIBS = $(APPLIBS) iconv.lib +-!endif +-!if "$(WITH_ZLIB)" == "1" +-APPLIBS = $(APPLIBS) zlib.lib +-!endif ++APPLIBS = $(LIBS) libxml2.lib + {$(UTILS_SRCDIR)}.c{$(BINDIR)}.exe: + $(CC) /D "LIBXML_STATIC" /D "LIBXSLT_STATIC" /D "LIBEXSLT_STATIC" \ + $(CFLAGS) /Fo$(UTILS_INTDIR)\ /c $< +-- diff --git a/ports/libxslt/portfile.cmake b/ports/libxslt/portfile.cmake index ab556701f..2343ba99f 100644 --- a/ports/libxslt/portfile.cmake +++ b/ports/libxslt/portfile.cmake @@ -19,7 +19,7 @@ find_program(NMAKE nmake) vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH}/ - PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001-Fix-makefile-imports.patch + PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001-Fix-makefile.patch ) set(SCRIPTS_DIR ${SOURCE_PATH}/win32) @@ -62,11 +62,14 @@ vcpkg_execute_required_process( WORKING_DIRECTORY ${SCRIPTS_DIR} LOGNAME config-${TARGET_TRIPLET}-rel ) +# Handle build output directory +file(TO_NATIVE_PATH "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" OUTDIR) +file(MAKE_DIRECTORY "${OUTDIR}") message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") message(STATUS "Building ${TARGET_TRIPLET}-rel") vcpkg_execute_required_process( - COMMAND ${NMAKE} /f Makefile.msvc rebuild + COMMAND ${NMAKE} /f Makefile.msvc rebuild OUTDIR=${OUTDIR} WORKING_DIRECTORY ${SCRIPTS_DIR} LOGNAME build-${TARGET_TRIPLET}-rel ) @@ -74,7 +77,7 @@ message(STATUS "Building ${TARGET_TRIPLET}-rel done") message(STATUS "Installing ${TARGET_TRIPLET}-rel") vcpkg_execute_required_process( - COMMAND ${NMAKE} /f Makefile.msvc install + COMMAND ${NMAKE} /f Makefile.msvc install OUTDIR=${OUTDIR} WORKING_DIRECTORY ${SCRIPTS_DIR} LOGNAME install-${TARGET_TRIPLET}-rel ) @@ -104,11 +107,14 @@ vcpkg_execute_required_process( WORKING_DIRECTORY ${SCRIPTS_DIR} LOGNAME config-${TARGET_TRIPLET}-dbg ) +# Handle build output directory +file(TO_NATIVE_PATH "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg" OUTDIR) +file(MAKE_DIRECTORY "${OUTDIR}") message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") message(STATUS "Building ${TARGET_TRIPLET}-dbg") vcpkg_execute_required_process( - COMMAND ${NMAKE} /f Makefile.msvc rebuild + COMMAND ${NMAKE} /f Makefile.msvc rebuild OUTDIR=${OUTDIR} WORKING_DIRECTORY ${SCRIPTS_DIR} LOGNAME build-${TARGET_TRIPLET}-dbg ) @@ -116,7 +122,7 @@ message(STATUS "Building ${TARGET_TRIPLET}-dbg done") message(STATUS "Installing ${TARGET_TRIPLET}-dbg") vcpkg_execute_required_process( - COMMAND ${NMAKE} /f Makefile.msvc install + COMMAND ${NMAKE} /f Makefile.msvc install OUTDIR=${OUTDIR} WORKING_DIRECTORY ${SCRIPTS_DIR} LOGNAME install-${TARGET_TRIPLET}-dbg ) -- cgit v1.2.3 From f357b18b0173c45678d773c43083fd31c4763a6e Mon Sep 17 00:00:00 2001 From: Wakusei Date: Tue, 22 Nov 2016 22:11:57 +0900 Subject: [port] Added yaml-cpp #308 --- ports/yaml-cpp/CONTROL | 3 +++ ports/yaml-cpp/portfile.cmake | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 ports/yaml-cpp/CONTROL create mode 100644 ports/yaml-cpp/portfile.cmake diff --git a/ports/yaml-cpp/CONTROL b/ports/yaml-cpp/CONTROL new file mode 100644 index 000000000..f55ccfc4f --- /dev/null +++ b/ports/yaml-cpp/CONTROL @@ -0,0 +1,3 @@ +Source: yaml-cpp +Version: 0.5.4 candidate +Description: yaml-cpp is a YAML parser and emitter in C++ matching the YAML 1.2 spec. diff --git a/ports/yaml-cpp/portfile.cmake b/ports/yaml-cpp/portfile.cmake new file mode 100644 index 000000000..69f838884 --- /dev/null +++ b/ports/yaml-cpp/portfile.cmake @@ -0,0 +1,38 @@ +# 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/yaml-cpp-380ecb404ef99ba132154ed43dd2b84136b30b14) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/jbeder/yaml-cpp/archive/380ecb404ef99ba132154ed43dd2b84136b30b14.zip" + FILENAME "380ecb404ef99ba132154ed43dd2b84136b30b14.zip" + SHA512 7e090b53ba760f4f9a44701359fe2c30c05f1bbcd2cba78a8f9a88c651b09be6d592e65826fbacb9dd7317afbe3cd968be531b89f83e79f15cd97e9c27d17232 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +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() + +vcpkg_copy_pdbs() + +# Remove debug include files +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +# Remove cmake files +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/CMake) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/CMake) + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/yaml-cpp) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/yaml-cpp/LICENSE ${CURRENT_PACKAGES_DIR}/share/yaml-cpp/copyright) + -- cgit v1.2.3 From bbf853d00727de2e43a55ec91a272de3c636bd0b Mon Sep 17 00:00:00 2001 From: Charlie Barto Date: Tue, 22 Nov 2016 13:07:05 -0500 Subject: added libodb-pgsql support --- ports/libodb-pgsql/CMakeLists.txt | 43 +++++++++++++++++++++++++++++++++++++++ ports/libodb-pgsql/CONTROL | 4 ++++ ports/libodb-pgsql/portfile.cmake | 25 +++++++++++++++++++++++ ports/libodb/odbConfig.cmake | 2 +- 4 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 ports/libodb-pgsql/CMakeLists.txt create mode 100644 ports/libodb-pgsql/CONTROL create mode 100644 ports/libodb-pgsql/portfile.cmake diff --git a/ports/libodb-pgsql/CMakeLists.txt b/ports/libodb-pgsql/CMakeLists.txt new file mode 100644 index 000000000..cb510e805 --- /dev/null +++ b/ports/libodb-pgsql/CMakeLists.txt @@ -0,0 +1,43 @@ +cmake_minimum_required(VERSION 3.0) +project(libodb-pgsql VERSION 2.4.0 LANGUAGES CXX) +find_package(odb 2.4.0 REQUIRED COMPONENTS libodb) +find_package(PostgreSQL REQUIRED) +set(LIBODB_INSTALL_HEADERS ON CACHE BOOL "Install the header files (a debug install)") +file(GLOB_RECURSE libodb_src LIST_DIRECTORIES False + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + *.cxx) +list(FILTER libodb_src EXCLUDE REGEX /posix/.*) +add_library(libodb-pgsql ${libodb_src}) +target_include_directories(libodb-pgsql + PUBLIC + $ + $ + +) + +target_link_libraries(libodb-pgsql PRIVATE odb::libodb ${PostgreSQL_LIBRARY}) +if(BUILD_SHARED_LIBS) + target_compile_definitions(libodb-pgsql PRIVATE + -DLIBODB_PGSQL_DYNAMIC_LIB) +else() + target_compile_definitions(libodb-pgsql PRIVATE + -DLIBODB_PGSQL_STATIC_LIB) +endif() +install(TARGETS libodb-pgsql EXPORT odb_pgsqlConfig + COMPONENT pgsql + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) +if(LIBODB_INSTALL_HEADERS) +install(DIRECTORY odb DESTINATION include/ + COMPONENT sqlite + FILES_MATCHING + PATTERN "*.h" + PATTERN "*.hxx" + PATTERN "*.ixx" + PATTERN "*.txx" +) +endif() +install(EXPORT odb_pgsqlConfig NAMESPACE odb:: COMPONENT pgsql DESTINATION share/odb) +export(TARGETS libodb-pgsql NAMESPACE odb:: FILE odb_pgsqlConfig.cmake) \ No newline at end of file diff --git a/ports/libodb-pgsql/CONTROL b/ports/libodb-pgsql/CONTROL new file mode 100644 index 000000000..a2daa777a --- /dev/null +++ b/ports/libodb-pgsql/CONTROL @@ -0,0 +1,4 @@ +Source: libodb-pgsql +Version: 2.4.0 +Description: Description: PostgreSQL support for the ODB ORM library +Build-Depends: libodb, libpq \ No newline at end of file diff --git a/ports/libodb-pgsql/portfile.cmake b/ports/libodb-pgsql/portfile.cmake new file mode 100644 index 000000000..752f98b70 --- /dev/null +++ b/ports/libodb-pgsql/portfile.cmake @@ -0,0 +1,25 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libodb-pgsql-2.4.0) +vcpkg_download_distfile(ARCHIVE + URLS "http://www.codesynthesis.com/download/odb/2.4/libodb-pgsql-2.4.0.tar.gz" + FILENAME "libodb-pgsql-2.4.0.tar.gz" + SHA512 535515356233b815f144c0098940174f7a530e7fa4e930c0a9ebdc255fdb8bac8cdcceac31f25be4864105323e00bfe50808efa648e7c8ffb5a944e52f514b69 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS_DEBUG + -DLIBODB_INSTALL_HEADERS=OFF +) +vcpkg_build_cmake() +vcpkg_install_cmake() + +file(READ ${CURRENT_PACKAGES_DIR}/debug/share/odb/odb_pgsqlConfig-debug.cmake LIBODB_DEBUG_TARGETS) +string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" LIBODB_DEBUG_TARGETS "${LIBODB_DEBUG_TARGETS}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/odb/odb_pgsqlConfig-debug.cmake "${LIBODB_DEBUG_TARGETS}") +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libodb-pgsql) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/libodb-pgsql/LICENSE ${CURRENT_PACKAGES_DIR}/share/libodb-pgsql/copyright) +vcpkg_copy_pdbs() diff --git a/ports/libodb/odbConfig.cmake b/ports/libodb/odbConfig.cmake index 21631fadf..afe51dc16 100644 --- a/ports/libodb/odbConfig.cmake +++ b/ports/libodb/odbConfig.cmake @@ -1,4 +1,4 @@ -set(_supported_components libodb sqlite) +set(_supported_components libodb sqlite pgsql) foreach(_comp ${odb_FIND_COMPONENTS}) if(NOT ";${_supported_components};" MATCHES _comp) -- cgit v1.2.3 From 1f22f927e2f2ba1eb8c702ced4bc6ad811da2bdc Mon Sep 17 00:00:00 2001 From: Charlie Barto Date: Tue, 22 Nov 2016 15:51:35 -0500 Subject: mode fmt export all symbols on windows --- ports/fmt/portfile.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ports/fmt/portfile.cmake b/ports/fmt/portfile.cmake index 152b878a7..3470dbedb 100644 --- a/ports/fmt/portfile.cmake +++ b/ports/fmt/portfile.cmake @@ -17,6 +17,7 @@ vcpkg_configure_cmake( -DFMT_CMAKE_DIR=share/fmt -DFMT_TEST=OFF -DFMT_DOC=OFF + -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON ) @@ -36,6 +37,13 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/debug/share/fmt/fmt-targets-debug.cmake ${CU file(READ ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake FMT_DEBUG_MODULE) string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" FMT_DEBUG_MODULE "${FMT_DEBUG_MODULE}") file(WRITE ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake "${FMT_DEBUG_MODULE}") + +file(READ ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake FMT_DEBUG_MODULE) +string(REPLACE "lib/fmt.dll" "bin/fmt.dll" FMT_DEBUG_MODULE ${FMT_DEBUG_MODULE}) +file(WRITE ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake "${FMT_DEBUG_MODULE}") +file(READ ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-release.cmake FMT_RELEASE_MODULE) +string(REPLACE "lib/fmt.dll" "bin/fmt.dll" FMT_RELEASE_MODULE ${FMT_RELEASE_MODULE}) +file(WRITE ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-release.cmake "${FMT_RELEASE_MODULE}") file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) vcpkg_copy_pdbs() -- cgit v1.2.3 From 47af38473c6ff427b75263041a62484ffac1b03c Mon Sep 17 00:00:00 2001 From: Saul Thurrowgood Date: Wed, 23 Nov 2016 11:00:31 +1100 Subject: Add zstd port --- ports/zstd/CONTROL | 3 +++ ports/zstd/portfile.cmake | 58 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 ports/zstd/CONTROL create mode 100644 ports/zstd/portfile.cmake diff --git a/ports/zstd/CONTROL b/ports/zstd/CONTROL new file mode 100644 index 000000000..f92f610a4 --- /dev/null +++ b/ports/zstd/CONTROL @@ -0,0 +1,3 @@ +Source: zstd +Version: 1.1.1 +Description: Zstandard - Fast real-time compression algorithm http://www.zstd.net diff --git a/ports/zstd/portfile.cmake b/ports/zstd/portfile.cmake new file mode 100644 index 000000000..c7c276e7a --- /dev/null +++ b/ports/zstd/portfile.cmake @@ -0,0 +1,58 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/zstd-1.1.1) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/facebook/zstd/archive/v1.1.1.zip" + FILENAME "zstd-1.1.1.zip" + SHA512 c96a97519202a759c62f661c7bbaeaa0d48e4e78588a8232ad23fd78fe7c3440f1f07d996dcf07daa652569e1c5e39cb7b93103b9ec7845db05b161ec29a8dde +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH}/build/cmake + OPTIONS -DZSTD_LEGACY_SUPPORT=1 +) + +vcpkg_build_cmake() + +# Manual install since zstd guarded all their installation functions behind an if (UNIX) +message(STATUS "Installing") + +file(COPY ${SOURCE_PATH}/lib/zstd.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) +file(COPY ${SOURCE_PATH}/lib/common/zbuff.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) +file(COPY ${SOURCE_PATH}/lib/dictBuilder/zdict.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) + +# Copy the command-line zstd exe +file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/programs/Release/ + DESTINATION ${CURRENT_PACKAGES_DIR}/tools + FILES_MATCHING PATTERN "zstd.exe") + +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + # Dynamic libs of zstd appear to start with "zstdlib." + file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/lib/Release/ + DESTINATION ${CURRENT_PACKAGES_DIR}/lib + FILES_MATCHING PATTERN "zstdlib.*.lib") + file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/lib/Release/ + DESTINATION ${CURRENT_PACKAGES_DIR}/bin + FILES_MATCHING PATTERN "zstdlib.*.dll") + file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/lib/Debug/ + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib + FILES_MATCHING PATTERN "zstdlib.*.lib") + file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/lib/Debug/ + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin + FILES_MATCHING PATTERN "zstdlib.*.dll") +else() + # Static libs of zstd appear to start with "zstdlib_" + file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/lib/Release/ + DESTINATION ${CURRENT_PACKAGES_DIR}/lib + FILES_MATCHING PATTERN "zstdlib_*.lib") + file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/lib/Debug/ + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib + FILES_MATCHING PATTERN "zstdlib_*.lib") +endif() + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/zstd) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/zstd/LICENSE ${CURRENT_PACKAGES_DIR}/share/zstd/copyright) + +vcpkg_copy_pdbs() +message(STATUS "Installing done") -- cgit v1.2.3 From a26bf41ac3107f34ca6851f4872f8aaa0b798b71 Mon Sep 17 00:00:00 2001 From: sdcb Date: Wed, 23 Nov 2016 10:11:17 +0800 Subject: [mongo-cxx-driver] using BUILD_SHARED_LIBS instead of self-defined macro. related to: https://github.com/Microsoft/vcpkg/pull/316 --- ports/mongo-cxx-driver/disable_shared.patch | 8 ++++---- ports/mongo-cxx-driver/portfile.cmake | 5 ----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/ports/mongo-cxx-driver/disable_shared.patch b/ports/mongo-cxx-driver/disable_shared.patch index 46a258326..5f2f9a04e 100644 --- a/ports/mongo-cxx-driver/disable_shared.patch +++ b/ports/mongo-cxx-driver/disable_shared.patch @@ -1,5 +1,5 @@ diff --git a/src/bsoncxx/CMakeLists.txt b/src/bsoncxx/CMakeLists.txt -index a9a7ada..f4534b1 100644 +index a9a7ada..6b87a6d 100644 --- a/src/bsoncxx/CMakeLists.txt +++ b/src/bsoncxx/CMakeLists.txt @@ -117,9 +117,15 @@ if (WIN32) @@ -9,7 +9,7 @@ index a9a7ada..f4534b1 100644 -add_library(bsoncxx SHARED - ${bsoncxx_sources} -) -+if(ENABLE_SHARED) ++if(BUILD_SHARED_LIBS) + add_library(bsoncxx SHARED + ${bsoncxx_sources} + ) @@ -22,7 +22,7 @@ index a9a7ada..f4534b1 100644 set(bsoncxx_libs ${LIBBSON_LIBRARIES}) diff --git a/src/mongocxx/CMakeLists.txt b/src/mongocxx/CMakeLists.txt -index 2ef54e4..a2c8ca4 100644 +index 2ef54e4..53a13f7 100644 --- a/src/mongocxx/CMakeLists.txt +++ b/src/mongocxx/CMakeLists.txt @@ -134,9 +134,15 @@ set_target_properties(mongocxx_mocked PROPERTIES @@ -32,7 +32,7 @@ index 2ef54e4..a2c8ca4 100644 -add_library(mongocxx SHARED - ${mongocxx_sources} -) -+if(ENABLE_SHARED) ++if(BUILD_SHARED_LIBS) + add_library(mongocxx SHARED + ${mongocxx_sources} + ) diff --git a/ports/mongo-cxx-driver/portfile.cmake b/ports/mongo-cxx-driver/portfile.cmake index 7c3247d48..fa0549fd7 100644 --- a/ports/mongo-cxx-driver/portfile.cmake +++ b/ports/mongo-cxx-driver/portfile.cmake @@ -15,17 +15,12 @@ vcpkg_apply_patches( ${CMAKE_CURRENT_LIST_DIR}/disable_shared.patch ) -if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - set(ENABLE_SHARED ON) -endif() - vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS -DLIBBSON_DIR=${CURRENT_INSTALLED_DIR} -DLIBMONGOC_DIR=${CURRENT_INSTALLED_DIR} -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=ON - -DENABLE_SHARED=${ENABLE_SHARED} ) vcpkg_install_cmake() -- cgit v1.2.3 From 9144d1f7c751cca14a82a3bb8264af8c4b0ca727 Mon Sep 17 00:00:00 2001 From: sdcb Date: Wed, 23 Nov 2016 10:34:15 +0800 Subject: [mongo-c-driver] Remove useless 0001_cmake.patch --- ports/mongo-c-driver/0001_cmake.patch | 43 ----------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 ports/mongo-c-driver/0001_cmake.patch diff --git a/ports/mongo-c-driver/0001_cmake.patch b/ports/mongo-c-driver/0001_cmake.patch deleted file mode 100644 index a2f9087e7..000000000 --- a/ports/mongo-c-driver/0001_cmake.patch +++ /dev/null @@ -1,43 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index b3fc5b9..5a106ca 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -20,7 +20,6 @@ option(ENABLE_EXPERIMENTAL_FEATURES - - set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/build/cmake) - --include(InstallRequiredSystemLibraries) - include(FindBSON REQUIRED) - - if (NOT (ENABLE_SSL STREQUAL DARWIN -@@ -563,7 +562,7 @@ install( - ) - install( - FILES ${HEADERS} -- DESTINATION "include/libmongoc-${MONGOC_API_VERSION}" -+ DESTINATION "include" - ) - - # Define pkg-config files -diff --git a/build/cmake/FindBSON.cmake b/build/cmake/FindBSON.cmake -index 4ac39ea..bf6ecab 100644 ---- a/build/cmake/FindBSON.cmake -+++ b/build/cmake/FindBSON.cmake -@@ -11,7 +11,7 @@ endif () - - find_path(BSON_INCLUDE_DIR - NAMES -- libbson-1.0/bson.h -+ bson.h - HINTS - ${BSON_ROOT_DIR} - ${_BSON_INCLUDEDIR} -@@ -19,8 +19,6 @@ find_path(BSON_INCLUDE_DIR - include - ) - --set(BSON_INCLUDE_DIR "${BSON_INCLUDE_DIR}/libbson-1.0") -- - if(WIN32 AND NOT CYGWIN) - if(MSVC) - find_library(BSON -- cgit v1.2.3 From 5c745463008a800cba3af3a4af06e83823d248f7 Mon Sep 17 00:00:00 2001 From: Saul Thurrowgood Date: Wed, 23 Nov 2016 17:56:56 +1100 Subject: zstd port: rename to non-versioned libs, don't --- ports/zstd/portfile.cmake | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ports/zstd/portfile.cmake b/ports/zstd/portfile.cmake index c7c276e7a..e9ba07b54 100644 --- a/ports/zstd/portfile.cmake +++ b/ports/zstd/portfile.cmake @@ -21,11 +21,6 @@ file(COPY ${SOURCE_PATH}/lib/zstd.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) file(COPY ${SOURCE_PATH}/lib/common/zbuff.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) file(COPY ${SOURCE_PATH}/lib/dictBuilder/zdict.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) -# Copy the command-line zstd exe -file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/programs/Release/ - DESTINATION ${CURRENT_PACKAGES_DIR}/tools - FILES_MATCHING PATTERN "zstd.exe") - if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) # Dynamic libs of zstd appear to start with "zstdlib." file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/lib/Release/ -- cgit v1.2.3 From 431f5e12a3626ac522fb468e44b7b3549f2d2fe1 Mon Sep 17 00:00:00 2001 From: Saul Thurrowgood Date: Wed, 23 Nov 2016 17:58:25 +1100 Subject: zstd port: rename libs to non-versioned names --- ports/zstd/portfile.cmake | 57 ++++++++++++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 23 deletions(-) diff --git a/ports/zstd/portfile.cmake b/ports/zstd/portfile.cmake index e9ba07b54..7384e5461 100644 --- a/ports/zstd/portfile.cmake +++ b/ports/zstd/portfile.cmake @@ -7,47 +7,58 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) +# Name dynamic libs to be non-versioned and simpler "zstd". +# Avoid name conflict with static, so postfix static to "zstd-static" +# This seems to be less painful than renaming a DLL file after creation. +set(lib_cmake_filename ${SOURCE_PATH}/build/cmake/lib/CMakeLists.txt) +if (NOT EXISTS ${lib_cmake_filename}.orig) + file(INSTALL ${SOURCE_PATH}/build/cmake/lib/CMakeLists.txt + DESTINATION ${SOURCE_PATH}/build/cmake/lib + RENAME CMakeLists.txt.orig) +endif() +file(READ "${lib_cmake_filename}" lib_cmake_content) +string(REPLACE + "SET(SHARED_LIBRARY_OUTPUT_NAME \${LIBRARY_BASE_NAME}.\${LIBVER_MAJOR}.\${LIBVER_MINOR}.\${LIBVER_RELEASE})" + "SET(SHARED_LIBRARY_OUTPUT_NAME zstd)" + lib_cmake_content + "${lib_cmake_content}" +) +string(REPLACE + "SET(STATIC_LIBRARY_OUTPUT_NAME \${LIBRARY_BASE_NAME})" + "SET(STATIC_LIBRARY_OUTPUT_NAME zstd-static)" + lib_cmake_content + "${lib_cmake_content}" +) +file(WRITE "${lib_cmake_filename}" "${lib_cmake_content}") + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH}/build/cmake OPTIONS -DZSTD_LEGACY_SUPPORT=1 ) - vcpkg_build_cmake() -# Manual install since zstd guarded all their installation functions behind an if (UNIX) +# Manual install message(STATUS "Installing") file(COPY ${SOURCE_PATH}/lib/zstd.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) file(COPY ${SOURCE_PATH}/lib/common/zbuff.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) file(COPY ${SOURCE_PATH}/lib/dictBuilder/zdict.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) +set(RELDIR ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/lib/Release) +set(DEBDIR ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/lib/Debug) if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - # Dynamic libs of zstd appear to start with "zstdlib." - file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/lib/Release/ - DESTINATION ${CURRENT_PACKAGES_DIR}/lib - FILES_MATCHING PATTERN "zstdlib.*.lib") - file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/lib/Release/ - DESTINATION ${CURRENT_PACKAGES_DIR}/bin - FILES_MATCHING PATTERN "zstdlib.*.dll") - file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/lib/Debug/ - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib - FILES_MATCHING PATTERN "zstdlib.*.lib") - file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/lib/Debug/ - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin - FILES_MATCHING PATTERN "zstdlib.*.dll") + file(INSTALL ${RELDIR}/ DESTINATION ${CURRENT_PACKAGES_DIR}/lib FILES_MATCHING PATTERN "zstd_*.lib") + file(INSTALL ${RELDIR}/ DESTINATION ${CURRENT_PACKAGES_DIR}/bin FILES_MATCHING PATTERN "zstd_*.dll") + file(INSTALL ${DEBDIR}/ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib FILES_MATCHING PATTERN "zstd_*.lib") + file(INSTALL ${DEBDIR}/ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin FILES_MATCHING PATTERN "zstd_*.dll") + vcpkg_copy_pdbs() else() - # Static libs of zstd appear to start with "zstdlib_" - file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/lib/Release/ - DESTINATION ${CURRENT_PACKAGES_DIR}/lib - FILES_MATCHING PATTERN "zstdlib_*.lib") - file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/lib/Debug/ - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib - FILES_MATCHING PATTERN "zstdlib_*.lib") + file(INSTALL ${RELDIR}/ DESTINATION ${CURRENT_PACKAGES_DIR}/lib FILES_MATCHING PATTERN "zstd-static_*.lib") + file(INSTALL ${DEBDIR}/ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib FILES_MATCHING PATTERN "zstd-static_*.lib") endif() # Handle copyright file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/zstd) file(RENAME ${CURRENT_PACKAGES_DIR}/share/zstd/LICENSE ${CURRENT_PACKAGES_DIR}/share/zstd/copyright) -vcpkg_copy_pdbs() message(STATUS "Installing done") -- cgit v1.2.3 From 8e911397c5a7e9796714431e9f87787dfd234fcc Mon Sep 17 00:00:00 2001 From: Manuel Massing Date: Mon, 21 Nov 2016 11:43:23 +0100 Subject: [boost] Build boost with zlib support --- ports/boost/CONTROL | 1 + ports/boost/portfile.cmake | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/ports/boost/CONTROL b/ports/boost/CONTROL index 57dfe58e3..8f5fcbb39 100644 --- a/ports/boost/CONTROL +++ b/ports/boost/CONTROL @@ -1,3 +1,4 @@ Source: boost Version: 1.62-6 Description: Peer-reviewed portable C++ source libraries +Build-Depends: zlib diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake index 7cc0d60b0..5b488c697 100644 --- a/ports/boost/portfile.cmake +++ b/ports/boost/portfile.cmake @@ -31,6 +31,10 @@ endif() message(STATUS "Bootstrapping done") set(B2_OPTIONS + -sZLIB_BINARY=zlib + -sZLIB_INCLUDE="${CURRENT_INSTALLED_DIR}\\include" + -sZLIB_LIBPATH="${CURRENT_INSTALLED_DIR}\\lib" + -sNO_BZIP2=1 -j$ENV{NUMBER_OF_PROCESSORS} --debug-configuration --hash -- cgit v1.2.3 From aa3f34c02f4742dcee5ef4a07e03002de2bb520d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 23 Nov 2016 15:46:30 -0800 Subject: Update CHANGELOG and bump version to v0.0.60 --- CHANGELOG.md | 43 +++++++++++++++++++++++++++++++++++++++++++ toolsrc/VERSION.txt | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ea89a30f..a1ad55b0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,46 @@ +vcpkg (0.0.60) +-------------- + * Add ports: + - box2d 2.3.1-374664b + - decimal-for-cpp 1.12 + - jsoncpp 1.7.7 + - libpq 9.6.1 + - libxslt 1.1.29 + - poco 1.7.6-2 + - qt5 5.7-1 + - signalrclient 1.0.0-beta1 + - soci 2016.10.22 + - tclap 1.2.1 + * Update ports: + - boost 1.62-1 -> 1.62-6 + - chakracore 1.2.0.0 -> 1.3.0 + - eigen3 3.2.10-2 -> 3.3.0 + - fmt 3.0.0-1 -> 3.0.1 + - jxrlib 1.1 -> 1.1-1 + - libbson 1.4.2 -> 1.5.0-rc6 + - libuv 1.9.1 -> 1.10.1 + - libwebp 0.5.1 -> 0.5.1-1 + - mongo-c-driver 1.4.2 -> 1.5.0-rc6 + - mongo-cxx-driver 3.0.2 -> 3.0.3 + - pcre 8.38 -> 8.38-1 + - sdl2 2.0.4 -> 2.0.5 + * `vcpkg` has exceeded 100 libraries! + * Rework dependency handling + * Many more portfiles now support static builds. The remaining ones warn that static is not yet supported and will perform a dynamic build instead + * The triplet file is now automatically included and is available in every portfile + * Improvements in the post-build checks: + - Introduce `BUILD_INFO` file. This contains information about the settings used in the build. The post-build checks use this file to choose what checks to perform + - Add CRT checks + - Improve coff file reader. It is now more robust and it correctly handles a couple of corner cases + - A few miscellaneous checks to further prevent potential issues with the produced packages + * Improve integration and fix related issues + * Add support for VS 2017 + * Introduce function that tries to repeatedly build up to a number of failures. This reduces/resolves issues from libraries with flaky builds + * Many fixes and improvements in existing portfiles and the `vcpkg` tool itself + +-- vcpkg team WED, 23 Nov 2016 15:30:00 -0800 + + vcpkg (0.0.51) -------------- * Add simple substring search to `vcpkg cache` diff --git a/toolsrc/VERSION.txt b/toolsrc/VERSION.txt index f19db15c3..19b2518b7 100644 --- a/toolsrc/VERSION.txt +++ b/toolsrc/VERSION.txt @@ -1 +1 @@ -"0.0.51" \ No newline at end of file +"0.0.60" \ No newline at end of file -- cgit v1.2.3 From d6c6818531a8653d870d203491a20cf0ac61be17 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 23 Nov 2016 16:03:44 -0800 Subject: [fmt] Bump version --- ports/fmt/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/fmt/CONTROL b/ports/fmt/CONTROL index b54c468b3..adcb2def4 100644 --- a/ports/fmt/CONTROL +++ b/ports/fmt/CONTROL @@ -1,3 +1,3 @@ Source: fmt -Version: 3.0.1 +Version: 3.0.1-1 Description: Formatting library for C++. It can be used as a safe alternative to printf or as a fast alternative to IOStreams. -- cgit v1.2.3 From 986c6e5ea0bb566e53e39eb97b63a7add0d4bd76 Mon Sep 17 00:00:00 2001 From: Jens Frederich Date: Thu, 24 Nov 2016 13:24:25 +0100 Subject: [think-cell-range] upgrade to e2d3018 Signed-off-by: Jens Frederich --- ports/think-cell-range/CONTROL | 2 +- ports/think-cell-range/portfile.cmake | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/think-cell-range/CONTROL b/ports/think-cell-range/CONTROL index 80b05f586..3b5872232 100644 --- a/ports/think-cell-range/CONTROL +++ b/ports/think-cell-range/CONTROL @@ -1,5 +1,5 @@ Source: think-cell-range Maintainer: jfrederich@gmail.com -Version: 1d785d9 +Version: e2d3018 Description: think-cell's range library , , Build-Depends: boost diff --git a/ports/think-cell-range/portfile.cmake b/ports/think-cell-range/portfile.cmake index bbe75cf8b..858461e36 100644 --- a/ports/think-cell-range/portfile.cmake +++ b/ports/think-cell-range/portfile.cmake @@ -1,9 +1,9 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/range-1d785d99b6d4e43b951bff51219e9304b012c3fe) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/range-e2d3018c3a797e7328dea005e72b34cace8b1fc6) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/think-cell/range/archive/1d785d99b6d4e43b951bff51219e9304b012c3fe.zip" - FILENAME "think-cell_range-1d785d9.zip" - SHA512 2248d9bcc053f67c4b30b640254bf89a2f4c753fb144219806358175fb897a264c330e870556568d3b2f6c6987f49a5a875492b36f614f19bca0e3b46d0c2490 + URLS "https://github.com/think-cell/range/archive/e2d3018c3a797e7328dea005e72b34cace8b1fc6.zip" + FILENAME "think-cell_range-e2d3018.zip" + SHA512 13c74aba4950a84fdf446c976564030b18a740c5ce42b7650116a0559ba9e9a59471ff0f80132c626bc442402b3717805d3615b9ea70751e2dd1e648fd9f7916 ) vcpkg_extract_source_archive(${ARCHIVE}) -- cgit v1.2.3 From 266703eab8b6ecde6b64e2e1a6cd52be6cb6b4e3 Mon Sep 17 00:00:00 2001 From: sdcb Date: Fri, 25 Nov 2016 16:42:12 +0800 Subject: [dxut] switch dxut building static lib dxut is by building static library by default, my previous PR forcing dxut building dynamic by creating a huge patch (basically add dllimport/dllexport everywhere). This PR droped the huge patch and switch building static library (which is the upstream default behavior). related issue: https://github.com/Microsoft/DXUT/issues/8 --- ports/dxut/CONTROL | 2 +- ports/dxut/dll.patch | 834 ---------------------------------------------- ports/dxut/portfile.cmake | 19 +- 3 files changed, 4 insertions(+), 851 deletions(-) delete mode 100644 ports/dxut/dll.patch diff --git a/ports/dxut/CONTROL b/ports/dxut/CONTROL index ee632dfab..56fefdb32 100644 --- a/ports/dxut/CONTROL +++ b/ports/dxut/CONTROL @@ -1,3 +1,3 @@ Source: dxut -Version: 11.14 +Version: 11.14-1 Description: A "GLUT"-like framework for Direct3D 11.x Win32 desktop applications \ No newline at end of file diff --git a/ports/dxut/dll.patch b/ports/dxut/dll.patch deleted file mode 100644 index 4557ab88a..000000000 --- a/ports/dxut/dll.patch +++ /dev/null @@ -1,834 +0,0 @@ -diff --git a/Core/DDSTextureLoader.h b/Core/DDSTextureLoader.h -index 122df9f..8af6c62 100644 ---- a/Core/DDSTextureLoader.h -+++ b/Core/DDSTextureLoader.h -@@ -23,6 +23,11 @@ - #include - #include - -+#ifdef DXUT_EXPORT -+ #define DXUT_API __declspec(dllexport) -+#else -+ #define DXUT_API __declspec(dllimport) -+#endif - - namespace DirectX - { -@@ -34,9 +39,9 @@ namespace DirectX - DDS_ALPHA_MODE_OPAQUE = 3, - DDS_ALPHA_MODE_CUSTOM = 4, - }; -- -+ - // Standard version -- HRESULT CreateDDSTextureFromMemory( _In_ ID3D11Device* d3dDevice, -+ HRESULT DXUT_API CreateDDSTextureFromMemory( _In_ ID3D11Device* d3dDevice, - _In_reads_bytes_(ddsDataSize) const uint8_t* ddsData, - _In_ size_t ddsDataSize, - _Outptr_opt_ ID3D11Resource** texture, -@@ -45,7 +50,7 @@ namespace DirectX - _Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr - ); - -- HRESULT CreateDDSTextureFromFile( _In_ ID3D11Device* d3dDevice, -+ HRESULT DXUT_API CreateDDSTextureFromFile( _In_ ID3D11Device* d3dDevice, - _In_z_ const wchar_t* szFileName, - _Outptr_opt_ ID3D11Resource** texture, - _Outptr_opt_ ID3D11ShaderResourceView** textureView, -@@ -54,7 +59,7 @@ namespace DirectX - ); - - // Standard version with optional auto-gen mipmap support -- HRESULT CreateDDSTextureFromMemory( _In_ ID3D11Device* d3dDevice, -+ HRESULT DXUT_API CreateDDSTextureFromMemory( _In_ ID3D11Device* d3dDevice, - _In_opt_ ID3D11DeviceContext* d3dContext, - _In_reads_bytes_(ddsDataSize) const uint8_t* ddsData, - _In_ size_t ddsDataSize, -@@ -64,7 +69,7 @@ namespace DirectX - _Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr - ); - -- HRESULT CreateDDSTextureFromFile( _In_ ID3D11Device* d3dDevice, -+ HRESULT DXUT_API CreateDDSTextureFromFile( _In_ ID3D11Device* d3dDevice, - _In_opt_ ID3D11DeviceContext* d3dContext, - _In_z_ const wchar_t* szFileName, - _Outptr_opt_ ID3D11Resource** texture, -@@ -74,7 +79,7 @@ namespace DirectX - ); - - // Extended version -- HRESULT CreateDDSTextureFromMemoryEx( _In_ ID3D11Device* d3dDevice, -+ HRESULT DXUT_API CreateDDSTextureFromMemoryEx( _In_ ID3D11Device* d3dDevice, - _In_reads_bytes_(ddsDataSize) const uint8_t* ddsData, - _In_ size_t ddsDataSize, - _In_ size_t maxsize, -@@ -88,7 +93,7 @@ namespace DirectX - _Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr - ); - -- HRESULT CreateDDSTextureFromFileEx( _In_ ID3D11Device* d3dDevice, -+ HRESULT DXUT_API CreateDDSTextureFromFileEx( _In_ ID3D11Device* d3dDevice, - _In_z_ const wchar_t* szFileName, - _In_ size_t maxsize, - _In_ D3D11_USAGE usage, -@@ -102,7 +107,7 @@ namespace DirectX - ); - - // Extended version with optional auto-gen mipmap support -- HRESULT CreateDDSTextureFromMemoryEx( _In_ ID3D11Device* d3dDevice, -+ HRESULT DXUT_API CreateDDSTextureFromMemoryEx( _In_ ID3D11Device* d3dDevice, - _In_opt_ ID3D11DeviceContext* d3dContext, - _In_reads_bytes_(ddsDataSize) const uint8_t* ddsData, - _In_ size_t ddsDataSize, -@@ -117,7 +122,7 @@ namespace DirectX - _Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr - ); - -- HRESULT CreateDDSTextureFromFileEx( _In_ ID3D11Device* d3dDevice, -+ HRESULT DXUT_API CreateDDSTextureFromFileEx( _In_ ID3D11Device* d3dDevice, - _In_opt_ ID3D11DeviceContext* d3dContext, - _In_z_ const wchar_t* szFileName, - _In_ size_t maxsize, -diff --git a/Core/DXUT.h b/Core/DXUT.h -index fc6247e..a0e06fa 100644 ---- a/Core/DXUT.h -+++ b/Core/DXUT.h -@@ -12,6 +12,12 @@ - //-------------------------------------------------------------------------------------- - #pragma once - -+#ifdef DXUT_EXPORT -+ #define DXUT_API __declspec(dllexport) -+#else -+ #define DXUT_API __declspec(dllimport) -+#endif -+ - #ifndef UNICODE - #error "DXUT requires a Unicode build." - #endif -@@ -207,68 +213,68 @@ typedef void (CALLBACK *LPDXUTCALLBACKD3D11SWAPCHAINRELEASING)( _In_opt_ void - typedef void (CALLBACK *LPDXUTCALLBACKD3D11DEVICEDESTROYED)( _In_opt_ void* pUserContext ); - - // General callbacks --void WINAPI DXUTSetCallbackFrameMove( _In_ LPDXUTCALLBACKFRAMEMOVE pCallback, _In_opt_ void* pUserContext = nullptr ); --void WINAPI DXUTSetCallbackKeyboard( _In_ LPDXUTCALLBACKKEYBOARD pCallback, _In_opt_ void* pUserContext = nullptr ); --void WINAPI DXUTSetCallbackMouse( _In_ LPDXUTCALLBACKMOUSE pCallback, bool bIncludeMouseMove = false, _In_opt_ void* pUserContext = nullptr ); --void WINAPI DXUTSetCallbackMsgProc( _In_ LPDXUTCALLBACKMSGPROC pCallback, _In_opt_ void* pUserContext = nullptr ); --void WINAPI DXUTSetCallbackDeviceChanging( _In_ LPDXUTCALLBACKMODIFYDEVICESETTINGS pCallback, _In_opt_ void* pUserContext = nullptr ); --void WINAPI DXUTSetCallbackDeviceRemoved( _In_ LPDXUTCALLBACKDEVICEREMOVED pCallback, _In_opt_ void* pUserContext = nullptr ); -+void DXUT_API WINAPI DXUTSetCallbackFrameMove( _In_ LPDXUTCALLBACKFRAMEMOVE pCallback, _In_opt_ void* pUserContext = nullptr ); -+void DXUT_API WINAPI DXUTSetCallbackKeyboard( _In_ LPDXUTCALLBACKKEYBOARD pCallback, _In_opt_ void* pUserContext = nullptr ); -+void DXUT_API WINAPI DXUTSetCallbackMouse( _In_ LPDXUTCALLBACKMOUSE pCallback, bool bIncludeMouseMove = false, _In_opt_ void* pUserContext = nullptr ); -+void DXUT_API WINAPI DXUTSetCallbackMsgProc( _In_ LPDXUTCALLBACKMSGPROC pCallback, _In_opt_ void* pUserContext = nullptr ); -+void DXUT_API WINAPI DXUTSetCallbackDeviceChanging( _In_ LPDXUTCALLBACKMODIFYDEVICESETTINGS pCallback, _In_opt_ void* pUserContext = nullptr ); -+void DXUT_API WINAPI DXUTSetCallbackDeviceRemoved( _In_ LPDXUTCALLBACKDEVICEREMOVED pCallback, _In_opt_ void* pUserContext = nullptr ); - - // Direct3D 11 callbacks --void WINAPI DXUTSetCallbackD3D11DeviceAcceptable( _In_ LPDXUTCALLBACKISD3D11DEVICEACCEPTABLE pCallback, _In_opt_ void* pUserContext = nullptr ); --void WINAPI DXUTSetCallbackD3D11DeviceCreated( _In_ LPDXUTCALLBACKD3D11DEVICECREATED pCallback, _In_opt_ void* pUserContext = nullptr ); --void WINAPI DXUTSetCallbackD3D11SwapChainResized( _In_ LPDXUTCALLBACKD3D11SWAPCHAINRESIZED pCallback, _In_opt_ void* pUserContext = nullptr ); --void WINAPI DXUTSetCallbackD3D11FrameRender( _In_ LPDXUTCALLBACKD3D11FRAMERENDER pCallback, _In_opt_ void* pUserContext = nullptr ); --void WINAPI DXUTSetCallbackD3D11SwapChainReleasing( _In_ LPDXUTCALLBACKD3D11SWAPCHAINRELEASING pCallback, _In_opt_ void* pUserContext = nullptr ); --void WINAPI DXUTSetCallbackD3D11DeviceDestroyed( _In_ LPDXUTCALLBACKD3D11DEVICEDESTROYED pCallback, _In_opt_ void* pUserContext = nullptr ); -+void DXUT_API WINAPI DXUTSetCallbackD3D11DeviceAcceptable( _In_ LPDXUTCALLBACKISD3D11DEVICEACCEPTABLE pCallback, _In_opt_ void* pUserContext = nullptr ); -+void DXUT_API WINAPI DXUTSetCallbackD3D11DeviceCreated( _In_ LPDXUTCALLBACKD3D11DEVICECREATED pCallback, _In_opt_ void* pUserContext = nullptr ); -+void DXUT_API WINAPI DXUTSetCallbackD3D11SwapChainResized( _In_ LPDXUTCALLBACKD3D11SWAPCHAINRESIZED pCallback, _In_opt_ void* pUserContext = nullptr ); -+void DXUT_API WINAPI DXUTSetCallbackD3D11FrameRender( _In_ LPDXUTCALLBACKD3D11FRAMERENDER pCallback, _In_opt_ void* pUserContext = nullptr ); -+void DXUT_API WINAPI DXUTSetCallbackD3D11SwapChainReleasing( _In_ LPDXUTCALLBACKD3D11SWAPCHAINRELEASING pCallback, _In_opt_ void* pUserContext = nullptr ); -+void DXUT_API WINAPI DXUTSetCallbackD3D11DeviceDestroyed( _In_ LPDXUTCALLBACKD3D11DEVICEDESTROYED pCallback, _In_opt_ void* pUserContext = nullptr ); - - - //-------------------------------------------------------------------------------------- - // Initialization - //-------------------------------------------------------------------------------------- --HRESULT WINAPI DXUTInit( _In_ bool bParseCommandLine = true, -+HRESULT DXUT_API WINAPI DXUTInit( _In_ bool bParseCommandLine = true, - _In_ bool bShowMsgBoxOnError = true, - _In_opt_ WCHAR* strExtraCommandLineParams = nullptr, - _In_ bool bThreadSafeDXUT = false ); - - // Choose either DXUTCreateWindow or DXUTSetWindow. If using DXUTSetWindow, consider using DXUTStaticWndProc --HRESULT WINAPI DXUTCreateWindow( _In_z_ const WCHAR* strWindowTitle = L"Direct3D Window", -+HRESULT DXUT_API WINAPI DXUTCreateWindow( _In_z_ const WCHAR* strWindowTitle = L"Direct3D Window", - _In_opt_ HINSTANCE hInstance = nullptr, _In_opt_ HICON hIcon = nullptr, _In_opt_ HMENU hMenu = nullptr, - _In_ int x = CW_USEDEFAULT, _In_ int y = CW_USEDEFAULT ); --HRESULT WINAPI DXUTSetWindow( _In_ HWND hWndFocus, _In_ HWND hWndDeviceFullScreen, _In_ HWND hWndDeviceWindowed, _In_ bool bHandleMessages = true ); --LRESULT CALLBACK DXUTStaticWndProc( _In_ HWND hWnd, _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam ); -+HRESULT DXUT_API WINAPI DXUTSetWindow( _In_ HWND hWndFocus, _In_ HWND hWndDeviceFullScreen, _In_ HWND hWndDeviceWindowed, _In_ bool bHandleMessages = true ); -+LRESULT DXUT_API CALLBACK DXUTStaticWndProc( _In_ HWND hWnd, _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam ); - - // Choose either DXUTCreateDevice or DXUTCreateD3DDeviceFromSettings - --HRESULT WINAPI DXUTCreateDevice(_In_ D3D_FEATURE_LEVEL reqFL, _In_ bool bWindowed= true, _In_ int nSuggestedWidth =0,_In_ int nSuggestedHeight =0 ); --HRESULT WINAPI DXUTCreateDeviceFromSettings( _In_ DXUTDeviceSettings* pDeviceSettings, _In_ bool bClipWindowToSingleAdapter = true ); -+HRESULT DXUT_API WINAPI DXUTCreateDevice(_In_ D3D_FEATURE_LEVEL reqFL, _In_ bool bWindowed= true, _In_ int nSuggestedWidth =0,_In_ int nSuggestedHeight =0 ); -+HRESULT DXUT_API WINAPI DXUTCreateDeviceFromSettings( _In_ DXUTDeviceSettings* pDeviceSettings, _In_ bool bClipWindowToSingleAdapter = true ); - - // Choose either DXUTMainLoop or implement your own main loop --HRESULT WINAPI DXUTMainLoop( _In_opt_ HACCEL hAccel = nullptr ); -+HRESULT DXUT_API WINAPI DXUTMainLoop( _In_opt_ HACCEL hAccel = nullptr ); - - // If not using DXUTMainLoop consider using DXUTRender3DEnvironment --void WINAPI DXUTRender3DEnvironment(); -+void DXUT_API WINAPI DXUTRender3DEnvironment(); - - - //-------------------------------------------------------------------------------------- - // Common Tasks - //-------------------------------------------------------------------------------------- --HRESULT WINAPI DXUTToggleFullScreen(); --HRESULT WINAPI DXUTToggleREF(); --HRESULT WINAPI DXUTToggleWARP(); --void WINAPI DXUTPause( _In_ bool bPauseTime, _In_ bool bPauseRendering ); --void WINAPI DXUTSetConstantFrameTime( _In_ bool bConstantFrameTime, _In_ float fTimePerFrame = 0.0333f ); --void WINAPI DXUTSetCursorSettings( _In_ bool bShowCursorWhenFullScreen = false, _In_ bool bClipCursorWhenFullScreen = false ); --void WINAPI DXUTSetHotkeyHandling( _In_ bool bAltEnterToToggleFullscreen = true, _In_ bool bEscapeToQuit = true, _In_ bool bPauseToToggleTimePause = true ); --void WINAPI DXUTSetMultimonSettings( _In_ bool bAutoChangeAdapter = true ); --void WINAPI DXUTSetShortcutKeySettings( _In_ bool bAllowWhenFullscreen = false, _In_ bool bAllowWhenWindowed = true ); // Controls the Windows key, and accessibility shortcut keys --void WINAPI DXUTSetWindowSettings( _In_ bool bCallDefWindowProc = true ); --HRESULT WINAPI DXUTSetTimer( _In_ LPDXUTCALLBACKTIMER pCallbackTimer, _In_ float fTimeoutInSecs = 1.0f, _Out_opt_ UINT* pnIDEvent = nullptr, _In_opt_ void* pCallbackUserContext = nullptr ); --HRESULT WINAPI DXUTKillTimer( _In_ UINT nIDEvent ); --void WINAPI DXUTResetFrameworkState(); --void WINAPI DXUTShutdown( _In_ int nExitCode = 0 ); --void WINAPI DXUTSetIsInGammaCorrectMode( _In_ bool bGammaCorrect ); --bool WINAPI DXUTGetMSAASwapChainCreated(); -+HRESULT DXUT_API WINAPI DXUTToggleFullScreen(); -+HRESULT DXUT_API WINAPI DXUTToggleREF(); -+HRESULT DXUT_API WINAPI DXUTToggleWARP(); -+void DXUT_API WINAPI DXUTPause( _In_ bool bPauseTime, _In_ bool bPauseRendering ); -+void DXUT_API WINAPI DXUTSetConstantFrameTime( _In_ bool bConstantFrameTime, _In_ float fTimePerFrame = 0.0333f ); -+void DXUT_API WINAPI DXUTSetCursorSettings( _In_ bool bShowCursorWhenFullScreen = false, _In_ bool bClipCursorWhenFullScreen = false ); -+void DXUT_API WINAPI DXUTSetHotkeyHandling( _In_ bool bAltEnterToToggleFullscreen = true, _In_ bool bEscapeToQuit = true, _In_ bool bPauseToToggleTimePause = true ); -+void DXUT_API WINAPI DXUTSetMultimonSettings( _In_ bool bAutoChangeAdapter = true ); -+void DXUT_API WINAPI DXUTSetShortcutKeySettings( _In_ bool bAllowWhenFullscreen = false, _In_ bool bAllowWhenWindowed = true ); // Controls the Windows key, and accessibility shortcut keys -+void DXUT_API WINAPI DXUTSetWindowSettings( _In_ bool bCallDefWindowProc = true ); -+HRESULT DXUT_API WINAPI DXUTSetTimer( _In_ LPDXUTCALLBACKTIMER pCallbackTimer, _In_ float fTimeoutInSecs = 1.0f, _Out_opt_ UINT* pnIDEvent = nullptr, _In_opt_ void* pCallbackUserContext = nullptr ); -+HRESULT DXUT_API WINAPI DXUTKillTimer( _In_ UINT nIDEvent ); -+void DXUT_API WINAPI DXUTResetFrameworkState(); -+void DXUT_API WINAPI DXUTShutdown( _In_ int nExitCode = 0 ); -+void DXUT_API WINAPI DXUTSetIsInGammaCorrectMode( _In_ bool bGammaCorrect ); -+bool DXUT_API WINAPI DXUTGetMSAASwapChainCreated(); - - - //-------------------------------------------------------------------------------------- -@@ -276,63 +282,63 @@ bool WINAPI DXUTGetMSAASwapChainCreated(); - //-------------------------------------------------------------------------------------- - - // Direct3D 11.x (These do not addref unlike typical Get* APIs) --IDXGIFactory1* WINAPI DXUTGetDXGIFactory(); --IDXGISwapChain* WINAPI DXUTGetDXGISwapChain(); --const DXGI_SURFACE_DESC* WINAPI DXUTGetDXGIBackBufferSurfaceDesc(); --HRESULT WINAPI DXUTSetupD3D11Views( _In_ ID3D11DeviceContext* pd3dDeviceContext ); // Supports immediate or deferred context --D3D_FEATURE_LEVEL WINAPI DXUTGetD3D11DeviceFeatureLevel(); // Returns the D3D11 devices current feature level --ID3D11RenderTargetView* WINAPI DXUTGetD3D11RenderTargetView(); --ID3D11DepthStencilView* WINAPI DXUTGetD3D11DepthStencilView(); -+DXUT_API IDXGIFactory1* WINAPI DXUTGetDXGIFactory(); -+DXUT_API IDXGISwapChain* WINAPI DXUTGetDXGISwapChain(); -+DXUT_API const DXGI_SURFACE_DESC* WINAPI DXUTGetDXGIBackBufferSurfaceDesc(); -+DXUT_API HRESULT WINAPI DXUTSetupD3D11Views(_In_ ID3D11DeviceContext* pd3dDeviceContext); // Supports immediate or deferred context -+DXUT_API D3D_FEATURE_LEVEL WINAPI DXUTGetD3D11DeviceFeatureLevel(); // Returns the D3D11 devices current feature level -+DXUT_API ID3D11RenderTargetView* WINAPI DXUTGetD3D11RenderTargetView(); -+DXUT_API ID3D11DepthStencilView* WINAPI DXUTGetD3D11DepthStencilView(); - --ID3D11Device* WINAPI DXUTGetD3D11Device(); --ID3D11DeviceContext* WINAPI DXUTGetD3D11DeviceContext(); -+DXUT_API ID3D11Device* WINAPI DXUTGetD3D11Device(); -+DXUT_API ID3D11DeviceContext* WINAPI DXUTGetD3D11DeviceContext(); - --ID3D11Device1* WINAPI DXUTGetD3D11Device1(); --ID3D11DeviceContext1* WINAPI DXUTGetD3D11DeviceContext1(); -+DXUT_API ID3D11Device1* WINAPI DXUTGetD3D11Device1(); -+DXUT_API ID3D11DeviceContext1* WINAPI DXUTGetD3D11DeviceContext1(); - - #ifdef USE_DIRECT3D11_2 --ID3D11Device2* WINAPI DXUTGetD3D11Device2(); --ID3D11DeviceContext2* WINAPI DXUTGetD3D11DeviceContext2(); -+DXUT_API ID3D11Device2* WINAPI DXUTGetD3D11Device2(); -+DXUT_API ID3D11DeviceContext2* WINAPI DXUTGetD3D11DeviceContext2(); - #endif - - #ifdef USE_DIRECT3D11_3 --ID3D11Device3* WINAPI DXUTGetD3D11Device3(); --ID3D11DeviceContext3* WINAPI DXUTGetD3D11DeviceContext3(); -+DXUT_API ID3D11Device3* WINAPI DXUTGetD3D11Device3(); -+DXUT_API ID3D11DeviceContext3* WINAPI DXUTGetD3D11DeviceContext3(); - #endif - - // General --DXUTDeviceSettings WINAPI DXUTGetDeviceSettings(); --HINSTANCE WINAPI DXUTGetHINSTANCE(); --HWND WINAPI DXUTGetHWND(); --HWND WINAPI DXUTGetHWNDFocus(); --HWND WINAPI DXUTGetHWNDDeviceFullScreen(); --HWND WINAPI DXUTGetHWNDDeviceWindowed(); --RECT WINAPI DXUTGetWindowClientRect(); --LONG WINAPI DXUTGetWindowWidth(); --LONG WINAPI DXUTGetWindowHeight(); --RECT WINAPI DXUTGetWindowClientRectAtModeChange(); // Useful for returning to windowed mode with the same resolution as before toggle to full screen mode --RECT WINAPI DXUTGetFullsceenClientRectAtModeChange(); // Useful for returning to full screen mode with the same resolution as before toggle to windowed mode --double WINAPI DXUTGetTime(); --float WINAPI DXUTGetElapsedTime(); --bool WINAPI DXUTIsWindowed(); --bool WINAPI DXUTIsInGammaCorrectMode(); --float WINAPI DXUTGetFPS(); --LPCWSTR WINAPI DXUTGetWindowTitle(); --LPCWSTR WINAPI DXUTGetFrameStats( _In_ bool bIncludeFPS = false ); --LPCWSTR WINAPI DXUTGetDeviceStats(); -- --bool WINAPI DXUTIsVsyncEnabled(); --bool WINAPI DXUTIsRenderingPaused(); --bool WINAPI DXUTIsTimePaused(); --bool WINAPI DXUTIsActive(); --int WINAPI DXUTGetExitCode(); --bool WINAPI DXUTGetShowMsgBoxOnError(); --bool WINAPI DXUTGetAutomation(); // Returns true if -automation parameter is used to launch the app --bool WINAPI DXUTIsKeyDown( _In_ BYTE vKey ); // Pass a virtual-key code, ex. VK_F1, 'A', VK_RETURN, VK_LSHIFT, etc --bool WINAPI DXUTWasKeyPressed( _In_ BYTE vKey ); // Like DXUTIsKeyDown() but return true only if the key was just pressed --bool WINAPI DXUTIsMouseButtonDown( _In_ BYTE vButton ); // Pass a virtual-key code: VK_LBUTTON, VK_RBUTTON, VK_MBUTTON, VK_XBUTTON1, VK_XBUTTON2 --HRESULT WINAPI DXUTCreateState(); // Optional method to create DXUT's memory. If its not called by the application it will be automatically called when needed --void WINAPI DXUTDestroyState(); // Optional method to destroy DXUT's memory. If its not called by the application it will be automatically called after the application exits WinMain -+DXUTDeviceSettings DXUT_API WINAPI DXUTGetDeviceSettings(); -+HINSTANCE DXUT_API WINAPI DXUTGetHINSTANCE(); -+HWND DXUT_API WINAPI DXUTGetHWND(); -+HWND DXUT_API WINAPI DXUTGetHWNDFocus(); -+HWND DXUT_API WINAPI DXUTGetHWNDDeviceFullScreen(); -+HWND DXUT_API WINAPI DXUTGetHWNDDeviceWindowed(); -+RECT DXUT_API WINAPI DXUTGetWindowClientRect(); -+LONG DXUT_API WINAPI DXUTGetWindowWidth(); -+LONG DXUT_API WINAPI DXUTGetWindowHeight(); -+RECT DXUT_API WINAPI DXUTGetWindowClientRectAtModeChange(); // Useful for returning to windowed mode with the same resolution as before toggle to full screen mode -+RECT DXUT_API WINAPI DXUTGetFullsceenClientRectAtModeChange(); // Useful for returning to full screen mode with the same resolution as before toggle to windowed mode -+double DXUT_API WINAPI DXUTGetTime(); -+float DXUT_API WINAPI DXUTGetElapsedTime(); -+bool DXUT_API WINAPI DXUTIsWindowed(); -+bool DXUT_API WINAPI DXUTIsInGammaCorrectMode(); -+float DXUT_API WINAPI DXUTGetFPS(); -+LPCWSTR DXUT_API WINAPI DXUTGetWindowTitle(); -+LPCWSTR DXUT_API WINAPI DXUTGetFrameStats( _In_ bool bIncludeFPS = false ); -+LPCWSTR DXUT_API WINAPI DXUTGetDeviceStats(); -+ -+bool DXUT_API WINAPI DXUTIsVsyncEnabled(); -+bool DXUT_API WINAPI DXUTIsRenderingPaused(); -+bool DXUT_API WINAPI DXUTIsTimePaused(); -+bool DXUT_API WINAPI DXUTIsActive(); -+int DXUT_API WINAPI DXUTGetExitCode(); -+bool DXUT_API WINAPI DXUTGetShowMsgBoxOnError(); -+bool DXUT_API WINAPI DXUTGetAutomation(); // Returns true if -automation parameter is used to launch the app -+bool DXUT_API WINAPI DXUTIsKeyDown( _In_ BYTE vKey ); // Pass a virtual-key code, ex. VK_F1, 'A', VK_RETURN, VK_LSHIFT, etc -+bool DXUT_API WINAPI DXUTWasKeyPressed( _In_ BYTE vKey ); // Like DXUTIsKeyDown() but return true only if the key was just pressed -+bool DXUT_API WINAPI DXUTIsMouseButtonDown( _In_ BYTE vButton ); // Pass a virtual-key code: VK_LBUTTON, VK_RBUTTON, VK_MBUTTON, VK_XBUTTON1, VK_XBUTTON2 -+HRESULT DXUT_API WINAPI DXUTCreateState(); // Optional method to create DXUT's memory. If its not called by the application it will be automatically called when needed -+void DXUT_API WINAPI DXUTDestroyState(); // Optional method to destroy DXUT's memory. If its not called by the application it will be automatically called after the application exits WinMain - - //-------------------------------------------------------------------------------------- - // DXUT core layer includes -diff --git a/Core/DXUTDevice11.h b/Core/DXUTDevice11.h -index 1e38a63..e607463 100644 ---- a/Core/DXUTDevice11.h -+++ b/Core/DXUTDevice11.h -@@ -14,12 +14,14 @@ - //-------------------------------------------------------------------------------------- - #pragma once - --void DXUTApplyDefaultDeviceSettings(DXUTDeviceSettings *modifySettings); -+#pragma warning(disable: 4251) -+ -+DXUT_API void DXUTApplyDefaultDeviceSettings(DXUTDeviceSettings *modifySettings); - - //-------------------------------------------------------------------------------------- - // Functions to get bit depth from formats - //-------------------------------------------------------------------------------------- --HRESULT WINAPI DXUTGetD3D11AdapterDisplayMode( _In_ UINT AdapterOrdinal, _In_ UINT Output, _Out_ DXGI_MODE_DESC* pModeDesc ); -+DXUT_API HRESULT WINAPI DXUTGetD3D11AdapterDisplayMode( _In_ UINT AdapterOrdinal, _In_ UINT Output, _Out_ DXGI_MODE_DESC* pModeDesc ); - - - -@@ -28,7 +30,7 @@ HRESULT WINAPI DXUTGetD3D11AdapterDisplayMode( _In_ UINT AdapterOrdinal, _In_ UI - // Optional memory create/destory functions. If not call, these will be called automatically - //-------------------------------------------------------------------------------------- - HRESULT WINAPI DXUTCreateD3D11Enumeration(); --void WINAPI DXUTDestroyD3D11Enumeration(); -+DXUT_API void WINAPI DXUTDestroyD3D11Enumeration(); - - - -@@ -46,7 +48,7 @@ struct CD3D11EnumDeviceSettingsCombo; - //-------------------------------------------------------------------------------------- - // Enumerates available Direct3D11 adapters, devices, modes, etc. - //-------------------------------------------------------------------------------------- --class CD3D11Enumeration -+class DXUT_API CD3D11Enumeration - { - public: - // These should be called before Enumerate(). -@@ -106,7 +108,7 @@ private: - void ClearAdapterInfoList(); - }; - --CD3D11Enumeration* WINAPI DXUTGetD3D11Enumeration(_In_ bool bForceEnumerate = false, _In_ bool EnumerateAllAdapterFormats = true, _In_ D3D_FEATURE_LEVEL forceFL = ((D3D_FEATURE_LEVEL )0) ); -+DXUT_API CD3D11Enumeration* WINAPI DXUTGetD3D11Enumeration(_In_ bool bForceEnumerate = false, _In_ bool EnumerateAllAdapterFormats = true, _In_ D3D_FEATURE_LEVEL forceFL = ((D3D_FEATURE_LEVEL )0) ); - - - #define DXGI_MAX_DEVICE_IDENTIFIER_STRING 128 -@@ -115,7 +117,7 @@ CD3D11Enumeration* WINAPI DXUTGetD3D11Enumeration(_In_ bool bForceEnumerate = fa - // A class describing an adapter which contains a unique adapter ordinal - // that is installed on the system - //-------------------------------------------------------------------------------------- --class CD3D11EnumAdapterInfo -+class DXUT_API CD3D11EnumAdapterInfo - { - const CD3D11EnumAdapterInfo &operator = ( const CD3D11EnumAdapterInfo &rhs ); - -@@ -144,7 +146,7 @@ public: - }; - - --class CD3D11EnumOutputInfo -+class DXUT_API CD3D11EnumOutputInfo - { - const CD3D11EnumOutputInfo &operator = ( const CD3D11EnumOutputInfo &rhs ); - -@@ -167,7 +169,7 @@ public: - //-------------------------------------------------------------------------------------- - // A class describing a Direct3D11 device that contains a unique supported driver type - //-------------------------------------------------------------------------------------- --class CD3D11EnumDeviceInfo -+class DXUT_API CD3D11EnumDeviceInfo - { - const CD3D11EnumDeviceInfo& operator =( const CD3D11EnumDeviceInfo& rhs ); - -@@ -187,7 +189,7 @@ public: - // adapter format, back buffer format, and windowed that is compatible with a - // particular Direct3D device and the app. - //-------------------------------------------------------------------------------------- --struct CD3D11EnumDeviceSettingsCombo -+struct DXUT_API CD3D11EnumDeviceSettingsCombo - { - UINT AdapterOrdinal; - D3D_DRIVER_TYPE DeviceType; -@@ -203,7 +205,7 @@ struct CD3D11EnumDeviceSettingsCombo - CD3D11EnumOutputInfo* pOutputInfo; - }; - --float DXUTRankD3D11DeviceCombo( _In_ CD3D11EnumDeviceSettingsCombo* pDeviceSettingsCombo, -+float DXUT_API DXUTRankD3D11DeviceCombo( _In_ CD3D11EnumDeviceSettingsCombo* pDeviceSettingsCombo, - _In_ DXUTD3D11DeviceSettings* pOptimalDeviceSettings, - _Out_ int &bestModeIndex, - _Out_ int &bestMSAAIndex -diff --git a/Core/DXUT_2015.vcxproj b/Core/DXUT_2015.vcxproj -index 6d6c522..62b0708 100644 ---- a/Core/DXUT_2015.vcxproj -+++ b/Core/DXUT_2015.vcxproj -@@ -34,35 +34,35 @@ - - - -- StaticLibrary -+ DynamicLibrary - Unicode - v140 - - -- StaticLibrary -+ DynamicLibrary - Unicode - v140 - - -- StaticLibrary -+ DynamicLibrary - true - Unicode - v140 - - -- StaticLibrary -+ DynamicLibrary - true - Unicode - v140 - - -- StaticLibrary -+ DynamicLibrary - true - Unicode - v140 - - -- StaticLibrary -+ DynamicLibrary - true - Unicode - v140 -@@ -147,7 +147,7 @@ - StreamingSIMDExtensions2 - Sync - %(AdditionalOptions) -- WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_LIB;USE_DIRECT3D11_2;_WIN32_WINNT=0x0600;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) -+ DXUT_EXPORT;WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_LIB;USE_DIRECT3D11_2;_WIN32_WINNT=0x0600;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) - EditAndContinue - EnableFastChecks - $(IntDir)$(TargetName).pdb -@@ -156,7 +156,7 @@ - - - %(AdditionalOptions) -- %(AdditionalDependencies) -+ comctl32.lib;%(AdditionalDependencies) - Windows - true - true -@@ -188,7 +188,7 @@ - Fast - Sync - %(AdditionalOptions) -- WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_LIB;USE_DIRECT3D11_2;_WIN32_WINNT=0x0600;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) -+ DXUT_EXPORT;WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_LIB;USE_DIRECT3D11_2;_WIN32_WINNT=0x0600;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) - EnableFastChecks - $(IntDir)$(TargetName).pdb - Use -@@ -196,7 +196,7 @@ - - - %(AdditionalOptions) -- %(AdditionalDependencies) -+ comctl32.lib;%(AdditionalDependencies) - Windows - true - true -@@ -230,14 +230,14 @@ - StreamingSIMDExtensions2 - Sync - %(AdditionalOptions) -- WIN32;NDEBUG;_WINDOWS;_LIB;USE_DIRECT3D11_2;_WIN32_WINNT=0x0600;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) -+ DXUT_EXPORT;WIN32;NDEBUG;_WINDOWS;_LIB;USE_DIRECT3D11_2;_WIN32_WINNT=0x0600;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) - $(IntDir)$(TargetName).pdb - Use - DXUT.h - - - %(AdditionalOptions) -- %(AdditionalDependencies) -+ comctl32.lib;%(AdditionalDependencies) - true - Windows - true -@@ -272,14 +272,14 @@ - Fast - Sync - %(AdditionalOptions) -- WIN32;NDEBUG;_WINDOWS;_LIB;USE_DIRECT3D11_2;_WIN32_WINNT=0x0600;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) -+ DXUT_EXPORT;WIN32;NDEBUG;_WINDOWS;_LIB;USE_DIRECT3D11_2;_WIN32_WINNT=0x0600;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) - $(IntDir)$(TargetName).pdb - Use - DXUT.h - - - %(AdditionalOptions) -- %(AdditionalDependencies) -+ comctl32.lib;%(AdditionalDependencies) - true - Windows - true -@@ -315,14 +315,14 @@ - StreamingSIMDExtensions2 - Sync - %(AdditionalOptions) -- WIN32;NDEBUG;PROFILE;_WINDOWS;_LIB;USE_DIRECT3D11_2;_WIN32_WINNT=0x0600;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) -+ DXUT_EXPORT;WIN32;NDEBUG;PROFILE;_WINDOWS;_LIB;USE_DIRECT3D11_2;_WIN32_WINNT=0x0600;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) - $(IntDir)$(TargetName).pdb - Use - DXUT.h - - - %(AdditionalOptions) -- %(AdditionalDependencies) -+ comctl32.lib;%(AdditionalDependencies) - true - Windows - true -@@ -357,14 +357,14 @@ - Fast - Sync - %(AdditionalOptions) -- WIN32;NDEBUG;PROFILE;_WINDOWS;_LIB;USE_DIRECT3D11_2;_WIN32_WINNT=0x0600;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) -+ DXUT_EXPORT;WIN32;NDEBUG;PROFILE;_WINDOWS;_LIB;USE_DIRECT3D11_2;_WIN32_WINNT=0x0600;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) - $(IntDir)$(TargetName).pdb - Use - DXUT.h - - - %(AdditionalOptions) -- %(AdditionalDependencies) -+ comctl32.lib;%(AdditionalDependencies) - true - Windows - true -diff --git a/Core/DXUTmisc.h b/Core/DXUTmisc.h -index 9706ccc..74ab666 100644 ---- a/Core/DXUTmisc.h -+++ b/Core/DXUTmisc.h -@@ -62,23 +62,23 @@ struct DXUT_GAMEPAD - bool bLastRightTrigger; - }; - --HRESULT DXUTGetGamepadState( _In_ DWORD dwPort, _In_ DXUT_GAMEPAD* pGamePad, _In_ bool bThumbstickDeadZone = true, -+HRESULT DXUT_API DXUTGetGamepadState( _In_ DWORD dwPort, _In_ DXUT_GAMEPAD* pGamePad, _In_ bool bThumbstickDeadZone = true, - _In_ bool bSnapThumbstickToCardinals = true ); --HRESULT DXUTStopRumbleOnAllControllers(); --void DXUTEnableXInput( _In_ bool bEnable ); -+HRESULT DXUT_API DXUTStopRumbleOnAllControllers(); -+void DXUT_API DXUTEnableXInput( _In_ bool bEnable ); - - - //-------------------------------------------------------------------------------------- - // Takes a screen shot of a 32bit D3D11 back buffer and saves the images to a BMP or DDS file - //-------------------------------------------------------------------------------------- - --HRESULT DXUTSnapD3D11Screenshot( _In_z_ LPCWSTR szFileName, _In_ bool usedds = true ); -+HRESULT DXUT_API DXUTSnapD3D11Screenshot( _In_z_ LPCWSTR szFileName, _In_ bool usedds = true ); - - //-------------------------------------------------------------------------------------- - // Performs timer operations - // Use DXUTGetGlobalTimer() to get the global instance - //-------------------------------------------------------------------------------------- --class CDXUTTimer -+class DXUT_API CDXUTTimer - { - public: - CDXUTTimer(); -@@ -109,24 +109,24 @@ protected: - LONGLONG m_llBaseTime; - }; - --CDXUTTimer* WINAPI DXUTGetGlobalTimer(); -+DXUT_API CDXUTTimer* WINAPI DXUTGetGlobalTimer(); - - - //-------------------------------------------------------------------------------------- - // Returns the string for the given DXGI_FORMAT. - // bWithPrefix determines whether the string should include the "DXGI_FORMAT_" - //-------------------------------------------------------------------------------------- --LPCWSTR WINAPI DXUTDXGIFormatToString( _In_ DXGI_FORMAT format, _In_ bool bWithPrefix ); -+DXUT_API LPCWSTR WINAPI DXUTDXGIFormatToString( _In_ DXGI_FORMAT format, _In_ bool bWithPrefix ); - - - //-------------------------------------------------------------------------------------- - // Debug printing support - // See dxerr.h for more debug printing support - //-------------------------------------------------------------------------------------- --void WINAPI DXUTOutputDebugStringW( _In_z_ LPCWSTR strMsg, ... ); --void WINAPI DXUTOutputDebugStringA( _In_z_ LPCSTR strMsg, ... ); --HRESULT WINAPI DXUTTrace( _In_z_ const CHAR* strFile, _In_ DWORD dwLine, _In_ HRESULT hr, _In_z_ const WCHAR* strMsg, _In_ bool bPopMsgBox ); --const WCHAR* WINAPI DXUTTraceWindowsMessage( _In_ UINT uMsg ); -+DXUT_API void WINAPI DXUTOutputDebugStringW( _In_z_ LPCWSTR strMsg, ... ); -+DXUT_API void WINAPI DXUTOutputDebugStringA( _In_z_ LPCSTR strMsg, ... ); -+DXUT_API HRESULT WINAPI DXUTTrace( _In_z_ const CHAR* strFile, _In_ DWORD dwLine, _In_ HRESULT hr, _In_z_ const WCHAR* strMsg, _In_ bool bPopMsgBox ); -+DXUT_API const WCHAR* WINAPI DXUTTraceWindowsMessage( _In_ UINT uMsg ); - - #ifdef UNICODE - #define DXUTOutputDebugString DXUTOutputDebugStringW -@@ -152,17 +152,17 @@ const WCHAR* WINAPI DXUTTraceWindowsMessage( _In_ UINT uMsg ); - // failure if APIs are not present. - //-------------------------------------------------------------------------------------- - --int WINAPI DXUT_Dynamic_D3DPERF_BeginEvent( _In_ DWORD col, _In_z_ LPCWSTR wszName ); --int WINAPI DXUT_Dynamic_D3DPERF_EndEvent( void ); --void WINAPI DXUT_Dynamic_D3DPERF_SetMarker( _In_ DWORD col, _In_z_ LPCWSTR wszName ); --void WINAPI DXUT_Dynamic_D3DPERF_SetRegion( _In_ DWORD col, _In_z_ LPCWSTR wszName ); --BOOL WINAPI DXUT_Dynamic_D3DPERF_QueryRepeatFrame( void ); --void WINAPI DXUT_Dynamic_D3DPERF_SetOptions( _In_ DWORD dwOptions ); --DWORD WINAPI DXUT_Dynamic_D3DPERF_GetStatus(); --HRESULT WINAPI DXUT_Dynamic_CreateDXGIFactory1( _In_ REFIID rInterface, _Out_ void** ppOut ); --HRESULT WINAPI DXUT_Dynamic_DXGIGetDebugInterface( _In_ REFIID rInterface, _Out_ void** ppOut ); -- --HRESULT WINAPI DXUT_Dynamic_D3D11CreateDevice( _In_opt_ IDXGIAdapter* pAdapter, -+DXUT_API int WINAPI DXUT_Dynamic_D3DPERF_BeginEvent( _In_ DWORD col, _In_z_ LPCWSTR wszName ); -+DXUT_API int WINAPI DXUT_Dynamic_D3DPERF_EndEvent( void ); -+DXUT_API void WINAPI DXUT_Dynamic_D3DPERF_SetMarker( _In_ DWORD col, _In_z_ LPCWSTR wszName ); -+DXUT_API void WINAPI DXUT_Dynamic_D3DPERF_SetRegion( _In_ DWORD col, _In_z_ LPCWSTR wszName ); -+DXUT_API BOOL WINAPI DXUT_Dynamic_D3DPERF_QueryRepeatFrame( void ); -+DXUT_API void WINAPI DXUT_Dynamic_D3DPERF_SetOptions( _In_ DWORD dwOptions ); -+DXUT_API DWORD WINAPI DXUT_Dynamic_D3DPERF_GetStatus(); -+DXUT_API HRESULT WINAPI DXUT_Dynamic_CreateDXGIFactory1( _In_ REFIID rInterface, _Out_ void** ppOut ); -+DXUT_API HRESULT WINAPI DXUT_Dynamic_DXGIGetDebugInterface( _In_ REFIID rInterface, _Out_ void** ppOut ); -+ -+DXUT_API HRESULT WINAPI DXUT_Dynamic_D3D11CreateDevice( _In_opt_ IDXGIAdapter* pAdapter, - _In_ D3D_DRIVER_TYPE DriverType, - _In_opt_ HMODULE Software, - _In_ UINT32 Flags, -@@ -173,7 +173,7 @@ HRESULT WINAPI DXUT_Dynamic_D3D11CreateDevice( _In_opt_ IDXGIAdapter* pAdapter, - _Out_opt_ D3D_FEATURE_LEVEL* pFeatureLevel, - _Out_opt_ ID3D11DeviceContext** ppImmediateContext ); - --bool DXUT_EnsureD3D11APIs(); -+DXUT_API bool DXUT_EnsureD3D11APIs(); - - - //-------------------------------------------------------------------------------------- -@@ -285,14 +285,14 @@ typedef MONITORINFOEXW MONITORINFOEX; - typedef LPMONITORINFOEXW LPMONITORINFOEX; - #endif - --HMONITOR WINAPI DXUTMonitorFromWindow( _In_ HWND hWnd, _In_ DWORD dwFlags ); --HMONITOR WINAPI DXUTMonitorFromRect( _In_ LPCRECT lprcScreenCoords, _In_ DWORD dwFlags ); --BOOL WINAPI DXUTGetMonitorInfo( _In_ HMONITOR hMonitor, _Out_ LPMONITORINFO lpMonitorInfo ); --void WINAPI DXUTGetDesktopResolution( _In_ UINT AdapterOrdinal, _Out_ UINT* pWidth, _Out_ UINT* pHeight ); -+DXUT_API HMONITOR WINAPI DXUTMonitorFromWindow( _In_ HWND hWnd, _In_ DWORD dwFlags ); -+DXUT_API HMONITOR WINAPI DXUTMonitorFromRect( _In_ LPCRECT lprcScreenCoords, _In_ DWORD dwFlags ); -+DXUT_API BOOL WINAPI DXUTGetMonitorInfo( _In_ HMONITOR hMonitor, _Out_ LPMONITORINFO lpMonitorInfo ); -+DXUT_API void WINAPI DXUTGetDesktopResolution( _In_ UINT AdapterOrdinal, _Out_ UINT* pWidth, _Out_ UINT* pHeight ); - - - //-------------------------------------------------------------------------------------- - // Helper functions to create SRGB formats from typeless formats and vice versa - //-------------------------------------------------------------------------------------- --DXGI_FORMAT MAKE_SRGB( _In_ DXGI_FORMAT format ); --DXGI_FORMAT MAKE_TYPELESS( _In_ DXGI_FORMAT format ); -+DXUT_API DXGI_FORMAT MAKE_SRGB( _In_ DXGI_FORMAT format ); -+DXUT_API DXGI_FORMAT MAKE_TYPELESS( _In_ DXGI_FORMAT format ); -diff --git a/Core/ScreenGrab.h b/Core/ScreenGrab.h -index d643073..cf4eba6 100644 ---- a/Core/ScreenGrab.h -+++ b/Core/ScreenGrab.h -@@ -27,14 +27,20 @@ - #include - #include - -+#ifdef DXUT_EXPORT -+ #define DXUT_API __declspec(dllexport) -+#else -+ #define DXUT_API __declspec(dllimport) -+#endif -+ - - namespace DirectX - { -- HRESULT SaveDDSTextureToFile( _In_ ID3D11DeviceContext* pContext, -+ DXUT_API HRESULT SaveDDSTextureToFile( _In_ ID3D11DeviceContext* pContext, - _In_ ID3D11Resource* pSource, - _In_z_ LPCWSTR fileName ); - -- HRESULT SaveWICTextureToFile( _In_ ID3D11DeviceContext* pContext, -+ DXUT_API HRESULT SaveWICTextureToFile( _In_ ID3D11DeviceContext* pContext, - _In_ ID3D11Resource* pSource, - _In_ REFGUID guidContainerFormat, - _In_z_ LPCWSTR fileName, -diff --git a/Core/WICTextureLoader.h b/Core/WICTextureLoader.h -index 2b0340c..f2edacf 100644 ---- a/Core/WICTextureLoader.h -+++ b/Core/WICTextureLoader.h -@@ -30,11 +30,17 @@ - #include - #include - -+#ifdef DXUT_EXPORT -+ #define DXUT_API __declspec(dllexport) -+#else -+ #define DXUT_API __declspec(dllimport) -+#endif -+ - - namespace DirectX - { - // Standard version -- HRESULT CreateWICTextureFromMemory( _In_ ID3D11Device* d3dDevice, -+ DXUT_API HRESULT CreateWICTextureFromMemory( _In_ ID3D11Device* d3dDevice, - _In_reads_bytes_(wicDataSize) const uint8_t* wicData, - _In_ size_t wicDataSize, - _Out_opt_ ID3D11Resource** texture, -@@ -42,7 +48,7 @@ namespace DirectX - _In_ size_t maxsize = 0 - ); - -- HRESULT CreateWICTextureFromFile( _In_ ID3D11Device* d3dDevice, -+ DXUT_API HRESULT CreateWICTextureFromFile( _In_ ID3D11Device* d3dDevice, - _In_z_ const wchar_t* szFileName, - _Out_opt_ ID3D11Resource** texture, - _Out_opt_ ID3D11ShaderResourceView** textureView, -@@ -50,7 +56,7 @@ namespace DirectX - ); - - // Standard version with optional auto-gen mipmap support -- HRESULT CreateWICTextureFromMemory( _In_ ID3D11Device* d3dDevice, -+ DXUT_API HRESULT CreateWICTextureFromMemory( _In_ ID3D11Device* d3dDevice, - _In_opt_ ID3D11DeviceContext* d3dContext, - _In_reads_bytes_(wicDataSize) const uint8_t* wicData, - _In_ size_t wicDataSize, -@@ -59,7 +65,7 @@ namespace DirectX - _In_ size_t maxsize = 0 - ); - -- HRESULT CreateWICTextureFromFile( _In_ ID3D11Device* d3dDevice, -+ DXUT_API HRESULT CreateWICTextureFromFile( _In_ ID3D11Device* d3dDevice, - _In_opt_ ID3D11DeviceContext* d3dContext, - _In_z_ const wchar_t* szFileName, - _Out_opt_ ID3D11Resource** texture, -@@ -68,7 +74,7 @@ namespace DirectX - ); - - // Extended version -- HRESULT CreateWICTextureFromMemoryEx( _In_ ID3D11Device* d3dDevice, -+ DXUT_API HRESULT CreateWICTextureFromMemoryEx( _In_ ID3D11Device* d3dDevice, - _In_reads_bytes_(wicDataSize) const uint8_t* wicData, - _In_ size_t wicDataSize, - _In_ size_t maxsize, -@@ -81,7 +87,7 @@ namespace DirectX - _Out_opt_ ID3D11ShaderResourceView** textureView - ); - -- HRESULT CreateWICTextureFromFileEx( _In_ ID3D11Device* d3dDevice, -+ DXUT_API HRESULT CreateWICTextureFromFileEx( _In_ ID3D11Device* d3dDevice, - _In_z_ const wchar_t* szFileName, - _In_ size_t maxsize, - _In_ D3D11_USAGE usage, -@@ -94,7 +100,7 @@ namespace DirectX - ); - - // Extended version with optional auto-gen mipmap support -- HRESULT CreateWICTextureFromMemoryEx( _In_ ID3D11Device* d3dDevice, -+ DXUT_API HRESULT CreateWICTextureFromMemoryEx( _In_ ID3D11Device* d3dDevice, - _In_opt_ ID3D11DeviceContext* d3dContext, - _In_reads_bytes_(wicDataSize) const uint8_t* wicData, - _In_ size_t wicDataSize, -@@ -108,7 +114,7 @@ namespace DirectX - _Out_opt_ ID3D11ShaderResourceView** textureView - ); - -- HRESULT CreateWICTextureFromFileEx( _In_ ID3D11Device* d3dDevice, -+ DXUT_API HRESULT CreateWICTextureFromFileEx( _In_ ID3D11Device* d3dDevice, - _In_opt_ ID3D11DeviceContext* d3dContext, - _In_z_ const wchar_t* szFileName, - _In_ size_t maxsize, -diff --git a/Core/dxerr.h b/Core/dxerr.h -index 39e348d..9616dea 100644 ---- a/Core/dxerr.h -+++ b/Core/dxerr.h -@@ -25,7 +25,7 @@ extern "C" { - //-------------------------------------------------------------------------------------- - // DXGetErrorString - //-------------------------------------------------------------------------------------- --const WCHAR* WINAPI DXGetErrorStringW( _In_ HRESULT hr ); -+DXUT_API const WCHAR* WINAPI DXGetErrorStringW( _In_ HRESULT hr ); - - #define DXGetErrorString DXGetErrorStringW - -@@ -33,7 +33,7 @@ const WCHAR* WINAPI DXGetErrorStringW( _In_ HRESULT hr ); - // DXGetErrorDescription has to be modified to return a copy in a buffer rather than - // the original static string. - //-------------------------------------------------------------------------------------- --void WINAPI DXGetErrorDescriptionW( _In_ HRESULT hr, _Out_cap_(count) WCHAR* desc, _In_ size_t count ); -+void DXUT_API WINAPI DXGetErrorDescriptionW( _In_ HRESULT hr, _Out_cap_(count) WCHAR* desc, _In_ size_t count ); - - #define DXGetErrorDescription DXGetErrorDescriptionW - -@@ -52,7 +52,7 @@ void WINAPI DXGetErrorDescriptionW( _In_ HRESULT hr, _Out_cap_(count) WCHAR* des - // - // Return: The hr that was passed in. - //-------------------------------------------------------------------------------------- --HRESULT WINAPI DXTraceW( _In_z_ const WCHAR* strFile, _In_ DWORD dwLine, _In_ HRESULT hr, _In_opt_ const WCHAR* strMsg, _In_ bool bPopMsgBox ); -+HRESULT DXUT_API WINAPI DXTraceW( _In_z_ const WCHAR* strFile, _In_ DWORD dwLine, _In_ HRESULT hr, _In_opt_ const WCHAR* strMsg, _In_ bool bPopMsgBox ); - - #define DXTrace DXTraceW - diff --git a/ports/dxut/portfile.cmake b/ports/dxut/portfile.cmake index 774ef4d5f..294f64a1f 100644 --- a/ports/dxut/portfile.cmake +++ b/ports/dxut/portfile.cmake @@ -1,6 +1,6 @@ -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(STATUS "Warning: Static building not supported yet. Building dynamic.") - set(VCPKG_LIBRARY_LINKAGE dynamic) +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/DXUT-sept2016) @@ -11,11 +11,6 @@ vcpkg_download_distfile(ARCHIVE_FILE ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) -vcpkg_apply_patches( - SOURCE_PATH ${SOURCE_PATH} - PATCHES ${CMAKE_CURRENT_LIST_DIR}/dll.patch -) - vcpkg_build_msbuild( PROJECT_PATH ${SOURCE_PATH}/Core/DXUT_2015.vcxproj ) @@ -37,18 +32,10 @@ file(INSTALL DESTINATION ${CURRENT_PACKAGES_DIR}/include ) -file(INSTALL - ${SOURCE_PATH}/Core/Bin/Desktop_2015/${BUILD_ARCH}/Release/DXUT.dll - DESTINATION ${CURRENT_PACKAGES_DIR}/bin) - file(INSTALL ${SOURCE_PATH}/Core/Bin/Desktop_2015/${BUILD_ARCH}/Release/DXUT.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) -file(INSTALL - ${SOURCE_PATH}/Core/Bin/Desktop_2015/${BUILD_ARCH}/Debug/DXUT.dll - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) - file(INSTALL ${SOURCE_PATH}/Core/Bin/Desktop_2015/${BUILD_ARCH}/Debug/DXUT.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) -- cgit v1.2.3 From 5cc2e93a6f9105ff246f5405bcfcc36f20357b3a Mon Sep 17 00:00:00 2001 From: sdcb Date: Fri, 25 Nov 2016 17:37:48 +0800 Subject: Add directxtk Note: 1. dynamic build is not supported, because upstream build are static by default. 2. Currently uwp build are not supported, it can eanbled by swith to using DirectXTK_Windows10.sln instead of DirectXTK_Desktop_2015_Win10.sln. We can enable it in the future. --- ports/directxtk/CONTROL | 3 +++ ports/directxtk/portfile.cmake | 51 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 ports/directxtk/CONTROL create mode 100644 ports/directxtk/portfile.cmake diff --git a/ports/directxtk/CONTROL b/ports/directxtk/CONTROL new file mode 100644 index 000000000..c9c00c89c --- /dev/null +++ b/ports/directxtk/CONTROL @@ -0,0 +1,3 @@ +Source: directxtk +Version: oct2016 +Description: A collection of helper classes for writing DirectX 11.x code in C++. \ No newline at end of file diff --git a/ports/directxtk/portfile.cmake b/ports/directxtk/portfile.cmake new file mode 100644 index 000000000..8315cd196 --- /dev/null +++ b/ports/directxtk/portfile.cmake @@ -0,0 +1,51 @@ +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/DirectXTK-oct2016) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/Microsoft/DirectXTK/archive/oct2016.tar.gz" + FILENAME "oct2016.tar.gz" + SHA512 b44ee28518ca65d38a3c915881ef79533b48b07d3738b616f1935d7c00a26d5e48b2292cde6acc34e933f85ba2a6362c585c60b2bbc704745d43cef53769a112 +) +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}/DirectXTK_Desktop_2015_Win10.sln + PLATFORM ${BUILD_ARCH} +) + +file(INSTALL + ${SOURCE_PATH}/Bin/Desktop_2015_Win10/${BUILD_ARCH}/Release/DirectXTK.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + +file(INSTALL + ${SOURCE_PATH}/Bin/Desktop_2015_Win10/${BUILD_ARCH}/Debug/DirectXTK.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + +set(DXTK_TOOL_PATH ${CURRENT_PACKAGES_DIR}/tools/directxtk) +file(MAKE_DIRECTORY ${DXTK_TOOL_PATH}) + +file(INSTALL + ${SOURCE_PATH}/MakeSpriteFont/bin/Release/MakeSpriteFont.exe + DESTINATION ${DXTK_TOOL_PATH}) + +file(INSTALL + ${SOURCE_PATH}/XWBTool/Bin/Desktop_2015/${BUILD_ARCH}/Release/XWBTool.exe + DESTINATION ${DXTK_TOOL_PATH}) + +file(INSTALL + ${SOURCE_PATH}/Inc/ + DESTINATION ${CURRENT_PACKAGES_DIR}/include +) + +# Handle copyright +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/directxtk RENAME copyright) -- cgit v1.2.3 From 877b237f6f22fdc098051f550c7b9dcf26afe3ec Mon Sep 17 00:00:00 2001 From: devel71 Date: Fri, 25 Nov 2016 11:40:29 +0100 Subject: initial commit to qca branch --- ports/qca/0001-fix-path-for-vcpkg.patch | 54 ++++++++++++++++++ ports/qca/CONTROL | 3 + ports/qca/portfile.cmake | 97 +++++++++++++++++++++++++++++++++ ports/qca/qca_load_qtenv.cmake | 40 ++++++++++++++ 4 files changed, 194 insertions(+) create mode 100644 ports/qca/0001-fix-path-for-vcpkg.patch create mode 100644 ports/qca/CONTROL create mode 100644 ports/qca/portfile.cmake create mode 100644 ports/qca/qca_load_qtenv.cmake diff --git a/ports/qca/0001-fix-path-for-vcpkg.patch b/ports/qca/0001-fix-path-for-vcpkg.patch new file mode 100644 index 000000000..b48fee18f --- /dev/null +++ b/ports/qca/0001-fix-path-for-vcpkg.patch @@ -0,0 +1,54 @@ +From bab44a6614d4a540af56860432bcc0d6bdf420c9 Mon Sep 17 00:00:00 2001 +From: devel +Date: Wed, 23 Nov 2016 16:54:44 +0100 +Subject: [PATCH] fix path for vcpkg + +--- + CMakeLists.txt | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 605621b..a8c3774 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -277,7 +277,7 @@ if(DEVELOPER_MODE) + # To prefer plugins from build tree when run qca from build tree + file(WRITE ${CMAKE_BINARY_DIR}/bin/qt.conf + "[Paths] +-Plugins=${CMAKE_BINARY_DIR}/lib/${QCA_LIB_NAME} ++Plugins=${CMAKE_BINARY_DIR}/bin/${QCA_LIB_NAME} + ") + endif() + +@@ -401,10 +401,10 @@ endif(DOXYGEN_FOUND) + include(CMakePackageConfigHelpers) + configure_package_config_file( + "${CMAKE_CURRENT_SOURCE_DIR}/QcaConfig.cmake.in" +- "${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/${QCA_CONFIG_NAME_BASE}/${QCA_CONFIG_NAME_BASE}Config.cmake" +- INSTALL_DESTINATION ${QCA_LIBRARY_INSTALL_DIR}/cmake/${QCA_CONFIG_NAME_BASE} ++ "${CMAKE_CURRENT_BINARY_DIR}/share/cmake/${QCA_CONFIG_NAME_BASE}/${QCA_CONFIG_NAME_BASE}Config.cmake" ++ INSTALL_DESTINATION ${CMAKE_BINARY_DIR}/share/cmake/${QCA_CONFIG_NAME_BASE} + ) +-write_basic_config_version_file("${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/${QCA_CONFIG_NAME_BASE}/${QCA_CONFIG_NAME_BASE}ConfigVersion.cmake" VERSION ${QCA_LIB_VERSION_STRING} COMPATIBILITY AnyNewerVersion) ++write_basic_config_version_file("${CMAKE_BINARY_DIR}/share/cmake/${QCA_CONFIG_NAME_BASE}/${QCA_CONFIG_NAME_BASE}ConfigVersion.cmake" VERSION ${QCA_LIB_VERSION_STRING} COMPATIBILITY AnyNewerVersion) + + if(NOT DEVELOPER_MODE) + +@@ -472,10 +472,10 @@ if(NOT DEVELOPER_MODE) + endif() + endif() + +- install(EXPORT ${QCA_CONFIG_NAME_BASE}Targets DESTINATION ${QCA_LIBRARY_INSTALL_DIR}/cmake/${QCA_CONFIG_NAME_BASE} FILE ${QCA_CONFIG_NAME_BASE}Targets.cmake) ++ install(EXPORT ${QCA_CONFIG_NAME_BASE}Targets DESTINATION ${QCA_PREFIX_INSTALL_DIR}/share/cmake/${QCA_CONFIG_NAME_BASE} FILE ${QCA_CONFIG_NAME_BASE}Targets.cmake) + install(FILES +- "${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/${QCA_CONFIG_NAME_BASE}/${QCA_CONFIG_NAME_BASE}Config.cmake" +- "${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/${QCA_CONFIG_NAME_BASE}/${QCA_CONFIG_NAME_BASE}ConfigVersion.cmake" +- DESTINATION ${QCA_LIBRARY_INSTALL_DIR}/cmake/${QCA_CONFIG_NAME_BASE} ++ "${CMAKE_CURRENT_BINARY_DIR}/share/cmake/${QCA_CONFIG_NAME_BASE}/${QCA_CONFIG_NAME_BASE}Config.cmake" ++ "${CMAKE_CURRENT_BINARY_DIR}/share/cmake/${QCA_CONFIG_NAME_BASE}/${QCA_CONFIG_NAME_BASE}ConfigVersion.cmake" ++ DESTINATION ${QCA_PREFIX_INSTALL_DIR}/share/cmake/${QCA_CONFIG_NAME_BASE} + ) + endif() +-- +2.9.2.windows.1 + diff --git a/ports/qca/CONTROL b/ports/qca/CONTROL new file mode 100644 index 000000000..84465481a --- /dev/null +++ b/ports/qca/CONTROL @@ -0,0 +1,3 @@ +Source: qca +Version: 2.2.0 +Description: Qt Cryptographic Api (QCA) diff --git a/ports/qca/portfile.cmake b/ports/qca/portfile.cmake new file mode 100644 index 000000000..cc391b517 --- /dev/null +++ b/ports/qca/portfile.cmake @@ -0,0 +1,97 @@ +# For now only x[64|86]-windows triplet and dynamic linking is supported +# + +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(STATUS "Warning: Static building not supported yet. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) +endif() + +include(vcpkg_common_functions) +include(${CMAKE_CURRENT_LIST_DIR}/qca_load_qtenv.cmake) + +find_program(GIT git) + +# Set git variables to qca version 2.2.0 commit +set(GIT_URL "git://anongit.kde.org/qca.git") +set(GIT_REF "19ec49f89a0a560590ec733c549b92e199792837") # Commit + +# Prepare source dir +if(NOT EXISTS "${DOWNLOADS}/qca.git") + message(STATUS "Cloning") + vcpkg_execute_required_process( + COMMAND ${GIT} clone --bare ${GIT_URL} ${DOWNLOADS}/qca.git + WORKING_DIRECTORY ${DOWNLOADS} + LOGNAME clone + ) +endif() +message(STATUS "Cloning done") + +if(NOT EXISTS "${CURRENT_BUILDTREES_DIR}/src/.git") + message(STATUS "Adding worktree") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}) + vcpkg_execute_required_process( + COMMAND ${GIT} worktree add -f --detach ${CURRENT_BUILDTREES_DIR}/src ${GIT_REF} + WORKING_DIRECTORY ${DOWNLOADS}/qca.git + LOGNAME worktree + ) +endif() +message(STATUS "Adding worktree done") + +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/) + +# Apply the patch to install 'crypto' and 'cmake targets' folder +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001-fix-path-for-vcpkg.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + CURRENT_PACKAGES_DIR ${CURRENT_PACKAGES_DIR} + OPTIONS + #-DSOURCE=${SOURCE_PATH} + -DBUILD_SHARED_LIBS=ON + -DUSE_RELATIVE_PATHS=ON + -DQT4_BUILD=OFF + -DBUILD_TESTS=OFF + -DBUILD_TOOLS=OFF + -DQCA_SUFFIX=qt5 + OPTIONS_DEBUG + -DQCA_PLUGINS_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/debug/bin/Qca-qt5 + OPTIONS_RELEASE + -DQCA_PLUGINS_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/bin/Qca-qt5 +) + +vcpkg_install_cmake() + +message(STATUS "Patching files") + +file(RENAME + ${CURRENT_PACKAGES_DIR}/debug/share/cmake/Qca-qt5/Qca-qt5Targets-debug.cmake + ${CURRENT_PACKAGES_DIR}/share/cmake/Qca-qt5/Qca-qt5Targets-debug.cmake +) + +set(T_DEBUG ${CURRENT_PACKAGES_DIR}/share/cmake/Qca-qt5/Qca-qt5Targets-debug.cmake) +set(T_TARGETS ${CURRENT_PACKAGES_DIR}/share/cmake/Qca-qt5/Qca-qt5Targets.cmake) + +file(READ ${T_DEBUG} QCA_DEBUG_CONFIG) +string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" QCA_DEBUG_CONFIG "${QCA_DEBUG_CONFIG}") +file(WRITE ${T_DEBUG} "${QCA_DEBUG_CONFIG}") + +file(READ ${T_TARGETS} QCA_TARGET_CONFIG) +string(REPLACE "packages/qca_" "installed/" QCA_TARGET_CONFIG "${QCA_TARGET_CONFIG}") +file(WRITE ${T_TARGETS} "${QCA_TARGET_CONFIG}") + +# Remove unneeded dirs +file(REMOVE_RECURSE + ${CURRENT_BUILDTREES_DIR}/share/man + ${CURRENT_PACKAGES_DIR}/share/man + ${CURRENT_PACKAGES_DIR}/debug/include + ${CURRENT_PACKAGES_DIR}/debug/share +) + +message(STATUS "Patching files done") + +# Handle copyright +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/qca) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/qca/COPYING ${CURRENT_PACKAGES_DIR}/share/qca/copyright) diff --git a/ports/qca/qca_load_qtenv.cmake b/ports/qca/qca_load_qtenv.cmake new file mode 100644 index 000000000..ee2eb9696 --- /dev/null +++ b/ports/qca/qca_load_qtenv.cmake @@ -0,0 +1,40 @@ +# TODO: Better way to find Qt5 dir +# + +set(_QT5_FOUND FALSE) + +# Already available? +find_package(Qt5Core QUIET) +if(Qt5Core_FOUND) + message(STATUS "Qt5 found by CMake. Version: " ${Qt5Core_VERSION}) + set(_QT5_FOUND TRUE) + return() + +elseif(NOT Qt5Core_FOUND) + # Try to find Qt in the Windows Registry (just msvc2015 and msvc2015_64 for now) + if(${TRIPLET_SYSTEM_ARCH} STREQUAL "x86") + set(_QTKEY "HKEY_CURRENT_USER\\SOFTWARE\\Digia\\Versions\\msvc2015") + elseif(${TRIPLET_SYSTEM_ARCH} STREQUAL "x64") + set(_QTKEY "HKEY_CURRENT_USER\\SOFTWARE\\Digia\\Versions\\msvc2015_64") + endif() + get_filename_component(_QTPATH "[${_QTKEY};InstallDir]" ABSOLUTE) + if(NOT ${_QTPATH} STREQUAL "/registry") # Path should be ok + message(STATUS "Qt found in the registry: ${_QTPATH}") + set(QT5 ${_QTPATH}) + set(_QT5_FOUND TRUE) + endif() +endif(Qt5Core_FOUND) + +if((NOT _QT5_FOUND) AND (NOT DEFINED $ENV{QT5})) + message(STATUS " ") + message(STATUS "QT5 not found.") + message(STATUS "Please set the path to the Qt5 ${TRIPLET_SYSTEM_ARCH} toolchain dir for this session with f. e.:") + message(STATUS " \$env:QT5 = \"path\\to\\Qt\\msvc[_64]\"") + message(FATAL_ERROR "") +elseif(_QT5_FOUND AND (${TARGET_TRIPLET} STREQUAL "x64-windows" OR ${TARGET_TRIPLET} STREQUAL "x86-windows")) + #message(STATUS "Using Qt5: ${QT5}") + #set(ENV{QTDIR} ${QT5}) + set(ENV{PATH} "${QT5}/bin;$ENV{PATH}") +else() + message(FATAL_ERROR "Target triplet: ${TARGET_TRIPLET} not supported yet.") +endif() -- cgit v1.2.3 From 447995519319c80cefd0c612c49aa005ab2586d3 Mon Sep 17 00:00:00 2001 From: Manuel Massing Date: Fri, 25 Nov 2016 15:58:57 +0100 Subject: [boost] Link against correct version of zlib when building debug variant. --- ports/boost/portfile.cmake | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake index 5b488c697..050418afc 100644 --- a/ports/boost/portfile.cmake +++ b/ports/boost/portfile.cmake @@ -65,6 +65,15 @@ if(TRIPLET_SYSTEM_NAME MATCHES "WindowsStore") set(ENV{BOOST_BUILD_PATH} ${CMAKE_CURRENT_LIST_DIR}) endif() +# Add build type specific options +set(B2_OPTIONS_DBG + ${B2_OPTIONS} + -sZLIB_LIBPATH="${CURRENT_INSTALLED_DIR}\\debug\\lib" +) +set(B2_OPTIONS_REL + ${B2_OPTIONS} + -sZLIB_LIBPATH="${CURRENT_INSTALLED_DIR}\\lib" +) file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) @@ -74,7 +83,7 @@ vcpkg_execute_required_process_repeat( COMMAND "${SOURCE_PATH}/b2.exe" --stagedir=${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/stage --build-dir=${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel - ${B2_OPTIONS} + ${B2_OPTIONS_REL} variant=release debug-symbols=on WORKING_DIRECTORY ${SOURCE_PATH} @@ -87,7 +96,7 @@ vcpkg_execute_required_process_repeat( COMMAND "${SOURCE_PATH}/b2.exe" --stagedir=${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/stage --build-dir=${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg - ${B2_OPTIONS} + ${B2_OPTIONS_DBG} variant=debug WORKING_DIRECTORY ${SOURCE_PATH} LOGNAME build-${TARGET_TRIPLET}-dbg -- cgit v1.2.3 From 89314e013280b5dceec13ec034b38324cbed3e08 Mon Sep 17 00:00:00 2001 From: ab Date: Fri, 25 Nov 2016 16:33:16 +0100 Subject: Adding http-parser library --- ports/http-parser/CMakeLists.txt | 22 ++++++++++++++++++++++ ports/http-parser/CONTROL | 3 +++ ports/http-parser/portfile.cmake | 29 +++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 ports/http-parser/CMakeLists.txt create mode 100644 ports/http-parser/CONTROL create mode 100644 ports/http-parser/portfile.cmake diff --git a/ports/http-parser/CMakeLists.txt b/ports/http-parser/CMakeLists.txt new file mode 100644 index 000000000..021b1842f --- /dev/null +++ b/ports/http-parser/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required (VERSION 2.6) +project (http-parser) + +set(PUBLIC_HDRS + http_parser.h +) +set(PRIVATE_HDRS +) +set(SRCS + http_parser.c +) + +add_library(http_parser STATIC ${SRCS} ${PUBLIC_HDRS} ${PRIAVTE_HDRS}) + +if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) + install(TARGETS http_parser + ARCHIVE DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" ) +endif() + +if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL ) + install(FILES ${PUBLIC_HDRS} DESTINATION "${CMAKE_INSTALL_PREFIX}/include") +endif() \ No newline at end of file diff --git a/ports/http-parser/CONTROL b/ports/http-parser/CONTROL new file mode 100644 index 000000000..41d234d26 --- /dev/null +++ b/ports/http-parser/CONTROL @@ -0,0 +1,3 @@ +Source: http-parser +Version: 2.7.1 +Description: HTTP Parser. \ No newline at end of file diff --git a/ports/http-parser/portfile.cmake b/ports/http-parser/portfile.cmake new file mode 100644 index 000000000..728293eed --- /dev/null +++ b/ports/http-parser/portfile.cmake @@ -0,0 +1,29 @@ +# 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/http-parser-2.7.1) +vcpkg_download_distfile(ARCHIVE_FILE + URLS "https://github.com/nodejs/http-parser/archive/v2.7.1.zip" + FILENAME "http-parser-2.7.1.zip" + SHA512 9fb8b855ba7edb47628c91ac062d7ffce9c4bb8d6b8237d861d7926af989fb3e354c113821bdab1b8ac910f5f1064ca1339947aa20d56f6806b919b0cd6b6eae +) +vcpkg_extract_source_archive(${ARCHIVE_FILE}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS_DEBUG + -DSKIP_INSTALL_HEADERS=ON +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE-MIT DESTINATION ${CURRENT_PACKAGES_DIR}/share/http-parser) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/http-parser/LICENSE-MIT ${CURRENT_PACKAGES_DIR}/share/http-parser/copyright) \ No newline at end of file -- cgit v1.2.3 From 84ce8ae5cb3bc1998f87b6e2aeb1d57514428845 Mon Sep 17 00:00:00 2001 From: Manuel Massing Date: Wed, 23 Nov 2016 18:30:36 +0100 Subject: [glew] Implement static build --- ports/glew/portfile.cmake | 104 +++++++++++++++++++++++++++++----------------- 1 file changed, 66 insertions(+), 38 deletions(-) diff --git a/ports/glew/portfile.cmake b/ports/glew/portfile.cmake index fd3c5ef9a..e7cf16cf2 100644 --- a/ports/glew/portfile.cmake +++ b/ports/glew/portfile.cmake @@ -1,7 +1,3 @@ -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(STATUS "Warning: Static building not supported yet. Building dynamic.") - set(VCPKG_LIBRARY_LINKAGE dynamic) -endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/glew-2.0.0) vcpkg_download_distfile(ARCHIVE_FILE @@ -19,45 +15,77 @@ ELSE() SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH}) ENDIF() -if(NOT EXISTS ${SOURCE_PATH}/build/vc12/glew_shared14.vcxproj) - message(STATUS "Upgrading projects") - file(READ ${SOURCE_PATH}/build/vc12/glew_shared.vcxproj PROJ) - string(REPLACE - "v120" - "v140" - PROJ ${PROJ}) - string(REPLACE - "opengl32.lib%" - "opengl32.lib\;%" - PROJ ${PROJ}) - file(WRITE ${SOURCE_PATH}/build/vc12/glew_shared14.vcxproj ${PROJ}) -endif() +# TODO: Maybe switch to glews' cmake build system in the future +FOREACH(LINKAGE shared static) + if(NOT EXISTS ${SOURCE_PATH}/build/vc12/glew_${LINKAGE}14.vcxproj) + message(STATUS "Upgrading " ${LINKAGE} " project") + file(READ ${SOURCE_PATH}/build/vc12/glew_${LINKAGE}.vcxproj PROJ) + string(REPLACE + "v120" + "v140" + PROJ ${PROJ}) + string(REPLACE + "opengl32.lib%" + "opengl32.lib\;%" + PROJ ${PROJ}) + + if (LINKAGE STREQUAL "static") + string(REPLACE + "MultiThreadedDebugDLL" + "MultiThreadedDebug" + PROJ ${PROJ} + ) + endif() + file(WRITE ${SOURCE_PATH}/build/vc12/glew_${LINKAGE}14.vcxproj ${PROJ}) + endif() +ENDFOREACH(LINKAGE) message(STATUS "Upgrading projects done") -vcpkg_build_msbuild( - PROJECT_PATH ${SOURCE_PATH}/build/vc12/glew_shared14.vcxproj -) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + vcpkg_build_msbuild( + PROJECT_PATH ${SOURCE_PATH}/build/vc12/glew_static14.vcxproj + ) +else() + vcpkg_build_msbuild( + PROJECT_PATH ${SOURCE_PATH}/build/vc12/glew_shared14.vcxproj + ) +endif() + message(STATUS "Installing") -file(INSTALL - ${SOURCE_PATH}/bin/Debug/${BUILD_ARCH}/glew32d.dll - ${SOURCE_PATH}/bin/Debug/${BUILD_ARCH}/glew32d.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 - ${SOURCE_PATH}/lib/Debug/${BUILD_ARCH}/glew32d.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib -) -file(INSTALL - ${SOURCE_PATH}/lib/Release/${BUILD_ARCH}/glew32.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/lib -) +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(INSTALL + ${SOURCE_PATH}/bin/Debug/${BUILD_ARCH}/glew32d.dll + ${SOURCE_PATH}/bin/Debug/${BUILD_ARCH}/glew32d.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 + ${SOURCE_PATH}/lib/Debug/${BUILD_ARCH}/glew32d.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib + ) + file(INSTALL + ${SOURCE_PATH}/lib/Release/${BUILD_ARCH}/glew32.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib + ) +else() + file(INSTALL + ${SOURCE_PATH}/lib/Debug/${BUILD_ARCH}/glew32sd.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib + RENAME glew32d.lib + ) + file(INSTALL + ${SOURCE_PATH}/lib/Release/${BUILD_ARCH}/glew32s.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib + RENAME glew32.lib + ) +endif() + file(INSTALL ${SOURCE_PATH}/include/GL DESTINATION ${CURRENT_PACKAGES_DIR}/include -- cgit v1.2.3 From 3cff7cd6af89c8d75dde0b2005a79405f386e807 Mon Sep 17 00:00:00 2001 From: Manuel Massing Date: Wed, 23 Nov 2016 19:28:16 +0100 Subject: Add PROJ.4 cartographic projection library port --- ...etection-of-recent-visual-studio-versions.patch | 26 ++++++ ...rror-by-only-setting-properties-for-targe.patch | 52 ++++++++++++ ...onfigurable-cmake-config-install-location.patch | 98 ++++++++++++++++++++++ ports/proj4/CONTROL | 3 + ports/proj4/portfile.cmake | 53 ++++++++++++ 5 files changed, 232 insertions(+) create mode 100644 ports/proj4/0001-CMake-add-detection-of-recent-visual-studio-versions.patch create mode 100644 ports/proj4/0002-CMake-fix-error-by-only-setting-properties-for-targe.patch create mode 100644 ports/proj4/0003-CMake-configurable-cmake-config-install-location.patch create mode 100644 ports/proj4/CONTROL create mode 100644 ports/proj4/portfile.cmake diff --git a/ports/proj4/0001-CMake-add-detection-of-recent-visual-studio-versions.patch b/ports/proj4/0001-CMake-add-detection-of-recent-visual-studio-versions.patch new file mode 100644 index 000000000..9be5438aa --- /dev/null +++ b/ports/proj4/0001-CMake-add-detection-of-recent-visual-studio-versions.patch @@ -0,0 +1,26 @@ +From ca8bb14234091ab7b1ada2b9e5abb04f40d459cb Mon Sep 17 00:00:00 2001 +From: Manuel Massing +Date: Tue, 22 Nov 2016 12:00:39 +0100 +Subject: [PATCH 1/3] CMake: add detection of recent visual studio versions + +--- + cmake/Proj4SystemInfo.cmake | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/cmake/Proj4SystemInfo.cmake b/cmake/Proj4SystemInfo.cmake +index 294a50b..c7fb6bf 100644 +--- a/cmake/Proj4SystemInfo.cmake ++++ b/cmake/Proj4SystemInfo.cmake +@@ -50,6 +50,9 @@ if(WIN32) + if(MSVC_VERSION EQUAL 1800) + set(PROJ_COMPILER_NAME "msvc-12.0") #Visual Studio 2013 + endif() ++ if(MSVC_VERSION EQUAL 1900) ++ set(PROJ_COMPILER_NAME "msvc-14.0") #Visual Studio 2015 ++ endif() + endif(MSVC) + + if(MINGW) +-- +2.9.2.windows.1 + diff --git a/ports/proj4/0002-CMake-fix-error-by-only-setting-properties-for-targe.patch b/ports/proj4/0002-CMake-fix-error-by-only-setting-properties-for-targe.patch new file mode 100644 index 000000000..2c470570e --- /dev/null +++ b/ports/proj4/0002-CMake-fix-error-by-only-setting-properties-for-targe.patch @@ -0,0 +1,52 @@ +From 1265d13f29259be05535241e9bcbfcf16857dc06 Mon Sep 17 00:00:00 2001 +From: Manuel Massing +Date: Tue, 22 Nov 2016 12:04:10 +0100 +Subject: [PATCH 2/3] CMake: fix error by only setting properties for targets + which are actually defined + +--- + src/CMakeLists.txt | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 8d7e7d1..59ad00a 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -22,25 +22,30 @@ if(NOT MSVC) + endif () + endif () + ++ + if(BUILD_CS2CS) +- include(bin_cs2cs.cmake) ++ list(APPEND BINARY_TARGETS cs2cs) ++ include(bin_cs2cs.cmake) + endif(BUILD_CS2CS) + + if(BUILD_PROJ) ++ list(APPEND BINARY_TARGETS proj) + include(bin_proj.cmake) + endif(BUILD_PROJ) + + if(BUILD_GEOD) ++ list(APPEND BINARY_TARGETS geod) + include(bin_geod.cmake) + include(bin_geodtest.cmake) + endif(BUILD_GEOD) + + if(BUILD_NAD2BIN) ++ list(APPEND BINARY_TARGETS nad2bin) + include(bin_nad2bin.cmake) + endif(BUILD_NAD2BIN) + +-if (MSVC OR CMAKE_CONFIGURATION_TYPES) ++if ((MSVC OR CMAKE_CONFIGURATION_TYPES) AND BINARY_TARGETS) + # Add _d suffix for your debug versions of the tools +- set_target_properties (cs2cs binproj geod nad2bin PROPERTIES +- DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) ++ set_target_properties(${BINARY_TARGETS} PROPERTIES ++ DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) + endif () +-- +2.9.2.windows.1 + diff --git a/ports/proj4/0003-CMake-configurable-cmake-config-install-location.patch b/ports/proj4/0003-CMake-configurable-cmake-config-install-location.patch new file mode 100644 index 000000000..5870e12ea --- /dev/null +++ b/ports/proj4/0003-CMake-configurable-cmake-config-install-location.patch @@ -0,0 +1,98 @@ +From 0be627798d943558c674d4d92767ca255d847631 Mon Sep 17 00:00:00 2001 +From: Manuel Massing +Date: Tue, 22 Nov 2016 12:26:39 +0100 +Subject: [PATCH 3/3] CMake: configurable cmake config install location + +--- + CMakeLists.txt | 1 + + cmake/CMakeLists.txt | 14 +++++++------- + cmake/Proj4InstallPath.cmake | 12 +++++++++--- + 3 files changed, 17 insertions(+), 10 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index cde21f0..1b1f892 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -106,6 +106,7 @@ set(LIBDIR "${DEFAULT_LIBDIR}" CACHE PATH "The directory to install libraries in + set(DATADIR "${DEFAULT_DATADIR}" CACHE PATH "The directory to install data files into.") + set(DOCDIR "${DEFAULT_DOCDIR}" CACHE PATH "The directory to install doc files into.") + set(INCLUDEDIR "${DEFAULT_INCLUDEDIR}" CACHE PATH "The directory to install includes into.") ++set(CMAKEDIR "${DEFAULT_CMAKE_CONFIGDIR}" CACHE PATH "The directory to install cmake files into.") + + ################################################################################# + # Build configured components +diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt +index 742da0e..2bdef0d 100644 +--- a/cmake/CMakeLists.txt ++++ b/cmake/CMakeLists.txt +@@ -2,13 +2,13 @@ + # ${INSTALL_CMAKE_DIR} and @PROJECT_ROOT_DIR@ is the relative + # path to the root from there. (Note that the whole install tree can + # be relocated.) +-if (NOT WIN32) +- set (INSTALL_CMAKE_DIR "share/cmake/${PROJECT_NAME}") +- set (PROJECT_ROOT_DIR "../../..") +-else () +- set (INSTALL_CMAKE_DIR "cmake") +- set (PROJECT_ROOT_DIR "..") +-endif () ++ ++set (INSTALL_CMAKE_DIR ${CMAKEDIR}) ++if(NOT IS_ABSOLUTE ${INSTALL_CMAKE_DIR}) ++ set(INSTALL_CMAKE_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKEDIR}") ++endif() ++ ++file(RELATIVE_PATH PROJECT_ROOT_DIR ${INSTALL_CMAKE_DIR} ${CMAKE_INSTALL_PREFIX}) + + string(TOLOWER "${PROJECT_NAME}" PROJECT_NAME_LOWER) + configure_file (project-config.cmake.in project-config.cmake @ONLY) +diff --git a/cmake/Proj4InstallPath.cmake b/cmake/Proj4InstallPath.cmake +index da1491c..826fb29 100644 +--- a/cmake/Proj4InstallPath.cmake ++++ b/cmake/Proj4InstallPath.cmake +@@ -28,13 +28,15 @@ if(WIN32) + set(DEFAULT_DATA_SUBDIR share) + set(DEFAULT_INCLUDE_SUBDIR local/include) + set(DEFAULT_DOC_SUBDIR share/doc/proj) ++ set(DEFAULT_CMAKE_CONFIG_SUBDIR "cmake") + else() +- # Common locatoins for Unix and Mac OS X ++ # Common locations for Unix and Mac OS X + set(DEFAULT_BIN_SUBDIR bin) + set(DEFAULT_LIB_SUBDIR lib) + set(DEFAULT_DATA_SUBDIR share/proj) + set(DEFAULT_DOC_SUBDIR doc/proj) + set(DEFAULT_INCLUDE_SUBDIR include) ++ set(DEFAULT_CMAKE_CONFIG_SUBDIR "share/cmake/${PROJECT_NAME}") + endif() + + # Locations are changeable by user to customize layout of PDAL installation +@@ -49,19 +51,23 @@ set(PROJ_DATA_SUBDIR ${DEFAULT_DATA_SUBDIR} CACHE STRING + "Subdirectory where data will be installed") + set(PROJ_DOC_SUBDIR ${DEFAULT_DOC_SUBDIR} CACHE STRING + "Subdirectory where data will be installed") +- ++set(PROJ_CMAKE_CONFIG_SUBDIR ${DEFAULT_CMAKE_CONFIG_SUBDIR} CACHE STRING ++ "Subdirectory where cmake configuration files will be installed") ++ + # Mark *DIR variables as advanced and dedicated to use by power-users only. + mark_as_advanced(PROJ_ROOT_DIR + PROJ_BIN_SUBDIR + PROJ_LIB_SUBDIR + PROJ_INCLUDE_SUBDIR + PROJ_DATA_SUBDIR +- PROJ_DOC_SUBDIR ) ++ PROJ_DOC_SUBDIR ++ PROJ_CMAKE_CONFIG_SUBDIR) + + set(DEFAULT_BINDIR "${PROJ_BIN_SUBDIR}") + set(DEFAULT_LIBDIR "${PROJ_LIB_SUBDIR}") + set(DEFAULT_DATADIR "${PROJ_DATA_SUBDIR}") + set(DEFAULT_DOCDIR "${PROJ_DOC_SUBDIR}") + set(DEFAULT_INCLUDEDIR "${PROJ_INCLUDE_SUBDIR}") ++set(DEFAULT_CMAKE_CONFIGDIR "${PROJ_CMAKE_CONFIG_SUBDIR}") + + +-- +2.9.2.windows.1 + diff --git a/ports/proj4/CONTROL b/ports/proj4/CONTROL new file mode 100644 index 000000000..f31a03049 --- /dev/null +++ b/ports/proj4/CONTROL @@ -0,0 +1,3 @@ +Source: proj4 +Version: 4.9.3 +Description: PROJ.4 library for cartographic projections diff --git a/ports/proj4/portfile.cmake b/ports/proj4/portfile.cmake new file mode 100644 index 000000000..e5af388b0 --- /dev/null +++ b/ports/proj4/portfile.cmake @@ -0,0 +1,53 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/proj-4.9.3) +vcpkg_download_distfile(ARCHIVE + URLS "http://download.osgeo.org/proj/proj-4.9.3.zip" + FILENAME "proj-4.9.3.zip" + SHA512 c9703008cd1f75fe1239b180158e560b9b88ae2ffd900b72923c716908eb86d1abbc4230647af5e3131f8c34481bdc66b03826d669620161ffcfbe67801cb631 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH}/ + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/0001-CMake-add-detection-of-recent-visual-studio-versions.patch + ${CMAKE_CURRENT_LIST_DIR}/0002-CMake-fix-error-by-only-setting-properties-for-targe.patch + ${CMAKE_CURRENT_LIST_DIR}/0003-CMake-configurable-cmake-config-install-location.patch +) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + list(APPEND CMAKE_OPTIONS "-DBUILD_LIBPROJ_SHARED=YES") +else() + list(APPEND CMAKE_OPTIONS "-DBUILD_LIBPROJ_SHARED=NO") +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS ${CMAKE_OPTIONS} + -DPROJ_LIB_SUBDIR=lib + -DPROJ_INCLUDE_SUBDIR=include + -DPROJ_DATA_SUBDIR=share/proj4 + -DPROJ_CMAKE_CONFIG_SUBDIR=share/proj4 + -DBUILD_CS2CS=NO + -DBUILD_PROJ=NO + -DBUILD_GEOD=NO + -DBUILD_NAD2BIN=NO + -DPROJ4_TESTS=NO +) + +vcpkg_install_cmake( + -DBUILD_CS2CS=NO + -DBUILD_PROJ=NO + -DBUILD_GEOD=NO + -DBUILD_NAD2BIN=NO + -DPROJ4_TESTS=NO +) + +# Remove duplicate headers installed from debug build +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +# Remove data installed from debug build +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + +# Handle copyright +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/proj4) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/proj4/COPYING ${CURRENT_PACKAGES_DIR}/share/proj4/copyright) -- cgit v1.2.3 From 57f051776f3015e51045bab19d71fa8f7a69c81b Mon Sep 17 00:00:00 2001 From: "Michael B. McLaughlin" Date: Fri, 25 Nov 2016 18:48:19 -0500 Subject: Added ports for pixman 0.32.0 and cairo 1.14.6. Note that neither support UWP (pixman can only build as a static library due to having no exports and cairo depends on GDI among other things). Also, cairo depends on pixman, libpng, and zlib. --- ports/cairo/CMakeLists.txt | 3 + ports/cairo/CMakeLists_cairo.txt | 250 +++++++++++++++++++++++++++++++++++++ ports/cairo/CONTROL | 4 + ports/cairo/cairo-features.h | 27 ++++ ports/cairo/portfile.cmake | 54 ++++++++ ports/pixman/CMakeLists.txt | 4 + ports/pixman/CMakeLists_pixman.txt | 53 ++++++++ ports/pixman/CONTROL | 3 + ports/pixman/portfile.cmake | 52 ++++++++ 9 files changed, 450 insertions(+) create mode 100644 ports/cairo/CMakeLists.txt create mode 100644 ports/cairo/CMakeLists_cairo.txt create mode 100644 ports/cairo/CONTROL create mode 100644 ports/cairo/cairo-features.h create mode 100644 ports/cairo/portfile.cmake create mode 100644 ports/pixman/CMakeLists.txt create mode 100644 ports/pixman/CMakeLists_pixman.txt create mode 100644 ports/pixman/CONTROL create mode 100644 ports/pixman/portfile.cmake diff --git a/ports/cairo/CMakeLists.txt b/ports/cairo/CMakeLists.txt new file mode 100644 index 000000000..348732130 --- /dev/null +++ b/ports/cairo/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.0) +project(cairo VERSION 1.14.6 LANGUAGES C CXX) +add_subdirectory(src) diff --git a/ports/cairo/CMakeLists_cairo.txt b/ports/cairo/CMakeLists_cairo.txt new file mode 100644 index 000000000..f445605b9 --- /dev/null +++ b/ports/cairo/CMakeLists_cairo.txt @@ -0,0 +1,250 @@ +set(CURRENT_INSTALLED_DIR ${CMAKE_PREFIX_PATH}) + +# Add include directories +include_directories("." "./win32" "${CURRENT_INSTALLED_DIR}/include") + +file(GLOB SOURCES +"cairo-analysis-surface.c" +"cairo-arc.c" +"cairo-array.c" +"cairo-atomic.c" +"cairo-base64-stream.c" +"cairo-base85-stream.c" +"cairo-bentley-ottmann.c" +"cairo-bentley-ottmann-rectangular.c" +"cairo-bentley-ottmann-rectilinear.c" +"cairo-botor-scan-converter.c" +"cairo-boxes.c" +"cairo-boxes-intersect.c" +"cairo.c" +"cairo-cache.c" +"cairo-clip.c" +"cairo-clip-boxes.c" +"cairo-clip-polygon.c" +"cairo-clip-region.c" +"cairo-clip-surface.c" +"cairo-color.c" +"cairo-composite-rectangles.c" +"cairo-compositor.c" +"cairo-contour.c" +"cairo-damage.c" +"cairo-debug.c" +"cairo-default-context.c" +"cairo-device.c" +"cairo-error.c" +"cairo-fallback-compositor.c" +"cairo-fixed.c" +"cairo-font-face.c" +"cairo-font-face-twin.c" +"cairo-font-face-twin-data.c" +"cairo-font-options.c" +"cairo-freelist.c" +"cairo-freed-pool.c" +"cairo-gstate.c" +"cairo-hash.c" +"cairo-hull.c" +"cairo-image-compositor.c" +"cairo-image-info.c" +"cairo-image-source.c" +"cairo-image-surface.c" +"cairo-line.c" +"cairo-lzw.c" +"cairo-matrix.c" +"cairo-mask-compositor.c" +"cairo-mesh-pattern-rasterizer.c" +"cairo-mempool.c" +"cairo-misc.c" +"cairo-mono-scan-converter.c" +"cairo-mutex.c" +"cairo-no-compositor.c" +"cairo-observer.c" +"cairo-output-stream.c" +"cairo-paginated-surface.c" +"cairo-path-bounds.c" +"cairo-path.c" +"cairo-path-fill.c" +"cairo-path-fixed.c" +"cairo-path-in-fill.c" +"cairo-path-stroke.c" +"cairo-path-stroke-boxes.c" +"cairo-path-stroke-polygon.c" +"cairo-path-stroke-traps.c" +"cairo-path-stroke-tristrip.c" +"cairo-pattern.c" +"cairo-pen.c" +"cairo-polygon.c" +"cairo-polygon-intersect.c" +"cairo-polygon-reduce.c" +"cairo-raster-source-pattern.c" +"cairo-recording-surface.c" +"cairo-rectangle.c" +"cairo-rectangular-scan-converter.c" +"cairo-region.c" +"cairo-rtree.c" +"cairo-scaled-font.c" +"cairo-shape-mask-compositor.c" +"cairo-slope.c" +"cairo-spans.c" +"cairo-spans-compositor.c" +"cairo-spline.c" +"cairo-stroke-dash.c" +"cairo-stroke-style.c" +"cairo-surface.c" +"cairo-surface-clipper.c" +"cairo-surface-fallback.c" +"cairo-surface-observer.c" +"cairo-surface-offset.c" +"cairo-surface-snapshot.c" +"cairo-surface-subsurface.c" +"cairo-surface-wrapper.c" +"cairo-time.c" +"cairo-tor-scan-converter.c" +"cairo-tor22-scan-converter.c" +"cairo-clip-tor-scan-converter.c" +"cairo-toy-font-face.c" +"cairo-traps.c" +"cairo-tristrip.c" +"cairo-traps-compositor.c" +"cairo-unicode.c" +"cairo-user-font.c" +"cairo-version.c" +"cairo-wideint.c" +# win32 +"win32/cairo-win32-debug.c" +"win32/cairo-win32-device.c" +"win32/cairo-win32-gdi-compositor.c" +"win32/cairo-win32-system.c" +"win32/cairo-win32-surface.c" +"win32/cairo-win32-display-surface.c" +"win32/cairo-win32-printing-surface.c" +"win32/cairo-win32-font.c" +# generic font support +"cairo-cff-subset.c" +"cairo-scaled-font-subsets.c" +"cairo-truetype-subset.c" +"cairo-type1-fallback.c" +"cairo-type1-glyph-names.c" +"cairo-type1-subset.c" +"cairo-type3-glyph-surface.c" +# pdf +"cairo-pdf-operators.c" +"cairo-pdf-shading.c" +"cairo-pdf-surface.c" +# png +"cairo-png.c" +# ps surface +"cairo-ps-surface.c" +# deflate source +"cairo-deflate-stream.c" +# svg surface +"cairo-svg-surface.c" +# script surface +"cairo-script-surface.c" +) + +set(CMAKE_DEBUG_POSTFIX "d") + +if (${CMAKE_BUILD_TYPE} STREQUAL "Debug") + # Make the zlib library available + find_library(ZLIB_DEBUG_IMPLIB NAMES zlibd) + if (ZLIB_DEBUG_IMPLIB STREQUAL ZLIB_DEBUG_IMPLIB-NOTFOUND) + message(FATAL_ERROR "The zlibd.lib import library could not be found. Check to ensure that zlib is properly installed.") + endif() + add_library(zlib UNKNOWN IMPORTED) + set_property(TARGET zlib PROPERTY IMPORTED_LOCATION "${ZLIB_DEBUG_IMPLIB}") + + # Make the libpng library available + find_library(LIBPNG_DEBUG_IMPLIB NAMES libpng16d) + if (LIBPNG_DEBUG_IMPLIB STREQUAL LIBPNG_DEBUG_IMPLIB-NOTFOUND) + message(FATAL_ERROR "The libpng16d.lib import library could not be found. Check to ensure that libpng is properly installed.") + endif() + add_library(libpng UNKNOWN IMPORTED) + set_property(TARGET libpng PROPERTY IMPORTED_LOCATION "${LIBPNG_DEBUG_IMPLIB}") + + # Make the pixman library available + find_library(PIXMAN_DEBUG_IMPLIB NAMES pixman-1d) + if (PIXMAN_DEBUG_IMPLIB STREQUAL PIXMAN_DEBUG_IMPLIB-NOTFOUND) + message(FATAL_ERROR "The pixman-1d.lib import library could not be found. Check to ensure that pixman is properly installed.") + endif() + add_library(pixman UNKNOWN IMPORTED) + set_property(TARGET pixman PROPERTY IMPORTED_LOCATION "${PIXMAN_DEBUG_IMPLIB}") + +elseif (${CMAKE_BUILD_TYPE} STREQUAL "Release") + # Make the zlib library available + find_library(ZLIB_RELEASE_IMPLIB NAMES zlib) + if (ZLIB_RELEASE_IMPLIB STREQUAL ZLIB_RELEASE_IMPLIB-NOTFOUND) + message(FATAL_ERROR "The zlib.lib import library could not be found. Check to ensure that zlib is properly installed.") + endif() + add_library(zlib UNKNOWN IMPORTED) + set_property(TARGET zlib PROPERTY IMPORTED_LOCATION "${ZLIB_RELEASE_IMPLIB}") + + # Make the libpng library available + find_library(LIBPNG_RELEASE_IMPLIB NAMES libpng16) + if (LIBPNG_RELEASE_IMPLIB STREQUAL LIBPNG_RELEASE_IMPLIB-NOTFOUND) + message(FATAL_ERROR "The libpng16.lib import library could not be found. Check to ensure that libpng is properly installed.") + endif() + add_library(libpng UNKNOWN IMPORTED) + set_property(TARGET libpng PROPERTY IMPORTED_LOCATION "${LIBPNG_RELEASE_IMPLIB}") + + # Make the pixman library available + find_library(PIXMAN_RELEASE_IMPLIB NAMES pixman-1) + if (PIXMAN_RELEASE_IMPLIB STREQUAL PIXMAN_RELEASE_IMPLIB-NOTFOUND) + message(FATAL_ERROR "The pixman-1.lib import library could not be found. Check to ensure that pixman is properly installed.") + endif() + add_library(pixman UNKNOWN IMPORTED) + set_property(TARGET pixman PROPERTY IMPORTED_LOCATION "${PIXMAN_RELEASE_IMPLIB}") + +else() + message(FATAL_ERROR "Unexpected value '${CMAKE_BUILD_TYPE}' for CMAKE_BUILD_TYPE.") +endif() + +# Make the gdi32 library available +find_library(GDI32_LIBRARY NAMES gdi32) +if (GDI32_LIBRARY STREQUAL GDI32_LIBRARY-NOTFOUND) + message(FATAL_ERROR "The gdi32.lib import library could not be found. Check to ensure that the Windows SDK is installed.") +endif() +add_library(gdi32 UNKNOWN IMPORTED) +set_property(TARGET gdi32 PROPERTY IMPORTED_LOCATION "${GDI32_LIBRARY}") + +# Make the msimg32 library available +find_library(MSIMG32_LIBRARY NAMES msimg32) +if (MSIMG32_LIBRARY STREQUAL MSIMG32_LIBRARY-NOTFOUND) + message(FATAL_ERROR "The msimg32.lib import library could not be found. Check to ensure that the Windows SDK is installed.") +endif() +add_library(msimg32 UNKNOWN IMPORTED) +set_property(TARGET msimg32 PROPERTY IMPORTED_LOCATION "${MSIMG32_LIBRARY}") + +# Make the user32 library available +find_library(USER32_LIBRARY NAMES user32) +if (USER32_LIBRARY STREQUAL USER32_LIBRARY-NOTFOUND) + message(FATAL_ERROR "The user32.lib import library could not be found. Check to ensure that the Windows SDK is installed.") +endif() +add_library(user32 UNKNOWN IMPORTED) +set_property(TARGET user32 PROPERTY IMPORTED_LOCATION "${USER32_LIBRARY}") + +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + add_library(cairo ${SOURCES}) + # cairo produces a lot of warnings which are disabled here because they otherwise fill up the log files + target_compile_options(cairo PUBLIC "/wd4244" PUBLIC "/wd4146" PUBLIC "/wd4312" PUBLIC "/wd4267" PUBLIC "/wd4996" PUBLIC "/wd4311" PUBLIC "/wd4334" PUBLIC "/wd4101") + target_link_libraries(cairo gdi32 msimg32 user32 zlib libpng pixman) + + install(TARGETS cairo + RUNTIME DESTINATION bin + LIBRARY DESTINATION bin + ARCHIVE DESTINATION lib + ) +elseif (VCPKG_LIBRARY_LINKAGE STREQUAL static) + add_library(cairo-static ${SOURCES}) + target_compile_options(cairo-static PUBLIC "/DCAIRO_WIN32_STATIC_BUILD=1") + # cairo produces a lot of warnings which are disabled here because they otherwise fill up the log files + target_compile_options(cairo-static PUBLIC "/wd4244" PUBLIC "/wd4146" PUBLIC "/wd4312" PUBLIC "/wd4267" PUBLIC "/wd4996" PUBLIC "/wd4311" PUBLIC "/wd4334" PUBLIC "/wd4101") + target_link_libraries(cairo-static gdi32 msimg32 user32 zlib libpng pixman) + + install(TARGETS cairo-static + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + ) +else() + message(FATAL_ERROR "VCPKG_LIBRARY_LINKAGE is not defined or has an unexpected value") +endif() diff --git a/ports/cairo/CONTROL b/ports/cairo/CONTROL new file mode 100644 index 000000000..017569c50 --- /dev/null +++ b/ports/cairo/CONTROL @@ -0,0 +1,4 @@ +Source: cairo +Version: 1.14.6 +Description: Cairo is a 2D graphics library with support for multiple output devices. Currently supported output targets include the X Window System (via both Xlib and XCB), Quartz, Win32, image buffers, PostScript, PDF, and SVG file output. Experimental backends include OpenGL, BeOS, OS/2, and DirectFB. +Build-Depends: zlib, libpng, pixman diff --git a/ports/cairo/cairo-features.h b/ports/cairo/cairo-features.h new file mode 100644 index 000000000..b9277b7f7 --- /dev/null +++ b/ports/cairo/cairo-features.h @@ -0,0 +1,27 @@ +#ifndef CAIRO_FEATURES_H +#define CAIRO_FEATURES_H +/* Chosen from the various possible defines in "../build/Makefile.win32.features.h"" + guided by "../build/Makefile.win32.features". Modify at your own risk. +*/ + +/* Always for Win32 */ +#define CAIRO_HAS_WIN32_SURFACE 1 +#define CAIRO_HAS_WIN32_FONT 1 + +/* Require libpng */ +#define CAIRO_HAS_PNG_FUNCTIONS 1 +#define CAIRO_HAS_PS_SURFACE 1 +#define CAIRO_HAS_PDF_SURFACE 1 + +// Likely available +#define CAIRO_HAS_SCRIPT_SURFACE 1 +#define CAIRO_HAS_SVG_SURFACE 1 + +/* Always available */ +#define CAIRO_HAS_IMAGE_SURFACE 1 +#define CAIRO_HAS_MIME_SURFACE 1 +#define CAIRO_HAS_RECORDING_SURFACE 1 +#define CAIRO_HAS_OBSERVER_SURFACE 1 +#define CAIRO_HAS_USER_FONT 1 + +#endif diff --git a/ports/cairo/portfile.cmake b/ports/cairo/portfile.cmake new file mode 100644 index 000000000..2131bd146 --- /dev/null +++ b/ports/cairo/portfile.cmake @@ -0,0 +1,54 @@ +# 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/cairo-1.14.6) +vcpkg_download_distfile(ARCHIVE + URLS "https://www.cairographics.org/releases/cairo-1.14.6.tar.xz" + FILENAME "cairo-1.14.6.tar.xz" + SHA512 e2aa17a33b95b68d407b53ac321cca15b0c148eb49b8639c75b2af1e75e7b417a2168ea978dabb8581b341f0f45dc042d3b1a56b01ab525b1984015f0865316b +) +vcpkg_extract_source_archive(${ARCHIVE}) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_cairo.txt DESTINATION ${SOURCE_PATH}/src) +file(RENAME ${SOURCE_PATH}/src/CMakeLists_cairo.txt ${SOURCE_PATH}/src/CMakeLists.txt) +file(COPY ${CURRENT_PORT_DIR}/cairo-features.h DESTINATION ${SOURCE_PATH}/src) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + ) +elseif (VCPKG_LIBRARY_LINKAGE STREQUAL static) + vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + ) +endif() + +vcpkg_install_cmake() + +# Copy the appropriate header files. +file(COPY +"${SOURCE_PATH}/src/cairo.h" +"${SOURCE_PATH}/src/cairo-deprecated.h" +"${SOURCE_PATH}/src/cairo-features.h" +"${SOURCE_PATH}/src/cairo-pdf.h" +"${SOURCE_PATH}/src/cairo-ps.h" +"${SOURCE_PATH}/src/cairo-script.h" +"${SOURCE_PATH}/src/cairo-svg.h" +"${SOURCE_PATH}/cairo-version.h" +"${SOURCE_PATH}/src/cairo-win32.h" +DESTINATION +${CURRENT_PACKAGES_DIR}/include +) + +# Handle copyright +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/cairo) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/cairo/COPYING ${CURRENT_PACKAGES_DIR}/share/cairo/copyright) + +vcpkg_copy_pdbs() diff --git a/ports/pixman/CMakeLists.txt b/ports/pixman/CMakeLists.txt new file mode 100644 index 000000000..aad6ec778 --- /dev/null +++ b/ports/pixman/CMakeLists.txt @@ -0,0 +1,4 @@ +cmake_minimum_required(VERSION 3.0) +project(pixman VERSION 0.32.0 LANGUAGES C CXX) + +add_subdirectory(pixman) \ No newline at end of file diff --git a/ports/pixman/CMakeLists_pixman.txt b/ports/pixman/CMakeLists_pixman.txt new file mode 100644 index 000000000..c8030bcd6 --- /dev/null +++ b/ports/pixman/CMakeLists_pixman.txt @@ -0,0 +1,53 @@ +# Add include directories +include_directories(".") + +FILE(GLOB SOURCES +"pixman.c" +"pixman-access.c" +"pixman-access-accessors.c" +"pixman-bits-image.c" +"pixman-combine32.c" +"pixman-combine-float.c" +"pixman-conical-gradient.c" +"pixman-filter.c" +"pixman-x86.c" +"pixman-mips.c" +"pixman-arm.c" +"pixman-ppc.c" +"pixman-edge.c" +"pixman-edge-accessors.c" +"pixman-fast-path.c" +"pixman-glyph.c" +"pixman-general.c" +"pixman-gradient-walker.c" +"pixman-image.c" +"pixman-implementation.c" +"pixman-linear-gradient.c" +"pixman-matrix.c" +"pixman-noop.c" +"pixman-radial-gradient.c" +"pixman-region16.c" +"pixman-region32.c" +"pixman-solid-fill.c" +"pixman-timer.c" +"pixman-trap.c" +"pixman-utils.c" +"pixman-sse2.c" +) + +set(CMAKE_DEBUG_POSTFIX "d") + +add_library(pixman-1 ${SOURCES}) + +# pixman requires the three PACKAGE* definitions in order to compile. The USE_SSE2 definition lets it use SSE2 instructions for speed. Every target machine should have SSE2 these days. +target_compile_definitions(pixman-1 PUBLIC PACKAGE="pixman-1" PUBLIC PACKAGE_VERSION="0.34.0" PUBLIC PACKAGE_BUGREPORT="" PUBLIC USE_SSE2) + +# pixman produces a lot of warnings which are disabled here because they otherwise fill up the log files +target_compile_options(pixman-1 PUBLIC "/wd4244" PUBLIC "/wd4146" PUBLIC "/wd4996") # PUBLIC "/D_CRT_SECURE_NO_WARNINGS" + +# The LIBRARY DESTINATION here is lib rather than bin because pixman must always be compiled as a static library since it has no exports. +install(TARGETS pixman-1 + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) diff --git a/ports/pixman/CONTROL b/ports/pixman/CONTROL new file mode 100644 index 000000000..564c81466 --- /dev/null +++ b/ports/pixman/CONTROL @@ -0,0 +1,3 @@ +Source: pixman +Version: 0.34.0 +Description: Pixman is a low-level software library for pixel manipulation, providing features such as image compositing and trapezoid rasterization. diff --git a/ports/pixman/portfile.cmake b/ports/pixman/portfile.cmake new file mode 100644 index 000000000..b4029a26b --- /dev/null +++ b/ports/pixman/portfile.cmake @@ -0,0 +1,52 @@ +# 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. Building static.") # pixman does not export any symbols. + set(VCPKG_LIBRARY_LINKAGE static) +endif() + +include(vcpkg_common_functions) + +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/pixman-0.34.0) + +vcpkg_download_distfile(ARCHIVE + URLS "https://www.cairographics.org/releases/pixman-0.34.0.tar.gz" + FILENAME "pixman-0.34.0.tar.gz" + SHA512 81caca5b71582b53aaac473bc37145bd66ba9acebb4773fa8cdb51f4ed7fbcb6954790d8633aad85b2826dd276bcce725e26e37997a517760e9edd72e2669a6d +) +vcpkg_extract_source_archive(${ARCHIVE}) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_pixman.txt DESTINATION ${SOURCE_PATH}/pixman) +file(RENAME ${SOURCE_PATH}/pixman/CMakeLists_pixman.txt ${SOURCE_PATH}/pixman/CMakeLists.txt) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} +) + +vcpkg_install_cmake() + +# Copy the appropriate header files. +file(COPY +"${SOURCE_PATH}/pixman/pixman.h" +"${SOURCE_PATH}/pixman/pixman-accessor.h" +"${SOURCE_PATH}/pixman/pixman-combine32.h" +"${SOURCE_PATH}/pixman/pixman-compiler.h" +"${SOURCE_PATH}/pixman/pixman-edge-imp.h" +"${SOURCE_PATH}/pixman/pixman-inlines.h" +"${SOURCE_PATH}/pixman/pixman-private.h" +"${SOURCE_PATH}/pixman/pixman-version.h" +DESTINATION +${CURRENT_PACKAGES_DIR}/include +) + +# Handle copyright +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/pixman) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/pixman/COPYING ${CURRENT_PACKAGES_DIR}/share/pixman/copyright) + +vcpkg_copy_pdbs() -- cgit v1.2.3 From 1794eec16dd4f329a2d751b7be0f1e33d2a02124 Mon Sep 17 00:00:00 2001 From: flysha Date: Sat, 26 Nov 2016 09:58:03 +0800 Subject: [rxcpp] Upgrade to latest 3.0.0 --- ports/rxcpp/CONTROL | 2 +- ports/rxcpp/portfile.cmake | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ports/rxcpp/CONTROL b/ports/rxcpp/CONTROL index b4440da35..02b873816 100644 --- a/ports/rxcpp/CONTROL +++ b/ports/rxcpp/CONTROL @@ -1,3 +1,3 @@ Source: rxcpp -Version: 2.3.0 +Version: 3.0.0 Description: Reactive Extensions for C++ \ No newline at end of file diff --git a/ports/rxcpp/portfile.cmake b/ports/rxcpp/portfile.cmake index 65062c360..440c7ccf3 100644 --- a/ports/rxcpp/portfile.cmake +++ b/ports/rxcpp/portfile.cmake @@ -1,12 +1,12 @@ #header-only library include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/RxCpp-2.3.0) -vcpkg_download_distfile(ARCHIVE_FILE - URLS "https://github.com/Reactive-Extensions/RxCpp/archive/v2.3.0.tar.gz" - FILENAME "RxCpp-2.3.0.tar.gz" - SHA512 180cf36777b0c14e989b4b79f01fcda7ecabfe4b3cee3ad7343138497578af02745de63f74941ec228eac3fccca4a7dfdfdd1c4d16a89438022dca6f9968953f +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/RxCpp-3.0.0) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/Reactive-Extensions/RxCpp/archive/v3.0.0.tar.gz" + FILENAME "v3.0.0.tar.gz" + SHA512 6d810b6163d0920d531f32a13729e290c81b47d5fc9c3e3d3d8a25d27a6f0671fec097d091bef7383b7e556e9e5471db087bb955e7f4fd9a5fdc9e7b06050844 ) -vcpkg_extract_source_archive(${ARCHIVE_FILE}) +vcpkg_extract_source_archive(${ARCHIVE}) file(INSTALL ${SOURCE_PATH}/Rx/v2/src/rxcpp -- cgit v1.2.3 From 420795eed17f103db1c2597f939d14bcabb2173e Mon Sep 17 00:00:00 2001 From: Kirk Shoop Date: Fri, 25 Nov 2016 19:27:07 -0800 Subject: update rxcpp to 3.0.0 --- ports/rxcpp/CONTROL | 2 +- ports/rxcpp/portfile.cmake | 15 +++++---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/ports/rxcpp/CONTROL b/ports/rxcpp/CONTROL index b4440da35..02b873816 100644 --- a/ports/rxcpp/CONTROL +++ b/ports/rxcpp/CONTROL @@ -1,3 +1,3 @@ Source: rxcpp -Version: 2.3.0 +Version: 3.0.0 Description: Reactive Extensions for C++ \ No newline at end of file diff --git a/ports/rxcpp/portfile.cmake b/ports/rxcpp/portfile.cmake index 65062c360..8180c2051 100644 --- a/ports/rxcpp/portfile.cmake +++ b/ports/rxcpp/portfile.cmake @@ -1,20 +1,15 @@ #header-only library include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/RxCpp-2.3.0) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/RxCpp-3.0.0) vcpkg_download_distfile(ARCHIVE_FILE - URLS "https://github.com/Reactive-Extensions/RxCpp/archive/v2.3.0.tar.gz" - FILENAME "RxCpp-2.3.0.tar.gz" - SHA512 180cf36777b0c14e989b4b79f01fcda7ecabfe4b3cee3ad7343138497578af02745de63f74941ec228eac3fccca4a7dfdfdd1c4d16a89438022dca6f9968953f + URLS "https://github.com/Reactive-Extensions/RxCpp/archive/v3.0.0.tar.gz" + FILENAME "RxCpp-3.0.0.tar.gz" + SHA512 f30f71cefee25f86297d66a49e752a44bdb8ad9a1a92249bf944101afd91b432564e9b8c9e8853f7042608030bffaa4d58d294f18a61f394701cee347f42bcbb ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) file(INSTALL - ${SOURCE_PATH}/Rx/v2/src/rxcpp - DESTINATION ${CURRENT_PACKAGES_DIR}/include -) - -file(INSTALL - ${SOURCE_PATH}/Ix/CPP/src/cpplinq + ${SOURCE_PATH}/Rx/v2/src DESTINATION ${CURRENT_PACKAGES_DIR}/include ) -- cgit v1.2.3 From bff67a592def0047547237ec2b0e6420e055dba6 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 25 Nov 2016 21:44:01 -0800 Subject: Revert "Merge pull request #348 from kirkshoop/rxcpp3.0.0" This reverts commit 82c29e0dc5f7a19f6294b2b654acf2c7b5bae60d, reversing changes made to a5b1ed784aafd000a9e14dfc2c6ed228d5fe2952. --- ports/rxcpp/portfile.cmake | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ports/rxcpp/portfile.cmake b/ports/rxcpp/portfile.cmake index f767d8a3b..440c7ccf3 100644 --- a/ports/rxcpp/portfile.cmake +++ b/ports/rxcpp/portfile.cmake @@ -3,16 +3,21 @@ include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/RxCpp-3.0.0) vcpkg_download_distfile(ARCHIVE URLS "https://github.com/Reactive-Extensions/RxCpp/archive/v3.0.0.tar.gz" - FILENAME "RxCpp-v3.0.0.tar.gz" + FILENAME "v3.0.0.tar.gz" SHA512 6d810b6163d0920d531f32a13729e290c81b47d5fc9c3e3d3d8a25d27a6f0671fec097d091bef7383b7e556e9e5471db087bb955e7f4fd9a5fdc9e7b06050844 ) vcpkg_extract_source_archive(${ARCHIVE}) file(INSTALL - ${SOURCE_PATH}/Rx/v2/src + ${SOURCE_PATH}/Rx/v2/src/rxcpp DESTINATION ${CURRENT_PACKAGES_DIR}/include ) file(INSTALL - ${SOURCE_PATH}/license.md - DESTINATION ${CURRENT_PACKAGES_DIR}/share/rxcpp RENAME copyright) \ No newline at end of file + ${SOURCE_PATH}/Ix/CPP/src/cpplinq + DESTINATION ${CURRENT_PACKAGES_DIR}/include +) + +file(INSTALL + ${SOURCE_PATH}/license.md + DESTINATION ${CURRENT_PACKAGES_DIR}/share/rxcpp RENAME copyright) \ No newline at end of file -- cgit v1.2.3 From cdba9a5e4904af960362614d1222ee47a29c21a7 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 25 Nov 2016 21:45:41 -0800 Subject: [rxcpp] Renaming downloaded file back to RxCpp-v3.0.0.tar.gz to avoid collisions with other libraries --- ports/rxcpp/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/rxcpp/portfile.cmake b/ports/rxcpp/portfile.cmake index 440c7ccf3..4a321222d 100644 --- a/ports/rxcpp/portfile.cmake +++ b/ports/rxcpp/portfile.cmake @@ -3,7 +3,7 @@ include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/RxCpp-3.0.0) vcpkg_download_distfile(ARCHIVE URLS "https://github.com/Reactive-Extensions/RxCpp/archive/v3.0.0.tar.gz" - FILENAME "v3.0.0.tar.gz" + FILENAME "RxCpp-v3.0.0.tar.gz" SHA512 6d810b6163d0920d531f32a13729e290c81b47d5fc9c3e3d3d8a25d27a6f0671fec097d091bef7383b7e556e9e5471db087bb955e7f4fd9a5fdc9e7b06050844 ) vcpkg_extract_source_archive(${ARCHIVE}) -- cgit v1.2.3 From 32157f8ce5abdca2f25981064006906cd1cce5e5 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 25 Nov 2016 23:10:27 -0800 Subject: [vcpkg-integrate] Provide an opt-out for autolinking. Properly suppress integration via MSBuild when using CMake. Add lib\ and lib\manual-link\ to additional library paths. [gtest] Because the four libraries provided by gtest supply redundant symbols and define main, opt them all out. Addresses #306. --- ports/gtest/portfile.cmake | 13 ++++++++++-- scripts/buildsystems/msbuild/vcpkg.targets | 8 +++++--- scripts/buildsystems/vcpkg.cmake | 32 ++++++++++++++++++++++-------- 3 files changed, 40 insertions(+), 13 deletions(-) diff --git a/ports/gtest/portfile.cmake b/ports/gtest/portfile.cmake index e1d601d7b..d1ba722d7 100644 --- a/ports/gtest/portfile.cmake +++ b/ports/gtest/portfile.cmake @@ -37,8 +37,6 @@ message(STATUS "Adding worktree and patching done") vcpkg_configure_cmake( SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src - OPTIONS - -DBUILD_SHARED_LIBS=ON ) vcpkg_install_cmake() @@ -55,4 +53,15 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gtest_main.dll ${CURRENT_PACKAGES_ file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gmock.dll ${CURRENT_PACKAGES_DIR}/debug/bin/gmock.dll) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gmock_main.dll ${CURRENT_PACKAGES_DIR}/debug/bin/gmock_main.dll) +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/lib/manual-link) +file(RENAME ${CURRENT_PACKAGES_DIR}/lib/gtest.lib ${CURRENT_PACKAGES_DIR}/lib/manual-link/gtest.lib) +file(RENAME ${CURRENT_PACKAGES_DIR}/lib/gtest_main.lib ${CURRENT_PACKAGES_DIR}/lib/manual-link/gtest_main.lib) +file(RENAME ${CURRENT_PACKAGES_DIR}/lib/gmock.lib ${CURRENT_PACKAGES_DIR}/lib/manual-link/gmock.lib) +file(RENAME ${CURRENT_PACKAGES_DIR}/lib/gmock_main.lib ${CURRENT_PACKAGES_DIR}/lib/manual-link/gmock_main.lib) +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) +file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gtest.lib ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link/gtest.lib) +file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gtest_main.lib ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link/gtest_main.lib) +file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gmock.lib ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link/gmock.lib) +file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gmock_main.lib ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link/gmock_main.lib) + vcpkg_copy_pdbs() diff --git a/scripts/buildsystems/msbuild/vcpkg.targets b/scripts/buildsystems/msbuild/vcpkg.targets index 18c4e9d9f..7782551c2 100644 --- a/scripts/buildsystems/msbuild/vcpkg.targets +++ b/scripts/buildsystems/msbuild/vcpkg.targets @@ -31,11 +31,13 @@ - $(VcpkgRoot)debug\lib\*.lib;%(AdditionalDependencies) - $(VcpkgRoot)lib\*.lib;%(AdditionalDependencies) + %(AdditionalDependencies);$(VcpkgRoot)debug\lib\*.lib + %(AdditionalDependencies);$(VcpkgRoot)lib\*.lib + %(AdditionalLibraryDirectories);$(VcpkgRoot)lib;$(VcpkgRoot)lib\manual-link + %(AdditionalLibraryDirectories);$(VcpkgRoot)debug\lib;$(VcpkgRoot)debug\lib\manual-link - $(VcpkgRoot)include;%(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories);$(VcpkgRoot)include diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 54960a138..c77aca52d 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -46,21 +46,27 @@ if(NOT VCPKG_TOOLCHAIN) list(APPEND CMAKE_PREFIX_PATH ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug ) + list(APPEND CMAKE_LIBRARY_PATH + ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/manual-link + ) endif() list(APPEND CMAKE_PREFIX_PATH ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET} ) + list(APPEND CMAKE_LIBRARY_PATH + ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/manual-link + ) include_directories(${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include) set(CMAKE_PROGRAM_PATH ${CMAKE_PROGRAM_PATH} ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools) - option(OVERRIDE_ADD_EXECUTABLE "Automatically copy dependencies into the output directory for executables." ON) - if(OVERRIDE_ADD_EXECUTABLE) - function(add_executable name) - _add_executable(${ARGV}) - list(FIND ARGV "IMPORTED" IMPORTED_IDX) - if(IMPORTED_IDX EQUAL -1) + option(VCPKG_APPLOCAL_DEPS "Automatically copy dependencies into the output directory for executables." ON) + function(add_executable name) + _add_executable(${ARGV}) + list(FIND ARGV "IMPORTED" IMPORTED_IDX) + if(IMPORTED_IDX EQUAL -1) + if(VCPKG_APPLOCAL_DEPS) add_custom_command(TARGET ${name} POST_BUILD COMMAND powershell -noprofile -executionpolicy UnRestricted -file ${_VCPKG_TOOLCHAIN_DIR}/msbuild/applocal.ps1 -targetBinary $ @@ -68,7 +74,17 @@ if(NOT VCPKG_TOOLCHAIN) -OutVariable out ) endif() - endfunction() - endif() + set_target_properties(${name} PROPERTIES VS_GLOBAL_VcpkgEnabled false) + endif() + endfunction() + + function(add_library name) + _add_library(${ARGV}) + list(FIND ARGV "IMPORTED" IMPORTED_IDX) + if(IMPORTED_IDX EQUAL -1) + set_target_properties(${name} PROPERTIES VS_GLOBAL_VcpkgEnabled false) + endif() + endfunction() + set(VCPKG_TOOLCHAIN ON) endif() -- cgit v1.2.3 From 61b653aad37f4dbad0d64f7dca895ca94ccad983 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 26 Nov 2016 00:10:42 -0800 Subject: [vcpkg.cmake] Add `lib` and `lib/manual-link` to CMake's default link directories when using our toolchain. --- scripts/buildsystems/vcpkg.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index c77aca52d..44db05a22 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -49,6 +49,7 @@ if(NOT VCPKG_TOOLCHAIN) list(APPEND CMAKE_LIBRARY_PATH ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/manual-link ) + link_directories(${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/manual-link) endif() list(APPEND CMAKE_PREFIX_PATH ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET} @@ -56,6 +57,7 @@ if(NOT VCPKG_TOOLCHAIN) list(APPEND CMAKE_LIBRARY_PATH ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/manual-link ) + link_directories(${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/manual-link) include_directories(${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include) -- cgit v1.2.3 From 351c9a85b2d9a7d5a166e7d58271431eb3d74f99 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 26 Nov 2016 00:15:38 -0800 Subject: [curl] [freetype] [tiff] Add dependencies on zlib. Add curl dependency on openssl. --- ports/curl/CONTROL | 5 +++-- ports/freetype/CONTROL | 3 ++- ports/tiff/CONTROL | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ports/curl/CONTROL b/ports/curl/CONTROL index 26fe767c3..bca23865d 100644 --- a/ports/curl/CONTROL +++ b/ports/curl/CONTROL @@ -1,3 +1,4 @@ Source: curl -Version: 7.51.0 -Description: A library for transferring data with URLs \ No newline at end of file +Version: 7.51.0-1 +Build-Depends: zlib, openssl +Description: A library for transferring data with URLs diff --git a/ports/freetype/CONTROL b/ports/freetype/CONTROL index 39def18fc..614017c81 100644 --- a/ports/freetype/CONTROL +++ b/ports/freetype/CONTROL @@ -1,3 +1,4 @@ Source: freetype -Version: 2.6.3-1 +Version: 2.6.3-2 +Build-Depends: zlib Description: A library to render fonts. \ No newline at end of file diff --git a/ports/tiff/CONTROL b/ports/tiff/CONTROL index df11c0e9c..65e3d37da 100644 --- a/ports/tiff/CONTROL +++ b/ports/tiff/CONTROL @@ -1,3 +1,4 @@ Source: tiff -Version: 4.0.6 +Version: 4.0.6-1 +Build-Depends: zlib Description: A library that supports the manipulation of TIFF image files \ No newline at end of file -- cgit v1.2.3 From 7e4a57fbfd60ad0eb9cfce7d4db0160bdf6e9cc4 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 26 Nov 2016 00:15:38 -0800 Subject: [curl] [freetype] [tiff] Add dependencies on zlib. Add curl dependency on openssl. --- ports/curl/CONTROL | 5 +++-- ports/freetype/CONTROL | 3 ++- ports/tiff/CONTROL | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ports/curl/CONTROL b/ports/curl/CONTROL index 26fe767c3..bca23865d 100644 --- a/ports/curl/CONTROL +++ b/ports/curl/CONTROL @@ -1,3 +1,4 @@ Source: curl -Version: 7.51.0 -Description: A library for transferring data with URLs \ No newline at end of file +Version: 7.51.0-1 +Build-Depends: zlib, openssl +Description: A library for transferring data with URLs diff --git a/ports/freetype/CONTROL b/ports/freetype/CONTROL index 39def18fc..614017c81 100644 --- a/ports/freetype/CONTROL +++ b/ports/freetype/CONTROL @@ -1,3 +1,4 @@ Source: freetype -Version: 2.6.3-1 +Version: 2.6.3-2 +Build-Depends: zlib Description: A library to render fonts. \ No newline at end of file diff --git a/ports/tiff/CONTROL b/ports/tiff/CONTROL index df11c0e9c..65e3d37da 100644 --- a/ports/tiff/CONTROL +++ b/ports/tiff/CONTROL @@ -1,3 +1,4 @@ Source: tiff -Version: 4.0.6 +Version: 4.0.6-1 +Build-Depends: zlib Description: A library that supports the manipulation of TIFF image files \ No newline at end of file -- cgit v1.2.3 From 02f00dfbc75844a09b121a6f0de35747dafb898f Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 26 Nov 2016 02:40:38 -0800 Subject: [zstd] Reduce modifications to the upstream CMake. Remove all variation from the import lib name. --- ports/zstd/portfile.cmake | 40 +++++++++------------------------------- 1 file changed, 9 insertions(+), 31 deletions(-) diff --git a/ports/zstd/portfile.cmake b/ports/zstd/portfile.cmake index 7384e5461..0cb089ce5 100644 --- a/ports/zstd/portfile.cmake +++ b/ports/zstd/portfile.cmake @@ -7,30 +7,6 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) -# Name dynamic libs to be non-versioned and simpler "zstd". -# Avoid name conflict with static, so postfix static to "zstd-static" -# This seems to be less painful than renaming a DLL file after creation. -set(lib_cmake_filename ${SOURCE_PATH}/build/cmake/lib/CMakeLists.txt) -if (NOT EXISTS ${lib_cmake_filename}.orig) - file(INSTALL ${SOURCE_PATH}/build/cmake/lib/CMakeLists.txt - DESTINATION ${SOURCE_PATH}/build/cmake/lib - RENAME CMakeLists.txt.orig) -endif() -file(READ "${lib_cmake_filename}" lib_cmake_content) -string(REPLACE - "SET(SHARED_LIBRARY_OUTPUT_NAME \${LIBRARY_BASE_NAME}.\${LIBVER_MAJOR}.\${LIBVER_MINOR}.\${LIBVER_RELEASE})" - "SET(SHARED_LIBRARY_OUTPUT_NAME zstd)" - lib_cmake_content - "${lib_cmake_content}" -) -string(REPLACE - "SET(STATIC_LIBRARY_OUTPUT_NAME \${LIBRARY_BASE_NAME})" - "SET(STATIC_LIBRARY_OUTPUT_NAME zstd-static)" - lib_cmake_content - "${lib_cmake_content}" -) -file(WRITE "${lib_cmake_filename}" "${lib_cmake_content}") - vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH}/build/cmake OPTIONS -DZSTD_LEGACY_SUPPORT=1 @@ -46,17 +22,19 @@ file(COPY ${SOURCE_PATH}/lib/dictBuilder/zdict.h DESTINATION ${CURRENT_PACKAGES_ set(RELDIR ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/lib/Release) set(DEBDIR ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/lib/Debug) -if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - file(INSTALL ${RELDIR}/ DESTINATION ${CURRENT_PACKAGES_DIR}/lib FILES_MATCHING PATTERN "zstd_*.lib") - file(INSTALL ${RELDIR}/ DESTINATION ${CURRENT_PACKAGES_DIR}/bin FILES_MATCHING PATTERN "zstd_*.dll") - file(INSTALL ${DEBDIR}/ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib FILES_MATCHING PATTERN "zstd_*.lib") - file(INSTALL ${DEBDIR}/ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin FILES_MATCHING PATTERN "zstd_*.dll") + +if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + file(INSTALL ${RELDIR}/zstdlib.1.1.1024_${TRIPLET_SYSTEM_ARCH}.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib RENAME zstdlib.lib) + file(INSTALL ${DEBDIR}/zstdlib.1.1.1024_${TRIPLET_SYSTEM_ARCH}.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib RENAME zstdlib.lib) + file(INSTALL ${RELDIR}/ DESTINATION ${CURRENT_PACKAGES_DIR}/bin FILES_MATCHING PATTERN "*.dll") + file(INSTALL ${DEBDIR}/ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin FILES_MATCHING PATTERN "*.dll") vcpkg_copy_pdbs() else() - file(INSTALL ${RELDIR}/ DESTINATION ${CURRENT_PACKAGES_DIR}/lib FILES_MATCHING PATTERN "zstd-static_*.lib") - file(INSTALL ${DEBDIR}/ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib FILES_MATCHING PATTERN "zstd-static_*.lib") + file(INSTALL ${RELDIR}/zstdlib_${TRIPLET_SYSTEM_ARCH}.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib RENAME zstdlib.lib) + file(INSTALL ${DEBDIR}/zstdlib_${TRIPLET_SYSTEM_ARCH}.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib RENAME zstdlib.lib) endif() + # Handle copyright file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/zstd) file(RENAME ${CURRENT_PACKAGES_DIR}/share/zstd/LICENSE ${CURRENT_PACKAGES_DIR}/share/zstd/copyright) -- cgit v1.2.3 From cc7ee77d9031853580eeecd8c80ca195a8ae9bd6 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 26 Nov 2016 02:49:42 -0800 Subject: [vcpkg] The static keyword at member function scope is not once-per-instance, it's once-per-function --- toolsrc/src/BuildInfo.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/toolsrc/src/BuildInfo.cpp b/toolsrc/src/BuildInfo.cpp index 1f802869f..3fc56efc0 100644 --- a/toolsrc/src/BuildInfo.cpp +++ b/toolsrc/src/BuildInfo.cpp @@ -16,13 +16,13 @@ namespace vcpkg const std::regex& BuildType::crt_regex() const { - static const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); + const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); return r; } const std::string& BuildType::toString() const { - static const std::string s = Strings::format("[%s,%s]", to_string(this->m_config), to_string(this->m_linkage)); + const std::string s = Strings::format("[%s,%s]", to_string(this->m_config), to_string(this->m_linkage)); return s; } @@ -153,7 +153,7 @@ namespace vcpkg const std::regex& OutdatedDynamicCrt::crt_regex() const { - static const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); + const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); return r; } -- cgit v1.2.3 From 692d95c865f271d0805a60fff63fb319c1985ad3 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 26 Nov 2016 02:51:12 -0800 Subject: [vcpkg] Do not return references to locals --- toolsrc/include/BuildInfo.h | 6 +++--- toolsrc/src/BuildInfo.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/toolsrc/include/BuildInfo.h b/toolsrc/include/BuildInfo.h index 22b4bed7d..7f64c51cc 100644 --- a/toolsrc/include/BuildInfo.h +++ b/toolsrc/include/BuildInfo.h @@ -46,8 +46,8 @@ namespace vcpkg const ConfigurationType& config() const; const LinkageType& linkage() const; - const std::regex& crt_regex() const; - const std::string& toString() const; + const std::regex crt_regex() const; + const std::string toString() const; private: BuildType(const ConfigurationType& config, const LinkageType& linkage, const std::string& crt_regex_as_string) @@ -106,7 +106,7 @@ namespace vcpkg OutdatedDynamicCrt() = delete; - const std::regex& crt_regex() const; + const std::regex crt_regex() const; const std::string& toString() const; private: diff --git a/toolsrc/src/BuildInfo.cpp b/toolsrc/src/BuildInfo.cpp index 3fc56efc0..8d46a0dba 100644 --- a/toolsrc/src/BuildInfo.cpp +++ b/toolsrc/src/BuildInfo.cpp @@ -14,13 +14,13 @@ namespace vcpkg return this->m_linkage; } - const std::regex& BuildType::crt_regex() const + const std::regex BuildType::crt_regex() const { const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); return r; } - const std::string& BuildType::toString() const + const std::string BuildType::toString() const { const std::string s = Strings::format("[%s,%s]", to_string(this->m_config), to_string(this->m_linkage)); return s; @@ -151,7 +151,7 @@ namespace vcpkg const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCRT20_DLL = OutdatedDynamicCrt("msvcrt20.dll", R"(msvcrt20\.dll)");; const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCRT40_DLL = OutdatedDynamicCrt("msvcrt40.dll", R"(msvcrt40\.dll)");; - const std::regex& OutdatedDynamicCrt::crt_regex() const + const std::regex OutdatedDynamicCrt::crt_regex() const { const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); return r; -- cgit v1.2.3 From cb778ecfbd78f03e8a9361ff9376df108f6bb906 Mon Sep 17 00:00:00 2001 From: devel71 Date: Sat, 26 Nov 2016 13:51:09 +0100 Subject: [qca] fix cmake file location Added qt5 Build-Depends to CONTROL file. --- ports/qca/0001-fix-path-for-vcpkg.patch | 14 ++++++------ ports/qca/CONTROL | 1 + ports/qca/portfile.cmake | 36 +++++++++++++++-------------- ports/qca/qca_load_qtenv.cmake | 40 --------------------------------- 4 files changed, 27 insertions(+), 64 deletions(-) delete mode 100644 ports/qca/qca_load_qtenv.cmake diff --git a/ports/qca/0001-fix-path-for-vcpkg.patch b/ports/qca/0001-fix-path-for-vcpkg.patch index b48fee18f..d7764c01d 100644 --- a/ports/qca/0001-fix-path-for-vcpkg.patch +++ b/ports/qca/0001-fix-path-for-vcpkg.patch @@ -26,11 +26,11 @@ index 605621b..a8c3774 100644 "${CMAKE_CURRENT_SOURCE_DIR}/QcaConfig.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/${QCA_CONFIG_NAME_BASE}/${QCA_CONFIG_NAME_BASE}Config.cmake" - INSTALL_DESTINATION ${QCA_LIBRARY_INSTALL_DIR}/cmake/${QCA_CONFIG_NAME_BASE} -+ "${CMAKE_CURRENT_BINARY_DIR}/share/cmake/${QCA_CONFIG_NAME_BASE}/${QCA_CONFIG_NAME_BASE}Config.cmake" -+ INSTALL_DESTINATION ${CMAKE_BINARY_DIR}/share/cmake/${QCA_CONFIG_NAME_BASE} ++ "${CMAKE_BINARY_DIR}/share/qca/cmake/${QCA_CONFIG_NAME_BASE}Config.cmake" ++ INSTALL_DESTINATION ${CMAKE_BINARY_DIR}/share/qca/cmake ) -write_basic_config_version_file("${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/${QCA_CONFIG_NAME_BASE}/${QCA_CONFIG_NAME_BASE}ConfigVersion.cmake" VERSION ${QCA_LIB_VERSION_STRING} COMPATIBILITY AnyNewerVersion) -+write_basic_config_version_file("${CMAKE_BINARY_DIR}/share/cmake/${QCA_CONFIG_NAME_BASE}/${QCA_CONFIG_NAME_BASE}ConfigVersion.cmake" VERSION ${QCA_LIB_VERSION_STRING} COMPATIBILITY AnyNewerVersion) ++write_basic_config_version_file("${CMAKE_BINARY_DIR}/share/qca/cmake/${QCA_CONFIG_NAME_BASE}ConfigVersion.cmake" VERSION ${QCA_LIB_VERSION_STRING} COMPATIBILITY AnyNewerVersion) if(NOT DEVELOPER_MODE) @@ -39,14 +39,14 @@ index 605621b..a8c3774 100644 endif() - install(EXPORT ${QCA_CONFIG_NAME_BASE}Targets DESTINATION ${QCA_LIBRARY_INSTALL_DIR}/cmake/${QCA_CONFIG_NAME_BASE} FILE ${QCA_CONFIG_NAME_BASE}Targets.cmake) -+ install(EXPORT ${QCA_CONFIG_NAME_BASE}Targets DESTINATION ${QCA_PREFIX_INSTALL_DIR}/share/cmake/${QCA_CONFIG_NAME_BASE} FILE ${QCA_CONFIG_NAME_BASE}Targets.cmake) ++ install(EXPORT ${QCA_CONFIG_NAME_BASE}Targets DESTINATION ${QCA_PREFIX_INSTALL_DIR}/share/qca/cmake FILE ${QCA_CONFIG_NAME_BASE}Targets.cmake) install(FILES - "${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/${QCA_CONFIG_NAME_BASE}/${QCA_CONFIG_NAME_BASE}Config.cmake" - "${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/${QCA_CONFIG_NAME_BASE}/${QCA_CONFIG_NAME_BASE}ConfigVersion.cmake" - DESTINATION ${QCA_LIBRARY_INSTALL_DIR}/cmake/${QCA_CONFIG_NAME_BASE} -+ "${CMAKE_CURRENT_BINARY_DIR}/share/cmake/${QCA_CONFIG_NAME_BASE}/${QCA_CONFIG_NAME_BASE}Config.cmake" -+ "${CMAKE_CURRENT_BINARY_DIR}/share/cmake/${QCA_CONFIG_NAME_BASE}/${QCA_CONFIG_NAME_BASE}ConfigVersion.cmake" -+ DESTINATION ${QCA_PREFIX_INSTALL_DIR}/share/cmake/${QCA_CONFIG_NAME_BASE} ++ "${CMAKE_BINARY_DIR}/share/qca/cmake/${QCA_CONFIG_NAME_BASE}Config.cmake" ++ "${CMAKE_BINARY_DIR}/share/qca/cmake/${QCA_CONFIG_NAME_BASE}ConfigVersion.cmake" ++ DESTINATION ${QCA_PREFIX_INSTALL_DIR}/share/qca/cmake ) endif() -- diff --git a/ports/qca/CONTROL b/ports/qca/CONTROL index 84465481a..30716ca6e 100644 --- a/ports/qca/CONTROL +++ b/ports/qca/CONTROL @@ -1,3 +1,4 @@ Source: qca Version: 2.2.0 Description: Qt Cryptographic Api (QCA) +Build-Depends: qt5 \ No newline at end of file diff --git a/ports/qca/portfile.cmake b/ports/qca/portfile.cmake index cc391b517..fa38970d3 100644 --- a/ports/qca/portfile.cmake +++ b/ports/qca/portfile.cmake @@ -7,7 +7,6 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) endif() include(vcpkg_common_functions) -include(${CMAKE_CURRENT_LIST_DIR}/qca_load_qtenv.cmake) find_program(GIT git) @@ -39,48 +38,51 @@ message(STATUS "Adding worktree done") set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/) -# Apply the patch to install 'crypto' and 'cmake targets' folder +# Apply the patch to install to the expected folders vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001-fix-path-for-vcpkg.patch ) +# Configure and build vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} CURRENT_PACKAGES_DIR ${CURRENT_PACKAGES_DIR} OPTIONS - #-DSOURCE=${SOURCE_PATH} -DBUILD_SHARED_LIBS=ON -DUSE_RELATIVE_PATHS=ON -DQT4_BUILD=OFF -DBUILD_TESTS=OFF -DBUILD_TOOLS=OFF - -DQCA_SUFFIX=qt5 + -DQCA_SUFFIX=OFF # OPTIONS_DEBUG - -DQCA_PLUGINS_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/debug/bin/Qca-qt5 + -DQCA_PLUGINS_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/debug/bin/Qca # OPTIONS_RELEASE - -DQCA_PLUGINS_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/bin/Qca-qt5 + -DQCA_PLUGINS_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/bin/Qca # ) vcpkg_install_cmake() +# Patch and copy cmake files message(STATUS "Patching files") -file(RENAME - ${CURRENT_PACKAGES_DIR}/debug/share/cmake/Qca-qt5/Qca-qt5Targets-debug.cmake - ${CURRENT_PACKAGES_DIR}/share/cmake/Qca-qt5/Qca-qt5Targets-debug.cmake +file(READ + ${CURRENT_PACKAGES_DIR}/debug/share/qca/cmake/QcaTargets-debug.cmake + QCA_DEBUG_CONFIG ) - -set(T_DEBUG ${CURRENT_PACKAGES_DIR}/share/cmake/Qca-qt5/Qca-qt5Targets-debug.cmake) -set(T_TARGETS ${CURRENT_PACKAGES_DIR}/share/cmake/Qca-qt5/Qca-qt5Targets.cmake) - -file(READ ${T_DEBUG} QCA_DEBUG_CONFIG) string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" QCA_DEBUG_CONFIG "${QCA_DEBUG_CONFIG}") -file(WRITE ${T_DEBUG} "${QCA_DEBUG_CONFIG}") +file(WRITE + ${CURRENT_PACKAGES_DIR}/share/qca/cmake/QcaTargets-debug.cmake + "${QCA_DEBUG_CONFIG}" +) -file(READ ${T_TARGETS} QCA_TARGET_CONFIG) +file(READ ${CURRENT_PACKAGES_DIR}/share/qca/cmake/QcaTargets.cmake + QCA_TARGET_CONFIG +) string(REPLACE "packages/qca_" "installed/" QCA_TARGET_CONFIG "${QCA_TARGET_CONFIG}") -file(WRITE ${T_TARGETS} "${QCA_TARGET_CONFIG}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/qca/cmake/QcaTargets.cmake + "${QCA_TARGET_CONFIG}" +) # Remove unneeded dirs file(REMOVE_RECURSE diff --git a/ports/qca/qca_load_qtenv.cmake b/ports/qca/qca_load_qtenv.cmake deleted file mode 100644 index ee2eb9696..000000000 --- a/ports/qca/qca_load_qtenv.cmake +++ /dev/null @@ -1,40 +0,0 @@ -# TODO: Better way to find Qt5 dir -# - -set(_QT5_FOUND FALSE) - -# Already available? -find_package(Qt5Core QUIET) -if(Qt5Core_FOUND) - message(STATUS "Qt5 found by CMake. Version: " ${Qt5Core_VERSION}) - set(_QT5_FOUND TRUE) - return() - -elseif(NOT Qt5Core_FOUND) - # Try to find Qt in the Windows Registry (just msvc2015 and msvc2015_64 for now) - if(${TRIPLET_SYSTEM_ARCH} STREQUAL "x86") - set(_QTKEY "HKEY_CURRENT_USER\\SOFTWARE\\Digia\\Versions\\msvc2015") - elseif(${TRIPLET_SYSTEM_ARCH} STREQUAL "x64") - set(_QTKEY "HKEY_CURRENT_USER\\SOFTWARE\\Digia\\Versions\\msvc2015_64") - endif() - get_filename_component(_QTPATH "[${_QTKEY};InstallDir]" ABSOLUTE) - if(NOT ${_QTPATH} STREQUAL "/registry") # Path should be ok - message(STATUS "Qt found in the registry: ${_QTPATH}") - set(QT5 ${_QTPATH}) - set(_QT5_FOUND TRUE) - endif() -endif(Qt5Core_FOUND) - -if((NOT _QT5_FOUND) AND (NOT DEFINED $ENV{QT5})) - message(STATUS " ") - message(STATUS "QT5 not found.") - message(STATUS "Please set the path to the Qt5 ${TRIPLET_SYSTEM_ARCH} toolchain dir for this session with f. e.:") - message(STATUS " \$env:QT5 = \"path\\to\\Qt\\msvc[_64]\"") - message(FATAL_ERROR "") -elseif(_QT5_FOUND AND (${TARGET_TRIPLET} STREQUAL "x64-windows" OR ${TARGET_TRIPLET} STREQUAL "x86-windows")) - #message(STATUS "Using Qt5: ${QT5}") - #set(ENV{QTDIR} ${QT5}) - set(ENV{PATH} "${QT5}/bin;$ENV{PATH}") -else() - message(FATAL_ERROR "Target triplet: ${TARGET_TRIPLET} not supported yet.") -endif() -- cgit v1.2.3 From 282d979c7eb8a2ebaf7a815f688245450e844b29 Mon Sep 17 00:00:00 2001 From: devel71 Date: Sat, 26 Nov 2016 13:56:01 +0100 Subject: [qca] fix cmake files dir Added qt5 as Build-Depends to CONTROL file. --- ports/qca/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/qca/CONTROL b/ports/qca/CONTROL index 30716ca6e..d3dd43ab5 100644 --- a/ports/qca/CONTROL +++ b/ports/qca/CONTROL @@ -1,4 +1,4 @@ Source: qca Version: 2.2.0 Description: Qt Cryptographic Api (QCA) -Build-Depends: qt5 \ No newline at end of file +Build-Depends: qt5 -- cgit v1.2.3 From c7bb71b29ac142105f755d548133a6dda28442c0 Mon Sep 17 00:00:00 2001 From: codicodi Date: Sat, 26 Nov 2016 16:54:51 +0100 Subject: Specify path for includes --- ports/directxtk/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/directxtk/portfile.cmake b/ports/directxtk/portfile.cmake index 8315cd196..c14b7c6aa 100644 --- a/ports/directxtk/portfile.cmake +++ b/ports/directxtk/portfile.cmake @@ -44,7 +44,7 @@ file(INSTALL file(INSTALL ${SOURCE_PATH}/Inc/ - DESTINATION ${CURRENT_PACKAGES_DIR}/include + DESTINATION ${CURRENT_PACKAGES_DIR}/include/DirectXTK ) # Handle copyright -- cgit v1.2.3 From a510782857df5de7a98e8077ae5c053ba71b7563 Mon Sep 17 00:00:00 2001 From: codicodi Date: Sat, 26 Nov 2016 16:55:29 +0100 Subject: Bump version --- ports/directxtk/CONTROL | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/directxtk/CONTROL b/ports/directxtk/CONTROL index c9c00c89c..b5e0bcb7d 100644 --- a/ports/directxtk/CONTROL +++ b/ports/directxtk/CONTROL @@ -1,3 +1,3 @@ Source: directxtk -Version: oct2016 -Description: A collection of helper classes for writing DirectX 11.x code in C++. \ No newline at end of file +Version: oct2016-1 +Description: A collection of helper classes for writing DirectX 11.x code in C++. -- cgit v1.2.3 From 469b819fdfa91bb81b3c0ec6081e43df36883528 Mon Sep 17 00:00:00 2001 From: Daniel Bonrath Date: Sat, 26 Nov 2016 19:36:25 +0100 Subject: #339 added clockUtils port --- ports/clockutils/CONTROL | 3 +++ ports/clockutils/portfile.cmake | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 ports/clockutils/CONTROL create mode 100644 ports/clockutils/portfile.cmake diff --git a/ports/clockutils/CONTROL b/ports/clockutils/CONTROL new file mode 100644 index 000000000..4ade8d5f0 --- /dev/null +++ b/ports/clockutils/CONTROL @@ -0,0 +1,3 @@ +Source: clockutils +Version: 1.1.1 +Description: A lightweight c++ library for commonly needed tasks. Optimized for simplicity and speed. diff --git a/ports/clockutils/portfile.cmake b/ports/clockutils/portfile.cmake new file mode 100644 index 000000000..c40d73328 --- /dev/null +++ b/ports/clockutils/portfile.cmake @@ -0,0 +1,34 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/clockUtils-1.1.1) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/ClockworkOrigins/clockUtils/archive/1.1.1.tar.gz" + FILENAME "clockUtils-1.1.1.tar.gz" + SHA512 6b0c57862baf04c0c5529549ba13983e53445172d9a272571aa20968ba6dba15f1cf480096ca100d450218fef090805366d0564c77a4aa4721a4fe694a0481c9 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +if (VCPKG_CRT_LINKAGE STREQUAL dynamic) + SET(SHARED_FLAG ON) +else() + SET(SHARED_FLAG OFF) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DWITH_LIBRARY_ARGPARSER=ON + -DWITH_LIBRARY_COMPRESSION=ON + -DWITH_LIBRARY_CONTAINER=ON + -DWITH_LIBRARY_INIPARSER=ON + -DWITH_LIBRARY_SOCKETS=ON + -DWITH_TESTING=OFF + -DCLOCKUTILS_BUILD_SHARED=${SHARED_FLAG} +) + +vcpkg_build_cmake() +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/clockUtils) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/clockUtils/LICENSE ${CURRENT_PACKAGES_DIR}/share/clockUtils/copyright) \ No newline at end of file -- cgit v1.2.3 From 90a0447f9370a67edb0e0e2fab10438e4906dd98 Mon Sep 17 00:00:00 2001 From: Mattias Cibien Date: Sat, 26 Nov 2016 21:00:53 +0100 Subject: Initial globjects --- ports/globjects/CONTROL | 3 +++ ports/globjects/portfile.cmake | 29 +++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 ports/globjects/CONTROL create mode 100644 ports/globjects/portfile.cmake diff --git a/ports/globjects/CONTROL b/ports/globjects/CONTROL new file mode 100644 index 000000000..170269191 --- /dev/null +++ b/ports/globjects/CONTROL @@ -0,0 +1,3 @@ +Source: globjects +Version: 1.0.0 +Description: C++ library strictly wrapping OpenGL objects. diff --git a/ports/globjects/portfile.cmake b/ports/globjects/portfile.cmake new file mode 100644 index 000000000..f6e7fc9e6 --- /dev/null +++ b/ports/globjects/portfile.cmake @@ -0,0 +1,29 @@ +# 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/globjects-1.0.0) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/cginternals/globjects/archive/v1.0.0.zip" + FILENAME "globjects-1.0.0.zip" + SHA512 e03ae16786b11891a61f0e2f85b0d98a858d1bad3cf4c45944982d6a753dbaa8b28975dc02153360a5ac0f3be73fe86c91af130cfc0dda7459dd782f16868eeb +) +vcpkg_extract_source_archive(${ARCHIVE}) + +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}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/globjects) +#file(RENAME ${CURRENT_PACKAGES_DIR}/share/globjects/LICENSE ${CURRENT_PACKAGES_DIR}/share/globjects/copyright) -- cgit v1.2.3 From de0065d9d27ed8be7bd0cc63dc004a529cbc1624 Mon Sep 17 00:00:00 2001 From: Mattias Cibien Date: Sat, 26 Nov 2016 21:14:30 +0100 Subject: Finished globjects --- ports/globjects/portfile.cmake | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/ports/globjects/portfile.cmake b/ports/globjects/portfile.cmake index f6e7fc9e6..6102dfa8a 100644 --- a/ports/globjects/portfile.cmake +++ b/ports/globjects/portfile.cmake @@ -15,15 +15,37 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) -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_configure_cmake(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/globjects-1.0.0) +#vcpkg_build_cmake() vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) +file(RENAME ${CURRENT_PACKAGES_DIR}/cmake/globjects ${CURRENT_PACKAGES_DIR}/share/globjects) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/cmake) + +file(READ ${CURRENT_PACKAGES_DIR}/debug/cmake/globjects/globjects-export-debug.cmake globjects_DEBUG_MODULE) +string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" globjects_DEBUG_MODULE "${globjects_DEBUG_MODULE}") +string(REPLACE "globjectsd.dll" "bin/globjectsd.dll" globjects_DEBUG_MODULE "${globjects_DEBUG_MODULE}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/globjects/globjects-export-debug.cmake "${globjects_DEBUG_MODULE}") +file(READ ${CURRENT_PACKAGES_DIR}/share/globjects/globjects-export-release.cmake RELEASE_CONF) +string(REPLACE "globjects.dll" "bin/globjects.dll" RELEASE_CONF "${RELEASE_CONF}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/globjects/globjects-export-release.cmake "${RELEASE_CONF}") +file(REMOVE ${CURRENT_PACKAGES_DIR}/globjects-config.cmake) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/globjects-config.cmake) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/globjects/globjects-export.cmake ${CURRENT_PACKAGES_DIR}/share/globjects/globjects-config.cmake) +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin) + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) + file(RENAME ${CURRENT_PACKAGES_DIR}/globjects.dll ${CURRENT_PACKAGES_DIR}/bin/globjects.dll) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/globjectsd.dll ${CURRENT_PACKAGES_DIR}/debug/bin/globjectsd.dll) +endif() +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/cmake) +file(RENAME ${CURRENT_PACKAGES_DIR}/data ${CURRENT_PACKAGES_DIR}/share/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/data) # Handle copyright -#file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/globjects) -#file(RENAME ${CURRENT_PACKAGES_DIR}/share/globjects/LICENSE ${CURRENT_PACKAGES_DIR}/share/globjects/copyright) +file(COPY ${CURRENT_BUILDTREES_DIR}/src/globjects-1.0.0/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/globjects) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/globjects/LICENSE ${CURRENT_PACKAGES_DIR}/share/globjects/copyright) + +vcpkg_copy_pdbs() -- cgit v1.2.3 From 4efbc5b1353b900de513e4e4a3ba3458a99495f6 Mon Sep 17 00:00:00 2001 From: vlj Date: Fri, 25 Nov 2016 18:08:06 +0100 Subject: Add glslang. --- .../0001-Fix-export-symbol-for-Windows.patch | 86 ++++++++++++++++++++++ ports/glslang/CONTROL | 3 + ports/glslang/copyright | 35 +++++++++ ports/glslang/portfile.cmake | 68 +++++++++++++++++ 4 files changed, 192 insertions(+) create mode 100644 ports/glslang/0001-Fix-export-symbol-for-Windows.patch create mode 100644 ports/glslang/CONTROL create mode 100644 ports/glslang/copyright create mode 100644 ports/glslang/portfile.cmake diff --git a/ports/glslang/0001-Fix-export-symbol-for-Windows.patch b/ports/glslang/0001-Fix-export-symbol-for-Windows.patch new file mode 100644 index 000000000..80ce58da4 --- /dev/null +++ b/ports/glslang/0001-Fix-export-symbol-for-Windows.patch @@ -0,0 +1,86 @@ +From 1ccadd2cb6db3ce5a00635f65db21e561eb7f705 Mon Sep 17 00:00:00 2001 +From: vlj +Date: Fri, 25 Nov 2016 17:12:35 +0100 +Subject: [PATCH] Fix export symbol for Windows. + +--- + StandAlone/CMakeLists.txt | 1 + + StandAlone/ResourceLimits.cpp | 3 +++ + StandAlone/ResourceLimits.h | 10 ++++++++++ + 3 files changed, 14 insertions(+) + +diff --git a/StandAlone/CMakeLists.txt b/StandAlone/CMakeLists.txt +index 231ba27..3aff02e 100644 +--- a/StandAlone/CMakeLists.txt ++++ b/StandAlone/CMakeLists.txt +@@ -2,6 +2,7 @@ add_library(glslang-default-resource-limits + ${CMAKE_CURRENT_SOURCE_DIR}/ResourceLimits.cpp + ) + set_property(TARGET glslang-default-resource-limits PROPERTY FOLDER glslang) ++set_property(TARGET glslang-default-resource-limits PROPERTY COMPILE_DEFINITIONS DLLEXPORT) + + target_include_directories(glslang-default-resource-limits + PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} +diff --git a/StandAlone/ResourceLimits.cpp b/StandAlone/ResourceLimits.cpp +index e22ec80..634d9c9 100644 +--- a/StandAlone/ResourceLimits.cpp ++++ b/StandAlone/ResourceLimits.cpp +@@ -41,6 +41,7 @@ + + namespace glslang { + ++DLL_EXPORT + const TBuiltInResource DefaultTBuiltInResource = { + /* .MaxLights = */ 32, + /* .MaxClipPlanes = */ 6, +@@ -137,6 +138,7 @@ const TBuiltInResource DefaultTBuiltInResource = { + /* .generalConstantMatrixVectorIndexing = */ 1, + }}; + ++DLL_EXPORT + std::string GetDefaultTBuiltInResourceString() + { + std::ostringstream ostream; +@@ -239,6 +241,7 @@ std::string GetDefaultTBuiltInResourceString() + return ostream.str(); + } + ++DLL_EXPORT + void DecodeResourceLimits(TBuiltInResource* resources, char* config) + { + static const char* delims = " \t\n\r"; +diff --git a/StandAlone/ResourceLimits.h b/StandAlone/ResourceLimits.h +index 9c3eb3e..932a59f 100644 +--- a/StandAlone/ResourceLimits.h ++++ b/StandAlone/ResourceLimits.h +@@ -39,17 +39,27 @@ + + #include "glslang/Include/ResourceLimits.h" + ++#ifdef DLLEXPORT ++#define DLL_EXPORT __declspec(dllexport) ++#else ++#define DLL_EXPORT __declspec(dllimport) ++#endif ++ + namespace glslang { + + // These are the default resources for TBuiltInResources, used for both + // - parsing this string for the case where the user didn't supply one, + // - dumping out a template for user construction of a config file. ++ ++DLL_EXPORT + extern const TBuiltInResource DefaultTBuiltInResource; + + // Returns the DefaultTBuiltInResource as a human-readable string. ++DLL_EXPORT + std::string GetDefaultTBuiltInResourceString(); + + // Decodes the resource limits from |config| to |resources|. ++DLL_EXPORT + void DecodeResourceLimits(TBuiltInResource* resources, char* config); + + } // end namespace glslang +-- +2.10.2.windows.1 + diff --git a/ports/glslang/CONTROL b/ports/glslang/CONTROL new file mode 100644 index 000000000..7bd0c7e40 --- /dev/null +++ b/ports/glslang/CONTROL @@ -0,0 +1,3 @@ +Source: glslang +Version: 1c573fbcfba6b3d631008b1babc838501ca925d3 +Description: Khronos reference front-end for GLSL and ESSL, and sample SPIR-V generator diff --git a/ports/glslang/copyright b/ports/glslang/copyright new file mode 100644 index 000000000..dfffea6a8 --- /dev/null +++ b/ports/glslang/copyright @@ -0,0 +1,35 @@ +// +//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +//Copyright (C) 2012-2013 LunarG, Inc. +// +//All rights reserved. +// +//Redistribution and use in source and binary forms, with or without +//modification, are permitted provided that the following conditions +//are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 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. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 HOLDERS OR 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. +// diff --git a/ports/glslang/portfile.cmake b/ports/glslang/portfile.cmake new file mode 100644 index 000000000..bdeece78a --- /dev/null +++ b/ports/glslang/portfile.cmake @@ -0,0 +1,68 @@ +# 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) +find_program(GIT git) + +set(GIT_URL "https://github.com/KhronosGroup/glslang.git") +set(GIT_REF "1c573fbcfba6b3d631008b1babc838501ca925d3") + +if(NOT EXISTS "${DOWNLOADS}/glslang.git") + message(STATUS "Cloning") + vcpkg_execute_required_process( + COMMAND ${GIT} clone --bare ${GIT_URL} ${DOWNLOADS}/glslang.git + WORKING_DIRECTORY ${DOWNLOADS} + LOGNAME clone + ) +endif() + +if(NOT EXISTS "${CURRENT_BUILDTREES_DIR}/src/.git") + message(STATUS "Adding worktree and patching") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}) + vcpkg_execute_required_process( + COMMAND ${GIT} worktree add -f --detach ${CURRENT_BUILDTREES_DIR}/src ${GIT_REF} + WORKING_DIRECTORY ${DOWNLOADS}/glslang.git + LOGNAME worktree + ) + message(STATUS "Patching") + vcpkg_execute_required_process( + COMMAND ${GIT} apply ${CMAKE_CURRENT_LIST_DIR}/0001-Fix-export-symbol-for-Windows.patch --ignore-whitespace --whitespace=fix + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/src + LOGNAME patch + ) +endif() + + + +vcpkg_configure_cmake( + SOURCE_PATH "${CURRENT_BUILDTREES_DIR}/src" +) + +vcpkg_install_cmake() + +file(COPY "${CURRENT_BUILDTREES_DIR}/src/glslang/Public/ShaderLang.h" DESTINATION ${CURRENT_PACKAGES_DIR}/include/glslang) +file(COPY "${CURRENT_PACKAGES_DIR}/bin/glslangValidator.exe" DESTINATION ${CURRENT_PACKAGES_DIR}/tools) +file(REMOVE "${CURRENT_PACKAGES_DIR}/bin/glslangValidator.exe") +file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/glslangValidator.exe") +file(COPY "${CURRENT_PACKAGES_DIR}/bin/spirv-remap.exe" DESTINATION ${CURRENT_PACKAGES_DIR}/tools) +file(REMOVE "${CURRENT_PACKAGES_DIR}/bin/spirv-remap.exe") +file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/spirv-remap.exe") + +file(GLOB BIN_DIR "${CURRENT_PACKAGES_DIR}/bin/*") +list(LENGTH BIN_DIR BIN_DIR_SIZE) +if(${BIN_DIR_SIZE} EQUAL 0) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin") +endif() +file(GLOB DEBUG_BIN_DIR "${CURRENT_PACKAGES_DIR}/debug/bin/*") +list(LENGTH DEBUG_BIN_DIR DEBUG_BIN_DIR_SIZE) +if(${DEBUG_BIN_DIR_SIZE} EQUAL 0) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin") +endif() + +# Handle copyright +file(COPY ${CMAKE_CURRENT_LIST_DIR}/copyright DESTINATION ${CURRENT_PACKAGES_DIR}/share/glslang) -- cgit v1.2.3 From 660797c22cf866a0fc613e3ec4c5d59cf761edc8 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sat, 26 Nov 2016 13:35:26 -0800 Subject: [clockutils] Call vcpkg_copy_pdbs() --- ports/clockutils/portfile.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ports/clockutils/portfile.cmake b/ports/clockutils/portfile.cmake index c40d73328..49ef3bf3f 100644 --- a/ports/clockutils/portfile.cmake +++ b/ports/clockutils/portfile.cmake @@ -31,4 +31,6 @@ vcpkg_install_cmake() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/clockUtils) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/clockUtils/LICENSE ${CURRENT_PACKAGES_DIR}/share/clockUtils/copyright) \ No newline at end of file +file(RENAME ${CURRENT_PACKAGES_DIR}/share/clockUtils/LICENSE ${CURRENT_PACKAGES_DIR}/share/clockUtils/copyright) + +vcpkg_copy_pdbs() \ No newline at end of file -- cgit v1.2.3 From 56581e816a7129d99e25b592035e1de5a8801178 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sat, 26 Nov 2016 16:05:46 -0800 Subject: [curl] Enable static building --- ports/curl/portfile.cmake | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/ports/curl/portfile.cmake b/ports/curl/portfile.cmake index 8ad5ed7f7..e2359f73d 100644 --- a/ports/curl/portfile.cmake +++ b/ports/curl/portfile.cmake @@ -1,7 +1,3 @@ -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(STATUS "Warning: Static building not supported yet. Building dynamic.") - set(VCPKG_LIBRARY_LINKAGE dynamic) -endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/curl-curl-7_51_0) vcpkg_download_distfile(ARCHIVE_FILE @@ -11,12 +7,19 @@ vcpkg_download_distfile(ARCHIVE_FILE ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) +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 ) @@ -25,4 +28,9 @@ vcpkg_install_cmake() file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/curl RENAME copyright) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) +endif() + vcpkg_copy_pdbs() \ No newline at end of file -- cgit v1.2.3 From 9fdb1f8fe800867a5e87452f0bad249b2500f3b2 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sat, 26 Nov 2016 16:11:27 -0800 Subject: [clockutils] Remove copy of LICENSE --- ports/clockutils/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/clockutils/portfile.cmake b/ports/clockutils/portfile.cmake index 49ef3bf3f..c078673a6 100644 --- a/ports/clockutils/portfile.cmake +++ b/ports/clockutils/portfile.cmake @@ -32,5 +32,6 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/clockUtils) file(RENAME ${CURRENT_PACKAGES_DIR}/share/clockUtils/LICENSE ${CURRENT_PACKAGES_DIR}/share/clockUtils/copyright) +file(REMOVE ${CURRENT_PACKAGES_DIR}/LICENSE) vcpkg_copy_pdbs() \ No newline at end of file -- cgit v1.2.3 From cfa70c4f67a351732c9e02063a848356d1dc8758 Mon Sep 17 00:00:00 2001 From: codicodi Date: Sun, 27 Nov 2016 02:23:55 +0100 Subject: [ICU] Initial commit --- ports/icu/CONTROL | 3 ++ ports/icu/portfile.cmake | 73 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 ports/icu/CONTROL create mode 100644 ports/icu/portfile.cmake diff --git a/ports/icu/CONTROL b/ports/icu/CONTROL new file mode 100644 index 000000000..a0d0552d7 --- /dev/null +++ b/ports/icu/CONTROL @@ -0,0 +1,3 @@ +Source: icu +Version: 58.1 +Description: Mature and widely used Unicode and localization library. diff --git a/ports/icu/portfile.cmake b/ports/icu/portfile.cmake new file mode 100644 index 000000000..fd6bc8a5a --- /dev/null +++ b/ports/icu/portfile.cmake @@ -0,0 +1,73 @@ +if (NOT TARGET_TRIPLET STREQUAL "x86-windows" OR NOT TARGET_TRIPLET STREQUAL "x64-windows") + message(FATAL_ERROR "Error: Only x64 and x86 desktop builds are supported now.") +endif() + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/icu) +vcpkg_download_distfile(ARCHIVE + URLS "http://download.icu-project.org/files/icu4c/58.1/icu4c-58_1-src.zip" + FILENAME "icu4c-58_1-src.zip" + SHA512 b13b1d8aa5e6a08a5cecaea85252354150064ef98ed7bb66b70d32eac5c80874c11f1fc9e3a667075b867fcc848c33ad90e6cada3a279f65b62cb9d46e25181d) +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}/source/allinone/allinone.sln + PLATFORM ${BUILD_ARCH}) + +set(ICU_VERSION 58) +if(TRIPLET_SYSTEM_ARCH MATCHES "x64") + set(ICU_BIN bin64) + set(ICU_LIB lib64) +else() + set(ICU_BIN bin) + set(ICU_LIB lib) +endif() + +function(install_module MODULENAME) + if(${MODULENAME} STREQUAL icudt) # Database doesn't have debug mode + set(DEBUG_DLLNAME ${MODULENAME}${ICU_VERSION}.dll) + set(DEBUG_LIBNAME ${MODULENAME}.lib) + else() + set(DEBUG_DLLNAME ${MODULENAME}${ICU_VERSION}d.dll) + set(DEBUG_LIBNAME ${MODULENAME}d.lib) + endif() + set(RELEASE_DLLNAME ${MODULENAME}${ICU_VERSION}.dll) + set(RELEASE_LIBNAME ${MODULENAME}.lib) + file(INSTALL + ${SOURCE_PATH}/${ICU_BIN}/${RELEASE_DLLNAME} + DESTINATION ${CURRENT_PACKAGES_DIR}/bin) + file(INSTALL + ${SOURCE_PATH}/${ICU_BIN}/${DEBUG_DLLNAME} + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) + file(INSTALL + ${SOURCE_PATH}/${ICU_LIB}/${RELEASE_LIBNAME} + DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + file(INSTALL + ${SOURCE_PATH}/${ICU_LIB}/${DEBUG_LIBNAME} + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) +endfunction() + +install_module(icuuc) # Common library +install_module(icuio) # Unicode stdio +install_module(icutu) # Tool utility library +install_module(icuin) # I18n library +install_module(icudt) # Database + +vcpkg_copy_pdbs() + +file(INSTALL + ${SOURCE_PATH}/include/ + DESTINATION ${CURRENT_PACKAGES_DIR}/include) + +file(COPY + ${SOURCE_PATH}/LICENSE + DESTINATION ${CURRENT_PACKAGES_DIR}/share/icu) +file(RENAME + ${CURRENT_PACKAGES_DIR}/share/icu/LICENSE + ${CURRENT_PACKAGES_DIR}/share/icu/copyright) -- cgit v1.2.3 From 76e1ee2cfc6c8fab2c1dd1964c6ec6aea66540c3 Mon Sep 17 00:00:00 2001 From: codicodi Date: Sun, 27 Nov 2016 02:28:37 +0100 Subject: Fix small logic error --- ports/icu/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/icu/portfile.cmake b/ports/icu/portfile.cmake index fd6bc8a5a..376c2878b 100644 --- a/ports/icu/portfile.cmake +++ b/ports/icu/portfile.cmake @@ -1,4 +1,4 @@ -if (NOT TARGET_TRIPLET STREQUAL "x86-windows" OR NOT TARGET_TRIPLET STREQUAL "x64-windows") +if (NOT TARGET_TRIPLET STREQUAL "x86-windows" AND NOT TARGET_TRIPLET STREQUAL "x64-windows") message(FATAL_ERROR "Error: Only x64 and x86 desktop builds are supported now.") endif() -- cgit v1.2.3 From 98bb77dab2951822573e02b7b50aa4fbcc080981 Mon Sep 17 00:00:00 2001 From: Mattias Cibien Date: Sun, 27 Nov 2016 09:26:00 +0100 Subject: Added maintainer and url --- ports/globjects/CONTROL | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ports/globjects/CONTROL b/ports/globjects/CONTROL index 170269191..14fb29ae5 100644 --- a/ports/globjects/CONTROL +++ b/ports/globjects/CONTROL @@ -1,3 +1,5 @@ Source: globjects +Maintainer: mattias@mattiascibien.net Version: 1.0.0 -Description: C++ library strictly wrapping OpenGL objects. +Build-Depends: glbinding +Description: C++ library strictly wrapping OpenGL objects. -- cgit v1.2.3 From a45a65f9390b5d4f839daf94fe6a3d6845037a99 Mon Sep 17 00:00:00 2001 From: Mattias Cibien Date: Sun, 27 Nov 2016 09:37:54 +0100 Subject: Fixed missing glm dependency --- ports/globjects/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/globjects/CONTROL b/ports/globjects/CONTROL index 14fb29ae5..7917bacac 100644 --- a/ports/globjects/CONTROL +++ b/ports/globjects/CONTROL @@ -1,5 +1,5 @@ Source: globjects Maintainer: mattias@mattiascibien.net Version: 1.0.0 -Build-Depends: glbinding +Build-Depends: glbinding, glm Description: C++ library strictly wrapping OpenGL objects. -- cgit v1.2.3 From 3b345d4ab5a336d34314bbf1e5a1faa6180bea0d Mon Sep 17 00:00:00 2001 From: sdcb Date: Mon, 28 Nov 2016 09:50:37 +0800 Subject: [chakracore] upgrade to 1.3.1 --- ports/chakracore/CONTROL | 2 +- ports/chakracore/portfile.cmake | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/chakracore/CONTROL b/ports/chakracore/CONTROL index addb84aa2..593691bbf 100644 --- a/ports/chakracore/CONTROL +++ b/ports/chakracore/CONTROL @@ -1,3 +1,3 @@ Source: chakracore -Version: 1.3.0 +Version: 1.3.1 Description: Core part of the Chakra Javascript engine \ No newline at end of file diff --git a/ports/chakracore/portfile.cmake b/ports/chakracore/portfile.cmake index bdba23809..639cf0f65 100644 --- a/ports/chakracore/portfile.cmake +++ b/ports/chakracore/portfile.cmake @@ -4,11 +4,11 @@ endif() include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ChakraCore-1.3.0) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ChakraCore-1.3.1) vcpkg_download_distfile(ARCHIVE_FILE - URLS "https://github.com/Microsoft/ChakraCore/archive/v1.3.0.tar.gz" - FILENAME "ChakraCore-1.3.0.tar.gz" - SHA512 d00757e25f5c62bfc29721bd8f715df8dbaf0ac14c1dbdb0735227535cb4f2a209ec3957f24bb6a7e2bced540475bbf3e54712a930fb517fdfd5adb4d56cea07 + URLS "https://github.com/Microsoft/ChakraCore/archive/v1.3.1.tar.gz" + FILENAME "ChakraCore-1.3.1.tar.gz" + SHA512 52216a03333e44bce235917cfae5ccd6a756056678d9b81c63ec272d9ce5c6afabc673e7910dd3da54fda7927ea62ede980a4371dbb08f6ce4907121c27dbc53 ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) -- cgit v1.2.3 From e0d211cf0bba46e5c3b85f9b712e395b6e48e7b0 Mon Sep 17 00:00:00 2001 From: sdcb Date: Mon, 28 Nov 2016 10:02:07 +0800 Subject: Add DirectXTK12 The DirectX Tool Kit (aka DirectXTK12) is a collection of helper classes for writing DirectX 12 code in C++ Official github: https://github.com/Microsoft/DirectXTK12 --- ports/directxtk12/CONTROL | 3 +++ ports/directxtk12/portfile.cmake | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 ports/directxtk12/CONTROL create mode 100644 ports/directxtk12/portfile.cmake diff --git a/ports/directxtk12/CONTROL b/ports/directxtk12/CONTROL new file mode 100644 index 000000000..dd9ca5620 --- /dev/null +++ b/ports/directxtk12/CONTROL @@ -0,0 +1,3 @@ +Source: directxtk12 +Version: oct2016 +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 new file mode 100644 index 000000000..19372a3b1 --- /dev/null +++ b/ports/directxtk12/portfile.cmake @@ -0,0 +1,38 @@ +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/DirectXTK12-oct2016) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/Microsoft/DirectXTK12/archive/oct2016.tar.gz" + FILENAME "DirectXTK12-oct2016.tar.gz" + SHA512 f33af80dc018c1fda117eeef66bd08046b48572806d879651187cbed9d5ceb402b1798ecc0e1089b54ddb879e5355b45f2b67e3be99fbe270c5216a945a9924b +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_build_msbuild( + PROJECT_PATH ${SOURCE_PATH}/DirectXTK_Desktop_2015_Win10.sln +) + +IF (TRIPLET_SYSTEM_ARCH MATCHES "x86") + SET(BUILD_ARCH "Win32") +ELSE() + SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH}) +ENDIF() + +file(INSTALL + ${SOURCE_PATH}/Bin/Desktop_2015_Win10/${BUILD_ARCH}/Release/DirectXTK12.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib) +file(INSTALL + ${SOURCE_PATH}/Bin/Desktop_2015_Win10/${BUILD_ARCH}/Debug/DirectXTK12.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + +file(INSTALL + ${SOURCE_PATH}/Inc/ + DESTINATION ${CURRENT_PACKAGES_DIR}/include/DirectXTK12 +) + +# Handle copyright +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/directxtk12 RENAME copyright) -- cgit v1.2.3 From 00f10b7789ad6d7b48c71f9f72b6ba0d8d3d1ea4 Mon Sep 17 00:00:00 2001 From: sdcb Date: Mon, 28 Nov 2016 13:06:48 +0800 Subject: [dxut] add build for optional libs. --- ports/dxut/CONTROL | 2 +- ports/dxut/portfile.cmake | 23 ++++++++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/ports/dxut/CONTROL b/ports/dxut/CONTROL index 56fefdb32..372a98d72 100644 --- a/ports/dxut/CONTROL +++ b/ports/dxut/CONTROL @@ -1,3 +1,3 @@ Source: dxut -Version: 11.14-1 +Version: 11.14-2 Description: A "GLUT"-like framework for Direct3D 11.x Win32 desktop applications \ No newline at end of file diff --git a/ports/dxut/portfile.cmake b/ports/dxut/portfile.cmake index 294f64a1f..97dc8b2e3 100644 --- a/ports/dxut/portfile.cmake +++ b/ports/dxut/portfile.cmake @@ -11,33 +11,34 @@ vcpkg_download_distfile(ARCHIVE_FILE ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) -vcpkg_build_msbuild( - PROJECT_PATH ${SOURCE_PATH}/Core/DXUT_2015.vcxproj -) - 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}/DXUT_2015.sln + PLATFORM ${BUILD_ARCH} +) + file(INSTALL - ${SOURCE_PATH}/Core/DDSTextureLoader.h - ${SOURCE_PATH}/Core/DXErr.h - ${SOURCE_PATH}/Core/DXUT.h - ${SOURCE_PATH}/Core/DXUTDevice11.h - ${SOURCE_PATH}/Core/DXUTmisc.h - ${SOURCE_PATH}/Core/Screengrab.h - ${SOURCE_PATH}/Core/WICTextureLoader.h + ${SOURCE_PATH}/Core/ + ${SOURCE_PATH}/Optional/ DESTINATION ${CURRENT_PACKAGES_DIR}/include + FILES_MATCHING PATTERN "*.h" ) +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/include/Bin) file(INSTALL ${SOURCE_PATH}/Core/Bin/Desktop_2015/${BUILD_ARCH}/Release/DXUT.lib + ${SOURCE_PATH}/Optional/Bin/Desktop_2015/${BUILD_ARCH}/Release/DXUTOpt.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) file(INSTALL ${SOURCE_PATH}/Core/Bin/Desktop_2015/${BUILD_ARCH}/Debug/DXUT.lib + ${SOURCE_PATH}/Optional/Bin/Desktop_2015/${BUILD_ARCH}/Debug/DXUTOpt.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) vcpkg_copy_pdbs() -- cgit v1.2.3 From e2e1c7d778c5063f8967bd26c35f9aeca4fbf757 Mon Sep 17 00:00:00 2001 From: sdcb Date: Mon, 28 Nov 2016 19:15:42 +0800 Subject: Add aws-sdk-cpp Note: 1. I add a patch to not using git, because git will emit a wrong version number in initialize_project_version.cmake file. 2. building aws-sdk-cpp will emit some very long file(longer than 258 in my machine), to make it work, you must moving vcpkg into some shorter path like: C:\vcpkg --- ports/aws-sdk-cpp/CONTROL | 3 +++ ports/aws-sdk-cpp/drop_git.patch | 13 +++++++++++++ ports/aws-sdk-cpp/portfile.cmake | 23 +++++++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 ports/aws-sdk-cpp/CONTROL create mode 100644 ports/aws-sdk-cpp/drop_git.patch create mode 100644 ports/aws-sdk-cpp/portfile.cmake diff --git a/ports/aws-sdk-cpp/CONTROL b/ports/aws-sdk-cpp/CONTROL new file mode 100644 index 000000000..bfeed7a0b --- /dev/null +++ b/ports/aws-sdk-cpp/CONTROL @@ -0,0 +1,3 @@ +Source: aws-sdk-cpp +Version: 1.0.34 +Description: AWS SDK for C++ diff --git a/ports/aws-sdk-cpp/drop_git.patch b/ports/aws-sdk-cpp/drop_git.patch new file mode 100644 index 000000000..491831bd7 --- /dev/null +++ b/ports/aws-sdk-cpp/drop_git.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9d2a98a..ce58b68 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -22,7 +22,7 @@ if(CMAKE_MAJOR_VERSION LESS 3) + endif() + + # git is required for Android builds and optional for all other platforms +-find_package(Git) ++#find_package(Git) + + # Cmake invocation variables: + # CUSTOM_MEMORY_MANAGEMENT - if set to 1, generates the sdk project files with custom memory management enabled, otherwise disables it diff --git a/ports/aws-sdk-cpp/portfile.cmake b/ports/aws-sdk-cpp/portfile.cmake new file mode 100644 index 000000000..8af7d0e94 --- /dev/null +++ b/ports/aws-sdk-cpp/portfile.cmake @@ -0,0 +1,23 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/aws-sdk-cpp-1.0.34) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/aws/aws-sdk-cpp/archive/1.0.34.tar.gz" + FILENAME "1.0.34.tar.gz" + SHA512 21ca03eb323eecb55c29866b73c07956a36aad7c9c051eb7ca201cfd356c3f9732c89898cf0c89660d6c1279dc52438bb389b37d613bf741bae81bb3e773a3c5 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/drop_git.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} +) + +vcpkg_install_cmake() + +# Handle copyright +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/aws-sdk-cpp RENAME copyright) \ No newline at end of file -- cgit v1.2.3 From 16a3384f9a3784c3275977880d0daf73ece44243 Mon Sep 17 00:00:00 2001 From: Manuel Massing Date: Sat, 26 Nov 2016 09:35:21 +0100 Subject: [proj4] Replace tabs with spaces --- ports/proj4/portfile.cmake | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ports/proj4/portfile.cmake b/ports/proj4/portfile.cmake index e5af388b0..d38a1b4ab 100644 --- a/ports/proj4/portfile.cmake +++ b/ports/proj4/portfile.cmake @@ -9,10 +9,10 @@ vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH}/ - PATCHES - ${CMAKE_CURRENT_LIST_DIR}/0001-CMake-add-detection-of-recent-visual-studio-versions.patch - ${CMAKE_CURRENT_LIST_DIR}/0002-CMake-fix-error-by-only-setting-properties-for-targe.patch - ${CMAKE_CURRENT_LIST_DIR}/0003-CMake-configurable-cmake-config-install-location.patch + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/0001-CMake-add-detection-of-recent-visual-studio-versions.patch + ${CMAKE_CURRENT_LIST_DIR}/0002-CMake-fix-error-by-only-setting-properties-for-targe.patch + ${CMAKE_CURRENT_LIST_DIR}/0003-CMake-configurable-cmake-config-install-location.patch ) if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) @@ -26,13 +26,13 @@ vcpkg_configure_cmake( OPTIONS ${CMAKE_OPTIONS} -DPROJ_LIB_SUBDIR=lib -DPROJ_INCLUDE_SUBDIR=include - -DPROJ_DATA_SUBDIR=share/proj4 - -DPROJ_CMAKE_CONFIG_SUBDIR=share/proj4 + -DPROJ_DATA_SUBDIR=share/proj4 + -DPROJ_CMAKE_CONFIG_SUBDIR=share/proj4 -DBUILD_CS2CS=NO -DBUILD_PROJ=NO -DBUILD_GEOD=NO -DBUILD_NAD2BIN=NO - -DPROJ4_TESTS=NO + -DPROJ4_TESTS=NO ) vcpkg_install_cmake( @@ -40,7 +40,7 @@ vcpkg_install_cmake( -DBUILD_PROJ=NO -DBUILD_GEOD=NO -DBUILD_NAD2BIN=NO - -DPROJ4_TESTS=NO + -DPROJ4_TESTS=NO ) # Remove duplicate headers installed from debug build -- cgit v1.2.3 From 524f716570aad90e3f7c3094af3eec8e548dec71 Mon Sep 17 00:00:00 2001 From: Manuel Massing Date: Mon, 28 Nov 2016 14:57:19 +0100 Subject: [proj4] Rename port from "proj4" to "proj" --- ...etection-of-recent-visual-studio-versions.patch | 26 ++++++ ...rror-by-only-setting-properties-for-targe.patch | 52 ++++++++++++ ...onfigurable-cmake-config-install-location.patch | 98 ++++++++++++++++++++++ ports/proj/CONTROL | 3 + ports/proj/portfile.cmake | 53 ++++++++++++ ...etection-of-recent-visual-studio-versions.patch | 26 ------ ...rror-by-only-setting-properties-for-targe.patch | 52 ------------ ...onfigurable-cmake-config-install-location.patch | 98 ---------------------- ports/proj4/CONTROL | 3 - ports/proj4/portfile.cmake | 53 ------------ 10 files changed, 232 insertions(+), 232 deletions(-) create mode 100644 ports/proj/0001-CMake-add-detection-of-recent-visual-studio-versions.patch create mode 100644 ports/proj/0002-CMake-fix-error-by-only-setting-properties-for-targe.patch create mode 100644 ports/proj/0003-CMake-configurable-cmake-config-install-location.patch create mode 100644 ports/proj/CONTROL create mode 100644 ports/proj/portfile.cmake delete mode 100644 ports/proj4/0001-CMake-add-detection-of-recent-visual-studio-versions.patch delete mode 100644 ports/proj4/0002-CMake-fix-error-by-only-setting-properties-for-targe.patch delete mode 100644 ports/proj4/0003-CMake-configurable-cmake-config-install-location.patch delete mode 100644 ports/proj4/CONTROL delete mode 100644 ports/proj4/portfile.cmake diff --git a/ports/proj/0001-CMake-add-detection-of-recent-visual-studio-versions.patch b/ports/proj/0001-CMake-add-detection-of-recent-visual-studio-versions.patch new file mode 100644 index 000000000..9be5438aa --- /dev/null +++ b/ports/proj/0001-CMake-add-detection-of-recent-visual-studio-versions.patch @@ -0,0 +1,26 @@ +From ca8bb14234091ab7b1ada2b9e5abb04f40d459cb Mon Sep 17 00:00:00 2001 +From: Manuel Massing +Date: Tue, 22 Nov 2016 12:00:39 +0100 +Subject: [PATCH 1/3] CMake: add detection of recent visual studio versions + +--- + cmake/Proj4SystemInfo.cmake | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/cmake/Proj4SystemInfo.cmake b/cmake/Proj4SystemInfo.cmake +index 294a50b..c7fb6bf 100644 +--- a/cmake/Proj4SystemInfo.cmake ++++ b/cmake/Proj4SystemInfo.cmake +@@ -50,6 +50,9 @@ if(WIN32) + if(MSVC_VERSION EQUAL 1800) + set(PROJ_COMPILER_NAME "msvc-12.0") #Visual Studio 2013 + endif() ++ if(MSVC_VERSION EQUAL 1900) ++ set(PROJ_COMPILER_NAME "msvc-14.0") #Visual Studio 2015 ++ endif() + endif(MSVC) + + if(MINGW) +-- +2.9.2.windows.1 + diff --git a/ports/proj/0002-CMake-fix-error-by-only-setting-properties-for-targe.patch b/ports/proj/0002-CMake-fix-error-by-only-setting-properties-for-targe.patch new file mode 100644 index 000000000..2c470570e --- /dev/null +++ b/ports/proj/0002-CMake-fix-error-by-only-setting-properties-for-targe.patch @@ -0,0 +1,52 @@ +From 1265d13f29259be05535241e9bcbfcf16857dc06 Mon Sep 17 00:00:00 2001 +From: Manuel Massing +Date: Tue, 22 Nov 2016 12:04:10 +0100 +Subject: [PATCH 2/3] CMake: fix error by only setting properties for targets + which are actually defined + +--- + src/CMakeLists.txt | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 8d7e7d1..59ad00a 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -22,25 +22,30 @@ if(NOT MSVC) + endif () + endif () + ++ + if(BUILD_CS2CS) +- include(bin_cs2cs.cmake) ++ list(APPEND BINARY_TARGETS cs2cs) ++ include(bin_cs2cs.cmake) + endif(BUILD_CS2CS) + + if(BUILD_PROJ) ++ list(APPEND BINARY_TARGETS proj) + include(bin_proj.cmake) + endif(BUILD_PROJ) + + if(BUILD_GEOD) ++ list(APPEND BINARY_TARGETS geod) + include(bin_geod.cmake) + include(bin_geodtest.cmake) + endif(BUILD_GEOD) + + if(BUILD_NAD2BIN) ++ list(APPEND BINARY_TARGETS nad2bin) + include(bin_nad2bin.cmake) + endif(BUILD_NAD2BIN) + +-if (MSVC OR CMAKE_CONFIGURATION_TYPES) ++if ((MSVC OR CMAKE_CONFIGURATION_TYPES) AND BINARY_TARGETS) + # Add _d suffix for your debug versions of the tools +- set_target_properties (cs2cs binproj geod nad2bin PROPERTIES +- DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) ++ set_target_properties(${BINARY_TARGETS} PROPERTIES ++ DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) + endif () +-- +2.9.2.windows.1 + diff --git a/ports/proj/0003-CMake-configurable-cmake-config-install-location.patch b/ports/proj/0003-CMake-configurable-cmake-config-install-location.patch new file mode 100644 index 000000000..5870e12ea --- /dev/null +++ b/ports/proj/0003-CMake-configurable-cmake-config-install-location.patch @@ -0,0 +1,98 @@ +From 0be627798d943558c674d4d92767ca255d847631 Mon Sep 17 00:00:00 2001 +From: Manuel Massing +Date: Tue, 22 Nov 2016 12:26:39 +0100 +Subject: [PATCH 3/3] CMake: configurable cmake config install location + +--- + CMakeLists.txt | 1 + + cmake/CMakeLists.txt | 14 +++++++------- + cmake/Proj4InstallPath.cmake | 12 +++++++++--- + 3 files changed, 17 insertions(+), 10 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index cde21f0..1b1f892 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -106,6 +106,7 @@ set(LIBDIR "${DEFAULT_LIBDIR}" CACHE PATH "The directory to install libraries in + set(DATADIR "${DEFAULT_DATADIR}" CACHE PATH "The directory to install data files into.") + set(DOCDIR "${DEFAULT_DOCDIR}" CACHE PATH "The directory to install doc files into.") + set(INCLUDEDIR "${DEFAULT_INCLUDEDIR}" CACHE PATH "The directory to install includes into.") ++set(CMAKEDIR "${DEFAULT_CMAKE_CONFIGDIR}" CACHE PATH "The directory to install cmake files into.") + + ################################################################################# + # Build configured components +diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt +index 742da0e..2bdef0d 100644 +--- a/cmake/CMakeLists.txt ++++ b/cmake/CMakeLists.txt +@@ -2,13 +2,13 @@ + # ${INSTALL_CMAKE_DIR} and @PROJECT_ROOT_DIR@ is the relative + # path to the root from there. (Note that the whole install tree can + # be relocated.) +-if (NOT WIN32) +- set (INSTALL_CMAKE_DIR "share/cmake/${PROJECT_NAME}") +- set (PROJECT_ROOT_DIR "../../..") +-else () +- set (INSTALL_CMAKE_DIR "cmake") +- set (PROJECT_ROOT_DIR "..") +-endif () ++ ++set (INSTALL_CMAKE_DIR ${CMAKEDIR}) ++if(NOT IS_ABSOLUTE ${INSTALL_CMAKE_DIR}) ++ set(INSTALL_CMAKE_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKEDIR}") ++endif() ++ ++file(RELATIVE_PATH PROJECT_ROOT_DIR ${INSTALL_CMAKE_DIR} ${CMAKE_INSTALL_PREFIX}) + + string(TOLOWER "${PROJECT_NAME}" PROJECT_NAME_LOWER) + configure_file (project-config.cmake.in project-config.cmake @ONLY) +diff --git a/cmake/Proj4InstallPath.cmake b/cmake/Proj4InstallPath.cmake +index da1491c..826fb29 100644 +--- a/cmake/Proj4InstallPath.cmake ++++ b/cmake/Proj4InstallPath.cmake +@@ -28,13 +28,15 @@ if(WIN32) + set(DEFAULT_DATA_SUBDIR share) + set(DEFAULT_INCLUDE_SUBDIR local/include) + set(DEFAULT_DOC_SUBDIR share/doc/proj) ++ set(DEFAULT_CMAKE_CONFIG_SUBDIR "cmake") + else() +- # Common locatoins for Unix and Mac OS X ++ # Common locations for Unix and Mac OS X + set(DEFAULT_BIN_SUBDIR bin) + set(DEFAULT_LIB_SUBDIR lib) + set(DEFAULT_DATA_SUBDIR share/proj) + set(DEFAULT_DOC_SUBDIR doc/proj) + set(DEFAULT_INCLUDE_SUBDIR include) ++ set(DEFAULT_CMAKE_CONFIG_SUBDIR "share/cmake/${PROJECT_NAME}") + endif() + + # Locations are changeable by user to customize layout of PDAL installation +@@ -49,19 +51,23 @@ set(PROJ_DATA_SUBDIR ${DEFAULT_DATA_SUBDIR} CACHE STRING + "Subdirectory where data will be installed") + set(PROJ_DOC_SUBDIR ${DEFAULT_DOC_SUBDIR} CACHE STRING + "Subdirectory where data will be installed") +- ++set(PROJ_CMAKE_CONFIG_SUBDIR ${DEFAULT_CMAKE_CONFIG_SUBDIR} CACHE STRING ++ "Subdirectory where cmake configuration files will be installed") ++ + # Mark *DIR variables as advanced and dedicated to use by power-users only. + mark_as_advanced(PROJ_ROOT_DIR + PROJ_BIN_SUBDIR + PROJ_LIB_SUBDIR + PROJ_INCLUDE_SUBDIR + PROJ_DATA_SUBDIR +- PROJ_DOC_SUBDIR ) ++ PROJ_DOC_SUBDIR ++ PROJ_CMAKE_CONFIG_SUBDIR) + + set(DEFAULT_BINDIR "${PROJ_BIN_SUBDIR}") + set(DEFAULT_LIBDIR "${PROJ_LIB_SUBDIR}") + set(DEFAULT_DATADIR "${PROJ_DATA_SUBDIR}") + set(DEFAULT_DOCDIR "${PROJ_DOC_SUBDIR}") + set(DEFAULT_INCLUDEDIR "${PROJ_INCLUDE_SUBDIR}") ++set(DEFAULT_CMAKE_CONFIGDIR "${PROJ_CMAKE_CONFIG_SUBDIR}") + + +-- +2.9.2.windows.1 + diff --git a/ports/proj/CONTROL b/ports/proj/CONTROL new file mode 100644 index 000000000..b706ca11a --- /dev/null +++ b/ports/proj/CONTROL @@ -0,0 +1,3 @@ +Source: proj +Version: 4.9.3 +Description: PROJ.4 library for cartographic projections diff --git a/ports/proj/portfile.cmake b/ports/proj/portfile.cmake new file mode 100644 index 000000000..c67edb70c --- /dev/null +++ b/ports/proj/portfile.cmake @@ -0,0 +1,53 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/proj-4.9.3) +vcpkg_download_distfile(ARCHIVE + URLS "http://download.osgeo.org/proj/proj-4.9.3.zip" + FILENAME "proj-4.9.3.zip" + SHA512 c9703008cd1f75fe1239b180158e560b9b88ae2ffd900b72923c716908eb86d1abbc4230647af5e3131f8c34481bdc66b03826d669620161ffcfbe67801cb631 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH}/ + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/0001-CMake-add-detection-of-recent-visual-studio-versions.patch + ${CMAKE_CURRENT_LIST_DIR}/0002-CMake-fix-error-by-only-setting-properties-for-targe.patch + ${CMAKE_CURRENT_LIST_DIR}/0003-CMake-configurable-cmake-config-install-location.patch +) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + list(APPEND CMAKE_OPTIONS "-DBUILD_LIBPROJ_SHARED=YES") +else() + list(APPEND CMAKE_OPTIONS "-DBUILD_LIBPROJ_SHARED=NO") +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS ${CMAKE_OPTIONS} + -DPROJ_LIB_SUBDIR=lib + -DPROJ_INCLUDE_SUBDIR=include + -DPROJ_DATA_SUBDIR=share/proj + -DPROJ_CMAKE_CONFIG_SUBDIR=share/proj + -DBUILD_CS2CS=NO + -DBUILD_PROJ=NO + -DBUILD_GEOD=NO + -DBUILD_NAD2BIN=NO + -DPROJ4_TESTS=NO +) + +vcpkg_install_cmake( + -DBUILD_CS2CS=NO + -DBUILD_PROJ=NO + -DBUILD_GEOD=NO + -DBUILD_NAD2BIN=NO + -DPROJ4_TESTS=NO +) + +# Remove duplicate headers installed from debug build +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +# Remove data installed from debug build +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + +# Handle copyright +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/proj) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/proj/COPYING ${CURRENT_PACKAGES_DIR}/share/proj/copyright) diff --git a/ports/proj4/0001-CMake-add-detection-of-recent-visual-studio-versions.patch b/ports/proj4/0001-CMake-add-detection-of-recent-visual-studio-versions.patch deleted file mode 100644 index 9be5438aa..000000000 --- a/ports/proj4/0001-CMake-add-detection-of-recent-visual-studio-versions.patch +++ /dev/null @@ -1,26 +0,0 @@ -From ca8bb14234091ab7b1ada2b9e5abb04f40d459cb Mon Sep 17 00:00:00 2001 -From: Manuel Massing -Date: Tue, 22 Nov 2016 12:00:39 +0100 -Subject: [PATCH 1/3] CMake: add detection of recent visual studio versions - ---- - cmake/Proj4SystemInfo.cmake | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/cmake/Proj4SystemInfo.cmake b/cmake/Proj4SystemInfo.cmake -index 294a50b..c7fb6bf 100644 ---- a/cmake/Proj4SystemInfo.cmake -+++ b/cmake/Proj4SystemInfo.cmake -@@ -50,6 +50,9 @@ if(WIN32) - if(MSVC_VERSION EQUAL 1800) - set(PROJ_COMPILER_NAME "msvc-12.0") #Visual Studio 2013 - endif() -+ if(MSVC_VERSION EQUAL 1900) -+ set(PROJ_COMPILER_NAME "msvc-14.0") #Visual Studio 2015 -+ endif() - endif(MSVC) - - if(MINGW) --- -2.9.2.windows.1 - diff --git a/ports/proj4/0002-CMake-fix-error-by-only-setting-properties-for-targe.patch b/ports/proj4/0002-CMake-fix-error-by-only-setting-properties-for-targe.patch deleted file mode 100644 index 2c470570e..000000000 --- a/ports/proj4/0002-CMake-fix-error-by-only-setting-properties-for-targe.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 1265d13f29259be05535241e9bcbfcf16857dc06 Mon Sep 17 00:00:00 2001 -From: Manuel Massing -Date: Tue, 22 Nov 2016 12:04:10 +0100 -Subject: [PATCH 2/3] CMake: fix error by only setting properties for targets - which are actually defined - ---- - src/CMakeLists.txt | 13 +++++++++---- - 1 file changed, 9 insertions(+), 4 deletions(-) - -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 8d7e7d1..59ad00a 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -22,25 +22,30 @@ if(NOT MSVC) - endif () - endif () - -+ - if(BUILD_CS2CS) -- include(bin_cs2cs.cmake) -+ list(APPEND BINARY_TARGETS cs2cs) -+ include(bin_cs2cs.cmake) - endif(BUILD_CS2CS) - - if(BUILD_PROJ) -+ list(APPEND BINARY_TARGETS proj) - include(bin_proj.cmake) - endif(BUILD_PROJ) - - if(BUILD_GEOD) -+ list(APPEND BINARY_TARGETS geod) - include(bin_geod.cmake) - include(bin_geodtest.cmake) - endif(BUILD_GEOD) - - if(BUILD_NAD2BIN) -+ list(APPEND BINARY_TARGETS nad2bin) - include(bin_nad2bin.cmake) - endif(BUILD_NAD2BIN) - --if (MSVC OR CMAKE_CONFIGURATION_TYPES) -+if ((MSVC OR CMAKE_CONFIGURATION_TYPES) AND BINARY_TARGETS) - # Add _d suffix for your debug versions of the tools -- set_target_properties (cs2cs binproj geod nad2bin PROPERTIES -- DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) -+ set_target_properties(${BINARY_TARGETS} PROPERTIES -+ DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) - endif () --- -2.9.2.windows.1 - diff --git a/ports/proj4/0003-CMake-configurable-cmake-config-install-location.patch b/ports/proj4/0003-CMake-configurable-cmake-config-install-location.patch deleted file mode 100644 index 5870e12ea..000000000 --- a/ports/proj4/0003-CMake-configurable-cmake-config-install-location.patch +++ /dev/null @@ -1,98 +0,0 @@ -From 0be627798d943558c674d4d92767ca255d847631 Mon Sep 17 00:00:00 2001 -From: Manuel Massing -Date: Tue, 22 Nov 2016 12:26:39 +0100 -Subject: [PATCH 3/3] CMake: configurable cmake config install location - ---- - CMakeLists.txt | 1 + - cmake/CMakeLists.txt | 14 +++++++------- - cmake/Proj4InstallPath.cmake | 12 +++++++++--- - 3 files changed, 17 insertions(+), 10 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index cde21f0..1b1f892 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -106,6 +106,7 @@ set(LIBDIR "${DEFAULT_LIBDIR}" CACHE PATH "The directory to install libraries in - set(DATADIR "${DEFAULT_DATADIR}" CACHE PATH "The directory to install data files into.") - set(DOCDIR "${DEFAULT_DOCDIR}" CACHE PATH "The directory to install doc files into.") - set(INCLUDEDIR "${DEFAULT_INCLUDEDIR}" CACHE PATH "The directory to install includes into.") -+set(CMAKEDIR "${DEFAULT_CMAKE_CONFIGDIR}" CACHE PATH "The directory to install cmake files into.") - - ################################################################################# - # Build configured components -diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt -index 742da0e..2bdef0d 100644 ---- a/cmake/CMakeLists.txt -+++ b/cmake/CMakeLists.txt -@@ -2,13 +2,13 @@ - # ${INSTALL_CMAKE_DIR} and @PROJECT_ROOT_DIR@ is the relative - # path to the root from there. (Note that the whole install tree can - # be relocated.) --if (NOT WIN32) -- set (INSTALL_CMAKE_DIR "share/cmake/${PROJECT_NAME}") -- set (PROJECT_ROOT_DIR "../../..") --else () -- set (INSTALL_CMAKE_DIR "cmake") -- set (PROJECT_ROOT_DIR "..") --endif () -+ -+set (INSTALL_CMAKE_DIR ${CMAKEDIR}) -+if(NOT IS_ABSOLUTE ${INSTALL_CMAKE_DIR}) -+ set(INSTALL_CMAKE_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKEDIR}") -+endif() -+ -+file(RELATIVE_PATH PROJECT_ROOT_DIR ${INSTALL_CMAKE_DIR} ${CMAKE_INSTALL_PREFIX}) - - string(TOLOWER "${PROJECT_NAME}" PROJECT_NAME_LOWER) - configure_file (project-config.cmake.in project-config.cmake @ONLY) -diff --git a/cmake/Proj4InstallPath.cmake b/cmake/Proj4InstallPath.cmake -index da1491c..826fb29 100644 ---- a/cmake/Proj4InstallPath.cmake -+++ b/cmake/Proj4InstallPath.cmake -@@ -28,13 +28,15 @@ if(WIN32) - set(DEFAULT_DATA_SUBDIR share) - set(DEFAULT_INCLUDE_SUBDIR local/include) - set(DEFAULT_DOC_SUBDIR share/doc/proj) -+ set(DEFAULT_CMAKE_CONFIG_SUBDIR "cmake") - else() -- # Common locatoins for Unix and Mac OS X -+ # Common locations for Unix and Mac OS X - set(DEFAULT_BIN_SUBDIR bin) - set(DEFAULT_LIB_SUBDIR lib) - set(DEFAULT_DATA_SUBDIR share/proj) - set(DEFAULT_DOC_SUBDIR doc/proj) - set(DEFAULT_INCLUDE_SUBDIR include) -+ set(DEFAULT_CMAKE_CONFIG_SUBDIR "share/cmake/${PROJECT_NAME}") - endif() - - # Locations are changeable by user to customize layout of PDAL installation -@@ -49,19 +51,23 @@ set(PROJ_DATA_SUBDIR ${DEFAULT_DATA_SUBDIR} CACHE STRING - "Subdirectory where data will be installed") - set(PROJ_DOC_SUBDIR ${DEFAULT_DOC_SUBDIR} CACHE STRING - "Subdirectory where data will be installed") -- -+set(PROJ_CMAKE_CONFIG_SUBDIR ${DEFAULT_CMAKE_CONFIG_SUBDIR} CACHE STRING -+ "Subdirectory where cmake configuration files will be installed") -+ - # Mark *DIR variables as advanced and dedicated to use by power-users only. - mark_as_advanced(PROJ_ROOT_DIR - PROJ_BIN_SUBDIR - PROJ_LIB_SUBDIR - PROJ_INCLUDE_SUBDIR - PROJ_DATA_SUBDIR -- PROJ_DOC_SUBDIR ) -+ PROJ_DOC_SUBDIR -+ PROJ_CMAKE_CONFIG_SUBDIR) - - set(DEFAULT_BINDIR "${PROJ_BIN_SUBDIR}") - set(DEFAULT_LIBDIR "${PROJ_LIB_SUBDIR}") - set(DEFAULT_DATADIR "${PROJ_DATA_SUBDIR}") - set(DEFAULT_DOCDIR "${PROJ_DOC_SUBDIR}") - set(DEFAULT_INCLUDEDIR "${PROJ_INCLUDE_SUBDIR}") -+set(DEFAULT_CMAKE_CONFIGDIR "${PROJ_CMAKE_CONFIG_SUBDIR}") - - --- -2.9.2.windows.1 - diff --git a/ports/proj4/CONTROL b/ports/proj4/CONTROL deleted file mode 100644 index f31a03049..000000000 --- a/ports/proj4/CONTROL +++ /dev/null @@ -1,3 +0,0 @@ -Source: proj4 -Version: 4.9.3 -Description: PROJ.4 library for cartographic projections diff --git a/ports/proj4/portfile.cmake b/ports/proj4/portfile.cmake deleted file mode 100644 index d38a1b4ab..000000000 --- a/ports/proj4/portfile.cmake +++ /dev/null @@ -1,53 +0,0 @@ -include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/proj-4.9.3) -vcpkg_download_distfile(ARCHIVE - URLS "http://download.osgeo.org/proj/proj-4.9.3.zip" - FILENAME "proj-4.9.3.zip" - SHA512 c9703008cd1f75fe1239b180158e560b9b88ae2ffd900b72923c716908eb86d1abbc4230647af5e3131f8c34481bdc66b03826d669620161ffcfbe67801cb631 -) -vcpkg_extract_source_archive(${ARCHIVE}) - -vcpkg_apply_patches( - SOURCE_PATH ${SOURCE_PATH}/ - PATCHES - ${CMAKE_CURRENT_LIST_DIR}/0001-CMake-add-detection-of-recent-visual-studio-versions.patch - ${CMAKE_CURRENT_LIST_DIR}/0002-CMake-fix-error-by-only-setting-properties-for-targe.patch - ${CMAKE_CURRENT_LIST_DIR}/0003-CMake-configurable-cmake-config-install-location.patch -) - -if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - list(APPEND CMAKE_OPTIONS "-DBUILD_LIBPROJ_SHARED=YES") -else() - list(APPEND CMAKE_OPTIONS "-DBUILD_LIBPROJ_SHARED=NO") -endif() - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - OPTIONS ${CMAKE_OPTIONS} - -DPROJ_LIB_SUBDIR=lib - -DPROJ_INCLUDE_SUBDIR=include - -DPROJ_DATA_SUBDIR=share/proj4 - -DPROJ_CMAKE_CONFIG_SUBDIR=share/proj4 - -DBUILD_CS2CS=NO - -DBUILD_PROJ=NO - -DBUILD_GEOD=NO - -DBUILD_NAD2BIN=NO - -DPROJ4_TESTS=NO -) - -vcpkg_install_cmake( - -DBUILD_CS2CS=NO - -DBUILD_PROJ=NO - -DBUILD_GEOD=NO - -DBUILD_NAD2BIN=NO - -DPROJ4_TESTS=NO -) - -# Remove duplicate headers installed from debug build -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -# Remove data installed from debug build -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) - -# Handle copyright -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/proj4) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/proj4/COPYING ${CURRENT_PACKAGES_DIR}/share/proj4/copyright) -- cgit v1.2.3 From c969fad3f99c5c6b0ef50d7f30a66d0a12c59d2c Mon Sep 17 00:00:00 2001 From: Manuel Massing Date: Mon, 28 Nov 2016 14:59:41 +0100 Subject: [proj] Rename library to "proj.lib" / "projd.lib" --- ports/proj/portfile.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ports/proj/portfile.cmake b/ports/proj/portfile.cmake index c67edb70c..88941291c 100644 --- a/ports/proj/portfile.cmake +++ b/ports/proj/portfile.cmake @@ -43,6 +43,15 @@ vcpkg_install_cmake( -DPROJ4_TESTS=NO ) +# Rename library and adapt cmake configuration +# N.B. debug cmake export is not copied, as it's not relocatable +file(READ ${CURRENT_PACKAGES_DIR}/share/proj/proj4-targets-release.cmake PROJ4_TARGETS_RELEASE) +string(REPLACE "proj_4_9.lib" "proj.lib" PROJ4_TARGETS_RELEASE ${PROJ4_TARGETS_RELEASE}) +file(WRITE ${CURRENT_PACKAGES_DIR}/share/proj/proj4-targets-release.cmake ${PROJ4_TARGETS_RELEASE}) + +file(RENAME ${CURRENT_PACKAGES_DIR}/lib/proj_4_9.lib ${CURRENT_PACKAGES_DIR}/lib/proj.lib) +file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/proj_4_9_d.lib ${CURRENT_PACKAGES_DIR}/debug/lib/projd.lib) + # Remove duplicate headers installed from debug build file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Remove data installed from debug build -- cgit v1.2.3 From de3189dbe6c5107495bf65b066712b54d4ff9e51 Mon Sep 17 00:00:00 2001 From: Manuel Massing Date: Mon, 28 Nov 2016 14:59:59 +0100 Subject: [proj] Remove unused parameters --- ports/proj/portfile.cmake | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/ports/proj/portfile.cmake b/ports/proj/portfile.cmake index 88941291c..6007ab62a 100644 --- a/ports/proj/portfile.cmake +++ b/ports/proj/portfile.cmake @@ -35,13 +35,8 @@ vcpkg_configure_cmake( -DPROJ4_TESTS=NO ) -vcpkg_install_cmake( - -DBUILD_CS2CS=NO - -DBUILD_PROJ=NO - -DBUILD_GEOD=NO - -DBUILD_NAD2BIN=NO - -DPROJ4_TESTS=NO -) +vcpkg_install_cmake() + # Rename library and adapt cmake configuration # N.B. debug cmake export is not copied, as it's not relocatable -- cgit v1.2.3 From 94776cec0e831234a6d07bc535615c13f5344a8d Mon Sep 17 00:00:00 2001 From: flysha Date: Mon, 28 Nov 2016 23:03:26 +0800 Subject: [aws-sdk-cpp] correct the lib file --- ports/aws-sdk-cpp/portfile.cmake | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ports/aws-sdk-cpp/portfile.cmake b/ports/aws-sdk-cpp/portfile.cmake index 8af7d0e94..6a72cda14 100644 --- a/ports/aws-sdk-cpp/portfile.cmake +++ b/ports/aws-sdk-cpp/portfile.cmake @@ -19,5 +19,20 @@ vcpkg_configure_cmake( vcpkg_install_cmake() +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/debug/include + ${CURRENT_PACKAGES_DIR}/lib/cmake + ${CURRENT_PACKAGES_DIR}/lib/pkgconfig + ${CURRENT_PACKAGES_DIR}/debug/lib/cmake + ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig + ${CURRENT_PACKAGES_DIR}/nuget + ${CURRENT_PACKAGES_DIR}/debug/nuget) + +file(GLOB LIB_FILES ${CURRENT_PACKAGES_DIR}/bin/*.lib) +file(GLOB DEBUG_LIB_FILES ${CURRENT_PACKAGES_DIR}/debug/bin/*.lib) +file(COPY ${LIB_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/lib) +file(COPY ${DEBUG_LIB_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) +file(REMOVE ${LIB_FILES} ${DEBUG_LIB_FILES}) + # Handle copyright file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/aws-sdk-cpp RENAME copyright) \ No newline at end of file -- cgit v1.2.3 From 84c99801c4142e937ed76b5c8b77747f6865d862 Mon Sep 17 00:00:00 2001 From: flysha Date: Mon, 28 Nov 2016 23:06:04 +0800 Subject: [aws-sdk-cpp] specify dynamic only --- ports/aws-sdk-cpp/portfile.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ports/aws-sdk-cpp/portfile.cmake b/ports/aws-sdk-cpp/portfile.cmake index 6a72cda14..7912f8b11 100644 --- a/ports/aws-sdk-cpp/portfile.cmake +++ b/ports/aws-sdk-cpp/portfile.cmake @@ -1,3 +1,8 @@ +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(STATUS "Warning: Static building not supported yet. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) +endif() + include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/aws-sdk-cpp-1.0.34) vcpkg_download_distfile(ARCHIVE -- cgit v1.2.3 From 167f82b804052239244bcbb7122253c13c4dca7e Mon Sep 17 00:00:00 2001 From: Manuel Massing Date: Wed, 23 Nov 2016 18:30:50 +0100 Subject: [ports] Initial commit of GDAL 1.11.3 port --- ...upport-for-MSVC1900-backported-from-GDAL2.patch | 70 ++++++++++++ ...e-CXX_CRT_FLAGS-to-allow-for-selection-of.patch | 50 ++++++++ ports/gdal/CONTROL | 4 + ports/gdal/portfile.cmake | 126 +++++++++++++++++++++ 4 files changed, 250 insertions(+) create mode 100644 ports/gdal/0001-Add-support-for-MSVC1900-backported-from-GDAL2.patch create mode 100644 ports/gdal/0002-Add-variable-CXX_CRT_FLAGS-to-allow-for-selection-of.patch create mode 100644 ports/gdal/CONTROL create mode 100644 ports/gdal/portfile.cmake diff --git a/ports/gdal/0001-Add-support-for-MSVC1900-backported-from-GDAL2.patch b/ports/gdal/0001-Add-support-for-MSVC1900-backported-from-GDAL2.patch new file mode 100644 index 000000000..e29cc5b8e --- /dev/null +++ b/ports/gdal/0001-Add-support-for-MSVC1900-backported-from-GDAL2.patch @@ -0,0 +1,70 @@ +From 823171a129401d226ac4821fb997ce585045170c Mon Sep 17 00:00:00 2001 +From: Manuel Massing +Date: Wed, 23 Nov 2016 23:50:12 +0100 +Subject: [PATCH] Add support for MSVC1900 (backported from GDAL2) + +--- + nmake.opt | 6 ++++++ + port/cpl_config.h.vc | 8 +++++--- + 2 files changed, 11 insertions(+), 3 deletions(-) + +diff --git a/nmake.opt b/nmake.opt +index 8900135..4d1c4fa 100644 +--- a/nmake.opt ++++ b/nmake.opt +@@ -31,6 +31,7 @@ + # Check version of Visual C++ compiler: + # nmake -f makefile.vc MSVC_VER=xxxx + # where xxxx is one of following: ++# 1900 = 14.0(2015) + # 1800 = 12.0(2013) + # 1700 = 11.0(2012) + # 1600 = 10.0(2010) +@@ -627,8 +628,13 @@ GDALLIB = $(GDAL_ROOT)/gdal.lib + !ENDIF + + !IFDEF ODBC_SUPPORTED ++!IF $(MSVC_VER) >= 1900 ++# legacy_stdio_definitions.lib : https://connect.microsoft.com/VisualStudio/feedback/details/1134693/vs-2015-ctp-5-c-vsnwprintf-s-and-other-functions-are-not-exported-in-appcrt140-dll-breaking-linkage-of-static-libraries ++ODBCLIB = legacy_stdio_definitions.lib odbc32.lib odbccp32.lib user32.lib ++!ELSE + ODBCLIB = odbc32.lib odbccp32.lib user32.lib + !ENDIF ++!ENDIF + + !IF DEFINED(MRSID_DIR) || DEFINED(MRSID_RASTER_DIR) || DEFINED(MRSID_LIDAR_DIR) + !IF "$(MRSID_PLUGIN)" != "YES" +diff --git a/port/cpl_config.h.vc b/port/cpl_config.h.vc +index bfff8f6..fe7b82a 100644 +--- a/port/cpl_config.h.vc ++++ b/port/cpl_config.h.vc +@@ -1,5 +1,5 @@ + +-/* We define this here in general so that a VC++ build will publically ++/* We define this here in general so that a VC++ build will publicly + declare STDCALL interfaces even if an application is built against it + using MinGW */ + +@@ -17,7 +17,9 @@ + #if defined(_MSC_VER) && (_MSC_VER < 1500) + # define vsnprintf _vsnprintf + #endif +-#define snprintf _snprintf ++#if defined(_MSC_VER) && (_MSC_VER < 1900) ++# define snprintf _snprintf ++#endif + + #define HAVE_GETCWD 1 + /* gmt_notunix.h from GMT project also redefines getcwd. See #3138 */ +@@ -86,7 +88,7 @@ + /* Set the native cpu bit order */ + #define HOST_FILLORDER FILLORDER_LSB2MSB + +-/* Define as 0 or 1 according to the floating point format suported by the ++/* Define as 0 or 1 according to the floating point format supported by the + machine */ + #define HAVE_IEEEFP 1 + +-- +2.10.1.windows.1 + diff --git a/ports/gdal/0002-Add-variable-CXX_CRT_FLAGS-to-allow-for-selection-of.patch b/ports/gdal/0002-Add-variable-CXX_CRT_FLAGS-to-allow-for-selection-of.patch new file mode 100644 index 000000000..0ffcac5fb --- /dev/null +++ b/ports/gdal/0002-Add-variable-CXX_CRT_FLAGS-to-allow-for-selection-of.patch @@ -0,0 +1,50 @@ +From b25c3dc49ca1bcf9a789cf64c9fa8694e35127f0 Mon Sep 17 00:00:00 2001 +From: Manuel Massing +Date: Sun, 27 Nov 2016 09:57:04 +0100 +Subject: [PATCH 2/2] Add variable CXX_CRT_FLAGS to allow for selection of C + runtime linkage in nmake build. + +--- + nmake.opt | 18 ++++++++++++++---- + 1 file changed, 14 insertions(+), 4 deletions(-) + +diff --git a/nmake.opt b/nmake.opt +index 4d1c4fa..47c2df8 100644 +--- a/nmake.opt ++++ b/nmake.opt +@@ -125,18 +125,28 @@ CXX_PDB_FLAGS=/Zi /Fd$(GDAL_ROOT)\gdal$(VERSION).pdb + CXX_PDB_FLAGS= + !ENDIF + ++# Flags to choose CRT variant to link against (e.g. static: /MT, /MTd, dynamic: /MD, /MDd) ++# Ensure MRSID_CONFIG in mrsid/nmake.opt is set appropriately as well ++!IFNDEF CXX_CRT_FLAGS ++!IFNDEF DEBUG ++CXX_CRT_FLAGS=/MD ++!ELSE ++CXX_CRT_FLAGS=/MDd ++!ENDIF ++!ENDIF ++ + !IFNDEF OPTFLAGS + !IF $(MSVC_VER) >= 1400 + !IFNDEF DEBUG +-OPTFLAGS= $(CXX_ANALYZE_FLAGS) $(CXX_PDB_FLAGS) /nologo /MD /EHsc /Ox /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DNDEBUG ++OPTFLAGS= $(CXX_ANALYZE_FLAGS) $(CXX_PDB_FLAGS) /nologo $(CXX_CRT_FLAGS) /EHsc /Ox /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DNDEBUG + !ELSE +-OPTFLAGS= $(CXX_ANALYZE_FLAGS) $(CXX_PDB_FLAGS) /nologo /MD /EHsc /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DDEBUG ++OPTFLAGS= $(CXX_ANALYZE_FLAGS) $(CXX_PDB_FLAGS) /nologo $(CXX_CRT_FLAGS) /EHsc /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DDEBUG + !ENDIF + !ELSE + !IFNDEF DEBUG +-OPTFLAGS= $(CXX_PDB_FLAGS) /nologo /MD /EHsc /GR /Ox /DNDEBUG ++OPTFLAGS= $(CXX_PDB_FLAGS) /nologo $(CXX_CRT_FLAGS) /EHsc /GR /Ox /DNDEBUG + !ELSE +-OPTFLAGS= $(CXX_PDB_FLAGS) /nologo /MD /EHsc /GR /DDEBUG ++OPTFLAGS= $(CXX_PDB_FLAGS) /nologo $(CXX_CRT_FLAGS) /EHsc /GR /DDEBUG + !ENDIF + !ENDIF #MSVC_VER + !ENDIF # OPTFLAGS +-- +2.10.1.windows.1 + diff --git a/ports/gdal/CONTROL b/ports/gdal/CONTROL new file mode 100644 index 000000000..38eccc46d --- /dev/null +++ b/ports/gdal/CONTROL @@ -0,0 +1,4 @@ +Source: gdal +Version: 1.11.3 +Description: The Geographic Data Abstraction Library for reading and writing geospatial raster and vector data. +Build-Depends: proj diff --git a/ports/gdal/portfile.cmake b/ports/gdal/portfile.cmake new file mode 100644 index 000000000..ca548ae83 --- /dev/null +++ b/ports/gdal/portfile.cmake @@ -0,0 +1,126 @@ +if (TRIPLET_SYSTEM_ARCH MATCHES "arm") + message(FATAL_ERROR " ARM is currently not supported.") +endif() + +include(vcpkg_common_functions) + +# Remove part pertaining to linkage +string(REPLACE "-static" "" ARCH ${TARGET_TRIPLET}) + +vcpkg_download_distfile(ARCHIVE + URLS "http://download.osgeo.org/gdal/1.11.3/gdal1113.zip" + FILENAME "gdal1113.zip" + SHA512 42feb98a54019d3b6ac54f598f299a57e117db500c662d39faa9d5f5090f03c1b8d7680242e1abd8035738edc4fc3197ae118a0ce50733691a76a5cf377bcd46 +) + +# Extract source into archictecture specific directory, because GDALs' nmake based build currently does not +# support out of source builds. +set(SOURCE_PATH_DEBUG ${CURRENT_BUILDTREES_DIR}/src-${ARCH}-debug/gdal-1.11.3) +set(SOURCE_PATH_RELEASE ${CURRENT_BUILDTREES_DIR}/src-${ARCH}-release/gdal-1.11.3) + +foreach(BUILD_TYPE debug release) + vcpkg_extract_source_archive(${ARCHIVE} ${CURRENT_BUILDTREES_DIR}/src-${ARCH}-${BUILD_TYPE}) + vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src-${ARCH}-${BUILD_TYPE}/gdal-1.11.3 + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/0001-Add-support-for-MSVC1900-backported-from-GDAL2.patch + ${CMAKE_CURRENT_LIST_DIR}/0002-Add-variable-CXX_CRT_FLAGS-to-allow-for-selection-of.patch + ) +endforeach() + +find_program(NMAKE nmake REQUIRED) + +file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}" NATIVE_PACKAGES_DIR) +file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}/share/gdal" NATIVE_DATA_DIR) +file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}/share/gdal/html" NATIVE_HTML_DIR) + +file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/include" PROJ_INCLUDE_DIR) +file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/lib/proj.lib" PROJ_LIBRARY_REL) +file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/debug/lib/projd.lib" PROJ_LIBRARY_DBG) + +set(NMAKE_OPTIONS + GDAL_HOME=${NATIVE_PACKAGES_DIR} + DATADIR=${NATIVE_DATA_DIR} + HTMLDIR=${NATIVE_HTML_DIR} + PROJ_INCLUDE=-I${PROJ_INCLUDE_DIR} + MSVC_VER=1900 +) + +if(TARGET_TRIPLET MATCHES "x64") + list(APPEND NMAKE_OPTIONS WIN64=YES) +endif() + +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + list(APPEND NMAKE_OPTIONS + PROJ_FLAGS=-DPROJ_STATIC + ) +endif() + +if (VCPKG_CRT_LINKAGE STREQUAL static) + set(LINKAGE_FLAGS "/MT") +else() + set(LINKAGE_FLAGS "/MD") +endif() + +set(NMAKE_OPTIONS_REL + "${NMAKE_OPTIONS}" + CXX_CRT_FLAGS=${LINKAGE_FLAGS} + PROJ_LIBRARY=${PROJ_LIBRARY_REL} +) +set(NMAKE_OPTIONS_DBG + "${NMAKE_OPTIONS}" + CXX_CRT_FLAGS="${LINKAGE_FLAGS}d" + PROJ_LIBRARY=${PROJ_LIBRARY_DBG} + DEBUG=1 +) +################ +# Release build +################ +message(STATUS "Building ${TARGET_TRIPLET}-rel") +vcpkg_execute_required_process( + COMMAND ${NMAKE} -f makefile.vc + "${NMAKE_OPTIONS_REL}" + WORKING_DIRECTORY ${SOURCE_PATH_RELEASE} + LOGNAME nmake-build-${TARGET_TRIPLET}-release +) +message(STATUS "Building ${TARGET_TRIPLET}-rel done") + +################ +# Debug build +################ +message(STATUS "Building ${TARGET_TRIPLET}-dbg") +vcpkg_execute_required_process( + COMMAND ${NMAKE} /G -f makefile.vc + "${NMAKE_OPTIONS_DBG}" + WORKING_DIRECTORY ${SOURCE_PATH_DEBUG} + LOGNAME nmake-build-${TARGET_TRIPLET}-debug +) +message(STATUS "Building ${TARGET_TRIPLET}-dbg done") + +message(STATUS "Packaging ${TARGET_TRIPLET}") +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/gdal/html) + +vcpkg_execute_required_process( + COMMAND ${NMAKE} -f makefile.vc + "${NMAKE_OPTIONS_REL}" + "install" + "devinstall" + WORKING_DIRECTORY ${SOURCE_PATH_RELEASE} + LOGNAME nmake-install-${TARGET_TRIPLET} +) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/gdal_i.lib) + file(COPY ${SOURCE_PATH_DEBUG}/gdal.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + file(COPY ${SOURCE_PATH_RELEASE}/gdal.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) +else() + file(COPY ${SOURCE_PATH_DEBUG}/gdal111.dll DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) + file(COPY ${SOURCE_PATH_DEBUG}/gdal_i.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + file(GLOB EXE_FILES ${CURRENT_PACKAGES_DIR}/bin/*.exe) + file(REMOVE ${EXE_FILES} ${CURRENT_PACKAGES_DIR}/lib/gdal.lib) +endif() +# Handle copyright +file(RENAME ${CURRENT_PACKAGES_DIR}/share/gdal/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/gdal/copyright) + +message(STATUS "Packaging ${TARGET_TRIPLET} done") -- cgit v1.2.3 From 8ee0ec169919dc6c2e0379803a35f135d064dceb Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Mon, 28 Nov 2016 13:01:55 -0800 Subject: fix for uwp builds --- ports/libiconv/0003-Fix-uwp.patch | 25 +++++++++++++++++++++++++ ports/libiconv/CMakeLists.txt | 2 ++ ports/libiconv/portfile.cmake | 1 + 3 files changed, 28 insertions(+) create mode 100644 ports/libiconv/0003-Fix-uwp.patch diff --git a/ports/libiconv/0003-Fix-uwp.patch b/ports/libiconv/0003-Fix-uwp.patch new file mode 100644 index 000000000..0b2444166 --- /dev/null +++ b/ports/libiconv/0003-Fix-uwp.patch @@ -0,0 +1,25 @@ +diff --git a/libcharset/lib/localcharset.c b/libcharset/lib/localcharset.c +index 3aceb42..dadd95a 100644 +--- a/libcharset/lib/localcharset.c ++++ b/libcharset/lib/localcharset.c +@@ -455,7 +455,10 @@ locale_charset (void) + # endif + + #elif defined WIN32_NATIVE +- ++#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) ++ // GetACP() not available to UWP apps ++ codeset = NULL; ++#else + static char buf[2 + 10 + 1]; + + /* Woe32 has a function returning the locale's codepage as a number: +@@ -467,7 +470,7 @@ locale_charset (void) + encoding is the best bet. */ + sprintf (buf, "CP%u", GetACP ()); + codeset = buf; +- ++#endif + #elif defined OS2 + + const char *locale; diff --git a/ports/libiconv/CMakeLists.txt b/ports/libiconv/CMakeLists.txt index 46575ca27..0d2a2a4d3 100644 --- a/ports/libiconv/CMakeLists.txt +++ b/ports/libiconv/CMakeLists.txt @@ -55,6 +55,8 @@ list(APPEND Libiconv_headers ${Libiconv_BINARY_DIR}/localcharset.h) # set(libname libiconv) +add_definitions(-D_CRT_SECURE_NO_WARNINGS) + configure_file( ${Libiconv_SOURCE_DIR}/include/iconv.h.build.in ${Libiconv_BINARY_DIR}/iconv.h diff --git a/ports/libiconv/portfile.cmake b/ports/libiconv/portfile.cmake index cfb96391b..46bd2f9e9 100644 --- a/ports/libiconv/portfile.cmake +++ b/ports/libiconv/portfile.cmake @@ -14,6 +14,7 @@ vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001-Add-export-definitions.patch ${CMAKE_CURRENT_LIST_DIR}/0002-Config-for-MSVC.patch + ${CMAKE_CURRENT_LIST_DIR}/0003-Fix-uwp.patch ) vcpkg_configure_cmake( -- cgit v1.2.3 From 5bd036cf5a70e18c451cc5aa9d041c530bf7adf1 Mon Sep 17 00:00:00 2001 From: Silvio Date: Sun, 27 Nov 2016 17:24:23 +0100 Subject: Add freeimage port Extensive modification have been done to support building with external dependencies. The biggest change is a new CMake-based build system. Several patches are based on the equivalent ones used in Debian packaging, see http://sources.debian.net/patches/freeimage . The only dependency for which the internal version is still used is OpenEXR. --- ports/freeimage/CMakeLists.txt | 148 ++++++++++++++++++ ports/freeimage/CONTROL | 4 + ports/freeimage/FreeImageConfig-dynamic.h | 5 + ports/freeimage/FreeImageConfig-static.h | 8 + ports/freeimage/cmake/FindJXR.cmake | 28 ++++ ports/freeimage/cmake/FindWEBP.cmake | 26 +++ ...pending-on-internal-third-party-libraries.patch | 71 +++++++++ ports/freeimage/portfile.cmake | 54 +++++++ ports/freeimage/use-external-jpeg.patch | 17 ++ ports/freeimage/use-external-jxrlib.patch | 14 ++ ports/freeimage/use-external-libtiff.patch | 174 +++++++++++++++++++++ ports/freeimage/use-external-openjpeg.patch | 39 +++++ ports/freeimage/use-external-png-zlib.patch | 40 +++++ ports/freeimage/use-external-rawlib.patch | 13 ++ ports/freeimage/use-external-webp.patch | 18 +++ ports/freeimage/use-freeimage-config-include.patch | 16 ++ 16 files changed, 675 insertions(+) create mode 100644 ports/freeimage/CMakeLists.txt create mode 100644 ports/freeimage/CONTROL create mode 100644 ports/freeimage/FreeImageConfig-dynamic.h create mode 100644 ports/freeimage/FreeImageConfig-static.h create mode 100644 ports/freeimage/cmake/FindJXR.cmake create mode 100644 ports/freeimage/cmake/FindWEBP.cmake create mode 100644 ports/freeimage/disable-plugins-depending-on-internal-third-party-libraries.patch create mode 100644 ports/freeimage/portfile.cmake create mode 100644 ports/freeimage/use-external-jpeg.patch create mode 100644 ports/freeimage/use-external-jxrlib.patch create mode 100644 ports/freeimage/use-external-libtiff.patch create mode 100644 ports/freeimage/use-external-openjpeg.patch create mode 100644 ports/freeimage/use-external-png-zlib.patch create mode 100644 ports/freeimage/use-external-rawlib.patch create mode 100644 ports/freeimage/use-external-webp.patch create mode 100644 ports/freeimage/use-freeimage-config-include.patch diff --git a/ports/freeimage/CMakeLists.txt b/ports/freeimage/CMakeLists.txt new file mode 100644 index 000000000..80a40b43b --- /dev/null +++ b/ports/freeimage/CMakeLists.txt @@ -0,0 +1,148 @@ +cmake_minimum_required(VERSION 3.4) + +include(GNUInstallDirs) + +project(FreeImage C CXX) + +find_package(zlib REQUIRED) +find_package(PNG REQUIRED) +find_package(JPEG REQUIRED) +find_package(TIFF REQUIRED) +find_package(OPENJPEG REQUIRED) + +# Include some custom Find***.cmake modules +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) + +find_package(WEBP REQUIRED) +find_package(JXR REQUIRED) +find_package(LibRaw REQUIRED) + +option(BUILD_SHARED_LIBS "Build shared libraries" ON) + +set(REAL_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Source) + +# Add a debug postfix +set(CMAKE_DEBUG_POSTFIX "d") + +# For now the internal copy of OpenEXR is used (as a private always static library) +file(GLOB OPENEXR_PRIVATE_HEADERS ${REAL_SOURCE_DIR}/OpenEXR/Half/*.h + ${REAL_SOURCE_DIR}/OpenEXR/Iex/*.h + ${REAL_SOURCE_DIR}/OpenEXR/IexMath/*.h + ${REAL_SOURCE_DIR}/OpenEXR/IlmImf/*.h + ${REAL_SOURCE_DIR}/OpenEXR/IlmThread/*.h + ${REAL_SOURCE_DIR}/OpenEXR/Imath/*.h + ${REAL_SOURCE_DIR}/OpenEXR/*.h) + +file(GLOB OPENEXR_SRCS ${REAL_SOURCE_DIR}/OpenEXR/Half/*.cpp + ${REAL_SOURCE_DIR}/OpenEXR/Iex/*.cpp + ${REAL_SOURCE_DIR}/OpenEXR/IexMath/*.cpp + ${REAL_SOURCE_DIR}/OpenEXR/IlmImf/*.cpp + ${REAL_SOURCE_DIR}/OpenEXR/IlmThread/*.cpp + ${REAL_SOURCE_DIR}/OpenEXR/Imath/*.cpp) + +add_library(FreeImage_Private_OpenEXR STATIC ${OPENEXR_PRIVATE_HEADERS} ${OPENEXR_SRCS}) + +set(FreeImage_Private_OpenEXR_INCLUDE_DIRS ${REAL_SOURCE_DIR}/OpenEXR + ${REAL_SOURCE_DIR}/OpenEXR/Half + ${REAL_SOURCE_DIR}/OpenEXR/Iex + ${REAL_SOURCE_DIR}/OpenEXR/IexMath + ${REAL_SOURCE_DIR}/OpenEXR/IlmImf + ${REAL_SOURCE_DIR}/OpenEXR/IlmThread + ${REAL_SOURCE_DIR}/OpenEXR/Imath) + +target_include_directories(FreeImage_Private_OpenEXR PRIVATE ${FreeImage_Private_OpenEXR_INCLUDE_DIRS} + ${ZLIB_INCLUDE_DIRS}) + +# List the public header files +set(PUBLIC_HEADERS ${REAL_SOURCE_DIR}/FreeImage.h) + +# List the private header files +set(ROOT_PRIVATE_HEADERS ${REAL_SOURCE_DIR}/CacheFile.h + ${REAL_SOURCE_DIR}/FreeImageIO.h + ${REAL_SOURCE_DIR}/MapIntrospector.h + ${REAL_SOURCE_DIR}/Plugin.h + ${REAL_SOURCE_DIR}/Quantizers.h + ${REAL_SOURCE_DIR}/ToneMapping.h + ${REAL_SOURCE_DIR}/Utilities.h + ${REAL_SOURCE_DIR}/DeprecationManager/DeprecationMgr.h) + +file(GLOB FREEIMAGE_PRIVATE_HEADERS ${REAL_SOURCE_DIR}/FreeImage/*.h) +file(GLOB FREEIMAGE_TOOLKIT_PRIVATE_HEADERS ${REAL_SOURCE_DIR}/FreeImageToolkit/*.h) +file(GLOB METADATA_PRIVATE_HEADERS ${REAL_SOURCE_DIR}/Metadata/*.h) + +set(PRIVATE_HEADERS ${ROOT_PRIVATE_HEADERS} + ${FREEIMAGE_PRIVATE_HEADERS} + ${FREEIMAGE_TOOLKIT_PRIVATE_HEADERS} + ${METADATA_PRIVATE_HEADERS}) + +# List the source files +file(GLOB DEPRECATION_SRCS ${REAL_SOURCE_DIR}/DeprecationManager/*.cpp) +file(GLOB FREEIMAGE_TOOLKIT_SRCS ${REAL_SOURCE_DIR}/FreeImageToolkit/*.cpp) +file(GLOB FREEIMAGE_SRCS ${REAL_SOURCE_DIR}/FreeImage/*.cpp) +file(GLOB METADATA_SRCS ${REAL_SOURCE_DIR}/Metadata/*.cpp) + +# The G3 plugin is disabled because it require the private copy of tiff +list(REMOVE_ITEM FREEIMAGE_SRCS ${REAL_SOURCE_DIR}/FreeImage/PluginG3.cpp) + +# The JPEGTransform plugin is disable because it requires a private copy of jpeg +list(REMOVE_ITEM FREEIMAGE_TOOLKIT_SRCS ${REAL_SOURCE_DIR}/FreeImageToolkit/JPEGTransform.cpp) + + +set(SRCS ${DEPRECATION_SRCS} + ${FREEIMAGE_SRCS} + ${FREEIMAGE_TOOLKIT_SRCS} + ${METADATA_SRCS} +) + +# If FreeImage is used as a static library, FREEIMAGE_LIB +# needs to be defined (at the C preprocessor level) to correctly +# define (to nothing instead of _declspec(dllimport) ) the DLL_API macro. +# For this purpouse we include (depending on the BUILD_SHARED_LIBS ) +# the appropriate FreeImageConfig.h . +if(${BUILD_SHARED_LIBS}) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/FreeImageConfig-dynamic.h ${CMAKE_CURRENT_BINARY_DIR}/FreeImageConfig.h) +else() + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/FreeImageConfig-static.h ${CMAKE_CURRENT_BINARY_DIR}/FreeImageConfig.h) +endif() +list(APPEND PUBLIC_HEADERS ${CMAKE_CURRENT_BINARY_DIR}/FreeImageConfig.h) + +add_library(FreeImage ${SRCS} ${PRIVATE_HEADERS} ${PUBLIC_HEADERS}) + +if(${BUILD_SHARED_LIBS}) + target_compile_definitions(FreeImage PRIVATE -DFREEIMAGE_EXPORTS) +else() + target_compile_definitions(FreeImage PRIVATE -DFREEIMAGE_LIB) +endif() + +target_include_directories(FreeImage PRIVATE ${REAL_SOURCE_DIR} + ${ZLIB_INCLUDE_DIRS} + ${JPEG_INCLUDE_DIRS} + ${TIFF_INCLUDE_DIRS} + ${PNG_INCLUDE_DIRS} + ${OPENJPEG_INCLUDE_DIRS} + ${WEBP_INCLUDE_DIRS} + ${JXR_INCLUDE_DIRS} + ${LibRaw_INCLUDE_DIRS} + ${FreeImage_Private_OpenEXR_INCLUDE_DIRS} + ${CMAKE_CURRENT_BINARY_DIR}) + + +target_link_libraries(FreeImage ${ZLIB_LIBRARIES} + ${JPEG_LIBRARIES} + ${TIFF_LIBRARIES} + ${PNG_LIBRARIES} + ${OPENJPEG_LIBRARIES} + ${WEBP_LIBRARIES} + ${JXR_LIBRARIES} + ${LibRaw_LIBRARIES} + FreeImage_Private_OpenEXR) + +target_compile_definitions(FreeImage PRIVATE ${PNG_DEFINITIONS}) + +install(TARGETS FreeImage + COMPONENT runtime + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT lib) + +install(FILES ${PUBLIC_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) \ No newline at end of file diff --git a/ports/freeimage/CONTROL b/ports/freeimage/CONTROL new file mode 100644 index 000000000..961acc4be --- /dev/null +++ b/ports/freeimage/CONTROL @@ -0,0 +1,4 @@ +Source: freeimage +Version: 3.17.0 +Build-Depends: zlib, libpng, libjpeg-turbo, tiff, openjpeg, libwebp, libraw, jxrlib +Description: Support library for graphics image formats diff --git a/ports/freeimage/FreeImageConfig-dynamic.h b/ports/freeimage/FreeImageConfig-dynamic.h new file mode 100644 index 000000000..d87b65b4c --- /dev/null +++ b/ports/freeimage/FreeImageConfig-dynamic.h @@ -0,0 +1,5 @@ +#ifndef FREEIMAGE_CONFIG_H +#define FREEIMAGE_CONFIG_H + + +#endif diff --git a/ports/freeimage/FreeImageConfig-static.h b/ports/freeimage/FreeImageConfig-static.h new file mode 100644 index 000000000..a7e6a3224 --- /dev/null +++ b/ports/freeimage/FreeImageConfig-static.h @@ -0,0 +1,8 @@ +#ifndef FREEIMAGE_CONFIG_H +#define FREEIMAGE_CONFIG_H + +#ifndef +#define FREEIMAGE_LIB +#endif + +#endif diff --git a/ports/freeimage/cmake/FindJXR.cmake b/ports/freeimage/cmake/FindJXR.cmake new file mode 100644 index 000000000..7e4a5d45e --- /dev/null +++ b/ports/freeimage/cmake/FindJXR.cmake @@ -0,0 +1,28 @@ +# - Find JXR +# Find the JXR library +# This module defines +# JXR_INCLUDE_DIRS, where to find jxrlib/JXRGlue.h +# JXR_LIBRARIES, the libraries needed to use JXR +# + +find_path(JXR_INCLUDE_DIRS + NAMES JXRGlue.h + PATH_SUFFIXES jxrlib +) +mark_as_advanced(JXR_INCLUDE_DIRS) + +include(SelectLibraryConfigurations) + +find_library(JPEGXR_LIBRARY_RELEASE NAMES jpegxr PATH_SUFFIXES lib) +find_library(JPEGXR_LIBRARY_DEBUG NAMES jpegxrd PATH_SUFFIXES lib) +select_library_configurations(JPEGXR) + +find_library(JXRGLUE_LIBRARY_RELEASE NAMES jxrglue PATH_SUFFIXES lib) +find_library(JXRGLUE_LIBRARY_DEBUG NAMES jxrglued PATH_SUFFIXES lib) +select_library_configurations(JXRGLUE) + +set(JXR_LIBRARIES ${JPEGXR_LIBRARY} ${JXRGLUE_LIBRARY}) +mark_as_advanced(JXR_LIBRARIES) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(JXR DEFAULT_MSG JXR_INCLUDE_DIRS JXR_LIBRARIES) diff --git a/ports/freeimage/cmake/FindWEBP.cmake b/ports/freeimage/cmake/FindWEBP.cmake new file mode 100644 index 000000000..9b8516e15 --- /dev/null +++ b/ports/freeimage/cmake/FindWEBP.cmake @@ -0,0 +1,26 @@ +# - 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 +# + +find_path(WEBP_INCLUDE_DIRS + NAMES webp/decode.h +) +mark_as_advanced(WEBP_INCLUDE_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) + +set(WEBP_LIBRARIES ${WEBP_LIBRARY}) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(WEBP DEFAULT_MSG WEBP_INCLUDE_DIRS WEBP_LIBRARIES) diff --git a/ports/freeimage/disable-plugins-depending-on-internal-third-party-libraries.patch b/ports/freeimage/disable-plugins-depending-on-internal-third-party-libraries.patch new file mode 100644 index 000000000..28d0e3a42 --- /dev/null +++ b/ports/freeimage/disable-plugins-depending-on-internal-third-party-libraries.patch @@ -0,0 +1,71 @@ +diff --git a/Source/FreeImage.h b/Source/FreeImage.h +index e2d1c5a..cc66b7d 100644 +--- a/Source/FreeImage.h ++++ b/Source/FreeImage.h +@@ -410,7 +410,11 @@ FI_ENUM(FREE_IMAGE_FORMAT) { + FIF_DDS = 24, + FIF_GIF = 25, + FIF_HDR = 26, +- FIF_FAXG3 = 27, ++/* vcpkg: The G3 fax format plugin is deliberately disabled in our build of ++ FreeImage, since it requires usage of the vendored copy of libtiff. */ ++#if 0 ++ FIF_FAXG3 = 27, ++#endif + FIF_SGI = 28, + FIF_EXR = 29, + FIF_J2K = 30, +@@ -476,6 +480,9 @@ FI_ENUM(FREE_IMAGE_DITHER) { + /** Lossless JPEG transformations + Constants used in FreeImage_JPEGTransform + */ ++/* vcpkg: The JPEGTransform functions are deliberately disabled in our build ++ of FreeImage, since they require usage of the vendored copy of libjpeg. */ ++#if 0 + FI_ENUM(FREE_IMAGE_JPEG_OPERATION) { + FIJPEG_OP_NONE = 0, //! no transformation + FIJPEG_OP_FLIP_H = 1, //! horizontal flip +@@ -486,6 +493,7 @@ FI_ENUM(FREE_IMAGE_JPEG_OPERATION) { + FIJPEG_OP_ROTATE_180 = 6, //! 180-degree rotation + FIJPEG_OP_ROTATE_270 = 7 //! 270-degree clockwise (or 90 ccw) + }; ++#endif + + /** Tone mapping operators. + Constants used in FreeImage_ToneMapping. +@@ -1077,6 +1085,9 @@ DLL_API const char* DLL_CALLCONV FreeImage_TagToString(FREE_IMAGE_MDMODEL model, + // JPEG lossless transformation routines + // -------------------------------------------------------------------------- + ++/* vcpkg: The JPEGTransform functions are deliberately disabled in our build ++ of FreeImage, since they require usage of the vendored copy of libjpeg. */ ++#if 0 + DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransform(const char *src_file, const char *dst_file, FREE_IMAGE_JPEG_OPERATION operation, BOOL perfect FI_DEFAULT(TRUE)); + DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransformU(const wchar_t *src_file, const wchar_t *dst_file, FREE_IMAGE_JPEG_OPERATION operation, BOOL perfect FI_DEFAULT(TRUE)); + DLL_API BOOL DLL_CALLCONV FreeImage_JPEGCrop(const char *src_file, const char *dst_file, int left, int top, int right, int bottom); +@@ -1085,7 +1096,7 @@ DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransformFromHandle(FreeImageIO* src_io, + DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransformCombined(const char *src_file, const char *dst_file, FREE_IMAGE_JPEG_OPERATION operation, int* left, int* top, int* right, int* bottom, BOOL perfect FI_DEFAULT(TRUE)); + DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransformCombinedU(const wchar_t *src_file, const wchar_t *dst_file, FREE_IMAGE_JPEG_OPERATION operation, int* left, int* top, int* right, int* bottom, BOOL perfect FI_DEFAULT(TRUE)); + DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransformCombinedFromMemory(FIMEMORY* src_stream, FIMEMORY* dst_stream, FREE_IMAGE_JPEG_OPERATION operation, int* left, int* top, int* right, int* bottom, BOOL perfect FI_DEFAULT(TRUE)); +- ++#endif + + // -------------------------------------------------------------------------- + // Image manipulation toolkit +diff --git a/Source/FreeImage/Plugin.cpp b/Source/FreeImage/Plugin.cpp +index 57ebffd..a93440f 100644 +--- a/Source/FreeImage/Plugin.cpp ++++ b/Source/FreeImage/Plugin.cpp +@@ -263,7 +263,11 @@ FreeImage_Initialise(BOOL load_local_plugins_only) { + s_plugins->AddNode(InitDDS); + s_plugins->AddNode(InitGIF); + s_plugins->AddNode(InitHDR); +- s_plugins->AddNode(InitG3); ++/* vcpkg: The G3 fax format plugin is deliberately disabled in our build of FreeImage +++ since it requires usage of the vendored copy of libtiff. */ ++#if 0 ++ s_plugins->AddNode(InitG3); ++#endif + s_plugins->AddNode(InitSGI); + s_plugins->AddNode(InitEXR); + s_plugins->AddNode(InitJ2K); diff --git a/ports/freeimage/portfile.cmake b/ports/freeimage/portfile.cmake new file mode 100644 index 000000000..4a212ba4b --- /dev/null +++ b/ports/freeimage/portfile.cmake @@ -0,0 +1,54 @@ +include(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/FreeImage) +vcpkg_download_distfile(ARCHIVE + URLS "http://downloads.sourceforge.net/freeimage/FreeImage3170.zip" + FILENAME "FreeImage3170.zip" + SHA512 703c2626c0bcfe73eb40d720f45745208ca9650a7730759680a2b38ad3f6c719a43008477032bc70b76a95761f7d4b6f901b961359d36b54ace906dd78fb391b +) +vcpkg_extract_source_archive(${ARCHIVE}) + + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/FreeImageConfig-static.h DESTINATION ${SOURCE_PATH}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/FreeImageConfig-dynamic.h DESTINATION ${SOURCE_PATH}) + +# Copy some useful Find***.cmake modules +file(COPY ${CMAKE_CURRENT_LIST_DIR}/cmake DESTINATION ${SOURCE_PATH}) + +# This is not strictly necessary, but to make sure +# that no "internal" libraries are used by removing them +# Note that the only "internal" dependency used is OpenEXR +file(REMOVE_RECURSE ${SOURCE_PATH}/Source/LibJPEG) +file(REMOVE_RECURSE ${SOURCE_PATH}/Source/LibPNG) +file(REMOVE_RECURSE ${SOURCE_PATH}/Source/LibTIFF4) +file(REMOVE_RECURSE ${SOURCE_PATH}/Source/ZLib) +file(REMOVE_RECURSE ${SOURCE_PATH}/Source/LibOpenJPEG) +file(REMOVE_RECURSE ${SOURCE_PATH}/Source/LibJXR) +file(REMOVE_RECURSE ${SOURCE_PATH}/Source/LibWebP) +file(REMOVE_RECURSE ${SOURCE_PATH}/Source/LibRawLite) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES "${CMAKE_CURRENT_LIST_DIR}/disable-plugins-depending-on-internal-third-party-libraries.patch" + "${CMAKE_CURRENT_LIST_DIR}/use-external-jpeg.patch" + "${CMAKE_CURRENT_LIST_DIR}/use-external-jxrlib.patch" + "${CMAKE_CURRENT_LIST_DIR}/use-external-libtiff.patch" + "${CMAKE_CURRENT_LIST_DIR}/use-external-openjpeg.patch" + "${CMAKE_CURRENT_LIST_DIR}/use-external-png-zlib.patch" + "${CMAKE_CURRENT_LIST_DIR}/use-external-rawlib.patch" + "${CMAKE_CURRENT_LIST_DIR}/use-external-webp.patch" + "${CMAKE_CURRENT_LIST_DIR}/use-freeimage-config-include.patch" +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# Handle copyright +file(COPY ${SOURCE_PATH}/license-fi.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/freeimage) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/freeimage/license-fi.txt ${CURRENT_PACKAGES_DIR}/share/freeimage/copyright) diff --git a/ports/freeimage/use-external-jpeg.patch b/ports/freeimage/use-external-jpeg.patch new file mode 100644 index 000000000..2df2c9d2d --- /dev/null +++ b/ports/freeimage/use-external-jpeg.patch @@ -0,0 +1,17 @@ +diff --git a/Source/FreeImage/PluginJPEG.cpp b/Source/FreeImage/PluginJPEG.cpp +index 573989c..aaeefa4 100644 +--- a/Source/FreeImage/PluginJPEG.cpp ++++ b/Source/FreeImage/PluginJPEG.cpp +@@ -35,9 +35,9 @@ extern "C" { + #undef FAR + #include + +-#include "../LibJPEG/jinclude.h" +-#include "../LibJPEG/jpeglib.h" +-#include "../LibJPEG/jerror.h" ++#include ++#include ++#include + } + + #include "FreeImage.h" diff --git a/ports/freeimage/use-external-jxrlib.patch b/ports/freeimage/use-external-jxrlib.patch new file mode 100644 index 000000000..d86a18e82 --- /dev/null +++ b/ports/freeimage/use-external-jxrlib.patch @@ -0,0 +1,14 @@ +diff --git a/Source/FreeImage/PluginJXR.cpp b/Source/FreeImage/PluginJXR.cpp +index 0e14e09..8eb9d5d 100644 +--- a/Source/FreeImage/PluginJXR.cpp ++++ b/Source/FreeImage/PluginJXR.cpp +@@ -23,7 +23,8 @@ + #include "Utilities.h" + #include "../Metadata/FreeImageTag.h" + +-#include "../LibJXR/jxrgluelib/JXRGlue.h" ++#define INITGUID ++#include + + // ========================================================== + // Plugin Interface diff --git a/ports/freeimage/use-external-libtiff.patch b/ports/freeimage/use-external-libtiff.patch new file mode 100644 index 000000000..f2ddd9ba6 --- /dev/null +++ b/ports/freeimage/use-external-libtiff.patch @@ -0,0 +1,174 @@ +diff --git a/Source/FreeImage/PluginTIFF.cpp b/Source/FreeImage/PluginTIFF.cpp +index 1b45453..562fdd7 100644 +--- a/Source/FreeImage/PluginTIFF.cpp ++++ b/Source/FreeImage/PluginTIFF.cpp +@@ -37,7 +37,7 @@ + + #include "FreeImage.h" + #include "Utilities.h" +-#include "../LibTIFF4/tiffiop.h" ++#include + #include "../Metadata/FreeImageTag.h" + #include "../OpenEXR/Half/half.h" + +diff --git a/Source/Metadata/XTIFF.cpp b/Source/Metadata/XTIFF.cpp +index d5be902..8dbcd5d 100644 +--- a/Source/Metadata/XTIFF.cpp ++++ b/Source/Metadata/XTIFF.cpp +@@ -29,7 +29,7 @@ + #pragma warning (disable : 4786) // identifier was truncated to 'number' characters + #endif + +-#include "../LibTIFF4/tiffiop.h" ++#include + + #include "FreeImage.h" + #include "Utilities.h" +@@ -40,6 +40,43 @@ + // Extended TIFF Directory GEO Tag Support + // ---------------------------------------------------------- + ++// vcpkg: function imported from libtiff/tif_dirinfo.c, in which it is not exported ++/* ++ * Return size of TIFFDataType in bytes. ++ * ++ * XXX: We need a separate function to determine the space needed ++ * to store the value. For TIFF_RATIONAL values TIFFDataWidth() returns 8, ++ * but we use 4-byte float to represent rationals. ++ */ ++int ++FreeImage_TIFFDataSize(TIFFDataType type) ++{ ++ switch (type) ++ { ++ case TIFF_BYTE: ++ case TIFF_SBYTE: ++ case TIFF_ASCII: ++ case TIFF_UNDEFINED: ++ return 1; ++ case TIFF_SHORT: ++ case TIFF_SSHORT: ++ return 2; ++ case TIFF_LONG: ++ case TIFF_SLONG: ++ case TIFF_FLOAT: ++ case TIFF_IFD: ++ case TIFF_RATIONAL: ++ case TIFF_SRATIONAL: ++ return 4; ++ case TIFF_DOUBLE: ++ case TIFF_LONG8: ++ case TIFF_SLONG8: ++ case TIFF_IFD8: ++ return 8; ++ default: ++ return 0; ++ } ++} + /** + Tiff info structure. + Entry format: +@@ -224,6 +261,33 @@ tiff_write_geotiff_profile(TIFF *tif, FIBITMAP *dib) { + // TIFF EXIF tag reading & writing + // ---------------------------------------------------------- + ++static uint32 exif_tag_ids[] = { ++ EXIFTAG_EXPOSURETIME, EXIFTAG_FNUMBER, EXIFTAG_EXPOSUREPROGRAM, ++ EXIFTAG_SPECTRALSENSITIVITY, EXIFTAG_ISOSPEEDRATINGS, EXIFTAG_OECF, ++ EXIFTAG_EXIFVERSION, EXIFTAG_DATETIMEORIGINAL, EXIFTAG_DATETIMEDIGITIZED, ++ EXIFTAG_COMPONENTSCONFIGURATION, EXIFTAG_COMPRESSEDBITSPERPIXEL, ++ EXIFTAG_SHUTTERSPEEDVALUE, EXIFTAG_APERTUREVALUE, ++ EXIFTAG_BRIGHTNESSVALUE, EXIFTAG_EXPOSUREBIASVALUE, ++ EXIFTAG_MAXAPERTUREVALUE, EXIFTAG_SUBJECTDISTANCE, EXIFTAG_METERINGMODE, ++ EXIFTAG_LIGHTSOURCE, EXIFTAG_FLASH, EXIFTAG_FOCALLENGTH, ++ EXIFTAG_SUBJECTAREA, EXIFTAG_MAKERNOTE, EXIFTAG_USERCOMMENT, ++ EXIFTAG_SUBSECTIME, EXIFTAG_SUBSECTIMEORIGINAL, ++ EXIFTAG_SUBSECTIMEDIGITIZED, EXIFTAG_FLASHPIXVERSION, EXIFTAG_COLORSPACE, ++ EXIFTAG_PIXELXDIMENSION, EXIFTAG_PIXELYDIMENSION, ++ EXIFTAG_RELATEDSOUNDFILE, EXIFTAG_FLASHENERGY, ++ EXIFTAG_SPATIALFREQUENCYRESPONSE, EXIFTAG_FOCALPLANEXRESOLUTION, ++ EXIFTAG_FOCALPLANEYRESOLUTION, EXIFTAG_FOCALPLANERESOLUTIONUNIT, ++ EXIFTAG_SUBJECTLOCATION, EXIFTAG_EXPOSUREINDEX, EXIFTAG_SENSINGMETHOD, ++ EXIFTAG_FILESOURCE, EXIFTAG_SCENETYPE, EXIFTAG_CFAPATTERN, ++ EXIFTAG_CUSTOMRENDERED, EXIFTAG_EXPOSUREMODE, EXIFTAG_WHITEBALANCE, ++ EXIFTAG_DIGITALZOOMRATIO, EXIFTAG_FOCALLENGTHIN35MMFILM, ++ EXIFTAG_SCENECAPTURETYPE, EXIFTAG_GAINCONTROL, EXIFTAG_CONTRAST, ++ EXIFTAG_SATURATION, EXIFTAG_SHARPNESS, EXIFTAG_DEVICESETTINGDESCRIPTION, ++ EXIFTAG_SUBJECTDISTANCERANGE, EXIFTAG_GAINCONTROL, EXIFTAG_GAINCONTROL, ++ EXIFTAG_IMAGEUNIQUEID ++}; ++static int nExifTags = sizeof(exif_tag_ids) / sizeof(exif_tag_ids[0]); ++ + /** + Read a single Exif tag + +@@ -575,43 +639,10 @@ tiff_read_exif_tags(TIFF *tif, TagLib::MDMODEL md_model, FIBITMAP *dib) { + + // loop over all Core Directory Tags + // ### uses private data, but there is no other way ++ // -> vcpkg: Best we can do without private headers is to hard-code a list of known EXIF tags and read those + if(md_model == TagLib::EXIF_MAIN) { +- const TIFFDirectory *td = &tif->tif_dir; +- +- uint32 lastTag = 0; //<- used to prevent reading some tags twice (as stored in tif_fieldinfo) +- +- for (int fi = 0, nfi = (int)tif->tif_nfields; nfi > 0; nfi--, fi++) { +- const TIFFField *fld = tif->tif_fields[fi]; +- +- const uint32 tag_id = TIFFFieldTag(fld); +- +- if(tag_id == lastTag) { +- continue; +- } +- +- // test if tag value is set +- // (lifted directly from LibTiff _TIFFWriteDirectory) +- +- if( fld->field_bit == FIELD_CUSTOM ) { +- int is_set = FALSE; +- +- for(int ci = 0; ci < td->td_customValueCount; ci++ ) { +- is_set |= (td->td_customValues[ci].info == fld); +- } +- +- if( !is_set ) { +- continue; +- } +- +- } else if(!TIFFFieldSet(tif, fld->field_bit)) { +- continue; +- } +- +- // process *all* other tags (some will be ignored) +- +- tiff_read_exif_tag(tif, tag_id, dib, md_model); +- +- lastTag = tag_id; ++ for (int i = 0; i < nExifTags; ++i) { ++ tiff_read_exif_tag(tif, exif_tag_ids[i], dib, md_model); + } + + } +@@ -723,10 +754,9 @@ tiff_write_exif_tags(TIFF *tif, TagLib::MDMODEL md_model, FIBITMAP *dib) { + + TagLib& tag_lib = TagLib::instance(); + +- for (int fi = 0, nfi = (int)tif->tif_nfields; nfi > 0; nfi--, fi++) { +- const TIFFField *fld = tif->tif_fields[fi]; +- +- const uint32 tag_id = TIFFFieldTag(fld); ++ for (int fi = 0, nfi = nExifTags; nfi > 0; nfi--, fi++) { ++ const uint32 tag_id = exif_tag_ids[fi]; ++ const TIFFField *fld = TIFFFieldWithTag(tif, tag_id); + + if(skip_write_field(tif, tag_id)) { + // skip tags that are already handled by the LibTIFF writing process +@@ -749,7 +779,7 @@ tiff_write_exif_tags(TIFF *tif, TagLib::MDMODEL md_model, FIBITMAP *dib) { + continue; + } + // type of storage may differ (e.g. rationnal array vs float array type) +- if((unsigned)_TIFFDataSize(tif_tag_type) != FreeImage_TagDataWidth(tag_type)) { ++ if((unsigned)FreeImage_TIFFDataSize(tif_tag_type) != FreeImage_TagDataWidth(tag_type)) { + // skip tag or _TIFFmemcpy will fail + continue; + } diff --git a/ports/freeimage/use-external-openjpeg.patch b/ports/freeimage/use-external-openjpeg.patch new file mode 100644 index 000000000..fa4f8e7b6 --- /dev/null +++ b/ports/freeimage/use-external-openjpeg.patch @@ -0,0 +1,39 @@ +diff --git a/Source/FreeImage/J2KHelper.cpp b/Source/FreeImage/J2KHelper.cpp +index 1776c3b..538f1c5 100644 +--- a/Source/FreeImage/J2KHelper.cpp ++++ b/Source/FreeImage/J2KHelper.cpp +@@ -21,7 +21,7 @@ + + #include "FreeImage.h" + #include "Utilities.h" +-#include "../LibOpenJPEG/openjpeg.h" ++#include + #include "J2KHelper.h" + + // -------------------------------------------------------------------------- +diff --git a/Source/FreeImage/PluginJ2K.cpp b/Source/FreeImage/PluginJ2K.cpp +index b8bcfc8..621a903 100644 +--- a/Source/FreeImage/PluginJ2K.cpp ++++ b/Source/FreeImage/PluginJ2K.cpp +@@ -21,7 +21,7 @@ + + #include "FreeImage.h" + #include "Utilities.h" +-#include "../LibOpenJPEG/openjpeg.h" ++#include + #include "J2KHelper.h" + + // ========================================================== +diff --git a/Source/FreeImage/PluginJP2.cpp b/Source/FreeImage/PluginJP2.cpp +index 742fe2c..c57f626 100644 +--- a/Source/FreeImage/PluginJP2.cpp ++++ b/Source/FreeImage/PluginJP2.cpp +@@ -21,7 +21,7 @@ + + #include "FreeImage.h" + #include "Utilities.h" +-#include "../LibOpenJPEG/openjpeg.h" ++#include + #include "J2KHelper.h" + + // ========================================================== diff --git a/ports/freeimage/use-external-png-zlib.patch b/ports/freeimage/use-external-png-zlib.patch new file mode 100644 index 000000000..fc7837e43 --- /dev/null +++ b/ports/freeimage/use-external-png-zlib.patch @@ -0,0 +1,40 @@ +diff --git a/Source/FreeImage/PluginPNG.cpp b/Source/FreeImage/PluginPNG.cpp +index ba2ef17..c3c5cd6 100644 +--- a/Source/FreeImage/PluginPNG.cpp ++++ b/Source/FreeImage/PluginPNG.cpp +@@ -40,8 +40,8 @@ + + // ---------------------------------------------------------- + +-#include "../ZLib/zlib.h" +-#include "../LibPNG/png.h" ++#include ++#include + + // ---------------------------------------------------------- + +diff --git a/Source/FreeImage/ZLibInterface.cpp b/Source/FreeImage/ZLibInterface.cpp +index 3ab6d32..725618b 100644 +--- a/Source/FreeImage/ZLibInterface.cpp ++++ b/Source/FreeImage/ZLibInterface.cpp +@@ -19,10 +19,9 @@ + // Use at your own risk! + // ========================================================== + +-#include "../ZLib/zlib.h" ++#include + #include "FreeImage.h" + #include "Utilities.h" +-#include "../ZLib/zutil.h" /* must be the last header because of error C3163 in VS2008 (_vsnprintf defined in stdio.h) */ + + /** + Compresses a source buffer into a target buffer, using the ZLib library. +@@ -115,7 +114,7 @@ FreeImage_ZLibGZip(BYTE *target, DWORD target_size, BYTE *source, DWORD source_s + return 0; + case Z_OK: { + // patch header, setup crc and length (stolen from mod_trace_output) +- BYTE *p = target + 8; *p++ = 2; *p = OS_CODE; // xflags, os_code ++ BYTE *p = target + 8; *p++ = 2; *p = 0x03; // xflags, os_code + crc = crc32(crc, source, source_size); + memcpy(target + 4 + dest_len, &crc, 4); + memcpy(target + 8 + dest_len, &source_size, 4); diff --git a/ports/freeimage/use-external-rawlib.patch b/ports/freeimage/use-external-rawlib.patch new file mode 100644 index 000000000..6afa0bffa --- /dev/null +++ b/ports/freeimage/use-external-rawlib.patch @@ -0,0 +1,13 @@ +diff --git a/Source/FreeImage/PluginRAW.cpp b/Source/FreeImage/PluginRAW.cpp +index e9bd5bf..c7f8758 100644 +--- a/Source/FreeImage/PluginRAW.cpp ++++ b/Source/FreeImage/PluginRAW.cpp +@@ -19,7 +19,7 @@ + // Use at your own risk! + // ========================================================== + +-#include "../LibRawLite/libraw/libraw.h" ++#include + + #include "FreeImage.h" + #include "Utilities.h" diff --git a/ports/freeimage/use-external-webp.patch b/ports/freeimage/use-external-webp.patch new file mode 100644 index 000000000..ae6328431 --- /dev/null +++ b/ports/freeimage/use-external-webp.patch @@ -0,0 +1,18 @@ +diff --git a/Source/FreeImage/PluginWebP.cpp b/Source/FreeImage/PluginWebP.cpp +index 9fb0b69..c401447 100644 +--- a/Source/FreeImage/PluginWebP.cpp ++++ b/Source/FreeImage/PluginWebP.cpp +@@ -24,10 +24,9 @@ + + #include "../Metadata/FreeImageTag.h" + +-#include "../LibWebP/src/webp/decode.h" +-#include "../LibWebP/src/webp/encode.h" +-#include "../LibWebP/src/enc/vp8enci.h" +-#include "../LibWebP/src/webp/mux.h" ++#include ++#include ++#include + + // ========================================================== + // Plugin Interface diff --git a/ports/freeimage/use-freeimage-config-include.patch b/ports/freeimage/use-freeimage-config-include.patch new file mode 100644 index 000000000..4927aff5b --- /dev/null +++ b/ports/freeimage/use-freeimage-config-include.patch @@ -0,0 +1,16 @@ +diff --git a/Source/FreeImage.h b/Source/FreeImage.h +index cc66b7d..cc66812 100644 +--- a/Source/FreeImage.h ++++ b/Source/FreeImage.h +@@ -32,6 +32,11 @@ + #define FREEIMAGE_MINOR_VERSION 17 + #define FREEIMAGE_RELEASE_SERIAL 0 + ++// vcpkg specific includes -------------------------------------------------- ++// Include FreeImageConfig.h to define FREEIMAGE_LIB in static builds, ++// or do not define it in dynamic builds ++#include "FreeImageConfig.h" ++ + // Compiler options --------------------------------------------------------- + + #include // needed for UNICODE functions -- cgit v1.2.3 From d933562a584a9acb47dde9ba7e41f0128cb8763b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 28 Nov 2016 17:17:28 -0800 Subject: Move PYTHON2 "acquisition" to vcpkg_find_acquire_program --- ports/libuv/portfile.cmake | 32 ++------------------------ scripts/cmake/vcpkg_find_acquire_program.cmake | 22 ++++++++++++++++++ 2 files changed, 24 insertions(+), 30 deletions(-) diff --git a/ports/libuv/portfile.cmake b/ports/libuv/portfile.cmake index f71ba9f88..173d3bcdc 100644 --- a/ports/libuv/portfile.cmake +++ b/ports/libuv/portfile.cmake @@ -16,38 +16,10 @@ if(NOT EXISTS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-src) ) endif() -find_program(PYTHON2 - NAMES python2 python - PATHS C:/python27 ENV PYTHON -) -if(NOT PYTHON2 MATCHES "NOTFOUND") - execute_process( - COMMAND ${PYTHON2} --version - OUTPUT_VARIABLE PYTHON_VER_CHECK_OUT - ERROR_VARIABLE PYTHON_VER_CHECK_ERR - ) - set(PYTHON_VER_CHECK "${PYTHON_VER_CHECK_OUT}${PYTHON_VER_CHECK_ERR}") - debug_message("PYTHON_VER_CHECK=${PYTHON_VER_CHECK}") - if(NOT PYTHON_VER_CHECK MATCHES "Python 2.7") - set(PYTHON2 PYTHON2-NOTFOUND) - find_program(PYTHON2 - NAMES python2 python - PATHS C:/python27 ENV PYTHON - NO_SYSTEM_ENVIRONMENT_PATH - ) - endif() -endif() - -if(PYTHON2 MATCHES "NOTFOUND") - message(FATAL_ERROR "libuv uses the GYP build system, which requires Python 2.7.\n" - "Python 2.7 was not found in the path or by searching inside C:\\Python27.\n" - "There is no portable redistributable for Python 2.7, so you will need to install the MSI located at:\n" - " https://www.python.org/ftp/python/2.7.11/python-2.7.11.amd64.msi\n" - ) -endif() +vcpkg_find_acquire_program(PYTHON2) -set(ENV{GYP_MSVS_VERSION} 2015) set(ENV{PYTHON} ${PYTHON2}) +set(ENV{GYP_MSVS_VERSION} 2015) if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) set(LIBUV_LINKAGE shared) diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 633721f0e..b192bc5d7 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -30,6 +30,28 @@ function(vcpkg_find_acquire_program VAR) set(URL "https://www.python.org/ftp/python/3.5.2/python-3.5.2-embed-amd64.zip") set(ARCHIVE "python-3.5.2-embed-amd64.zip") set(HASH 48bdcb6f94c993acad6782ee33ad4a07a0ea3b9b1bfcdeadf446d459a9224336837e2e7b518d54d8d99c5c3f4e9f8877ea1789cae513fa2eda2a3cad9e4dfd8f) + elseif(VAR MATCHES "PYTHON2") + find_program(PYTHON2 NAMES python2 python PATHS C:/python27 ENV PYTHON) + if(NOT PYTHON2 MATCHES "NOTFOUND") + execute_process( + COMMAND ${PYTHON2} --version + OUTPUT_VARIABLE PYTHON_VER_CHECK_OUT + ERROR_VARIABLE PYTHON_VER_CHECK_ERR + ) + set(PYTHON_VER_CHECK "${PYTHON_VER_CHECK_OUT}${PYTHON_VER_CHECK_ERR}") + debug_message("PYTHON_VER_CHECK=${PYTHON_VER_CHECK}") + if(NOT PYTHON_VER_CHECK MATCHES "Python 2.7") + set(PYTHON2 PYTHON2-NOTFOUND) + find_program(PYTHON2 NAMES python2 python PATHS C:/python27 ENV PYTHON NO_SYSTEM_ENVIRONMENT_PATH) + endif() + endif() + if(PYTHON2 MATCHES "NOTFOUND") + message(FATAL_ERROR "libuv uses the GYP build system, which requires Python 2.7.\n" + "Python 2.7 was not found in the path or by searching inside C:\\Python27.\n" + "There is no portable redistributable for Python 2.7, so you will need to install the MSI located at:\n" + " https://www.python.org/ftp/python/2.7.11/python-2.7.11.amd64.msi\n" + ) + endif() elseif(VAR MATCHES "JOM") set(PROGNAME jom) set(PATHS ${DOWNLOADS}/tools/jom) -- cgit v1.2.3 From 0f5a833b81529362b290b2b62fe81ce07b98e766 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 28 Nov 2016 18:07:42 -0800 Subject: [vcpkg portsdiff] Add check that commit id exists --- toolsrc/src/commands_portsdiff.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/toolsrc/src/commands_portsdiff.cpp b/toolsrc/src/commands_portsdiff.cpp index 3789e3b42..b6b604e54 100644 --- a/toolsrc/src/commands_portsdiff.cpp +++ b/toolsrc/src/commands_portsdiff.cpp @@ -8,6 +8,7 @@ #include #include "Paragraphs.h" #include "SourceParagraph.h" +#include "vcpkg_Environment.h" namespace vcpkg { @@ -87,14 +88,28 @@ namespace vcpkg return names_and_versions; } + static void check_commit_exists(const std::wstring& git_commit_id) + { + static const std::string VALID_COMMIT_OUTPUT = "commit\n"; + + const std::wstring cmd = Strings::wformat(LR"(git cat-file -t %s 2>NUL)", git_commit_id); + const System::exit_code_and_output output = System::cmd_execute_and_capture_output(cmd); + 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) { static const std::string example = Strings::format("The argument should be a branch/tag/hash to checkout.\n%s", create_example_string("portsdiff mybranchname")); args.check_min_arg_count(1, example.c_str()); args.check_max_arg_count(2, example.c_str()); + + Environment::ensure_git_on_path(paths); const std::wstring git_commit_id_for_previous_snapshot = Strings::utf8_to_utf16(args.command_arguments.at(0)); const std::wstring git_commit_id_for_current_snapshot = args.command_arguments.size() < 2 ? L"HEAD" : Strings::utf8_to_utf16(args.command_arguments.at(1)); + check_commit_exists(git_commit_id_for_current_snapshot); + check_commit_exists(git_commit_id_for_previous_snapshot); + const std::map current_names_and_versions = read_ports_from_commit(paths, git_commit_id_for_current_snapshot); const std::map previous_names_and_versions = read_ports_from_commit(paths, git_commit_id_for_previous_snapshot); -- cgit v1.2.3 From 568f742f86c6cb99d56306d34bfc09630e1208da Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 28 Nov 2016 18:15:02 -0800 Subject: Update CHANGELOG and bump version to v0.0.61 --- CHANGELOG.md | 28 +++++++++++++++++++++++++++- toolsrc/VERSION.txt | 2 +- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1ad55b0d..f4e056cdc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,29 @@ +vcpkg (0.0.61) +-------------- + * Add ports: + - cairo 1.14.6 + - clockutils 1.1.1 + - directxtk oct2016-1 + - directxtk12 oct2016 + - glslang 1c573fbcfba6b3d631008b1babc838501ca925d3 + - libodb-pgsql 2.4.0 + - pixman 0.34.0 + - proj 4.9.3 + - zstd 1.1.1 + * Update ports: + - chakracore 1.3.0 -> 1.3.1 + - curl 7.51.0 -> 7.51.0-1 + - dxut 11.14 -> 11.14-2 + - fmt 3.0.1 -> 3.0.1-1 + - freetype 2.6.3-1 -> 2.6.3-2 + - rxcpp 2.3.0 -> 3.0.0 + - think-cell-range 1d785d9 -> e2d3018 + - tiff 4.0.6 -> 4.0.6-1 + * Fixes and improvements in existing portfiles and the `vcpkg` tool itself + +-- vcpkg team MON, 28 Nov 2016 18:30:00 -0800 + + vcpkg (0.0.60) -------------- * Add ports: @@ -153,7 +179,7 @@ vcpkg (0.0.40) * Add mirror support * `vcpkg` now checks for valid package names: only ASCII lowercase chars, digits, or dashes are allowed * `vcpkg create` now also creates a templated CONTROL file - * `vcpkg create` now checks for invalid chars in the zip path + * `vcpkg create` now checks for invalid chars in the zip path * `vcpkg edit` now throws an error if it cannot launch an editor * Fix `vcpkg integrate` to only apply to C++ projects instead of all projects * Fix `vcpkg integrate` locale-specific failures diff --git a/toolsrc/VERSION.txt b/toolsrc/VERSION.txt index 19b2518b7..7d83b8c7b 100644 --- a/toolsrc/VERSION.txt +++ b/toolsrc/VERSION.txt @@ -1 +1 @@ -"0.0.60" \ No newline at end of file +"0.0.61" \ No newline at end of file -- cgit v1.2.3 From a4b593ac627ef9a47a95277a05ed22083ddca955 Mon Sep 17 00:00:00 2001 From: sdcb Date: Tue, 29 Nov 2016 10:32:38 +0800 Subject: [aws-sdk] drop static block because aws-sdk actually works in static builds. --- ports/aws-sdk-cpp/portfile.cmake | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ports/aws-sdk-cpp/portfile.cmake b/ports/aws-sdk-cpp/portfile.cmake index 7912f8b11..6a72cda14 100644 --- a/ports/aws-sdk-cpp/portfile.cmake +++ b/ports/aws-sdk-cpp/portfile.cmake @@ -1,8 +1,3 @@ -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(STATUS "Warning: Static building not supported yet. Building dynamic.") - set(VCPKG_LIBRARY_LINKAGE dynamic) -endif() - include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/aws-sdk-cpp-1.0.34) vcpkg_download_distfile(ARCHIVE -- cgit v1.2.3 From 865faa40172be0d61166bac87eadc43517463f0b Mon Sep 17 00:00:00 2001 From: sdcb Date: Tue, 29 Nov 2016 11:04:32 +0800 Subject: [aws-sdk] issues occurs in static build, revert code. --- ports/aws-sdk-cpp/portfile.cmake | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/ports/aws-sdk-cpp/portfile.cmake b/ports/aws-sdk-cpp/portfile.cmake index 6a72cda14..16ba1916c 100644 --- a/ports/aws-sdk-cpp/portfile.cmake +++ b/ports/aws-sdk-cpp/portfile.cmake @@ -1,3 +1,8 @@ +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(STATUS "Warning: Static building not supported yet. Building dynamic.") #Blocked by CRT MD link issue. + set(VCPKG_LIBRARY_LINKAGE dynamic) +endif() + include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/aws-sdk-cpp-1.0.34) vcpkg_download_distfile(ARCHIVE @@ -28,11 +33,13 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/nuget ${CURRENT_PACKAGES_DIR}/debug/nuget) -file(GLOB LIB_FILES ${CURRENT_PACKAGES_DIR}/bin/*.lib) -file(GLOB DEBUG_LIB_FILES ${CURRENT_PACKAGES_DIR}/debug/bin/*.lib) -file(COPY ${LIB_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/lib) -file(COPY ${DEBUG_LIB_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) -file(REMOVE ${LIB_FILES} ${DEBUG_LIB_FILES}) +if(${VCPKG_LIBRARY_LINKAGE} STREQUAL dynamic) + file(GLOB LIB_FILES ${CURRENT_PACKAGES_DIR}/bin/*.lib) + file(GLOB DEBUG_LIB_FILES ${CURRENT_PACKAGES_DIR}/debug/bin/*.lib) + file(COPY ${LIB_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + file(COPY ${DEBUG_LIB_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + file(REMOVE ${LIB_FILES} ${DEBUG_LIB_FILES}) +endif() # Handle copyright file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/aws-sdk-cpp RENAME copyright) \ No newline at end of file -- cgit v1.2.3 From 394d3fd1574085b67ede4f486c845fa66a7a2a16 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Tue, 29 Nov 2016 09:52:06 +0100 Subject: [freeimage] Add vcpkg_copy_pdbs() --- ports/freeimage/portfile.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/freeimage/portfile.cmake b/ports/freeimage/portfile.cmake index 4a212ba4b..3e403f9ea 100644 --- a/ports/freeimage/portfile.cmake +++ b/ports/freeimage/portfile.cmake @@ -52,3 +52,5 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright file(COPY ${SOURCE_PATH}/license-fi.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/freeimage) file(RENAME ${CURRENT_PACKAGES_DIR}/share/freeimage/license-fi.txt ${CURRENT_PACKAGES_DIR}/share/freeimage/copyright) + +vcpkg_copy_pdbs() -- cgit v1.2.3 From 537bded431bb850344ba0790630ddbc5fd9ef2ec Mon Sep 17 00:00:00 2001 From: Mattias Cibien Date: Tue, 29 Nov 2016 10:42:02 +0100 Subject: Initial anax port --- ports/anax/CONTROL | 3 +++ ports/anax/portfile.cmake | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 ports/anax/CONTROL create mode 100644 ports/anax/portfile.cmake diff --git a/ports/anax/CONTROL b/ports/anax/CONTROL new file mode 100644 index 000000000..f6d285b4c --- /dev/null +++ b/ports/anax/CONTROL @@ -0,0 +1,3 @@ +Source: anax +Version: 2.1.0 +Description: An open source C++ entity system. diff --git a/ports/anax/portfile.cmake b/ports/anax/portfile.cmake new file mode 100644 index 000000000..845643992 --- /dev/null +++ b/ports/anax/portfile.cmake @@ -0,0 +1,41 @@ +# 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/anax-2.1.0) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/miguelmartin75/anax/archive/v2.1.0.zip" + FILENAME "anax-2.1.0.zip" + SHA512 89f2df64add676ab48a19953b95d8eae1da9c8c5f3c0f6bc757a3bc99af6e4360c56c12d27d12c672ccd754b1f53a5e271533b381641f20e8cf3ca8ddda6cd1a +) +vcpkg_extract_source_archive(${ARCHIVE}) + +if (VCPKG_CRT_LINKAGE STREQUAL dynamic) + SET(SHARED_FLAG ON) +else() + SET(SHARED_FLAG OFF) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DBUILD_SHARED_LIBS=${SHARED_FLAG} +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/anax) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/anax/LICENSE ${CURRENT_PACKAGES_DIR}/share/anax/copyright) -- cgit v1.2.3 From c6fe22929cc5c152677efede93b9f42778afa7b6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 29 Nov 2016 02:33:07 -0800 Subject: [anax] BUILD_SHARED_LIBS is automatically set by vcpkg --- ports/anax/portfile.cmake | 8 -------- 1 file changed, 8 deletions(-) diff --git a/ports/anax/portfile.cmake b/ports/anax/portfile.cmake index 845643992..ae22332cf 100644 --- a/ports/anax/portfile.cmake +++ b/ports/anax/portfile.cmake @@ -20,16 +20,8 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) -if (VCPKG_CRT_LINKAGE STREQUAL dynamic) - SET(SHARED_FLAG ON) -else() - SET(SHARED_FLAG OFF) -endif() - vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} - OPTIONS - -DBUILD_SHARED_LIBS=${SHARED_FLAG} ) vcpkg_install_cmake() -- cgit v1.2.3 From fa32afc372d42ebc120f4c20ab1e270eeea08ab8 Mon Sep 17 00:00:00 2001 From: Mattias Cibien Date: Tue, 29 Nov 2016 12:42:34 +0100 Subject: Add entityx --- ports/entityx/CONTROL | 3 +++ ports/entityx/portfile.cmake | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 ports/entityx/CONTROL create mode 100644 ports/entityx/portfile.cmake diff --git a/ports/entityx/CONTROL b/ports/entityx/CONTROL new file mode 100644 index 000000000..f6dab245a --- /dev/null +++ b/ports/entityx/CONTROL @@ -0,0 +1,3 @@ +Source: entityx +Version: +Description: diff --git a/ports/entityx/portfile.cmake b/ports/entityx/portfile.cmake new file mode 100644 index 000000000..d7bcdbe1b --- /dev/null +++ b/ports/entityx/portfile.cmake @@ -0,0 +1,44 @@ +# 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/entityx-1.2.0) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/alecthomas/entityx/archive/1.2.0.zip" + FILENAME "entityx-1.2.0.zip" + SHA512 4d7009f0412fbccd7bee72713d53424c3b4fa39da62b87729dd84a710a059db27e65ca27b927285c82af09997caea125d85571824133d9b71b4e3c4eebd9917c +) +vcpkg_extract_source_archive(${ARCHIVE}) + +if (VCPKG_CRT_LINKAGE STREQUAL dynamic) + SET(SHARED_FLAG ON) +else() + SET(SHARED_FLAG OFF) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + # OPTIONS_RELEASE -DOPTIMIZE=1 + # OPTIONS_DEBUG -DDEBUGGABLE=1 + -DENTITYX_BUILD_SHARED=${SHARED_FLAG} + -DENTITYX_BUILD_TESTING=false +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# Handle copyright +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/entityx) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/entityx/COPYING ${CURRENT_PACKAGES_DIR}/share/entityx/copyright) -- cgit v1.2.3 From e55e05dcb31820b8b578c7ff87d94cca30916a14 Mon Sep 17 00:00:00 2001 From: Mattias Cibien Date: Tue, 29 Nov 2016 12:46:57 +0100 Subject: Added missing control info --- ports/entityx/CONTROL | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/entityx/CONTROL b/ports/entityx/CONTROL index f6dab245a..f522fe702 100644 --- a/ports/entityx/CONTROL +++ b/ports/entityx/CONTROL @@ -1,3 +1,3 @@ Source: entityx -Version: -Description: +Version: 1.2.0 +Description: EntityX - A fast, type-safe C++ Entity-Component system. -- cgit v1.2.3 From 519c54250792cbd2a321f6b4292aeb4d4e3c1a2b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 29 Nov 2016 11:33:32 -0800 Subject: Don't return by const value --- toolsrc/include/BuildInfo.h | 4 ++-- toolsrc/src/BuildInfo.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/toolsrc/include/BuildInfo.h b/toolsrc/include/BuildInfo.h index 7f64c51cc..ccf40abbf 100644 --- a/toolsrc/include/BuildInfo.h +++ b/toolsrc/include/BuildInfo.h @@ -46,8 +46,8 @@ namespace vcpkg const ConfigurationType& config() const; const LinkageType& linkage() const; - const std::regex crt_regex() const; - const std::string toString() const; + std::regex crt_regex() const; + std::string toString() const; private: BuildType(const ConfigurationType& config, const LinkageType& linkage, const std::string& crt_regex_as_string) diff --git a/toolsrc/src/BuildInfo.cpp b/toolsrc/src/BuildInfo.cpp index 8d46a0dba..44c7fdcf0 100644 --- a/toolsrc/src/BuildInfo.cpp +++ b/toolsrc/src/BuildInfo.cpp @@ -14,13 +14,13 @@ namespace vcpkg return this->m_linkage; } - const std::regex BuildType::crt_regex() const + std::regex BuildType::crt_regex() const { const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); return r; } - const std::string BuildType::toString() const + std::string BuildType::toString() const { const std::string s = Strings::format("[%s,%s]", to_string(this->m_config), to_string(this->m_linkage)); return s; -- cgit v1.2.3 From 5e75a3dd0e891e6100fa9137fbf9d05ab750f24a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 29 Nov 2016 13:06:27 -0800 Subject: Extract local variable --- toolsrc/src/vcpkg.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index db85eee8f..acebd57b9 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -157,8 +157,8 @@ static void install_and_write_listfile(const vcpkg_paths& paths, const BinaryPar for (auto it = fs::recursive_directory_iterator(package_prefix_path); it != fs::recursive_directory_iterator(); ++it) { - const auto& filename = it->path().filename(); - if (fs::is_regular_file(it->status()) && (_stricmp(filename.generic_string().c_str(), "CONTROL") == 0 || _stricmp(filename.generic_string().c_str(), "BUILD_INFO") == 0)) + const std::string filename = it->path().filename().generic_string(); + if (fs::is_regular_file(it->status()) && (_stricmp(filename.c_str(), "CONTROL") == 0 || _stricmp(filename.c_str(), "BUILD_INFO") == 0)) { // Do not copy the control file continue; -- cgit v1.2.3 From b271355a5845ddfc235dd79c0e6e1389de3fb534 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 29 Nov 2016 13:06:42 -0800 Subject: Extract local variable --- toolsrc/src/post_build_lint.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index 9ae91748e..82a532f5f 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -613,10 +613,11 @@ namespace vcpkg error_count += check_for_copyright_file(spec, paths); error_count += check_for_exes(spec, paths); - const fs::path debug_lib_dir = paths.packages / spec.dir() / "debug" / "lib"; - const fs::path release_lib_dir = paths.packages / spec.dir() / "lib"; - const fs::path debug_bin_dir = paths.packages / spec.dir() / "debug" / "bin"; - const fs::path release_bin_dir = paths.packages / spec.dir() / "bin"; + const fs::path package_dir = paths.package_dir(spec); + const fs::path debug_lib_dir = package_dir / "debug" / "lib"; + const fs::path release_lib_dir = package_dir / "lib"; + const fs::path debug_bin_dir = package_dir / "debug" / "bin"; + const fs::path release_bin_dir = package_dir / "bin"; const std::vector debug_libs = recursive_find_files_with_extension_in_dir(debug_lib_dir, ".lib"); const std::vector release_libs = recursive_find_files_with_extension_in_dir(release_lib_dir, ".lib"); -- cgit v1.2.3 From be71c433cc9902813e5a64be81fd058238c64fef Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 29 Nov 2016 13:07:21 -0800 Subject: [post-build-checks] Add check for files in package dir and debug dir --- toolsrc/src/post_build_lint.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index 82a532f5f..c3a6db184 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -32,6 +32,12 @@ namespace vcpkg System::println(""); } + template + void non_recursive_find_matching_paths_in_dir(const fs::path& dir, const Pred predicate, std::vector* output) + { + std::copy_if(fs::directory_iterator(dir), fs::directory_iterator(), std::back_inserter(*output), predicate); + } + template void recursive_find_matching_paths_in_dir(const fs::path& dir, const Pred predicate, std::vector* output) { @@ -591,6 +597,34 @@ namespace vcpkg return lint_status::SUCCESS; } + static lint_status check_no_files_in_package_dir_and_debug_dir(const fs::path& package_dir) + { + std::vector misplaced_files; + + non_recursive_find_matching_paths_in_dir(package_dir, [](const fs::path& current) + { + const std::string filename = current.filename().generic_string(); + return !fs::is_directory(current) && !((_stricmp(filename.c_str(), "CONTROL") == 0 || _stricmp(filename.c_str(), "BUILD_INFO") == 0)); + }, &misplaced_files); + + + const fs::path debug_dir = package_dir / "debug"; + non_recursive_find_matching_paths_in_dir(debug_dir, [](const fs::path& current) + { + return !fs::is_directory(current); + }, &misplaced_files); + + if (!misplaced_files.empty()) + { + System::println(System::color::warning, "The following files are placed in\n%s and\n%s: ", package_dir.generic_string(), debug_dir.generic_string()); + print_vector_of_files(misplaced_files); + System::println(System::color::warning, "Files cannot be present in those directories.\n"); + return lint_status::ERROR_DETECTED; + } + + return lint_status::SUCCESS; + } + static void operator +=(size_t& left, const lint_status& right) { left += static_cast(right); @@ -680,6 +714,7 @@ namespace vcpkg #endif error_count += check_no_empty_folders(paths.packages / spec.dir()); + error_count += check_no_files_in_package_dir_and_debug_dir(package_dir); if (error_count != 0) { -- cgit v1.2.3 From 7a2e6f614d9366fb63f0abb1f02a3e65dbd64ddb Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 29 Nov 2016 13:14:20 -0800 Subject: Use extracted local variable --- toolsrc/src/post_build_lint.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index c3a6db184..866050edf 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -690,7 +690,7 @@ namespace vcpkg case LinkageType::STATIC: { std::vector dlls; - recursive_find_files_with_extension_in_dir(paths.packages / spec.dir(), ".dll", &dlls); + recursive_find_files_with_extension_in_dir(package_dir, ".dll", &dlls); error_count += check_no_dlls_present(dlls); error_count += check_bin_folders_are_not_present_in_static_build(spec, paths); @@ -709,11 +709,11 @@ namespace vcpkg Checks::unreachable(); } #if 0 - error_count += check_no_subdirectories(paths.packages / spec.dir() / "lib"); - error_count += check_no_subdirectories(paths.packages / spec.dir() / "debug" / "lib"); + error_count += check_no_subdirectories(package_dir / "lib"); + error_count += check_no_subdirectories(package_dir / "debug" / "lib"); #endif - error_count += check_no_empty_folders(paths.packages / spec.dir()); + error_count += check_no_empty_folders(package_dir); error_count += check_no_files_in_package_dir_and_debug_dir(package_dir); if (error_count != 0) -- cgit v1.2.3 From 7c08cf4347b6d8a91420439bae87ee0fb000912f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 29 Nov 2016 13:14:56 -0800 Subject: [glbinding] Remove files from package dir and debug dir --- ports/glbinding/CONTROL | 2 +- ports/glbinding/portfile.cmake | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ports/glbinding/CONTROL b/ports/glbinding/CONTROL index bc04bf5f6..5e7ec029c 100644 --- a/ports/glbinding/CONTROL +++ b/ports/glbinding/CONTROL @@ -1,3 +1,3 @@ Source: glbinding -Version: 2.1.1 +Version: 2.1.1-1 Description: glbinding is an MIT licensed, cross-platform C++ binding for the OpenGL API diff --git a/ports/glbinding/portfile.cmake b/ports/glbinding/portfile.cmake index cf578c0a5..6da7d4858 100644 --- a/ports/glbinding/portfile.cmake +++ b/ports/glbinding/portfile.cmake @@ -43,6 +43,16 @@ endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/cmake) file(RENAME ${CURRENT_PACKAGES_DIR}/data ${CURRENT_PACKAGES_DIR}/share/data) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/data) +file(REMOVE ${CURRENT_PACKAGES_DIR}/AUTHORS + ${CURRENT_PACKAGES_DIR}/LICENSE + ${CURRENT_PACKAGES_DIR}/README.md + ${CURRENT_PACKAGES_DIR}/VERSION + ${CURRENT_PACKAGES_DIR}/debug/AUTHORS + ${CURRENT_PACKAGES_DIR}/debug/LICENSE + ${CURRENT_PACKAGES_DIR}/debug/README.md + ${CURRENT_PACKAGES_DIR}/debug/VERSION + ) + # Handle copyright file(COPY ${CURRENT_BUILDTREES_DIR}/src/glbinding-2.1.1/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/glbinding) file(RENAME ${CURRENT_PACKAGES_DIR}/share/glbinding/LICENSE ${CURRENT_PACKAGES_DIR}/share/glbinding/copyright) -- cgit v1.2.3 From 52866d79b01fb81e97cdbf22e46a13264c1662e5 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 29 Nov 2016 13:19:29 -0800 Subject: [globjects] Remove files from package dir and debug dir --- ports/globjects/portfile.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ports/globjects/portfile.cmake b/ports/globjects/portfile.cmake index 6102dfa8a..e46c34509 100644 --- a/ports/globjects/portfile.cmake +++ b/ports/globjects/portfile.cmake @@ -44,6 +44,16 @@ endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/cmake) file(RENAME ${CURRENT_PACKAGES_DIR}/data ${CURRENT_PACKAGES_DIR}/share/data) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/data) +file(REMOVE ${CURRENT_PACKAGES_DIR}/AUTHORS + ${CURRENT_PACKAGES_DIR}/LICENSE + ${CURRENT_PACKAGES_DIR}/README.md + ${CURRENT_PACKAGES_DIR}/VERSION + ${CURRENT_PACKAGES_DIR}/debug/AUTHORS + ${CURRENT_PACKAGES_DIR}/debug/LICENSE + ${CURRENT_PACKAGES_DIR}/debug/README.md + ${CURRENT_PACKAGES_DIR}/debug/VERSION + ) + # Handle copyright file(COPY ${CURRENT_BUILDTREES_DIR}/src/globjects-1.0.0/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/globjects) file(RENAME ${CURRENT_PACKAGES_DIR}/share/globjects/LICENSE ${CURRENT_PACKAGES_DIR}/share/globjects/copyright) -- cgit v1.2.3 From daa47668d00d1534a913e8f81ac26c349fe5d2f9 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 29 Nov 2016 15:32:44 -0800 Subject: [post-build-checks] Refactor - pass around package_dir --- toolsrc/src/post_build_lint.cpp | 78 ++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 40 deletions(-) diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index 866050edf..d358cca45 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -68,9 +68,9 @@ namespace vcpkg } } - static lint_status check_for_files_in_include_directory(const package_spec& spec, const vcpkg_paths& paths) + static lint_status check_for_files_in_include_directory(const fs::path& package_dir) { - const fs::path include_dir = paths.packages / spec.dir() / "include"; + const fs::path include_dir = package_dir / "include"; if (!fs::exists(include_dir) || fs::is_empty(include_dir)) { System::println(System::color::warning, "The folder /include is empty. This indicates the library was not correctly installed."); @@ -80,9 +80,9 @@ namespace vcpkg return lint_status::SUCCESS; } - static lint_status check_for_files_in_debug_include_directory(const package_spec& spec, const vcpkg_paths& paths) + static lint_status check_for_files_in_debug_include_directory(const fs::path& package_dir) { - const fs::path debug_include_dir = paths.packages / spec.dir() / "debug" / "include"; + const fs::path debug_include_dir = package_dir / "debug" / "include"; std::vector files_found; recursive_find_matching_paths_in_dir(debug_include_dir, [&](const fs::path& current) @@ -101,9 +101,9 @@ namespace vcpkg return lint_status::SUCCESS; } - static lint_status check_for_files_in_debug_share_directory(const package_spec& spec, const vcpkg_paths& paths) + static lint_status check_for_files_in_debug_share_directory(const fs::path& package_dir) { - const fs::path debug_share = paths.packages / spec.dir() / "debug" / "share"; + const fs::path debug_share = package_dir / "debug" / "share"; if (fs::exists(debug_share) && !fs::is_empty(debug_share)) { @@ -114,9 +114,9 @@ namespace vcpkg return lint_status::SUCCESS; } - static lint_status check_folder_lib_cmake(const package_spec& spec, const vcpkg_paths& paths) + static lint_status check_folder_lib_cmake(const fs::path& package_dir) { - const fs::path lib_cmake = paths.packages / spec.dir() / "lib" / "cmake"; + const fs::path lib_cmake = package_dir / "lib" / "cmake"; if (fs::exists(lib_cmake)) { System::println(System::color::warning, "The /lib/cmake folder should be moved to just /cmake"); @@ -126,14 +126,13 @@ namespace vcpkg return lint_status::SUCCESS; } - static lint_status check_for_misplaced_cmake_files(const package_spec& spec, const vcpkg_paths& paths) + static lint_status check_for_misplaced_cmake_files(const fs::path& package_dir, const package_spec& spec) { - const fs::path current_packages_dir = paths.packages / spec.dir(); std::vector misplaced_cmake_files; - recursive_find_files_with_extension_in_dir(current_packages_dir / "cmake", ".cmake", &misplaced_cmake_files); - recursive_find_files_with_extension_in_dir(current_packages_dir / "debug" / "cmake", ".cmake", &misplaced_cmake_files); - recursive_find_files_with_extension_in_dir(current_packages_dir / "lib" / "cmake", ".cmake", &misplaced_cmake_files); - recursive_find_files_with_extension_in_dir(current_packages_dir / "debug" / "lib" / "cmake", ".cmake", &misplaced_cmake_files); + recursive_find_files_with_extension_in_dir(package_dir / "cmake", ".cmake", &misplaced_cmake_files); + recursive_find_files_with_extension_in_dir(package_dir / "debug" / "cmake", ".cmake", &misplaced_cmake_files); + recursive_find_files_with_extension_in_dir(package_dir / "lib" / "cmake", ".cmake", &misplaced_cmake_files); + recursive_find_files_with_extension_in_dir(package_dir / "debug" / "lib" / "cmake", ".cmake", &misplaced_cmake_files); if (!misplaced_cmake_files.empty()) { @@ -145,9 +144,9 @@ namespace vcpkg return lint_status::SUCCESS; } - static lint_status check_folder_debug_lib_cmake(const package_spec& spec, const vcpkg_paths& paths) + static lint_status check_folder_debug_lib_cmake(const fs::path& package_dir) { - const fs::path lib_cmake_debug = paths.packages / spec.dir() / "debug" / "lib" / "cmake"; + const fs::path lib_cmake_debug = package_dir / "debug" / "lib" / "cmake"; if (fs::exists(lib_cmake_debug)) { System::println(System::color::warning, "The /debug/lib/cmake folder should be moved to just /debug/cmake"); @@ -157,11 +156,11 @@ namespace vcpkg return lint_status::SUCCESS; } - static lint_status check_for_dlls_in_lib_dirs(const package_spec& spec, const vcpkg_paths& paths) + static lint_status check_for_dlls_in_lib_dirs(const fs::path& package_dir) { std::vector dlls; - recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "lib", ".dll", &dlls); - recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "debug" / "lib", ".dll", &dlls); + recursive_find_files_with_extension_in_dir(package_dir / "lib", ".dll", &dlls); + recursive_find_files_with_extension_in_dir(package_dir / "debug" / "lib", ".dll", &dlls); if (!dlls.empty()) { @@ -175,7 +174,8 @@ namespace vcpkg static lint_status check_for_copyright_file(const package_spec& spec, const vcpkg_paths& paths) { - const fs::path copyright_file = paths.packages / spec.dir() / "share" / spec.name() / "copyright"; + const fs::path packages_dir = paths.packages / spec.dir(); + const fs::path copyright_file = packages_dir / "share" / spec.name() / "copyright"; if (fs::exists(copyright_file)) { return lint_status::SUCCESS; @@ -216,17 +216,15 @@ namespace vcpkg print_vector_of_files(potential_copyright_files); } - const fs::path current_packages_dir = paths.packages / spec.dir(); - System::println(" %s/share/%s/copyright", current_packages_dir.generic_string(), spec.name()); - + System::println(" %s/share/%s/copyright", packages_dir.generic_string(), spec.name()); return lint_status::ERROR_DETECTED; } - static lint_status check_for_exes(const package_spec& spec, const vcpkg_paths& paths) + static lint_status check_for_exes(const fs::path& package_dir) { std::vector exes; - recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "bin", ".exe", &exes); - recursive_find_files_with_extension_in_dir(paths.packages / spec.dir() / "debug" / "bin", ".exe", &exes); + recursive_find_files_with_extension_in_dir(package_dir / "bin", ".exe", &exes); + recursive_find_files_with_extension_in_dir(package_dir / "debug" / "bin", ".exe", &exes); if (!exes.empty()) { @@ -452,10 +450,10 @@ namespace vcpkg return lint_status::SUCCESS; } - static lint_status check_bin_folders_are_not_present_in_static_build(const package_spec& spec, const vcpkg_paths& paths) + static lint_status check_bin_folders_are_not_present_in_static_build(const fs::path& package_dir) { - const fs::path bin = paths.packages / spec.dir() / "bin"; - const fs::path debug_bin = paths.packages / spec.dir() / "debug" / "bin"; + const fs::path bin = package_dir / "bin"; + const fs::path debug_bin = package_dir / "debug" / "bin"; if (!fs::exists(bin) && !fs::exists(debug_bin)) { @@ -607,7 +605,6 @@ namespace vcpkg return !fs::is_directory(current) && !((_stricmp(filename.c_str(), "CONTROL") == 0 || _stricmp(filename.c_str(), "BUILD_INFO") == 0)); }, &misplaced_files); - const fs::path debug_dir = package_dir / "debug"; non_recursive_find_matching_paths_in_dir(debug_dir, [](const fs::path& current) { @@ -635,19 +632,20 @@ namespace vcpkg System::println("-- Performing post-build validation"); BuildInfo build_info = read_build_info(paths.build_info_file_path(spec)); + const fs::path package_dir = paths.package_dir(spec); size_t error_count = 0; - error_count += check_for_files_in_include_directory(spec, paths); - error_count += check_for_files_in_debug_include_directory(spec, paths); - error_count += check_for_files_in_debug_share_directory(spec, paths); - error_count += check_folder_lib_cmake(spec, paths); - error_count += check_for_misplaced_cmake_files(spec, paths); - error_count += check_folder_debug_lib_cmake(spec, paths); - error_count += check_for_dlls_in_lib_dirs(spec, paths); + error_count += check_for_files_in_include_directory(package_dir); + error_count += check_for_files_in_debug_include_directory(package_dir); + error_count += check_for_files_in_debug_share_directory(package_dir); + error_count += check_folder_lib_cmake(package_dir); + error_count += check_for_misplaced_cmake_files(package_dir, spec); + error_count += check_folder_debug_lib_cmake(package_dir); + error_count += check_for_dlls_in_lib_dirs(package_dir); error_count += check_for_copyright_file(spec, paths); - error_count += check_for_exes(spec, paths); + error_count += check_for_exes(package_dir); - const fs::path package_dir = paths.package_dir(spec); + const fs::path debug_lib_dir = package_dir / "debug" / "lib"; const fs::path release_lib_dir = package_dir / "lib"; const fs::path debug_bin_dir = package_dir / "debug" / "bin"; @@ -693,7 +691,7 @@ namespace vcpkg recursive_find_files_with_extension_in_dir(package_dir, ".dll", &dlls); error_count += check_no_dlls_present(dlls); - error_count += check_bin_folders_are_not_present_in_static_build(spec, paths); + error_count += check_bin_folders_are_not_present_in_static_build(package_dir); error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::DEBUG, linkage_type_value_of(build_info.crt_linkage)), debug_libs); error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::RELEASE, linkage_type_value_of(build_info.crt_linkage)), release_libs); -- cgit v1.2.3 From c0564b6111a14f54e94ad64892ab40f9adb4a1b6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 29 Nov 2016 16:45:21 -0800 Subject: Remove unused function --- toolsrc/src/vcpkg.cpp | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index acebd57b9..b1fe76982 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -18,19 +18,6 @@ using namespace vcpkg; bool vcpkg::g_do_dry_run = false; -namespace -{ - template - auto find_or_default(const M& map, const K& key, const V& val) - { - auto it = map.find(key); - if (it == map.end()) - return decltype(it->second)(val); - else - return it->second; - } -} - namespace { std::fstream open_status_file(const vcpkg_paths& paths, std::ios_base::openmode mode = std::ios_base::app | std::ios_base::in | std::ios_base::out | std::ios_base::binary) -- cgit v1.2.3 From af120041b68f2b9221bdd3cf0047f7e20705aa5a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 29 Nov 2016 17:04:41 -0800 Subject: Move file functions to vcpkg_Files.h --- toolsrc/include/vcpkg_Files.h | 27 +++++++++ toolsrc/src/post_build_lint.cpp | 119 ++++++++++++++-------------------------- toolsrc/src/vcpkg_Files.cpp | 15 +++++ 3 files changed, 82 insertions(+), 79 deletions(-) diff --git a/toolsrc/include/vcpkg_Files.h b/toolsrc/include/vcpkg_Files.h index 445713965..4aa9b956a 100644 --- a/toolsrc/include/vcpkg_Files.h +++ b/toolsrc/include/vcpkg_Files.h @@ -2,9 +2,12 @@ #include "expected.h" #include +#include namespace vcpkg {namespace Files { + namespace fs = std::tr2::sys; + static const char* FILESYSTEM_INVALID_CHARACTERS = R"(\/:*?"<>|)"; void check_is_directory(const std::tr2::sys::path& dirpath); @@ -14,4 +17,28 @@ namespace vcpkg {namespace Files expected get_contents(const std::tr2::sys::path& file_path) noexcept; std::tr2::sys::path find_file_recursively_up(const std::tr2::sys::path& starting_dir, const std::string& filename); + + template + void non_recursive_find_matching_paths_in_dir(const fs::path& dir, const Pred predicate, std::vector* output) + { + std::copy_if(fs::directory_iterator(dir), fs::directory_iterator(), std::back_inserter(*output), predicate); + } + + template + void recursive_find_matching_paths_in_dir(const fs::path& dir, const Pred predicate, std::vector* output) + { + std::copy_if(fs::recursive_directory_iterator(dir), fs::recursive_directory_iterator(), std::back_inserter(*output), predicate); + } + + template + std::vector recursive_find_matching_paths_in_dir(const fs::path& dir, const Pred predicate) + { + std::vector v; + recursive_find_matching_paths_in_dir(dir, predicate, &v); + return v; + } + + void recursive_find_files_with_extension_in_dir(const fs::path& dir, const std::string& extension, std::vector* output); + + std::vector recursive_find_files_with_extension_in_dir(const fs::path& dir, const std::string& extension); }} diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index d358cca45..b93844f03 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -1,7 +1,7 @@ #include #include "vcpkg_paths.h" #include "package_spec.h" -#include +#include "vcpkg_Files.h" #include #include "vcpkg_System.h" #include "coff_file_reader.h" @@ -20,52 +20,14 @@ namespace vcpkg static const fs::path DUMPBIN_EXE = R"(%VS140COMNTOOLS%\..\..\VC\bin\dumpbin.exe)"; - namespace + static void print_vector_of_files(const std::vector& paths) { - void print_vector_of_files(const std::vector& paths) - { - System::println(""); - for (const fs::path& p : paths) - { - System::println(" %s", p.generic_string()); - } - System::println(""); - } - - template - void non_recursive_find_matching_paths_in_dir(const fs::path& dir, const Pred predicate, std::vector* output) - { - std::copy_if(fs::directory_iterator(dir), fs::directory_iterator(), std::back_inserter(*output), predicate); - } - - template - void recursive_find_matching_paths_in_dir(const fs::path& dir, const Pred predicate, std::vector* output) - { - std::copy_if(fs::recursive_directory_iterator(dir), fs::recursive_directory_iterator(), std::back_inserter(*output), predicate); - } - - template - std::vector recursive_find_matching_paths_in_dir(const fs::path& dir, const Pred predicate) - { - std::vector v; - recursive_find_matching_paths_in_dir(dir, predicate, &v); - return v; - } - - void recursive_find_files_with_extension_in_dir(const fs::path& dir, const std::string& extension, std::vector* output) - { - recursive_find_matching_paths_in_dir(dir, [&extension](const fs::path& current) - { - return !fs::is_directory(current) && current.extension() == extension; - }, output); - } - - std::vector recursive_find_files_with_extension_in_dir(const fs::path& dir, const std::string& extension) + System::println(""); + for (const fs::path& p : paths) { - std::vector v; - recursive_find_files_with_extension_in_dir(dir, extension, &v); - return v; + System::println(" %s", p.generic_string()); } + System::println(""); } static lint_status check_for_files_in_include_directory(const fs::path& package_dir) @@ -85,10 +47,10 @@ namespace vcpkg const fs::path debug_include_dir = package_dir / "debug" / "include"; std::vector files_found; - recursive_find_matching_paths_in_dir(debug_include_dir, [&](const fs::path& current) - { - return !fs::is_directory(current) && current.extension() != ".ifc"; - }, &files_found); + Files::recursive_find_matching_paths_in_dir(debug_include_dir, [&](const fs::path& current) + { + return !fs::is_directory(current) && current.extension() != ".ifc"; + }, &files_found); if (!files_found.empty()) { @@ -129,10 +91,10 @@ namespace vcpkg static lint_status check_for_misplaced_cmake_files(const fs::path& package_dir, const package_spec& spec) { std::vector misplaced_cmake_files; - recursive_find_files_with_extension_in_dir(package_dir / "cmake", ".cmake", &misplaced_cmake_files); - recursive_find_files_with_extension_in_dir(package_dir / "debug" / "cmake", ".cmake", &misplaced_cmake_files); - recursive_find_files_with_extension_in_dir(package_dir / "lib" / "cmake", ".cmake", &misplaced_cmake_files); - recursive_find_files_with_extension_in_dir(package_dir / "debug" / "lib" / "cmake", ".cmake", &misplaced_cmake_files); + Files::recursive_find_files_with_extension_in_dir(package_dir / "cmake", ".cmake", &misplaced_cmake_files); + Files::recursive_find_files_with_extension_in_dir(package_dir / "debug" / "cmake", ".cmake", &misplaced_cmake_files); + Files::recursive_find_files_with_extension_in_dir(package_dir / "lib" / "cmake", ".cmake", &misplaced_cmake_files); + Files::recursive_find_files_with_extension_in_dir(package_dir / "debug" / "lib" / "cmake", ".cmake", &misplaced_cmake_files); if (!misplaced_cmake_files.empty()) { @@ -159,8 +121,8 @@ namespace vcpkg static lint_status check_for_dlls_in_lib_dirs(const fs::path& package_dir) { std::vector dlls; - recursive_find_files_with_extension_in_dir(package_dir / "lib", ".dll", &dlls); - recursive_find_files_with_extension_in_dir(package_dir / "debug" / "lib", ".dll", &dlls); + Files::recursive_find_files_with_extension_in_dir(package_dir / "lib", ".dll", &dlls); + Files::recursive_find_files_with_extension_in_dir(package_dir / "debug" / "lib", ".dll", &dlls); if (!dlls.empty()) { @@ -223,8 +185,8 @@ namespace vcpkg static lint_status check_for_exes(const fs::path& package_dir) { std::vector exes; - recursive_find_files_with_extension_in_dir(package_dir / "bin", ".exe", &exes); - recursive_find_files_with_extension_in_dir(package_dir / "debug" / "bin", ".exe", &exes); + Files::recursive_find_files_with_extension_in_dir(package_dir / "bin", ".exe", &exes); + Files::recursive_find_files_with_extension_in_dir(package_dir / "debug" / "bin", ".exe", &exes); if (!exes.empty()) { @@ -434,10 +396,10 @@ namespace vcpkg static lint_status check_no_subdirectories(const fs::path& dir) { - const std::vector subdirectories = recursive_find_matching_paths_in_dir(dir, [&](const fs::path& current) - { - return fs::is_directory(current); - }); + const std::vector subdirectories = Files::recursive_find_matching_paths_in_dir(dir, [&](const fs::path& current) + { + return fs::is_directory(current); + }); if (!subdirectories.empty()) { @@ -483,10 +445,10 @@ namespace vcpkg static lint_status check_no_empty_folders(const fs::path& dir) { - const std::vector empty_directories = recursive_find_matching_paths_in_dir(dir, [](const fs::path& current) - { - return fs::is_directory(current) && fs::is_empty(current); - }); + const std::vector empty_directories = Files::recursive_find_matching_paths_in_dir(dir, [](const fs::path& current) + { + return fs::is_directory(current) && fs::is_empty(current); + }); if (!empty_directories.empty()) { @@ -599,17 +561,17 @@ namespace vcpkg { std::vector misplaced_files; - non_recursive_find_matching_paths_in_dir(package_dir, [](const fs::path& current) - { - const std::string filename = current.filename().generic_string(); - return !fs::is_directory(current) && !((_stricmp(filename.c_str(), "CONTROL") == 0 || _stricmp(filename.c_str(), "BUILD_INFO") == 0)); - }, &misplaced_files); + Files::non_recursive_find_matching_paths_in_dir(package_dir, [](const fs::path& current) + { + const std::string filename = current.filename().generic_string(); + return !fs::is_directory(current) && !((_stricmp(filename.c_str(), "CONTROL") == 0 || _stricmp(filename.c_str(), "BUILD_INFO") == 0)); + }, &misplaced_files); const fs::path debug_dir = package_dir / "debug"; - non_recursive_find_matching_paths_in_dir(debug_dir, [](const fs::path& current) - { - return !fs::is_directory(current); - }, &misplaced_files); + Files::non_recursive_find_matching_paths_in_dir(debug_dir, [](const fs::path& current) + { + return !fs::is_directory(current); + }, &misplaced_files); if (!misplaced_files.empty()) { @@ -645,14 +607,13 @@ namespace vcpkg error_count += check_for_copyright_file(spec, paths); error_count += check_for_exes(package_dir); - const fs::path debug_lib_dir = package_dir / "debug" / "lib"; const fs::path release_lib_dir = package_dir / "lib"; const fs::path debug_bin_dir = package_dir / "debug" / "bin"; const fs::path release_bin_dir = package_dir / "bin"; - const std::vector debug_libs = recursive_find_files_with_extension_in_dir(debug_lib_dir, ".lib"); - const std::vector release_libs = recursive_find_files_with_extension_in_dir(release_lib_dir, ".lib"); + const std::vector debug_libs = Files::recursive_find_files_with_extension_in_dir(debug_lib_dir, ".lib"); + const std::vector release_libs = Files::recursive_find_files_with_extension_in_dir(release_lib_dir, ".lib"); error_count += check_matching_debug_and_release_binaries(debug_libs, release_libs); @@ -666,8 +627,8 @@ namespace vcpkg { case LinkageType::DYNAMIC: { - const std::vector debug_dlls = recursive_find_files_with_extension_in_dir(debug_bin_dir, ".dll"); - const std::vector release_dlls = recursive_find_files_with_extension_in_dir(release_bin_dir, ".dll"); + const std::vector debug_dlls = Files::recursive_find_files_with_extension_in_dir(debug_bin_dir, ".dll"); + const std::vector release_dlls = Files::recursive_find_files_with_extension_in_dir(release_bin_dir, ".dll"); error_count += check_matching_debug_and_release_binaries(debug_dlls, release_dlls); @@ -688,7 +649,7 @@ namespace vcpkg case LinkageType::STATIC: { std::vector dlls; - recursive_find_files_with_extension_in_dir(package_dir, ".dll", &dlls); + Files::recursive_find_files_with_extension_in_dir(package_dir, ".dll", &dlls); error_count += check_no_dlls_present(dlls); error_count += check_bin_folders_are_not_present_in_static_build(package_dir); diff --git a/toolsrc/src/vcpkg_Files.cpp b/toolsrc/src/vcpkg_Files.cpp index 611aa7450..42e815cc2 100644 --- a/toolsrc/src/vcpkg_Files.cpp +++ b/toolsrc/src/vcpkg_Files.cpp @@ -58,4 +58,19 @@ namespace vcpkg {namespace Files return current_dir; } + + void recursive_find_files_with_extension_in_dir(const fs::path& dir, const std::string& extension, std::vector* output) + { + recursive_find_matching_paths_in_dir(dir, [&extension](const fs::path& current) + { + return !fs::is_directory(current) && current.extension() == extension; + }, output); + } + + std::vector recursive_find_files_with_extension_in_dir(const fs::path& dir, const std::string& extension) + { + std::vector v; + recursive_find_files_with_extension_in_dir(dir, extension, &v); + return v; + } }} -- cgit v1.2.3 From ab147b838b79692b838e6d3cf794a8caef3e5629 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 29 Nov 2016 17:12:45 -0800 Subject: [vcpkg] Remove link-time choice of thread-safe vs non-thread-safe so that dependent libraries make the right choice. --- ports/libraw/CONTROL | 2 +- ports/libraw/portfile.cmake | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ports/libraw/CONTROL b/ports/libraw/CONTROL index d627cdd16..dd5c7a5c3 100644 --- a/ports/libraw/CONTROL +++ b/ports/libraw/CONTROL @@ -1,4 +1,4 @@ Source: libraw -Version: 0.17.2 +Version: 0.17.2-1 Build-Depends: libjpeg-turbo Description: raw image decoder library diff --git a/ports/libraw/portfile.cmake b/ports/libraw/portfile.cmake index 69c168a07..3ff69a6e0 100644 --- a/ports/libraw/portfile.cmake +++ b/ports/libraw/portfile.cmake @@ -23,12 +23,16 @@ file(COPY ${LIBRAW_CMAKE_SOURCE_PATH}/cmake DESTINATION ${SOURCE_PATH}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS - -DINSTALL_CMAKE_MODULE_PATH=${SOURCE_PATH} + -DINSTALL_CMAKE_MODULE_PATH=${CURRENT_PACKAGES_DIR}/share/libraw ) vcpkg_install_cmake() -file(COPY ${SOURCE_PATH}/FindLibRaw.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/libraw/cmake/FindLibRaw.cmake) +# Rename thread-safe version to be "raw.lib". This is unfortunately needed +# because otherwise libraries that build on top of libraw have to choose. +file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/raw.lib ${CURRENT_PACKAGES_DIR}/debug/lib/raw.lib) +file(RENAME ${CURRENT_PACKAGES_DIR}/lib/raw_r.lib ${CURRENT_PACKAGES_DIR}/lib/raw.lib) +file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/raw_r.lib ${CURRENT_PACKAGES_DIR}/debug/lib/raw.lib) # Cleanup file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) @@ -38,6 +42,8 @@ file(GLOB DEBUG_EXECUTABLES ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe) file(REMOVE ${DEBUG_EXECUTABLES}) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) +else() + file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/raw.dll ${CURRENT_PACKAGES_DIR}/debug/bin/raw.dll) endif() # Handle copyright -- cgit v1.2.3 From 74f69ade187dbe091cb00ace4d40ef9d20a3e416 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 29 Nov 2016 17:17:45 -0800 Subject: Introduce PostBuildLint namespace --- toolsrc/include/BuildInfo.h | 4 ++-- toolsrc/include/post_build_lint.h | 4 ++-- toolsrc/src/BuildInfo.cpp | 4 ++-- toolsrc/src/commands_installation.cpp | 4 ++-- toolsrc/src/post_build_lint.cpp | 8 ++++---- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/toolsrc/include/BuildInfo.h b/toolsrc/include/BuildInfo.h index ccf40abbf..7c654d9c7 100644 --- a/toolsrc/include/BuildInfo.h +++ b/toolsrc/include/BuildInfo.h @@ -6,7 +6,7 @@ namespace fs = std::tr2::sys; -namespace vcpkg +namespace vcpkg { namespace PostBuildLint { enum class LinkageType { @@ -128,4 +128,4 @@ namespace vcpkg }; BuildInfo read_build_info(const fs::path& filepath); -} +}} diff --git a/toolsrc/include/post_build_lint.h b/toolsrc/include/post_build_lint.h index bc916a7af..a5fb9149f 100644 --- a/toolsrc/include/post_build_lint.h +++ b/toolsrc/include/post_build_lint.h @@ -2,7 +2,7 @@ #include "package_spec.h" #include "vcpkg_paths.h" -namespace vcpkg +namespace vcpkg {namespace PostBuildLint { void perform_all_checks(const package_spec& spec, const vcpkg_paths& paths); -} +}} diff --git a/toolsrc/src/BuildInfo.cpp b/toolsrc/src/BuildInfo.cpp index 44c7fdcf0..d96df8e8c 100644 --- a/toolsrc/src/BuildInfo.cpp +++ b/toolsrc/src/BuildInfo.cpp @@ -2,7 +2,7 @@ #include "vcpkg_Checks.h" #include "vcpkglib_helpers.h" -namespace vcpkg +namespace vcpkg { namespace PostBuildLint { const ConfigurationType& BuildType::config() const { @@ -161,4 +161,4 @@ namespace vcpkg { return this->m_dll_name; } -} +}} diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_installation.cpp index f7af2ef7c..93335220d 100644 --- a/toolsrc/src/commands_installation.cpp +++ b/toolsrc/src/commands_installation.cpp @@ -59,7 +59,7 @@ namespace vcpkg exit(EXIT_FAILURE); } - perform_all_checks(spec, paths); + PostBuildLint::perform_all_checks(spec, paths); create_binary_control_file(paths, source_paragraph, target_triplet); @@ -140,7 +140,7 @@ namespace vcpkg const std::unordered_set options = args.check_and_get_optional_command_arguments({OPTION_CHECKS_ONLY}); if (options.find(OPTION_CHECKS_ONLY) != options.end()) { - perform_all_checks(spec, paths); + PostBuildLint::perform_all_checks(spec, paths); exit(EXIT_SUCCESS); } diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index b93844f03..3ef906353 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -10,7 +10,7 @@ namespace fs = std::tr2::sys; -namespace vcpkg +namespace vcpkg { namespace PostBuildLint { enum class lint_status { @@ -668,8 +668,8 @@ namespace vcpkg Checks::unreachable(); } #if 0 - error_count += check_no_subdirectories(package_dir / "lib"); - error_count += check_no_subdirectories(package_dir / "debug" / "lib"); + error_count += check_no_subdirectories(package_dir / "lib"); + error_count += check_no_subdirectories(package_dir / "debug" / "lib"); #endif error_count += check_no_empty_folders(package_dir); @@ -684,4 +684,4 @@ namespace vcpkg System::println("-- Performing post-build validation done"); } -} +}} -- cgit v1.2.3 From af2b0cab4276ab7581595d968dd2470b0cb46fd5 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 29 Nov 2016 17:48:32 -0800 Subject: [libraw] Rename Module to Config to increase flexibility of install locations --- ports/libraw/CONTROL | 2 +- ports/libraw/portfile.cmake | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ports/libraw/CONTROL b/ports/libraw/CONTROL index dd5c7a5c3..b10e10794 100644 --- a/ports/libraw/CONTROL +++ b/ports/libraw/CONTROL @@ -1,4 +1,4 @@ Source: libraw -Version: 0.17.2-1 +Version: 0.17.2-2 Build-Depends: libjpeg-turbo Description: raw image decoder library diff --git a/ports/libraw/portfile.cmake b/ports/libraw/portfile.cmake index 3ff69a6e0..159251c28 100644 --- a/ports/libraw/portfile.cmake +++ b/ports/libraw/portfile.cmake @@ -46,6 +46,9 @@ else() file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/raw.dll ${CURRENT_PACKAGES_DIR}/debug/bin/raw.dll) endif() +# Rename cmake module into a config in order to allow more flexible lookup rules +file(RENAME ${CURRENT_PACKAGES_DIR}/share/libraw/FindLibRaw.cmake ${CURRENT_PACKAGES_DIR}/share/libraw/LibRaw-config.cmake) + # Handle copyright file(COPY ${SOURCE_PATH}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/libraw) file(RENAME ${CURRENT_PACKAGES_DIR}/share/libraw/COPYRIGHT ${CURRENT_PACKAGES_DIR}/share/libraw/copyright) -- cgit v1.2.3 From b2ec171574b83abe2637a27087717136aaf004e2 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 29 Nov 2016 18:02:49 -0800 Subject: [freeimage] Always define FREEIMAGE_LIB in static mode. --- ports/freeimage/FreeImageConfig-static.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/ports/freeimage/FreeImageConfig-static.h b/ports/freeimage/FreeImageConfig-static.h index a7e6a3224..ed723490e 100644 --- a/ports/freeimage/FreeImageConfig-static.h +++ b/ports/freeimage/FreeImageConfig-static.h @@ -1,8 +1,6 @@ #ifndef FREEIMAGE_CONFIG_H #define FREEIMAGE_CONFIG_H -#ifndef #define FREEIMAGE_LIB -#endif #endif -- cgit v1.2.3 From 0b996a002ec6d90d8a132e7603553b60b332c9fe Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 29 Nov 2016 18:08:00 -0800 Subject: [Files] Add functions to get all files of a dir recursively or non-recursively --- toolsrc/include/vcpkg_Files.h | 8 ++++++++ toolsrc/src/vcpkg_Files.cpp | 30 ++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/toolsrc/include/vcpkg_Files.h b/toolsrc/include/vcpkg_Files.h index 4aa9b956a..8ed1eabe1 100644 --- a/toolsrc/include/vcpkg_Files.h +++ b/toolsrc/include/vcpkg_Files.h @@ -41,4 +41,12 @@ namespace vcpkg {namespace Files void recursive_find_files_with_extension_in_dir(const fs::path& dir, const std::string& extension, std::vector* output); std::vector recursive_find_files_with_extension_in_dir(const fs::path& dir, const std::string& extension); + + void recursive_find_all_files_in_dir(const fs::path& dir, std::vector* output); + + std::vector recursive_find_all_files_in_dir(const fs::path& dir); + + void non_recursive_find_all_files_in_dir(const fs::path& dir, std::vector* output); + + std::vector non_recursive_find_all_files_in_dir(const fs::path& dir); }} diff --git a/toolsrc/src/vcpkg_Files.cpp b/toolsrc/src/vcpkg_Files.cpp index 42e815cc2..bb34915d7 100644 --- a/toolsrc/src/vcpkg_Files.cpp +++ b/toolsrc/src/vcpkg_Files.cpp @@ -73,4 +73,34 @@ namespace vcpkg {namespace Files recursive_find_files_with_extension_in_dir(dir, extension, &v); return v; } + + void recursive_find_all_files_in_dir(const fs::path& dir, std::vector* output) + { + recursive_find_matching_paths_in_dir(dir, [&](const fs::path& current) + { + return !fs::is_directory(current); + }, output); + } + + std::vector recursive_find_all_files_in_dir(const fs::path& dir) + { + std::vector v; + recursive_find_all_files_in_dir(dir, &v); + return v; + } + + void non_recursive_find_all_files_in_dir(const fs::path& dir, std::vector* output) + { + non_recursive_find_matching_paths_in_dir(dir, [&](const fs::path& current) + { + return !fs::is_directory(current); + }, output); + } + + std::vector non_recursive_find_all_files_in_dir(const fs::path& dir) + { + std::vector v; + non_recursive_find_all_files_in_dir(dir, &v); + return v; + } }} -- cgit v1.2.3 From 35152bb4fddc63f6166611a6a01fe7429e955743 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 29 Nov 2016 18:08:53 -0800 Subject: Use new Files functions --- toolsrc/src/post_build_lint.cpp | 5 +---- toolsrc/src/vcpkg_Files.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index 3ef906353..61fbba52a 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -568,10 +568,7 @@ namespace vcpkg { namespace PostBuildLint }, &misplaced_files); const fs::path debug_dir = package_dir / "debug"; - Files::non_recursive_find_matching_paths_in_dir(debug_dir, [](const fs::path& current) - { - return !fs::is_directory(current); - }, &misplaced_files); + Files::non_recursive_find_all_files_in_dir(debug_dir, &misplaced_files); if (!misplaced_files.empty()) { diff --git a/toolsrc/src/vcpkg_Files.cpp b/toolsrc/src/vcpkg_Files.cpp index bb34915d7..86e7080e4 100644 --- a/toolsrc/src/vcpkg_Files.cpp +++ b/toolsrc/src/vcpkg_Files.cpp @@ -77,9 +77,9 @@ namespace vcpkg {namespace Files void recursive_find_all_files_in_dir(const fs::path& dir, std::vector* output) { recursive_find_matching_paths_in_dir(dir, [&](const fs::path& current) - { - return !fs::is_directory(current); - }, output); + { + return !fs::is_directory(current); + }, output); } std::vector recursive_find_all_files_in_dir(const fs::path& dir) @@ -92,9 +92,9 @@ namespace vcpkg {namespace Files void non_recursive_find_all_files_in_dir(const fs::path& dir, std::vector* output) { non_recursive_find_matching_paths_in_dir(dir, [&](const fs::path& current) - { - return !fs::is_directory(current); - }, output); + { + return !fs::is_directory(current); + }, output); } std::vector non_recursive_find_all_files_in_dir(const fs::path& dir) -- cgit v1.2.3 From 069fb0f9711873d30db4752138a1908e950e413a Mon Sep 17 00:00:00 2001 From: Alexander Kaspar Date: Wed, 30 Nov 2016 10:10:01 +0100 Subject: formatting portfile --- ports/qca/portfile.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/qca/portfile.cmake b/ports/qca/portfile.cmake index fa38970d3..0ff913025 100644 --- a/ports/qca/portfile.cmake +++ b/ports/qca/portfile.cmake @@ -54,11 +54,11 @@ vcpkg_configure_cmake( -DQT4_BUILD=OFF -DBUILD_TESTS=OFF -DBUILD_TOOLS=OFF - -DQCA_SUFFIX=OFF # + -DQCA_SUFFIX=OFF OPTIONS_DEBUG - -DQCA_PLUGINS_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/debug/bin/Qca # + -DQCA_PLUGINS_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/debug/bin/Qca OPTIONS_RELEASE - -DQCA_PLUGINS_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/bin/Qca # + -DQCA_PLUGINS_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/bin/Qca ) vcpkg_install_cmake() -- cgit v1.2.3 From e7f0cf8694badd1ee0b9c55d2d956c4d291fec0f Mon Sep 17 00:00:00 2001 From: Manuel Massing Date: Wed, 30 Nov 2016 10:24:10 +0100 Subject: [gdal] Separate build directories for dynamic and static build --- ports/gdal/portfile.cmake | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/ports/gdal/portfile.cmake b/ports/gdal/portfile.cmake index ca548ae83..698c96a5c 100644 --- a/ports/gdal/portfile.cmake +++ b/ports/gdal/portfile.cmake @@ -4,9 +4,6 @@ endif() include(vcpkg_common_functions) -# Remove part pertaining to linkage -string(REPLACE "-static" "" ARCH ${TARGET_TRIPLET}) - vcpkg_download_distfile(ARCHIVE URLS "http://download.osgeo.org/gdal/1.11.3/gdal1113.zip" FILENAME "gdal1113.zip" @@ -15,13 +12,13 @@ vcpkg_download_distfile(ARCHIVE # Extract source into archictecture specific directory, because GDALs' nmake based build currently does not # support out of source builds. -set(SOURCE_PATH_DEBUG ${CURRENT_BUILDTREES_DIR}/src-${ARCH}-debug/gdal-1.11.3) -set(SOURCE_PATH_RELEASE ${CURRENT_BUILDTREES_DIR}/src-${ARCH}-release/gdal-1.11.3) +set(SOURCE_PATH_DEBUG ${CURRENT_BUILDTREES_DIR}/src-${TARGET_TRIPLET}-debug/gdal-1.11.3) +set(SOURCE_PATH_RELEASE ${CURRENT_BUILDTREES_DIR}/src-${TARGET_TRIPLET}-release/gdal-1.11.3) foreach(BUILD_TYPE debug release) - vcpkg_extract_source_archive(${ARCHIVE} ${CURRENT_BUILDTREES_DIR}/src-${ARCH}-${BUILD_TYPE}) + vcpkg_extract_source_archive(${ARCHIVE} ${CURRENT_BUILDTREES_DIR}/src-${TARGET_TRIPLET}-${BUILD_TYPE}) vcpkg_apply_patches( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src-${ARCH}-${BUILD_TYPE}/gdal-1.11.3 + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src-${TARGET_TRIPLET}-${BUILD_TYPE}/gdal-1.11.3 PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001-Add-support-for-MSVC1900-backported-from-GDAL2.patch ${CMAKE_CURRENT_LIST_DIR}/0002-Add-variable-CXX_CRT_FLAGS-to-allow-for-selection-of.patch -- cgit v1.2.3 From e3001c78b91531b5170181935fd7b0293fdb82a8 Mon Sep 17 00:00:00 2001 From: Manuel Massing Date: Wed, 30 Nov 2016 10:26:18 +0100 Subject: [gdal] Enable building of PDBs in release builds as well, copy PDBs over --- ...lusion-of-PDB-in-release-dll-if-so-reques.patch | 26 ++++++++++++++++++++++ ports/gdal/portfile.cmake | 14 ++++++++---- 2 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 ports/gdal/0003-Ensures-inclusion-of-PDB-in-release-dll-if-so-reques.patch diff --git a/ports/gdal/0003-Ensures-inclusion-of-PDB-in-release-dll-if-so-reques.patch b/ports/gdal/0003-Ensures-inclusion-of-PDB-in-release-dll-if-so-reques.patch new file mode 100644 index 000000000..1065a2982 --- /dev/null +++ b/ports/gdal/0003-Ensures-inclusion-of-PDB-in-release-dll-if-so-reques.patch @@ -0,0 +1,26 @@ +From 9da0cb6eed442ebf3eea232cd85e26c155c963ef Mon Sep 17 00:00:00 2001 +From: Manuel Massing +Date: Tue, 29 Nov 2016 12:43:58 +0100 +Subject: [PATCH 3/4] - Ensures inclusion of PDB in release dll if so requested + +--- + gdal/nmake.opt | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/nmake.opt b/nmake.opt +index 47c2df8..4844d22 100644 +--- a/nmake.opt ++++ b/nmake.opt +@@ -174,6 +174,9 @@ SOFTWARNFLAGS= /wd4244 /wd4702 /wd4701 /wd4013 /wd4706 /wd4057 /wd4210 /wd4305 + # Linker debug options + !IFDEF DEBUG + LDEBUG= /debug ++!ELSEIFDEF WITH_PDB ++# Ensures that PDB is included in release DLL if so requested ++LDEBUG= /debug /opt:ref /opt:icf + !ENDIF + + # Uncomment the following if you are building for 64-bit windows +-- +2.10.1.windows.1 + diff --git a/ports/gdal/portfile.cmake b/ports/gdal/portfile.cmake index 698c96a5c..ee003d622 100644 --- a/ports/gdal/portfile.cmake +++ b/ports/gdal/portfile.cmake @@ -22,7 +22,8 @@ foreach(BUILD_TYPE debug release) PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001-Add-support-for-MSVC1900-backported-from-GDAL2.patch ${CMAKE_CURRENT_LIST_DIR}/0002-Add-variable-CXX_CRT_FLAGS-to-allow-for-selection-of.patch - ) + ${CMAKE_CURRENT_LIST_DIR}/0003-Ensures-inclusion-of-PDB-in-release-dll-if-so-reques.patch + ) endforeach() find_program(NMAKE nmake REQUIRED) @@ -48,9 +49,10 @@ if(TARGET_TRIPLET MATCHES "x64") endif() if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - list(APPEND NMAKE_OPTIONS - PROJ_FLAGS=-DPROJ_STATIC - ) + list(APPEND NMAKE_OPTIONS PROJ_FLAGS=-DPROJ_STATIC) +else() + # Enables PDBs for release and debug builds + list(APPEND NMAKE_OPTIONS WITH_PDB=1) endif() if (VCPKG_CRT_LINKAGE STREQUAL static) @@ -117,6 +119,10 @@ else() file(GLOB EXE_FILES ${CURRENT_PACKAGES_DIR}/bin/*.exe) file(REMOVE ${EXE_FILES} ${CURRENT_PACKAGES_DIR}/lib/gdal.lib) endif() + +# Copy over PDBs +vcpkg_copy_pdbs() + # Handle copyright file(RENAME ${CURRENT_PACKAGES_DIR}/share/gdal/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/gdal/copyright) -- cgit v1.2.3 From 05f9b3a164085d3069be3e95d6bb469fc9b0438f Mon Sep 17 00:00:00 2001 From: Manuel Massing Date: Wed, 30 Nov 2016 10:26:18 +0100 Subject: [gdal] Rename dynamic gdal libraries to match static library naming, add "d" suffix for debug libraries --- ports/gdal/portfile.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ports/gdal/portfile.cmake b/ports/gdal/portfile.cmake index ee003d622..e5f148922 100644 --- a/ports/gdal/portfile.cmake +++ b/ports/gdal/portfile.cmake @@ -66,6 +66,7 @@ set(NMAKE_OPTIONS_REL CXX_CRT_FLAGS=${LINKAGE_FLAGS} PROJ_LIBRARY=${PROJ_LIBRARY_REL} ) + set(NMAKE_OPTIONS_DBG "${NMAKE_OPTIONS}" CXX_CRT_FLAGS="${LINKAGE_FLAGS}d" @@ -113,11 +114,14 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/gdal_i.lib) file(COPY ${SOURCE_PATH_DEBUG}/gdal.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) file(COPY ${SOURCE_PATH_RELEASE}/gdal.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gdal.lib ${CURRENT_PACKAGES_DIR}/debug/lib/gdald.lib) else() - file(COPY ${SOURCE_PATH_DEBUG}/gdal111.dll DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) - file(COPY ${SOURCE_PATH_DEBUG}/gdal_i.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) file(GLOB EXE_FILES ${CURRENT_PACKAGES_DIR}/bin/*.exe) file(REMOVE ${EXE_FILES} ${CURRENT_PACKAGES_DIR}/lib/gdal.lib) + file(COPY ${SOURCE_PATH_DEBUG}/gdal111.dll DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) + file(COPY ${SOURCE_PATH_DEBUG}/gdal_i.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + file(RENAME ${CURRENT_PACKAGES_DIR}/lib/gdal_i.lib ${CURRENT_PACKAGES_DIR}/lib/gdal.lib) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gdal_i.lib ${CURRENT_PACKAGES_DIR}/debug/lib/gdald.lib) endif() # Copy over PDBs -- cgit v1.2.3 From 5b2d836e1436c8557909797285131e46eac81d88 Mon Sep 17 00:00:00 2001 From: flysha Date: Wed, 30 Nov 2016 23:03:49 +0800 Subject: [aws-sdk-cpp] enable static and disable test --- ports/aws-sdk-cpp/portfile.cmake | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ports/aws-sdk-cpp/portfile.cmake b/ports/aws-sdk-cpp/portfile.cmake index 16ba1916c..321ec5f8c 100644 --- a/ports/aws-sdk-cpp/portfile.cmake +++ b/ports/aws-sdk-cpp/portfile.cmake @@ -1,8 +1,3 @@ -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(STATUS "Warning: Static building not supported yet. Building dynamic.") #Blocked by CRT MD link issue. - set(VCPKG_LIBRARY_LINKAGE dynamic) -endif() - include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/aws-sdk-cpp-1.0.34) vcpkg_download_distfile(ARCHIVE @@ -18,8 +13,15 @@ vcpkg_apply_patches( ${CMAKE_CURRENT_LIST_DIR}/drop_git.patch ) +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + set(FORCE_SHARED_CRT ON) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DENABLE_TESTING=OFF + -DFORCE_SHARED_CRT=${FORCE_SHARED_CRT} ) vcpkg_install_cmake() -- cgit v1.2.3 From 915d99ecb751c3607adac689e7353f59d30f13f6 Mon Sep 17 00:00:00 2001 From: flysha Date: Wed, 30 Nov 2016 23:06:00 +0800 Subject: [aws-sdk-cpp] correct FORCE_SHARED_CRT --- ports/aws-sdk-cpp/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/aws-sdk-cpp/portfile.cmake b/ports/aws-sdk-cpp/portfile.cmake index 321ec5f8c..f012719a8 100644 --- a/ports/aws-sdk-cpp/portfile.cmake +++ b/ports/aws-sdk-cpp/portfile.cmake @@ -14,7 +14,7 @@ vcpkg_apply_patches( ) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - set(FORCE_SHARED_CRT ON) + set(FORCE_SHARED_CRT OFF) endif() vcpkg_configure_cmake( -- cgit v1.2.3 From 5a04753a4a99a6210990b25e8773b86ccbffec0b Mon Sep 17 00:00:00 2001 From: Alexander Kaspar Date: Wed, 30 Nov 2016 17:16:59 +0100 Subject: [qca] added PS script to extract local certs from store --- ports/qca/0001-fix-path-for-vcpkg.patch | 23 +++++++++++++++------- ports/qca/import-local-certificates.ps1 | 35 +++++++++++++++++++++++++++++++++ ports/qca/portfile.cmake | 17 +++++++++++++++- 3 files changed, 67 insertions(+), 8 deletions(-) create mode 100644 ports/qca/import-local-certificates.ps1 diff --git a/ports/qca/0001-fix-path-for-vcpkg.patch b/ports/qca/0001-fix-path-for-vcpkg.patch index d7764c01d..9db22af1d 100644 --- a/ports/qca/0001-fix-path-for-vcpkg.patch +++ b/ports/qca/0001-fix-path-for-vcpkg.patch @@ -1,14 +1,14 @@ -From bab44a6614d4a540af56860432bcc0d6bdf420c9 Mon Sep 17 00:00:00 2001 -From: devel -Date: Wed, 23 Nov 2016 16:54:44 +0100 +From a3a8d50f3bdcb4df630f7126718c21f23efd7832 Mon Sep 17 00:00:00 2001 +From: Alexander Kaspar +Date: Wed, 30 Nov 2016 15:45:12 +0100 Subject: [PATCH] fix path for vcpkg --- - CMakeLists.txt | 16 ++++++++-------- - 1 file changed, 8 insertions(+), 8 deletions(-) + CMakeLists.txt | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt -index 605621b..a8c3774 100644 +index 605621b..3b5a9be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -277,7 +277,7 @@ if(DEVELOPER_MODE) @@ -20,6 +20,15 @@ index 605621b..a8c3774 100644 ") endif() +@@ -320,7 +320,7 @@ else (qca_CERTSTORE) + set( qca_CERTSTORE "${CMAKE_CURRENT_SOURCE_DIR}/certs/rootcerts.pem") + # note that INSTALL_FILES targets are relative to the current installation prefix... + if(NOT DEVELOPER_MODE) +- install(FILES "${qca_CERTSTORE}" DESTINATION "${QCA_PREFIX_INSTALL_DIR}/certs") ++ install(FILES "${qca_CERTSTORE}" DESTINATION "${QCA_PREFIX_INSTALL_DIR}/share/qca/certs") + endif() + endif (qca_CERTSTORE) + message(STATUS "certstore path: " ${qca_CERTSTORE}) @@ -401,10 +401,10 @@ endif(DOXYGEN_FOUND) include(CMakePackageConfigHelpers) configure_package_config_file( @@ -50,5 +59,5 @@ index 605621b..a8c3774 100644 ) endif() -- -2.9.2.windows.1 +2.8.1.windows.1 diff --git a/ports/qca/import-local-certificates.ps1 b/ports/qca/import-local-certificates.ps1 new file mode 100644 index 000000000..94e68e766 --- /dev/null +++ b/ports/qca/import-local-certificates.ps1 @@ -0,0 +1,35 @@ +# According to: +# https://www.openssl.org/docs/faq.html#USER16 +# it is up to developers or admins to maintain CAs. +# +# This script imports LocalMachine certificates into rootcerts.pem +# needed by qca. +# +# PS> .\import-local-certificates.ps1 -certstore Root -outpath C:\src\git\vcpkg\ports\qca +# + +param ( + # one of Root, My, CA, ... + [string]$certstore = "Root", + # the path where it should be in qca buildtree (without trailing '\') + [Parameter(Mandatory=$true)][string]$outpath +) + +$certs = (Get-ChildItem -Path 'Cert:\LocalMachine\Root') +$outfile = $outpath + "\rootcerts.pem" + +Write-Host "Importing: " $certs.Count " certificates ..." + +foreach ($cert in $certs) +{ + $certs.GetIssuerName() + $out = New-Object String[] -ArgumentList 3 + $out[0] = "-----BEGIN CERTIFICATE-----" + $out[1] = [System.Convert]::ToBase64String($cert.PublicKey.EncodedKeyValue.RawData, "InsertLineBreaks") + $out[2] = "-----END CERTIFICATE-----" + + [System.IO.File]::AppendAllLines($outfile, $out) +} + +Write-Host "Written to: " $outfile +Write-Host "Importing certificates done." diff --git a/ports/qca/portfile.cmake b/ports/qca/portfile.cmake index 0ff913025..b92596ef9 100644 --- a/ports/qca/portfile.cmake +++ b/ports/qca/portfile.cmake @@ -53,8 +53,9 @@ vcpkg_configure_cmake( -DUSE_RELATIVE_PATHS=ON -DQT4_BUILD=OFF -DBUILD_TESTS=OFF - -DBUILD_TOOLS=OFF + -DBUILD_TOOLS=ON -DQCA_SUFFIX=OFF + -DQCA_FEATURE_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/share/qca/mkspecs/features OPTIONS_DEBUG -DQCA_PLUGINS_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/debug/bin/Qca OPTIONS_RELEASE @@ -84,6 +85,20 @@ file(WRITE ${CURRENT_PACKAGES_DIR}/share/qca/cmake/QcaTargets.cmake "${QCA_TARGET_CONFIG}" ) +# Move tools +file(COPY ${CURRENT_PACKAGES_DIR}/bin/mozcerts.exe + DESTINATION ${CURRENT_PACKAGES_DIR}/share/qca/tools +) +file(COPY ${CURRENT_PACKAGES_DIR}/bin/qcatool.exe + DESTINATION ${CURRENT_PACKAGES_DIR}/share/qca/tools +) +file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/mozcerts.exe + ${CURRENT_PACKAGES_DIR}/bin/qcatool.exe + ${CURRENT_PACKAGES_DIR}/debug/bin/mozcerts.exe + ${CURRENT_PACKAGES_DIR}/debug/bin/mozcerts.pdb + ${CURRENT_PACKAGES_DIR}/debug/bin/qcatool.exe +) + # Remove unneeded dirs file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/share/man -- cgit v1.2.3 From 03cdf1dc97f05b7fc290c6c6eac1306aae1605ba Mon Sep 17 00:00:00 2001 From: Alexander Kaspar Date: Wed, 30 Nov 2016 21:34:35 +0100 Subject: [qca] import local certs --- ports/qca/import-local-certificates.ps1 | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/ports/qca/import-local-certificates.ps1 b/ports/qca/import-local-certificates.ps1 index 94e68e766..d0e644a50 100644 --- a/ports/qca/import-local-certificates.ps1 +++ b/ports/qca/import-local-certificates.ps1 @@ -22,13 +22,8 @@ Write-Host "Importing: " $certs.Count " certificates ..." foreach ($cert in $certs) { - $certs.GetIssuerName() - $out = New-Object String[] -ArgumentList 3 - $out[0] = "-----BEGIN CERTIFICATE-----" - $out[1] = [System.Convert]::ToBase64String($cert.PublicKey.EncodedKeyValue.RawData, "InsertLineBreaks") - $out[2] = "-----END CERTIFICATE-----" - - [System.IO.File]::AppendAllLines($outfile, $out) + $outfile = $outpath + "/" + $cert.Thumbprint + ".cer" + Export-Certificate -Cert $cert -FilePath $outfile } Write-Host "Written to: " $outfile -- cgit v1.2.3 From 0042316c4b57cf91ded8e474a8dda354340e7381 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 29 Nov 2016 18:08:53 -0800 Subject: Introduce filesystem_fs.h --- toolsrc/include/BuildInfo.h | 2 -- toolsrc/include/Paragraphs.h | 3 +-- toolsrc/include/coff_file_reader.h | 4 +--- toolsrc/include/filesystem_fs.h | 5 +++++ toolsrc/include/vcpkg.h | 3 --- toolsrc/include/vcpkg_Files.h | 10 ++++------ toolsrc/include/vcpkg_System.h | 5 ++--- toolsrc/include/vcpkg_paths.h | 4 +--- toolsrc/src/commands_hash.cpp | 2 -- toolsrc/src/commands_search.cpp | 2 -- toolsrc/src/metrics.cpp | 4 +--- toolsrc/src/post_build_lint.cpp | 3 --- toolsrc/src/vcpkg.cpp | 1 - toolsrc/src/vcpkg_Files.cpp | 3 --- toolsrc/src/vcpkg_System.cpp | 2 -- toolsrc/src/vcpkg_metrics_uploader.cpp | 2 -- toolsrc/src/vcpkg_paths.cpp | 1 - toolsrc/vcpkg/vcpkg.vcxproj | 1 + toolsrc/vcpkg/vcpkg.vcxproj.filters | 3 +++ 19 files changed, 19 insertions(+), 41 deletions(-) create mode 100644 toolsrc/include/filesystem_fs.h diff --git a/toolsrc/include/BuildInfo.h b/toolsrc/include/BuildInfo.h index 7c654d9c7..9f872385e 100644 --- a/toolsrc/include/BuildInfo.h +++ b/toolsrc/include/BuildInfo.h @@ -4,8 +4,6 @@ #include "Paragraphs.h" #include -namespace fs = std::tr2::sys; - namespace vcpkg { namespace PostBuildLint { enum class LinkageType diff --git a/toolsrc/include/Paragraphs.h b/toolsrc/include/Paragraphs.h index 22aaefe98..9e9fafe49 100644 --- a/toolsrc/include/Paragraphs.h +++ b/toolsrc/include/Paragraphs.h @@ -1,11 +1,10 @@ #pragma once -#include +#include "filesystem_fs.h" #include namespace vcpkg { namespace Paragraphs { - namespace fs = std::tr2::sys; std::vector> get_paragraphs(const fs::path& control_path); std::vector> parse_paragraphs(const std::string& str); }} diff --git a/toolsrc/include/coff_file_reader.h b/toolsrc/include/coff_file_reader.h index 81f107f10..1a9a071ef 100644 --- a/toolsrc/include/coff_file_reader.h +++ b/toolsrc/include/coff_file_reader.h @@ -1,12 +1,10 @@ #pragma once #include #include "MachineType.h" -#include +#include "filesystem_fs.h" namespace vcpkg {namespace COFFFileReader { - namespace fs = std::tr2::sys; - struct dll_info { MachineType machine_type; diff --git a/toolsrc/include/filesystem_fs.h b/toolsrc/include/filesystem_fs.h new file mode 100644 index 000000000..ece485c23 --- /dev/null +++ b/toolsrc/include/filesystem_fs.h @@ -0,0 +1,5 @@ +#pragma once + +#include + +namespace fs = std::tr2::sys; \ No newline at end of file diff --git a/toolsrc/include/vcpkg.h b/toolsrc/include/vcpkg.h index 81b4d45ba..832fb1920 100644 --- a/toolsrc/include/vcpkg.h +++ b/toolsrc/include/vcpkg.h @@ -1,6 +1,5 @@ #pragma once -#include #include "package_spec.h" #include "BinaryParagraph.h" #include "StatusParagraphs.h" @@ -8,8 +7,6 @@ namespace vcpkg { - namespace fs = std::tr2::sys; - extern bool g_do_dry_run; StatusParagraphs database_load_check(const vcpkg_paths& paths); diff --git a/toolsrc/include/vcpkg_Files.h b/toolsrc/include/vcpkg_Files.h index 8ed1eabe1..aa25d8333 100644 --- a/toolsrc/include/vcpkg_Files.h +++ b/toolsrc/include/vcpkg_Files.h @@ -1,22 +1,20 @@ #pragma once #include "expected.h" -#include +#include "filesystem_fs.h" #include namespace vcpkg {namespace Files { - namespace fs = std::tr2::sys; - static const char* FILESYSTEM_INVALID_CHARACTERS = R"(\/:*?"<>|)"; - void check_is_directory(const std::tr2::sys::path& dirpath); + void check_is_directory(const fs::path& dirpath); bool has_invalid_chars_for_filesystem(const std::string s); - expected get_contents(const std::tr2::sys::path& file_path) noexcept; + expected get_contents(const fs::path& file_path) noexcept; - std::tr2::sys::path find_file_recursively_up(const std::tr2::sys::path& starting_dir, const std::string& filename); + fs::path find_file_recursively_up(const fs::path& starting_dir, const std::string& filename); template void non_recursive_find_matching_paths_in_dir(const fs::path& dir, const Pred predicate, std::vector* output) diff --git a/toolsrc/include/vcpkg_System.h b/toolsrc/include/vcpkg_System.h index c420464c1..e059bde0a 100644 --- a/toolsrc/include/vcpkg_System.h +++ b/toolsrc/include/vcpkg_System.h @@ -1,12 +1,11 @@ #pragma once #include "vcpkg_Strings.h" - -#include +#include "filesystem_fs.h" namespace vcpkg {namespace System { - std::tr2::sys::path get_exe_path_of_current_process(); + fs::path get_exe_path_of_current_process(); struct exit_code_and_output { diff --git a/toolsrc/include/vcpkg_paths.h b/toolsrc/include/vcpkg_paths.h index 2dc9c7636..a2932070d 100644 --- a/toolsrc/include/vcpkg_paths.h +++ b/toolsrc/include/vcpkg_paths.h @@ -1,13 +1,11 @@ #pragma once -#include +#include "filesystem_fs.h" #include "expected.h" #include "package_spec.h" #include "BinaryParagraph.h" namespace vcpkg { - namespace fs = std::tr2::sys; - struct vcpkg_paths { static expected create(const fs::path& vcpkg_root_dir); diff --git a/toolsrc/src/commands_hash.cpp b/toolsrc/src/commands_hash.cpp index 4b89f2894..17c191b78 100644 --- a/toolsrc/src/commands_hash.cpp +++ b/toolsrc/src/commands_hash.cpp @@ -1,8 +1,6 @@ #include "vcpkg_Commands.h" #include "vcpkg_System.h" -namespace fs = std::tr2::sys; - namespace vcpkg { static void do_file_hash(fs::path const& path, std::wstring const& hashType) diff --git a/toolsrc/src/commands_search.cpp b/toolsrc/src/commands_search.cpp index 923368252..a604c5383 100644 --- a/toolsrc/src/commands_search.cpp +++ b/toolsrc/src/commands_search.cpp @@ -4,8 +4,6 @@ #include "vcpkglib_helpers.h" #include "SourceParagraph.h" -namespace fs = std::tr2::sys; - namespace vcpkg { static std::vector read_all_source_paragraphs(const vcpkg_paths& paths) diff --git a/toolsrc/src/metrics.cpp b/toolsrc/src/metrics.cpp index ada065fd6..23962bcfe 100644 --- a/toolsrc/src/metrics.cpp +++ b/toolsrc/src/metrics.cpp @@ -10,12 +10,10 @@ #include #include #include -#include +#include "filesystem_fs.h" #include "vcpkg_Strings.h" #include "vcpkg_System.h" -namespace fs = std::tr2::sys; - namespace vcpkg { static std::string GetCurrentDateTime() diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index 61fbba52a..1a09c99b7 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -1,4 +1,3 @@ -#include #include "vcpkg_paths.h" #include "package_spec.h" #include "vcpkg_Files.h" @@ -8,8 +7,6 @@ #include "BuildInfo.h" #include -namespace fs = std::tr2::sys; - namespace vcpkg { namespace PostBuildLint { enum class lint_status diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index b1fe76982..4b65ea972 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -6,7 +6,6 @@ #include #include #include -#include #include #include #include "vcpkg_Files.h" diff --git a/toolsrc/src/vcpkg_Files.cpp b/toolsrc/src/vcpkg_Files.cpp index 86e7080e4..b86edb4ab 100644 --- a/toolsrc/src/vcpkg_Files.cpp +++ b/toolsrc/src/vcpkg_Files.cpp @@ -1,10 +1,7 @@ #include "vcpkg_Files.h" #include -#include #include -namespace fs = std::tr2::sys; - namespace vcpkg {namespace Files { static const std::regex FILESYSTEM_INVALID_CHARACTERS_REGEX = std::regex(R"([\/:*?"<>|])"); diff --git a/toolsrc/src/vcpkg_System.cpp b/toolsrc/src/vcpkg_System.cpp index cc7080069..cb3eb6584 100644 --- a/toolsrc/src/vcpkg_System.cpp +++ b/toolsrc/src/vcpkg_System.cpp @@ -3,8 +3,6 @@ #include #include -namespace fs = std::tr2::sys; - namespace vcpkg {namespace System { fs::path get_exe_path_of_current_process() diff --git a/toolsrc/src/vcpkg_metrics_uploader.cpp b/toolsrc/src/vcpkg_metrics_uploader.cpp index f1f4a52ed..63668d1d7 100644 --- a/toolsrc/src/vcpkg_metrics_uploader.cpp +++ b/toolsrc/src/vcpkg_metrics_uploader.cpp @@ -1,10 +1,8 @@ #include "metrics.h" -#include #include "vcpkg_Checks.h" #include "vcpkg_Files.h" #include -namespace fs = std::tr2::sys; using namespace vcpkg; int WINAPI diff --git a/toolsrc/src/vcpkg_paths.cpp b/toolsrc/src/vcpkg_paths.cpp index 5347b79d8..b7e716307 100644 --- a/toolsrc/src/vcpkg_paths.cpp +++ b/toolsrc/src/vcpkg_paths.cpp @@ -1,4 +1,3 @@ -#include #include "expected.h" #include "vcpkg_paths.h" #include "metrics.h" diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/vcpkg/vcpkg.vcxproj index 9d9022229..7fab309d3 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj +++ b/toolsrc/vcpkg/vcpkg.vcxproj @@ -154,6 +154,7 @@ + diff --git a/toolsrc/vcpkg/vcpkg.vcxproj.filters b/toolsrc/vcpkg/vcpkg.vcxproj.filters index 568850787..cfbb17a22 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj.filters +++ b/toolsrc/vcpkg/vcpkg.vcxproj.filters @@ -110,5 +110,8 @@ Header Files + + Header Files + \ No newline at end of file -- cgit v1.2.3 From 5b6baf0ce065c1aa0e176ca2730226e0e6beae18 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 30 Nov 2016 14:06:49 -0800 Subject: Rename function --- toolsrc/src/post_build_lint.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index 1a09c99b7..5287ae359 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -17,7 +17,7 @@ namespace vcpkg { namespace PostBuildLint static const fs::path DUMPBIN_EXE = R"(%VS140COMNTOOLS%\..\..\VC\bin\dumpbin.exe)"; - static void print_vector_of_files(const std::vector& paths) + static void print_paths(const std::vector& paths) { System::println(""); for (const fs::path& p : paths) @@ -96,7 +96,7 @@ namespace vcpkg { namespace PostBuildLint if (!misplaced_cmake_files.empty()) { System::println(System::color::warning, "The following cmake files were found outside /share/%s. Please place cmake files in /share/%s.", spec.name(), spec.name()); - print_vector_of_files(misplaced_cmake_files); + print_paths(misplaced_cmake_files); return lint_status::ERROR_DETECTED; } @@ -124,7 +124,7 @@ namespace vcpkg { namespace PostBuildLint if (!dlls.empty()) { System::println(System::color::warning, "\nThe following dlls were found in /lib and /debug/lib. Please move them to /bin or /debug/bin, respectively."); - print_vector_of_files(dlls); + print_paths(dlls); return lint_status::ERROR_DETECTED; } @@ -172,7 +172,7 @@ namespace vcpkg { namespace PostBuildLint if (potential_copyright_files.size() > 1) { System::println(System::color::warning, "The following files are potential copyright files:"); - print_vector_of_files(potential_copyright_files); + print_paths(potential_copyright_files); } System::println(" %s/share/%s/copyright", packages_dir.generic_string(), spec.name()); @@ -188,7 +188,7 @@ namespace vcpkg { namespace PostBuildLint if (!exes.empty()) { System::println(System::color::warning, "The following EXEs were found in /bin and /debug/bin. EXEs are not valid distribution targets."); - print_vector_of_files(exes); + print_paths(exes); return lint_status::ERROR_DETECTED; } @@ -213,7 +213,7 @@ namespace vcpkg { namespace PostBuildLint if (!dlls_with_no_exports.empty()) { System::println(System::color::warning, "The following DLLs have no exports:"); - print_vector_of_files(dlls_with_no_exports); + print_paths(dlls_with_no_exports); System::println(System::color::warning, "DLLs without any exports are likely a bug in the build script."); return lint_status::ERROR_DETECTED; } @@ -244,7 +244,7 @@ namespace vcpkg { namespace PostBuildLint if (!dlls_with_improper_uwp_bit.empty()) { System::println(System::color::warning, "The following DLLs do not have the App Container bit set:"); - print_vector_of_files(dlls_with_improper_uwp_bit); + print_paths(dlls_with_improper_uwp_bit); System::println(System::color::warning, "This bit is required for Windows Store apps."); return lint_status::ERROR_DETECTED; } @@ -346,7 +346,7 @@ namespace vcpkg { namespace PostBuildLint } System::println(System::color::warning, "DLLs should not be present in a static build, but the following DLLs were found:"); - print_vector_of_files(dlls); + print_paths(dlls); return lint_status::ERROR_DETECTED; } @@ -361,10 +361,10 @@ namespace vcpkg { namespace PostBuildLint System::println(System::color::warning, "Mismatching number of debug and release binaries. Found %d for debug but %d for release.", debug_count, release_count); System::println("Debug binaries"); - print_vector_of_files(debug_binaries); + print_paths(debug_binaries); System::println("Release binaries"); - print_vector_of_files(release_binaries); + print_paths(release_binaries); if (debug_count == 0) { @@ -402,7 +402,7 @@ namespace vcpkg { namespace PostBuildLint { System::println(System::color::warning, "Directory %s should have no subdirectories", dir.generic_string()); System::println("The following subdirectories were found: "); - print_vector_of_files(subdirectories); + print_paths(subdirectories); return lint_status::ERROR_DETECTED; } @@ -451,7 +451,7 @@ namespace vcpkg { namespace PostBuildLint { System::println(System::color::warning, "There should be no empty directories in %s", dir.generic_string()); System::println("The following empty directories were found: "); - print_vector_of_files(empty_directories); + print_paths(empty_directories); System::println(System::color::warning, "If a directory should be populated but is not, this might indicate an error in the portfile.\n" "If the directories are not needed and their creation cannot be disabled, use something like this in the portfile to remove them)\n" "\n" @@ -570,7 +570,7 @@ namespace vcpkg { namespace PostBuildLint if (!misplaced_files.empty()) { System::println(System::color::warning, "The following files are placed in\n%s and\n%s: ", package_dir.generic_string(), debug_dir.generic_string()); - print_vector_of_files(misplaced_files); + print_paths(misplaced_files); System::println(System::color::warning, "Files cannot be present in those directories.\n"); return lint_status::ERROR_DETECTED; } -- cgit v1.2.3 From ae379fedea589552ad7c98eb350c492ce830fb48 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 30 Nov 2016 14:08:43 -0800 Subject: Move print_paths() to Files:: --- toolsrc/include/vcpkg_Files.h | 2 ++ toolsrc/src/post_build_lint.cpp | 34 ++++++++++++---------------------- toolsrc/src/vcpkg_Files.cpp | 11 +++++++++++ 3 files changed, 25 insertions(+), 22 deletions(-) diff --git a/toolsrc/include/vcpkg_Files.h b/toolsrc/include/vcpkg_Files.h index aa25d8333..8b320303d 100644 --- a/toolsrc/include/vcpkg_Files.h +++ b/toolsrc/include/vcpkg_Files.h @@ -47,4 +47,6 @@ namespace vcpkg {namespace Files void non_recursive_find_all_files_in_dir(const fs::path& dir, std::vector* output); std::vector non_recursive_find_all_files_in_dir(const fs::path& dir); + + void print_paths(const std::vector& paths); }} diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index 5287ae359..3043bd4fa 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -17,16 +17,6 @@ namespace vcpkg { namespace PostBuildLint static const fs::path DUMPBIN_EXE = R"(%VS140COMNTOOLS%\..\..\VC\bin\dumpbin.exe)"; - static void print_paths(const std::vector& paths) - { - System::println(""); - for (const fs::path& p : paths) - { - System::println(" %s", p.generic_string()); - } - System::println(""); - } - static lint_status check_for_files_in_include_directory(const fs::path& package_dir) { const fs::path include_dir = package_dir / "include"; @@ -96,7 +86,7 @@ namespace vcpkg { namespace PostBuildLint if (!misplaced_cmake_files.empty()) { System::println(System::color::warning, "The following cmake files were found outside /share/%s. Please place cmake files in /share/%s.", spec.name(), spec.name()); - print_paths(misplaced_cmake_files); + Files::print_paths(misplaced_cmake_files); return lint_status::ERROR_DETECTED; } @@ -124,7 +114,7 @@ namespace vcpkg { namespace PostBuildLint if (!dlls.empty()) { System::println(System::color::warning, "\nThe following dlls were found in /lib and /debug/lib. Please move them to /bin or /debug/bin, respectively."); - print_paths(dlls); + Files::print_paths(dlls); return lint_status::ERROR_DETECTED; } @@ -172,7 +162,7 @@ namespace vcpkg { namespace PostBuildLint if (potential_copyright_files.size() > 1) { System::println(System::color::warning, "The following files are potential copyright files:"); - print_paths(potential_copyright_files); + Files::print_paths(potential_copyright_files); } System::println(" %s/share/%s/copyright", packages_dir.generic_string(), spec.name()); @@ -188,7 +178,7 @@ namespace vcpkg { namespace PostBuildLint if (!exes.empty()) { System::println(System::color::warning, "The following EXEs were found in /bin and /debug/bin. EXEs are not valid distribution targets."); - print_paths(exes); + Files::print_paths(exes); return lint_status::ERROR_DETECTED; } @@ -213,7 +203,7 @@ namespace vcpkg { namespace PostBuildLint if (!dlls_with_no_exports.empty()) { System::println(System::color::warning, "The following DLLs have no exports:"); - print_paths(dlls_with_no_exports); + Files::print_paths(dlls_with_no_exports); System::println(System::color::warning, "DLLs without any exports are likely a bug in the build script."); return lint_status::ERROR_DETECTED; } @@ -244,7 +234,7 @@ namespace vcpkg { namespace PostBuildLint if (!dlls_with_improper_uwp_bit.empty()) { System::println(System::color::warning, "The following DLLs do not have the App Container bit set:"); - print_paths(dlls_with_improper_uwp_bit); + Files::print_paths(dlls_with_improper_uwp_bit); System::println(System::color::warning, "This bit is required for Windows Store apps."); return lint_status::ERROR_DETECTED; } @@ -346,7 +336,7 @@ namespace vcpkg { namespace PostBuildLint } System::println(System::color::warning, "DLLs should not be present in a static build, but the following DLLs were found:"); - print_paths(dlls); + Files::print_paths(dlls); return lint_status::ERROR_DETECTED; } @@ -361,10 +351,10 @@ namespace vcpkg { namespace PostBuildLint System::println(System::color::warning, "Mismatching number of debug and release binaries. Found %d for debug but %d for release.", debug_count, release_count); System::println("Debug binaries"); - print_paths(debug_binaries); + Files::print_paths(debug_binaries); System::println("Release binaries"); - print_paths(release_binaries); + Files::print_paths(release_binaries); if (debug_count == 0) { @@ -402,7 +392,7 @@ namespace vcpkg { namespace PostBuildLint { System::println(System::color::warning, "Directory %s should have no subdirectories", dir.generic_string()); System::println("The following subdirectories were found: "); - print_paths(subdirectories); + Files::print_paths(subdirectories); return lint_status::ERROR_DETECTED; } @@ -451,7 +441,7 @@ namespace vcpkg { namespace PostBuildLint { System::println(System::color::warning, "There should be no empty directories in %s", dir.generic_string()); System::println("The following empty directories were found: "); - print_paths(empty_directories); + Files::print_paths(empty_directories); System::println(System::color::warning, "If a directory should be populated but is not, this might indicate an error in the portfile.\n" "If the directories are not needed and their creation cannot be disabled, use something like this in the portfile to remove them)\n" "\n" @@ -570,7 +560,7 @@ namespace vcpkg { namespace PostBuildLint if (!misplaced_files.empty()) { System::println(System::color::warning, "The following files are placed in\n%s and\n%s: ", package_dir.generic_string(), debug_dir.generic_string()); - print_paths(misplaced_files); + Files::print_paths(misplaced_files); System::println(System::color::warning, "Files cannot be present in those directories.\n"); return lint_status::ERROR_DETECTED; } diff --git a/toolsrc/src/vcpkg_Files.cpp b/toolsrc/src/vcpkg_Files.cpp index b86edb4ab..698579736 100644 --- a/toolsrc/src/vcpkg_Files.cpp +++ b/toolsrc/src/vcpkg_Files.cpp @@ -1,6 +1,7 @@ #include "vcpkg_Files.h" #include #include +#include "vcpkg_System.h" namespace vcpkg {namespace Files { @@ -100,4 +101,14 @@ namespace vcpkg {namespace Files non_recursive_find_all_files_in_dir(dir, &v); return v; } + + void print_paths(const std::vector& paths) + { + System::println(""); + for (const fs::path& p : paths) + { + System::println(" %s", p.generic_string()); + } + System::println(""); + } }} -- cgit v1.2.3 From 223e7f970d30d3d97e64af3d1970d52cc0ddaaf5 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 30 Nov 2016 14:16:37 -0800 Subject: Use check_exit() instead of check_throw() --- toolsrc/src/BuildInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/BuildInfo.cpp b/toolsrc/src/BuildInfo.cpp index d96df8e8c..ddd44a1e6 100644 --- a/toolsrc/src/BuildInfo.cpp +++ b/toolsrc/src/BuildInfo.cpp @@ -127,7 +127,7 @@ namespace vcpkg { namespace PostBuildLint BuildInfo read_build_info(const fs::path& filepath) { const std::vector> pghs = Paragraphs::get_paragraphs(filepath); - Checks::check_throw(pghs.size() == 1, "Invalid BUILD_INFO file for package"); + Checks::check_exit(pghs.size() == 1, "Invalid BUILD_INFO file for package"); return BuildInfo::create(pghs[0]); } -- cgit v1.2.3 From 76f99eecfce01ef1ab4262f179819eb250b8d56e Mon Sep 17 00:00:00 2001 From: sdcb Date: Thu, 1 Dec 2016 10:23:35 +0800 Subject: [aws-sdk-cpp] add patch to define USE_IMPORT_EXPORT to fix dynamic build link issue --- ports/aws-sdk-cpp/portfile.cmake | 6 ++++++ ports/aws-sdk-cpp/shared_define.patch | 10 ++++++++++ 2 files changed, 16 insertions(+) create mode 100644 ports/aws-sdk-cpp/shared_define.patch diff --git a/ports/aws-sdk-cpp/portfile.cmake b/ports/aws-sdk-cpp/portfile.cmake index f012719a8..5ff1ba6b7 100644 --- a/ports/aws-sdk-cpp/portfile.cmake +++ b/ports/aws-sdk-cpp/portfile.cmake @@ -41,6 +41,12 @@ if(${VCPKG_LIBRARY_LINKAGE} STREQUAL dynamic) file(COPY ${LIB_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/lib) file(COPY ${DEBUG_LIB_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) file(REMOVE ${LIB_FILES} ${DEBUG_LIB_FILES}) + + vcpkg_apply_patches( #define USE_IMPORT_EXPORT in SDKConfig.h + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CURRENT_PACKAGES_DIR}/include/shared_define.patch + ) endif() # Handle copyright diff --git a/ports/aws-sdk-cpp/shared_define.patch b/ports/aws-sdk-cpp/shared_define.patch new file mode 100644 index 000000000..96657b33e --- /dev/null +++ b/ports/aws-sdk-cpp/shared_define.patch @@ -0,0 +1,10 @@ +diff --git a/aws/core/SDKConfig.h b/aws/core/SDKConfig.h +index 130c9dd..66b2630 100644 +--- a/aws/core/SDKConfig.h ++++ b/aws/core/SDKConfig.h +@@ -17,3 +17,4 @@ + + #define JSON_USE_EXCEPTION 0 + ++#define USE_IMPORT_EXPORT +\ No newline at end of file -- cgit v1.2.3 From e6a26aaa314a1267f5a1176d067fe7a2e1063ab2 Mon Sep 17 00:00:00 2001 From: sdcb Date: Thu, 1 Dec 2016 10:27:27 +0800 Subject: [aws-sdk-cpp] set FORCE_SHARED_CRT ON when building dynamic. --- ports/aws-sdk-cpp/portfile.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/aws-sdk-cpp/portfile.cmake b/ports/aws-sdk-cpp/portfile.cmake index 5ff1ba6b7..888a492d9 100644 --- a/ports/aws-sdk-cpp/portfile.cmake +++ b/ports/aws-sdk-cpp/portfile.cmake @@ -15,6 +15,8 @@ vcpkg_apply_patches( if(VCPKG_LIBRARY_LINKAGE STREQUAL static) set(FORCE_SHARED_CRT OFF) +else() + set(FORCE_SHARED_CRT ON) endif() vcpkg_configure_cmake( -- cgit v1.2.3 From 007de30723ade2ef68047b9c1f705a72b4f28f96 Mon Sep 17 00:00:00 2001 From: sdcb Date: Thu, 1 Dec 2016 10:56:43 +0800 Subject: [aws-sdk-cpp] correct patch path --- ports/aws-sdk-cpp/portfile.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/aws-sdk-cpp/portfile.cmake b/ports/aws-sdk-cpp/portfile.cmake index 888a492d9..a1f1a40b9 100644 --- a/ports/aws-sdk-cpp/portfile.cmake +++ b/ports/aws-sdk-cpp/portfile.cmake @@ -45,9 +45,9 @@ if(${VCPKG_LIBRARY_LINKAGE} STREQUAL dynamic) file(REMOVE ${LIB_FILES} ${DEBUG_LIB_FILES}) vcpkg_apply_patches( #define USE_IMPORT_EXPORT in SDKConfig.h - SOURCE_PATH ${SOURCE_PATH} + SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include PATCHES - ${CURRENT_PACKAGES_DIR}/include/shared_define.patch + ${CMAKE_CURRENT_LIST_DIR}/shared_define.patch ) endif() -- cgit v1.2.3 From 1f758b19a5250ae16e10ba21700976ba53197516 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 30 Nov 2016 13:26:28 -0800 Subject: [install-command] Verify files will not overwrite existing files --- toolsrc/src/vcpkg.cpp | 58 ++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 50 insertions(+), 8 deletions(-) diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index 4b65ea972..c198365e1 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -12,19 +12,13 @@ #include "vcpkg_System.h" #include "Paragraphs.h" #include +#include +#include "vcpkg_Maps.h" using namespace vcpkg; bool vcpkg::g_do_dry_run = false; -namespace -{ - std::fstream open_status_file(const vcpkg_paths& paths, std::ios_base::openmode mode = std::ios_base::app | std::ios_base::in | std::ios_base::out | std::ios_base::binary) - { - return std::fstream(paths.vcpkg_dir_status_file, mode); - } -} - static StatusParagraphs load_current_database(const fs::path& vcpkg_dir_status_file, const fs::path& vcpkg_dir_status_file_old) { if (!fs::exists(vcpkg_dir_status_file)) @@ -189,8 +183,56 @@ static void install_and_write_listfile(const vcpkg_paths& paths, const BinaryPar listfile.close(); } +static std::map remove_first_n_chars_and_map(const std::vector absolute_paths, const size_t n) +{ + std::map output; + + for (const fs::path& absolute_path : absolute_paths) + { + std::string suffix = absolute_path.generic_string(); + suffix.erase(0, n); + output.emplace(suffix, absolute_path); + } + + return output; +} + +static void print_map_values(const std::vector keys, const std::map& map) +{ + System::println(""); + for (const std::string& key : keys) + { + System::println(" %s", map.at(key).generic_string()); + } + System::println(""); +} + void vcpkg::install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs& status_db) { + const fs::path package_dir = paths.package_dir(binary_paragraph.spec); + const std::vector package_files = Files::recursive_find_all_files_in_dir(package_dir); + + const fs::path installed_dir = paths.installed / binary_paragraph.spec.target_triplet().canonical_name(); + const std::vector installed_files = Files::recursive_find_all_files_in_dir(installed_dir); + + const std::map package_files_relative_paths_to_absolute_paths = remove_first_n_chars_and_map(package_files, package_dir.generic_string().size() + 1); + const std::map installed_files_relative_paths_to_absolute_paths = remove_first_n_chars_and_map(installed_files, installed_dir.generic_string().size() + 1); + + const std::vector package_files_set = Maps::extract_keys(package_files_relative_paths_to_absolute_paths); + const std::vector installed_files_set = Maps::extract_keys(installed_files_relative_paths_to_absolute_paths); + + std::vector intersection; + std::set_intersection(package_files_set.cbegin(), package_files_set.cend(), + installed_files_set.cbegin(), installed_files_set.cend(), + std::back_inserter(intersection)); + + if (!intersection.empty()) + { + System::println(System::color::error, "The following files are already installed and are in conflict with %s:", binary_paragraph.spec); + print_map_values(intersection, installed_files_relative_paths_to_absolute_paths); + exit(EXIT_FAILURE); + } + StatusParagraph spgh; spgh.package = binary_paragraph; spgh.want = want_t::install; -- cgit v1.2.3 From 89aaf195fbdfa63708fd6ac90103cac0cdedf3c6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 1 Dec 2016 01:37:41 -0800 Subject: Remove unused variable --- toolsrc/include/vcpkg.h | 4 +--- toolsrc/src/vcpkg.cpp | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/toolsrc/include/vcpkg.h b/toolsrc/include/vcpkg.h index 832fb1920..2fc993616 100644 --- a/toolsrc/include/vcpkg.h +++ b/toolsrc/include/vcpkg.h @@ -7,19 +7,17 @@ namespace vcpkg { - extern bool g_do_dry_run; - StatusParagraphs database_load_check(const vcpkg_paths& paths); void install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs& status_db); void deinstall_package(const vcpkg_paths& paths, const package_spec& spec, StatusParagraphs& status_db); expected try_load_port(const fs::path& control_path); + inline expected try_load_port(const vcpkg_paths& paths, const std::string& name) { return try_load_port(paths.ports / name); } expected try_load_cached_package(const vcpkg_paths& paths, const package_spec& spec); - } // namespace vcpkg diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index c198365e1..6c34497b2 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -17,8 +17,6 @@ using namespace vcpkg; -bool vcpkg::g_do_dry_run = false; - static StatusParagraphs load_current_database(const fs::path& vcpkg_dir_status_file, const fs::path& vcpkg_dir_status_file_old) { if (!fs::exists(vcpkg_dir_status_file)) -- cgit v1.2.3 From 6eac44c9640a50fbde88535df6261a1a3f234350 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 1 Dec 2016 01:49:24 -0800 Subject: Move install_package() and deinstall_package() to the files of the appropriate commands --- toolsrc/include/vcpkg.h | 3 +- toolsrc/src/commands_installation.cpp | 132 ++++++++++++++++ toolsrc/src/commands_remove.cpp | 145 ++++++++++++++++++ toolsrc/src/vcpkg.cpp | 278 +--------------------------------- 4 files changed, 279 insertions(+), 279 deletions(-) diff --git a/toolsrc/include/vcpkg.h b/toolsrc/include/vcpkg.h index 2fc993616..ef78e213e 100644 --- a/toolsrc/include/vcpkg.h +++ b/toolsrc/include/vcpkg.h @@ -9,8 +9,7 @@ namespace vcpkg { StatusParagraphs database_load_check(const vcpkg_paths& paths); - void install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs& status_db); - void deinstall_package(const vcpkg_paths& paths, const package_spec& spec, StatusParagraphs& status_db); + void write_update(const vcpkg_paths& paths, const StatusParagraph& p); expected try_load_port(const fs::path& control_path); diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_installation.cpp index 93335220d..23342070d 100644 --- a/toolsrc/src/commands_installation.cpp +++ b/toolsrc/src/commands_installation.cpp @@ -67,6 +67,138 @@ namespace vcpkg // delete_directory(port_buildtrees_dir); } + static void install_and_write_listfile(const vcpkg_paths& paths, const BinaryParagraph& bpgh) + { + std::fstream listfile(paths.listfile_path(bpgh), std::ios_base::out | std::ios_base::binary | std::ios_base::trunc); + + auto package_prefix_path = paths.package_dir(bpgh.spec); + auto prefix_length = package_prefix_path.native().size(); + + const triplet& target_triplet = bpgh.spec.target_triplet(); + const std::string& target_triplet_as_string = target_triplet.canonical_name(); + std::error_code ec; + fs::create_directory(paths.installed / target_triplet_as_string, ec); + listfile << target_triplet << "\n"; + + for (auto it = fs::recursive_directory_iterator(package_prefix_path); it != fs::recursive_directory_iterator(); ++it) + { + const std::string filename = it->path().filename().generic_string(); + if (fs::is_regular_file(it->status()) && (_stricmp(filename.c_str(), "CONTROL") == 0 || _stricmp(filename.c_str(), "BUILD_INFO") == 0)) + { + // Do not copy the control file + continue; + } + + auto suffix = it->path().generic_u8string().substr(prefix_length + 1); + auto target = paths.installed / target_triplet_as_string / suffix; + + auto status = it->status(ec); + if (ec) + { + System::println(System::color::error, "failed: %s: %s", it->path().u8string(), ec.message()); + continue; + } + if (fs::is_directory(status)) + { + fs::create_directory(target, ec); + if (ec) + { + System::println(System::color::error, "failed: %s: %s", target.u8string(), ec.message()); + } + + listfile << target_triplet << "/" << suffix << "\n"; + } + else if (fs::is_regular_file(status)) + { + fs::copy_file(*it, target, ec); + if (ec) + { + System::println(System::color::error, "failed: %s: %s", target.u8string(), ec.message()); + } + listfile << target_triplet << "/" << suffix << "\n"; + } + else if (!fs::status_known(status)) + { + System::println(System::color::error, "failed: %s: unknown status", it->path().u8string()); + } + else + System::println(System::color::error, "failed: %s: cannot handle file type", it->path().u8string()); + } + + listfile.close(); + } + + static std::map remove_first_n_chars_and_map(const std::vector absolute_paths, const size_t n) + { + std::map output; + + for (const fs::path& absolute_path : absolute_paths) + { + std::string suffix = absolute_path.generic_string(); + suffix.erase(0, n); + output.emplace(suffix, absolute_path); + } + + return output; + } + + static void print_map_values(const std::vector keys, const std::map& map) + { + System::println(""); + for (const std::string& key : keys) + { + System::println(" %s", map.at(key).generic_string()); + } + System::println(""); + } + + static void install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs& status_db) + { + const fs::path package_dir = paths.package_dir(binary_paragraph.spec); + const std::vector package_files = Files::recursive_find_all_files_in_dir(package_dir); + + const fs::path installed_dir = paths.installed / binary_paragraph.spec.target_triplet().canonical_name(); + const std::vector installed_files = Files::recursive_find_all_files_in_dir(installed_dir); + + const std::map package_files_relative_paths_to_absolute_paths = remove_first_n_chars_and_map(package_files, package_dir.generic_string().size() + 1); + const std::map installed_files_relative_paths_to_absolute_paths = remove_first_n_chars_and_map(installed_files, installed_dir.generic_string().size() + 1); + + const std::vector package_files_set = Maps::extract_keys(package_files_relative_paths_to_absolute_paths); + const std::vector installed_files_set = Maps::extract_keys(installed_files_relative_paths_to_absolute_paths); + + std::vector intersection; + std::set_intersection(package_files_set.cbegin(), package_files_set.cend(), + installed_files_set.cbegin(), installed_files_set.cend(), + std::back_inserter(intersection)); + + if (!intersection.empty()) + { + System::println(System::color::error, "The following files are already installed and are in conflict with %s:", binary_paragraph.spec); + print_map_values(intersection, installed_files_relative_paths_to_absolute_paths); + exit(EXIT_FAILURE); + } + + StatusParagraph spgh; + spgh.package = binary_paragraph; + spgh.want = want_t::install; + spgh.state = install_state_t::half_installed; + for (auto&& dep : spgh.package.depends) + { + if (status_db.find_installed(dep, spgh.package.spec.target_triplet()) == status_db.end()) + { + Checks::unreachable(); + } + } + write_update(paths, spgh); + status_db.insert(std::make_unique(spgh)); + + install_and_write_listfile(paths, spgh.package); + + spgh.state = install_state_t::installed; + write_update(paths, spgh); + status_db.insert(std::make_unique(spgh)); + } + 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"); diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index 5bb9ecc96..31331fc2f 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -2,6 +2,7 @@ #include "vcpkg.h" #include "vcpkg_System.h" #include "vcpkg_Input.h" +#include namespace vcpkg { @@ -21,6 +22,150 @@ namespace vcpkg } } + enum class deinstall_plan + { + not_installed, + dependencies_not_satisfied, + should_deinstall + }; + + static deinstall_plan deinstall_package_plan( + const StatusParagraphs::iterator package_it, + const StatusParagraphs& status_db, + std::vector& dependencies_out) + { + dependencies_out.clear(); + + if (package_it == status_db.end() || (*package_it)->state == install_state_t::not_installed) + { + return deinstall_plan::not_installed; + } + + auto& pkg = (*package_it)->package; + + for (auto&& inst_pkg : status_db) + { + if (inst_pkg->want != want_t::install) + continue; + if (inst_pkg->package.spec.target_triplet() != pkg.spec.target_triplet()) + continue; + + const auto& deps = inst_pkg->package.depends; + + if (std::find(deps.begin(), deps.end(), pkg.spec.name()) != deps.end()) + { + dependencies_out.push_back(inst_pkg.get()); + } + } + + if (!dependencies_out.empty()) + return deinstall_plan::dependencies_not_satisfied; + + return deinstall_plan::should_deinstall; + } + + static void deinstall_package(const vcpkg_paths& paths, const package_spec& spec, StatusParagraphs& status_db) + { + auto package_it = status_db.find(spec.name(), spec.target_triplet()); + if (package_it == status_db.end()) + { + System::println(System::color::success, "Package %s is not installed", spec); + return; + } + + auto& pkg = **package_it; + + std::vector deps; + auto plan = deinstall_package_plan(package_it, status_db, deps); + switch (plan) + { + case deinstall_plan::not_installed: + System::println(System::color::success, "Package %s is not installed", spec); + return; + case deinstall_plan::dependencies_not_satisfied: + System::println(System::color::error, "Error: Cannot remove package %s:", spec); + for (auto&& dep : deps) + { + System::println(" %s depends on %s", dep->package.displayname(), pkg.package.displayname()); + } + exit(EXIT_FAILURE); + case deinstall_plan::should_deinstall: + break; + default: + Checks::unreachable(); + } + + pkg.want = want_t::purge; + pkg.state = install_state_t::half_installed; + write_update(paths, pkg); + + std::fstream listfile(paths.listfile_path(pkg.package), std::ios_base::in | std::ios_base::binary); + if (listfile) + { + std::vector dirs_touched; + std::string suffix; + while (std::getline(listfile, suffix)) + { + if (!suffix.empty() && suffix.back() == '\r') + suffix.pop_back(); + + std::error_code ec; + + auto target = paths.installed / suffix; + + auto status = fs::status(target, ec); + if (ec) + { + System::println(System::color::error, "failed: %s", ec.message()); + continue; + } + + if (fs::is_directory(status)) + { + dirs_touched.push_back(target); + } + else if (fs::is_regular_file(status)) + { + fs::remove(target, ec); + if (ec) + { + System::println(System::color::error, "failed: %s: %s", target.u8string(), ec.message()); + } + } + else if (!fs::status_known(status)) + { + System::println(System::color::warning, "Warning: unknown status: %s", target.u8string()); + } + else + { + System::println(System::color::warning, "Warning: %s: cannot handle file type", target.u8string()); + } + } + + auto b = dirs_touched.rbegin(); + auto e = dirs_touched.rend(); + for (; b != e; ++b) + { + if (fs::directory_iterator(*b) == fs::directory_iterator()) + { + std::error_code ec; + fs::remove(*b, ec); + if (ec) + { + System::println(System::color::error, "failed: %s", ec.message()); + } + } + } + + listfile.close(); + fs::remove(paths.listfile_path(pkg.package)); + } + + pkg.state = install_state_t::not_installed; + write_update(paths, pkg); + 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) { static const std::string example = create_example_string("remove zlib zlib:x64-windows curl boost"); diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index 6c34497b2..f8ebc7de4 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -108,7 +108,7 @@ static std::string get_fullpkgname_from_listfile(const fs::path& path) return ret; } -static void write_update(const vcpkg_paths& paths, const StatusParagraph& p) +void vcpkg::write_update(const vcpkg_paths& paths, const StatusParagraph& p) { static int update_id = 0; auto my_update_id = update_id++; @@ -120,282 +120,6 @@ static void write_update(const vcpkg_paths& paths, const StatusParagraph& p) fs::rename(tmp_update_filename, update_filename); } -static void install_and_write_listfile(const vcpkg_paths& paths, const BinaryParagraph& bpgh) -{ - std::fstream listfile(paths.listfile_path(bpgh), std::ios_base::out | std::ios_base::binary | std::ios_base::trunc); - - auto package_prefix_path = paths.package_dir(bpgh.spec); - auto prefix_length = package_prefix_path.native().size(); - - const triplet& target_triplet = bpgh.spec.target_triplet(); - const std::string& target_triplet_as_string = target_triplet.canonical_name(); - std::error_code ec; - fs::create_directory(paths.installed / target_triplet_as_string, ec); - listfile << target_triplet << "\n"; - - for (auto it = fs::recursive_directory_iterator(package_prefix_path); it != fs::recursive_directory_iterator(); ++it) - { - const std::string filename = it->path().filename().generic_string(); - if (fs::is_regular_file(it->status()) && (_stricmp(filename.c_str(), "CONTROL") == 0 || _stricmp(filename.c_str(), "BUILD_INFO") == 0)) - { - // Do not copy the control file - continue; - } - - auto suffix = it->path().generic_u8string().substr(prefix_length + 1); - auto target = paths.installed / target_triplet_as_string / suffix; - - auto status = it->status(ec); - if (ec) - { - System::println(System::color::error, "failed: %s: %s", it->path().u8string(), ec.message()); - continue; - } - if (fs::is_directory(status)) - { - fs::create_directory(target, ec); - if (ec) - { - System::println(System::color::error, "failed: %s: %s", target.u8string(), ec.message()); - } - - listfile << target_triplet << "/" << suffix << "\n"; - } - else if (fs::is_regular_file(status)) - { - fs::copy_file(*it, target, ec); - if (ec) - { - System::println(System::color::error, "failed: %s: %s", target.u8string(), ec.message()); - } - listfile << target_triplet << "/" << suffix << "\n"; - } - else if (!fs::status_known(status)) - { - System::println(System::color::error, "failed: %s: unknown status", it->path().u8string()); - } - else - System::println(System::color::error, "failed: %s: cannot handle file type", it->path().u8string()); - } - - listfile.close(); -} - -static std::map remove_first_n_chars_and_map(const std::vector absolute_paths, const size_t n) -{ - std::map output; - - for (const fs::path& absolute_path : absolute_paths) - { - std::string suffix = absolute_path.generic_string(); - suffix.erase(0, n); - output.emplace(suffix, absolute_path); - } - - return output; -} - -static void print_map_values(const std::vector keys, const std::map& map) -{ - System::println(""); - for (const std::string& key : keys) - { - System::println(" %s", map.at(key).generic_string()); - } - System::println(""); -} - -void vcpkg::install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs& status_db) -{ - const fs::path package_dir = paths.package_dir(binary_paragraph.spec); - const std::vector package_files = Files::recursive_find_all_files_in_dir(package_dir); - - const fs::path installed_dir = paths.installed / binary_paragraph.spec.target_triplet().canonical_name(); - const std::vector installed_files = Files::recursive_find_all_files_in_dir(installed_dir); - - const std::map package_files_relative_paths_to_absolute_paths = remove_first_n_chars_and_map(package_files, package_dir.generic_string().size() + 1); - const std::map installed_files_relative_paths_to_absolute_paths = remove_first_n_chars_and_map(installed_files, installed_dir.generic_string().size() + 1); - - const std::vector package_files_set = Maps::extract_keys(package_files_relative_paths_to_absolute_paths); - const std::vector installed_files_set = Maps::extract_keys(installed_files_relative_paths_to_absolute_paths); - - std::vector intersection; - std::set_intersection(package_files_set.cbegin(), package_files_set.cend(), - installed_files_set.cbegin(), installed_files_set.cend(), - std::back_inserter(intersection)); - - if (!intersection.empty()) - { - System::println(System::color::error, "The following files are already installed and are in conflict with %s:", binary_paragraph.spec); - print_map_values(intersection, installed_files_relative_paths_to_absolute_paths); - exit(EXIT_FAILURE); - } - - StatusParagraph spgh; - spgh.package = binary_paragraph; - spgh.want = want_t::install; - spgh.state = install_state_t::half_installed; - for (auto&& dep : spgh.package.depends) - { - if (status_db.find_installed(dep, spgh.package.spec.target_triplet()) == status_db.end()) - { - Checks::unreachable(); - } - } - write_update(paths, spgh); - status_db.insert(std::make_unique(spgh)); - - install_and_write_listfile(paths, spgh.package); - - spgh.state = install_state_t::installed; - write_update(paths, spgh); - status_db.insert(std::make_unique(spgh)); -} - -enum class deinstall_plan -{ - not_installed, - dependencies_not_satisfied, - should_deinstall -}; - -static deinstall_plan deinstall_package_plan( - const StatusParagraphs::iterator package_it, - const StatusParagraphs& status_db, - std::vector& dependencies_out) -{ - dependencies_out.clear(); - - if (package_it == status_db.end() || (*package_it)->state == install_state_t::not_installed) - { - return deinstall_plan::not_installed; - } - - auto& pkg = (*package_it)->package; - - for (auto&& inst_pkg : status_db) - { - if (inst_pkg->want != want_t::install) - continue; - if (inst_pkg->package.spec.target_triplet() != pkg.spec.target_triplet()) - continue; - - const auto& deps = inst_pkg->package.depends; - - if (std::find(deps.begin(), deps.end(), pkg.spec.name()) != deps.end()) - { - dependencies_out.push_back(inst_pkg.get()); - } - } - - if (!dependencies_out.empty()) - return deinstall_plan::dependencies_not_satisfied; - - return deinstall_plan::should_deinstall; -} - -void vcpkg::deinstall_package(const vcpkg_paths& paths, const package_spec& spec, StatusParagraphs& status_db) -{ - auto package_it = status_db.find(spec.name(), spec.target_triplet()); - if (package_it == status_db.end()) - { - System::println(System::color::success, "Package %s is not installed", spec); - return; - } - - auto& pkg = **package_it; - - std::vector deps; - auto plan = deinstall_package_plan(package_it, status_db, deps); - switch (plan) - { - case deinstall_plan::not_installed: - System::println(System::color::success, "Package %s is not installed", spec); - return; - case deinstall_plan::dependencies_not_satisfied: - System::println(System::color::error, "Error: Cannot remove package %s:", spec); - for (auto&& dep : deps) - { - System::println(" %s depends on %s", dep->package.displayname(), pkg.package.displayname()); - } - exit(EXIT_FAILURE); - case deinstall_plan::should_deinstall: - break; - default: - Checks::unreachable(); - } - - pkg.want = want_t::purge; - pkg.state = install_state_t::half_installed; - write_update(paths, pkg); - - std::fstream listfile(paths.listfile_path(pkg.package), std::ios_base::in | std::ios_base::binary); - if (listfile) - { - std::vector dirs_touched; - std::string suffix; - while (std::getline(listfile, suffix)) - { - if (!suffix.empty() && suffix.back() == '\r') - suffix.pop_back(); - - std::error_code ec; - - auto target = paths.installed / suffix; - - auto status = fs::status(target, ec); - if (ec) - { - System::println(System::color::error, "failed: %s", ec.message()); - continue; - } - - if (fs::is_directory(status)) - { - dirs_touched.push_back(target); - } - else if (fs::is_regular_file(status)) - { - fs::remove(target, ec); - if (ec) - { - System::println(System::color::error, "failed: %s: %s", target.u8string(), ec.message()); - } - } - else if (!fs::status_known(status)) - { - System::println(System::color::warning, "Warning: unknown status: %s", target.u8string()); - } - else - { - System::println(System::color::warning, "Warning: %s: cannot handle file type", target.u8string()); - } - } - - auto b = dirs_touched.rbegin(); - auto e = dirs_touched.rend(); - for (; b != e; ++b) - { - if (fs::directory_iterator(*b) == fs::directory_iterator()) - { - std::error_code ec; - fs::remove(*b, ec); - if (ec) - { - System::println(System::color::error, "failed: %s", ec.message()); - } - } - } - - listfile.close(); - fs::remove(paths.listfile_path(pkg.package)); - } - - pkg.state = install_state_t::not_installed; - write_update(paths, pkg); - System::println(System::color::success, "Package %s was successfully removed", pkg.package.displayname()); -} - expected vcpkg::try_load_port(const fs::path& path) { try -- cgit v1.2.3 From 53598df2874436a31ea6d4f1dd112310afaa83f4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 1 Dec 2016 02:02:49 -0800 Subject: Remove unused #include directives --- toolsrc/src/vcpkg.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index f8ebc7de4..05ff7340f 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -7,13 +7,9 @@ #include #include #include -#include #include "vcpkg_Files.h" -#include "vcpkg_System.h" #include "Paragraphs.h" #include -#include -#include "vcpkg_Maps.h" using namespace vcpkg; -- cgit v1.2.3 From 79399923b6cd98b9e77020615e433ef0560d5dc2 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 1 Dec 2016 02:03:07 -0800 Subject: Remove unused function --- toolsrc/src/vcpkg.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index 05ff7340f..6c5224f56 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -97,13 +97,6 @@ StatusParagraphs vcpkg::database_load_check(const vcpkg_paths& paths) return current_status_db; } -static std::string get_fullpkgname_from_listfile(const fs::path& path) -{ - auto ret = path.stem().generic_u8string(); - std::replace(ret.begin(), ret.end(), '_', ':'); - return ret; -} - void vcpkg::write_update(const vcpkg_paths& paths, const StatusParagraph& p) { static int update_id = 0; -- cgit v1.2.3 From 0f797c7a0127e2575e3ac0ad56d829383ec5b5ae Mon Sep 17 00:00:00 2001 From: Alexander Kaspar Date: Thu, 1 Dec 2016 13:43:36 +0100 Subject: [qca] working on certstore --- ports/qca/CONTROL | 2 +- ports/qca/import-local-certificates.ps1 | 17 ++++++++++++----- ports/qca/portfile.cmake | 34 ++++++++++++++++----------------- 3 files changed, 29 insertions(+), 24 deletions(-) diff --git a/ports/qca/CONTROL b/ports/qca/CONTROL index d3dd43ab5..cbe923bb4 100644 --- a/ports/qca/CONTROL +++ b/ports/qca/CONTROL @@ -1,4 +1,4 @@ Source: qca Version: 2.2.0 -Description: Qt Cryptographic Api (QCA) +Description: Qt Cryptographic Architecture (QCA). Sources: https://cgit.kde.org/qca.git/ Build-Depends: qt5 diff --git a/ports/qca/import-local-certificates.ps1 b/ports/qca/import-local-certificates.ps1 index d0e644a50..df39cbb01 100644 --- a/ports/qca/import-local-certificates.ps1 +++ b/ports/qca/import-local-certificates.ps1 @@ -5,7 +5,7 @@ # This script imports LocalMachine certificates into rootcerts.pem # needed by qca. # -# PS> .\import-local-certificates.ps1 -certstore Root -outpath C:\src\git\vcpkg\ports\qca +# PS> .\import-local-certificates.ps1 [-certstore Root] -outpath C:\src\git\vcpkg\ports\qca # param ( @@ -15,15 +15,22 @@ param ( [Parameter(Mandatory=$true)][string]$outpath ) -$certs = (Get-ChildItem -Path 'Cert:\LocalMachine\Root') -$outfile = $outpath + "\rootcerts.pem" +$certs = (Get-ChildItem -Path 'Cert:\LocalMachine\Root' -EKU "Server Authentication") +$outfile = $outpath + "rootcerts.pem" Write-Host "Importing: " $certs.Count " certificates ..." foreach ($cert in $certs) { - $outfile = $outpath + "/" + $cert.Thumbprint + ".cer" - Export-Certificate -Cert $cert -FilePath $outfile + $out = New-Object String[] -ArgumentList 5 + + $out[0] = " " + $out[1] = "# " + $cert.Issuer + $out[2] = "-----BEGIN CERTIFICATE-----" + $out[3] = $([Convert]::ToBase64String($cert.Export('Cert'), [System.Base64FormattingOptions]::InsertLineBreaks)) + $out[4] = "-----END CERTIFICATE-----" + + [System.IO.File]::AppendAllLines($outfile,$out) } Write-Host "Written to: " $outfile diff --git a/ports/qca/portfile.cmake b/ports/qca/portfile.cmake index b92596ef9..bdb5ac153 100644 --- a/ports/qca/portfile.cmake +++ b/ports/qca/portfile.cmake @@ -1,4 +1,8 @@ -# For now only x[64|86]-windows triplet and dynamic linking is supported +# This portfile adds the Qt Cryptographic Arcitecture +# Changes to the original sources by this file: +# No -qt5 suffix, which is recommended just for Linux +# Output directories according to vcpkg +# Updated certstore. See certstore.pem in the output dirs # if (VCPKG_LIBRARY_LINKAGE STREQUAL static) @@ -44,6 +48,16 @@ vcpkg_apply_patches( PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001-fix-path-for-vcpkg.patch ) +# Importing local certificates +message(STATUS "Importing certstore") +file(REMOVE ${SOURCE_PATH}/certs/rootcerts.pem) +vcpkg_execute_required_process( + COMMAND "& ${CMAKE_CURRENT_LIST_DIR}/import-local-certificates.ps1 -outpath ${SOURCE_PATH}/certs/" + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + LOGNAME certimport +) +message(STATUS "Importing certstore done") + # Configure and build vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} @@ -53,7 +67,7 @@ vcpkg_configure_cmake( -DUSE_RELATIVE_PATHS=ON -DQT4_BUILD=OFF -DBUILD_TESTS=OFF - -DBUILD_TOOLS=ON + -DBUILD_TOOLS=OFF -DQCA_SUFFIX=OFF -DQCA_FEATURE_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/share/qca/mkspecs/features OPTIONS_DEBUG @@ -66,7 +80,6 @@ vcpkg_install_cmake() # Patch and copy cmake files message(STATUS "Patching files") - file(READ ${CURRENT_PACKAGES_DIR}/debug/share/qca/cmake/QcaTargets-debug.cmake QCA_DEBUG_CONFIG @@ -85,20 +98,6 @@ file(WRITE ${CURRENT_PACKAGES_DIR}/share/qca/cmake/QcaTargets.cmake "${QCA_TARGET_CONFIG}" ) -# Move tools -file(COPY ${CURRENT_PACKAGES_DIR}/bin/mozcerts.exe - DESTINATION ${CURRENT_PACKAGES_DIR}/share/qca/tools -) -file(COPY ${CURRENT_PACKAGES_DIR}/bin/qcatool.exe - DESTINATION ${CURRENT_PACKAGES_DIR}/share/qca/tools -) -file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/mozcerts.exe - ${CURRENT_PACKAGES_DIR}/bin/qcatool.exe - ${CURRENT_PACKAGES_DIR}/debug/bin/mozcerts.exe - ${CURRENT_PACKAGES_DIR}/debug/bin/mozcerts.pdb - ${CURRENT_PACKAGES_DIR}/debug/bin/qcatool.exe -) - # Remove unneeded dirs file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/share/man @@ -106,7 +105,6 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share ) - message(STATUS "Patching files done") # Handle copyright -- cgit v1.2.3 From b5a6f7eb63562f7cc553ab84d64d3ee426fc2599 Mon Sep 17 00:00:00 2001 From: codicodi Date: Thu, 1 Dec 2016 15:03:33 +0100 Subject: Fix arch/linkage checks --- ports/icu/portfile.cmake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ports/icu/portfile.cmake b/ports/icu/portfile.cmake index 376c2878b..a8bdd1d80 100644 --- a/ports/icu/portfile.cmake +++ b/ports/icu/portfile.cmake @@ -1,5 +1,10 @@ -if (NOT TARGET_TRIPLET STREQUAL "x86-windows" AND NOT TARGET_TRIPLET STREQUAL "x64-windows") - message(FATAL_ERROR "Error: Only x64 and x86 desktop builds are supported now.") +if (VCPKG_TARGET_ARCHITECTURE STREQUAL arm OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore) + message(FATAL_ERROR "Error: ARM and/or UWP builds are currently not supported.") +endif() + +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(STATUS "Warning: Static building not supported yet. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) -- cgit v1.2.3 From 8b558dbe51f43ae68101fac0ac8a98672f22d4d2 Mon Sep 17 00:00:00 2001 From: Guillaume Dumont Date: Thu, 1 Dec 2016 10:19:31 -0500 Subject: Updated gflags to v2.2.0 --- ...-some-compilation-warnings-with-MSVC-2015.patch | 51 ---------------------- ports/gflags/CONTROL | 2 +- ports/gflags/portfile.cmake | 26 +++++------ 3 files changed, 13 insertions(+), 66 deletions(-) delete mode 100644 ports/gflags/0001-Fix-some-compilation-warnings-with-MSVC-2015.patch diff --git a/ports/gflags/0001-Fix-some-compilation-warnings-with-MSVC-2015.patch b/ports/gflags/0001-Fix-some-compilation-warnings-with-MSVC-2015.patch deleted file mode 100644 index d099ea616..000000000 --- a/ports/gflags/0001-Fix-some-compilation-warnings-with-MSVC-2015.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 5af642bdfe023a7c857d1d26593af586516bf696 Mon Sep 17 00:00:00 2001 -From: Sergey Sharybin -Date: Thu, 31 Dec 2015 17:16:26 +0500 -Subject: [PATCH] Fix some compilation warnings with MSVC 2015 - -MSVC 2015 already defines vsnprintf() and va_copy(). ---- - src/windows_port.cc | 2 ++ - src/windows_port.h | 2 ++ - 2 files changed, 4 insertions(+) - -diff --git a/src/windows_port.cc b/src/windows_port.cc -index 1f40458..b5b7194 100644 ---- a/src/windows_port.cc -+++ b/src/windows_port.cc -@@ -44,6 +44,7 @@ - - // These call the windows _vsnprintf, but always NUL-terminate. - #if !defined(__MINGW32__) && !defined(__MINGW64__) /* mingw already defines */ -+#if !(defined(_MSC_VER) && _MSC_VER >= 1900) /* msvc 2015 already defines */ - - #ifdef _MSC_VER - # pragma warning(push) -@@ -68,4 +69,5 @@ int snprintf(char *str, size_t size, const char *format, ...) { - return r; - } - -+#endif /* if !(defined(_MSC_VER) && _MSC_VER >= 1900) */ - #endif /* #if !defined(__MINGW32__) && !defined(__MINGW64__) */ -diff --git a/src/windows_port.h b/src/windows_port.h -index c8ff24f..554b9c9 100644 ---- a/src/windows_port.h -+++ b/src/windows_port.h -@@ -63,12 +63,14 @@ - * name vsnprintf, since windows defines that (but not snprintf (!)). - */ - #if !defined(__MINGW32__) && !defined(__MINGW64__) /* mingw already defines */ -+#if !(defined(_MSC_VER) && _MSC_VER >= 1900) /* msvc 2015 already defines */ - extern GFLAGS_DLL_DECL int snprintf(char *str, size_t size, - const char *format, ...); - extern int GFLAGS_DLL_DECL safe_vsnprintf(char *str, size_t size, - const char *format, va_list ap); - #define vsnprintf(str, size, format, ap) safe_vsnprintf(str, size, format, ap) - #define va_copy(dst, src) (dst) = (src) -+#endif - #endif /* #if !defined(__MINGW32__) && !defined(__MINGW64__) */ - - #ifdef _MSC_VER --- -2.10.0.windows.1 - diff --git a/ports/gflags/CONTROL b/ports/gflags/CONTROL index 03977243f..62910c121 100644 --- a/ports/gflags/CONTROL +++ b/ports/gflags/CONTROL @@ -1,3 +1,3 @@ Source: gflags -Version: 2.1.2 +Version: 2.2.0 Description: A C++ library that implements commandline flags processing diff --git a/ports/gflags/portfile.cmake b/ports/gflags/portfile.cmake index b600d8832..66ac76227 100644 --- a/ports/gflags/portfile.cmake +++ b/ports/gflags/portfile.cmake @@ -2,7 +2,7 @@ include(vcpkg_common_functions) find_program(GIT git) set(GIT_URL "https://github.com/gflags/gflags.git") -set(GIT_TAG "v2.1.2") +set(GIT_TAG "v2.2.0") if(NOT EXISTS "${DOWNLOADS}/gflags.git") message(STATUS "Cloning") @@ -22,17 +22,15 @@ if(NOT EXISTS "${CURRENT_BUILDTREES_DIR}/src/.git") WORKING_DIRECTORY ${DOWNLOADS}/gflags.git LOGNAME worktree ) - message(STATUS "Patching") - vcpkg_execute_required_process( - COMMAND ${GIT} apply ${CMAKE_CURRENT_LIST_DIR}/0001-Fix-some-compilation-warnings-with-MSVC-2015.patch --ignore-whitespace --whitespace=fix - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/src - LOGNAME patch - ) endif() -message(STATUS "Adding worktree and patching done") + +message(STATUS "Adding worktree") vcpkg_configure_cmake( SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src + OPTIONS + -DGFLAGS_REGISTER_BUILD_DIR:BOOL=OFF + -DGFLAGS_REGISTER_INSTALL_PREFIX:BOOL=OFF ) vcpkg_install_cmake() @@ -49,24 +47,24 @@ file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) file(RENAME ${CURRENT_PACKAGES_DIR}/cmake ${CURRENT_PACKAGES_DIR}/share/gflags) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(READ ${CURRENT_PACKAGES_DIR}/debug/cmake/gflags-export-debug.cmake GFLAGS_DEBUG_MODULE) +file(READ ${CURRENT_PACKAGES_DIR}/debug/cmake/gflags-targets-debug.cmake GFLAGS_DEBUG_MODULE) string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" GFLAGS_DEBUG_MODULE "${GFLAGS_DEBUG_MODULE}") string(REPLACE "/Lib/gflags.dll" "/bin/gflags.dll" GFLAGS_DEBUG_MODULE "${GFLAGS_DEBUG_MODULE}") string(REPLACE "/Lib/gflags_nothreads.dll" "/bin/gflags_nothreads.dll" GFLAGS_DEBUG_MODULE "${GFLAGS_DEBUG_MODULE}") -file(WRITE ${CURRENT_PACKAGES_DIR}/share/gflags/gflags-export-debug.cmake "${GFLAGS_DEBUG_MODULE}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/gflags/gflags-targets-debug.cmake "${GFLAGS_DEBUG_MODULE}") -file(READ ${CURRENT_PACKAGES_DIR}/share/gflags/gflags-export-release.cmake GFLAGS_RELEASE_MODULE) +file(READ ${CURRENT_PACKAGES_DIR}/share/gflags/gflags-targets-release.cmake GFLAGS_RELEASE_MODULE) string(REPLACE "/Lib/gflags.dll" "/bin/gflags.dll" GFLAGS_RELEASE_MODULE "${GFLAGS_RELEASE_MODULE}") string(REPLACE "/Lib/gflags_nothreads.dll" "/bin/gflags_nothreads.dll" GFLAGS_RELEASE_MODULE "${GFLAGS_RELEASE_MODULE}") -file(WRITE ${CURRENT_PACKAGES_DIR}/share/gflags/gflags-export-release.cmake "${GFLAGS_RELEASE_MODULE}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/gflags/gflags-targets-release.cmake "${GFLAGS_RELEASE_MODULE}") file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/cmake) -file(READ ${CURRENT_PACKAGES_DIR}/share/gflags/gflags-export.cmake GFLAGS_CONFIG_MODULE) +file(READ ${CURRENT_PACKAGES_DIR}/share/gflags/gflags-targets.cmake GFLAGS_CONFIG_MODULE) string(REPLACE "get_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)" "get_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)\nget_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)" GFLAGS_CONFIG_MODULE "${GFLAGS_CONFIG_MODULE}") -file(WRITE ${CURRENT_PACKAGES_DIR}/share/gflags/gflags-export.cmake ${GFLAGS_CONFIG_MODULE}) +file(WRITE ${CURRENT_PACKAGES_DIR}/share/gflags/gflags-targets.cmake ${GFLAGS_CONFIG_MODULE}) file(INSTALL ${CURRENT_BUILDTREES_DIR}/src/COPYING.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/gflags RENAME copyright) -- cgit v1.2.3 From 7c2abc755f58beaea36aa1cbc1c3b7f375e567a3 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 1 Dec 2016 15:36:39 -0800 Subject: Introduce function get_installed_files() --- toolsrc/include/vcpkg.h | 8 ++++++++ toolsrc/src/vcpkg.cpp | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/toolsrc/include/vcpkg.h b/toolsrc/include/vcpkg.h index ef78e213e..75dc40b43 100644 --- a/toolsrc/include/vcpkg.h +++ b/toolsrc/include/vcpkg.h @@ -11,6 +11,14 @@ namespace vcpkg void write_update(const vcpkg_paths& paths, const StatusParagraph& p); + struct StatusParagraph_and_associated_files + { + StatusParagraph pgh; + std::vector files; + }; + + std::vector get_installed_files(const vcpkg_paths& paths, const StatusParagraphs& status_db); + expected try_load_port(const fs::path& control_path); inline expected try_load_port(const vcpkg_paths& paths, const std::string& name) diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index 6c5224f56..57b2e7adb 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -109,6 +109,39 @@ void vcpkg::write_update(const vcpkg_paths& paths, const StatusParagraph& p) fs::rename(tmp_update_filename, update_filename); } +std::vector vcpkg::get_installed_files(const vcpkg_paths& paths, const StatusParagraphs& status_db) +{ + std::vector installed_files; + + std::string line; + + for (const std::unique_ptr& pgh : status_db) + { + if (pgh->state != install_state_t::installed) + { + continue; + } + + std::fstream listfile(paths.listfile_path(pgh->package)); + + std::vector installed_files_of_current_pgh; + while (std::getline(listfile, line)) + { + if (line.empty()) + { + continue; + } + + installed_files_of_current_pgh.push_back(line); + } + + const StatusParagraph_and_associated_files pgh_and_files = {*pgh, std::move(installed_files_of_current_pgh)}; + installed_files.push_back(pgh_and_files); + } + + return installed_files; +} + expected vcpkg::try_load_port(const fs::path& path) { try -- cgit v1.2.3 From 4d298be260ecafef2c7c17145aafbd4ea8a952cb Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 1 Dec 2016 15:37:08 -0800 Subject: [owns command] Use get_installed_files() --- toolsrc/src/commands_owns.cpp | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/toolsrc/src/commands_owns.cpp b/toolsrc/src/commands_owns.cpp index e5599ce01..45f073304 100644 --- a/toolsrc/src/commands_owns.cpp +++ b/toolsrc/src/commands_owns.cpp @@ -1,30 +1,21 @@ #include "vcpkg_Commands.h" #include "vcpkg_System.h" #include "vcpkg.h" -#include namespace vcpkg { static void search_file(const vcpkg_paths& paths, const std::string& file_substr, const StatusParagraphs& status_db) { - std::string line; - - for (auto&& pgh : status_db) + const std::vector installed_files = get_installed_files(paths, status_db); + for (const StatusParagraph_and_associated_files& pgh_and_file : installed_files) { - if (pgh->state != install_state_t::installed) - continue; + const StatusParagraph& pgh = pgh_and_file.pgh; - std::fstream listfile(paths.listfile_path(pgh->package)); - while (std::getline(listfile, line)) + for (const std::string& file : pgh_and_file.files) { - if (line.empty()) - { - continue; - } - - if (line.find(file_substr) != std::string::npos) + if (file.find(file_substr) != std::string::npos) { - System::println("%s: %s", pgh->package.displayname(), line); + System::println("%s: %s", pgh.package.displayname(), file); } } } -- cgit v1.2.3 From a8c189c3f29dcb081ffe7c1bda53bdc82ac6dc92 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 1 Dec 2016 17:22:20 -0800 Subject: [pre-install checks] Greatly improve the check for already isntalled files --- toolsrc/src/commands_installation.cpp | 74 +++++++++++++++++++++-------------- 1 file changed, 44 insertions(+), 30 deletions(-) diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_installation.cpp index 23342070d..8bae0a182 100644 --- a/toolsrc/src/commands_installation.cpp +++ b/toolsrc/src/commands_installation.cpp @@ -128,53 +128,67 @@ namespace vcpkg listfile.close(); } - static std::map remove_first_n_chars_and_map(const std::vector absolute_paths, const size_t n) + static void remove_first_n_chars(std::vector* strings, const size_t n) { - std::map output; - - for (const fs::path& absolute_path : absolute_paths) + for (std::string& s : *strings) { - std::string suffix = absolute_path.generic_string(); - suffix.erase(0, n); - output.emplace(suffix, absolute_path); + s.erase(0, n); } + }; - return output; - } - - static void print_map_values(const std::vector keys, const std::map& map) + static std::vector extract_files_in_triplet(const std::vector& pgh_and_files, const triplet& triplet) { - System::println(""); - for (const std::string& key : keys) + std::vector output; + for (const StatusParagraph_and_associated_files& t : pgh_and_files) { - System::println(" %s", map.at(key).generic_string()); + if (t.pgh.package.spec.target_triplet() != triplet) + { + continue; + } + + output.insert(output.end(), t.files.cbegin(), t.files.cend()); } - System::println(""); + + std::sort(output.begin(), output.end()); + return output; } - static void install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs& status_db) + void install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs& status_db) { const fs::path package_dir = paths.package_dir(binary_paragraph.spec); - const std::vector package_files = Files::recursive_find_all_files_in_dir(package_dir); - - const fs::path installed_dir = paths.installed / binary_paragraph.spec.target_triplet().canonical_name(); - const std::vector installed_files = Files::recursive_find_all_files_in_dir(installed_dir); - - const std::map package_files_relative_paths_to_absolute_paths = remove_first_n_chars_and_map(package_files, package_dir.generic_string().size() + 1); - const std::map installed_files_relative_paths_to_absolute_paths = remove_first_n_chars_and_map(installed_files, installed_dir.generic_string().size() + 1); - - const std::vector package_files_set = Maps::extract_keys(package_files_relative_paths_to_absolute_paths); - const std::vector installed_files_set = Maps::extract_keys(installed_files_relative_paths_to_absolute_paths); + const std::vector package_file_paths = Files::recursive_find_all_files_in_dir(package_dir); + std::vector package_files; + const size_t package_remove_char_count = package_dir.generic_string().size() + 1; // +1 for the slash + std::transform(package_file_paths.cbegin(), package_file_paths.cend(), std::back_inserter(package_files), [package_remove_char_count](const fs::path& path) + { + return path.generic_string().erase(0, package_remove_char_count); + }); + std::sort(package_files.begin(), package_files.end()); + + const std::vector& pgh_and_files = get_installed_files(paths, status_db); + const triplet& triplet = binary_paragraph.spec.target_triplet(); + std::vector installed_files = extract_files_in_triplet(pgh_and_files, triplet); + const size_t installed_remove_char_count = triplet.canonical_name().size() + 1; // +1 for the slash + remove_first_n_chars(&installed_files, installed_remove_char_count); + std::sort(installed_files.begin(), installed_files.end()); std::vector intersection; - std::set_intersection(package_files_set.cbegin(), package_files_set.cend(), - installed_files_set.cbegin(), installed_files_set.cend(), + std::set_intersection(package_files.cbegin(), package_files.cend(), + installed_files.cbegin(), installed_files.cend(), std::back_inserter(intersection)); if (!intersection.empty()) { - System::println(System::color::error, "The following files are already installed and are in conflict with %s:", binary_paragraph.spec); - print_map_values(intersection, installed_files_relative_paths_to_absolute_paths); + const fs::path triplet_install_path = paths.installed / triplet.canonical_name(); + System::println(System::color::error, "The following files are already installed in %s and are in conflict with %s", + triplet_install_path.generic_string(), + binary_paragraph.spec); + System::println(""); + for (const std::string& s : intersection) + { + System::println(" %s", s); + } + System::println(""); exit(EXIT_FAILURE); } -- cgit v1.2.3 From a195dedf52e67b1aaac62f041cc767e0d12592b3 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 1 Dec 2016 20:39:28 -0800 Subject: get_installed_files() now filters out the directories --- toolsrc/src/commands_installation.cpp | 2 +- toolsrc/src/vcpkg.cpp | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_installation.cpp index 8bae0a182..1abd16796 100644 --- a/toolsrc/src/commands_installation.cpp +++ b/toolsrc/src/commands_installation.cpp @@ -170,7 +170,7 @@ namespace vcpkg std::vector installed_files = extract_files_in_triplet(pgh_and_files, triplet); const size_t installed_remove_char_count = triplet.canonical_name().size() + 1; // +1 for the slash remove_first_n_chars(&installed_files, installed_remove_char_count); - std::sort(installed_files.begin(), installed_files.end()); + std::sort(installed_files.begin(), installed_files.end()); // Should already be sorted std::vector intersection; std::set_intersection(package_files.cbegin(), package_files.cend(), diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index 57b2e7adb..88b05b0a9 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -111,6 +111,8 @@ void vcpkg::write_update(const vcpkg_paths& paths, const StatusParagraph& p) std::vector vcpkg::get_installed_files(const vcpkg_paths& paths, const StatusParagraphs& status_db) { + static const std::string MARK_FOR_REMOVAL = ""; + std::vector installed_files; std::string line; @@ -135,6 +137,30 @@ std::vector vcpkg::get_installed_files(con installed_files_of_current_pgh.push_back(line); } + // Should already be sorted + std::sort(installed_files_of_current_pgh.begin(), installed_files_of_current_pgh.end()); + + // Since the files are sorted, we can detect the entries that represent directories + // by comparing every element with the next one and checking if the next has a slash immediately after the current one's length + for (int i = 1; i < installed_files_of_current_pgh.size(); i++) + { + std::string& current_string = installed_files_of_current_pgh.at(i - 1); + const std::string& next_string = installed_files_of_current_pgh.at(i); + + const size_t potential_slash_char_index = current_string.length(); + // Make sure the index exists first + if (next_string.size() > potential_slash_char_index && next_string.at(potential_slash_char_index) == '/') + { + current_string = MARK_FOR_REMOVAL; + } + } + + installed_files_of_current_pgh.erase(std::remove_if(installed_files_of_current_pgh.begin(), installed_files_of_current_pgh.end(), [](const std::string& file) + { + return file == MARK_FOR_REMOVAL; + }), + installed_files_of_current_pgh.end()); + const StatusParagraph_and_associated_files pgh_and_files = {*pgh, std::move(installed_files_of_current_pgh)}; installed_files.push_back(pgh_and_files); } -- cgit v1.2.3 From 5849d36d4891a832461e6061f7820b1e61e73461 Mon Sep 17 00:00:00 2001 From: Jason Yang Date: Fri, 2 Dec 2016 14:54:03 +0800 Subject: [azure-storage-cpp] add link to v2.5.0 --- ports/azure-storage-cpp/CONTROL | 5 + ports/azure-storage-cpp/cmake.patch | 181 +++++++++++++++++++++++++++++++++ ports/azure-storage-cpp/portfile.cmake | 34 +++++++ 3 files changed, 220 insertions(+) create mode 100644 ports/azure-storage-cpp/CONTROL create mode 100644 ports/azure-storage-cpp/cmake.patch create mode 100644 ports/azure-storage-cpp/portfile.cmake diff --git a/ports/azure-storage-cpp/CONTROL b/ports/azure-storage-cpp/CONTROL new file mode 100644 index 000000000..78b7e0a11 --- /dev/null +++ b/ports/azure-storage-cpp/CONTROL @@ -0,0 +1,5 @@ +Source: azure-storage-cpp +Version: 2.5.0 +Build-Depends: cpprestsdk [windows] +Description: Microsoft Azure Storage Client SDK for C++ + A client library for working with Microsoft Azure storage services including blobs, files, tables, and queues. This client library enables working with the Microsoft Azure storage services which include the blob service for storing binary and text data, the file service for storing binary and text data, the table service for storing structured non-relational data, and the queue service for storing messages that may be accessed by a client. Microsoft Azure Storage team's blog - http://blogs.msdn.com/b/windowsazurestorage/ \ No newline at end of file diff --git a/ports/azure-storage-cpp/cmake.patch b/ports/azure-storage-cpp/cmake.patch new file mode 100644 index 000000000..7c70782b9 --- /dev/null +++ b/ports/azure-storage-cpp/cmake.patch @@ -0,0 +1,181 @@ +diff --git a/Microsoft.WindowsAzure.Storage/CMakeLists.txt b/Microsoft.WindowsAzure.Storage/CMakeLists.txt +index f037c7f..a0b5982 100644 +--- a/Microsoft.WindowsAzure.Storage/CMakeLists.txt ++++ b/Microsoft.WindowsAzure.Storage/CMakeLists.txt +@@ -1,6 +1,10 @@ + set(CMAKE_LEGACY_CYGWIN_WIN32 0) + cmake_minimum_required(VERSION 2.6) +-project(azurestorage) ++if(WIN32) ++ project(wastorage) ++else() ++ project(azurestorage) ++endif() + + enable_testing() + +@@ -59,12 +63,25 @@ if(UNIX) + install(FILES ${WASCORE_HEADERS} DESTINATION include/wascore) + file(GLOB WASCORE_DATA includes/wascore/*.dat) + install(FILES ${WASCORE_DATA} DESTINATION include/wascore) ++elseif(WIN32) ++ message("-- Setting WIN32 options") ++ find_package(Casablanca REQUIRED) ++ add_definitions(-DUNICODE -D_UNICODE -D_WIN32) ++ option(BUILD_SHARED_LIBS "Build shared Libraries." ON) ++ option(WASTORE_INSTALL_HEADERS "Install header files." ON) ++ if(WASTORE_INSTALL_HEADERS) ++ include_directories(includes) ++ file(GLOB WAS_HEADERS includes/was/*.h) ++ file(GLOB WASCORE_HEADERS includes/wascore/*.h) ++ file(GLOB WASCORE_DATA includes/wascore/*.dat) ++ endif() + else() + message("-- Unsupported Build Platform.") + endif() + ++ + # Compiler (not platform) specific settings +-if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") ++if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") + message("-- Setting gcc options") + + set(WARNINGS "-Wall -Wextra -Wunused-parameter -Wcast-align -Wcast-qual -Wconversion -Wformat=2 -Winit-self -Winvalid-pch -Wmissing-format-attribute -Wmissing-include-dirs -Wpacked -Wredundant-decls -Wunreachable-code") +@@ -81,37 +98,56 @@ if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") + add_definitions(-DBOOST_LOG_DYN_LINK) + endif() + add_definitions(-D_TURN_OFF_PLATFORM_STRING) +-elseif((CMAKE_CXX_COMPILER_ID MATCHES "Clang")) +- message("-- Setting clang options") ++elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") ++ message("-- Setting clang options") + +- set(WARNINGS "-Wall -Wextra -Wcast-qual -Wconversion -Wformat=2 -Winit-self -Winvalid-pch -Wmissing-format-attribute -Wmissing-include-dirs -Wpacked -Wredundant-decls") +- set(OSX_SUPPRESSIONS "-Wno-overloaded-virtual -Wno-sign-conversion -Wno-deprecated -Wno-unknown-pragmas -Wno-reorder -Wno-char-subscripts -Wno-switch -Wno-unused-parameter -Wno-unused-variable -Wno-deprecated -Wno-unused-value -Wno-unknown-warning-option -Wno-return-type-c-linkage -Wno-unused-function -Wno-sign-compare -Wno-shorten-64-to-32 -Wno-reorder -Wno-unused-local-typedefs") +- set(WARNINGS "${WARNINGS} ${OSX_SUPPRESSIONS}") ++ set(WARNINGS "-Wall -Wextra -Wcast-qual -Wconversion -Wformat=2 -Winit-self -Winvalid-pch -Wmissing-format-attribute -Wmissing-include-dirs -Wpacked -Wredundant-decls") ++ set(OSX_SUPPRESSIONS "-Wno-overloaded-virtual -Wno-sign-conversion -Wno-deprecated -Wno-unknown-pragmas -Wno-reorder -Wno-char-subscripts -Wno-switch -Wno-unused-parameter -Wno-unused-variable -Wno-deprecated -Wno-unused-value -Wno-unknown-warning-option -Wno-return-type-c-linkage -Wno-unused-function -Wno-sign-compare -Wno-shorten-64-to-32 -Wno-reorder -Wno-unused-local-typedefs") ++ set(WARNINGS "${WARNINGS} ${OSX_SUPPRESSIONS}") + +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -Wno-return-type-c-linkage -Wno-unneeded-internal-declaration") +- set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") +- set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -Wno-return-type-c-linkage -Wno-unneeded-internal-declaration") ++ set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") ++ set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11") + +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-strict-aliasing") +- if (BUILD_SHARED_LIBS) +- add_definitions(-DBOOST_LOG_DYN_LINK) +- endif() +- add_definitions(-D_TURN_OFF_PLATFORM_STRING) ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-strict-aliasing") ++ if (BUILD_SHARED_LIBS) ++ add_definitions(-DBOOST_LOG_DYN_LINK) ++ endif() ++ add_definitions(-D_TURN_OFF_PLATFORM_STRING) ++elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") ++ message("-- Setting MSVC options") ++ add_compile_options(/bigobj) ++ add_compile_options(/MP) ++ if(BUILD_SHARED_LIBS) ++ add_definitions(-DWASTORAGE_DLL -D_USRDLL) ++ endif() + else() + message("-- Unknown compiler, success is doubtful.") + endif() + +-# Reconfigure final output directory +-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Binaries) +-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Binaries) +-set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Binaries) ++if (WIN32) ++ # Reconfigure final output directory ++ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Binaries) ++ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Binaries) ++ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Binaries) + +-set(AZURESTORAGE_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/includes) +-set(AZURESTORAGE_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/includes ${CASABLANCA_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIRS} ${LibXML++_INCLUDE_DIRS} ${UUID_INCLUDE_DIRS} ${Glibmm_INCLUDE_DIRS}) ++ set(AZURESTORAGE_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/includes) ++ set(AZURESTORAGE_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/includes ${CASABLANCA_INCLUDE_DIRS}) + ++ set(AZURESTORAGE_LIBRARY azure-storage-cpp) ++ set(AZURESTORAGE_LIBRARIES ${AZURESTORAGE_LIBRARY} ${CASABLANCA_LIBRARIES}) ++else() ++ # Reconfigure final output directory ++ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Binaries) ++ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Binaries) ++ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Binaries) ++ ++ set(AZURESTORAGE_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/includes) ++ set(AZURESTORAGE_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/includes ${CASABLANCA_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIRS} ${LibXML++_INCLUDE_DIRS} ${UUID_INCLUDE_DIRS} ${Glibmm_INCLUDE_DIRS}) + +-set(AZURESTORAGE_LIBRARY azurestorage) +-set(AZURESTORAGE_LIBRARIES ${AZURESTORAGE_LIBRARY} ${CASABLANCA_LIBRARIES} ${Boost_LIBRARIES} ${Boost_FRAMEWORK} ${OPENSSL_LIBRARIES} ${LibXML++_LIBRARIES} ${UUID_LIBRARIES} ${Glibmm_LIBRARIES}) ++ set(AZURESTORAGE_LIBRARY azurestorage) ++ set(AZURESTORAGE_LIBRARIES ${AZURESTORAGE_LIBRARY} ${CASABLANCA_LIBRARIES} ${Boost_LIBRARIES} ${Boost_FRAMEWORK} ${OPENSSL_LIBRARIES} ${LibXML++_LIBRARIES} ${UUID_LIBRARIES} ${Glibmm_LIBRARIES}) ++endif() + + # Set version numbers centralized + set (AZURESTORAGE_VERSION_MAJOR 2) +diff --git a/Microsoft.WindowsAzure.Storage/cmake/Modules/FindCasablanca.cmake b/Microsoft.WindowsAzure.Storage/cmake/Modules/FindCasablanca.cmake +index 5c1df3c..da66eb4 100644 +--- a/Microsoft.WindowsAzure.Storage/cmake/Modules/FindCasablanca.cmake ++++ b/Microsoft.WindowsAzure.Storage/cmake/Modules/FindCasablanca.cmake +@@ -27,6 +27,7 @@ find_path(CASABLANCA_INCLUDE_DIR + find_library(CASABLANCA_LIBRARY + NAMES + cpprest ++ cpprest_2_9.lib + PATHS + ${CASABLANCA_PKGCONF_LIBRARY_DIRS} + ${CASABLANCA_DIR} +diff --git a/Microsoft.WindowsAzure.Storage/src/CMakeLists.txt b/Microsoft.WindowsAzure.Storage/src/CMakeLists.txt +index b08111f..ee5c9ed 100644 +--- a/Microsoft.WindowsAzure.Storage/src/CMakeLists.txt ++++ b/Microsoft.WindowsAzure.Storage/src/CMakeLists.txt +@@ -2,7 +2,7 @@ include_directories(${Boost_INCLUDE_DIR} ${OPENSSL_INCLUDE_DIR}) + include_directories(${AZURESTORAGE_INCLUDE_DIRS}) + + # THE ORDER OF FILES IS VERY /VERY/ IMPORTANT +-if(UNIX) ++if(UNIX OR WIN32) + set(SOURCES + xmlhelpers.cpp + response_parsers.cpp +@@ -64,14 +64,17 @@ if ("${CMAKE_BUILD_TYPE}" MATCHES "Debug") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage") + endif() + if (APPLE) +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNINGS}") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNINGS}") + else() +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + endif() + + add_library(${AZURESTORAGE_LIBRARY} ${SOURCES}) + + target_link_libraries(${AZURESTORAGE_LIBRARIES}) ++if(WIN32) ++ target_link_libraries(${AZURESTORAGE_LIBRARY} Ws2_32.lib rpcrt4.lib xmllite.lib bcrypt.lib) ++endif() + + # Portions specific to azure storage binary versioning and installation. + if(UNIX) +@@ -84,4 +87,14 @@ if(UNIX) + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + ) ++elseif(WIN32) ++ install(FILES ${WAS_HEADERS} DESTINATION include/was) ++ install(FILES ${WASCORE_HEADERS} DESTINATION include/wascore) ++ install(FILES ${WASCORE_DATA} DESTINATION include/wascore) ++ install( ++ TARGETS ${AZURESTORAGE_LIBRARY} ++ RUNTIME DESTINATION bin ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib ++ ) + endif() diff --git a/ports/azure-storage-cpp/portfile.cmake b/ports/azure-storage-cpp/portfile.cmake new file mode 100644 index 000000000..8898a61a0 --- /dev/null +++ b/ports/azure-storage-cpp/portfile.cmake @@ -0,0 +1,34 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/azure-storage-cpp-2.5.0) + +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/Azure/azure-storage-cpp/archive/v2.5.0.tar.gz" + FILENAME "azure-storage-cpp/v2.5.0.tar.gz" + SHA512 128e02f4c4f741083b7860a1aacabaeee5616684d6a5f7f1b3a88abf7f74e6c46610ed62def2a743e67a20a1d12604b9c44c202d94b56ca0ca02847a2b6c9e1b +) +vcpkg_extract_source_archive(${ARCHIVE}) + + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/cmake.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH}/Microsoft.WindowsAzure.Storage + OPTIONS + -DBUILD_TESTS=OFF + -DBUILD_SAMPLES=OFF +) + +vcpkg_install_cmake() + +file(INSTALL + ${SOURCE_PATH}/LICENSE.txt + DESTINATION ${CURRENT_PACKAGES_DIR}/share/azure-storage-cpp RENAME copyright) +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/debug/include) + +vcpkg_copy_pdbs() + -- cgit v1.2.3 From 13b0c034ecfc78c683d1924334370f5cfcbeab71 Mon Sep 17 00:00:00 2001 From: Alexander Kaspar Date: Fri, 2 Dec 2016 10:12:57 +0100 Subject: [qca] downloading cacerts from curl homepage, because used version is very outdated. --- ports/qca/portfile.cmake | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/ports/qca/portfile.cmake b/ports/qca/portfile.cmake index bdb5ac153..dc360af87 100644 --- a/ports/qca/portfile.cmake +++ b/ports/qca/portfile.cmake @@ -48,13 +48,18 @@ vcpkg_apply_patches( PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001-fix-path-for-vcpkg.patch ) -# Importing local certificates +# According to: +# https://www.openssl.org/docs/faq.html#USER16 +# it is up to developers or admins to maintain CAs. +# So we do it here: +# Importing certificates from curl maintainers +# See: https://curl.haxx.se/docs/caextract.html message(STATUS "Importing certstore") file(REMOVE ${SOURCE_PATH}/certs/rootcerts.pem) -vcpkg_execute_required_process( - COMMAND "& ${CMAKE_CURRENT_LIST_DIR}/import-local-certificates.ps1 -outpath ${SOURCE_PATH}/certs/" - WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} - LOGNAME certimport +file(DOWNLOAD https://curl.haxx.se/ca/cacert.pem + ${SOURCE_PATH}/certs/rootcerts.pem + SHOW_PROGRESS + TLS_VERIFY ON ) message(STATUS "Importing certstore done") -- cgit v1.2.3 From 31b4236f091a0d63fe4db8240d12466d19947be2 Mon Sep 17 00:00:00 2001 From: Jason Yang Date: Fri, 2 Dec 2016 17:17:53 +0800 Subject: rename dll to wastorage to keep consistency --- ports/azure-storage-cpp/cmake.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/azure-storage-cpp/cmake.patch b/ports/azure-storage-cpp/cmake.patch index 7c70782b9..0275991ae 100644 --- a/ports/azure-storage-cpp/cmake.patch +++ b/ports/azure-storage-cpp/cmake.patch @@ -1,5 +1,5 @@ diff --git a/Microsoft.WindowsAzure.Storage/CMakeLists.txt b/Microsoft.WindowsAzure.Storage/CMakeLists.txt -index f037c7f..a0b5982 100644 +index f037c7f..478bf48 100644 --- a/Microsoft.WindowsAzure.Storage/CMakeLists.txt +++ b/Microsoft.WindowsAzure.Storage/CMakeLists.txt @@ -1,6 +1,10 @@ @@ -100,7 +100,7 @@ index f037c7f..a0b5982 100644 + set(AZURESTORAGE_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/includes) + set(AZURESTORAGE_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/includes ${CASABLANCA_INCLUDE_DIRS}) -+ set(AZURESTORAGE_LIBRARY azure-storage-cpp) ++ set(AZURESTORAGE_LIBRARY wastorage) + set(AZURESTORAGE_LIBRARIES ${AZURESTORAGE_LIBRARY} ${CASABLANCA_LIBRARIES}) +else() + # Reconfigure final output directory -- cgit v1.2.3 From 8762c2a626cdff681f4e7ee9e5c982251303f76b Mon Sep 17 00:00:00 2001 From: phsucharee Date: Fri, 2 Dec 2016 16:35:36 +0100 Subject: [jxrlib] Remove __ANSI__ preprocessor definition --- ports/jxrlib/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/jxrlib/CMakeLists.txt b/ports/jxrlib/CMakeLists.txt index d9ac84fb6..17f16bea4 100644 --- a/ports/jxrlib/CMakeLists.txt +++ b/ports/jxrlib/CMakeLists.txt @@ -62,7 +62,7 @@ JXR_MAKE_OBJ(ENC) add_library(jpegxr ${OBJ_ENC} ${OBJ_DEC} ${OBJ_SYS}) set_property(TARGET jpegxr - PROPERTY COMPILE_DEFINITIONS __ANSI__ DISABLE_PERF_MEASUREMENT ${DEF_ENDIAN} + PROPERTY COMPILE_DEFINITIONS DISABLE_PERF_MEASUREMENT ${DEF_ENDIAN} ) set_property(TARGET jpegxr PROPERTY LINK_INTERFACE_LIBRARIES "") install(TARGETS jpegxr @@ -80,7 +80,7 @@ JXR_MAKE_OBJ(TEST) add_library(jxrglue ${OBJ_GLUE} ${OBJ_TEST}) set_property(TARGET jxrglue - PROPERTY COMPILE_DEFINITIONS __ANSI__ DISABLE_PERF_MEASUREMENT ${DEF_ENDIAN} + PROPERTY COMPILE_DEFINITIONS DISABLE_PERF_MEASUREMENT ${DEF_ENDIAN} ) set_property(TARGET jxrglue PROPERTY LINK_INTERFACE_LIBRARIES "") install(TARGETS jxrglue -- cgit v1.2.3 From 67303f15690629053d8a6191665131fde5829f73 Mon Sep 17 00:00:00 2001 From: charlie barto Date: Tue, 15 Nov 2016 22:44:53 -0500 Subject: Added libpq support to qt5 qt5 changes more qt5 changes added libpq to qt5 fix merge fixed left over git thing --- ports/libpq/CMakeLists.txt | 4 ++++ ports/libpq/portfile.cmake | 3 ++- ports/qt5/CONTROL | 2 +- ports/qt5/portfile.cmake | 10 ++++++++-- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/ports/libpq/CMakeLists.txt b/ports/libpq/CMakeLists.txt index 517039d8f..54e929a5b 100644 --- a/ports/libpq/CMakeLists.txt +++ b/ports/libpq/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.5) project(libpq VERSION 9.6.1 LANGUAGES C) find_package(OpenSSL REQUIRED) +set(CMAKE_DEBUG_POSTFIX "d") configure_file(${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config.h.win32 ${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config.h) configure_file(${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config_ext.h.win32 ${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config_ext.h) configure_file(${CMAKE_CURRENT_LIST_DIR}/src/include/port/win32.h ${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config_os.h) @@ -61,11 +62,14 @@ set(pg_libpq_catalog_interface src/include/catalog/genbki.h ) set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_DEBUG_POSTFIX "d") +set(CMAKE_INCLUDE_CURRENT_DIR ON) add_library(libpq ${pg_port_src} ${pg_backend_src} ${pg_libpq_src}) target_compile_definitions(libpq PRIVATE -DFRONTEND -DENABLE_THREAD_SAFETY -DUSE_OPENSSL -D_CRT_SECURE_NO_WARNINGS) target_link_libraries(libpq PRIVATE OpenSSL::SSL ws2_32 secur32 advapi32 shell32) target_include_directories(libpq PRIVATE src/include src/include/port/win32 src/include/port/win32_msvc src/port) set_target_properties(libpq PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) + install(TARGETS libpq ARCHIVE DESTINATION lib LIBRARY DESTINATION lib diff --git a/ports/libpq/portfile.cmake b/ports/libpq/portfile.cmake index 67a45dba0..50ac67bb7 100644 --- a/ports/libpq/portfile.cmake +++ b/ports/libpq/portfile.cmake @@ -29,4 +29,5 @@ file(COPY ${SOURCE_PATH}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/lib file(RENAME ${CURRENT_PACKAGES_DIR}/share/libpq/COPYRIGHT ${CURRENT_PACKAGES_DIR}/share/libpq/copyright) -vcpkg_copy_pdbs() + +vcpkg_copy_pdbs() \ No newline at end of file diff --git a/ports/qt5/CONTROL b/ports/qt5/CONTROL index accc2ba07..e38a2c835 100644 --- a/ports/qt5/CONTROL +++ b/ports/qt5/CONTROL @@ -1,4 +1,4 @@ Source: qt5 Version: 5.7-1 -Build-Depends: Description: Qt5 application framework main components. Webengine, examples and tests not included. +Build-Depends: sqlite3, libpq \ No newline at end of file diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake index 85ebb107b..3cc3a17bb 100644 --- a/ports/qt5/portfile.cmake +++ b/ports/qt5/portfile.cmake @@ -13,7 +13,8 @@ get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY) get_filename_component(JOM_EXE_PATH ${JOM} DIRECTORY) set(ENV{PATH} "${JOM_EXE_PATH};${PYTHON3_EXE_PATH};${PERL_EXE_PATH};$ENV{PATH}") - +set(ENV{INCLUDE} "${CURRENT_INSTALLED_DIR}/include;$ENV{INCLUDE}") +set(ENV{LIB} "${CURRENT_INSTALLED_DIR}/lib;$ENV{LIB}") vcpkg_download_distfile(ARCHIVE_FILE URLS "http://download.qt.io/official_releases/qt/5.7/5.7.0/single/qt-everywhere-opensource-src-5.7.0.7z" FILENAME "qt-5.7.0.7z" @@ -44,7 +45,11 @@ vcpkg_execute_required_process( COMMAND "${SOURCE_PATH}/configure.bat" -confirm-license -opensource -platform win32-msvc2015 -debug-and-release -force-debug-info ${QT_RUNTIME_LINKAGE} + -qt-zlib + -qt-libjpeg + -system-sqlite -nomake examples -nomake tests -skip webengine + -qt-sql-sqlite -qt-sql-psql -prefix ${CURRENT_PACKAGES_DIR} -bindir ${CURRENT_PACKAGES_DIR}/bin -hostbindir ${CURRENT_PACKAGES_DIR}/tools @@ -67,7 +72,7 @@ message(STATUS "Build ${TARGET_TRIPLET} done") message(STATUS "Installing ${TARGET_TRIPLET}") vcpkg_execute_required_process( - COMMAND ${JOM} install + COMMAND ${JOM} -j1 install WORKING_DIRECTORY ${OUTPUT_PATH} LOGNAME install-${TARGET_TRIPLET} ) @@ -151,3 +156,4 @@ vcpkg_execute_required_process( file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5 RENAME copyright) vcpkg_copy_pdbs() + -- cgit v1.2.3 From f874d15ecabd7e7331e3da6bf03d7573fe48c6a4 Mon Sep 17 00:00:00 2001 From: Charlie Barto Date: Fri, 2 Dec 2016 12:24:14 -0500 Subject: fixed vcpkg trying to set properties on INTERFACE and ALIAS targets --- scripts/buildsystems/vcpkg.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 44db05a22..089d28db8 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -83,7 +83,9 @@ if(NOT VCPKG_TOOLCHAIN) function(add_library name) _add_library(${ARGV}) list(FIND ARGV "IMPORTED" IMPORTED_IDX) - if(IMPORTED_IDX EQUAL -1) + list(FIND ARGV "INTERFACE" INTERFACE_IDX) + list(FIND ARGV "ALIAS" ALIAS_IDX) + if(IMPORTED_IDX EQUAL -1 AND INTERFACE_IDX EQUAL -1 AND ALIAS_IDX EQUAL -1) set_target_properties(${name} PROPERTIES VS_GLOBAL_VcpkgEnabled false) endif() endfunction() -- cgit v1.2.3 From bdbf98a7305eb3518f687c7084308c8a4f285d24 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 2 Dec 2016 11:47:52 -0800 Subject: [jxrlib] Bump version --- ports/jxrlib/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/jxrlib/CONTROL b/ports/jxrlib/CONTROL index 7c3d5d603..062850e06 100644 --- a/ports/jxrlib/CONTROL +++ b/ports/jxrlib/CONTROL @@ -1,3 +1,3 @@ Source: jxrlib -Version: 1.1-1 +Version: 1.1-2 Description: Open source implementation of the jpegxr image format standard. -- cgit v1.2.3 From a710f67e5281480ab22d0ef372d376696f5fc8ab Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 3 Dec 2016 02:54:37 -0800 Subject: [vcpkg] Remove automatic include paths and link paths from CMake toolchain. It is customary to use find_X() in CMake, so automatic paths are not needed. --- scripts/buildsystems/vcpkg.cmake | 4 ---- 1 file changed, 4 deletions(-) diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 089d28db8..7be93e54d 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -49,7 +49,6 @@ if(NOT VCPKG_TOOLCHAIN) list(APPEND CMAKE_LIBRARY_PATH ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/manual-link ) - link_directories(${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/manual-link) endif() list(APPEND CMAKE_PREFIX_PATH ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET} @@ -57,9 +56,6 @@ if(NOT VCPKG_TOOLCHAIN) list(APPEND CMAKE_LIBRARY_PATH ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/manual-link ) - link_directories(${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/manual-link) - - include_directories(${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include) set(CMAKE_PROGRAM_PATH ${CMAKE_PROGRAM_PATH} ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools) -- cgit v1.2.3 From 26793bd449ae34e6a781e765cd364eb16c0e6337 Mon Sep 17 00:00:00 2001 From: Alexander Kaspar Date: Sat, 3 Dec 2016 12:41:39 +0100 Subject: [qca] Added mk-ca-bundle.pl to generate certstore at build time. --- ports/qca/mk-ca-bundle.pl | 554 ++++++++++++++++++++++++++++++++++++++++++++++ ports/qca/portfile.cmake | 18 +- 2 files changed, 566 insertions(+), 6 deletions(-) create mode 100644 ports/qca/mk-ca-bundle.pl diff --git a/ports/qca/mk-ca-bundle.pl b/ports/qca/mk-ca-bundle.pl new file mode 100644 index 000000000..9574f1dbf --- /dev/null +++ b/ports/qca/mk-ca-bundle.pl @@ -0,0 +1,554 @@ +#!/usr/bin/perl -w +# *************************************************************************** +# * _ _ ____ _ +# * Project ___| | | | _ \| | +# * / __| | | | |_) | | +# * | (__| |_| | _ <| |___ +# * \___|\___/|_| \_\_____| +# * +# * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al. +# * +# * This software is licensed as described in the file COPYING, which +# * you should have received as part of this distribution. The terms +# * are also available at https://curl.haxx.se/docs/copyright.html. +# * +# * You may opt to use, copy, modify, merge, publish, distribute and/or sell +# * copies of the Software, and permit persons to whom the Software is +# * furnished to do so, under the terms of the COPYING file. +# * +# * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY +# * KIND, either express or implied. +# * +# *************************************************************************** +# This Perl script creates a fresh ca-bundle.crt file for use with libcurl. +# It downloads certdata.txt from Mozilla's source tree (see URL below), +# then parses certdata.txt and extracts CA Root Certificates into PEM format. +# These are then processed with the OpenSSL commandline tool to produce the +# final ca-bundle.crt file. +# The script is based on the parse-certs script written by Roland Krikava. +# This Perl script works on almost any platform since its only external +# dependency is the OpenSSL commandline tool for optional text listing. +# Hacked by Guenter Knauf. +# +use Encode; +use Getopt::Std; +use MIME::Base64; +use strict; +use vars qw($opt_b $opt_d $opt_f $opt_h $opt_i $opt_k $opt_l $opt_m $opt_n $opt_p $opt_q $opt_s $opt_t $opt_u $opt_v $opt_w); +use List::Util; +use Text::Wrap; +my $MOD_SHA = "Digest::SHA"; +eval "require $MOD_SHA"; +if ($@) { + $MOD_SHA = "Digest::SHA::PurePerl"; + eval "require $MOD_SHA"; +} +eval "require LWP::UserAgent"; + +my %urls = ( + 'nss' => + 'https://hg.mozilla.org/projects/nss/raw-file/tip/lib/ckfw/builtins/certdata.txt', + 'central' => + 'https://hg.mozilla.org/mozilla-central/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt', + 'aurora' => + 'https://hg.mozilla.org/releases/mozilla-aurora/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt', + 'beta' => + 'https://hg.mozilla.org/releases/mozilla-beta/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt', + 'release' => + 'https://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt', +); + +$opt_d = 'release'; + +# If the OpenSSL commandline is not in search path you can configure it here! +my $openssl = 'openssl'; + +my $version = '1.27'; + +$opt_w = 76; # default base64 encoded lines length + +# default cert types to include in the output (default is to include CAs which may issue SSL server certs) +my $default_mozilla_trust_purposes = "SERVER_AUTH"; +my $default_mozilla_trust_levels = "TRUSTED_DELEGATOR"; +$opt_p = $default_mozilla_trust_purposes . ":" . $default_mozilla_trust_levels; + +my @valid_mozilla_trust_purposes = ( + "DIGITAL_SIGNATURE", + "NON_REPUDIATION", + "KEY_ENCIPHERMENT", + "DATA_ENCIPHERMENT", + "KEY_AGREEMENT", + "KEY_CERT_SIGN", + "CRL_SIGN", + "SERVER_AUTH", + "CLIENT_AUTH", + "CODE_SIGNING", + "EMAIL_PROTECTION", + "IPSEC_END_SYSTEM", + "IPSEC_TUNNEL", + "IPSEC_USER", + "TIME_STAMPING", + "STEP_UP_APPROVED" +); + +my @valid_mozilla_trust_levels = ( + "TRUSTED_DELEGATOR", # CAs + "NOT_TRUSTED", # Don't trust these certs. + "MUST_VERIFY_TRUST", # This explicitly tells us that it ISN'T a CA but is otherwise ok. In other words, this should tell the app to ignore any other sources that claim this is a CA. + "TRUSTED" # This cert is trusted, but only for itself and not for delegates (i.e. it is not a CA). +); + +my $default_signature_algorithms = $opt_s = "MD5"; + +my @valid_signature_algorithms = ( + "MD5", + "SHA1", + "SHA256", + "SHA384", + "SHA512" +); + +$0 =~ s@.*(/|\\)@@; +$Getopt::Std::STANDARD_HELP_VERSION = 1; +getopts('bd:fhiklmnp:qs:tuvw:'); + +if(!defined($opt_d)) { + # to make plain "-d" use not cause warnings, and actually still work + $opt_d = 'release'; +} + +# Use predefined URL or else custom URL specified on command line. +my $url; +if(defined($urls{$opt_d})) { + $url = $urls{$opt_d}; + if(!$opt_k && $url !~ /^https:\/\//i) { + die "The URL for '$opt_d' is not HTTPS. Use -k to override (insecure).\n"; + } +} +else { + $url = $opt_d; +} + +my $curl = `curl -V`; + +if ($opt_i) { + print ("=" x 78 . "\n"); + print "Script Version : $version\n"; + print "Perl Version : $]\n"; + print "Operating System Name : $^O\n"; + print "Getopt::Std.pm Version : ${Getopt::Std::VERSION}\n"; + print "MIME::Base64.pm Version : ${MIME::Base64::VERSION}\n"; + print "LWP::UserAgent.pm Version : ${LWP::UserAgent::VERSION}\n" if($LWP::UserAgent::VERSION); + print "LWP.pm Version : ${LWP::VERSION}\n" if($LWP::VERSION); + print "Digest::SHA.pm Version : ${Digest::SHA::VERSION}\n" if ($Digest::SHA::VERSION); + print "Digest::SHA::PurePerl.pm Version : ${Digest::SHA::PurePerl::VERSION}\n" if ($Digest::SHA::PurePerl::VERSION); + print ("=" x 78 . "\n"); +} + +sub warning_message() { + if ( $opt_d =~ m/^risk$/i ) { # Long Form Warning and Exit + print "Warning: Use of this script may pose some risk:\n"; + print "\n"; + print " 1) If you use HTTP URLs they are subject to a man in the middle attack\n"; + print " 2) Default to 'release', but more recent updates may be found in other trees\n"; + print " 3) certdata.txt file format may change, lag time to update this script\n"; + print " 4) Generally unwise to blindly trust CAs without manual review & verification\n"; + print " 5) Mozilla apps use additional security checks aren't represented in certdata\n"; + print " 6) Use of this script will make a security engineer grind his teeth and\n"; + print " swear at you. ;)\n"; + exit; + } else { # Short Form Warning + print "Warning: Use of this script may pose some risk, -d risk for more details.\n"; + } +} + +sub HELP_MESSAGE() { + print "Usage:\t${0} [-b] [-d] [-f] [-i] [-k] [-l] [-n] [-p] [-q] [-s] [-t] [-u] [-v] [-w] []\n"; + print "\t-b\tbackup an existing version of ca-bundle.crt\n"; + print "\t-d\tspecify Mozilla tree to pull certdata.txt or custom URL\n"; + print "\t\t Valid names are:\n"; + print "\t\t ", join( ", ", map { ( $_ =~ m/$opt_d/ ) ? "$_ (default)" : "$_" } sort keys %urls ), "\n"; + print "\t-f\tforce rebuild even if certdata.txt is current\n"; + print "\t-i\tprint version info about used modules\n"; + print "\t-k\tallow URLs other than HTTPS, enable HTTP fallback (insecure)\n"; + print "\t-l\tprint license info about certdata.txt\n"; + print "\t-m\tinclude meta data in output\n"; + print "\t-n\tno download of certdata.txt (to use existing)\n"; + print wrap("\t","\t\t", "-p\tlist of Mozilla trust purposes and levels for certificates to include in output. Takes the form of a comma separated list of purposes, a colon, and a comma separated list of levels. (default: $default_mozilla_trust_purposes:$default_mozilla_trust_levels)"), "\n"; + print "\t\t Valid purposes are:\n"; + print wrap("\t\t ","\t\t ", join( ", ", "ALL", @valid_mozilla_trust_purposes ) ), "\n"; + print "\t\t Valid levels are:\n"; + print wrap("\t\t ","\t\t ", join( ", ", "ALL", @valid_mozilla_trust_levels ) ), "\n"; + print "\t-q\tbe really quiet (no progress output at all)\n"; + print wrap("\t","\t\t", "-s\tcomma separated list of certificate signatures/hashes to output in plain text mode. (default: $default_signature_algorithms)\n"); + print "\t\t Valid signature algorithms are:\n"; + print wrap("\t\t ","\t\t ", join( ", ", "ALL", @valid_signature_algorithms ) ), "\n"; + print "\t-t\tinclude plain text listing of certificates\n"; + print "\t-u\tunlink (remove) certdata.txt after processing\n"; + print "\t-v\tbe verbose and print out processed CAs\n"; + print "\t-w \twrap base64 output lines after chars (default: ${opt_w})\n"; + exit; +} + +sub VERSION_MESSAGE() { + print "${0} version ${version} running Perl ${]} on ${^O}\n"; +} + +warning_message() unless ($opt_q || $url =~ m/^(ht|f)tps:/i ); +HELP_MESSAGE() if ($opt_h); + +sub report($@) { + my $output = shift; + + print STDERR $output . "\n" unless $opt_q; +} + +sub is_in_list($@) { + my $target = shift; + + return defined(List::Util::first { $target eq $_ } @_); +} + +# Parses $param_string as a case insensitive comma separated list with optional whitespace +# validates that only allowed parameters are supplied +sub parse_csv_param($$@) { + my $description = shift; + my $param_string = shift; + my @valid_values = @_; + + my @values = map { + s/^\s+//; # strip leading spaces + s/\s+$//; # strip trailing spaces + uc $_ # return the modified string as upper case + } split( ',', $param_string ); + + # Find all values which are not in the list of valid values or "ALL" + my @invalid = grep { !is_in_list($_,"ALL",@valid_values) } @values; + + if ( scalar(@invalid) > 0 ) { + # Tell the user which parameters were invalid and print the standard help message which will exit + print "Error: Invalid ", $description, scalar(@invalid) == 1 ? ": " : "s: ", join( ", ", map { "\"$_\"" } @invalid ), "\n"; + HELP_MESSAGE(); + } + + @values = @valid_values if ( is_in_list("ALL",@values) ); + + return @values; +} + +sub sha256 { + my $result; + if ($Digest::SHA::VERSION || $Digest::SHA::PurePerl::VERSION) { + open(FILE, $_[0]) or die "Can't open '$_[0]': $!"; + binmode(FILE); + $result = $MOD_SHA->new(256)->addfile(*FILE)->hexdigest; + close(FILE); + } else { + # Use OpenSSL command if Perl Digest::SHA modules not available + $result = `"$openssl" dgst -r -sha256 "$_[0]"`; + $result =~ s/^([0-9a-f]{64}) .+/$1/is; + } + return $result; +} + + +sub oldhash { + my $hash = ""; + open(C, "<$_[0]") || return 0; + while() { + chomp; + if($_ =~ /^\#\# SHA256: (.*)/) { + $hash = $1; + last; + } + } + close(C); + return $hash; +} + +if ( $opt_p !~ m/:/ ) { + print "Error: Mozilla trust identifier list must include both purposes and levels\n"; + HELP_MESSAGE(); +} + +(my $included_mozilla_trust_purposes_string, my $included_mozilla_trust_levels_string) = split( ':', $opt_p ); +my @included_mozilla_trust_purposes = parse_csv_param( "trust purpose", $included_mozilla_trust_purposes_string, @valid_mozilla_trust_purposes ); +my @included_mozilla_trust_levels = parse_csv_param( "trust level", $included_mozilla_trust_levels_string, @valid_mozilla_trust_levels ); + +my @included_signature_algorithms = parse_csv_param( "signature algorithm", $opt_s, @valid_signature_algorithms ); + +sub should_output_cert(%) { + my %trust_purposes_by_level = @_; + + foreach my $level (@included_mozilla_trust_levels) { + # for each level we want to output, see if any of our desired purposes are included + return 1 if ( defined( List::Util::first { is_in_list( $_, @included_mozilla_trust_purposes ) } @{$trust_purposes_by_level{$level}} ) ); + } + + return 0; +} + +my $crt = $ARGV[0] || 'ca-bundle.crt'; +(my $txt = $url) =~ s@(.*/|\?.*)@@g; + +my $stdout = $crt eq '-'; +my $resp; +my $fetched; + +my $oldhash = oldhash($crt); + +report "SHA256 of old file: $oldhash"; + +if(!$opt_n) { + report "Downloading $txt ..."; + + # If we have an HTTPS URL then use curl + if($url =~ /^https:\/\//i) { + if($curl) { + if($curl =~ /^Protocols:.* https( |$)/m) { + report "Get certdata with curl!"; + my $proto = !$opt_k ? "--proto =https" : ""; + my $quiet = $opt_q ? "-s" : ""; + my @out = `curl -w %{response_code} $proto $quiet -o "$txt" "$url"`; + if(@out && $out[0] == 200) { + $fetched = 1; + report "Downloaded $txt"; + } + else { + report "Failed downloading via HTTPS with curl"; + if(-e $txt && !unlink($txt)) { + report "Failed to remove '$txt': $!"; + } + } + } + else { + report "curl lacks https support"; + } + } + else { + report "curl not found"; + } + } + + # If nothing was fetched then use LWP + if(!$fetched) { + if($url =~ /^https:\/\//i) { + report "Falling back to HTTP"; + $url =~ s/^https:\/\//http:\/\//i; + } + if(!$opt_k) { + report "URLs other than HTTPS are disabled by default, to enable use -k"; + exit 1; + } + report "Get certdata with LWP!"; + if(!defined(${LWP::UserAgent::VERSION})) { + report "LWP is not available (LWP::UserAgent not found)"; + exit 1; + } + my $ua = new LWP::UserAgent(agent => "$0/$version"); + $ua->env_proxy(); + $resp = $ua->mirror($url, $txt); + if($resp && $resp->code eq '304') { + report "Not modified"; + exit 0 if -e $crt && !$opt_f; + } + else { + $fetched = 1; + report "Downloaded $txt"; + } + if(!$resp || $resp->code !~ /^(?:200|304)$/) { + report "Unable to download latest data: " + . ($resp? $resp->code . ' - ' . $resp->message : "LWP failed"); + exit 1 if -e $crt || ! -r $txt; + } + } +} + +my $filedate = $resp ? $resp->last_modified : (stat($txt))[9]; +my $datesrc = "as of"; +if(!$filedate) { + # mxr.mozilla.org gave us a time, hg.mozilla.org does not! + $filedate = time(); + $datesrc="downloaded on"; +} + +# get the hash from the download file +my $newhash= sha256($txt); + +if(!$opt_f && $oldhash eq $newhash) { + report "Downloaded file identical to previous run\'s source file. Exiting"; + exit; +} + +report "SHA256 of new file: $newhash"; + +my $currentdate = scalar gmtime($filedate); + +my $format = $opt_t ? "plain text and " : ""; +if( $stdout ) { + open(CRT, '> -') or die "Couldn't open STDOUT: $!\n"; +} else { + open(CRT,">$crt.~") or die "Couldn't open $crt.~: $!\n"; +} +print CRT <) { + if (/\*\*\*\*\* BEGIN LICENSE BLOCK \*\*\*\*\*/) { + print CRT; + print if ($opt_l); + while () { + print CRT; + print if ($opt_l); + last if (/\*\*\*\*\* END LICENSE BLOCK \*\*\*\*\*/); + } + } + elsif(/^# (Issuer|Serial Number|Subject|Not Valid Before|Not Valid After |Fingerprint \(MD5\)|Fingerprint \(SHA1\)):/) { + push @precert, $_; + next; + } + elsif(/^#|^\s*$/) { + undef @precert; + next; + } + chomp; + + # this is a match for the start of a certificate + if (/^CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE/) { + $start_of_cert = 1 + } + if ($start_of_cert && /^CKA_LABEL UTF8 \"(.*)\"/) { + $caname = $1; + } + my %trust_purposes_by_level; + if ($start_of_cert && /^CKA_VALUE MULTILINE_OCTAL/) { + my $data; + while () { + last if (/^END/); + chomp; + my @octets = split(/\\/); + shift @octets; + for (@octets) { + $data .= chr(oct); + } + } + # scan forwards until the trust part + while () { + last if (/^CKA_CLASS CK_OBJECT_CLASS CKO_NSS_TRUST/); + chomp; + } + # now scan the trust part to determine how we should trust this cert + while () { + last if (/^#/); + if (/^CKA_TRUST_([A-Z_]+)\s+CK_TRUST\s+CKT_NSS_([A-Z_]+)\s*$/) { + if ( !is_in_list($1,@valid_mozilla_trust_purposes) ) { + report "Warning: Unrecognized trust purpose for cert: $caname. Trust purpose: $1. Trust Level: $2"; + } elsif ( !is_in_list($2,@valid_mozilla_trust_levels) ) { + report "Warning: Unrecognized trust level for cert: $caname. Trust purpose: $1. Trust Level: $2"; + } else { + push @{$trust_purposes_by_level{$2}}, $1; + } + } + } + + if ( !should_output_cert(%trust_purposes_by_level) ) { + $skipnum ++; + } else { + my $encoded = MIME::Base64::encode_base64($data, ''); + $encoded =~ s/(.{1,${opt_w}})/$1\n/g; + my $pem = "-----BEGIN CERTIFICATE-----\n" + . $encoded + . "-----END CERTIFICATE-----\n"; + print CRT "\n$caname\n"; + print CRT @precert if($opt_m); + my $maxStringLength = length(decode('UTF-8', $caname, Encode::FB_CROAK)); + if ($opt_t) { + foreach my $key (keys %trust_purposes_by_level) { + my $string = $key . ": " . join(", ", @{$trust_purposes_by_level{$key}}); + $maxStringLength = List::Util::max( length($string), $maxStringLength ); + print CRT $string . "\n"; + } + } + print CRT ("=" x $maxStringLength . "\n"); + if (!$opt_t) { + print CRT $pem; + } else { + my $pipe = ""; + foreach my $hash (@included_signature_algorithms) { + $pipe = "|$openssl x509 -" . $hash . " -fingerprint -noout -inform PEM"; + if (!$stdout) { + $pipe .= " >> $crt.~"; + close(CRT) or die "Couldn't close $crt.~: $!"; + } + open(TMP, $pipe) or die "Couldn't open openssl pipe: $!"; + print TMP $pem; + close(TMP) or die "Couldn't close openssl pipe: $!"; + if (!$stdout) { + open(CRT, ">>$crt.~") or die "Couldn't open $crt.~: $!"; + } + } + $pipe = "|$openssl x509 -text -inform PEM"; + if (!$stdout) { + $pipe .= " >> $crt.~"; + close(CRT) or die "Couldn't close $crt.~: $!"; + } + open(TMP, $pipe) or die "Couldn't open openssl pipe: $!"; + print TMP $pem; + close(TMP) or die "Couldn't close openssl pipe: $!"; + if (!$stdout) { + open(CRT, ">>$crt.~") or die "Couldn't open $crt.~: $!"; + } + } + report "Parsing: $caname" if ($opt_v); + $certnum ++; + $start_of_cert = 0; + } + undef @precert; + } + +} +close(TXT) or die "Couldn't close $txt: $!\n"; +close(CRT) or die "Couldn't close $crt.~: $!\n"; +unless( $stdout ) { + if ($opt_b && -e $crt) { + my $bk = 1; + while (-e "$crt.~${bk}~") { + $bk++; + } + rename $crt, "$crt.~${bk}~" or die "Failed to create backup $crt.~$bk}~: $!\n"; + } elsif( -e $crt ) { + unlink( $crt ) or die "Failed to remove $crt: $!\n"; + } + rename "$crt.~", $crt or die "Failed to rename $crt.~ to $crt: $!\n"; +} +if($opt_u && -e $txt && !unlink($txt)) { + report "Failed to remove $txt: $!\n"; +} +report "Done ($certnum CA certs processed, $skipnum skipped)."; diff --git a/ports/qca/portfile.cmake b/ports/qca/portfile.cmake index dc360af87..3050de917 100644 --- a/ports/qca/portfile.cmake +++ b/ports/qca/portfile.cmake @@ -1,5 +1,5 @@ # This portfile adds the Qt Cryptographic Arcitecture -# Changes to the original sources by this file: +# Changes to the original build: # No -qt5 suffix, which is recommended just for Linux # Output directories according to vcpkg # Updated certstore. See certstore.pem in the output dirs @@ -13,6 +13,9 @@ endif() include(vcpkg_common_functions) find_program(GIT git) +vcpkg_find_acquire_program(PERL) +get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) +set(ENV{PATH} "${PERL_EXE_PATH};$ENV{PATH}") # Set git variables to qca version 2.2.0 commit set(GIT_URL "git://anongit.kde.org/qca.git") @@ -52,15 +55,18 @@ vcpkg_apply_patches( # https://www.openssl.org/docs/faq.html#USER16 # it is up to developers or admins to maintain CAs. # So we do it here: -# Importing certificates from curl maintainers -# See: https://curl.haxx.se/docs/caextract.html message(STATUS "Importing certstore") file(REMOVE ${SOURCE_PATH}/certs/rootcerts.pem) -file(DOWNLOAD https://curl.haxx.se/ca/cacert.pem - ${SOURCE_PATH}/certs/rootcerts.pem - SHOW_PROGRESS +# Using file(DOWNLOAD) to use https +file(DOWNLOAD https://hg.mozilla.org/projects/nss/raw-file/tip/lib/ckfw/builtins/certdata.txt + ${CMAKE_CURRENT_LIST_DIR}/certdata.txt TLS_VERIFY ON ) +vcpkg_execute_required_process( + COMMAND ${PERL} ${CMAKE_CURRENT_LIST_DIR}/mk-ca-bundle.pl -n ${SOURCE_PATH}/certs/rootcerts.pem + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + LOGNAME ca-bundle +) message(STATUS "Importing certstore done") # Configure and build -- cgit v1.2.3 From bf187f318a735307bcf0a42c3879f00293e477cf Mon Sep 17 00:00:00 2001 From: Alexander Kaspar Date: Sat, 3 Dec 2016 12:41:39 +0100 Subject: [qca] Added mk-ca-bundle.pl to generate certstore at build time. --- ports/qca/import-local-certificates.ps1 | 37 --- ports/qca/mk-ca-bundle.pl | 554 ++++++++++++++++++++++++++++++++ ports/qca/portfile.cmake | 18 +- 3 files changed, 566 insertions(+), 43 deletions(-) delete mode 100644 ports/qca/import-local-certificates.ps1 create mode 100644 ports/qca/mk-ca-bundle.pl diff --git a/ports/qca/import-local-certificates.ps1 b/ports/qca/import-local-certificates.ps1 deleted file mode 100644 index df39cbb01..000000000 --- a/ports/qca/import-local-certificates.ps1 +++ /dev/null @@ -1,37 +0,0 @@ -# According to: -# https://www.openssl.org/docs/faq.html#USER16 -# it is up to developers or admins to maintain CAs. -# -# This script imports LocalMachine certificates into rootcerts.pem -# needed by qca. -# -# PS> .\import-local-certificates.ps1 [-certstore Root] -outpath C:\src\git\vcpkg\ports\qca -# - -param ( - # one of Root, My, CA, ... - [string]$certstore = "Root", - # the path where it should be in qca buildtree (without trailing '\') - [Parameter(Mandatory=$true)][string]$outpath -) - -$certs = (Get-ChildItem -Path 'Cert:\LocalMachine\Root' -EKU "Server Authentication") -$outfile = $outpath + "rootcerts.pem" - -Write-Host "Importing: " $certs.Count " certificates ..." - -foreach ($cert in $certs) -{ - $out = New-Object String[] -ArgumentList 5 - - $out[0] = " " - $out[1] = "# " + $cert.Issuer - $out[2] = "-----BEGIN CERTIFICATE-----" - $out[3] = $([Convert]::ToBase64String($cert.Export('Cert'), [System.Base64FormattingOptions]::InsertLineBreaks)) - $out[4] = "-----END CERTIFICATE-----" - - [System.IO.File]::AppendAllLines($outfile,$out) -} - -Write-Host "Written to: " $outfile -Write-Host "Importing certificates done." diff --git a/ports/qca/mk-ca-bundle.pl b/ports/qca/mk-ca-bundle.pl new file mode 100644 index 000000000..9574f1dbf --- /dev/null +++ b/ports/qca/mk-ca-bundle.pl @@ -0,0 +1,554 @@ +#!/usr/bin/perl -w +# *************************************************************************** +# * _ _ ____ _ +# * Project ___| | | | _ \| | +# * / __| | | | |_) | | +# * | (__| |_| | _ <| |___ +# * \___|\___/|_| \_\_____| +# * +# * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al. +# * +# * This software is licensed as described in the file COPYING, which +# * you should have received as part of this distribution. The terms +# * are also available at https://curl.haxx.se/docs/copyright.html. +# * +# * You may opt to use, copy, modify, merge, publish, distribute and/or sell +# * copies of the Software, and permit persons to whom the Software is +# * furnished to do so, under the terms of the COPYING file. +# * +# * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY +# * KIND, either express or implied. +# * +# *************************************************************************** +# This Perl script creates a fresh ca-bundle.crt file for use with libcurl. +# It downloads certdata.txt from Mozilla's source tree (see URL below), +# then parses certdata.txt and extracts CA Root Certificates into PEM format. +# These are then processed with the OpenSSL commandline tool to produce the +# final ca-bundle.crt file. +# The script is based on the parse-certs script written by Roland Krikava. +# This Perl script works on almost any platform since its only external +# dependency is the OpenSSL commandline tool for optional text listing. +# Hacked by Guenter Knauf. +# +use Encode; +use Getopt::Std; +use MIME::Base64; +use strict; +use vars qw($opt_b $opt_d $opt_f $opt_h $opt_i $opt_k $opt_l $opt_m $opt_n $opt_p $opt_q $opt_s $opt_t $opt_u $opt_v $opt_w); +use List::Util; +use Text::Wrap; +my $MOD_SHA = "Digest::SHA"; +eval "require $MOD_SHA"; +if ($@) { + $MOD_SHA = "Digest::SHA::PurePerl"; + eval "require $MOD_SHA"; +} +eval "require LWP::UserAgent"; + +my %urls = ( + 'nss' => + 'https://hg.mozilla.org/projects/nss/raw-file/tip/lib/ckfw/builtins/certdata.txt', + 'central' => + 'https://hg.mozilla.org/mozilla-central/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt', + 'aurora' => + 'https://hg.mozilla.org/releases/mozilla-aurora/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt', + 'beta' => + 'https://hg.mozilla.org/releases/mozilla-beta/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt', + 'release' => + 'https://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt', +); + +$opt_d = 'release'; + +# If the OpenSSL commandline is not in search path you can configure it here! +my $openssl = 'openssl'; + +my $version = '1.27'; + +$opt_w = 76; # default base64 encoded lines length + +# default cert types to include in the output (default is to include CAs which may issue SSL server certs) +my $default_mozilla_trust_purposes = "SERVER_AUTH"; +my $default_mozilla_trust_levels = "TRUSTED_DELEGATOR"; +$opt_p = $default_mozilla_trust_purposes . ":" . $default_mozilla_trust_levels; + +my @valid_mozilla_trust_purposes = ( + "DIGITAL_SIGNATURE", + "NON_REPUDIATION", + "KEY_ENCIPHERMENT", + "DATA_ENCIPHERMENT", + "KEY_AGREEMENT", + "KEY_CERT_SIGN", + "CRL_SIGN", + "SERVER_AUTH", + "CLIENT_AUTH", + "CODE_SIGNING", + "EMAIL_PROTECTION", + "IPSEC_END_SYSTEM", + "IPSEC_TUNNEL", + "IPSEC_USER", + "TIME_STAMPING", + "STEP_UP_APPROVED" +); + +my @valid_mozilla_trust_levels = ( + "TRUSTED_DELEGATOR", # CAs + "NOT_TRUSTED", # Don't trust these certs. + "MUST_VERIFY_TRUST", # This explicitly tells us that it ISN'T a CA but is otherwise ok. In other words, this should tell the app to ignore any other sources that claim this is a CA. + "TRUSTED" # This cert is trusted, but only for itself and not for delegates (i.e. it is not a CA). +); + +my $default_signature_algorithms = $opt_s = "MD5"; + +my @valid_signature_algorithms = ( + "MD5", + "SHA1", + "SHA256", + "SHA384", + "SHA512" +); + +$0 =~ s@.*(/|\\)@@; +$Getopt::Std::STANDARD_HELP_VERSION = 1; +getopts('bd:fhiklmnp:qs:tuvw:'); + +if(!defined($opt_d)) { + # to make plain "-d" use not cause warnings, and actually still work + $opt_d = 'release'; +} + +# Use predefined URL or else custom URL specified on command line. +my $url; +if(defined($urls{$opt_d})) { + $url = $urls{$opt_d}; + if(!$opt_k && $url !~ /^https:\/\//i) { + die "The URL for '$opt_d' is not HTTPS. Use -k to override (insecure).\n"; + } +} +else { + $url = $opt_d; +} + +my $curl = `curl -V`; + +if ($opt_i) { + print ("=" x 78 . "\n"); + print "Script Version : $version\n"; + print "Perl Version : $]\n"; + print "Operating System Name : $^O\n"; + print "Getopt::Std.pm Version : ${Getopt::Std::VERSION}\n"; + print "MIME::Base64.pm Version : ${MIME::Base64::VERSION}\n"; + print "LWP::UserAgent.pm Version : ${LWP::UserAgent::VERSION}\n" if($LWP::UserAgent::VERSION); + print "LWP.pm Version : ${LWP::VERSION}\n" if($LWP::VERSION); + print "Digest::SHA.pm Version : ${Digest::SHA::VERSION}\n" if ($Digest::SHA::VERSION); + print "Digest::SHA::PurePerl.pm Version : ${Digest::SHA::PurePerl::VERSION}\n" if ($Digest::SHA::PurePerl::VERSION); + print ("=" x 78 . "\n"); +} + +sub warning_message() { + if ( $opt_d =~ m/^risk$/i ) { # Long Form Warning and Exit + print "Warning: Use of this script may pose some risk:\n"; + print "\n"; + print " 1) If you use HTTP URLs they are subject to a man in the middle attack\n"; + print " 2) Default to 'release', but more recent updates may be found in other trees\n"; + print " 3) certdata.txt file format may change, lag time to update this script\n"; + print " 4) Generally unwise to blindly trust CAs without manual review & verification\n"; + print " 5) Mozilla apps use additional security checks aren't represented in certdata\n"; + print " 6) Use of this script will make a security engineer grind his teeth and\n"; + print " swear at you. ;)\n"; + exit; + } else { # Short Form Warning + print "Warning: Use of this script may pose some risk, -d risk for more details.\n"; + } +} + +sub HELP_MESSAGE() { + print "Usage:\t${0} [-b] [-d] [-f] [-i] [-k] [-l] [-n] [-p] [-q] [-s] [-t] [-u] [-v] [-w] []\n"; + print "\t-b\tbackup an existing version of ca-bundle.crt\n"; + print "\t-d\tspecify Mozilla tree to pull certdata.txt or custom URL\n"; + print "\t\t Valid names are:\n"; + print "\t\t ", join( ", ", map { ( $_ =~ m/$opt_d/ ) ? "$_ (default)" : "$_" } sort keys %urls ), "\n"; + print "\t-f\tforce rebuild even if certdata.txt is current\n"; + print "\t-i\tprint version info about used modules\n"; + print "\t-k\tallow URLs other than HTTPS, enable HTTP fallback (insecure)\n"; + print "\t-l\tprint license info about certdata.txt\n"; + print "\t-m\tinclude meta data in output\n"; + print "\t-n\tno download of certdata.txt (to use existing)\n"; + print wrap("\t","\t\t", "-p\tlist of Mozilla trust purposes and levels for certificates to include in output. Takes the form of a comma separated list of purposes, a colon, and a comma separated list of levels. (default: $default_mozilla_trust_purposes:$default_mozilla_trust_levels)"), "\n"; + print "\t\t Valid purposes are:\n"; + print wrap("\t\t ","\t\t ", join( ", ", "ALL", @valid_mozilla_trust_purposes ) ), "\n"; + print "\t\t Valid levels are:\n"; + print wrap("\t\t ","\t\t ", join( ", ", "ALL", @valid_mozilla_trust_levels ) ), "\n"; + print "\t-q\tbe really quiet (no progress output at all)\n"; + print wrap("\t","\t\t", "-s\tcomma separated list of certificate signatures/hashes to output in plain text mode. (default: $default_signature_algorithms)\n"); + print "\t\t Valid signature algorithms are:\n"; + print wrap("\t\t ","\t\t ", join( ", ", "ALL", @valid_signature_algorithms ) ), "\n"; + print "\t-t\tinclude plain text listing of certificates\n"; + print "\t-u\tunlink (remove) certdata.txt after processing\n"; + print "\t-v\tbe verbose and print out processed CAs\n"; + print "\t-w \twrap base64 output lines after chars (default: ${opt_w})\n"; + exit; +} + +sub VERSION_MESSAGE() { + print "${0} version ${version} running Perl ${]} on ${^O}\n"; +} + +warning_message() unless ($opt_q || $url =~ m/^(ht|f)tps:/i ); +HELP_MESSAGE() if ($opt_h); + +sub report($@) { + my $output = shift; + + print STDERR $output . "\n" unless $opt_q; +} + +sub is_in_list($@) { + my $target = shift; + + return defined(List::Util::first { $target eq $_ } @_); +} + +# Parses $param_string as a case insensitive comma separated list with optional whitespace +# validates that only allowed parameters are supplied +sub parse_csv_param($$@) { + my $description = shift; + my $param_string = shift; + my @valid_values = @_; + + my @values = map { + s/^\s+//; # strip leading spaces + s/\s+$//; # strip trailing spaces + uc $_ # return the modified string as upper case + } split( ',', $param_string ); + + # Find all values which are not in the list of valid values or "ALL" + my @invalid = grep { !is_in_list($_,"ALL",@valid_values) } @values; + + if ( scalar(@invalid) > 0 ) { + # Tell the user which parameters were invalid and print the standard help message which will exit + print "Error: Invalid ", $description, scalar(@invalid) == 1 ? ": " : "s: ", join( ", ", map { "\"$_\"" } @invalid ), "\n"; + HELP_MESSAGE(); + } + + @values = @valid_values if ( is_in_list("ALL",@values) ); + + return @values; +} + +sub sha256 { + my $result; + if ($Digest::SHA::VERSION || $Digest::SHA::PurePerl::VERSION) { + open(FILE, $_[0]) or die "Can't open '$_[0]': $!"; + binmode(FILE); + $result = $MOD_SHA->new(256)->addfile(*FILE)->hexdigest; + close(FILE); + } else { + # Use OpenSSL command if Perl Digest::SHA modules not available + $result = `"$openssl" dgst -r -sha256 "$_[0]"`; + $result =~ s/^([0-9a-f]{64}) .+/$1/is; + } + return $result; +} + + +sub oldhash { + my $hash = ""; + open(C, "<$_[0]") || return 0; + while() { + chomp; + if($_ =~ /^\#\# SHA256: (.*)/) { + $hash = $1; + last; + } + } + close(C); + return $hash; +} + +if ( $opt_p !~ m/:/ ) { + print "Error: Mozilla trust identifier list must include both purposes and levels\n"; + HELP_MESSAGE(); +} + +(my $included_mozilla_trust_purposes_string, my $included_mozilla_trust_levels_string) = split( ':', $opt_p ); +my @included_mozilla_trust_purposes = parse_csv_param( "trust purpose", $included_mozilla_trust_purposes_string, @valid_mozilla_trust_purposes ); +my @included_mozilla_trust_levels = parse_csv_param( "trust level", $included_mozilla_trust_levels_string, @valid_mozilla_trust_levels ); + +my @included_signature_algorithms = parse_csv_param( "signature algorithm", $opt_s, @valid_signature_algorithms ); + +sub should_output_cert(%) { + my %trust_purposes_by_level = @_; + + foreach my $level (@included_mozilla_trust_levels) { + # for each level we want to output, see if any of our desired purposes are included + return 1 if ( defined( List::Util::first { is_in_list( $_, @included_mozilla_trust_purposes ) } @{$trust_purposes_by_level{$level}} ) ); + } + + return 0; +} + +my $crt = $ARGV[0] || 'ca-bundle.crt'; +(my $txt = $url) =~ s@(.*/|\?.*)@@g; + +my $stdout = $crt eq '-'; +my $resp; +my $fetched; + +my $oldhash = oldhash($crt); + +report "SHA256 of old file: $oldhash"; + +if(!$opt_n) { + report "Downloading $txt ..."; + + # If we have an HTTPS URL then use curl + if($url =~ /^https:\/\//i) { + if($curl) { + if($curl =~ /^Protocols:.* https( |$)/m) { + report "Get certdata with curl!"; + my $proto = !$opt_k ? "--proto =https" : ""; + my $quiet = $opt_q ? "-s" : ""; + my @out = `curl -w %{response_code} $proto $quiet -o "$txt" "$url"`; + if(@out && $out[0] == 200) { + $fetched = 1; + report "Downloaded $txt"; + } + else { + report "Failed downloading via HTTPS with curl"; + if(-e $txt && !unlink($txt)) { + report "Failed to remove '$txt': $!"; + } + } + } + else { + report "curl lacks https support"; + } + } + else { + report "curl not found"; + } + } + + # If nothing was fetched then use LWP + if(!$fetched) { + if($url =~ /^https:\/\//i) { + report "Falling back to HTTP"; + $url =~ s/^https:\/\//http:\/\//i; + } + if(!$opt_k) { + report "URLs other than HTTPS are disabled by default, to enable use -k"; + exit 1; + } + report "Get certdata with LWP!"; + if(!defined(${LWP::UserAgent::VERSION})) { + report "LWP is not available (LWP::UserAgent not found)"; + exit 1; + } + my $ua = new LWP::UserAgent(agent => "$0/$version"); + $ua->env_proxy(); + $resp = $ua->mirror($url, $txt); + if($resp && $resp->code eq '304') { + report "Not modified"; + exit 0 if -e $crt && !$opt_f; + } + else { + $fetched = 1; + report "Downloaded $txt"; + } + if(!$resp || $resp->code !~ /^(?:200|304)$/) { + report "Unable to download latest data: " + . ($resp? $resp->code . ' - ' . $resp->message : "LWP failed"); + exit 1 if -e $crt || ! -r $txt; + } + } +} + +my $filedate = $resp ? $resp->last_modified : (stat($txt))[9]; +my $datesrc = "as of"; +if(!$filedate) { + # mxr.mozilla.org gave us a time, hg.mozilla.org does not! + $filedate = time(); + $datesrc="downloaded on"; +} + +# get the hash from the download file +my $newhash= sha256($txt); + +if(!$opt_f && $oldhash eq $newhash) { + report "Downloaded file identical to previous run\'s source file. Exiting"; + exit; +} + +report "SHA256 of new file: $newhash"; + +my $currentdate = scalar gmtime($filedate); + +my $format = $opt_t ? "plain text and " : ""; +if( $stdout ) { + open(CRT, '> -') or die "Couldn't open STDOUT: $!\n"; +} else { + open(CRT,">$crt.~") or die "Couldn't open $crt.~: $!\n"; +} +print CRT <) { + if (/\*\*\*\*\* BEGIN LICENSE BLOCK \*\*\*\*\*/) { + print CRT; + print if ($opt_l); + while () { + print CRT; + print if ($opt_l); + last if (/\*\*\*\*\* END LICENSE BLOCK \*\*\*\*\*/); + } + } + elsif(/^# (Issuer|Serial Number|Subject|Not Valid Before|Not Valid After |Fingerprint \(MD5\)|Fingerprint \(SHA1\)):/) { + push @precert, $_; + next; + } + elsif(/^#|^\s*$/) { + undef @precert; + next; + } + chomp; + + # this is a match for the start of a certificate + if (/^CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE/) { + $start_of_cert = 1 + } + if ($start_of_cert && /^CKA_LABEL UTF8 \"(.*)\"/) { + $caname = $1; + } + my %trust_purposes_by_level; + if ($start_of_cert && /^CKA_VALUE MULTILINE_OCTAL/) { + my $data; + while () { + last if (/^END/); + chomp; + my @octets = split(/\\/); + shift @octets; + for (@octets) { + $data .= chr(oct); + } + } + # scan forwards until the trust part + while () { + last if (/^CKA_CLASS CK_OBJECT_CLASS CKO_NSS_TRUST/); + chomp; + } + # now scan the trust part to determine how we should trust this cert + while () { + last if (/^#/); + if (/^CKA_TRUST_([A-Z_]+)\s+CK_TRUST\s+CKT_NSS_([A-Z_]+)\s*$/) { + if ( !is_in_list($1,@valid_mozilla_trust_purposes) ) { + report "Warning: Unrecognized trust purpose for cert: $caname. Trust purpose: $1. Trust Level: $2"; + } elsif ( !is_in_list($2,@valid_mozilla_trust_levels) ) { + report "Warning: Unrecognized trust level for cert: $caname. Trust purpose: $1. Trust Level: $2"; + } else { + push @{$trust_purposes_by_level{$2}}, $1; + } + } + } + + if ( !should_output_cert(%trust_purposes_by_level) ) { + $skipnum ++; + } else { + my $encoded = MIME::Base64::encode_base64($data, ''); + $encoded =~ s/(.{1,${opt_w}})/$1\n/g; + my $pem = "-----BEGIN CERTIFICATE-----\n" + . $encoded + . "-----END CERTIFICATE-----\n"; + print CRT "\n$caname\n"; + print CRT @precert if($opt_m); + my $maxStringLength = length(decode('UTF-8', $caname, Encode::FB_CROAK)); + if ($opt_t) { + foreach my $key (keys %trust_purposes_by_level) { + my $string = $key . ": " . join(", ", @{$trust_purposes_by_level{$key}}); + $maxStringLength = List::Util::max( length($string), $maxStringLength ); + print CRT $string . "\n"; + } + } + print CRT ("=" x $maxStringLength . "\n"); + if (!$opt_t) { + print CRT $pem; + } else { + my $pipe = ""; + foreach my $hash (@included_signature_algorithms) { + $pipe = "|$openssl x509 -" . $hash . " -fingerprint -noout -inform PEM"; + if (!$stdout) { + $pipe .= " >> $crt.~"; + close(CRT) or die "Couldn't close $crt.~: $!"; + } + open(TMP, $pipe) or die "Couldn't open openssl pipe: $!"; + print TMP $pem; + close(TMP) or die "Couldn't close openssl pipe: $!"; + if (!$stdout) { + open(CRT, ">>$crt.~") or die "Couldn't open $crt.~: $!"; + } + } + $pipe = "|$openssl x509 -text -inform PEM"; + if (!$stdout) { + $pipe .= " >> $crt.~"; + close(CRT) or die "Couldn't close $crt.~: $!"; + } + open(TMP, $pipe) or die "Couldn't open openssl pipe: $!"; + print TMP $pem; + close(TMP) or die "Couldn't close openssl pipe: $!"; + if (!$stdout) { + open(CRT, ">>$crt.~") or die "Couldn't open $crt.~: $!"; + } + } + report "Parsing: $caname" if ($opt_v); + $certnum ++; + $start_of_cert = 0; + } + undef @precert; + } + +} +close(TXT) or die "Couldn't close $txt: $!\n"; +close(CRT) or die "Couldn't close $crt.~: $!\n"; +unless( $stdout ) { + if ($opt_b && -e $crt) { + my $bk = 1; + while (-e "$crt.~${bk}~") { + $bk++; + } + rename $crt, "$crt.~${bk}~" or die "Failed to create backup $crt.~$bk}~: $!\n"; + } elsif( -e $crt ) { + unlink( $crt ) or die "Failed to remove $crt: $!\n"; + } + rename "$crt.~", $crt or die "Failed to rename $crt.~ to $crt: $!\n"; +} +if($opt_u && -e $txt && !unlink($txt)) { + report "Failed to remove $txt: $!\n"; +} +report "Done ($certnum CA certs processed, $skipnum skipped)."; diff --git a/ports/qca/portfile.cmake b/ports/qca/portfile.cmake index dc360af87..072c4b7cb 100644 --- a/ports/qca/portfile.cmake +++ b/ports/qca/portfile.cmake @@ -1,5 +1,5 @@ # This portfile adds the Qt Cryptographic Arcitecture -# Changes to the original sources by this file: +# Changes to the original build: # No -qt5 suffix, which is recommended just for Linux # Output directories according to vcpkg # Updated certstore. See certstore.pem in the output dirs @@ -13,6 +13,9 @@ endif() include(vcpkg_common_functions) find_program(GIT git) +vcpkg_find_acquire_program(PERL) +get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) +set(ENV{PATH} "${PERL_EXE_PATH};$ENV{PATH}") # Set git variables to qca version 2.2.0 commit set(GIT_URL "git://anongit.kde.org/qca.git") @@ -52,15 +55,18 @@ vcpkg_apply_patches( # https://www.openssl.org/docs/faq.html#USER16 # it is up to developers or admins to maintain CAs. # So we do it here: -# Importing certificates from curl maintainers -# See: https://curl.haxx.se/docs/caextract.html message(STATUS "Importing certstore") file(REMOVE ${SOURCE_PATH}/certs/rootcerts.pem) -file(DOWNLOAD https://curl.haxx.se/ca/cacert.pem - ${SOURCE_PATH}/certs/rootcerts.pem - SHOW_PROGRESS +# Using file(DOWNLOAD) to use https +file(DOWNLOAD https://raw.githubusercontent.com/mozilla/gecko-dev/master/security/nss/lib/ckfw/builtins/certdata.txt + ${CMAKE_CURRENT_LIST_DIR}/certdata.txt TLS_VERIFY ON ) +vcpkg_execute_required_process( + COMMAND ${PERL} ${CMAKE_CURRENT_LIST_DIR}/mk-ca-bundle.pl -n ${SOURCE_PATH}/certs/rootcerts.pem + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + LOGNAME ca-bundle +) message(STATUS "Importing certstore done") # Configure and build -- cgit v1.2.3 From 6e3b500a827b3a85e47c3c37047660f3cb369a8f Mon Sep 17 00:00:00 2001 From: codicodi Date: Sun, 4 Dec 2016 15:03:47 +0100 Subject: [nana] initial commit --- ports/nana/CONTROL | 4 ++++ ports/nana/fix-linking.patch | 51 ++++++++++++++++++++++++++++++++++++++++++++ ports/nana/portfile.cmake | 36 +++++++++++++++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 ports/nana/CONTROL create mode 100644 ports/nana/fix-linking.patch create mode 100644 ports/nana/portfile.cmake diff --git a/ports/nana/CONTROL b/ports/nana/CONTROL new file mode 100644 index 000000000..e7692526f --- /dev/null +++ b/ports/nana/CONTROL @@ -0,0 +1,4 @@ +Source: nana +Version: 1.4.1 +Description: Cross-platform library for GUI programming in modern C++ style. +Build-Depends: zlib, libpng, libjpeg-turbo diff --git a/ports/nana/fix-linking.patch b/ports/nana/fix-linking.patch new file mode 100644 index 000000000..08ab58151 --- /dev/null +++ b/ports/nana/fix-linking.patch @@ -0,0 +1,51 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5c9c9c9..8376431 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -149,26 +149,20 @@ endif () + # Find PNG + if(NANA_CMAKE_ENABLE_PNG) + add_definitions(-DNANA_ENABLE_PNG) +- set(NANA_LINKS "${NANA_LINKS} -lpng") + if(NANA_CMAKE_LIBPNG_FROM_OS) +- find_package(PNG) +- if (PNG_FOUND) +- include_directories( ${PNG_INCLUDE_DIRS}) +- add_definitions(-DUSE_LIBPNG_FROM_OS) +- endif(PNG_FOUND) ++ find_package(PNG REQUIRED) ++ include_directories(${PNG_INCLUDE_DIRS}) ++ add_definitions(-DUSE_LIBPNG_FROM_OS) + endif(NANA_CMAKE_LIBPNG_FROM_OS) + endif(NANA_CMAKE_ENABLE_PNG) + + # Find JPEG + if(NANA_CMAKE_ENABLE_JPEG) + add_definitions(-DNANA_ENABLE_JPEG) +- set(NANA_LINKS "${NANA_LINKS} -ljpeg") + if(NANA_CMAKE_LIBJPEG_FROM_OS) +- find_package(JPEG) +- if (JPEG_FOUND) +- include_directories( ${JPEG_INCLUDE_DIRS}) +- add_definitions(-DUSE_LIBJPEG_FROM_OS) +- endif(JPEG_FOUND) ++ find_package(JPEG REQUIRED) ++ include_directories(${JPEG_INCLUDE_DIRS}) ++ add_definitions(-DUSE_LIBJPEG_FROM_OS) + endif(NANA_CMAKE_LIBJPEG_FROM_OS) + endif(NANA_CMAKE_ENABLE_JPEG) + +@@ -253,7 +247,12 @@ endforeach(subdir ${NANA_SOURCE_SUBDIRS}) + + include_directories(${NANA_INCLUDE_DIR}) + add_library(${PROJECT_NAME} ${sources} ) +-target_link_libraries(${PROJECT_NAME} ${NANA_LINKS}) ++if(NANA_CMAKE_ENABLE_JPEG AND NANA_CMAKE_LIBJPEG_FROM_OS) ++ target_link_libraries(${PROJECT_NAME} ${PNG_LIBRARIES}) ++endif() ++if(NANA_CMAKE_ENABLE_PNG AND NANA_CMAKE_LIBPNG_FROM_OS) ++ target_link_libraries(${PROJECT_NAME} ${JPEG_LIBRARIES}) ++endif() + + # Headers: use INCLUDE_DIRECTORIES + # Libraries: use FIND_LIBRARY and link with the result of it (try to avoid LINK_DIRECTORIES) diff --git a/ports/nana/portfile.cmake b/ports/nana/portfile.cmake new file mode 100644 index 000000000..66fca68fa --- /dev/null +++ b/ports/nana/portfile.cmake @@ -0,0 +1,36 @@ + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/nana) +vcpkg_download_distfile(ARCHIVE + URLS "http://downloads.sourceforge.net/project/nanapro/Nana/Nana 1.x/nana 1.4.1.zip" + FILENAME "nana 1.4.1.zip" + SHA512 38a4fe4c9f932d0e69753c0c1e28d0c8f7cc1ab73c639b87dd5ba102ed25da1ee04c93ec5d6bb79945f7bc118cc131022604c75c1bb6eaced3a071eb137115cd) + +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-linking.patch") + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON + -DNANA_CMAKE_ENABLE_PNG=ON + -DNANA_CMAKE_ENABLE_JPEG=ON + OPTIONS_DEBUG + -DNANA_CMAKE_INSTALL_INCLUDES=OFF) + +vcpkg_install_cmake() + +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/Debug/nana.dll + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/Release/nana.dll + DESTINATION ${CURRENT_PACKAGES_DIR}/bin) +endif() + +vcpkg_copy_pdbs() + +file(COPY ${SOURCE_PATH}/LICENSE_1_0.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/nana) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/nana/LICENSE_1_0.txt ${CURRENT_PACKAGES_DIR}/share/nana/copyright) -- cgit v1.2.3 From 49e760390ebd58670fb24a184e81db50360a8399 Mon Sep 17 00:00:00 2001 From: vlj Date: Fri, 2 Dec 2016 17:07:13 +0100 Subject: Expose some glslang internal includes and enforce static build. --- ports/glslang/portfile.cmake | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/ports/glslang/portfile.cmake b/ports/glslang/portfile.cmake index bdeece78a..bbc868915 100644 --- a/ports/glslang/portfile.cmake +++ b/ports/glslang/portfile.cmake @@ -30,14 +30,10 @@ if(NOT EXISTS "${CURRENT_BUILDTREES_DIR}/src/.git") LOGNAME worktree ) message(STATUS "Patching") - vcpkg_execute_required_process( - COMMAND ${GIT} apply ${CMAKE_CURRENT_LIST_DIR}/0001-Fix-export-symbol-for-Windows.patch --ignore-whitespace --whitespace=fix - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/src - LOGNAME patch - ) endif() - +set(VCPKG_LIBRARY_LINKAGE "static") +set(VCPKG_CRT_LINKAGE "static") vcpkg_configure_cmake( SOURCE_PATH "${CURRENT_BUILDTREES_DIR}/src" @@ -45,7 +41,12 @@ vcpkg_configure_cmake( vcpkg_install_cmake() -file(COPY "${CURRENT_BUILDTREES_DIR}/src/glslang/Public/ShaderLang.h" DESTINATION ${CURRENT_PACKAGES_DIR}/include/glslang) +file(COPY "${CURRENT_BUILDTREES_DIR}/src/glslang/Public" DESTINATION ${CURRENT_PACKAGES_DIR}/include/glslang) +file(COPY "${CURRENT_BUILDTREES_DIR}/src/glslang/Include" DESTINATION ${CURRENT_PACKAGES_DIR}/include/glslang) +file(COPY "${CURRENT_BUILDTREES_DIR}/src/glslang/MachineIndependent/Versions.h" DESTINATION ${CURRENT_PACKAGES_DIR}/include/glslang/MachineIndependent) +file(COPY "${CURRENT_BUILDTREES_DIR}/src/SPIRV/Logger.h" DESTINATION ${CURRENT_PACKAGES_DIR}/include/SPIRV) +file(COPY "${CURRENT_BUILDTREES_DIR}/src/SPIRV/spirv.hpp" DESTINATION ${CURRENT_PACKAGES_DIR}/include/SPIRV) +file(COPY "${CURRENT_BUILDTREES_DIR}/src/SPIRV/GlslangToSpv.h" DESTINATION ${CURRENT_PACKAGES_DIR}/include/SPIRV) file(COPY "${CURRENT_PACKAGES_DIR}/bin/glslangValidator.exe" DESTINATION ${CURRENT_PACKAGES_DIR}/tools) file(REMOVE "${CURRENT_PACKAGES_DIR}/bin/glslangValidator.exe") file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/glslangValidator.exe") @@ -56,12 +57,12 @@ file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/spirv-remap.exe") file(GLOB BIN_DIR "${CURRENT_PACKAGES_DIR}/bin/*") list(LENGTH BIN_DIR BIN_DIR_SIZE) if(${BIN_DIR_SIZE} EQUAL 0) - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin") endif() file(GLOB DEBUG_BIN_DIR "${CURRENT_PACKAGES_DIR}/debug/bin/*") list(LENGTH DEBUG_BIN_DIR DEBUG_BIN_DIR_SIZE) if(${DEBUG_BIN_DIR_SIZE} EQUAL 0) - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin") endif() # Handle copyright -- cgit v1.2.3 From b78fdc699457118368e251029211fc701e10be56 Mon Sep 17 00:00:00 2001 From: vlj Date: Sun, 27 Nov 2016 12:07:15 +0100 Subject: Add shaderc. --- .../0001-Do-not-generate-build-version.inc.patch | 30 ++++++ ports/shaderc/CMakeLists.txt | 29 ++++++ ports/shaderc/CONTROL | 3 + ports/shaderc/build-version.inc | 3 + ports/shaderc/portfile.cmake | 114 +++++++++++++++++++++ 5 files changed, 179 insertions(+) create mode 100644 ports/shaderc/0001-Do-not-generate-build-version.inc.patch create mode 100644 ports/shaderc/CMakeLists.txt create mode 100644 ports/shaderc/CONTROL create mode 100644 ports/shaderc/build-version.inc create mode 100644 ports/shaderc/portfile.cmake diff --git a/ports/shaderc/0001-Do-not-generate-build-version.inc.patch b/ports/shaderc/0001-Do-not-generate-build-version.inc.patch new file mode 100644 index 000000000..41cc81220 --- /dev/null +++ b/ports/shaderc/0001-Do-not-generate-build-version.inc.patch @@ -0,0 +1,30 @@ +From e8e12e856cbc41f9bdcc83bc87eb5013df199ee1 Mon Sep 17 00:00:00 2001 +From: vlj +Date: Fri, 2 Dec 2016 16:36:25 +0100 +Subject: [PATCH] Do not generate build-version.inc + +--- + CMakeLists.txt | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a4c2fac..5544a2d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -53,8 +53,8 @@ add_subdirectory(libshaderc) + add_subdirectory(glslc) + add_subdirectory(examples) + +-add_custom_target(build-version +- ${PYTHON_EXE} +- ${CMAKE_CURRENT_SOURCE_DIR}/utils/update_build_version.py +- ${shaderc_SOURCE_DIR} ${spirv-tools_SOURCE_DIR} ${glslang_SOURCE_DIR} +- COMMENT "Update build-version.inc in the Shaderc build directory (if necessary).") ++#add_custom_target(build-version ++# ${PYTHON_EXE} ++# ${CMAKE_CURRENT_SOURCE_DIR}/utils/update_build_version.py ++# ${shaderc_SOURCE_DIR} ${spirv-tools_SOURCE_DIR} ${glslang_SOURCE_DIR} ++# COMMENT "Update build-version.inc in the Shaderc build directory (if necessary).") +-- +2.10.2.windows.1 + diff --git a/ports/shaderc/CMakeLists.txt b/ports/shaderc/CMakeLists.txt new file mode 100644 index 000000000..3dc7be973 --- /dev/null +++ b/ports/shaderc/CMakeLists.txt @@ -0,0 +1,29 @@ +option(SUFFIX_D "Add d Suffix to lib" ${SUFFIX_D}) +if(NOT ${SUFFIX_D}) + find_library(GLSLANG glslang) + find_library(OSDEPENDENT OSDependent) + find_library(OGLCOMPILER OGLCompiler) + find_library(HLSLLIB HLSL) + find_library(SPIRVLIB SPIRV) +ELSE() + find_library(GLSLANG glslangd) + find_library(OSDEPENDENT OSDependentd) + find_library(OGLCOMPILER OGLCompilerd) + find_library(HLSLLIB HLSLd) + find_library(SPIRVLIB SPIRVd) +ENDIF() + +add_library(glslang STATIC IMPORTED GLOBAL) +set_property(TARGET glslang PROPERTY IMPORTED_LOCATION "${GLSLANG}") + +add_library(OSDependent STATIC IMPORTED GLOBAL) +set_property(TARGET OSDependent PROPERTY IMPORTED_LOCATION "${OSDEPENDENT}") + +add_library(OGLCompiler STATIC IMPORTED GLOBAL) +set_property(TARGET OGLCompiler PROPERTY IMPORTED_LOCATION "${OGLCOMPILER}") + +add_library(HLSL STATIC IMPORTED GLOBAL) +set_property(TARGET HLSL PROPERTY IMPORTED_LOCATION "${HLSLLIB}") + +add_library(SPIRV STATIC IMPORTED GLOBAL) +set_property(TARGET SPIRV PROPERTY IMPORTED_LOCATION "${SPIRVLIB}") diff --git a/ports/shaderc/CONTROL b/ports/shaderc/CONTROL new file mode 100644 index 000000000..7f82bee28 --- /dev/null +++ b/ports/shaderc/CONTROL @@ -0,0 +1,3 @@ +Source: shaderc +Version: 2df47b51d83ad83cbc2e7f8ff2b56776293e8958 +Description: A collection of tools, libraries and tests for shader compilation. diff --git a/ports/shaderc/build-version.inc b/ports/shaderc/build-version.inc new file mode 100644 index 000000000..853e89916 --- /dev/null +++ b/ports/shaderc/build-version.inc @@ -0,0 +1,3 @@ +"shaderc v2016.2-dev unknown hash, 2016-12-02\n" +"spirv-tools v2016.6-dev unknown hash, 2016-12-02\n" +"glslang unknown hash, 2016-12-02\n" diff --git a/ports/shaderc/portfile.cmake b/ports/shaderc/portfile.cmake new file mode 100644 index 000000000..74dff4d9d --- /dev/null +++ b/ports/shaderc/portfile.cmake @@ -0,0 +1,114 @@ +# 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) +find_program(GIT git) + +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src) + +set(SHADERC_GIT_URL "https://github.com/google/shaderc.git") +set(SHADERC_GIT_REF "2df47b51d83ad83cbc2e7f8ff2b56776293e8958") +if(NOT EXISTS "${DOWNLOADS}/shaderc.git") + message(STATUS "Cloning") + vcpkg_execute_required_process( + COMMAND ${GIT} clone --bare ${SHADERC_GIT_URL} ${DOWNLOADS}/shaderc.git + WORKING_DIRECTORY ${DOWNLOADS} + LOGNAME clone + ) +endif() +if(NOT EXISTS "${SOURCE_PATH}/.git") + message(STATUS "Adding worktree and patching") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}) + vcpkg_execute_required_process( + COMMAND ${GIT} worktree add -f --detach ${SOURCE_PATH} ${SHADERC_GIT_REF} + WORKING_DIRECTORY ${DOWNLOADS}/shaderc.git + LOGNAME worktree + ) + message(STATUS "Patching") + vcpkg_execute_required_process( + COMMAND ${GIT} apply ${CMAKE_CURRENT_LIST_DIR}/0001-Do-not-generate-build-version.inc.patch --ignore-whitespace --whitespace=fix + WORKING_DIRECTORY ${SOURCE_PATH} + LOGNAME patch + ) +endif() + +set(GLSLANG_GIT_URL "https://github.com/KhronosGroup/glslang.git") +set(GLSLANG_GIT_REF "1c573fbcfba6b3d631008b1babc838501ca925d3") +set(SPIRVTOOLS_GIT_URL "https://github.com/KhronosGroup/SPIRV-Tools.git") +set(SPIRVTOOLS_GIT_REF "f72189c249ba143c6a89a4cf1e7d53337b2ddd40") +set(SPIRVHEADERS_GIT_URL "https://github.com/KhronosGroup/SPIRV-Headers.git") +set(SPIRVHEADERS_GIT_REF "bd47a9abaefac00be692eae677daed1b977e625c") + +if(NOT EXISTS "${DOWNLOADS}/SPIRV-Tools.git") + message(STATUS "Cloning") + vcpkg_execute_required_process( + COMMAND ${GIT} clone --bare ${SPIRVTOOLS_GIT_URL} ${DOWNLOADS}/SPIRV-Tools.git + WORKING_DIRECTORY ${DOWNLOADS} + LOGNAME clone + ) +endif() +if(NOT EXISTS "${DOWNLOADS}/SPIRV-Headers.git") + message(STATUS "Cloning") + vcpkg_execute_required_process( + COMMAND ${GIT} clone --bare ${SPIRVHEADERS_GIT_URL} ${DOWNLOADS}/SPIRV-Headers.git + WORKING_DIRECTORY ${DOWNLOADS} + LOGNAME clone + ) +endif() + + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}/third_party/glslang) +if(NOT EXISTS "${SOURCE_PATH}/third_party/spirv-tools/.git") + message(STATUS "Adding worktree and patching") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}) + vcpkg_execute_required_process( + COMMAND ${GIT} worktree add -f --detach ${SOURCE_PATH}/third_party/spirv-tools ${SPIRVTOOLS_GIT_REF} + WORKING_DIRECTORY ${DOWNLOADS}/SPIRV-Tools.git + LOGNAME worktree + ) +endif() +if(NOT EXISTS "${SOURCE_PATH}/third_party/spirv-tools/external/spirv-headers/.git") + message(STATUS "Adding worktree and patching") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}) + vcpkg_execute_required_process( + COMMAND ${GIT} worktree add -f --detach ${SOURCE_PATH}/third_party/spirv-tools/external/spirv-headers ${SPIRVHEADERS_GIT_REF} + WORKING_DIRECTORY ${DOWNLOADS}/SPIRV-Headers.git + LOGNAME worktree + ) +endif() + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/build-version.inc DESTINATION ${SOURCE_PATH}/glslc/src) + +#Note: glslang and spir tools doesn't export symbol and need to be build as static lib for cmake to work +set(VCPKG_LIBRARY_LINKAGE "static") +set(VCPKG_CRT_LINKAGE "static") + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS -DSHADERC_SKIP_TESTS=true + OPTIONS_DEBUG -DSUFFIX_D=true + OPTIONS_RELEASE -DSUFFIX_D=false +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(GLOB EXES "${CURRENT_PACKAGES_DIR}/bin/*.exe") +file(COPY ${EXES} DESTINATION ${CURRENT_PACKAGES_DIR}/tools) + +#Safe to remove as libs are static +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) +#Provided by another package (glslang) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug) + + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/shaderc) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/shaderc/LICENSE ${CURRENT_PACKAGES_DIR}/share/shaderc/copyright) -- cgit v1.2.3 From fd74c49a5f9b8b2f5e20b82fe19ea273a8820eaa Mon Sep 17 00:00:00 2001 From: codicodi Date: Sun, 4 Dec 2016 19:11:01 +0100 Subject: [lua] add interpreter and compiler --- ports/lua/CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ports/lua/CMakeLists.txt b/ports/lua/CMakeLists.txt index 76ee6e15c..f929c41c9 100644 --- a/ports/lua/CMakeLists.txt +++ b/ports/lua/CMakeLists.txt @@ -41,6 +41,13 @@ INSTALL ( TARGETS lua ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ) +IF (NOT DEFINED SKIP_INSTALL_TOOLS) + ADD_EXECUTABLE ( luac src/luac.c ${SRC_LIBLUA} ) # compiler + ADD_EXECUTABLE ( luai src/lua.c ${SRC_LIBLUA} ) # interpreter + SET_TARGET_PROPERTIES ( luai PROPERTIES OUTPUT_NAME lua PDB_NAME luai ) + INSTALL ( TARGETS luai luac RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/tools ) +ENDIF () + IF (NOT DEFINED SKIP_INSTALL_HEADERS) INSTALL( FILES @@ -51,4 +58,4 @@ IF (NOT DEFINED SKIP_INSTALL_HEADERS) src/lauxlib.h DESTINATION include ) -ENDIF () \ No newline at end of file +ENDIF () -- cgit v1.2.3 From fffc1dc71eb612b8e85ac5529df6913b0d6c2a4d Mon Sep 17 00:00:00 2001 From: codicodi Date: Sun, 4 Dec 2016 19:12:21 +0100 Subject: [lua] no debug tools --- ports/lua/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/lua/portfile.cmake b/ports/lua/portfile.cmake index 598b15c94..0778a77f9 100644 --- a/ports/lua/portfile.cmake +++ b/ports/lua/portfile.cmake @@ -21,6 +21,7 @@ vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS_DEBUG -DSKIP_INSTALL_HEADERS=ON + -DSKIP_INSTALL_TOOLS=ON ) vcpkg_install_cmake() -- cgit v1.2.3 From 58c6c686a6526a83014476e0ae71875536b2096b Mon Sep 17 00:00:00 2001 From: codicodi Date: Mon, 5 Dec 2016 13:32:11 +0100 Subject: [nana] fix harmless but still ugly mix-up --- ports/nana/fix-linking.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/nana/fix-linking.patch b/ports/nana/fix-linking.patch index 08ab58151..a687e228b 100644 --- a/ports/nana/fix-linking.patch +++ b/ports/nana/fix-linking.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 5c9c9c9..8376431 100644 +index 5c9c9c9..ae35185 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -149,26 +149,20 @@ endif () @@ -41,10 +41,10 @@ index 5c9c9c9..8376431 100644 add_library(${PROJECT_NAME} ${sources} ) -target_link_libraries(${PROJECT_NAME} ${NANA_LINKS}) +if(NANA_CMAKE_ENABLE_JPEG AND NANA_CMAKE_LIBJPEG_FROM_OS) -+ target_link_libraries(${PROJECT_NAME} ${PNG_LIBRARIES}) ++ target_link_libraries(${PROJECT_NAME} ${JPEG_LIBRARIES}) +endif() +if(NANA_CMAKE_ENABLE_PNG AND NANA_CMAKE_LIBPNG_FROM_OS) -+ target_link_libraries(${PROJECT_NAME} ${JPEG_LIBRARIES}) ++ target_link_libraries(${PROJECT_NAME} ${PNG_LIBRARIES}) +endif() # Headers: use INCLUDE_DIRECTORIES -- cgit v1.2.3 From d8db19a2c469bec4db87674be1d9e63ce5959587 Mon Sep 17 00:00:00 2001 From: codicodi Date: Mon, 5 Dec 2016 14:40:10 +0100 Subject: [lua] bump version --- ports/lua/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/lua/CONTROL b/ports/lua/CONTROL index ae661f3f6..ca2a82b14 100644 --- a/ports/lua/CONTROL +++ b/ports/lua/CONTROL @@ -1,3 +1,3 @@ Source: lua -Version: 5.3.3 +Version: 5.3.3-1 Description: a powerful, fast, lightweight, embeddable scripting language -- cgit v1.2.3 From f62ad96c9ab7f09c80c42a95fee3dfd160fa825c Mon Sep 17 00:00:00 2001 From: ab Date: Mon, 5 Dec 2016 17:09:33 +0100 Subject: Update the cmakelists to build shared and static libraries properly. --- ports/http-parser/CMakeLists.txt | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/ports/http-parser/CMakeLists.txt b/ports/http-parser/CMakeLists.txt index 021b1842f..6e9067a04 100644 --- a/ports/http-parser/CMakeLists.txt +++ b/ports/http-parser/CMakeLists.txt @@ -1,22 +1,17 @@ -cmake_minimum_required (VERSION 2.6) +cmake_minimum_required (VERSION 3.4) project (http-parser) -set(PUBLIC_HDRS - http_parser.h -) -set(PRIVATE_HDRS -) -set(SRCS - http_parser.c -) +if (BUILD_SHARED_LIBS) + SET(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +endif() -add_library(http_parser STATIC ${SRCS} ${PUBLIC_HDRS} ${PRIAVTE_HDRS}) +add_library(http_parser http_parser.c http_parser.h) -if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) - install(TARGETS http_parser - ARCHIVE DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" ) -endif() +install(TARGETS http_parser + RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" + ARCHIVE DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" +) -if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL ) - install(FILES ${PUBLIC_HDRS} DESTINATION "${CMAKE_INSTALL_PREFIX}/include") +if (NOT SKIP_INSTALL_HEADERS) + install(FILES http_parser.h DESTINATION "${CMAKE_INSTALL_PREFIX}/include") endif() \ No newline at end of file -- cgit v1.2.3 From ff4d33b156e06b5457837361b28803fb8570d350 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 5 Dec 2016 16:42:30 -0800 Subject: [boost] Don't use --layout=system. Resolves #369 --- ports/boost/CONTROL | 2 +- ports/boost/portfile.cmake | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/ports/boost/CONTROL b/ports/boost/CONTROL index 57dfe58e3..91c8496a5 100644 --- a/ports/boost/CONTROL +++ b/ports/boost/CONTROL @@ -1,3 +1,3 @@ Source: boost -Version: 1.62-6 +Version: 1.62-7 Description: Peer-reviewed portable C++ source libraries diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake index 7cc0d60b0..67d9096ac 100644 --- a/ports/boost/portfile.cmake +++ b/ports/boost/portfile.cmake @@ -36,7 +36,6 @@ set(B2_OPTIONS --hash --without-python - --layout=system toolset=msvc threading=multi ) @@ -106,16 +105,16 @@ file(APPEND ${CURRENT_PACKAGES_DIR}/include/boost/config/user.hpp "\n#define BOO file(INSTALL ${SOURCE_PATH}/LICENSE_1_0.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/boost RENAME copyright) message(STATUS "Packaging headers done") -function(boost_remove_lib_prefix_from_lib_files LIBS) +# This function makes the static build lib names match the dynamic build lib names which FindBoost.cmake is looking for by default. +# It also renames a couple of "libboost" lib files in the dynamic build (for example libboost_exception-vc140-mt-1_62.lib). +function(boost_rename_libs LIBS) foreach(LIB ${${LIBS}}) get_filename_component(OLD_FILENAME ${LIB} NAME) get_filename_component(DIRECTORY_OF_LIB_FILE ${LIB} DIRECTORY) string(REPLACE "libboost_" "boost_" NEW_FILENAME ${OLD_FILENAME}) - if (EXISTS ${DIRECTORY_OF_LIB_FILE}/${NEW_FILENAME}) - file(REMOVE ${DIRECTORY_OF_LIB_FILE}/${OLD_FILENAME}) - else() - file(RENAME ${DIRECTORY_OF_LIB_FILE}/${OLD_FILENAME} ${DIRECTORY_OF_LIB_FILE}/${NEW_FILENAME}) - endif() + string(REPLACE "-s-" "-" NEW_FILENAME ${NEW_FILENAME}) # For Release libs + string(REPLACE "-sgd-" "-gd-" NEW_FILENAME ${NEW_FILENAME}) # For Debug libs + file(RENAME ${DIRECTORY_OF_LIB_FILE}/${OLD_FILENAME} ${DIRECTORY_OF_LIB_FILE}/${NEW_FILENAME}) endforeach() endfunction() @@ -129,7 +128,7 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) FILES_MATCHING PATTERN "*.dll") endif() file(GLOB RELEASE_LIBS ${CURRENT_PACKAGES_DIR}/lib/libboost*.lib) -boost_remove_lib_prefix_from_lib_files(RELEASE_LIBS) +boost_rename_libs(RELEASE_LIBS) message(STATUS "Packaging ${TARGET_TRIPLET}-rel done") message(STATUS "Packaging ${TARGET_TRIPLET}-dbg") @@ -142,7 +141,7 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) FILES_MATCHING PATTERN "*.dll") endif() file(GLOB DEBUG_LIBS ${CURRENT_PACKAGES_DIR}/debug/lib/libboost*.lib) -boost_remove_lib_prefix_from_lib_files(DEBUG_LIBS) +boost_rename_libs(DEBUG_LIBS) message(STATUS "Packaging ${TARGET_TRIPLET}-dbg done") vcpkg_copy_pdbs() -- cgit v1.2.3 From 242a3b2a801fc343a867ad10258db411851f4652 Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Wed, 26 Oct 2016 19:57:07 +0330 Subject: Update harfbuzz to 1.3.4 The needed local patches are now upstreamed thus no longer needed. Also Uniscribe backend is no longer default enabled so almost no lib is needed to be linked. --- ...0001-Add-an-extra-path-input-for-Freetype.patch | 40 ---------------------- .../0001-Set-d-suffix-for-debug-freetype-lib.patch | 28 --------------- ports/harfbuzz/CONTROL | 2 +- ports/harfbuzz/portfile.cmake | 20 ++++------- 4 files changed, 8 insertions(+), 82 deletions(-) delete mode 100644 ports/harfbuzz/0001-Add-an-extra-path-input-for-Freetype.patch delete mode 100644 ports/harfbuzz/0001-Set-d-suffix-for-debug-freetype-lib.patch diff --git a/ports/harfbuzz/0001-Add-an-extra-path-input-for-Freetype.patch b/ports/harfbuzz/0001-Add-an-extra-path-input-for-Freetype.patch deleted file mode 100644 index 75b81c28f..000000000 --- a/ports/harfbuzz/0001-Add-an-extra-path-input-for-Freetype.patch +++ /dev/null @@ -1,40 +0,0 @@ -From be3c446b1dd798b835052188813ee4e7cf135a81 Mon Sep 17 00:00:00 2001 -From: Vincent Lejeune -Date: Wed, 12 Oct 2016 00:27:35 +0200 -Subject: [PATCH] Add an extra path input for Freetype. - ---- - win32/config-msvc.mak | 3 +++ - win32/detectenv-msvc.mak | 2 +- - 2 files changed, 4 insertions(+), 1 deletion(-) - -diff --git a/win32/config-msvc.mak b/win32/config-msvc.mak -index e0c6468..1ad0913 100644 ---- a/win32/config-msvc.mak -+++ b/win32/config-msvc.mak -@@ -124,6 +124,9 @@ HB_DEFINES = $(HB_DEFINES) /DHAVE_CAIRO=1 - - # Enable freetype if desired - !if "$(FREETYPE)" == "1" -+HB_CFLAGS = \ -+ $(HB_CFLAGS) \ -+ /I$(FREETYPE_DIR) - HB_DEFINES = $(HB_DEFINES) /DHAVE_FREETYPE=1 - HB_SOURCES = $(HB_SOURCES) $(HB_FT_sources) - HB_HEADERS = $(HB_HEADERS) $(HB_FT_headers) -diff --git a/win32/detectenv-msvc.mak b/win32/detectenv-msvc.mak -index 83d8786..ad67493 100644 ---- a/win32/detectenv-msvc.mak -+++ b/win32/detectenv-msvc.mak -@@ -129,7 +129,7 @@ LDFLAGS_ARCH = /machine:x86 - !if "$(VALID_CFGSET)" == "TRUE" - CFLAGS = $(CFLAGS_ADD) /W3 /Zi /I.. /I..\src /I. /I$(PREFIX)\include - --LDFLAGS_BASE = $(LDFLAGS_ARCH) /libpath:$(PREFIX)\lib /DEBUG -+LDFLAGS_BASE = $(LDFLAGS_ARCH) /libpath:$(PREFIX)\lib /libpath:$(VCPKG_LIB_DIR) /DEBUG - - !if "$(CFG)" == "debug" - LDFLAGS = $(LDFLAGS_BASE) --- -2.10.0.windows.1 - diff --git a/ports/harfbuzz/0001-Set-d-suffix-for-debug-freetype-lib.patch b/ports/harfbuzz/0001-Set-d-suffix-for-debug-freetype-lib.patch deleted file mode 100644 index fce3ba562..000000000 --- a/ports/harfbuzz/0001-Set-d-suffix-for-debug-freetype-lib.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 2be3a687a3079c3988d718293e4ee5d8fc9797b7 Mon Sep 17 00:00:00 2001 -From: vlj -Date: Sat, 8 Oct 2016 21:14:57 +0200 -Subject: [PATCH] Set d suffix for debug freetype lib. - ---- - win32/config-msvc.mak | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/win32/config-msvc.mak b/win32/config-msvc.mak -index 9cc6608..236aef7 100644 ---- a/win32/config-msvc.mak -+++ b/win32/config-msvc.mak -@@ -12,7 +12,11 @@ HB_GLIB_LIBS = glib-2.0.lib - HB_GOBJECT_DEP_LIBS = gobject-2.0.lib $(HB_GLIB_LIBS) - - # Freetype is needed for building FreeType support and hb-view -+!if "$(CFG)" == "debug" -+FREETYPE_LIB = freetyped.lib -+!else - FREETYPE_LIB = freetype.lib -+!endif - - # Cairo is needed for building hb-view - CAIRO_LIB = cairo.lib --- -2.10.0.windows.1 - diff --git a/ports/harfbuzz/CONTROL b/ports/harfbuzz/CONTROL index dd5207077..eab88ff11 100644 --- a/ports/harfbuzz/CONTROL +++ b/ports/harfbuzz/CONTROL @@ -1,4 +1,4 @@ Source: harfbuzz -Version: 1.3.2 +Version: 1.3.4 Description: HarfBuzz OpenType text shaping engine Build-Depends: freetype diff --git a/ports/harfbuzz/portfile.cmake b/ports/harfbuzz/portfile.cmake index 2603fdf0a..b818e0938 100644 --- a/ports/harfbuzz/portfile.cmake +++ b/ports/harfbuzz/portfile.cmake @@ -11,34 +11,28 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/harfbuzz-1.3.2) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/harfbuzz-1.3.4) find_program(NMAKE nmake) vcpkg_download_distfile(ARCHIVE - URLS "https://www.freedesktop.org/software/harfbuzz/release/harfbuzz-1.3.2.tar.bz2" - FILENAME "harfbuzz-1.3.2.tar.bz2" - SHA512 19f846ee75d8a2d94da2a2b489fa8e54a5120599f998e451187f6695aa3931b28c491bbc0837892eaaebbd1da3441effe01f5f2470454f83cfa6a7c510ebcb32 + URLS "https://www.freedesktop.org/software/harfbuzz/release/harfbuzz-1.3.4.tar.bz2" + FILENAME "harfbuzz-1.3.4.tar.bz2" + SHA512 72027ce64d735f1f7ecabcc78ba426d6155cebd564439feb77cefdfc28b00bfd9f6314e6735addaa90cee1d98cf6d2c0b61f77b446ba34e11f7eb7cdfdcd386a ) vcpkg_extract_source_archive(${ARCHIVE}) -vcpkg_apply_patches( - SOURCE_PATH ${SOURCE_PATH} - PATCHES "${CMAKE_CURRENT_LIST_DIR}/0001-Add-an-extra-path-input-for-Freetype.patch" - PATCHES "${CMAKE_CURRENT_LIST_DIR}/0001-Set-d-suffix-for-debug-freetype-lib.patch" -) - file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/include" FREETYPE_INCLUDE_DIR) file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/debug/lib" FREETYPE_LIB_DIR_DBG) file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/lib" FREETYPE_LIB_DIR_REL) vcpkg_execute_required_process( - COMMAND ${NMAKE} -f Makefile.vc CFG=debug FREETYPE=1 FREETYPE_DIR=${FREETYPE_INCLUDE_DIR} VCPKG_LIB_DIR=${FREETYPE_LIB_DIR_DBG} + COMMAND ${NMAKE} -f Makefile.vc CFG=debug FREETYPE=1 FREETYPE_DIR=${FREETYPE_INCLUDE_DIR} ADDITIONAL_LIB_DIR=${FREETYPE_LIB_DIR_DBG} WORKING_DIRECTORY ${SOURCE_PATH}/win32/ LOGNAME nmake-build-${TARGET_TRIPLET}-debug ) vcpkg_execute_required_process( - COMMAND ${NMAKE} -f Makefile.vc CFG=release FREETYPE=1 FREETYPE_DIR=${FREETYPE_INCLUDE_DIR} VCPKG_LIB_DIR=${FREETYPE_LIB_DIR_REL} + COMMAND ${NMAKE} -f Makefile.vc CFG=release FREETYPE=1 FREETYPE_DIR=${FREETYPE_INCLUDE_DIR} ADDITIONAL_LIB_DIR=${FREETYPE_LIB_DIR_REL} WORKING_DIRECTORY ${SOURCE_PATH}/win32/ LOGNAME nmake-build-${TARGET_TRIPLET}-release ) @@ -61,5 +55,5 @@ vcpkg_execute_required_process( ) # Handle copyright -file(COPY ${CURRENT_BUILDTREES_DIR}/src/harfbuzz-1.3.2/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/harfbuzz) +file(COPY ${CURRENT_BUILDTREES_DIR}/src/harfbuzz-1.3.4/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/harfbuzz) file(RENAME ${CURRENT_PACKAGES_DIR}/share/harfbuzz/COPYING ${CURRENT_PACKAGES_DIR}/share/harfbuzz/copyright) -- cgit v1.2.3 From 33d5ff4e08be49c603bcc66de959d1e693255118 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 5 Dec 2016 22:47:24 -0800 Subject: [gflags] Switch to using zip files -- this makes the download faster and easier to upgrade. Remove gflags_nothreads to avoid choices at link time. --- ports/gflags/CONTROL | 2 +- ports/gflags/portfile.cmake | 37 ++++++++++--------------------------- 2 files changed, 11 insertions(+), 28 deletions(-) diff --git a/ports/gflags/CONTROL b/ports/gflags/CONTROL index 62910c121..0833c3c76 100644 --- a/ports/gflags/CONTROL +++ b/ports/gflags/CONTROL @@ -1,3 +1,3 @@ Source: gflags -Version: 2.2.0 +Version: 2.2.0-1 Description: A C++ library that implements commandline flags processing diff --git a/ports/gflags/portfile.cmake b/ports/gflags/portfile.cmake index 66ac76227..ac8a44c6e 100644 --- a/ports/gflags/portfile.cmake +++ b/ports/gflags/portfile.cmake @@ -1,36 +1,21 @@ include(vcpkg_common_functions) find_program(GIT git) -set(GIT_URL "https://github.com/gflags/gflags.git") -set(GIT_TAG "v2.2.0") +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/gflags/gflags/archive/v2.2.0.zip" + FILENAME "gflags-v2.2.0.zip" + SHA512 638d094cdcc759a35ebd0e57900216deec6113242d2dcc964beff7b88cf56e3dbab3dce6e10a055bfd94cb5daebb8632382219a5ef40a689e14c76b263d3eca5) -if(NOT EXISTS "${DOWNLOADS}/gflags.git") - message(STATUS "Cloning") - vcpkg_execute_required_process( - COMMAND ${GIT} clone --bare ${GIT_URL} ${DOWNLOADS}/gflags.git - WORKING_DIRECTORY ${DOWNLOADS} - LOGNAME clone - ) -endif() -message(STATUS "Cloning done") - -if(NOT EXISTS "${CURRENT_BUILDTREES_DIR}/src/.git") - message(STATUS "Adding worktree and patching") - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}) - vcpkg_execute_required_process( - COMMAND ${GIT} worktree add -f --detach ${CURRENT_BUILDTREES_DIR}/src ${GIT_TAG} - WORKING_DIRECTORY ${DOWNLOADS}/gflags.git - LOGNAME worktree - ) -endif() +vcpkg_extract_source_archive(${ARCHIVE}) -message(STATUS "Adding worktree") +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/gflags-2.2.0) vcpkg_configure_cmake( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src + SOURCE_PATH ${SOURCE_PATH} OPTIONS - -DGFLAGS_REGISTER_BUILD_DIR:BOOL=OFF - -DGFLAGS_REGISTER_INSTALL_PREFIX:BOOL=OFF + -DGFLAGS_REGISTER_BUILD_DIR:BOOL=OFF + -DGFLAGS_REGISTER_INSTALL_PREFIX:BOOL=OFF + -DBUILD_gflags_nothreads_LIB:BOOL=OFF ) vcpkg_install_cmake() @@ -38,9 +23,7 @@ vcpkg_install_cmake() if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) file(RENAME ${CURRENT_PACKAGES_DIR}/lib/gflags.dll ${CURRENT_PACKAGES_DIR}/bin/gflags.dll) - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/gflags_nothreads.dll ${CURRENT_PACKAGES_DIR}/bin/gflags_nothreads.dll) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gflags.dll ${CURRENT_PACKAGES_DIR}/debug/bin/gflags.dll) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gflags_nothreads.dll ${CURRENT_PACKAGES_DIR}/debug/bin/gflags_nothreads.dll) endif() file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) -- cgit v1.2.3 From 55605c73e04a08dd22b49b3e664441d579e0f2d5 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 6 Dec 2016 00:57:58 -0800 Subject: [gdal] Use CURRENT_INSTALLED_DIR instead of calculating it out. Use VCPKG_TARGET_ARCHITECTURE instead of parsing the triplet. --- ports/gdal/portfile.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/gdal/portfile.cmake b/ports/gdal/portfile.cmake index e5f148922..f198f4f0c 100644 --- a/ports/gdal/portfile.cmake +++ b/ports/gdal/portfile.cmake @@ -32,9 +32,9 @@ file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}" NATIVE_PACKAGES_DIR) file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}/share/gdal" NATIVE_DATA_DIR) file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}/share/gdal/html" NATIVE_HTML_DIR) -file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/include" PROJ_INCLUDE_DIR) -file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/lib/proj.lib" PROJ_LIBRARY_REL) -file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/debug/lib/projd.lib" PROJ_LIBRARY_DBG) +file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/include" PROJ_INCLUDE_DIR) +file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/proj.lib" PROJ_LIBRARY_REL) +file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/projd.lib" PROJ_LIBRARY_DBG) set(NMAKE_OPTIONS GDAL_HOME=${NATIVE_PACKAGES_DIR} @@ -44,7 +44,7 @@ set(NMAKE_OPTIONS MSVC_VER=1900 ) -if(TARGET_TRIPLET MATCHES "x64") +if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") list(APPEND NMAKE_OPTIONS WIN64=YES) endif() -- cgit v1.2.3 From 901b5978403ac144ec92a25a7a9a232c9b4a4f9e Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 6 Dec 2016 01:00:20 -0800 Subject: [gslang] Version bump to account for layout changes --- ports/glslang/CONTROL | 2 +- ports/glslang/portfile.cmake | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/ports/glslang/CONTROL b/ports/glslang/CONTROL index 7bd0c7e40..3b81f5287 100644 --- a/ports/glslang/CONTROL +++ b/ports/glslang/CONTROL @@ -1,3 +1,3 @@ Source: glslang -Version: 1c573fbcfba6b3d631008b1babc838501ca925d3 +Version: 1c573fbcfba6b3d631008b1babc838501ca925d3-1 Description: Khronos reference front-end for GLSL and ESSL, and sample SPIR-V generator diff --git a/ports/glslang/portfile.cmake b/ports/glslang/portfile.cmake index bbc868915..9fd6ae468 100644 --- a/ports/glslang/portfile.cmake +++ b/ports/glslang/portfile.cmake @@ -33,7 +33,6 @@ if(NOT EXISTS "${CURRENT_BUILDTREES_DIR}/src/.git") endif() set(VCPKG_LIBRARY_LINKAGE "static") -set(VCPKG_CRT_LINKAGE "static") vcpkg_configure_cmake( SOURCE_PATH "${CURRENT_BUILDTREES_DIR}/src" -- cgit v1.2.3 From 6993803b05e065953dd917a1fc7ecc466c406f19 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 6 Dec 2016 01:04:32 -0800 Subject: [shaderc] Enable dynamic CRT. Explicitly search for python3. Add Build-Depends on glslang. --- ports/shaderc/CONTROL | 1 + ports/shaderc/portfile.cmake | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/ports/shaderc/CONTROL b/ports/shaderc/CONTROL index 7f82bee28..e1e3d02b8 100644 --- a/ports/shaderc/CONTROL +++ b/ports/shaderc/CONTROL @@ -1,3 +1,4 @@ Source: shaderc Version: 2df47b51d83ad83cbc2e7f8ff2b56776293e8958 Description: A collection of tools, libraries and tests for shader compilation. +Build-Depends: glslang diff --git a/ports/shaderc/portfile.cmake b/ports/shaderc/portfile.cmake index 74dff4d9d..542d18598 100644 --- a/ports/shaderc/portfile.cmake +++ b/ports/shaderc/portfile.cmake @@ -37,8 +37,6 @@ if(NOT EXISTS "${SOURCE_PATH}/.git") ) endif() -set(GLSLANG_GIT_URL "https://github.com/KhronosGroup/glslang.git") -set(GLSLANG_GIT_REF "1c573fbcfba6b3d631008b1babc838501ca925d3") set(SPIRVTOOLS_GIT_URL "https://github.com/KhronosGroup/SPIRV-Tools.git") set(SPIRVTOOLS_GIT_REF "f72189c249ba143c6a89a4cf1e7d53337b2ddd40") set(SPIRVHEADERS_GIT_URL "https://github.com/KhronosGroup/SPIRV-Headers.git") @@ -61,7 +59,6 @@ if(NOT EXISTS "${DOWNLOADS}/SPIRV-Headers.git") ) endif() - file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}/third_party/glslang) if(NOT EXISTS "${SOURCE_PATH}/third_party/spirv-tools/.git") message(STATUS "Adding worktree and patching") @@ -86,11 +83,19 @@ file(COPY ${CMAKE_CURRENT_LIST_DIR}/build-version.inc DESTINATION ${SOURCE_PATH} #Note: glslang and spir tools doesn't export symbol and need to be build as static lib for cmake to work set(VCPKG_LIBRARY_LINKAGE "static") -set(VCPKG_CRT_LINKAGE "static") +set(OPTIONS) +if(VCPKG_CRT_LINKAGE STREQUAL "dynamic") + list(APPEND OPTIONS -DSHADERC_ENABLE_SHARED_CRT=ON) +endif() + +# shaderc uses python to manipulate copyright information +vcpkg_find_acquire_program(PYTHON3) +get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY) +set(ENV{PATH} "${PYTHON3_EXE_PATH};$ENV{PATH}") vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} - OPTIONS -DSHADERC_SKIP_TESTS=true + OPTIONS -DSHADERC_SKIP_TESTS=true ${OPTIONS} OPTIONS_DEBUG -DSUFFIX_D=true OPTIONS_RELEASE -DSUFFIX_D=false ) @@ -104,10 +109,6 @@ file(COPY ${EXES} DESTINATION ${CURRENT_PACKAGES_DIR}/tools) #Safe to remove as libs are static file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) -#Provided by another package (glslang) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug) - # Handle copyright file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/shaderc) -- cgit v1.2.3 From 5359a542a554668de7926a1b2c9a314db8b4d302 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 6 Dec 2016 01:26:21 -0800 Subject: [vcpkg] Disable all interactions with CMake registry -- we are effectively implementing our own registry and they don't nest very well at all. Fixes #334. --- scripts/cmake/vcpkg_configure_cmake.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 901e57368..2c506ad94 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -38,6 +38,9 @@ function(vcpkg_configure_cmake) list(APPEND _csc_OPTIONS "-DCMAKE_CXX_FLAGS= /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc" "-DCMAKE_C_FLAGS= /DWIN32 /D_WINDOWS /W3 /utf-8" + "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" + "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" + "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" ) if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL dynamic) list(APPEND _csc_OPTIONS_DEBUG -- cgit v1.2.3 From 1473e567298b6259df6d9ef4da183c602715f6fe Mon Sep 17 00:00:00 2001 From: Jason Yang Date: Tue, 6 Dec 2016 11:18:35 +0800 Subject: fix some comments --- ports/azure-storage-cpp/CONTROL | 2 +- ports/azure-storage-cpp/cmake.patch | 132 +++++++++++++++------------------ ports/azure-storage-cpp/portfile.cmake | 1 - 3 files changed, 61 insertions(+), 74 deletions(-) diff --git a/ports/azure-storage-cpp/CONTROL b/ports/azure-storage-cpp/CONTROL index 78b7e0a11..5fc7dbe13 100644 --- a/ports/azure-storage-cpp/CONTROL +++ b/ports/azure-storage-cpp/CONTROL @@ -1,5 +1,5 @@ Source: azure-storage-cpp Version: 2.5.0 -Build-Depends: cpprestsdk [windows] +Build-Depends: cpprestsdk Description: Microsoft Azure Storage Client SDK for C++ A client library for working with Microsoft Azure storage services including blobs, files, tables, and queues. This client library enables working with the Microsoft Azure storage services which include the blob service for storing binary and text data, the file service for storing binary and text data, the table service for storing structured non-relational data, and the queue service for storing messages that may be accessed by a client. Microsoft Azure Storage team's blog - http://blogs.msdn.com/b/windowsazurestorage/ \ No newline at end of file diff --git a/ports/azure-storage-cpp/cmake.patch b/ports/azure-storage-cpp/cmake.patch index 0275991ae..9487ab458 100644 --- a/ports/azure-storage-cpp/cmake.patch +++ b/ports/azure-storage-cpp/cmake.patch @@ -1,39 +1,34 @@ diff --git a/Microsoft.WindowsAzure.Storage/CMakeLists.txt b/Microsoft.WindowsAzure.Storage/CMakeLists.txt -index f037c7f..478bf48 100644 +index f037c7f..a4dd278 100644 --- a/Microsoft.WindowsAzure.Storage/CMakeLists.txt +++ b/Microsoft.WindowsAzure.Storage/CMakeLists.txt -@@ -1,6 +1,10 @@ - set(CMAKE_LEGACY_CYGWIN_WIN32 0) - cmake_minimum_required(VERSION 2.6) --project(azurestorage) -+if(WIN32) -+ project(wastorage) -+else() -+ project(azurestorage) -+endif() +@@ -51,20 +51,25 @@ if(UNIX) + find_package(UnitTest++ REQUIRED) + endif() - enable_testing() +- option(BUILD_SHARED_LIBS "Build shared Libraries." ON) -@@ -59,12 +63,25 @@ if(UNIX) - install(FILES ${WASCORE_HEADERS} DESTINATION include/wascore) - file(GLOB WASCORE_DATA includes/wascore/*.dat) - install(FILES ${WASCORE_DATA} DESTINATION include/wascore) +- file(GLOB WAS_HEADERS includes/was/*.h) +- install(FILES ${WAS_HEADERS} DESTINATION include/was) +- file(GLOB WASCORE_HEADERS includes/wascore/*.h) +- install(FILES ${WASCORE_HEADERS} DESTINATION include/wascore) +- file(GLOB WASCORE_DATA includes/wascore/*.dat) +- install(FILES ${WASCORE_DATA} DESTINATION include/wascore) +elseif(WIN32) + message("-- Setting WIN32 options") + find_package(Casablanca REQUIRED) + add_definitions(-DUNICODE -D_UNICODE -D_WIN32) -+ option(BUILD_SHARED_LIBS "Build shared Libraries." ON) -+ option(WASTORE_INSTALL_HEADERS "Install header files." ON) -+ if(WASTORE_INSTALL_HEADERS) -+ include_directories(includes) -+ file(GLOB WAS_HEADERS includes/was/*.h) -+ file(GLOB WASCORE_HEADERS includes/wascore/*.h) -+ file(GLOB WASCORE_DATA includes/wascore/*.dat) -+ endif() else() message("-- Unsupported Build Platform.") endif() ++option(BUILD_SHARED_LIBS "Build shared Libraries." ON) ++option(WASTORE_INSTALL_HEADERS "Install header files." ON) ++if(WASTORE_INSTALL_HEADERS) ++ file(GLOB WAS_HEADERS includes/was/*.h) ++ file(GLOB WASCORE_HEADERS includes/wascore/basic_types.h includes/wascore/constants.h) ++ file(GLOB WASCORE_DATA includes/wascore/*.dat) ++endif() + # Compiler (not platform) specific settings -if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") @@ -41,7 +36,7 @@ index f037c7f..478bf48 100644 message("-- Setting gcc options") set(WARNINGS "-Wall -Wextra -Wunused-parameter -Wcast-align -Wcast-qual -Wconversion -Wformat=2 -Winit-self -Winvalid-pch -Wmissing-format-attribute -Wmissing-include-dirs -Wpacked -Wredundant-decls -Wunreachable-code") -@@ -81,37 +98,56 @@ if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") +@@ -81,22 +86,29 @@ if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") add_definitions(-DBOOST_LOG_DYN_LINK) endif() add_definitions(-D_TURN_OFF_PLATFORM_STRING) @@ -84,41 +79,14 @@ index f037c7f..478bf48 100644 else() message("-- Unknown compiler, success is doubtful.") endif() +@@ -109,7 +121,6 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Binaries) + set(AZURESTORAGE_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/includes) + set(AZURESTORAGE_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/includes ${CASABLANCA_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIRS} ${LibXML++_INCLUDE_DIRS} ${UUID_INCLUDE_DIRS} ${Glibmm_INCLUDE_DIRS}) --# Reconfigure final output directory --set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Binaries) --set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Binaries) --set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Binaries) -+if (WIN32) -+ # Reconfigure final output directory -+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Binaries) -+ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Binaries) -+ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Binaries) +- + set(AZURESTORAGE_LIBRARY azurestorage) + set(AZURESTORAGE_LIBRARIES ${AZURESTORAGE_LIBRARY} ${CASABLANCA_LIBRARIES} ${Boost_LIBRARIES} ${Boost_FRAMEWORK} ${OPENSSL_LIBRARIES} ${LibXML++_LIBRARIES} ${UUID_LIBRARIES} ${Glibmm_LIBRARIES}) --set(AZURESTORAGE_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/includes) --set(AZURESTORAGE_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/includes ${CASABLANCA_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIRS} ${LibXML++_INCLUDE_DIRS} ${UUID_INCLUDE_DIRS} ${Glibmm_INCLUDE_DIRS}) -+ set(AZURESTORAGE_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/includes) -+ set(AZURESTORAGE_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/includes ${CASABLANCA_INCLUDE_DIRS}) - -+ set(AZURESTORAGE_LIBRARY wastorage) -+ set(AZURESTORAGE_LIBRARIES ${AZURESTORAGE_LIBRARY} ${CASABLANCA_LIBRARIES}) -+else() -+ # Reconfigure final output directory -+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Binaries) -+ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Binaries) -+ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Binaries) -+ -+ set(AZURESTORAGE_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/includes) -+ set(AZURESTORAGE_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/includes ${CASABLANCA_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIRS} ${LibXML++_INCLUDE_DIRS} ${UUID_INCLUDE_DIRS} ${Glibmm_INCLUDE_DIRS}) - --set(AZURESTORAGE_LIBRARY azurestorage) --set(AZURESTORAGE_LIBRARIES ${AZURESTORAGE_LIBRARY} ${CASABLANCA_LIBRARIES} ${Boost_LIBRARIES} ${Boost_FRAMEWORK} ${OPENSSL_LIBRARIES} ${LibXML++_LIBRARIES} ${UUID_LIBRARIES} ${Glibmm_LIBRARIES}) -+ set(AZURESTORAGE_LIBRARY azurestorage) -+ set(AZURESTORAGE_LIBRARIES ${AZURESTORAGE_LIBRARY} ${CASABLANCA_LIBRARIES} ${Boost_LIBRARIES} ${Boost_FRAMEWORK} ${OPENSSL_LIBRARIES} ${LibXML++_LIBRARIES} ${UUID_LIBRARIES} ${Glibmm_LIBRARIES}) -+endif() - - # Set version numbers centralized - set (AZURESTORAGE_VERSION_MAJOR 2) diff --git a/Microsoft.WindowsAzure.Storage/cmake/Modules/FindCasablanca.cmake b/Microsoft.WindowsAzure.Storage/cmake/Modules/FindCasablanca.cmake index 5c1df3c..da66eb4 100644 --- a/Microsoft.WindowsAzure.Storage/cmake/Modules/FindCasablanca.cmake @@ -132,7 +100,7 @@ index 5c1df3c..da66eb4 100644 ${CASABLANCA_PKGCONF_LIBRARY_DIRS} ${CASABLANCA_DIR} diff --git a/Microsoft.WindowsAzure.Storage/src/CMakeLists.txt b/Microsoft.WindowsAzure.Storage/src/CMakeLists.txt -index b08111f..ee5c9ed 100644 +index b08111f..74ba2fb 100644 --- a/Microsoft.WindowsAzure.Storage/src/CMakeLists.txt +++ b/Microsoft.WindowsAzure.Storage/src/CMakeLists.txt @@ -2,7 +2,7 @@ include_directories(${Boost_INCLUDE_DIR} ${OPENSSL_INCLUDE_DIR}) @@ -144,7 +112,7 @@ index b08111f..ee5c9ed 100644 set(SOURCES xmlhelpers.cpp response_parsers.cpp -@@ -64,14 +64,17 @@ if ("${CMAKE_BUILD_TYPE}" MATCHES "Debug") +@@ -64,24 +64,46 @@ if ("${CMAKE_BUILD_TYPE}" MATCHES "Debug") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage") endif() if (APPLE) @@ -153,6 +121,18 @@ index b08111f..ee5c9ed 100644 else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") ++endif() ++ ++if(MSVC) ++ add_compile_options(/Yustdafx.h) ++ set_source_files_properties(stdafx.cpp PROPERTIES COMPILE_FLAGS "/Ycstdafx.h") ++ ++ if (NOT CMAKE_GENERATOR MATCHES "Visual Studio .*") ++ set_property(SOURCE stdafx.cpp APPEND PROPERTY OBJECT_OUTPUTS "${CMAKE_CURRENT_BINARY_DIR}/stdafx.pch") ++ set_property(SOURCE ${SOURCES} APPEND PROPERTY OBJECT_DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/stdafx.pch") ++ endif() ++ ++ list(APPEND SOURCES stdafx.cpp) endif() add_library(${AZURESTORAGE_LIBRARY} ${SOURCES}) @@ -164,18 +144,26 @@ index b08111f..ee5c9ed 100644 # Portions specific to azure storage binary versioning and installation. if(UNIX) -@@ -84,4 +87,14 @@ if(UNIX) - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib - ) + set_target_properties(${AZURESTORAGE_LIBRARY} PROPERTIES + SOVERSION ${AZURESTORAGE_VERSION_MAJOR} + VERSION ${AZURESTORAGE_VERSION_MAJOR}.${AZURESTORAGE_VERSION_MINOR}) +- +- install( +- TARGETS ${AZURESTORAGE_LIBRARY} +- LIBRARY DESTINATION lib +- ARCHIVE DESTINATION lib +- ) +elseif(WIN32) -+ install(FILES ${WAS_HEADERS} DESTINATION include/was) -+ install(FILES ${WASCORE_HEADERS} DESTINATION include/wascore) -+ install(FILES ${WASCORE_DATA} DESTINATION include/wascore) -+ install( -+ TARGETS ${AZURESTORAGE_LIBRARY} -+ RUNTIME DESTINATION bin -+ LIBRARY DESTINATION lib -+ ARCHIVE DESTINATION lib -+ ) ++ set_target_properties(${AZURESTORAGE_LIBRARY} PROPERTIES OUTPUT_NAME "wastorage") endif() ++ ++install(FILES ${WAS_HEADERS} DESTINATION include/was) ++install(FILES ${WASCORE_HEADERS} DESTINATION include/wascore) ++install(FILES ${WASCORE_DATA} DESTINATION include/wascore) ++ ++install( ++ TARGETS ${AZURESTORAGE_LIBRARY} ++ RUNTIME DESTINATION bin ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib ++) diff --git a/ports/azure-storage-cpp/portfile.cmake b/ports/azure-storage-cpp/portfile.cmake index 8898a61a0..fdc858c1a 100644 --- a/ports/azure-storage-cpp/portfile.cmake +++ b/ports/azure-storage-cpp/portfile.cmake @@ -8,7 +8,6 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) - vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES -- cgit v1.2.3 From 134993109b00dac3ed92a66a57fbffb7f89e4a02 Mon Sep 17 00:00:00 2001 From: Mattias Cibien Date: Tue, 6 Dec 2016 11:17:25 +0100 Subject: Anax support for shared libs --- ports/anax/Add-bin-output.patch | 10 ++++++++++ ports/anax/portfile.cmake | 11 +++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 ports/anax/Add-bin-output.patch diff --git a/ports/anax/Add-bin-output.patch b/ports/anax/Add-bin-output.patch new file mode 100644 index 000000000..333a92fdc --- /dev/null +++ b/ports/anax/Add-bin-output.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt Tue Oct 13 13:47:40 2015 ++++ b/CMakeLists.txt Tue Dec 06 11:13:23 2016 +@@ -161,6 +161,7 @@ + # Library files + install( + TARGETS ${ANAX_LIBRARY_NAME} ++ RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + ) diff --git a/ports/anax/portfile.cmake b/ports/anax/portfile.cmake index ae22332cf..ef14f7264 100644 --- a/ports/anax/portfile.cmake +++ b/ports/anax/portfile.cmake @@ -6,10 +6,6 @@ # 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/anax-2.1.0) @@ -20,8 +16,15 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES ${CMAKE_CURRENT_LIST_DIR}/Add-bin-output.patch +) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON ) vcpkg_install_cmake() -- cgit v1.2.3 From 34f103d4209885d43e1038570d0c04b9deb5e654 Mon Sep 17 00:00:00 2001 From: Mattias Cibien Date: Tue, 6 Dec 2016 11:29:22 +0100 Subject: [anax] Bump Version --- ports/anax/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/anax/CONTROL b/ports/anax/CONTROL index f6d285b4c..ce3da2f57 100644 --- a/ports/anax/CONTROL +++ b/ports/anax/CONTROL @@ -1,3 +1,3 @@ Source: anax -Version: 2.1.0 +Version: 2.1.0-1 Description: An open source C++ entity system. -- cgit v1.2.3 From 175bb41f822891eb3a69795eb132c85f5b869a4b Mon Sep 17 00:00:00 2001 From: codicodi Date: Tue, 6 Dec 2016 12:14:31 +0100 Subject: [libflac] initial commit --- ports/libflac/CMakeLists.txt | 74 ++++++++++++++++++++++++++++++++++++++++++++ ports/libflac/CONTROL | 4 +++ ports/libflac/portfile.cmake | 32 +++++++++++++++++++ 3 files changed, 110 insertions(+) create mode 100644 ports/libflac/CMakeLists.txt create mode 100644 ports/libflac/CONTROL create mode 100644 ports/libflac/portfile.cmake diff --git a/ports/libflac/CMakeLists.txt b/ports/libflac/CMakeLists.txt new file mode 100644 index 000000000..2f3dedbdb --- /dev/null +++ b/ports/libflac/CMakeLists.txt @@ -0,0 +1,74 @@ +cmake_minimum_required(VERSION 2.6) +cmake_policy(SET CMP0005 NEW) # do not escape preprocessor defines + +project(libflac) + +if(NOT DEFINED LIBFLAC_OGG_LIB OR NOT DEFINED LIBFLAC_OGG_INCLUDES) + message(FATAL_ERROR "Ogg library required") +endif() + +if(NOT DEFINED LIBFLAC_ARCHITECTURE) + message(FATAL_ERROR "Target architecture not specified") +endif() + +file(GLOB LIBFLAC_SOURCES + ${PROJECT_SOURCE_DIR}/src/libFLAC/*.c + ${PROJECT_SOURCE_DIR}/src/share/win_utf8_io/win_utf8_io.c) + +file(GLOB LIBFLACXX_SOURCES + ${PROJECT_SOURCE_DIR}/src/libFLAC++/*.cpp) + +include_directories(${PROJECT_SOURCE_DIR}/include) +include_directories(${PROJECT_SOURCE_DIR}/src/libFLAC/include) +include_directories(${LIBFLAC_OGG_INCLUDES}) + +if(NOT LIBFLAC_ARCHITECTURE MATCHES arm) + add_definitions(-DFLAC__SSE_OS) + add_definitions(-DFLAC__HAS_X86INTRIN) +endif() + +if(LIBFLAC_ARCHITECTURE MATCHES x86) + add_definitions(-DFLAC__CPU_IA32) +elseif(LIBFLAC_ARCHITECTURE MATCHES x64) + add_definitions(-DFLAC__CPU_X86_64) +endif() + +if(CMAKE_BUILD_TYPE MATCHES Debug) + add_definitions(-DFLAC__OVERFLOW_DETECT) +endif() + +add_definitions(-DVERSION="1.3.1") +add_definitions(-DFLAC__HAS_OGG) +add_definitions(-DFLAC__ALIGN_MALLOC_DATA) # 32 byte boundary +add_definitions(-D_CRT_SECURE_NO_WARNINGS) +add_definitions(-D_CRT_NONSTDC_NO_WARNINGS) + +add_library(libFLAC ${LIBFLAC_SOURCES}) +add_library(libFLACXX ${LIBFLACXX_SOURCES}) + +set_target_properties(libFLAC PROPERTIES OUTPUT_NAME flac) +set_target_properties(libFLACXX PROPERTIES OUTPUT_NAME flac++) + +target_link_libraries(libFLAC ${LIBFLAC_OGG_LIB}) +target_link_libraries(libFLACXX libFLAC) + +if(BUILD_SHARED_LIBS) + set_target_properties(libFLACXX PROPERTIES COMPILE_FLAGS -DFLACPP_API_EXPORTS) + set_target_properties(libFLAC PROPERTIES COMPILE_FLAGS -DFLAC_API_EXPORTS) +else() + add_definitions(-DFLAC__NO_DLL) +endif() + +install(TARGETS libFLAC libFLACXX + RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib) + +if(NOT DEFINED LIBFLAC_SKIP_HEADERS) + install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/FLAC/ + DESTINATION include/FLAC + FILES_MATCHING PATTERN "*.h") + install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/FLAC++/ + DESTINATION include/FLAC++ + FILES_MATCHING PATTERN "*.h") +endif() diff --git a/ports/libflac/CONTROL b/ports/libflac/CONTROL new file mode 100644 index 000000000..557b30123 --- /dev/null +++ b/ports/libflac/CONTROL @@ -0,0 +1,4 @@ +Source: libflac +Version: 1.3.1 +Description: Library for manipulating FLAC files +Build-Depends: libogg diff --git a/ports/libflac/portfile.cmake b/ports/libflac/portfile.cmake new file mode 100644 index 000000000..bb7daae72 --- /dev/null +++ b/ports/libflac/portfile.cmake @@ -0,0 +1,32 @@ + # libFLAC uses winapi functons not avalible in WindowsStore +if (VCPKG_TARGET_ARCHITECTURE STREQUAL arm OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore) + message(FATAL_ERROR "Error: UWP builds are currently not supported.") +endif() + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/flac-1.3.1) +vcpkg_download_distfile(ARCHIVE + URLS "http://downloads.xiph.org/releases/flac/flac-1.3.1.tar.xz" + FILENAME "flac-1.3.1.tar.xz" + SHA512 923cd0ffe2155636febf2b4633791bc83370d57080461b97ebb69ea21a4b1be7c0ff376c7fc8ca3979af4714e761112114a24b49ff6c80228b58b929db6e96d5) + +vcpkg_extract_source_archive(${ARCHIVE}) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DLIBFLAC_ARCHITECTURE=${VCPKG_TARGET_ARCHITECTURE} + -DLIBFLAC_OGG_LIB=${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/lib/ogg.lib + -DLIBFLAC_OGG_INCLUDES=${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/include + OPTIONS_DEBUG + -DLIBFLAC_SKIP_HEADERS=ON) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +# This license (BSD) is relevant only for library - if someone would want to install +# FLAC cmd line tools as well additional license (GPL) should be included +file(COPY ${SOURCE_PATH}/COPYING.Xiph DESTINATION ${CURRENT_PACKAGES_DIR}/share/libflac) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/libflac/COPYING.Xiph ${CURRENT_PACKAGES_DIR}/share/libflac/copyright) -- cgit v1.2.3 From 05fdf3a01fb0f702c034d58850d47607713d60ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christophe=20Gu=C3=A9bert?= Date: Tue, 6 Dec 2016 14:33:43 +0100 Subject: Add libssh2. --- ports/libssh2/CONTROL | 4 ++++ ports/libssh2/LICENSE | 41 +++++++++++++++++++++++++++++++++++++++++ ports/libssh2/portfile.cmake | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 ports/libssh2/CONTROL create mode 100644 ports/libssh2/LICENSE create mode 100644 ports/libssh2/portfile.cmake diff --git a/ports/libssh2/CONTROL b/ports/libssh2/CONTROL new file mode 100644 index 000000000..d66030b71 --- /dev/null +++ b/ports/libssh2/CONTROL @@ -0,0 +1,4 @@ +Source: libssh2 +Version: 1.8.0 +Build-Depends: zlib, openssl +Description: The SSH library \ No newline at end of file diff --git a/ports/libssh2/LICENSE b/ports/libssh2/LICENSE new file mode 100644 index 000000000..d629fbd3f --- /dev/null +++ b/ports/libssh2/LICENSE @@ -0,0 +1,41 @@ +/* Copyright (c) 2004-2007 Sara Golemon + * Copyright (c) 2005,2006 Mikhail Gusarov + * Copyright (c) 2006-2007 The Written Word, Inc. + * Copyright (c) 2007 Eli Fant + * Copyright (c) 2009-2014 Daniel Stenberg + * Copyright (C) 2008, 2009 Simon Josefsson + * All rights reserved. + * + * Redistribution and use in source and binary forms, + * with or without modification, are permitted provided + * that the following conditions are met: + * + * Redistributions of source code must retain the above + * copyright notice, this list of conditions and the + * following disclaimer. + * + * 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. + * + * Neither the name of the copyright holder nor the names + * of any other contributors may be used to endorse or + * promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * 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 OWNER OR + * 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. + */ \ No newline at end of file diff --git a/ports/libssh2/portfile.cmake b/ports/libssh2/portfile.cmake new file mode 100644 index 000000000..9b4cc77dd --- /dev/null +++ b/ports/libssh2/portfile.cmake @@ -0,0 +1,32 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libssh2-1.8.0) +vcpkg_download_distfile(ARCHIVE_FILE + URLS "https://www.libssh2.org/download/libssh2-1.8.0.tar.gz" + FILENAME "libssh2-1.8.0.tar.gz" + SHA512 289aa45c4f99653bebf5f99565fe9c519abc204feb2084b47b7cc3badc8bf4ecdedd49ea6acdce8eb902b3c00995d5f92a3ca77b2508b92f04ae0e7de7287558 +) +vcpkg_extract_source_archive(${ARCHIVE_FILE}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DBUILD_EXAMPLES=OFF + -DBUILD_TESTING=OFF + -DENABLE_ZLIB_COMPRESSION=ON + OPTIONS_DEBUG + -DENABLE_DEBUG_LOGGING=OFF +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/cmake) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/pkgconfig) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share) + +file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libssh2 RENAME copyright) + +vcpkg_copy_pdbs() \ No newline at end of file -- cgit v1.2.3 From 7a061e8d90818b9058ff9b31376445c9dac2cfd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christophe=20Gu=C3=A9bert?= Date: Tue, 6 Dec 2016 16:39:57 +0100 Subject: Add uWebSockets. --- ports/uwebsockets/0001_cmake.patch | 40 ++++++++++++++++++++++++++++++++++++++ ports/uwebsockets/CONTROL | 4 ++++ ports/uwebsockets/portfile.cmake | 26 +++++++++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 ports/uwebsockets/0001_cmake.patch create mode 100644 ports/uwebsockets/CONTROL create mode 100644 ports/uwebsockets/portfile.cmake diff --git a/ports/uwebsockets/0001_cmake.patch b/ports/uwebsockets/0001_cmake.patch new file mode 100644 index 000000000..f4004a5bb --- /dev/null +++ b/ports/uwebsockets/0001_cmake.patch @@ -0,0 +1,40 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1fadf72..6ee984d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -18,7 +18,11 @@ if(NOT LIBUV_INCLUDE_DIR) + find_path(LIBUV_INCLUDE_DIR uv.h) + endif() + if(NOT LIBUV_LIBRARY) +- find_library(LIBUV_LIBRARY NAMES uv uv1) ++ if(WIN32) ++ find_library(LIBUV_LIBRARY NAMES libuv) ++ else() ++ find_library(LIBUV_LIBRARY NAMES uv uv1) ++ endif() + endif() + + add_library(uWS src/Extensions.cpp src/Group.cpp src/WebSocketImpl.cpp src/Networking.cpp src/Hub.cpp src/Node.cpp src/WebSocket.cpp src/HTTPSocket.cpp src/Socket.cpp) +@@ -38,4 +42,20 @@ install (TARGETS uWS DESTINATION /usr/lib64) + install (FILES src/Extensions.h src/WebSocketProtocol.h src/Networking.h src/WebSocket.h src/Hub.h src/Group.h src/Node.h src/Socket.h src/HTTPSocket.h src/uWS.h DESTINATION /usr/include/uWS) + endif (UNIX) + +-add_subdirectory(examples) ++#add_subdirectory(examples) ++ ++if(WIN32) ++ target_link_libraries (uWS PUBLIC psapi.lib iphlpapi.lib userenv.lib) ++ install (FILES src/Extensions.h src/WebSocketProtocol.h src/Networking.h src/WebSocket.h src/Hub.h src/Group.h src/Node.h src/Socket.h src/HTTPSocket.h src/uWS.h DESTINATION include/uWS) ++ ++ if(BUILD_SHARED_LIBS) ++ target_link_libraries (uWS PUBLIC ws2_32.lib) ++ endif() ++endif() ++ ++install( ++ TARGETS uWS ++ RUNTIME DESTINATION bin ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib ++) +\ No newline at end of file \ No newline at end of file diff --git a/ports/uwebsockets/CONTROL b/ports/uwebsockets/CONTROL new file mode 100644 index 000000000..840990004 --- /dev/null +++ b/ports/uwebsockets/CONTROL @@ -0,0 +1,4 @@ +Source: uwebsockets +Version: 0.12.0 +Build-Depends: libuv, openssl, zlib +Description: Highly scalable cross-platform WebSocket & HTTP library for C++11 and Node.js \ No newline at end of file diff --git a/ports/uwebsockets/portfile.cmake b/ports/uwebsockets/portfile.cmake new file mode 100644 index 000000000..881f35086 --- /dev/null +++ b/ports/uwebsockets/portfile.cmake @@ -0,0 +1,26 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/uwebsockets-0.12.0) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/uWebSockets/uWebSockets/archive/v0.12.0.zip" + FILENAME "uwebsockets-v0.12.0.zip" + SHA512 ea10682608d5f6c8b246f186dfc2f14f496858cc7e468880b96b111f10058daf529f1aa9662a851e21494dde9a4faadf2b9904483dac5350d0ca8736500cdda8 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/0001_cmake.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/uwebsockets) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/uwebsockets/LICENSE ${CURRENT_PACKAGES_DIR}/share/uwebsockets/copyright) +vcpkg_copy_pdbs() -- cgit v1.2.3 From 8bb60f70ef93a98b4a32156831827839fd4b1e5d Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Tue, 6 Dec 2016 09:05:27 -0800 Subject: fixed openssl hash for uwp builds --- ports/openssl/portfile-uwp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/openssl/portfile-uwp.cmake b/ports/openssl/portfile-uwp.cmake index 34861c122..13bb6a3f5 100644 --- a/ports/openssl/portfile-uwp.cmake +++ b/ports/openssl/portfile-uwp.cmake @@ -35,7 +35,7 @@ set(ENV{PATH} "${PERL_EXE_PATH};$ENV{PATH}") vcpkg_download_distfile(ARCHIVE URLS "https://github.com/Microsoft/openssl/archive/OpenSSL_1_0_2_WinRT-stable.zip" FILENAME "openssl-microsoft-1.0.2.zip" - SHA512 f265b7dbeca6b86815dbc14af9f2b6688407efd921eb335b1acf5a642dddb6b6334a794fe0939666d9db66976db11a67ad78a3ed74484708d3bf2040aae598d2 + SHA512 10c3d7eb354a0b39a837e0c48f31415444acd5b1e7df52ed49a735ea63bf8b7548602a266baa012f1703888e68fdd5cb070fc610584a2f3f9a555e7d62d8b44b ) vcpkg_extract_source_archive(${ARCHIVE}) -- cgit v1.2.3 From c128d007df40ee0f4a55f954cb153ddd983a4d36 Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Tue, 6 Dec 2016 10:08:15 -0800 Subject: use VCPKG_CMAKE_SYSTEM_NAME instead of TRIPLET_SYSTEM_NAME --- ports/sqlite3/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ports/sqlite3/CMakeLists.txt b/ports/sqlite3/CMakeLists.txt index 760684493..dbe636b79 100644 --- a/ports/sqlite3/CMakeLists.txt +++ b/ports/sqlite3/CMakeLists.txt @@ -17,7 +17,8 @@ target_compile_definitions(sqlite3 PRIVATE -DSQLITE_ENABLE_UNLOCK_NOTIFY ) target_include_directories(sqlite3 INTERFACE $) -if(TRIPLET_SYSTEM_NAME MATCHES "WindowsStore") + +if(VCPKG_CMAKE_SYSTEM_NAME MATCHES "WindowsStore") target_compile_definitions(sqlite3 PRIVATE -DSQLITE_OS_WINRT=1) endif() -- cgit v1.2.3 From f1a3424c772581f70351a9dfbf73c9f8d2a9e521 Mon Sep 17 00:00:00 2001 From: codicodi Date: Tue, 6 Dec 2016 22:38:25 +0100 Subject: [libflac] update config in static builds Now static libs can be used without defining FLAC__NO_DLL by user. --- ports/libflac/portfile.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ports/libflac/portfile.cmake b/ports/libflac/portfile.cmake index bb7daae72..79445a406 100644 --- a/ports/libflac/portfile.cmake +++ b/ports/libflac/portfile.cmake @@ -26,6 +26,11 @@ vcpkg_configure_cmake( vcpkg_install_cmake() vcpkg_copy_pdbs() +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(APPEND ${CURRENT_PACKAGES_DIR}/include/FLAC/export.h "#undef FLAC_API\n#define FLAC_API\n") + file(APPEND ${CURRENT_PACKAGES_DIR}/include/FLAC++/export.h "#undef FLAC_API\n#define FLAC_API\n") +endif() + # This license (BSD) is relevant only for library - if someone would want to install # FLAC cmd line tools as well additional license (GPL) should be included file(COPY ${SOURCE_PATH}/COPYING.Xiph DESTINATION ${CURRENT_PACKAGES_DIR}/share/libflac) -- cgit v1.2.3 From a545be80b4a5388e6cfde1ab9cd554bcaede4065 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 6 Dec 2016 13:48:37 -0800 Subject: [boost] Fix dynamic build lib renaming --- ports/boost/CONTROL | 2 +- ports/boost/portfile.cmake | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ports/boost/CONTROL b/ports/boost/CONTROL index 91c8496a5..52273d80e 100644 --- a/ports/boost/CONTROL +++ b/ports/boost/CONTROL @@ -1,3 +1,3 @@ Source: boost -Version: 1.62-7 +Version: 1.62-8 Description: Peer-reviewed portable C++ source libraries diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake index 67d9096ac..f9d70554a 100644 --- a/ports/boost/portfile.cmake +++ b/ports/boost/portfile.cmake @@ -114,7 +114,11 @@ function(boost_rename_libs LIBS) string(REPLACE "libboost_" "boost_" NEW_FILENAME ${OLD_FILENAME}) string(REPLACE "-s-" "-" NEW_FILENAME ${NEW_FILENAME}) # For Release libs string(REPLACE "-sgd-" "-gd-" NEW_FILENAME ${NEW_FILENAME}) # For Debug libs - file(RENAME ${DIRECTORY_OF_LIB_FILE}/${OLD_FILENAME} ${DIRECTORY_OF_LIB_FILE}/${NEW_FILENAME}) + if (EXISTS ${DIRECTORY_OF_LIB_FILE}/${NEW_FILENAME}) + file(REMOVE ${DIRECTORY_OF_LIB_FILE}/${OLD_FILENAME}) + else() + file(RENAME ${DIRECTORY_OF_LIB_FILE}/${OLD_FILENAME} ${DIRECTORY_OF_LIB_FILE}/${NEW_FILENAME}) + endif() endforeach() endfunction() -- cgit v1.2.3 From a05a033d744ad28b1eb8c8faa8ef8c21854c05f7 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 6 Dec 2016 13:58:04 -0800 Subject: [aws-sdk-cpp] Check VCPKG_CRT_LINKAGE instead of VCPKG_LIBRARY_LINKAGE. Rename archive to avoid collisions with other libraries. --- ports/aws-sdk-cpp/CONTROL | 2 +- ports/aws-sdk-cpp/portfile.cmake | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/aws-sdk-cpp/CONTROL b/ports/aws-sdk-cpp/CONTROL index bfeed7a0b..05ea2fc08 100644 --- a/ports/aws-sdk-cpp/CONTROL +++ b/ports/aws-sdk-cpp/CONTROL @@ -1,3 +1,3 @@ Source: aws-sdk-cpp -Version: 1.0.34 +Version: 1.0.34-1 Description: AWS SDK for C++ diff --git a/ports/aws-sdk-cpp/portfile.cmake b/ports/aws-sdk-cpp/portfile.cmake index a1f1a40b9..1cff4bee7 100644 --- a/ports/aws-sdk-cpp/portfile.cmake +++ b/ports/aws-sdk-cpp/portfile.cmake @@ -2,7 +2,7 @@ include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/aws-sdk-cpp-1.0.34) vcpkg_download_distfile(ARCHIVE URLS "https://github.com/aws/aws-sdk-cpp/archive/1.0.34.tar.gz" - FILENAME "1.0.34.tar.gz" + FILENAME "aws-sdk-cpp-1.0.34.tar.gz" SHA512 21ca03eb323eecb55c29866b73c07956a36aad7c9c051eb7ca201cfd356c3f9732c89898cf0c89660d6c1279dc52438bb389b37d613bf741bae81bb3e773a3c5 ) vcpkg_extract_source_archive(${ARCHIVE}) @@ -13,7 +13,7 @@ vcpkg_apply_patches( ${CMAKE_CURRENT_LIST_DIR}/drop_git.patch ) -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) +if(VCPKG_CRT_LINKAGE STREQUAL static) set(FORCE_SHARED_CRT OFF) else() set(FORCE_SHARED_CRT ON) @@ -37,7 +37,7 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/nuget ${CURRENT_PACKAGES_DIR}/debug/nuget) -if(${VCPKG_LIBRARY_LINKAGE} STREQUAL dynamic) +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(GLOB LIB_FILES ${CURRENT_PACKAGES_DIR}/bin/*.lib) file(GLOB DEBUG_LIB_FILES ${CURRENT_PACKAGES_DIR}/debug/bin/*.lib) file(COPY ${LIB_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/lib) -- cgit v1.2.3 From c0c2135a604f9ae7beb4aed936f9b9160b956e7a Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 6 Dec 2016 14:18:37 -0800 Subject: [gflags] Add quotes to avoid stripping semicolons from the config module. --- ports/gflags/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/gflags/portfile.cmake b/ports/gflags/portfile.cmake index ac8a44c6e..61a28055f 100644 --- a/ports/gflags/portfile.cmake +++ b/ports/gflags/portfile.cmake @@ -47,7 +47,7 @@ file(READ ${CURRENT_PACKAGES_DIR}/share/gflags/gflags-targets.cmake GFLAGS_CONFI string(REPLACE "get_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)" "get_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)\nget_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)" GFLAGS_CONFIG_MODULE "${GFLAGS_CONFIG_MODULE}") -file(WRITE ${CURRENT_PACKAGES_DIR}/share/gflags/gflags-targets.cmake ${GFLAGS_CONFIG_MODULE}) +file(WRITE ${CURRENT_PACKAGES_DIR}/share/gflags/gflags-targets.cmake "${GFLAGS_CONFIG_MODULE}") file(INSTALL ${CURRENT_BUILDTREES_DIR}/src/COPYING.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/gflags RENAME copyright) -- cgit v1.2.3 From dd7c39f0e328276adf74eb9a944080c06807fa60 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 6 Dec 2016 14:22:24 -0800 Subject: [gflags] Lowercase install directories. Bump version to account for this and c0c2135. --- ports/gflags/CONTROL | 2 +- ports/gflags/portfile.cmake | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ports/gflags/CONTROL b/ports/gflags/CONTROL index 0833c3c76..b84a3b67d 100644 --- a/ports/gflags/CONTROL +++ b/ports/gflags/CONTROL @@ -1,3 +1,3 @@ Source: gflags -Version: 2.2.0-1 +Version: 2.2.0-2 Description: A C++ library that implements commandline flags processing diff --git a/ports/gflags/portfile.cmake b/ports/gflags/portfile.cmake index 61a28055f..91da22ae6 100644 --- a/ports/gflags/portfile.cmake +++ b/ports/gflags/portfile.cmake @@ -51,5 +51,8 @@ file(WRITE ${CURRENT_PACKAGES_DIR}/share/gflags/gflags-targets.cmake "${GFLAGS_C file(INSTALL ${CURRENT_BUILDTREES_DIR}/src/COPYING.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/gflags RENAME copyright) +file(RENAME ${CURRENT_PACKAGES_DIR}/Include ${CURRENT_PACKAGES_DIR}/include) +file(RENAME ${CURRENT_PACKAGES_DIR}/Lib ${CURRENT_PACKAGES_DIR}/lib) +file(RENAME ${CURRENT_PACKAGES_DIR}/debug/Lib ${CURRENT_PACKAGES_DIR}/debug/lib) vcpkg_copy_pdbs() -- cgit v1.2.3 From 59587d94c730056138d2c0ce3e542d4640fc595d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 6 Dec 2016 14:39:17 -0800 Subject: [libflac] Fix typo --- ports/libflac/portfile.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/libflac/portfile.cmake b/ports/libflac/portfile.cmake index 79445a406..38b4846be 100644 --- a/ports/libflac/portfile.cmake +++ b/ports/libflac/portfile.cmake @@ -1,4 +1,4 @@ - # libFLAC uses winapi functons not avalible in WindowsStore + # libFLAC uses winapi functions not available in WindowsStore if (VCPKG_TARGET_ARCHITECTURE STREQUAL arm OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore) message(FATAL_ERROR "Error: UWP builds are currently not supported.") endif() @@ -9,7 +9,7 @@ vcpkg_download_distfile(ARCHIVE URLS "http://downloads.xiph.org/releases/flac/flac-1.3.1.tar.xz" FILENAME "flac-1.3.1.tar.xz" SHA512 923cd0ffe2155636febf2b4633791bc83370d57080461b97ebb69ea21a4b1be7c0ff376c7fc8ca3979af4714e761112114a24b49ff6c80228b58b929db6e96d5) - + vcpkg_extract_source_archive(${ARCHIVE}) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) -- cgit v1.2.3 From db4dc6d1ce8f8cf455bb908560c34a58465cd85a Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 6 Dec 2016 16:15:50 -0800 Subject: [openssl] Do not use branches; these will update and constantly break the hash. --- ports/openssl/CONTROL | 2 +- ports/openssl/portfile-uwp.cmake | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/openssl/CONTROL b/ports/openssl/CONTROL index d0cd893f5..cb7bc7493 100644 --- a/ports/openssl/CONTROL +++ b/ports/openssl/CONTROL @@ -1,3 +1,3 @@ Source: openssl -Version: 1.0.2j +Version: 1.0.2j-1 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 diff --git a/ports/openssl/portfile-uwp.cmake b/ports/openssl/portfile-uwp.cmake index 13bb6a3f5..d78b29bc4 100644 --- a/ports/openssl/portfile-uwp.cmake +++ b/ports/openssl/portfile-uwp.cmake @@ -33,9 +33,9 @@ get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) set(ENV{PATH} "${PERL_EXE_PATH};$ENV{PATH}") vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/Microsoft/openssl/archive/OpenSSL_1_0_2_WinRT-stable.zip" - FILENAME "openssl-microsoft-1.0.2.zip" - SHA512 10c3d7eb354a0b39a837e0c48f31415444acd5b1e7df52ed49a735ea63bf8b7548602a266baa012f1703888e68fdd5cb070fc610584a2f3f9a555e7d62d8b44b + URLS "https://github.com/Microsoft/openssl/archive/OpenSSL_1_0_2j_WinRT.zip" + FILENAME "openssl-microsoft-1.0.2j_WinRT.zip" + SHA512 0860d1f5fca7b1345870e866d7bb78f14672c5bb63c56bb04360ee891be542b4b56625ab971ef9b304b792b6cf36c9508bfd812c4a133f6ba8bafdde5e2f8fcf ) vcpkg_extract_source_archive(${ARCHIVE}) -- cgit v1.2.3 From ed2994a5e930b27fd5dbe121b35fe0abba428376 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 6 Dec 2016 16:17:58 -0800 Subject: [openssl] Fix source path for new archive. --- ports/openssl/portfile-uwp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/openssl/portfile-uwp.cmake b/ports/openssl/portfile-uwp.cmake index d78b29bc4..f4a0a716b 100644 --- a/ports/openssl/portfile-uwp.cmake +++ b/ports/openssl/portfile-uwp.cmake @@ -26,7 +26,7 @@ endif() include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/openssl-OpenSSL_1_0_2_WinRT-stable) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/openssl-OpenSSL_1_0_2j_WinRT) vcpkg_find_acquire_program(PERL) get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) -- cgit v1.2.3 From b65005b241c58763b239fa9151f42e286b692813 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christophe=20Gu=C3=A9bert?= Date: Wed, 7 Dec 2016 12:30:12 +0100 Subject: Add CharLS. --- ports/charls/0001_cmake.patch | 12 ++++++++++++ ports/charls/CONTROL | 3 +++ ports/charls/portfile.cmake | 27 +++++++++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 ports/charls/0001_cmake.patch create mode 100644 ports/charls/CONTROL create mode 100644 ports/charls/portfile.cmake diff --git a/ports/charls/0001_cmake.patch b/ports/charls/0001_cmake.patch new file mode 100644 index 000000000..7f50a98e6 --- /dev/null +++ b/ports/charls/0001_cmake.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1aa40a8..1051997 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -33,6 +33,7 @@ option (BUILD_TESTING "Build tests" ON) + if (WIN32) + if (BUILD_SHARED_LIBS) + add_definitions(-D CHARLS_DLL) ++ set_source_files_properties(src/interface.cpp PROPERTIES COMPILE_FLAGS -DCHARLS_DLL_BUILD) + else() + add_definitions(-D CHARLS_STATIC) + endif() diff --git a/ports/charls/CONTROL b/ports/charls/CONTROL new file mode 100644 index 000000000..8be1a5027 --- /dev/null +++ b/ports/charls/CONTROL @@ -0,0 +1,3 @@ +Source: charls +Version: 2.0.0 +Description: CharLS, a C++ JPEG-LS library implementation. \ No newline at end of file diff --git a/ports/charls/portfile.cmake b/ports/charls/portfile.cmake new file mode 100644 index 000000000..69726f1c3 --- /dev/null +++ b/ports/charls/portfile.cmake @@ -0,0 +1,27 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/charls-2.0.0) +vcpkg_download_distfile(ARCHIVE_FILE + URLS "https://github.com/team-charls/charls/archive/2.0.0.tar.gz" + FILENAME "charls-2.0.0.tar.gz" + SHA512 0a2862fad6d65b941c81f5f838db1fdc6a4625887281ddbf27e21be9084f607d27c8a27d246d6252e08358b2ed4aa0c2b7407048ca559fb40e94313ca72487dd +) +vcpkg_extract_source_archive(${ARCHIVE_FILE}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/0001_cmake.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DBUILD_TESTING=OFF +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(INSTALL ${SOURCE_PATH}/License.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/charls RENAME copyright) + +vcpkg_copy_pdbs() \ No newline at end of file -- cgit v1.2.3 From 7927112acb2ab216a8e45b13922bb78d87bd3bff Mon Sep 17 00:00:00 2001 From: codicodi Date: Wed, 7 Dec 2016 17:48:01 +0100 Subject: [libflac] link to correct version of ogg --- ports/libflac/CMakeLists.txt | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ports/libflac/CMakeLists.txt b/ports/libflac/CMakeLists.txt index 2f3dedbdb..afe55f55e 100644 --- a/ports/libflac/CMakeLists.txt +++ b/ports/libflac/CMakeLists.txt @@ -3,10 +3,6 @@ cmake_policy(SET CMP0005 NEW) # do not escape preprocessor defines project(libflac) -if(NOT DEFINED LIBFLAC_OGG_LIB OR NOT DEFINED LIBFLAC_OGG_INCLUDES) - message(FATAL_ERROR "Ogg library required") -endif() - if(NOT DEFINED LIBFLAC_ARCHITECTURE) message(FATAL_ERROR "Target architecture not specified") endif() @@ -20,7 +16,6 @@ file(GLOB LIBFLACXX_SOURCES include_directories(${PROJECT_SOURCE_DIR}/include) include_directories(${PROJECT_SOURCE_DIR}/src/libFLAC/include) -include_directories(${LIBFLAC_OGG_INCLUDES}) if(NOT LIBFLAC_ARCHITECTURE MATCHES arm) add_definitions(-DFLAC__SSE_OS) @@ -49,7 +44,11 @@ add_library(libFLACXX ${LIBFLACXX_SOURCES}) set_target_properties(libFLAC PROPERTIES OUTPUT_NAME flac) set_target_properties(libFLACXX PROPERTIES OUTPUT_NAME flac++) -target_link_libraries(libFLAC ${LIBFLAC_OGG_LIB}) +find_library(OGG_LIBRARY ogg) +find_path(OGG_INCLUDE_DIR ogg/ogg.h) + +include_directories(${OGG_INCLUDE_DIR}) +target_link_libraries(libFLAC ${OGG_LIBRARY}) target_link_libraries(libFLACXX libFLAC) if(BUILD_SHARED_LIBS) -- cgit v1.2.3 From 764563457f17f93f62fa0f2c5dedca35547facf1 Mon Sep 17 00:00:00 2001 From: codicodi Date: Wed, 7 Dec 2016 17:49:28 +0100 Subject: [libflac] remove unused flags --- ports/libflac/portfile.cmake | 2 -- 1 file changed, 2 deletions(-) diff --git a/ports/libflac/portfile.cmake b/ports/libflac/portfile.cmake index 38b4846be..4ed496fb8 100644 --- a/ports/libflac/portfile.cmake +++ b/ports/libflac/portfile.cmake @@ -18,8 +18,6 @@ vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS -DLIBFLAC_ARCHITECTURE=${VCPKG_TARGET_ARCHITECTURE} - -DLIBFLAC_OGG_LIB=${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/lib/ogg.lib - -DLIBFLAC_OGG_INCLUDES=${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/include OPTIONS_DEBUG -DLIBFLAC_SKIP_HEADERS=ON) -- cgit v1.2.3 From abc8c375209b0ee8d99e50a6ac9172a83ee61e6d Mon Sep 17 00:00:00 2001 From: codicodi Date: Wed, 7 Dec 2016 17:50:56 +0100 Subject: [libflac] bump version --- ports/libflac/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/libflac/CONTROL b/ports/libflac/CONTROL index 557b30123..9b1a37531 100644 --- a/ports/libflac/CONTROL +++ b/ports/libflac/CONTROL @@ -1,4 +1,4 @@ Source: libflac -Version: 1.3.1 +Version: 1.3.1-1 Description: Library for manipulating FLAC files Build-Depends: libogg -- cgit v1.2.3 From 31c4de315a218117f2f88742b3be58f9df9b76ac Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 7 Dec 2016 13:14:10 -0800 Subject: Add "vcpkg /?" which is equivalent to "vcpkg help" --- toolsrc/src/commands_other.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/toolsrc/src/commands_other.cpp b/toolsrc/src/commands_other.cpp index 5f4128bb1..bb1768048 100644 --- a/toolsrc/src/commands_other.cpp +++ b/toolsrc/src/commands_other.cpp @@ -74,6 +74,7 @@ namespace vcpkg const std::vector>& get_available_commands_type_b() { static std::vector> t = { + {"/?", help_command}, {"help", help_command}, {"search", search_command}, {"list", list_command}, -- cgit v1.2.3 From f047bd733e85b8e32b72a9f2a633255bb4da0fa8 Mon Sep 17 00:00:00 2001 From: codicodi Date: Wed, 7 Dec 2016 23:02:23 +0100 Subject: [sfml] initial commit --- ports/sfml/CMakeLists.txt | 123 ++++++++++++++++++++++++++++++++++++++++++++++ ports/sfml/CONTROL | 4 ++ ports/sfml/portfile.cmake | 34 +++++++++++++ 3 files changed, 161 insertions(+) create mode 100644 ports/sfml/CMakeLists.txt create mode 100644 ports/sfml/CONTROL create mode 100644 ports/sfml/portfile.cmake diff --git a/ports/sfml/CMakeLists.txt b/ports/sfml/CMakeLists.txt new file mode 100644 index 000000000..1eda7edb2 --- /dev/null +++ b/ports/sfml/CMakeLists.txt @@ -0,0 +1,123 @@ +cmake_minimum_required(VERSION 2.6) +project(SFML) + +include_directories(${PROJECT_SOURCE_DIR}/include) +include_directories(${PROJECT_SOURCE_DIR}/src) +include_directories(${SFML_DEPENDENCIES_PATH}/include) + +if(NOT BUILD_SHARED_LIBS) + add_definitions(-DSFML_STATIC) +endif() +add_definitions(-DUNICODE -D_UNICODE) +add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS) + +# import SFML's 'sfml_add_library' macro and find_package utils + +set(VERSION_MAJOR 2) +set(SFML_OS_WINDOWS ON) +set(SFML_GENERATE_PDB ON) +include(cmake/macros.cmake) +set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules/) + +# system module + +file(GLOB SFML_SYSTEM_SOURCES + ${PROJECT_SOURCE_DIR}/src/SFML/System/*.cpp + ${PROJECT_SOURCE_DIR}/src/SFML/System/Win32/*cpp) + +sfml_add_library(sfml-system + SOURCES ${SFML_SYSTEM_SOURCES} + EXTERNAL_LIBS winmm) + +# window module + +file(GLOB SFML_WINDOW_SOURCES + ${PROJECT_SOURCE_DIR}/src/SFML/Window/*.cpp + ${PROJECT_SOURCE_DIR}/src/SFML/Window/Win32/*cpp) + +list(REMOVE_ITEM SFML_WINDOW_SOURCES + ${PROJECT_SOURCE_DIR}/src/SFML/Window/EGLCheck.cpp + ${PROJECT_SOURCE_DIR}/src/SFML/Window/EglContext.cpp) + +sfml_add_library(sfml-window + SOURCES ${SFML_WINDOW_SOURCES} + DEPENDS sfml-system + EXTERNAL_LIBS winmm gdi32 opengl32) + +# network module + +file(GLOB SFML_NETWORK_SOURCES + ${PROJECT_SOURCE_DIR}/src/SFML/Network/*.cpp + ${PROJECT_SOURCE_DIR}/src/SFML/Network/Win32/*cpp) + +sfml_add_library(sfml-network + SOURCES ${SFML_NETWORK_SOURCES} + DEPENDS sfml-system + EXTERNAL_LIBS ws2_32) + +# audio module + +file(GLOB SFML_AUDIO_SOURCES + ${PROJECT_SOURCE_DIR}/src/SFML/Audio/*.cpp) + +find_package(OpenAL REQUIRED) +find_package(Vorbis REQUIRED) +find_package(FLAC REQUIRED) + +sfml_add_library(sfml-audio + SOURCES ${SFML_AUDIO_SOURCES} + DEPENDS sfml-system + EXTERNAL_LIBS ${OPENAL_LIBRARY} ${VORBIS_LIBRARIES} ${FLAC_LIBRARY}) + +target_include_directories(sfml-audio SYSTEM PRIVATE ${OPENAL_INCLUDE_DIR}) +target_include_directories(sfml-audio SYSTEM PRIVATE ${VORBIS_INCLUDE_DIRS}) +target_include_directories(sfml-audio SYSTEM PRIVATE ${FLAC_INCLUDE_DIR}) + +# graphics module + +file(GLOB SFML_GRAPHICS_SOURCES + ${PROJECT_SOURCE_DIR}/src/SFML/Graphics/*.cpp) + +find_package(JPEG REQUIRED) +find_package(Freetype REQUIRED) # fails to find debug lib +if(CMAKE_BUILD_TYPE MATCHES Debug) + find_library(FREETYPE_DEBUG_LIBRARY freetyped) + set(FREETYPE_ACTUAL_LIBRARY ${FREETYPE_DEBUG_LIBRARY}) +else() + set(FREETYPE_ACTUAL_LIBRARY ${FREETYPE_LIBRARY}) +endif() +find_path(STB_HEADERS stb_image.h) + +sfml_add_library(sfml-graphics + SOURCES ${SFML_GRAPHICS_SOURCES} + DEPENDS sfml-system sfml-window + EXTERNAL_LIBS ${FREETYPE_ACTUAL_LIBRARY} ${JPEG_LIBRARY} opengl32) + +target_include_directories(sfml-graphics SYSTEM PRIVATE ${STB_HEADERS}) +target_include_directories(sfml-graphics SYSTEM PRIVATE ${FREETYPE_INCLUDE_DIRS}) +target_include_directories(sfml-graphics SYSTEM PRIVATE ${JPEG_INCLUDE_DIR}) +set_target_properties(sfml-graphics PROPERTIES COMPILE_FLAGS -DSTBI_FAILURE_USERMSG) + +# main module + +add_library(sfml-main STATIC ${PROJECT_SOURCE_DIR}/src/SFML/Main/MainWin32.cpp) +set_target_properties(sfml-main PROPERTIES DEBUG_POSTFIX -d) +install(TARGETS sfml-main ARCHIVE DESTINATION lib) + +# headers + +if(NOT DEFINED SFML_SKIP_HEADERS) + install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include) +endif() + +# log linked libraries + +message(STATUS "Link-time dependencies:") +message(STATUS " " ${VORBIS_LIBRARY}) +message(STATUS " " ${VORBISFILE_LIBRARY}) +message(STATUS " " ${VORBISENC_LIBRARY}) +message(STATUS " " ${OGG_LIBRARY}) +message(STATUS " " ${OPENAL_LIBRARY}) +message(STATUS " " ${FLAC_LIBRARY}) +message(STATUS " " ${FREETYPE_ACTUAL_LIBRARY}) +message(STATUS " " ${JPEG_LIBRARY}) diff --git a/ports/sfml/CONTROL b/ports/sfml/CONTROL new file mode 100644 index 000000000..175aaa0ab --- /dev/null +++ b/ports/sfml/CONTROL @@ -0,0 +1,4 @@ +Source: sfml +Version: 2.4.1 +Description: Simple and fast multimedia library +Build-Depends: freetype, libflac, libjpeg-turbo, libogg, libvorbis, openal-soft, stb diff --git a/ports/sfml/portfile.cmake b/ports/sfml/portfile.cmake new file mode 100644 index 000000000..916b033ef --- /dev/null +++ b/ports/sfml/portfile.cmake @@ -0,0 +1,34 @@ + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/SFML-2.4.1) +vcpkg_download_distfile(ARCHIVE + URLS "http://www.sfml-dev.org/files/SFML-2.4.1-sources.zip" + FILENAME "SFML-2.4.1-sources.zip" + SHA512 e2a49927e1db6ab94fa52b88460782fa2b28ccd4a8c75793e10c7669b24736f63aab723c2e1d8befc96f6f5cf4ed185f13da2550da721d206780003f158e5507) + +vcpkg_extract_source_archive(${ARCHIVE}) + +file(REMOVE_RECURSE ${SOURCE_PATH}/extlibs) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS_DEBUG + -DSFML_SKIP_HEADERS=ON) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +# don't force users to define SFML_STATIC while using static library +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(APPEND ${CURRENT_PACKAGES_DIR}/include/SFML/Config.hpp "#undef SFML_API_IMPORT\n#define SFML_API_IMPORT\n") +endif() + +# move sfml-main to manual link dir +file(COPY ${CURRENT_PACKAGES_DIR}/lib/sfml-main.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/manual-link) +file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/sfml-main.lib) +file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/sfml-main-d.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/sfml-main-d.lib) + +file(COPY ${SOURCE_PATH}/license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/sfml) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/sfml/license.txt ${CURRENT_PACKAGES_DIR}/share/sfml/copyright) -- cgit v1.2.3 From f8c119d7fe05a1005c0b8ca86d7d62d4bd251e95 Mon Sep 17 00:00:00 2001 From: Guillaume Dumont Date: Wed, 7 Dec 2016 17:22:38 -0500 Subject: Fixed wrong location of gflags license file --- ports/gflags/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/gflags/portfile.cmake b/ports/gflags/portfile.cmake index 91da22ae6..37fea35c3 100644 --- a/ports/gflags/portfile.cmake +++ b/ports/gflags/portfile.cmake @@ -49,7 +49,7 @@ string(REPLACE "get_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PAT GFLAGS_CONFIG_MODULE "${GFLAGS_CONFIG_MODULE}") file(WRITE ${CURRENT_PACKAGES_DIR}/share/gflags/gflags-targets.cmake "${GFLAGS_CONFIG_MODULE}") -file(INSTALL ${CURRENT_BUILDTREES_DIR}/src/COPYING.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/gflags RENAME copyright) +file(INSTALL ${SOURCE_PATH}/COPYING.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/gflags RENAME copyright) file(RENAME ${CURRENT_PACKAGES_DIR}/Include ${CURRENT_PACKAGES_DIR}/include) file(RENAME ${CURRENT_PACKAGES_DIR}/Lib ${CURRENT_PACKAGES_DIR}/lib) -- cgit v1.2.3 From 040555ee81c0a70509e635f060836b7656fc4f36 Mon Sep 17 00:00:00 2001 From: codicodi Date: Wed, 7 Dec 2016 23:33:00 +0100 Subject: [sfml] this shouldn't be here... --- ports/sfml/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/sfml/CMakeLists.txt b/ports/sfml/CMakeLists.txt index 1eda7edb2..e8e16edec 100644 --- a/ports/sfml/CMakeLists.txt +++ b/ports/sfml/CMakeLists.txt @@ -3,7 +3,6 @@ project(SFML) include_directories(${PROJECT_SOURCE_DIR}/include) include_directories(${PROJECT_SOURCE_DIR}/src) -include_directories(${SFML_DEPENDENCIES_PATH}/include) if(NOT BUILD_SHARED_LIBS) add_definitions(-DSFML_STATIC) -- cgit v1.2.3 From ade896e4bffe80a38e3f5f9cc588669b9c24e9c0 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 7 Dec 2016 15:18:07 -0800 Subject: [asio] Use SOURCE_PATH --- ports/asio/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/asio/portfile.cmake b/ports/asio/portfile.cmake index c966b157e..345ddd673 100644 --- a/ports/asio/portfile.cmake +++ b/ports/asio/portfile.cmake @@ -9,7 +9,7 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive(${ARCHIVE}) # Handle copyright -file(COPY ${CURRENT_BUILDTREES_DIR}/src/asio-asio-1-10-6/asio/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/asio) +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/asio) file(RENAME ${CURRENT_PACKAGES_DIR}/share/asio/COPYING ${CURRENT_PACKAGES_DIR}/share/asio/copyright) # Copy the asio header files -- cgit v1.2.3 From e8b46b89d09ce9c5c0775ae29be9925cce8f16a1 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 7 Dec 2016 15:19:16 -0800 Subject: [assimp] Extract variable SOURCE_PATH --- ports/assimp/portfile.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ports/assimp/portfile.cmake b/ports/assimp/portfile.cmake index 04d19cdd3..452233265 100644 --- a/ports/assimp/portfile.cmake +++ b/ports/assimp/portfile.cmake @@ -7,6 +7,7 @@ # include(vcpkg_common_functions) +SET(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/assimp-3.3.1) vcpkg_download_distfile(ARCHIVE URLS "https://github.com/assimp/assimp/archive/v3.3.1.zip" FILENAME "assimp-3.3.1.zip" @@ -15,7 +16,7 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_configure_cmake( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/assimp-3.3.1 + SOURCE_PATH ${SOURCE_PATH} OPTIONS -DASSIMP_BUILD_TESTS=False -DASSIMP_BUILD_ASSIMP_VIEW=False -DASSIMP_BUILD_ZLIB=False @@ -33,7 +34,7 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright -file(COPY ${CURRENT_BUILDTREES_DIR}/src/assimp-3.3.1/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/assimp) +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/assimp) file(RENAME ${CURRENT_PACKAGES_DIR}/share/assimp/LICENSE ${CURRENT_PACKAGES_DIR}/share/assimp/copyright) vcpkg_copy_pdbs() \ No newline at end of file -- cgit v1.2.3 From e6ebc0369990c1d670d87bec248ffb04739df334 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 7 Dec 2016 15:21:30 -0800 Subject: [freeglut] Extract SOURCE_PATH variable --- ports/freeglut/portfile.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ports/freeglut/portfile.cmake b/ports/freeglut/portfile.cmake index 67c0b402b..929d8b9e4 100644 --- a/ports/freeglut/portfile.cmake +++ b/ports/freeglut/portfile.cmake @@ -1,4 +1,5 @@ include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/freeglut-3.0.0) vcpkg_download_distfile(ARCHIVE URLS "http://downloads.sourceforge.net/project/freeglut/freeglut/3.0.0/freeglut-3.0.0.tar.gz" FILENAME "freeglut-3.0.0.tar.gz" @@ -15,7 +16,7 @@ else() endif() vcpkg_configure_cmake( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/freeglut-3.0.0 + SOURCE_PATH ${SOURCE_PATH} OPTIONS -DFREEGLUT_BUILD_STATIC_LIBS=${FREEGLUT_STATIC} -DFREEGLUT_BUILD_SHARED_LIBS=${FREEGLUT_DYNAMIC} @@ -28,7 +29,7 @@ vcpkg_install_cmake() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright -file(COPY ${CURRENT_BUILDTREES_DIR}/src/freeglut-3.0.0/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/freeglut) +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/freeglut) file(RENAME ${CURRENT_PACKAGES_DIR}/share/freeglut/COPYING ${CURRENT_PACKAGES_DIR}/share/freeglut/copyright) vcpkg_copy_pdbs() \ No newline at end of file -- cgit v1.2.3 From 7555e6576bff0b588edb40d4b531a92546de2b2f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 7 Dec 2016 15:23:50 -0800 Subject: [geos] Extract SOURCE_PATH variable --- ports/geos/portfile.cmake | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ports/geos/portfile.cmake b/ports/geos/portfile.cmake index 60d907acd..7cd50db58 100644 --- a/ports/geos/portfile.cmake +++ b/ports/geos/portfile.cmake @@ -7,6 +7,7 @@ # include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/3.5) #downloading 3.5 from their SVN repo and not the release tarball #because the 3.5 release did not build on windows, and fixes were backported #without generating a new release tarball (I don't think very many GIS people use win) @@ -17,12 +18,12 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) -#we need to do this because GOES deploy process is totally broken for cmake +#we need to do this because GEOS deploy process is totally broken for cmake #file(DOWNLOAD http://svn.osgeo.org/geos/tags/3.5.0/cmake/modules/GenerateSourceGroups.cmake -# ${CURRENT_BUILDTREES_DIR}/src/geos-3.5.0/cmake/modules/GenerateSourceGroups.cmake) -file(WRITE ${CURRENT_BUILDTREES_DIR}/src/3.5/geos_svn_revision.h "#define GEOS_SVN_REVISION 4261") +# ${SOURCE_PATH}/cmake/modules/GenerateSourceGroups.cmake) +file(WRITE ${SOURCE_PATH}/geos_svn_revision.h "#define GEOS_SVN_REVISION 4261") vcpkg_configure_cmake( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/3.5 + SOURCE_PATH ${SOURCE_PATH} OPTIONS -DGEOS_ENABLE_TESTS=False -DBUILD_TESTING=False ) @@ -31,7 +32,7 @@ vcpkg_build_cmake() vcpkg_install_cmake() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright -file(COPY ${CURRENT_BUILDTREES_DIR}/src/3.5/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/geos) +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/geos) file(RENAME ${CURRENT_PACKAGES_DIR}/share/geos/COPYING ${CURRENT_PACKAGES_DIR}/share/geos/copyright) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/libgeos.lib ${CURRENT_PACKAGES_DIR}/debug/lib/libgeos.lib) -- cgit v1.2.3 From 220a8597c2ee8088ff36309eaf88b51fea21f297 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 7 Dec 2016 15:25:33 -0800 Subject: [glbinding] Extract SOURCE_PATH variable --- ports/glbinding/portfile.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/glbinding/portfile.cmake b/ports/glbinding/portfile.cmake index 6da7d4858..165c8d889 100644 --- a/ports/glbinding/portfile.cmake +++ b/ports/glbinding/portfile.cmake @@ -7,14 +7,14 @@ # include(vcpkg_common_functions) - +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/glbinding-2.1.1) vcpkg_download_distfile(ARCHIVE URLS "https://github.com/cginternals/glbinding/archive/v2.1.1.zip" FILENAME "glbinding-2.1.1.zip" SHA512 66b21853a4f4760b7b22cafd5211958769c513e83be999018fe79cf56a9271e0e28566caaa2286393f54ac2154d564a68d12159598d03c965adf6756f3753f11 ) vcpkg_extract_source_archive(${ARCHIVE}) -vcpkg_configure_cmake(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/glbinding-2.1.1) +vcpkg_configure_cmake(SOURCE_PATH ${SOURCE_PATH}) #vcpkg_build_cmake() vcpkg_install_cmake() @@ -54,7 +54,7 @@ file(REMOVE ${CURRENT_PACKAGES_DIR}/AUTHORS ) # Handle copyright -file(COPY ${CURRENT_BUILDTREES_DIR}/src/glbinding-2.1.1/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/glbinding) +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/glbinding) file(RENAME ${CURRENT_PACKAGES_DIR}/share/glbinding/LICENSE ${CURRENT_PACKAGES_DIR}/share/glbinding/copyright) vcpkg_copy_pdbs() \ No newline at end of file -- cgit v1.2.3 From 91a6913493c180d8b051a8c130f9bc542ad93161 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 7 Dec 2016 15:26:30 -0800 Subject: [globjects] Use SOURCE_PATH variable --- ports/globjects/portfile.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/globjects/portfile.cmake b/ports/globjects/portfile.cmake index e46c34509..5ab880ad6 100644 --- a/ports/globjects/portfile.cmake +++ b/ports/globjects/portfile.cmake @@ -15,7 +15,7 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) -vcpkg_configure_cmake(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/globjects-1.0.0) +vcpkg_configure_cmake(SOURCE_PATH ${SOURCE_PATH}) #vcpkg_build_cmake() vcpkg_install_cmake() @@ -55,7 +55,7 @@ file(REMOVE ${CURRENT_PACKAGES_DIR}/AUTHORS ) # Handle copyright -file(COPY ${CURRENT_BUILDTREES_DIR}/src/globjects-1.0.0/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/globjects) +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/globjects) file(RENAME ${CURRENT_PACKAGES_DIR}/share/globjects/LICENSE ${CURRENT_PACKAGES_DIR}/share/globjects/copyright) vcpkg_copy_pdbs() -- cgit v1.2.3 From dea170b46970171a104551d2d6512dee1469646b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 7 Dec 2016 15:35:23 -0800 Subject: [harfbuzz] Use SOURCE_PATH for copying license --- ports/harfbuzz/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/harfbuzz/portfile.cmake b/ports/harfbuzz/portfile.cmake index b818e0938..911dea860 100644 --- a/ports/harfbuzz/portfile.cmake +++ b/ports/harfbuzz/portfile.cmake @@ -55,5 +55,5 @@ vcpkg_execute_required_process( ) # Handle copyright -file(COPY ${CURRENT_BUILDTREES_DIR}/src/harfbuzz-1.3.4/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/harfbuzz) +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/harfbuzz) file(RENAME ${CURRENT_PACKAGES_DIR}/share/harfbuzz/COPYING ${CURRENT_PACKAGES_DIR}/share/harfbuzz/copyright) -- cgit v1.2.3 From a73feb7c99c62bc97a53e8497c41f1854e524108 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 7 Dec 2016 15:38:17 -0800 Subject: [ragel] Use SOURCE_PATH when copying license --- ports/ragel/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/ragel/portfile.cmake b/ports/ragel/portfile.cmake index 8568f6bac..c240fdefd 100644 --- a/ports/ragel/portfile.cmake +++ b/ports/ragel/portfile.cmake @@ -36,5 +36,5 @@ vcpkg_install_cmake() file(WRITE ${CURRENT_PACKAGES_DIR}/include/ragel.txt) # Handle copyright -file(COPY ${CURRENT_BUILDTREES_DIR}/src/ragel-6.9/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/ragel) +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/ragel) file(RENAME ${CURRENT_PACKAGES_DIR}/share/ragel/COPYING ${CURRENT_PACKAGES_DIR}/share/ragel/copyright) -- cgit v1.2.3 From 31b713ca1fe74f784f01cdc6ed0cfdaf4a5fcaf7 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 7 Dec 2016 21:40:36 -0800 Subject: [vcpkg] Remove all instances of TRIPLET_SYSTEM_NAME; use VCPKG_CMAKE_SYSTEM_NAME instead. --- ports/boost/portfile.cmake | 2 +- ports/sdl2/portfile.cmake | 2 +- scripts/cmake/vcpkg_configure_cmake.cmake | 6 +++--- scripts/ports.cmake | 1 - 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake index f9d70554a..fcf60402b 100644 --- a/ports/boost/portfile.cmake +++ b/ports/boost/portfile.cmake @@ -55,7 +55,7 @@ endif() if(TRIPLET_SYSTEM_ARCH MATCHES "x64") list(APPEND B2_OPTIONS address-model=64) endif() -if(TRIPLET_SYSTEM_NAME MATCHES "WindowsStore") +if(VCPKG_CMAKE_SYSTEM_NAME MATCHES "WindowsStore") list(APPEND B2_OPTIONS windows-api=store) set(ENV{BOOST_BUILD_PATH} ${CMAKE_CURRENT_LIST_DIR}) endif() diff --git a/ports/sdl2/portfile.cmake b/ports/sdl2/portfile.cmake index 6fcb94c8b..fd9bbd8d4 100644 --- a/ports/sdl2/portfile.cmake +++ b/ports/sdl2/portfile.cmake @@ -11,7 +11,7 @@ vcpkg_download_distfile(ARCHIVE_FILE ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) -if(TRIPLET_SYSTEM_NAME MATCHES "WindowsStore") +if(VCPKG_CMAKE_SYSTEM_NAME MATCHES "WindowsStore") vcpkg_build_msbuild( PROJECT_PATH ${SOURCE_PATH}/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj ) diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 2c506ad94..179703172 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -4,11 +4,11 @@ function(vcpkg_configure_cmake) if(_csc_GENERATOR) set(GENERATOR ${_csc_GENERATOR}) - elseif(TRIPLET_SYSTEM_NAME MATCHES "uwp" AND TRIPLET_SYSTEM_ARCH MATCHES "x86") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x86") set(GENERATOR "Visual Studio 14 2015") - elseif(TRIPLET_SYSTEM_NAME MATCHES "uwp" AND TRIPLET_SYSTEM_ARCH MATCHES "x64") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x64") set(GENERATOR "Visual Studio 14 2015 Win64") - elseif(TRIPLET_SYSTEM_NAME MATCHES "uwp" AND TRIPLET_SYSTEM_ARCH MATCHES "arm") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "arm") set(GENERATOR "Visual Studio 14 2015 ARM") # elseif(NOT vcpkg_configure_cmake_NINJA MATCHES "NOTFOUND") # set(GENERATOR "Ninja") diff --git a/scripts/ports.cmake b/scripts/ports.cmake index 762997491..4e28cbb67 100644 --- a/scripts/ports.cmake +++ b/scripts/ports.cmake @@ -33,7 +33,6 @@ endif() if(CMD MATCHES "^BUILD$") string(REGEX REPLACE "([^-]*)-([^-]*)" "\\1" TRIPLET_SYSTEM_ARCH ${TARGET_TRIPLET}) - string(REGEX REPLACE "([^-]*)-([^-]*)" "\\2" TRIPLET_SYSTEM_NAME ${TARGET_TRIPLET}) set(CMAKE_TRIPLET_FILE ${VCPKG_ROOT_DIR}/triplets/${TARGET_TRIPLET}.cmake) if(NOT EXISTS ${CMAKE_TRIPLET_FILE}) -- cgit v1.2.3 From 93d83e0a60a6e66f91a1cf9d02a490ca01348958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christophe=20Gu=C3=A9bert?= Date: Wed, 7 Dec 2016 09:04:49 +0100 Subject: Add a patch for curl to find the libssh2 library --- ports/curl/0001_cmake.patch | 13 +++++++++++++ ports/curl/portfile.cmake | 6 ++++++ 2 files changed, 19 insertions(+) create mode 100644 ports/curl/0001_cmake.patch diff --git a/ports/curl/0001_cmake.patch b/ports/curl/0001_cmake.patch new file mode 100644 index 000000000..db281e122 --- /dev/null +++ b/ports/curl/0001_cmake.patch @@ -0,0 +1,13 @@ +diff --git a/CMake/FindLibSSH2.cmake b/CMake/FindLibSSH2.cmake +index 12a7c61..9839c67 100644 +--- a/CMake/FindLibSSH2.cmake ++++ b/CMake/FindLibSSH2.cmake +@@ -12,7 +12,7 @@ endif (LIBSSH2_INCLUDE_DIR AND LIBSSH2_LIBRARY) + FIND_PATH(LIBSSH2_INCLUDE_DIR libssh2.h + ) + +-FIND_LIBRARY(LIBSSH2_LIBRARY NAMES ssh2 ++FIND_LIBRARY(LIBSSH2_LIBRARY NAMES ssh2 libssh2 + ) + + if(LIBSSH2_INCLUDE_DIR) diff --git a/ports/curl/portfile.cmake b/ports/curl/portfile.cmake index e2359f73d..01c76718b 100644 --- a/ports/curl/portfile.cmake +++ b/ports/curl/portfile.cmake @@ -7,6 +7,12 @@ vcpkg_download_distfile(ARCHIVE_FILE ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/0001_cmake.patch +) + if (VCPKG_CRT_LINKAGE STREQUAL dynamic) SET(CURL_STATICLIB OFF) else() -- cgit v1.2.3 From 2307fa6274326cfaaf49303f728bdededa436a93 Mon Sep 17 00:00:00 2001 From: codeandroid Date: Thu, 8 Dec 2016 17:03:45 +0100 Subject: [boost] unset BOOST_AUTO_LINK_NOMANGLE flag (fixes #397). This was a remnant of a previously enabled system install option which has been disabled in the meantime. --- ports/boost/portfile.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake index fcf60402b..3c408bca7 100644 --- a/ports/boost/portfile.cmake +++ b/ports/boost/portfile.cmake @@ -100,7 +100,6 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) "\n#define BOOST_ALL_DYN_LINK\n" ) endif() -file(APPEND ${CURRENT_PACKAGES_DIR}/include/boost/config/user.hpp "\n#define BOOST_AUTO_LINK_NOMANGLE\n") file(INSTALL ${SOURCE_PATH}/LICENSE_1_0.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/boost RENAME copyright) message(STATUS "Packaging headers done") -- cgit v1.2.3 From c10e7e49606d087e5dacd6f26026e2489ed4ef62 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 9 Dec 2016 14:20:03 -0800 Subject: [curl] Bump version and require libssh2 --- ports/curl/CONTROL | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/curl/CONTROL b/ports/curl/CONTROL index bca23865d..e18ea2f67 100644 --- a/ports/curl/CONTROL +++ b/ports/curl/CONTROL @@ -1,4 +1,4 @@ Source: curl -Version: 7.51.0-1 -Build-Depends: zlib, openssl +Version: 7.51.0-2 +Build-Depends: zlib, openssl, libssh2 Description: A library for transferring data with URLs -- cgit v1.2.3 From 48ca773907beeb4465ecb1a0c8446f738f4eda1e Mon Sep 17 00:00:00 2001 From: codicodi Date: Sun, 11 Dec 2016 14:04:59 +0100 Subject: [sdl2] enable static build --- ports/sdl2/portfile.cmake | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/ports/sdl2/portfile.cmake b/ports/sdl2/portfile.cmake index fd9bbd8d4..81439567c 100644 --- a/ports/sdl2/portfile.cmake +++ b/ports/sdl2/portfile.cmake @@ -1,7 +1,3 @@ -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(STATUS "Warning: Static building not supported yet. Building dynamic.") - set(VCPKG_LIBRARY_LINKAGE dynamic) -endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/SDL2-2.0.5) vcpkg_download_distfile(ARCHIVE_FILE @@ -32,10 +28,25 @@ if(VCPKG_CMAKE_SYSTEM_NAME MATCHES "WindowsStore") file(COPY ${SOURCE_PATH}/include DESTINATION ${CURRENT_PACKAGES_DIR}/include) file(RENAME ${CURRENT_PACKAGES_DIR}/include/include ${CURRENT_PACKAGES_DIR}/include/SDL2) else() + if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + set(SDL_STATIC_LIB ON) + set(SDL_SHARED_LIB OFF) + else() + set(SDL_STATIC_LIB OFF) + set(SDL_SHARED_LIB ON) + endif() + if(VCPKG_CRT_LINKAGE STREQUAL static) + set(SDL_STATIC_CRT ON) + else() + set(SDL_STATIC_CRT OFF) + endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS - -DSDL_STATIC=OFF + -DSDL_STATIC=${SDL_STATIC_LIB} + -DSDL_SHARED=${SDL_SHARED_LIB} + -DFORCE_STATIC_VCRT=${SDL_STATIC_CRT} ) vcpkg_install_cmake() @@ -43,5 +54,10 @@ else() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) endif() +file(COPY ${CURRENT_PACKAGES_DIR}/lib/SDL2main.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/manual-link) +file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/SDL2main.lib) +file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/SDL2main.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/SDL2main.lib) + file(INSTALL ${SOURCE_PATH}/COPYING.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/sdl2 RENAME copyright) vcpkg_copy_pdbs() -- cgit v1.2.3 From 7b111b87a817455922a0bcc5aa7579e7baeaa2b0 Mon Sep 17 00:00:00 2001 From: gknowles Date: Mon, 12 Dec 2016 12:05:20 -0800 Subject: Add dimcli --- ports/dimcli/CONTROL | 4 ++++ ports/dimcli/portfile.cmake | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 ports/dimcli/CONTROL create mode 100644 ports/dimcli/portfile.cmake diff --git a/ports/dimcli/CONTROL b/ports/dimcli/CONTROL new file mode 100644 index 000000000..c85457c89 --- /dev/null +++ b/ports/dimcli/CONTROL @@ -0,0 +1,4 @@ +Source: dimcli +Version: 1.0.3 +Description: C++ command line parser toolkit + diff --git a/ports/dimcli/portfile.cmake b/ports/dimcli/portfile.cmake new file mode 100644 index 000000000..465e1699e --- /dev/null +++ b/ports/dimcli/portfile.cmake @@ -0,0 +1,37 @@ +# 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} +# + +set(ver 1.0.3) +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/dimcli-${ver}) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/gknowles/dimcli/archive/v${ver}.zip" + FILENAME "dimcli-${ver}.zip" + SHA512 5168aff22223cb85421fabd4ce82f3ec0bcab6551704484bc5b05be02ead23bd3d4a629c558a15f214e9d999eccc9c129649d066fdacfda3c839a40b48f8ec17 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +set(staticCrt OFF) +if(VCPKG_CRT_LINKAGE STREQUAL static) + set(staticCrt ON) +endif() +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS -DLINK_STATIC_RUNTIME:BOOL=${staticCrt} +) + +vcpkg_install_cmake() + +# Remove includes from ${CMAKE_INSTALL_PREFIX}/debug +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +# Handle copyright +file(INSTALL "${SOURCE_PATH}/LICENSE" + DESTINATION "${CURRENT_PACKAGES_DIR}/share/dimcli" + RENAME copyright) + -- cgit v1.2.3 From 1310e9e052de50a8d53bc9b88696f8b6c61bece6 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 12 Dec 2016 14:03:13 -0800 Subject: Add SQM User Id to metrics --- toolsrc/include/metrics.h | 1 + toolsrc/src/main.cpp | 1 + toolsrc/src/metrics.cpp | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+) diff --git a/toolsrc/include/metrics.h b/toolsrc/include/metrics.h index 52662cd97..a0f4fc61d 100644 --- a/toolsrc/include/metrics.h +++ b/toolsrc/include/metrics.h @@ -13,6 +13,7 @@ namespace vcpkg void TrackProperty(const std::string& name, const std::string& value); void TrackProperty(const std::string& name, const std::wstring& value); bool GetCompiledMetricsEnabled(); + std::wstring GetSQMUser(); void Upload(const std::string& payload); void Flush(); diff --git a/toolsrc/src/main.cpp b/toolsrc/src/main.cpp index f937be7f1..5e9dcf7ff 100644 --- a/toolsrc/src/main.cpp +++ b/toolsrc/src/main.cpp @@ -197,6 +197,7 @@ int wmain(const int argc, const wchar_t* const* const argv) const std::string trimmed_command_line = trim_path_from_command_line(Strings::utf16_to_utf8(GetCommandLineW())); TrackProperty("cmdline", trimmed_command_line); loadConfig(); + TrackProperty("sqmuser", GetSQMUser()); const vcpkg_cmd_arguments args = vcpkg_cmd_arguments::create_from_command_line(argc, argv); diff --git a/toolsrc/src/metrics.cpp b/toolsrc/src/metrics.cpp index 23962bcfe..51c7179c8 100644 --- a/toolsrc/src/metrics.cpp +++ b/toolsrc/src/metrics.cpp @@ -235,6 +235,40 @@ true return DISABLE_METRICS == 0; } + std::wstring GetSQMUser() + { + LONG err = NULL; + + struct RAII_HKEY { + HKEY hkey = NULL; + ~RAII_HKEY() + { + if (hkey != NULL) + RegCloseKey(hkey); + } + } HKCU_SQMClient; + + err = RegOpenKeyExW(HKEY_CURRENT_USER, LR"(Software\Microsoft\SQMClient)", NULL, KEY_READ, &HKCU_SQMClient.hkey); + if (err != ERROR_SUCCESS) + { + return L"{}"; + } + + std::array buffer; + DWORD lType = 0; + DWORD dwBufferSize = static_cast(buffer.size() * sizeof(wchar_t)); + err = RegQueryValueExW(HKCU_SQMClient.hkey, L"UserId", NULL, &lType, reinterpret_cast(buffer.data()), &dwBufferSize); + if (err == ERROR_SUCCESS && lType == REG_SZ && dwBufferSize >= sizeof(wchar_t)) + { + size_t sz = dwBufferSize / sizeof(wchar_t); + if (buffer[sz - 1] == '\0') + --sz; + return std::wstring(buffer.begin(), buffer.begin() + sz); + } + + return L"{}"; + } + void SetUserInformation(const std::string& user_id, const std::string& first_use_time) { g_metricmessage.user_id = user_id; -- cgit v1.2.3 From d02fe9bdae3553660896d14ef24c2b6dc82bb6db Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 12 Dec 2016 14:58:38 -0800 Subject: Add System::println(std::string) overloads --- toolsrc/include/vcpkg_System.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/toolsrc/include/vcpkg_System.h b/toolsrc/include/vcpkg_System.h index e059bde0a..ca81235ed 100644 --- a/toolsrc/include/vcpkg_System.h +++ b/toolsrc/include/vcpkg_System.h @@ -39,6 +39,26 @@ namespace vcpkg {namespace System void print(color c, const char* message); void println(color c, const char* message); + inline void print(const std::string& message) + { + return print(message.c_str()); + } + + inline void println(const std::string& message) + { + return println(message.c_str()); + } + + inline void print(color c, const std::string& message) + { + return print(c, message.c_str()); + } + + inline void println(color c, const std::string& message) + { + return println(c, message.c_str()); + } + template void print(const char* messageTemplate, const Args&... messageArgs) { -- cgit v1.2.3 From b629cd904440c640b7e5b4c3fdf17df5aac90bad Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 12 Dec 2016 15:03:36 -0800 Subject: [vcpkg_cmd_arguments] Use std::string instead of char* --- toolsrc/include/vcpkg_cmd_arguments.h | 6 +++--- toolsrc/src/commands_cache.cpp | 2 +- toolsrc/src/commands_create.cpp | 4 ++-- toolsrc/src/commands_edit.cpp | 2 +- toolsrc/src/commands_hash.cpp | 4 ++-- toolsrc/src/commands_import.cpp | 2 +- toolsrc/src/commands_installation.cpp | 6 +++--- toolsrc/src/commands_integration.cpp | 2 +- toolsrc/src/commands_list.cpp | 2 +- toolsrc/src/commands_owns.cpp | 2 +- toolsrc/src/commands_portsdiff.cpp | 4 ++-- toolsrc/src/commands_remove.cpp | 2 +- toolsrc/src/commands_search.cpp | 2 +- toolsrc/src/vcpkg_cmd_arguments.cpp | 6 +++--- 14 files changed, 23 insertions(+), 23 deletions(-) diff --git a/toolsrc/include/vcpkg_cmd_arguments.h b/toolsrc/include/vcpkg_cmd_arguments.h index 95feb4814..2194e6d2c 100644 --- a/toolsrc/include/vcpkg_cmd_arguments.h +++ b/toolsrc/include/vcpkg_cmd_arguments.h @@ -24,11 +24,11 @@ namespace vcpkg std::unordered_set check_and_get_optional_command_arguments(const std::vector& valid_options) const; void check_max_arg_count(const size_t expected_arg_count) const; - void check_max_arg_count(const size_t expected_arg_count, const char* example_text) const; + void check_max_arg_count(const size_t expected_arg_count, const std::string& example_text) const; void check_min_arg_count(const size_t expected_arg_count) const; - void check_min_arg_count(const size_t expected_arg_count, const char* example_text) const; + void check_min_arg_count(const size_t expected_arg_count, const std::string& example_text) const; void check_exact_arg_count(const size_t expected_arg_count) const; - void check_exact_arg_count(const size_t expected_arg_count, const char* example_text) const; + void check_exact_arg_count(const size_t expected_arg_count, const std::string& example_text) const; private: std::unordered_set optional_command_arguments; diff --git a/toolsrc/src/commands_cache.cpp b/toolsrc/src/commands_cache.cpp index 19c762caf..f43b054a6 100644 --- a/toolsrc/src/commands_cache.cpp +++ b/toolsrc/src/commands_cache.cpp @@ -38,7 +38,7 @@ namespace vcpkg { 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")); - args.check_max_arg_count(1, example.c_str()); + args.check_max_arg_count(1, example); const std::vector binary_paragraphs = read_all_binary_paragraphs(paths); if (binary_paragraphs.empty()) diff --git a/toolsrc/src/commands_create.cpp b/toolsrc/src/commands_create.cpp index d1611eb5c..ad00cd676 100644 --- a/toolsrc/src/commands_create.cpp +++ b/toolsrc/src/commands_create.cpp @@ -9,8 +9,8 @@ namespace vcpkg 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")###"); - args.check_max_arg_count(3, example.c_str()); - args.check_min_arg_count(2, example.c_str()); + args.check_max_arg_count(3, example); + args.check_min_arg_count(2, example); const std::string port_name = args.command_arguments.at(0); Environment::ensure_utilities_on_path(paths); diff --git a/toolsrc/src/commands_edit.cpp b/toolsrc/src/commands_edit.cpp index f07a15875..fbf4eab62 100644 --- a/toolsrc/src/commands_edit.cpp +++ b/toolsrc/src/commands_edit.cpp @@ -7,7 +7,7 @@ namespace vcpkg void edit_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { static const std::string example = create_example_string("edit zlib"); - args.check_exact_arg_count(1, example.c_str()); + args.check_exact_arg_count(1, example); const std::string port_name = args.command_arguments.at(0); const fs::path portpath = paths.ports / port_name; diff --git a/toolsrc/src/commands_hash.cpp b/toolsrc/src/commands_hash.cpp index 17c191b78..42d1823fa 100644 --- a/toolsrc/src/commands_hash.cpp +++ b/toolsrc/src/commands_hash.cpp @@ -27,8 +27,8 @@ namespace vcpkg { 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")); - args.check_min_arg_count(1, example.c_str()); - args.check_max_arg_count(2, example.c_str()); + args.check_min_arg_count(1, example); + args.check_max_arg_count(2, example); if (args.command_arguments.size() == 1) { diff --git a/toolsrc/src/commands_import.cpp b/toolsrc/src/commands_import.cpp index e5e731799..3832f0e7b 100644 --- a/toolsrc/src/commands_import.cpp +++ b/toolsrc/src/commands_import.cpp @@ -78,7 +78,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)"); - args.check_exact_arg_count(3, example.c_str()); + args.check_exact_arg_count(3, example); const fs::path control_file_path(args.command_arguments[0]); const fs::path include_directory(args.command_arguments[1]); diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_installation.cpp index 1abd16796..c376d522f 100644 --- a/toolsrc/src/commands_installation.cpp +++ b/toolsrc/src/commands_installation.cpp @@ -216,7 +216,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"); - args.check_min_arg_count(1, example.c_str()); + args.check_min_arg_count(1, example); StatusParagraphs status_db = database_load_check(paths); std::vector specs = Input::check_and_get_package_specs(args.command_arguments, default_target_triplet, example.c_str()); @@ -276,7 +276,7 @@ namespace vcpkg // 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.c_str()); + args.check_exact_arg_count(1, example); StatusParagraphs status_db = database_load_check(paths); @@ -332,7 +332,7 @@ 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.c_str()); + 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()) diff --git a/toolsrc/src/commands_integration.cpp b/toolsrc/src/commands_integration.cpp index cd303c649..31f30f216 100644 --- a/toolsrc/src/commands_integration.cpp +++ b/toolsrc/src/commands_integration.cpp @@ -297,7 +297,7 @@ With a project open, go to Tools->NuGet Package Manager->Package Manager Console { static const std::string example = Strings::format("Commands:\n" "%s", INTEGRATE_COMMAND_HELPSTRING); - args.check_exact_arg_count(1, example.c_str()); + args.check_exact_arg_count(1, example); if (args.command_arguments[0] == "install") { diff --git a/toolsrc/src/commands_list.cpp b/toolsrc/src/commands_list.cpp index 2d6b42008..cc51232e9 100644 --- a/toolsrc/src/commands_list.cpp +++ b/toolsrc/src/commands_list.cpp @@ -17,7 +17,7 @@ namespace vcpkg { 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")); - args.check_max_arg_count(1, example.c_str()); + args.check_max_arg_count(1, example); const StatusParagraphs status_paragraphs = database_load_check(paths); std::vector installed_packages; diff --git a/toolsrc/src/commands_owns.cpp b/toolsrc/src/commands_owns.cpp index 45f073304..62dac57eb 100644 --- a/toolsrc/src/commands_owns.cpp +++ b/toolsrc/src/commands_owns.cpp @@ -24,7 +24,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")); - args.check_exact_arg_count(1, example.c_str()); + args.check_exact_arg_count(1, example); StatusParagraphs status_db = database_load_check(paths); search_file(paths, args.command_arguments[0], status_db); diff --git a/toolsrc/src/commands_portsdiff.cpp b/toolsrc/src/commands_portsdiff.cpp index b6b604e54..46c6c90c7 100644 --- a/toolsrc/src/commands_portsdiff.cpp +++ b/toolsrc/src/commands_portsdiff.cpp @@ -100,8 +100,8 @@ 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")); - args.check_min_arg_count(1, example.c_str()); - args.check_max_arg_count(2, example.c_str()); + args.check_min_arg_count(1, example); + args.check_max_arg_count(2, example); Environment::ensure_git_on_path(paths); const std::wstring git_commit_id_for_previous_snapshot = Strings::utf8_to_utf16(args.command_arguments.at(0)); diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index 31331fc2f..9d3352532 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -169,7 +169,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"); - args.check_min_arg_count(1, example.c_str()); + args.check_min_arg_count(1, example); const std::unordered_set options = args.check_and_get_optional_command_arguments({OPTION_PURGE}); auto status_db = database_load_check(paths); diff --git a/toolsrc/src/commands_search.cpp b/toolsrc/src/commands_search.cpp index a604c5383..a4714477e 100644 --- a/toolsrc/src/commands_search.cpp +++ b/toolsrc/src/commands_search.cpp @@ -43,7 +43,7 @@ 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")); - args.check_max_arg_count(1, example.c_str()); + args.check_max_arg_count(1, example); const std::vector source_paragraphs = read_all_source_paragraphs(paths); diff --git a/toolsrc/src/vcpkg_cmd_arguments.cpp b/toolsrc/src/vcpkg_cmd_arguments.cpp index d61e420ab..2cc1f811c 100644 --- a/toolsrc/src/vcpkg_cmd_arguments.cpp +++ b/toolsrc/src/vcpkg_cmd_arguments.cpp @@ -179,7 +179,7 @@ namespace vcpkg return check_exact_arg_count(expected_arg_count, ""); } - void vcpkg_cmd_arguments::check_max_arg_count(const size_t expected_arg_count, const char* example_text) const + void vcpkg_cmd_arguments::check_max_arg_count(const size_t expected_arg_count, const std::string& example_text) const { const size_t actual_arg_count = command_arguments.size(); if (actual_arg_count > expected_arg_count) @@ -190,7 +190,7 @@ namespace vcpkg } } - void vcpkg_cmd_arguments::check_min_arg_count(const size_t expected_arg_count, const char* example_text) const + void vcpkg_cmd_arguments::check_min_arg_count(const size_t expected_arg_count, const std::string& example_text) const { const size_t actual_arg_count = command_arguments.size(); if (actual_arg_count < expected_arg_count) @@ -201,7 +201,7 @@ namespace vcpkg } } - void vcpkg_cmd_arguments::check_exact_arg_count(const size_t expected_arg_count, const char* example_text) const + void vcpkg_cmd_arguments::check_exact_arg_count(const size_t expected_arg_count, const std::string& example_text) const { const size_t actual_arg_count = command_arguments.size(); if (actual_arg_count != expected_arg_count) -- cgit v1.2.3 From 852acbc2638c21d9639258417b8cd9fceed722c2 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 12 Dec 2016 15:05:49 -0800 Subject: [vcpkg_Input] Use std::string instead of char* --- toolsrc/include/vcpkg_Input.h | 4 ++-- toolsrc/src/commands_installation.cpp | 4 ++-- toolsrc/src/commands_remove.cpp | 2 +- toolsrc/src/vcpkg_Input.cpp | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/toolsrc/include/vcpkg_Input.h b/toolsrc/include/vcpkg_Input.h index bbf3adfbf..5ce90e3b9 100644 --- a/toolsrc/include/vcpkg_Input.h +++ b/toolsrc/include/vcpkg_Input.h @@ -5,9 +5,9 @@ namespace vcpkg {namespace Input { - package_spec check_and_get_package_spec(const std::string& package_spec_as_string, const triplet& default_target_triplet, const char* example_text); + package_spec check_and_get_package_spec(const std::string& package_spec_as_string, const triplet& default_target_triplet, const std::string& example_text); - std::vector check_and_get_package_specs(const std::vector& package_specs_as_strings, const triplet& default_target_triplet, const char* example_text); + std::vector check_and_get_package_specs(const std::vector& package_specs_as_strings, const triplet& default_target_triplet, const std::string& example_text); void check_triplet(const triplet& t, const vcpkg_paths& paths); diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_installation.cpp index c376d522f..c7bac3fc1 100644 --- a/toolsrc/src/commands_installation.cpp +++ b/toolsrc/src/commands_installation.cpp @@ -219,7 +219,7 @@ namespace vcpkg args.check_min_arg_count(1, example); StatusParagraphs status_db = database_load_check(paths); - std::vector specs = Input::check_and_get_package_specs(args.command_arguments, default_target_triplet, example.c_str()); + std::vector specs = Input::check_and_get_package_specs(args.command_arguments, default_target_triplet, example); Input::check_triplets(specs, paths); std::vector install_plan = Dependencies::create_install_plan(paths, specs, status_db); Checks::check_exit(!install_plan.empty(), "Install plan cannot be empty"); @@ -280,7 +280,7 @@ namespace vcpkg 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.c_str()); + 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}); diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index 9d3352532..445213fc2 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -174,7 +174,7 @@ namespace vcpkg const std::unordered_set options = args.check_and_get_optional_command_arguments({OPTION_PURGE}); auto status_db = database_load_check(paths); - std::vector specs = Input::check_and_get_package_specs(args.command_arguments, default_target_triplet, example.c_str()); + std::vector specs = Input::check_and_get_package_specs(args.command_arguments, default_target_triplet, example); Input::check_triplets(specs, paths); bool alsoRemoveFolderFromPackages = options.find(OPTION_PURGE) != options.end(); diff --git a/toolsrc/src/vcpkg_Input.cpp b/toolsrc/src/vcpkg_Input.cpp index f7aae1929..29d487fdb 100644 --- a/toolsrc/src/vcpkg_Input.cpp +++ b/toolsrc/src/vcpkg_Input.cpp @@ -5,7 +5,7 @@ namespace vcpkg {namespace Input { - package_spec check_and_get_package_spec(const std::string& package_spec_as_string, const triplet& default_target_triplet, const char* example_text) + package_spec check_and_get_package_spec(const std::string& package_spec_as_string, const triplet& default_target_triplet, const std::string& example_text) { const std::string as_lowercase = Strings::ascii_to_lowercase(package_spec_as_string); expected expected_spec = package_spec::from_string(as_lowercase, default_target_triplet); @@ -20,7 +20,7 @@ namespace vcpkg {namespace Input exit(EXIT_FAILURE); } - std::vector check_and_get_package_specs(const std::vector& package_specs_as_strings, const triplet& default_target_triplet, const char* example_text) + std::vector check_and_get_package_specs(const std::vector& package_specs_as_strings, const triplet& default_target_triplet, const std::string& example_text) { std::vector specs; for (const std::string& spec : package_specs_as_strings) -- cgit v1.2.3 From c77be8f221dbbb7b38c74ce382be9b4dbb4d296b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 12 Dec 2016 15:08:26 -0800 Subject: [vcpkg_System] Add missing const keywords --- toolsrc/include/vcpkg_System.h | 12 ++++++------ toolsrc/src/vcpkg_System.cpp | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/toolsrc/include/vcpkg_System.h b/toolsrc/include/vcpkg_System.h index ca81235ed..1101c9b27 100644 --- a/toolsrc/include/vcpkg_System.h +++ b/toolsrc/include/vcpkg_System.h @@ -36,8 +36,8 @@ namespace vcpkg {namespace System void print(const char* message); void println(const char* message); - void print(color c, const char* message); - void println(color c, const char* message); + void print(const color c, const char* message); + void println(const color c, const char* message); inline void print(const std::string& message) { @@ -49,12 +49,12 @@ namespace vcpkg {namespace System return println(message.c_str()); } - inline void print(color c, const std::string& message) + inline void print(const color c, const std::string& message) { return print(c, message.c_str()); } - inline void println(color c, const std::string& message) + inline void println(const color c, const std::string& message) { return println(c, message.c_str()); } @@ -66,7 +66,7 @@ namespace vcpkg {namespace System } template - void print(color c, const char* messageTemplate, const Args&... messageArgs) + void print(const color c, const char* messageTemplate, const Args&... messageArgs) { return print(c, Strings::format(messageTemplate, messageArgs...).c_str()); } @@ -78,7 +78,7 @@ namespace vcpkg {namespace System } template - void println(color c, const char* messageTemplate, const Args&... messageArgs) + void println(const color c, const char* messageTemplate, const Args&... messageArgs) { return println(c, Strings::format(messageTemplate, messageArgs...).c_str()); } diff --git a/toolsrc/src/vcpkg_System.cpp b/toolsrc/src/vcpkg_System.cpp index cb3eb6584..43eae3412 100644 --- a/toolsrc/src/vcpkg_System.cpp +++ b/toolsrc/src/vcpkg_System.cpp @@ -56,7 +56,7 @@ namespace vcpkg {namespace System std::cout << "\n"; } - void print(color c, const char* message) + void print(const color c, const char* message) { HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); @@ -69,7 +69,7 @@ namespace vcpkg {namespace System SetConsoleTextAttribute(hConsole, original_color); } - void println(color c, const char* message) + void println(const color c, const char* message) { print(c, message); std::cout << "\n"; -- cgit v1.2.3 From 9796e2532cc34896e38a6c0702e538454ffb5586 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 12 Dec 2016 15:10:29 -0800 Subject: Use System::println(std::string&) overload --- toolsrc/src/commands_cache.cpp | 4 ++-- toolsrc/src/commands_hash.cpp | 2 +- toolsrc/src/commands_other.cpp | 2 +- toolsrc/src/vcpkg_cmd_arguments.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/toolsrc/src/commands_cache.cpp b/toolsrc/src/commands_cache.cpp index f43b054a6..17b04b093 100644 --- a/toolsrc/src/commands_cache.cpp +++ b/toolsrc/src/commands_cache.cpp @@ -52,7 +52,7 @@ namespace vcpkg for (const BinaryParagraph& binary_paragraph : binary_paragraphs) { const std::string displayname = binary_paragraph.displayname(); - System::println(displayname.c_str()); + System::println(displayname); } } else @@ -66,7 +66,7 @@ namespace vcpkg continue; } - System::println(displayname.c_str()); + System::println(displayname); } } diff --git a/toolsrc/src/commands_hash.cpp b/toolsrc/src/commands_hash.cpp index 42d1823fa..0e3e8a77c 100644 --- a/toolsrc/src/commands_hash.cpp +++ b/toolsrc/src/commands_hash.cpp @@ -20,7 +20,7 @@ namespace vcpkg auto hash = output.substr(start, end - start); hash.erase(std::remove_if(hash.begin(), hash.end(), isspace), hash.end()); - System::println(hash.c_str()); + System::println(hash); } void hash_command(const vcpkg_cmd_arguments& args) diff --git a/toolsrc/src/commands_other.cpp b/toolsrc/src/commands_other.cpp index bb1768048..16b697952 100644 --- a/toolsrc/src/commands_other.cpp +++ b/toolsrc/src/commands_other.cpp @@ -50,7 +50,7 @@ namespace vcpkg void print_example(const char* command_and_arguments) { - System::println(create_example_string(command_and_arguments).c_str()); + System::println(create_example_string(command_and_arguments)); } void internal_test_command(const vcpkg_cmd_arguments& /*args*/, const vcpkg_paths& /*paths*/) diff --git a/toolsrc/src/vcpkg_cmd_arguments.cpp b/toolsrc/src/vcpkg_cmd_arguments.cpp index 2cc1f811c..a3648668f 100644 --- a/toolsrc/src/vcpkg_cmd_arguments.cpp +++ b/toolsrc/src/vcpkg_cmd_arguments.cpp @@ -156,7 +156,7 @@ namespace vcpkg System::println(System::color::error, "Unknown option(s) for command '%s':", this->command); for (const std::string& option : options_copy) { - System::println(option.c_str()); + System::println(option); } exit(EXIT_FAILURE); } -- cgit v1.2.3 From e523668cce29745d8024dd5d56ee1d705da24a49 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 12 Dec 2016 15:13:24 -0800 Subject: Change signature to std::string& (from char*) --- toolsrc/include/vcpkg_Commands.h | 4 ++-- toolsrc/src/commands_installation.cpp | 2 +- toolsrc/src/commands_other.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index 8272929a7..fd427fd40 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -8,8 +8,8 @@ namespace vcpkg extern const char*const INTEGRATE_COMMAND_HELPSTRING; void print_usage(); - void print_example(const char* command_and_arguments); - std::string create_example_string(const char* command_and_arguments); + void print_example(const std::string& command_and_arguments); + std::string create_example_string(const std::string& command_and_arguments); void update_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); void build_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_installation.cpp index c7bac3fc1..fd318d2e7 100644 --- a/toolsrc/src/commands_installation.cpp +++ b/toolsrc/src/commands_installation.cpp @@ -349,7 +349,7 @@ namespace vcpkg } 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).c_str()); + print_example(Strings::format("%s zlib:x64-windows", args.command)); exit(EXIT_FAILURE); } } diff --git a/toolsrc/src/commands_other.cpp b/toolsrc/src/commands_other.cpp index 16b697952..6df325100 100644 --- a/toolsrc/src/commands_other.cpp +++ b/toolsrc/src/commands_other.cpp @@ -41,14 +41,14 @@ namespace vcpkg , INTEGRATE_COMMAND_HELPSTRING); } - std::string create_example_string(const char* command_and_arguments) + 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 char* command_and_arguments) + void print_example(const std::string& command_and_arguments) { System::println(create_example_string(command_and_arguments)); } -- cgit v1.2.3 From dd8cbba38b9b2c6443dcd35bd1cd070a26ba7990 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 12 Dec 2016 18:13:32 -0800 Subject: Update CHANGELOG and bump version to v0.0.65 --- CHANGELOG.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ toolsrc/VERSION.txt | 2 +- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4e056cdc..464d5c3e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,48 @@ +vcpkg (0.0.65) +-------------- + * Add ports: + - anax 2.1.0-1 + - aws-sdk-cpp 1.0.34-1 + - azure-storage-cpp 2.5.0 + - charls 2.0.0 + - dimcli 1.0.3 + - entityx 1.2.0 + - freeimage 3.17.0 + - gdal 1.11.3 + - globjects 1.0.0 + - http-parser 2.7.1 + - icu 58.1 + - libflac 1.3.1-1 + - libssh2 1.8.0 + - nana 1.4.1 + - qca 2.2.0 + - sfml 2.4.1 + - shaderc 2df47b51d83ad83cbc2e7f8ff2b56776293e8958 + - uwebsockets 0.12.0 + - yaml-cpp 0.5.4 candidate + * Update ports: + - boost 1.62-6 -> 1.62-8 + - curl 7.51.0-1 -> 7.51.0-2 + - gflags 2.1.2 -> 2.2.0-2 + - glbinding 2.1.1 -> 2.1.1-1 + - glslang 1c573fbcfba6b3d631008b1babc838501ca925d3 -> 1c573fbcfba6b3d631008b1babc838501ca925d3-1 + - harfbuzz 1.3.2 -> 1.3.4 + - jxrlib 1.1-1 -> 1.1-2 + - libraw 0.17.2 -> 0.17.2-2 + - lua 5.3.3 -> 5.3.3-1 + - openssl 1.0.2j -> 1.0.2j-1 + * Improvements in the post-build checks: + - Add check for files in the `\` dir and `\debug\` dir + * Introduce pre-install checks: + - The `install` command now checks that files will not be overwrriten when installing a package. A particular file can only be owned by a single package + * Introduce 'lib\manul-link\' directory. Libraries placing the lib files in that directory are not automatically added to the link line + * Disable all interactions with CMake registry + * `vcpkg /?` is now a valid equivalent of `vcpkg help` + * Fixes and improvements in existing portfiles and the `vcpkg` tool itself + +-- vcpkg team MON, 12 Dec 2016 18:15:00 -0800 + + vcpkg (0.0.61) -------------- * Add ports: diff --git a/toolsrc/VERSION.txt b/toolsrc/VERSION.txt index 7d83b8c7b..1c65f15d9 100644 --- a/toolsrc/VERSION.txt +++ b/toolsrc/VERSION.txt @@ -1 +1 @@ -"0.0.61" \ No newline at end of file +"0.0.65" \ No newline at end of file -- cgit v1.2.3 From c9b310c16528c907ab12bcc5ec9a0f5795ebf29f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 13 Dec 2016 16:35:06 -0800 Subject: Minor code clarity change --- toolsrc/src/commands_installation.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_installation.cpp index fd318d2e7..35c29b6a8 100644 --- a/toolsrc/src/commands_installation.cpp +++ b/toolsrc/src/commands_installation.cpp @@ -161,7 +161,9 @@ namespace vcpkg const size_t package_remove_char_count = package_dir.generic_string().size() + 1; // +1 for the slash std::transform(package_file_paths.cbegin(), package_file_paths.cend(), std::back_inserter(package_files), [package_remove_char_count](const fs::path& path) { - return path.generic_string().erase(0, package_remove_char_count); + std::string as_string = path.generic_string(); + as_string.erase(0, package_remove_char_count); + return std::move(as_string); }); std::sort(package_files.begin(), package_files.end()); -- cgit v1.2.3 From b1681d0838fdc3a3bd361e5678d23d2376a3edbd Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 13 Dec 2016 19:02:02 -0800 Subject: Avoid copying struct --- toolsrc/src/vcpkg.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index 88b05b0a9..74b02e612 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -161,8 +161,8 @@ std::vector vcpkg::get_installed_files(con }), installed_files_of_current_pgh.end()); - const StatusParagraph_and_associated_files pgh_and_files = {*pgh, std::move(installed_files_of_current_pgh)}; - installed_files.push_back(pgh_and_files); + StatusParagraph_and_associated_files pgh_and_files = {*pgh, std::move(installed_files_of_current_pgh)}; + installed_files.push_back(std::move(pgh_and_files)); } return installed_files; -- cgit v1.2.3 From 6fbd2ad7805fcf996f01c29d9b11d0c5e91a8971 Mon Sep 17 00:00:00 2001 From: Axel Barrot Date: Wed, 14 Dec 2016 15:58:00 +0100 Subject: support lcms library (http://www.littlecms.com/download.html) --- ports/lcms/CMakeLists.txt | 65 +++++++++++++++++++++++++++++++++++++++++++++++ ports/lcms/CONTROL | 4 +++ ports/lcms/portfile.cmake | 31 ++++++++++++++++++++++ 3 files changed, 100 insertions(+) create mode 100644 ports/lcms/CMakeLists.txt create mode 100644 ports/lcms/CONTROL create mode 100644 ports/lcms/portfile.cmake diff --git a/ports/lcms/CMakeLists.txt b/ports/lcms/CMakeLists.txt new file mode 100644 index 000000000..8c43a2ea3 --- /dev/null +++ b/ports/lcms/CMakeLists.txt @@ -0,0 +1,65 @@ +cmake_minimum_required(VERSION 3.5) + +project(lcms) + +option(SHARED_LIBRARY "use shared library" ON) + +set(LIBRARY_TYPE STATIC) +if(SHARED_LIBRARY) + set(LIBRARY_TYPE SHARED) +endif(SHARED_LIBRARY) + +set(SRCS +"src/cmstypes.c" +"src/cmsvirt.c" +"src/cmswtpnt.c" +"src/cmsxform.c" +"src/lcms2.def" +"src/lcms2_internal.h" +"src/cmsalpha.c" +"src/cmscam02.c" +"src/cmscgats.c" +"src/cmscnvrt.c" +"src/cmserr.c" +"src/cmsgamma.c" +"src/cmsgmt.c" +"src/cmshalf.c" +"src/cmsintrp.c" +"src/cmsio0.c" +"src/cmsio1.c" +"src/cmslut.c" +"src/cmsmd5.c" +"src/cmsmtrx.c" +"src/cmsnamed.c" +"src/cmsopt.c" +"src/cmspack.c" +"src/cmspcs.c" +"src/cmsplugin.c" +"src/cmsps2.c" +"src/cmssamp.c" +"src/cmssm.c" +) + +include_directories( +"./include" +) + +add_library(lcms ${LIBRARY_TYPE} +${SRCS} +) + +if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL ) + + install(FILES + "./include/lcms2.h" + "./include/lcms2_plugin.h" + DESTINATION include + ) + +endif(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL ) + +install(TARGETS lcms EXPORT lcms_EXPORT + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) diff --git a/ports/lcms/CONTROL b/ports/lcms/CONTROL new file mode 100644 index 000000000..64567fddd --- /dev/null +++ b/ports/lcms/CONTROL @@ -0,0 +1,4 @@ +Source: lcms +Version: 2.8 +Build-Depends: +Description: Little CMS. \ No newline at end of file diff --git a/ports/lcms/portfile.cmake b/ports/lcms/portfile.cmake new file mode 100644 index 000000000..5c6926071 --- /dev/null +++ b/ports/lcms/portfile.cmake @@ -0,0 +1,31 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/lcms2-2.8) + +vcpkg_download_distfile(ARCHIVE + URLS "https://sourceforge.net/projects/lcms/files/lcms/2.8/lcms2-2.8.tar.gz/download" + #URLS "C:/Users/d3r55d/Downloads/lcms2-2.8.tar.gz" + FILENAME "lcms2-2.8.tar.gz" + SHA512 a9478885b4892c79314a2ef9ab560e6655ac8f2d17abae0805e8b871138bb190e21f0e5c805398449f9dad528dc50baaf9e3cce8b8158eb8ff74179be5733f8f +) +vcpkg_extract_source_archive(${ARCHIVE}) +message(STATUS ${SOURCE_PATH}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +set(USE_SHARED_LIBRARY OFF) +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(USE_SHARED_LIBRARY ON) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DSHARED_LIBRARY=${USE_SHARED_LIBRARY} + OPTIONS_DEBUG + -DSKIP_INSTALL_HEADERS=ON +) + +vcpkg_install_cmake() + +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/lcms RENAME copyright) + +vcpkg_copy_pdbs() -- cgit v1.2.3 From 6507a1ea321effda7c0c2ffc8cdc4982bac1b5d5 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 14 Dec 2016 12:25:34 -0800 Subject: [boost] Bump version --- ports/boost/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/boost/CONTROL b/ports/boost/CONTROL index ab7f87cc1..9e2afdf8a 100644 --- a/ports/boost/CONTROL +++ b/ports/boost/CONTROL @@ -1,4 +1,4 @@ Source: boost -Version: 1.62-8 +Version: 1.62-9 Description: Peer-reviewed portable C++ source libraries Build-Depends: zlib -- cgit v1.2.3 From 5d54e079f7096251208d9b745cf865327110f849 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 14 Dec 2016 16:51:05 -0800 Subject: Refactor writing of listfile --- toolsrc/src/commands_installation.cpp | 36 +++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_installation.cpp index 35c29b6a8..e61a2dbfe 100644 --- a/toolsrc/src/commands_installation.cpp +++ b/toolsrc/src/commands_installation.cpp @@ -69,16 +69,16 @@ namespace vcpkg static void install_and_write_listfile(const vcpkg_paths& paths, const BinaryParagraph& bpgh) { - std::fstream listfile(paths.listfile_path(bpgh), std::ios_base::out | std::ios_base::binary | std::ios_base::trunc); + std::vector output; - auto package_prefix_path = paths.package_dir(bpgh.spec); - auto prefix_length = package_prefix_path.native().size(); + const fs::path package_prefix_path = paths.package_dir(bpgh.spec); + const size_t prefix_length = package_prefix_path.native().size(); const triplet& target_triplet = bpgh.spec.target_triplet(); const std::string& target_triplet_as_string = target_triplet.canonical_name(); std::error_code ec; fs::create_directory(paths.installed / target_triplet_as_string, ec); - listfile << target_triplet << "\n"; + output.push_back(Strings::format(R"(%s)", target_triplet_as_string)); for (auto it = fs::recursive_directory_iterator(package_prefix_path); it != fs::recursive_directory_iterator(); ++it) { @@ -89,8 +89,8 @@ namespace vcpkg continue; } - auto suffix = it->path().generic_u8string().substr(prefix_length + 1); - auto target = paths.installed / target_triplet_as_string / suffix; + const std::string suffix = it->path().generic_u8string().substr(prefix_length + 1); + const fs::path target = paths.installed / target_triplet_as_string / suffix; auto status = it->status(ec); if (ec) @@ -98,6 +98,7 @@ namespace vcpkg System::println(System::color::error, "failed: %s: %s", it->path().u8string(), ec.message()); continue; } + if (fs::is_directory(status)) { fs::create_directory(target, ec); @@ -106,25 +107,36 @@ namespace vcpkg System::println(System::color::error, "failed: %s: %s", target.u8string(), ec.message()); } - listfile << target_triplet << "/" << suffix << "\n"; + // Trailing backslash for directories + output.push_back(Strings::format(R"(%s/%s)", target_triplet_as_string, suffix)); + continue; } - else if (fs::is_regular_file(status)) + + if (fs::is_regular_file(status)) { fs::copy_file(*it, target, ec); if (ec) { System::println(System::color::error, "failed: %s: %s", target.u8string(), ec.message()); } - listfile << target_triplet << "/" << suffix << "\n"; + output.push_back(Strings::format(R"(%s/%s)", target_triplet_as_string, suffix)); + continue; } - else if (!fs::status_known(status)) + + if (!fs::status_known(status)) { System::println(System::color::error, "failed: %s: unknown status", it->path().u8string()); + continue; } - else - System::println(System::color::error, "failed: %s: cannot handle file type", it->path().u8string()); + + System::println(System::color::error, "failed: %s: cannot handle file type", it->path().u8string()); } + std::fstream listfile(paths.listfile_path(bpgh), std::ios_base::out | std::ios_base::binary | std::ios_base::trunc); + for (const std::string& line : output) + { + listfile << line << "\n"; + } listfile.close(); } -- cgit v1.2.3 From 0b62c9ce911a8a86ea7cee9e1c323b61d7b313a6 Mon Sep 17 00:00:00 2001 From: agadoul Date: Thu, 15 Dec 2016 09:12:00 +0100 Subject: fix warning due to encoding. --- ports/lcms/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/lcms/CMakeLists.txt b/ports/lcms/CMakeLists.txt index 8c43a2ea3..e78b9b6b6 100644 --- a/ports/lcms/CMakeLists.txt +++ b/ports/lcms/CMakeLists.txt @@ -40,6 +40,9 @@ set(SRCS "src/cmssm.c" ) +add_definitions(-DUNICODE -D_UNICODE) +#string(REPLACE "/utf-8" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + include_directories( "./include" ) -- cgit v1.2.3 From 9e34484cbe2e9de1deb16cd2ca4e1faea456aa77 Mon Sep 17 00:00:00 2001 From: agadoul Date: Thu, 15 Dec 2016 13:16:55 +0100 Subject: uncomment removal of utf-8 flag --- ports/lcms/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/lcms/CMakeLists.txt b/ports/lcms/CMakeLists.txt index e78b9b6b6..85807a0b9 100644 --- a/ports/lcms/CMakeLists.txt +++ b/ports/lcms/CMakeLists.txt @@ -41,7 +41,7 @@ set(SRCS ) add_definitions(-DUNICODE -D_UNICODE) -#string(REPLACE "/utf-8" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") +string(REPLACE "/utf-8" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") include_directories( "./include" -- cgit v1.2.3 From 786d591cc363dcbba1e47bd148f31eba2197bba9 Mon Sep 17 00:00:00 2001 From: codicodi Date: Thu, 15 Dec 2016 21:11:27 +0100 Subject: [fastlz] specify correct source path --- ports/fastlz/portfile.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ports/fastlz/portfile.cmake b/ports/fastlz/portfile.cmake index 5b28df291..c9198f0f2 100644 --- a/ports/fastlz/portfile.cmake +++ b/ports/fastlz/portfile.cmake @@ -1,7 +1,8 @@ +set(FASTLZ_HASH f1217348a868bdb9ee0730244475aee05ab329c5) include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/FastLZ-master) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/FastLZ-${FASTLZ_HASH}) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/ariya/FastLZ/archive/f1217348a868bdb9ee0730244475aee05ab329c5.zip" + URLS "https://github.com/ariya/FastLZ/archive/${FASTLZ_HASH}.zip" FILENAME "fastlz.zip" SHA512 edfefbf4151e7ea6451a6fbb6d464a2a0f48ab50622f936634ec3ea4542ad3e1f075892a422e0fc5a23f2092be4ec890e6f91c4622bcd0d195fed84d4044d5df ) -- cgit v1.2.3 From 43262d24daa44a418c77bff87ee537a47344bb77 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 15 Dec 2016 13:30:48 -0800 Subject: [fastlz] Name downloaded archive to avoid conflicts with future versions --- ports/fastlz/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/fastlz/portfile.cmake b/ports/fastlz/portfile.cmake index c9198f0f2..16a727246 100644 --- a/ports/fastlz/portfile.cmake +++ b/ports/fastlz/portfile.cmake @@ -3,7 +3,7 @@ include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/FastLZ-${FASTLZ_HASH}) vcpkg_download_distfile(ARCHIVE URLS "https://github.com/ariya/FastLZ/archive/${FASTLZ_HASH}.zip" - FILENAME "fastlz.zip" + FILENAME "fastlz-${FASTLZ_HASH}.zip" SHA512 edfefbf4151e7ea6451a6fbb6d464a2a0f48ab50622f936634ec3ea4542ad3e1f075892a422e0fc5a23f2092be4ec890e6f91c4622bcd0d195fed84d4044d5df ) vcpkg_extract_source_archive(${ARCHIVE}) -- cgit v1.2.3 From 88daca5f547d00d58637a501c10c57e823771a02 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 15 Dec 2016 14:28:43 -0800 Subject: [listfile] When reading a listfile, add / at the end of directories --- toolsrc/src/vcpkg.cpp | 98 +++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 84 insertions(+), 14 deletions(-) diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index 74b02e612..6f1d30bc5 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -10,6 +10,7 @@ #include "vcpkg_Files.h" #include "Paragraphs.h" #include +#include "metrics.h" using namespace vcpkg; @@ -109,6 +110,82 @@ void vcpkg::write_update(const vcpkg_paths& paths, const StatusParagraph& p) fs::rename(tmp_update_filename, update_filename); } +static void upgrade_to_slash_terminated_sorted_format(std::vector* lines, const fs::path& listfile_path) +{ + static bool was_tracked = false; + + if (lines->empty()) + { + return; + } + + if (lines->at(0).back() == '/') + { + return; // File already in the new format + } + + if (!was_tracked) + { + was_tracked = true; + TrackProperty("listfile", "update to new format"); + } + + // The files are sorted such that directories are placed just before the files they contain + // (They are not necessarily sorted alphabetically, e.g. libflac) + // Therefore we can detect the entries that represent directories by comparing every element with the next one + // and checking if the next has a slash immediately after the current one's length + for (int i = 0; i < lines->size() - 1; i++) + { + std::string& current_string = lines->at(i); + const std::string& next_string = lines->at(i + 1); + + const size_t potential_slash_char_index = current_string.length(); + // Make sure the index exists first + if (next_string.size() > potential_slash_char_index && next_string.at(potential_slash_char_index) == '/') + { + current_string += '/'; // Mark as a directory + } + } + + // After suffixing the directories with a slash, we can now sort. + // We cannot sort before adding the suffixes because the following (actual example): + /* + x86-windows/include/FLAC <<<<<< This would be separated from its group due to sorting + x86-windows/include/FLAC/all.h + x86-windows/include/FLAC/assert.h + x86-windows/include/FLAC/callback.h + x86-windows/include/FLAC++ + x86-windows/include/FLAC++/all.h + x86-windows/include/FLAC++/decoder.h + x86-windows/include/FLAC++/encoder.h + * + x86-windows/include/FLAC/ <<<<<< This will now be kept with its group when sorting + x86-windows/include/FLAC/all.h + x86-windows/include/FLAC/assert.h + x86-windows/include/FLAC/callback.h + x86-windows/include/FLAC++/ + x86-windows/include/FLAC++/all.h + x86-windows/include/FLAC++/decoder.h + x86-windows/include/FLAC++/encoder.h + */ + // Note that after sorting, the FLAC++/ group will be placed before the FLAC/ group + // The new format is lexicographically sorted + std::sort(lines->begin(), lines->end()); + +#if 0 + // Replace the listfile on disk + const fs::path updated_listfile_path = listfile_path.generic_string() + "_updated"; + std::fstream output(updated_listfile_path, std::ios_base::out | std::ios_base::binary | std::ios_base::trunc); + for (const std::string& line : *lines) + { + output << line << "\n"; + } + output.close(); + + fs::rename(updated_listfile_path, listfile_path); +#endif +} + std::vector vcpkg::get_installed_files(const vcpkg_paths& paths, const StatusParagraphs& status_db) { static const std::string MARK_FOR_REMOVAL = ""; @@ -124,7 +201,8 @@ std::vector vcpkg::get_installed_files(con continue; } - std::fstream listfile(paths.listfile_path(pgh->package)); + const fs::path listfile_path = paths.listfile_path(pgh->package); + std::fstream listfile(listfile_path); std::vector installed_files_of_current_pgh; while (std::getline(listfile, line)) @@ -136,22 +214,14 @@ std::vector vcpkg::get_installed_files(con installed_files_of_current_pgh.push_back(line); } + listfile.close(); + upgrade_to_slash_terminated_sorted_format(&installed_files_of_current_pgh, listfile_path); - // Should already be sorted - std::sort(installed_files_of_current_pgh.begin(), installed_files_of_current_pgh.end()); - - // Since the files are sorted, we can detect the entries that represent directories - // by comparing every element with the next one and checking if the next has a slash immediately after the current one's length - for (int i = 1; i < installed_files_of_current_pgh.size(); i++) + for (std::string& file : installed_files_of_current_pgh) { - std::string& current_string = installed_files_of_current_pgh.at(i - 1); - const std::string& next_string = installed_files_of_current_pgh.at(i); - - const size_t potential_slash_char_index = current_string.length(); - // Make sure the index exists first - if (next_string.size() > potential_slash_char_index && next_string.at(potential_slash_char_index) == '/') + if (file.back() == '/') { - current_string = MARK_FOR_REMOVAL; + file = MARK_FOR_REMOVAL; } } -- cgit v1.2.3 From 8f397bb8d1bd05a2e1f6d5de808322364100ae5d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 15 Dec 2016 17:09:14 -0800 Subject: Add Strings::trim() function --- toolsrc/include/vcpkg_Strings.h | 4 ++++ toolsrc/src/vcpkg_Strings.cpp | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/toolsrc/include/vcpkg_Strings.h b/toolsrc/include/vcpkg_Strings.h index 859da5658..92c24298c 100644 --- a/toolsrc/include/vcpkg_Strings.h +++ b/toolsrc/include/vcpkg_Strings.h @@ -69,4 +69,8 @@ namespace vcpkg {namespace Strings std::string ascii_to_lowercase(const std::string& input); std::string join(const std::vector& v, const std::string& delimiter); + + void trim(std::string* s); + + std::string trimmed(const std::string& s); }} diff --git a/toolsrc/src/vcpkg_Strings.cpp b/toolsrc/src/vcpkg_Strings.cpp index 19ba8595f..4859a480b 100644 --- a/toolsrc/src/vcpkg_Strings.cpp +++ b/toolsrc/src/vcpkg_Strings.cpp @@ -4,9 +4,16 @@ #include #include #include +#include +#include namespace vcpkg {namespace Strings {namespace details { + static const auto isspace = [](const char c) + { + return std::isspace(c); + }; + std::string format_internal(const char* fmtstr, ...) { va_list lst; @@ -85,4 +92,17 @@ namespace vcpkg {namespace Strings return output; } + + void trim(std::string* s) + { + s->erase(s->begin(), std::find_if_not(s->begin(), s->end(), details::isspace)); + s->erase(std::find_if_not(s->rbegin(), s->rend(), details::isspace).base(), s->end()); + } + + std::string trimmed(const std::string& s) + { + auto whitespace_front = std::find_if_not(s.begin(), s.end(), details::isspace); + auto whitespace_back = std::find_if_not(s.rbegin(), s.rend(), details::isspace).base(); + return (whitespace_back <= whitespace_front ? std::string() : std::string(whitespace_front, whitespace_back)); + } }} -- cgit v1.2.3 From e4548a8cf46b20b8e89ab75ee9201e3b244484ba Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 15 Dec 2016 18:19:22 -0800 Subject: Add Files::read_all_lines() and Files::write_all_lines() --- toolsrc/include/vcpkg_Files.h | 4 ++++ toolsrc/src/vcpkg_Files.cpp | 29 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/toolsrc/include/vcpkg_Files.h b/toolsrc/include/vcpkg_Files.h index 8b320303d..5e788f7be 100644 --- a/toolsrc/include/vcpkg_Files.h +++ b/toolsrc/include/vcpkg_Files.h @@ -14,6 +14,10 @@ namespace vcpkg {namespace Files expected get_contents(const fs::path& file_path) noexcept; + expected> read_all_lines(const fs::path& file_path); + + void write_all_lines(const fs::path& file_path, const std::vector& lines); + fs::path find_file_recursively_up(const fs::path& starting_dir, const std::string& filename); template diff --git a/toolsrc/src/vcpkg_Files.cpp b/toolsrc/src/vcpkg_Files.cpp index 698579736..889ceb055 100644 --- a/toolsrc/src/vcpkg_Files.cpp +++ b/toolsrc/src/vcpkg_Files.cpp @@ -42,6 +42,35 @@ namespace vcpkg {namespace Files return std::move(output); } + expected> read_all_lines(const fs::path& file_path) + { + std::fstream file_stream(file_path, std::ios_base::in | std::ios_base::binary); + if (file_stream.fail()) + { + return std::errc::no_such_file_or_directory; + } + + std::vector output; + std::string line; + while (std::getline(file_stream, line)) + { + output.push_back(line); + } + file_stream.close(); + + return std::move(output); + } + + void write_all_lines(const fs::path& file_path, const std::vector& lines) + { + std::fstream output(file_path, std::ios_base::out | std::ios_base::binary | std::ios_base::trunc); + for (const std::string& line : lines) + { + output << line << "\n"; + } + output.close(); + } + fs::path find_file_recursively_up(const fs::path& starting_dir, const std::string& filename) { fs::path current_dir = starting_dir; -- cgit v1.2.3 From 15ca6919ad7d5dd86596603663845b3ea84d0d3b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 15 Dec 2016 18:24:06 -0800 Subject: Use Files::write_all_lines() --- toolsrc/src/commands_installation.cpp | 7 +------ toolsrc/src/vcpkg.cpp | 8 +------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_installation.cpp index e61a2dbfe..605343dfc 100644 --- a/toolsrc/src/commands_installation.cpp +++ b/toolsrc/src/commands_installation.cpp @@ -132,12 +132,7 @@ namespace vcpkg System::println(System::color::error, "failed: %s: cannot handle file type", it->path().u8string()); } - std::fstream listfile(paths.listfile_path(bpgh), std::ios_base::out | std::ios_base::binary | std::ios_base::trunc); - for (const std::string& line : output) - { - listfile << line << "\n"; - } - listfile.close(); + Files::write_all_lines(paths.listfile_path(bpgh), output); } static void remove_first_n_chars(std::vector* strings, const size_t n) diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index 6f1d30bc5..98c53f9ef 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -175,13 +175,7 @@ static void upgrade_to_slash_terminated_sorted_format(std::vector* #if 0 // Replace the listfile on disk const fs::path updated_listfile_path = listfile_path.generic_string() + "_updated"; - std::fstream output(updated_listfile_path, std::ios_base::out | std::ios_base::binary | std::ios_base::trunc); - for (const std::string& line : *lines) - { - output << line << "\n"; - } - output.close(); - + Files::write_all_lines(updated_listfile_path, *lines); fs::rename(updated_listfile_path, listfile_path); #endif } -- cgit v1.2.3 From 38859d5c91c6411fb2b0757a68fd3ca297927650 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 15 Dec 2016 18:41:01 -0800 Subject: Improve code that filters out the directories from a vector of paths --- toolsrc/src/vcpkg.cpp | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index 98c53f9ef..8d01cb267 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -182,8 +182,6 @@ static void upgrade_to_slash_terminated_sorted_format(std::vector* std::vector vcpkg::get_installed_files(const vcpkg_paths& paths, const StatusParagraphs& status_db) { - static const std::string MARK_FOR_REMOVAL = ""; - std::vector installed_files; std::string line; @@ -211,19 +209,13 @@ std::vector vcpkg::get_installed_files(con listfile.close(); upgrade_to_slash_terminated_sorted_format(&installed_files_of_current_pgh, listfile_path); - for (std::string& file : installed_files_of_current_pgh) - { - if (file.back() == '/') - { - file = MARK_FOR_REMOVAL; - } - } - - installed_files_of_current_pgh.erase(std::remove_if(installed_files_of_current_pgh.begin(), installed_files_of_current_pgh.end(), [](const std::string& file) - { - return file == MARK_FOR_REMOVAL; - }), - installed_files_of_current_pgh.end()); + // Remove the directories + installed_files_of_current_pgh.erase( + std::remove_if(installed_files_of_current_pgh.begin(), installed_files_of_current_pgh.end(), [](const std::string& file) -> bool + { + return file.back() == '/'; + } + ), installed_files_of_current_pgh.end()); StatusParagraph_and_associated_files pgh_and_files = {*pgh, std::move(installed_files_of_current_pgh)}; installed_files.push_back(std::move(pgh_and_files)); -- cgit v1.2.3 From bd50778cb53d7071d65159f0aa67e685a6628e19 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 16 Dec 2016 15:42:15 -0800 Subject: [install_command] now overwrites files if they are already present The listfile checks ensures that no other package claims ownership of the particular file --- toolsrc/src/commands_installation.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_installation.cpp index 605343dfc..8d940bc9d 100644 --- a/toolsrc/src/commands_installation.cpp +++ b/toolsrc/src/commands_installation.cpp @@ -114,7 +114,11 @@ namespace vcpkg if (fs::is_regular_file(status)) { - fs::copy_file(*it, target, ec); + if (fs::exists(target)) + { + System::println(System::color::warning, "File %s was already present and will be overwritten", target.u8string(), ec.message()); + } + fs::copy_file(*it, target, fs::copy_options::overwrite_existing, ec); if (ec) { System::println(System::color::error, "failed: %s: %s", target.u8string(), ec.message()); -- cgit v1.2.3 From a5c3fddfe7bc4f765a0efdd9b109709f2fb4ae9c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 16 Dec 2016 16:02:19 -0800 Subject: Add Strings::trim_all_and_remove_whitespace_strings() --- toolsrc/include/vcpkg_Strings.h | 2 ++ toolsrc/src/vcpkg_Strings.cpp | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/toolsrc/include/vcpkg_Strings.h b/toolsrc/include/vcpkg_Strings.h index 92c24298c..a117a1a81 100644 --- a/toolsrc/include/vcpkg_Strings.h +++ b/toolsrc/include/vcpkg_Strings.h @@ -73,4 +73,6 @@ namespace vcpkg {namespace Strings void trim(std::string* s); std::string trimmed(const std::string& s); + + void trim_all_and_remove_whitespace_strings(std::vector* strings); }} diff --git a/toolsrc/src/vcpkg_Strings.cpp b/toolsrc/src/vcpkg_Strings.cpp index 4859a480b..403900dae 100644 --- a/toolsrc/src/vcpkg_Strings.cpp +++ b/toolsrc/src/vcpkg_Strings.cpp @@ -9,6 +9,7 @@ namespace vcpkg {namespace Strings {namespace details { + // To disambiguate between two overloads static const auto isspace = [](const char c) { return std::isspace(c); @@ -105,4 +106,13 @@ namespace vcpkg {namespace Strings auto whitespace_back = std::find_if_not(s.rbegin(), s.rend(), details::isspace).base(); return (whitespace_back <= whitespace_front ? std::string() : std::string(whitespace_front, whitespace_back)); } + + void trim_all_and_remove_whitespace_strings(std::vector* strings) + { + strings->erase(std::remove_if(strings->begin(), strings->end(), [](std::string& s)-> bool + { + trim(&s); + return s == ""; + }), strings->end()); + } }} -- cgit v1.2.3 From 843e390c94cae55fdd4d411fc5c96f399af0f6f0 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 16 Dec 2016 16:20:27 -0800 Subject: Replace reading lines and ignoring empty lines with the new functions Namely: Files::read_all_lines(); Strings::trim_all_and_remove_whitespace_strings() --- toolsrc/src/vcpkg.cpp | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index 8d01cb267..bf9dbd6ab 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -184,8 +184,6 @@ std::vector vcpkg::get_installed_files(con { std::vector installed_files; - std::string line; - for (const std::unique_ptr& pgh : status_db) { if (pgh->state != install_state_t::installed) @@ -194,19 +192,8 @@ std::vector vcpkg::get_installed_files(con } const fs::path listfile_path = paths.listfile_path(pgh->package); - std::fstream listfile(listfile_path); - - std::vector installed_files_of_current_pgh; - while (std::getline(listfile, line)) - { - if (line.empty()) - { - continue; - } - - installed_files_of_current_pgh.push_back(line); - } - listfile.close(); + std::vector installed_files_of_current_pgh = Files::read_all_lines(listfile_path).get_or_throw(); + Strings::trim_all_and_remove_whitespace_strings(&installed_files_of_current_pgh); upgrade_to_slash_terminated_sorted_format(&installed_files_of_current_pgh, listfile_path); // Remove the directories -- cgit v1.2.3 From e4571e75c2e572ef6a9f094bdd00326f8711e195 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 16 Dec 2016 17:48:37 -0800 Subject: Do the trim and empty string erase in separate passes --- toolsrc/src/vcpkg_Strings.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/toolsrc/src/vcpkg_Strings.cpp b/toolsrc/src/vcpkg_Strings.cpp index 403900dae..d2e153ede 100644 --- a/toolsrc/src/vcpkg_Strings.cpp +++ b/toolsrc/src/vcpkg_Strings.cpp @@ -109,9 +109,13 @@ namespace vcpkg {namespace Strings void trim_all_and_remove_whitespace_strings(std::vector* strings) { - strings->erase(std::remove_if(strings->begin(), strings->end(), [](std::string& s)-> bool + for (std::string& s : *strings) + { + trim(&s); + } + + strings->erase(std::remove_if(strings->begin(), strings->end(), [](const std::string& s)-> bool { - trim(&s); return s == ""; }), strings->end()); } -- cgit v1.2.3 From fdec39f452df368a0dd9184cd556607857605832 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 16 Dec 2016 19:37:11 -0800 Subject: Use check_exit() instead of check_throw() --- toolsrc/src/vcpkg_Files.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/vcpkg_Files.cpp b/toolsrc/src/vcpkg_Files.cpp index 889ceb055..853a57d16 100644 --- a/toolsrc/src/vcpkg_Files.cpp +++ b/toolsrc/src/vcpkg_Files.cpp @@ -9,7 +9,7 @@ namespace vcpkg {namespace Files void check_is_directory(const fs::path& dirpath) { - Checks::check_throw(fs::is_directory(dirpath), "The path %s is not a directory", dirpath.string()); + Checks::check_exit(fs::is_directory(dirpath), "The path %s is not a directory", dirpath.string()); } bool has_invalid_chars_for_filesystem(const std::string s) -- cgit v1.2.3 From b666e90c32e58a673331b303e64e299cc1168aa2 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 16 Dec 2016 19:38:02 -0800 Subject: Pass by ref --- toolsrc/include/vcpkg_Files.h | 2 +- toolsrc/src/vcpkg_Files.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/toolsrc/include/vcpkg_Files.h b/toolsrc/include/vcpkg_Files.h index 5e788f7be..b0a9747bf 100644 --- a/toolsrc/include/vcpkg_Files.h +++ b/toolsrc/include/vcpkg_Files.h @@ -10,7 +10,7 @@ namespace vcpkg {namespace Files void check_is_directory(const fs::path& dirpath); - bool has_invalid_chars_for_filesystem(const std::string s); + bool has_invalid_chars_for_filesystem(const std::string& s); expected get_contents(const fs::path& file_path) noexcept; diff --git a/toolsrc/src/vcpkg_Files.cpp b/toolsrc/src/vcpkg_Files.cpp index 853a57d16..9e7002a37 100644 --- a/toolsrc/src/vcpkg_Files.cpp +++ b/toolsrc/src/vcpkg_Files.cpp @@ -12,7 +12,7 @@ namespace vcpkg {namespace Files Checks::check_exit(fs::is_directory(dirpath), "The path %s is not a directory", dirpath.string()); } - bool has_invalid_chars_for_filesystem(const std::string s) + bool has_invalid_chars_for_filesystem(const std::string& s) { return std::regex_search(s, FILESYSTEM_INVALID_CHARACTERS_REGEX); } -- cgit v1.2.3 From aad0cc4c042aad87b2b52eded0e465ed01e799c1 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 16 Dec 2016 19:40:58 -0800 Subject: Files::get_contents() -> Files::read_contents() --- toolsrc/include/vcpkg_Files.h | 2 +- toolsrc/src/Paragraphs.cpp | 2 +- toolsrc/src/commands_cache.cpp | 2 +- toolsrc/src/commands_integration.cpp | 2 +- toolsrc/src/commands_update.cpp | 2 +- toolsrc/src/main.cpp | 2 +- toolsrc/src/vcpkg.cpp | 6 +++--- toolsrc/src/vcpkg_Files.cpp | 2 +- toolsrc/src/vcpkg_metrics_uploader.cpp | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/toolsrc/include/vcpkg_Files.h b/toolsrc/include/vcpkg_Files.h index b0a9747bf..6c9d0d365 100644 --- a/toolsrc/include/vcpkg_Files.h +++ b/toolsrc/include/vcpkg_Files.h @@ -12,7 +12,7 @@ namespace vcpkg {namespace Files bool has_invalid_chars_for_filesystem(const std::string& s); - expected get_contents(const fs::path& file_path) noexcept; + expected read_contents(const fs::path& file_path) noexcept; expected> read_all_lines(const fs::path& file_path); diff --git a/toolsrc/src/Paragraphs.cpp b/toolsrc/src/Paragraphs.cpp index 5efa9a7b3..823b4a85e 100644 --- a/toolsrc/src/Paragraphs.cpp +++ b/toolsrc/src/Paragraphs.cpp @@ -153,7 +153,7 @@ namespace vcpkg { namespace Paragraphs std::vector> get_paragraphs(const fs::path& control_path) { - return parse_paragraphs(Files::get_contents(control_path).get_or_throw()); + return parse_paragraphs(Files::read_contents(control_path).get_or_throw()); } std::vector> parse_paragraphs(const std::string& str) diff --git a/toolsrc/src/commands_cache.cpp b/toolsrc/src/commands_cache.cpp index 17b04b093..1a10b93cf 100644 --- a/toolsrc/src/commands_cache.cpp +++ b/toolsrc/src/commands_cache.cpp @@ -15,7 +15,7 @@ namespace vcpkg try { - auto file_contents = Files::get_contents(path / "CONTROL"); + auto file_contents = Files::read_contents(path / "CONTROL"); if (auto text = file_contents.get()) { auto pghs = Paragraphs::parse_paragraphs(*text); diff --git a/toolsrc/src/commands_integration.cpp b/toolsrc/src/commands_integration.cpp index 31f30f216..e7e5b2d8d 100644 --- a/toolsrc/src/commands_integration.cpp +++ b/toolsrc/src/commands_integration.cpp @@ -173,7 +173,7 @@ namespace vcpkg bool should_install_system = true; if (fs::exists(system_wide_targets_file)) { - auto system_wide_file_contents = Files::get_contents(system_wide_targets_file); + auto system_wide_file_contents = Files::read_contents(system_wide_targets_file); if (auto contents_data = system_wide_file_contents.get()) { std::regex re(R"###()###"); diff --git a/toolsrc/src/commands_update.cpp b/toolsrc/src/commands_update.cpp index 82e3b7e52..a4ab7c6e7 100644 --- a/toolsrc/src/commands_update.cpp +++ b/toolsrc/src/commands_update.cpp @@ -71,7 +71,7 @@ namespace vcpkg System::println("\nTo update these packages, run\n vcpkg remove --purge ...\n vcpkg install ..."); } - auto version_file = Files::get_contents(paths.root / "toolsrc" / "VERSION.txt"); + auto version_file = Files::read_contents(paths.root / "toolsrc" / "VERSION.txt"); if (auto version_contents = version_file.get()) { int maj1, min1, rev1; diff --git a/toolsrc/src/main.cpp b/toolsrc/src/main.cpp index 5e9dcf7ff..7703c541f 100644 --- a/toolsrc/src/main.cpp +++ b/toolsrc/src/main.cpp @@ -113,7 +113,7 @@ static void loadConfig() try { - std::string config_contents = Files::get_contents(localappdata / "vcpkg" / "config").get_or_throw(); + std::string config_contents = Files::read_contents(localappdata / "vcpkg" / "config").get_or_throw(); std::unordered_map keys; auto pghs = Paragraphs::parse_paragraphs(config_contents); diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index bf9dbd6ab..6858d5518 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -27,7 +27,7 @@ static StatusParagraphs load_current_database(const fs::path& vcpkg_dir_status_f fs::rename(vcpkg_dir_status_file_old, vcpkg_dir_status_file); } - auto text = Files::get_contents(vcpkg_dir_status_file).get_or_throw(); + auto text = Files::read_contents(vcpkg_dir_status_file).get_or_throw(); auto pghs = Paragraphs::parse_paragraphs(text); std::vector> status_pghs; @@ -70,7 +70,7 @@ StatusParagraphs vcpkg::database_load_check(const vcpkg_paths& paths) if (b->path().filename() == "incomplete") continue; - auto text = Files::get_contents(b->path()).get_or_throw(); + auto text = Files::read_contents(b->path()).get_or_throw(); auto pghs = Paragraphs::parse_paragraphs(text); for (auto&& p : pghs) { @@ -230,7 +230,7 @@ expected vcpkg::try_load_cached_package(const vcpkg_paths& path { const fs::path path = paths.package_dir(spec) / "CONTROL"; - auto control_contents_maybe = Files::get_contents(path); + auto control_contents_maybe = Files::read_contents(path); if (auto control_contents = control_contents_maybe.get()) { std::vector> pghs; diff --git a/toolsrc/src/vcpkg_Files.cpp b/toolsrc/src/vcpkg_Files.cpp index 9e7002a37..48283e43f 100644 --- a/toolsrc/src/vcpkg_Files.cpp +++ b/toolsrc/src/vcpkg_Files.cpp @@ -17,7 +17,7 @@ namespace vcpkg {namespace Files return std::regex_search(s, FILESYSTEM_INVALID_CHARACTERS_REGEX); } - expected get_contents(const fs::path& file_path) noexcept + expected read_contents(const fs::path& file_path) noexcept { std::fstream file_stream(file_path, std::ios_base::in | std::ios_base::binary); if (file_stream.fail()) diff --git a/toolsrc/src/vcpkg_metrics_uploader.cpp b/toolsrc/src/vcpkg_metrics_uploader.cpp index 63668d1d7..14fc9ae48 100644 --- a/toolsrc/src/vcpkg_metrics_uploader.cpp +++ b/toolsrc/src/vcpkg_metrics_uploader.cpp @@ -19,5 +19,5 @@ WinMain( szArgList = CommandLineToArgvW(GetCommandLineW(), &argCount); Checks::check_exit(argCount == 2, "Requires exactly one argument, the path to the payload file"); - Upload(Files::get_contents(szArgList[1]).get_or_throw()); + Upload(Files::read_contents(szArgList[1]).get_or_throw()); } -- cgit v1.2.3 From 73bf8306b29d68853dc3c97d5dd415bd5e857cf5 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 16 Dec 2016 20:11:50 -0800 Subject: Pass by const ref --- toolsrc/include/coff_file_reader.h | 4 ++-- toolsrc/src/coff_file_reader.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/toolsrc/include/coff_file_reader.h b/toolsrc/include/coff_file_reader.h index 1a9a071ef..edf6910a5 100644 --- a/toolsrc/include/coff_file_reader.h +++ b/toolsrc/include/coff_file_reader.h @@ -15,7 +15,7 @@ namespace vcpkg {namespace COFFFileReader std::vector machine_types; }; - dll_info read_dll(const fs::path path); + dll_info read_dll(const fs::path& path); - lib_info read_lib(const fs::path path); + lib_info read_lib(const fs::path& path); }} diff --git a/toolsrc/src/coff_file_reader.cpp b/toolsrc/src/coff_file_reader.cpp index 3bf7922f5..1f30ea70b 100644 --- a/toolsrc/src/coff_file_reader.cpp +++ b/toolsrc/src/coff_file_reader.cpp @@ -223,7 +223,7 @@ namespace vcpkg { namespace COFFFileReader verify_equal_strings(FILE_START, file_start, FILE_START_SIZE, "LIB FILE_START"); } - dll_info read_dll(const fs::path path) + dll_info read_dll(const fs::path& path) { std::fstream fs(path, std::ios::in | std::ios::binary | std::ios::ate); Checks::check_exit(fs.is_open(), "Could not open file %s for reading", path.generic_string()); @@ -260,7 +260,7 @@ namespace vcpkg { namespace COFFFileReader fpos_t m_absolute_position = 0; }; - lib_info read_lib(const fs::path path) + lib_info read_lib(const fs::path& path) { std::fstream fs(path, std::ios::in | std::ios::binary | std::ios::ate); Checks::check_exit(fs.is_open(), "Could not open file %s for reading", path.generic_string()); -- cgit v1.2.3 From 835693ce97f271c0213f65c1c782e8df84cfb409 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 16 Dec 2016 20:17:24 -0800 Subject: Don't return by const value --- toolsrc/include/BuildInfo.h | 2 +- toolsrc/src/BuildInfo.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/toolsrc/include/BuildInfo.h b/toolsrc/include/BuildInfo.h index 9f872385e..49811d521 100644 --- a/toolsrc/include/BuildInfo.h +++ b/toolsrc/include/BuildInfo.h @@ -104,7 +104,7 @@ namespace vcpkg { namespace PostBuildLint OutdatedDynamicCrt() = delete; - const std::regex crt_regex() const; + std::regex crt_regex() const; const std::string& toString() const; private: diff --git a/toolsrc/src/BuildInfo.cpp b/toolsrc/src/BuildInfo.cpp index ddd44a1e6..f151a3ea5 100644 --- a/toolsrc/src/BuildInfo.cpp +++ b/toolsrc/src/BuildInfo.cpp @@ -151,7 +151,7 @@ namespace vcpkg { namespace PostBuildLint const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCRT20_DLL = OutdatedDynamicCrt("msvcrt20.dll", R"(msvcrt20\.dll)");; const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCRT40_DLL = OutdatedDynamicCrt("msvcrt40.dll", R"(msvcrt40\.dll)");; - const std::regex OutdatedDynamicCrt::crt_regex() const + std::regex OutdatedDynamicCrt::crt_regex() const { const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); return r; -- cgit v1.2.3 From 869071a34ea0c2614231f3c85db58b8f0f43f721 Mon Sep 17 00:00:00 2001 From: vlj Date: Mon, 12 Dec 2016 20:07:43 +0100 Subject: Add spirv-tools. --- ports/spirv-tools/CONTROL | 3 ++ ports/spirv-tools/portfile.cmake | 78 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 ports/spirv-tools/CONTROL create mode 100644 ports/spirv-tools/portfile.cmake diff --git a/ports/spirv-tools/CONTROL b/ports/spirv-tools/CONTROL new file mode 100644 index 000000000..0e1a82706 --- /dev/null +++ b/ports/spirv-tools/CONTROL @@ -0,0 +1,3 @@ +Source: spirv-tools +Version: +Description: diff --git a/ports/spirv-tools/portfile.cmake b/ports/spirv-tools/portfile.cmake new file mode 100644 index 000000000..c9bb5f85f --- /dev/null +++ b/ports/spirv-tools/portfile.cmake @@ -0,0 +1,78 @@ +# 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) +find_program(GIT git) + +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src) + +set(GIT_URL "https://github.com/KhronosGroup/SPIRV-Tools.git") +set(GIT_REF "f72189c249ba143c6a89a4cf1e7d53337b2ddd40") + +if(NOT EXISTS "${DOWNLOADS}/spirv-tools.git") + message(STATUS "Cloning") + vcpkg_execute_required_process( + COMMAND ${GIT} clone --bare ${GIT_URL} ${DOWNLOADS}/spirv-tools.git + WORKING_DIRECTORY ${DOWNLOADS} + LOGNAME clone + ) +endif() + +if(NOT EXISTS "${SOURCE_PATH}/.git") + message(STATUS "Adding worktree and patching") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}) + vcpkg_execute_required_process( + COMMAND ${GIT} worktree add -f --detach ${SOURCE_PATH} ${GIT_REF} + WORKING_DIRECTORY ${DOWNLOADS}/spirv-tools.git + LOGNAME worktree + ) + message(STATUS "Patching") +endif() + +set(SPIRVHEADERS_GIT_URL "https://github.com/KhronosGroup/SPIRV-Headers.git") +set(SPIRVHEADERS_GIT_REF "bd47a9abaefac00be692eae677daed1b977e625c") + +if(NOT EXISTS "${DOWNLOADS}/SPIRV-Headers.git") + message(STATUS "Cloning") + vcpkg_execute_required_process( + COMMAND ${GIT} clone --bare ${SPIRVHEADERS_GIT_URL} ${DOWNLOADS}/SPIRV-Headers.git + WORKING_DIRECTORY ${DOWNLOADS} + LOGNAME clone + ) +endif() + +if(NOT EXISTS "${SOURCE_PATH}/external/spirv-headers/.git") + message(STATUS "Adding worktree and patching") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}) + vcpkg_execute_required_process( + COMMAND ${GIT} worktree add -f --detach ${SOURCE_PATH}/external/spirv-headers ${SPIRVHEADERS_GIT_REF} + WORKING_DIRECTORY ${DOWNLOADS}/SPIRV-Headers.git + LOGNAME worktree + ) +endif() + +set(VCPKG_LIBRARY_LINKAGE "static") + +vcpkg_configure_cmake( + SOURCE_PATH "${CURRENT_BUILDTREES_DIR}/src" + # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 + # OPTIONS_RELEASE -DOPTIMIZE=1 + # OPTIONS_DEBUG -DDEBUGGABLE=1 +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(GLOB EXES "${CURRENT_PACKAGES_DIR}/bin/*.exe") +file(COPY ${EXES} DESTINATION ${CURRENT_PACKAGES_DIR}/tools) +file(REMOVE ${EXES}) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/spirv-tools) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/spirv-tools/LICENSE ${CURRENT_PACKAGES_DIR}/share/spirv-tools/copyright) -- cgit v1.2.3 From ea3113a4f520f7cb6383df1c261138cc21abceb6 Mon Sep 17 00:00:00 2001 From: sdcb Date: Sun, 18 Dec 2016 16:26:12 +0800 Subject: [mongo-x-driver] upgrade to 1.51/3.10 --- ports/libbson/portfile.cmake | 102 ++++++++++---------- ports/mongo-c-driver/portfile.cmake | 92 +++++++++--------- ports/mongo-cxx-driver/portfile.cmake | 175 +++++++++++++++++----------------- 3 files changed, 185 insertions(+), 184 deletions(-) diff --git a/ports/libbson/portfile.cmake b/ports/libbson/portfile.cmake index 7642c3437..e6e5ff352 100644 --- a/ports/libbson/portfile.cmake +++ b/ports/libbson/portfile.cmake @@ -1,52 +1,52 @@ -include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libbson-1.5.0-rc6) - -vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/mongodb/libbson/archive/1.5.0-rc6.tar.gz" - FILENAME "libbson-1.5.0-rc6.tar.gz" - SHA512 15cf590b488f7de8d614ddcc2c1536b05b607311f3cd3353418469c7a62177124fb4fb1c53f51b0de4c7491b21051c1ec47fbc12856cc69e37baebb3d65897c5 -) -vcpkg_extract_source_archive(${ARCHIVE}) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - OPTIONS - -DENABLE_TESTS=OFF - -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=ON -) - -vcpkg_install_cmake() - -file(RENAME - ${CURRENT_PACKAGES_DIR}/include/libbson-1.0 - ${CURRENT_PACKAGES_DIR}/temp) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include) -file(RENAME ${CURRENT_PACKAGES_DIR}/temp ${CURRENT_PACKAGES_DIR}/include) - -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) - -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) - file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/bson-1.0.lib) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/bson-1.0.lib) - - file(RENAME - ${CURRENT_PACKAGES_DIR}/lib/bson-static-1.0.lib - ${CURRENT_PACKAGES_DIR}/lib/bson-1.0.lib) - file(RENAME - ${CURRENT_PACKAGES_DIR}/debug/lib/bson-static-1.0.lib - ${CURRENT_PACKAGES_DIR}/debug/lib/bson-1.0.lib) - - # drop the __declspec(dllimport) when building static - vcpkg_apply_patches( - SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include - PATCHES - ${CMAKE_CURRENT_LIST_DIR}/static.patch - ) -else() - file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/bson-static-1.0.lib) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/bson-static-1.0.lib) -endif() - +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libbson-1.5.1) + +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/mongodb/libbson/archive/1.5.1.tar.gz" + FILENAME "libbson-1.5.1.tar.gz" + SHA512 b641e23ca041e532fe566167ad0292d12934e0fae2c110f81bf6ca3b71b5d01b651a604a7ce6da0d1b54b98cd95674ef331ef4e23c2dedfc706f371eac4efaec +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DENABLE_TESTS=OFF + -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=ON +) + +vcpkg_install_cmake() + +file(RENAME + ${CURRENT_PACKAGES_DIR}/include/libbson-1.0 + ${CURRENT_PACKAGES_DIR}/temp) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include) +file(RENAME ${CURRENT_PACKAGES_DIR}/temp ${CURRENT_PACKAGES_DIR}/include) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/bson-1.0.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/bson-1.0.lib) + + file(RENAME + ${CURRENT_PACKAGES_DIR}/lib/bson-static-1.0.lib + ${CURRENT_PACKAGES_DIR}/lib/bson-1.0.lib) + file(RENAME + ${CURRENT_PACKAGES_DIR}/debug/lib/bson-static-1.0.lib + ${CURRENT_PACKAGES_DIR}/debug/lib/bson-1.0.lib) + + # drop the __declspec(dllimport) when building static + vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/static.patch + ) +else() + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/bson-static-1.0.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/bson-static-1.0.lib) +endif() + file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libbson RENAME copyright) \ No newline at end of file diff --git a/ports/mongo-c-driver/portfile.cmake b/ports/mongo-c-driver/portfile.cmake index f9a247499..c3b7a0817 100644 --- a/ports/mongo-c-driver/portfile.cmake +++ b/ports/mongo-c-driver/portfile.cmake @@ -1,47 +1,47 @@ -include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mongo-c-driver-1.5.0-rc6) - -vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/mongodb/mongo-c-driver/archive/1.5.0-rc6.tar.gz" - FILENAME "mongo-c-driver-1.5.0-rc6.tar.gz" - SHA512 708caf4e963bad97b4802456c6f5809a0ba8c24fe5faaf0e91aa889a0690df4324005f8d324b3bfc80ffc76f1594612a8d391d7421dd914c58369c24cf8cc965 -) -vcpkg_extract_source_archive(${ARCHIVE}) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - OPTIONS - -DBSON_ROOT_DIR=${CURRENT_INSTALLED_DIR} - -DENABLE_TESTS=OFF - -DENABLE_EXAMPLES=OFF - -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=ON -) - -vcpkg_install_cmake() - -file(RENAME - ${CURRENT_PACKAGES_DIR}/include/libmongoc-1.0 - ${CURRENT_PACKAGES_DIR}/temp) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include) -file(RENAME ${CURRENT_PACKAGES_DIR}/temp ${CURRENT_PACKAGES_DIR}/include) - -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) - -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) - file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/mongoc-1.0.lib) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/mongoc-1.0.lib) - - file(RENAME - ${CURRENT_PACKAGES_DIR}/lib/mongoc-static-1.0.lib - ${CURRENT_PACKAGES_DIR}/lib/mongoc-1.0.lib) - file(RENAME - ${CURRENT_PACKAGES_DIR}/debug/lib/mongoc-static-1.0.lib - ${CURRENT_PACKAGES_DIR}/debug/lib/mongoc-1.0.lib) -else() - file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/mongoc-static-1.0.lib) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/mongoc-static-1.0.lib) -endif() - +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mongo-c-driver-1.5.1) + +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/mongodb/mongo-c-driver/archive/1.5.1.tar.gz" + FILENAME "mongo-c-driver-1.5.1.tar.gz" + SHA512 2977e6e1fb3c45256161d2c9bd711fea69b9f8c9ff15362fa636068e0a347c42e10d72fed5649504b552c8212f21cb1ae74d2dc8ca3d1388f49e63b2baf6e16d +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DBSON_ROOT_DIR=${CURRENT_INSTALLED_DIR} + -DENABLE_TESTS=OFF + -DENABLE_EXAMPLES=OFF + -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=ON +) + +vcpkg_install_cmake() + +file(RENAME + ${CURRENT_PACKAGES_DIR}/include/libmongoc-1.0 + ${CURRENT_PACKAGES_DIR}/temp) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include) +file(RENAME ${CURRENT_PACKAGES_DIR}/temp ${CURRENT_PACKAGES_DIR}/include) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/mongoc-1.0.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/mongoc-1.0.lib) + + file(RENAME + ${CURRENT_PACKAGES_DIR}/lib/mongoc-static-1.0.lib + ${CURRENT_PACKAGES_DIR}/lib/mongoc-1.0.lib) + file(RENAME + ${CURRENT_PACKAGES_DIR}/debug/lib/mongoc-static-1.0.lib + ${CURRENT_PACKAGES_DIR}/debug/lib/mongoc-1.0.lib) +else() + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/mongoc-static-1.0.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/mongoc-static-1.0.lib) +endif() + file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver RENAME copyright) \ No newline at end of file diff --git a/ports/mongo-cxx-driver/portfile.cmake b/ports/mongo-cxx-driver/portfile.cmake index fa0549fd7..a6c97335c 100644 --- a/ports/mongo-cxx-driver/portfile.cmake +++ b/ports/mongo-cxx-driver/portfile.cmake @@ -1,88 +1,89 @@ -include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mongo-cxx-driver-r3.0.3) - -vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/mongodb/mongo-cxx-driver/archive/r3.0.3.tar.gz" - FILENAME "mongo-cxx-driver-r3.0.3.tar.gz" - SHA512 29f7ae77dab160c4279eb2eba8e960b25afc7118bf82570d240f5c68e1e17b10dc99910c855888467c304d70399f2d02031463b0c168a95ad0b9323742ccfd35 -) -vcpkg_extract_source_archive(${ARCHIVE}) - -vcpkg_apply_patches( - SOURCE_PATH ${SOURCE_PATH} - PATCHES - ${CMAKE_CURRENT_LIST_DIR}/disable_test_and_example.patch - ${CMAKE_CURRENT_LIST_DIR}/disable_shared.patch -) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - OPTIONS - -DLIBBSON_DIR=${CURRENT_INSTALLED_DIR} - -DLIBMONGOC_DIR=${CURRENT_INSTALLED_DIR} - -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=ON -) - -vcpkg_install_cmake() - -file(RENAME - ${CURRENT_PACKAGES_DIR}/include/bsoncxx/v_noabi/bsoncxx - ${CURRENT_PACKAGES_DIR}/temp) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/bsoncxx) -file(RENAME ${CURRENT_PACKAGES_DIR}/temp ${CURRENT_PACKAGES_DIR}/include/bsoncxx) - -file(RENAME - ${CURRENT_PACKAGES_DIR}/include/mongocxx/v_noabi/mongocxx - ${CURRENT_PACKAGES_DIR}/temp) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/mongocxx) -file(RENAME ${CURRENT_PACKAGES_DIR}/temp ${CURRENT_PACKAGES_DIR}/include/mongocxx) - -file(REMOVE_RECURSE - ${CURRENT_PACKAGES_DIR}/lib/cmake - ${CURRENT_PACKAGES_DIR}/debug/lib/cmake - - ${CURRENT_PACKAGES_DIR}/include/bsoncxx/cmake - ${CURRENT_PACKAGES_DIR}/include/bsoncxx/config/private - ${CURRENT_PACKAGES_DIR}/include/bsoncxx/private - ${CURRENT_PACKAGES_DIR}/include/bsoncxx/test - ${CURRENT_PACKAGES_DIR}/include/bsoncxx/third_party - - ${CURRENT_PACKAGES_DIR}/include/mongocxx/cmake - ${CURRENT_PACKAGES_DIR}/include/mongocxx/config/private - ${CURRENT_PACKAGES_DIR}/include/mongocxx/test - ${CURRENT_PACKAGES_DIR}/include/mongocxx/test_util - ${CURRENT_PACKAGES_DIR}/include/mongocxx/private - ${CURRENT_PACKAGES_DIR}/include/mongocxx/exception/private - - ${CURRENT_PACKAGES_DIR}/debug/include) - - -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) - file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/bsoncxx.lib) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/bsoncxx.lib) - file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/mongocxx.lib) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/mongocxx.lib) - - file(RENAME - ${CURRENT_PACKAGES_DIR}/lib/libbsoncxx.lib - ${CURRENT_PACKAGES_DIR}/lib/bsoncxx.lib) - file(RENAME - ${CURRENT_PACKAGES_DIR}/debug/lib/libmongocxx.lib - ${CURRENT_PACKAGES_DIR}/debug/lib/mongocxx.lib) - - # define MONGOCXX_STATIC in config/export.hpp - vcpkg_apply_patches( - SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include - PATCHES - ${CMAKE_CURRENT_LIST_DIR}/static.patch - ) -else() - file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/libbsoncxx.lib) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/libbsoncxx.lib) - file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/libmongocxx.lib) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/libmongocxx.lib) -endif() - +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mongo-cxx-driver-r3.1.0) + +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/mongodb/mongo-cxx-driver/archive/r3.1.0.tar.gz" + FILENAME "mongo-cxx-driver-r3.1.0.tar.gz" + SHA512 2c9323f5e28304057b6ed6fc8bf33aad14db1313e234eaa74a96fb4cf93e99d24fd8c7c3f20b4b29cda7b1fe5c58f08dcb5cddcffbf62259c08334312fda4fba +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/disable_test_and_example.patch + ${CMAKE_CURRENT_LIST_DIR}/disable_shared.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DLIBBSON_DIR=${CURRENT_INSTALLED_DIR} + -DLIBMONGOC_DIR=${CURRENT_INSTALLED_DIR} + -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=ON +) + +vcpkg_install_cmake() + +file(RENAME + ${CURRENT_PACKAGES_DIR}/include/bsoncxx/v_noabi/bsoncxx + ${CURRENT_PACKAGES_DIR}/temp) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/bsoncxx) +file(RENAME ${CURRENT_PACKAGES_DIR}/temp ${CURRENT_PACKAGES_DIR}/include/bsoncxx) + +file(RENAME + ${CURRENT_PACKAGES_DIR}/include/mongocxx/v_noabi/mongocxx + ${CURRENT_PACKAGES_DIR}/temp) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/mongocxx) +file(RENAME ${CURRENT_PACKAGES_DIR}/temp ${CURRENT_PACKAGES_DIR}/include/mongocxx) + +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/lib/cmake + ${CURRENT_PACKAGES_DIR}/debug/lib/cmake + + ${CURRENT_PACKAGES_DIR}/include/bsoncxx/cmake + ${CURRENT_PACKAGES_DIR}/include/bsoncxx/config/private + ${CURRENT_PACKAGES_DIR}/include/bsoncxx/private + ${CURRENT_PACKAGES_DIR}/include/bsoncxx/test + ${CURRENT_PACKAGES_DIR}/include/bsoncxx/third_party + + ${CURRENT_PACKAGES_DIR}/include/mongocxx/cmake + ${CURRENT_PACKAGES_DIR}/include/mongocxx/config/private + ${CURRENT_PACKAGES_DIR}/include/mongocxx/test + ${CURRENT_PACKAGES_DIR}/include/mongocxx/test_util + ${CURRENT_PACKAGES_DIR}/include/mongocxx/private + ${CURRENT_PACKAGES_DIR}/include/mongocxx/exception/private + ${CURRENT_PACKAGES_DIR}/include/mongocxx/options + + ${CURRENT_PACKAGES_DIR}/debug/include) + + +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/bsoncxx.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/bsoncxx.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/mongocxx.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/mongocxx.lib) + + file(RENAME + ${CURRENT_PACKAGES_DIR}/lib/libbsoncxx.lib + ${CURRENT_PACKAGES_DIR}/lib/bsoncxx.lib) + file(RENAME + ${CURRENT_PACKAGES_DIR}/debug/lib/libmongocxx.lib + ${CURRENT_PACKAGES_DIR}/debug/lib/mongocxx.lib) + + # define MONGOCXX_STATIC in config/export.hpp + vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/static.patch + ) +else() + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/libbsoncxx.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/libbsoncxx.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/libmongocxx.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/libmongocxx.lib) +endif() + file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/mongo-cxx-driver RENAME copyright) \ No newline at end of file -- cgit v1.2.3 From b5368c404d51424c81a83834ac3fe1a628a54834 Mon Sep 17 00:00:00 2001 From: codicodi Date: Sun, 18 Dec 2016 15:18:24 +0100 Subject: [libmodplug] initial commit --- ports/libmodplug/CONTROL | 3 +++ .../automagically-define-modplug-static.patch | 13 ++++++++++ ports/libmodplug/portfile.cmake | 30 ++++++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 ports/libmodplug/CONTROL create mode 100644 ports/libmodplug/automagically-define-modplug-static.patch create mode 100644 ports/libmodplug/portfile.cmake diff --git a/ports/libmodplug/CONTROL b/ports/libmodplug/CONTROL new file mode 100644 index 000000000..8aca622a4 --- /dev/null +++ b/ports/libmodplug/CONTROL @@ -0,0 +1,3 @@ +Source: libmodplug +Version: 0.8.8.5-bb25b05 +Description: The ModPlug mod file playing library. diff --git a/ports/libmodplug/automagically-define-modplug-static.patch b/ports/libmodplug/automagically-define-modplug-static.patch new file mode 100644 index 000000000..b7982b2d3 --- /dev/null +++ b/ports/libmodplug/automagically-define-modplug-static.patch @@ -0,0 +1,13 @@ +diff --git a/libmodplug/modplug.h b/libmodplug/modplug.h +index 3ffbf9d..fd19ae5 100644 +--- a/libmodplug/modplug.h ++++ b/libmodplug/modplug.h +@@ -11,6 +11,8 @@ + extern "C" { + #endif + ++#define MODPLUG_STATIC ++ + #if defined(_WIN32) || defined(__CYGWIN__) + # if defined(MODPLUG_BUILD) && defined(DLL_EXPORT) /* building libmodplug as a dll for windows */ + # define MODPLUG_EXPORT __declspec(dllexport) diff --git a/ports/libmodplug/portfile.cmake b/ports/libmodplug/portfile.cmake new file mode 100644 index 000000000..7ffff7091 --- /dev/null +++ b/ports/libmodplug/portfile.cmake @@ -0,0 +1,30 @@ + +set(MODPLUG_HASH bb25b059a963f62aa0a3fe4c580da7da47f2b9c0) +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libmodplug-${MODPLUG_HASH}) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/Konstanty/libmodplug/archive/${MODPLUG_HASH}.zip" + FILENAME "libmodplug-0.8.8.5-${MODPLUG_HASH}" + SHA512 65840b7748284b400dfe99775e18f44dcc4846bc0ff522d18b9ded42c7032e10683e453110d530722d9e22547b7e5f4878ebfff92f232691cbd5b0638c48d88b) + +vcpkg_extract_source_archive(${ARCHIVE}) +vcpkg_configure_cmake(SOURCE_PATH ${SOURCE_PATH}) +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin) + file(RENAME ${CURRENT_PACKAGES_DIR}/lib/modplug.dll ${CURRENT_PACKAGES_DIR}/bin/modplug.dll) + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/modplug.dll ${CURRENT_PACKAGES_DIR}/debug/bin/modplug.dll) + vcpkg_copy_pdbs() +else() + vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/automagically-define-modplug-static.patch) +endif() + +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libmodplug) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/libmodplug/COPYING ${CURRENT_PACKAGES_DIR}/share/libmodplug/copyright) -- cgit v1.2.3 From effbdfbb91e3672e41cfc442ce0244872b1fad8c Mon Sep 17 00:00:00 2001 From: Silvio Date: Sun, 18 Dec 2016 23:00:35 +0100 Subject: Add ogre port --- ports/ogre/0001-use-vcpkg-freeimage.patch | 17 ++++++++ ports/ogre/0002-ogre-cmake-dir-as-option.patch | 19 ++++++++ ports/ogre/0003-use-flat-installation.patch | 41 ++++++++++++++++++ ports/ogre/CONTROL | 4 ++ ports/ogre/OGREConfig.cmake | 37 ++++++++++++++++ ports/ogre/portfile.cmake | 60 ++++++++++++++++++++++++++ 6 files changed, 178 insertions(+) create mode 100644 ports/ogre/0001-use-vcpkg-freeimage.patch create mode 100644 ports/ogre/0002-ogre-cmake-dir-as-option.patch create mode 100644 ports/ogre/0003-use-flat-installation.patch create mode 100644 ports/ogre/CONTROL create mode 100644 ports/ogre/OGREConfig.cmake create mode 100644 ports/ogre/portfile.cmake diff --git a/ports/ogre/0001-use-vcpkg-freeimage.patch b/ports/ogre/0001-use-vcpkg-freeimage.patch new file mode 100644 index 000000000..0266e5e89 --- /dev/null +++ b/ports/ogre/0001-use-vcpkg-freeimage.patch @@ -0,0 +1,17 @@ +diff --git a/OgreMain/CMakeLists.txt b/OgreMain/CMakeLists.txt +index 6a43378..22f950e 100644 +--- a/OgreMain/CMakeLists.txt ++++ b/OgreMain/CMakeLists.txt +@@ -220,7 +220,11 @@ endif () + list(APPEND HEADER_FILES ${THREAD_HEADER_FILES}) + + # Add needed definitions and nedmalloc include dir +-add_definitions(-DOGRE_NONCLIENT_BUILD -DFREEIMAGE_LIB -D_MT -D_USRDLL) ++# vcpkg specific patch: we removed -DFREEIMAGE_LIB ++# from the defines, because vcpkg's freeimage can ++# be both static or dynamic, and FREEIMAGE_LIB ++# remove all the symbol exporting declaration from FreeImage.h ++add_definitions(-DOGRE_NONCLIENT_BUILD -D_MT -D_USRDLL) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/nedmalloc) + + set(LIBRARIES ${PLATFORM_LIBS}) diff --git a/ports/ogre/0002-ogre-cmake-dir-as-option.patch b/ports/ogre/0002-ogre-cmake-dir-as-option.patch new file mode 100644 index 000000000..c5d75e20c --- /dev/null +++ b/ports/ogre/0002-ogre-cmake-dir-as-option.patch @@ -0,0 +1,19 @@ +diff --git a/CMake/CMakeLists.txt b/CMake/CMakeLists.txt +index 4c496b7..feb4017 100644 +--- a/CMake/CMakeLists.txt ++++ b/CMake/CMakeLists.txt +@@ -14,10 +14,12 @@ + ############################################################# + + if(WIN32 OR APPLE) +- set(OGRE_CMAKE_DIR "CMake") ++ set(OGRE_DEFAULT_CMAKE_DIR "CMake") + else() +- set(OGRE_CMAKE_DIR "${OGRE_LIB_DIRECTORY}/OGRE/cmake") ++ set(OGRE_DEFAULT_CMAKE_DIR "${OGRE_LIB_DIRECTORY}/OGRE/cmake") + endif() ++set(OGRE_CMAKE_DIR ${OGRE_DEFAULT_CMAKE_DIR} CACHE STRING "Install directory for CMake files.") ++mark_as_advanced(OGRE_DEFAULT_CMAKE_DIR) + + set(INST_FILES + Packages/FindOIS.cmake diff --git a/ports/ogre/0003-use-flat-installation.patch b/ports/ogre/0003-use-flat-installation.patch new file mode 100644 index 000000000..c5a382c1f --- /dev/null +++ b/ports/ogre/0003-use-flat-installation.patch @@ -0,0 +1,41 @@ +diff --git a/CMake/Utils/OgreConfigTargets.cmake b/CMake/Utils/OgreConfigTargets.cmake +index c6b3b40..2da7ebf 100644 +--- a/CMake/Utils/OgreConfigTargets.cmake ++++ b/CMake/Utils/OgreConfigTargets.cmake +@@ -41,15 +41,28 @@ if (NOT OGRE_RUNTIME_OUTPUT) + set(OGRE_RUNTIME_OUTPUT ${OGRE_BINARY_DIR}/bin) + endif () + ++option(OGRE_NO_INSTALLATION_SUFFIXES_ON_WIN32 "Do not install in configuration-specific directories in Windows" FALSE) ++ + if (WIN32) +- set(OGRE_RELEASE_PATH "/Release") +- set(OGRE_RELWDBG_PATH "/RelWithDebInfo") +- set(OGRE_MINSIZE_PATH "/MinSizeRel") +- set(OGRE_DEBUG_PATH "/Debug") +- set(OGRE_LIB_RELEASE_PATH "/Release") +- set(OGRE_LIB_RELWDBG_PATH "/RelWithDebInfo") +- set(OGRE_LIB_MINSIZE_PATH "/MinSizeRel") +- set(OGRE_LIB_DEBUG_PATH "/Debug") ++ if (OGRE_NO_INSTALLATION_SUFFIXES_ON_WIN32) ++ set(OGRE_RELEASE_PATH "") ++ set(OGRE_RELWDBG_PATH "") ++ set(OGRE_MINSIZE_PATH "") ++ set(OGRE_DEBUG_PATH "") ++ set(OGRE_LIB_RELEASE_PATH "") ++ set(OGRE_LIB_RELWDBG_PATH "") ++ set(OGRE_LIB_MINSIZE_PATH "") ++ set(OGRE_LIB_DEBUG_PATH "/") ++ else () ++ set(OGRE_RELEASE_PATH "/Release") ++ set(OGRE_RELWDBG_PATH "/RelWithDebInfo") ++ set(OGRE_MINSIZE_PATH "/MinSizeRel") ++ set(OGRE_DEBUG_PATH "/Debug") ++ set(OGRE_LIB_RELEASE_PATH "/Release") ++ set(OGRE_LIB_RELWDBG_PATH "/RelWithDebInfo") ++ set(OGRE_LIB_MINSIZE_PATH "/MinSizeRel") ++ set(OGRE_LIB_DEBUG_PATH "/Debug") ++ endif () + set(OGRE_PLUGIN_PATH "/opt") + set(OGRE_SAMPLE_PATH "/opt/samples") + elseif (UNIX) diff --git a/ports/ogre/CONTROL b/ports/ogre/CONTROL new file mode 100644 index 000000000..40d9e2416 --- /dev/null +++ b/ports/ogre/CONTROL @@ -0,0 +1,4 @@ +Source: ogre +Version: 1.9.0 +Build-Depends: freeimage, freetype, zlib, zziplib +Description: 3D Object-Oriented Graphics Rendering Engine diff --git a/ports/ogre/OGREConfig.cmake b/ports/ogre/OGREConfig.cmake new file mode 100644 index 000000000..a20544431 --- /dev/null +++ b/ports/ogre/OGREConfig.cmake @@ -0,0 +1,37 @@ +#.rst: +# OGREConfig +# ------------ +# +# Dummy OGREConfig to simplify use of OGRE-provided FindOGRE module. +# +# This file is provided as part of the vcpkg port of OGRE . +# It is meant to be found automatically by find_package(OGRE), +# but then offloads all the real work to the FindOGRE module by temporarly +# adding its directory to CMAKE_MODULE_PATH +# +# See the FindOGRE module to see the defined variables:: +# + +# Temporarly add the directory in which OGREConfig.cmake is contained to +# get access to the FindOGRE module +get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) +set(ORIGINAL_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}) +list(APPEND CMAKE_MODULE_PATH ${SELF_DIR}) +find_package(OGRE MODULE) + +# Leave CMAKE_MODULE_PATH as we found it +set(CMAKE_MODULE_PATH ${ORIGINAL_CMAKE_MODULE_PATH}) + +# Handle components +# imported from https://github.com/Kitware/CMake/blob/v3.7.1/Modules/CMakePackageConfigHelpers.cmake#L300 +macro(check_required_components _NAME) + foreach(comp ${${_NAME}_FIND_COMPONENTS}) + if(NOT ${_NAME}_${comp}_FOUND) + if(${_NAME}_FIND_REQUIRED_${comp}) + set(${_NAME}_FOUND FALSE) + endif() + endif() + endforeach() +endmacro() + +check_required_components(OGRE) \ No newline at end of file diff --git a/ports/ogre/portfile.cmake b/ports/ogre/portfile.cmake new file mode 100644 index 000000000..a0989a4a2 --- /dev/null +++ b/ports/ogre/portfile.cmake @@ -0,0 +1,60 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/sinbad-ogre-dd30349ea667) +vcpkg_download_distfile(ARCHIVE + URLS "https://bitbucket.org/sinbad/ogre/get/v1-9-0.zip" + FILENAME "ogre-v1-9-0.zip" + SHA512 de7315a2450ecf0d9073e6a8f0c54737e041016f7ad820556d10701c7d23eefab9d3473476a8e95447c30ab21518b8e4cfb0271db72494ea67a3dea284c9a3d3 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES "${CMAKE_CURRENT_LIST_DIR}/0001-use-vcpkg-freeimage.patch" + "${CMAKE_CURRENT_LIST_DIR}/0002-ogre-cmake-dir-as-option.patch" + "${CMAKE_CURRENT_LIST_DIR}/0003-use-flat-installation.patch" +) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + set(OGRE_STATIC ON) +else() + set(OGRE_STATIC OFF) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS -DOGRE_USE_BOOST:BOOL=OFF + -DOGRE_BUILD_RENDERSYSTEM_D3D9:BOOL=OFF + -DOGRE_INSTALL_DEPENDENCIES:BOOL=OFF + -DOGRE_COPY_DEPENDENCIES:BOOL=OFF + -DOGRE_BUILD_TOOLS:BOOL=OFF + -DOGRE_CMAKE_DIR:STRING=share/ogre + -DOGRE_STATIC:BOOL=${OGRE_STATIC} + -DOGRE_INSTALL_SAMPLES:BOOL=OFF + -DOGRE_INSTALL_TOOLS:BOOL=OFF + # We disable this option because it is broken and we rely on vcpkg_copy_pdbs + -DOGRE_INSTALL_PDB:BOOL=OFF + -DOGRE_BUILD_DOCS:BOOL=OFF + -DOGRE_INSTALL_DOCS:BOOL=OFF + -DOGRE_INSTALL_SAMPLES_SOURCE:BOOL=OFF + -DOGRE_NO_INSTALLATION_SUFFIXES_ON_WIN32:BOOL=ON +) + +vcpkg_install_cmake() + +# Add a OGREConfig.cmake to simplify the process of finding vcpkg OGRE +file(COPY ${CMAKE_CURRENT_LIST_DIR}/OGREConfig.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/ogre) + +# Remove debug includes +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# Remove debug CMake files +# Note that at the moment OGRE do not export imported targets, +# so we do not need to copy the debug imported targets in the +# release CMake path +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + +# Handle copyright +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/ogre) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/ogre/COPYING ${CURRENT_PACKAGES_DIR}/share/ogre/copyright) + +vcpkg_copy_pdbs() \ No newline at end of file -- cgit v1.2.3 From 419d0509337156310b6df7f1b19329f2e46a1c2f Mon Sep 17 00:00:00 2001 From: codicodi Date: Sun, 18 Dec 2016 23:37:12 +0100 Subject: [libmodplug] dont package internal headers --- ports/libmodplug/portfile.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ports/libmodplug/portfile.cmake b/ports/libmodplug/portfile.cmake index 7ffff7091..c6088d960 100644 --- a/ports/libmodplug/portfile.cmake +++ b/ports/libmodplug/portfile.cmake @@ -13,6 +13,11 @@ vcpkg_install_cmake() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +# don't package internal headers +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/include/it_defs.h) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/include/sndfile.h) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/include/stdafx.h) + if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin) file(RENAME ${CURRENT_PACKAGES_DIR}/lib/modplug.dll ${CURRENT_PACKAGES_DIR}/bin/modplug.dll) -- cgit v1.2.3 From f2578ccceed25646b7af6fd0c42e0babce4f7038 Mon Sep 17 00:00:00 2001 From: codicodi Date: Sun, 18 Dec 2016 23:51:24 +0100 Subject: [libmodplug] ...not in this directory though --- ports/libmodplug/portfile.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/libmodplug/portfile.cmake b/ports/libmodplug/portfile.cmake index c6088d960..91f03f690 100644 --- a/ports/libmodplug/portfile.cmake +++ b/ports/libmodplug/portfile.cmake @@ -14,9 +14,9 @@ vcpkg_install_cmake() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # don't package internal headers -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/include/it_defs.h) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/include/sndfile.h) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/include/stdafx.h) +file(REMOVE ${CURRENT_PACKAGES_DIR}/include/libmodplug/it_defs.h) +file(REMOVE ${CURRENT_PACKAGES_DIR}/include/libmodplug/sndfile.h) +file(REMOVE ${CURRENT_PACKAGES_DIR}/include/libmodplug/stdafx.h) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin) -- cgit v1.2.3 From 0fca9cfcf7831f669cd92e89c03e8c9753e99ad8 Mon Sep 17 00:00:00 2001 From: codicodi Date: Mon, 19 Dec 2016 00:37:11 +0100 Subject: [libmodplug] nevermind Those headers are used by ModplugXMMS project --- ports/libmodplug/portfile.cmake | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ports/libmodplug/portfile.cmake b/ports/libmodplug/portfile.cmake index 91f03f690..7ffff7091 100644 --- a/ports/libmodplug/portfile.cmake +++ b/ports/libmodplug/portfile.cmake @@ -13,11 +13,6 @@ vcpkg_install_cmake() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -# don't package internal headers -file(REMOVE ${CURRENT_PACKAGES_DIR}/include/libmodplug/it_defs.h) -file(REMOVE ${CURRENT_PACKAGES_DIR}/include/libmodplug/sndfile.h) -file(REMOVE ${CURRENT_PACKAGES_DIR}/include/libmodplug/stdafx.h) - if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin) file(RENAME ${CURRENT_PACKAGES_DIR}/lib/modplug.dll ${CURRENT_PACKAGES_DIR}/bin/modplug.dll) -- cgit v1.2.3 From 92124c9b5ef9baae6d57e57880e32489cba8068d Mon Sep 17 00:00:00 2001 From: codicodi Date: Mon, 19 Dec 2016 17:38:48 +0100 Subject: [libmodplug] preserve archive extension --- ports/libmodplug/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/libmodplug/portfile.cmake b/ports/libmodplug/portfile.cmake index 7ffff7091..6d2070975 100644 --- a/ports/libmodplug/portfile.cmake +++ b/ports/libmodplug/portfile.cmake @@ -4,7 +4,7 @@ include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libmodplug-${MODPLUG_HASH}) vcpkg_download_distfile(ARCHIVE URLS "https://github.com/Konstanty/libmodplug/archive/${MODPLUG_HASH}.zip" - FILENAME "libmodplug-0.8.8.5-${MODPLUG_HASH}" + FILENAME "libmodplug-0.8.8.5-${MODPLUG_HASH}.zip" SHA512 65840b7748284b400dfe99775e18f44dcc4846bc0ff522d18b9ded42c7032e10683e453110d530722d9e22547b7e5f4878ebfff92f232691cbd5b0638c48d88b) vcpkg_extract_source_archive(${ARCHIVE}) -- cgit v1.2.3 From bcab7f39130af7399453c53ba3a69f1e4d920f95 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 19 Dec 2016 15:16:38 -0800 Subject: [mongo/libbson] Tabs to spaces --- ports/libbson/portfile.cmake | 50 ++++++++-------- ports/mongo-c-driver/portfile.cmake | 40 ++++++------- ports/mongo-cxx-driver/portfile.cmake | 108 +++++++++++++++++----------------- 3 files changed, 99 insertions(+), 99 deletions(-) diff --git a/ports/libbson/portfile.cmake b/ports/libbson/portfile.cmake index e6e5ff352..ce2ccea40 100644 --- a/ports/libbson/portfile.cmake +++ b/ports/libbson/portfile.cmake @@ -10,43 +10,43 @@ vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} - OPTIONS - -DENABLE_TESTS=OFF - -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=ON + OPTIONS + -DENABLE_TESTS=OFF + -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=ON ) vcpkg_install_cmake() file(RENAME - ${CURRENT_PACKAGES_DIR}/include/libbson-1.0 - ${CURRENT_PACKAGES_DIR}/temp) + ${CURRENT_PACKAGES_DIR}/include/libbson-1.0 + ${CURRENT_PACKAGES_DIR}/temp) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include) file(RENAME ${CURRENT_PACKAGES_DIR}/temp ${CURRENT_PACKAGES_DIR}/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) - file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/bson-1.0.lib) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/bson-1.0.lib) - - file(RENAME - ${CURRENT_PACKAGES_DIR}/lib/bson-static-1.0.lib - ${CURRENT_PACKAGES_DIR}/lib/bson-1.0.lib) - file(RENAME - ${CURRENT_PACKAGES_DIR}/debug/lib/bson-static-1.0.lib - ${CURRENT_PACKAGES_DIR}/debug/lib/bson-1.0.lib) - - # drop the __declspec(dllimport) when building static - vcpkg_apply_patches( - SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include - PATCHES - ${CMAKE_CURRENT_LIST_DIR}/static.patch - ) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/bson-1.0.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/bson-1.0.lib) + + file(RENAME + ${CURRENT_PACKAGES_DIR}/lib/bson-static-1.0.lib + ${CURRENT_PACKAGES_DIR}/lib/bson-1.0.lib) + file(RENAME + ${CURRENT_PACKAGES_DIR}/debug/lib/bson-static-1.0.lib + ${CURRENT_PACKAGES_DIR}/debug/lib/bson-1.0.lib) + + # drop the __declspec(dllimport) when building static + vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/static.patch + ) else() - file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/bson-static-1.0.lib) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/bson-static-1.0.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/bson-static-1.0.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/bson-static-1.0.lib) endif() file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libbson RENAME copyright) \ No newline at end of file diff --git a/ports/mongo-c-driver/portfile.cmake b/ports/mongo-c-driver/portfile.cmake index c3b7a0817..833d7393c 100644 --- a/ports/mongo-c-driver/portfile.cmake +++ b/ports/mongo-c-driver/portfile.cmake @@ -10,38 +10,38 @@ vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} - OPTIONS - -DBSON_ROOT_DIR=${CURRENT_INSTALLED_DIR} - -DENABLE_TESTS=OFF - -DENABLE_EXAMPLES=OFF - -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=ON + OPTIONS + -DBSON_ROOT_DIR=${CURRENT_INSTALLED_DIR} + -DENABLE_TESTS=OFF + -DENABLE_EXAMPLES=OFF + -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=ON ) vcpkg_install_cmake() file(RENAME - ${CURRENT_PACKAGES_DIR}/include/libmongoc-1.0 - ${CURRENT_PACKAGES_DIR}/temp) + ${CURRENT_PACKAGES_DIR}/include/libmongoc-1.0 + ${CURRENT_PACKAGES_DIR}/temp) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include) file(RENAME ${CURRENT_PACKAGES_DIR}/temp ${CURRENT_PACKAGES_DIR}/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) - file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/mongoc-1.0.lib) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/mongoc-1.0.lib) - - file(RENAME - ${CURRENT_PACKAGES_DIR}/lib/mongoc-static-1.0.lib - ${CURRENT_PACKAGES_DIR}/lib/mongoc-1.0.lib) - file(RENAME - ${CURRENT_PACKAGES_DIR}/debug/lib/mongoc-static-1.0.lib - ${CURRENT_PACKAGES_DIR}/debug/lib/mongoc-1.0.lib) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/mongoc-1.0.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/mongoc-1.0.lib) + + file(RENAME + ${CURRENT_PACKAGES_DIR}/lib/mongoc-static-1.0.lib + ${CURRENT_PACKAGES_DIR}/lib/mongoc-1.0.lib) + file(RENAME + ${CURRENT_PACKAGES_DIR}/debug/lib/mongoc-static-1.0.lib + ${CURRENT_PACKAGES_DIR}/debug/lib/mongoc-1.0.lib) else() - file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/mongoc-static-1.0.lib) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/mongoc-static-1.0.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/mongoc-static-1.0.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/mongoc-static-1.0.lib) endif() file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver RENAME copyright) \ No newline at end of file diff --git a/ports/mongo-cxx-driver/portfile.cmake b/ports/mongo-cxx-driver/portfile.cmake index a6c97335c..137088109 100644 --- a/ports/mongo-cxx-driver/portfile.cmake +++ b/ports/mongo-cxx-driver/portfile.cmake @@ -10,80 +10,80 @@ vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} - PATCHES - ${CMAKE_CURRENT_LIST_DIR}/disable_test_and_example.patch - ${CMAKE_CURRENT_LIST_DIR}/disable_shared.patch + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/disable_test_and_example.patch + ${CMAKE_CURRENT_LIST_DIR}/disable_shared.patch ) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} - OPTIONS - -DLIBBSON_DIR=${CURRENT_INSTALLED_DIR} - -DLIBMONGOC_DIR=${CURRENT_INSTALLED_DIR} - -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=ON + OPTIONS + -DLIBBSON_DIR=${CURRENT_INSTALLED_DIR} + -DLIBMONGOC_DIR=${CURRENT_INSTALLED_DIR} + -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=ON ) vcpkg_install_cmake() file(RENAME - ${CURRENT_PACKAGES_DIR}/include/bsoncxx/v_noabi/bsoncxx - ${CURRENT_PACKAGES_DIR}/temp) + ${CURRENT_PACKAGES_DIR}/include/bsoncxx/v_noabi/bsoncxx + ${CURRENT_PACKAGES_DIR}/temp) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/bsoncxx) file(RENAME ${CURRENT_PACKAGES_DIR}/temp ${CURRENT_PACKAGES_DIR}/include/bsoncxx) file(RENAME - ${CURRENT_PACKAGES_DIR}/include/mongocxx/v_noabi/mongocxx - ${CURRENT_PACKAGES_DIR}/temp) + ${CURRENT_PACKAGES_DIR}/include/mongocxx/v_noabi/mongocxx + ${CURRENT_PACKAGES_DIR}/temp) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/mongocxx) file(RENAME ${CURRENT_PACKAGES_DIR}/temp ${CURRENT_PACKAGES_DIR}/include/mongocxx) -file(REMOVE_RECURSE - ${CURRENT_PACKAGES_DIR}/lib/cmake - ${CURRENT_PACKAGES_DIR}/debug/lib/cmake - - ${CURRENT_PACKAGES_DIR}/include/bsoncxx/cmake - ${CURRENT_PACKAGES_DIR}/include/bsoncxx/config/private - ${CURRENT_PACKAGES_DIR}/include/bsoncxx/private - ${CURRENT_PACKAGES_DIR}/include/bsoncxx/test - ${CURRENT_PACKAGES_DIR}/include/bsoncxx/third_party - - ${CURRENT_PACKAGES_DIR}/include/mongocxx/cmake - ${CURRENT_PACKAGES_DIR}/include/mongocxx/config/private - ${CURRENT_PACKAGES_DIR}/include/mongocxx/test - ${CURRENT_PACKAGES_DIR}/include/mongocxx/test_util - ${CURRENT_PACKAGES_DIR}/include/mongocxx/private - ${CURRENT_PACKAGES_DIR}/include/mongocxx/exception/private - ${CURRENT_PACKAGES_DIR}/include/mongocxx/options - - ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/lib/cmake + ${CURRENT_PACKAGES_DIR}/debug/lib/cmake + + ${CURRENT_PACKAGES_DIR}/include/bsoncxx/cmake + ${CURRENT_PACKAGES_DIR}/include/bsoncxx/config/private + ${CURRENT_PACKAGES_DIR}/include/bsoncxx/private + ${CURRENT_PACKAGES_DIR}/include/bsoncxx/test + ${CURRENT_PACKAGES_DIR}/include/bsoncxx/third_party + + ${CURRENT_PACKAGES_DIR}/include/mongocxx/cmake + ${CURRENT_PACKAGES_DIR}/include/mongocxx/config/private + ${CURRENT_PACKAGES_DIR}/include/mongocxx/test + ${CURRENT_PACKAGES_DIR}/include/mongocxx/test_util + ${CURRENT_PACKAGES_DIR}/include/mongocxx/private + ${CURRENT_PACKAGES_DIR}/include/mongocxx/exception/private + ${CURRENT_PACKAGES_DIR}/include/mongocxx/options + + ${CURRENT_PACKAGES_DIR}/debug/include) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) - file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/bsoncxx.lib) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/bsoncxx.lib) - file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/mongocxx.lib) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/mongocxx.lib) - - file(RENAME - ${CURRENT_PACKAGES_DIR}/lib/libbsoncxx.lib - ${CURRENT_PACKAGES_DIR}/lib/bsoncxx.lib) - file(RENAME - ${CURRENT_PACKAGES_DIR}/debug/lib/libmongocxx.lib - ${CURRENT_PACKAGES_DIR}/debug/lib/mongocxx.lib) - - # define MONGOCXX_STATIC in config/export.hpp - vcpkg_apply_patches( - SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include - PATCHES - ${CMAKE_CURRENT_LIST_DIR}/static.patch - ) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/bsoncxx.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/bsoncxx.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/mongocxx.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/mongocxx.lib) + + file(RENAME + ${CURRENT_PACKAGES_DIR}/lib/libbsoncxx.lib + ${CURRENT_PACKAGES_DIR}/lib/bsoncxx.lib) + file(RENAME + ${CURRENT_PACKAGES_DIR}/debug/lib/libmongocxx.lib + ${CURRENT_PACKAGES_DIR}/debug/lib/mongocxx.lib) + + # define MONGOCXX_STATIC in config/export.hpp + vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/static.patch + ) else() - file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/libbsoncxx.lib) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/libbsoncxx.lib) - file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/libmongocxx.lib) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/libmongocxx.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/libbsoncxx.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/libbsoncxx.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/libmongocxx.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/libmongocxx.lib) endif() file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/mongo-cxx-driver RENAME copyright) \ No newline at end of file -- cgit v1.2.3 From a077ccc4c7dfd7f2fd3a63aed9458952febcd94a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 19 Dec 2016 15:39:57 -0800 Subject: Avoid unnecessary copy --- toolsrc/src/post_build_lint.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index 3043bd4fa..4f0adf677 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -507,7 +507,7 @@ namespace vcpkg { namespace PostBuildLint static lint_status check_outdated_crt_linkage_of_dlls(const std::vector& dlls) { - const std::vector outdated_crts = OutdatedDynamicCrt::values(); + const std::vector& outdated_crts = OutdatedDynamicCrt::values(); std::vector dlls_with_outdated_crt; -- cgit v1.2.3 From d68abcd321e7cabe3c25a72a90a3c8db6c079e6d Mon Sep 17 00:00:00 2001 From: Christian Ullrich Date: Tue, 20 Dec 2016 09:21:15 +0100 Subject: Mention blank-property trap in FAQ. --- docs/FAQ.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/FAQ.md b/docs/FAQ.md index 7bc57f605..0a82d320e 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -61,6 +61,9 @@ In a corporate scenario, we currently recommend building the libraries once and ## What Visual C++ toolsets are supported? We plan to only support Visual Studio 2015 and above. +## Why does Visual Studio not use my libraries with user-wide integration enabled? +Enabling user-wide integration (`vcpkg integrate install`) changes the default for some project properties. In particular, "C/C++/General/Additional Include Directories" and "Linker/General/Additional Library Directories" are normally blank *without* user-wide integration. *With* integration, a blank value means that the augmented default supplied by vcpkg is overridden, and headers/libraries will not be found. To reinstate the default, set the properties to inherit from parent. + ## Can I acquire my package's sources by Git url+tag? Yes, however we prefer compressed archives of the specific release/commit since the internal downloads and build trees are meant to be read only. Github provides archives for every commit, tag, and branch, so it's always possible to perform this substitution for repositories hosted there. -- cgit v1.2.3 From 704e1ea85af0ee75cc41234e5c9a3df8dd544777 Mon Sep 17 00:00:00 2001 From: codicodi Date: Tue, 20 Dec 2016 14:52:13 +0100 Subject: [sdl2] make SDL2 use libc --- ports/sdl2/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/sdl2/portfile.cmake b/ports/sdl2/portfile.cmake index 81439567c..ba99334eb 100644 --- a/ports/sdl2/portfile.cmake +++ b/ports/sdl2/portfile.cmake @@ -47,6 +47,7 @@ else() -DSDL_STATIC=${SDL_STATIC_LIB} -DSDL_SHARED=${SDL_SHARED_LIB} -DFORCE_STATIC_VCRT=${SDL_STATIC_CRT} + -DLIBC=ON ) vcpkg_install_cmake() -- cgit v1.2.3 From a5bb368f2480bc8d1d6cbeaa9b264792430b1728 Mon Sep 17 00:00:00 2001 From: codicodi Date: Tue, 20 Dec 2016 15:17:24 +0100 Subject: [smpeg2] initial commit --- ports/smpeg2/CMakeLists.txt | 57 ++++++++++++++++++++++++++++++ ports/smpeg2/CONTROL | 4 +++ ports/smpeg2/correct-sdl-headers-dir.patch | 17 +++++++++ ports/smpeg2/portfile.cmake | 27 ++++++++++++++ 4 files changed, 105 insertions(+) create mode 100644 ports/smpeg2/CMakeLists.txt create mode 100644 ports/smpeg2/CONTROL create mode 100644 ports/smpeg2/correct-sdl-headers-dir.patch create mode 100644 ports/smpeg2/portfile.cmake diff --git a/ports/smpeg2/CMakeLists.txt b/ports/smpeg2/CMakeLists.txt new file mode 100644 index 000000000..9f061cfb8 --- /dev/null +++ b/ports/smpeg2/CMakeLists.txt @@ -0,0 +1,57 @@ +cmake_minimum_required(VERSION 2.6) +project(SMPEG2) + +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 +file(WRITE ${CMAKE_SOURCE_DIR}/declare_memset.h "#include \n") +add_definitions(-FIdeclare_memset.h) + +add_library(smpeg2 + audio/bitwindow.cpp + audio/filter.cpp + audio/filter_2.cpp + audio/hufftable.cpp + audio/mpeglayer1.cpp + audio/mpeglayer2.cpp + audio/mpeglayer3.cpp + audio/mpegtable.cpp + audio/mpegtoraw.cpp + audio/MPEGaudio.cpp + video/decoders.cpp + video/floatdct.cpp + video/gdith.cpp + video/jrevdct.cpp + video/motionvec.cpp + video/parseblock.cpp + video/readfile.cpp + video/util.cpp + video/video.cpp + video/MPEGvideo.cpp + MPEG.cpp + MPEGlist.cpp + MPEGring.cpp + MPEGstream.cpp + MPEGsystem.cpp + smpeg.cpp) + +target_link_libraries(smpeg2 ${SDL_LIBRARY}) + +install(TARGETS smpeg2 + RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib) + +if(NOT DEFINED SMPEG_SKIP_HEADERS) + install(FILES smpeg.h MPEGframe.h DESTINATION include) +endif() + +message(STATUS "Link-time dependencies:") +message(STATUS " " ${SDL_LIBRARY}) diff --git a/ports/smpeg2/CONTROL b/ports/smpeg2/CONTROL new file mode 100644 index 000000000..8465a6446 --- /dev/null +++ b/ports/smpeg2/CONTROL @@ -0,0 +1,4 @@ +Source: smpeg2 +Version: 2.0.0 +Description: SDL MPEG Player Library +Build-Depends: sdl2 diff --git a/ports/smpeg2/correct-sdl-headers-dir.patch b/ports/smpeg2/correct-sdl-headers-dir.patch new file mode 100644 index 000000000..601b6c8a8 --- /dev/null +++ b/ports/smpeg2/correct-sdl-headers-dir.patch @@ -0,0 +1,17 @@ +diff --git a/smpeg.h b/smpeg.h +index 6bc2dbd..d12c8f8 100644 +--- a/smpeg.h ++++ b/smpeg.h +@@ -22,9 +22,9 @@ + #ifndef _SMPEG_H_ + #define _SMPEG_H_ + +-#include "SDL.h" +-#include "SDL_mutex.h" +-#include "SDL_audio.h" ++#include "SDL2/SDL.h" ++#include "SDL2/SDL_mutex.h" ++#include "SDL2/SDL_audio.h" + #include "MPEGframe.h" + + #ifdef __cplusplus diff --git a/ports/smpeg2/portfile.cmake b/ports/smpeg2/portfile.cmake new file mode 100644 index 000000000..43e6e623e --- /dev/null +++ b/ports/smpeg2/portfile.cmake @@ -0,0 +1,27 @@ + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/smpeg2-2.0.0) +vcpkg_download_distfile(ARCHIVE + URLS "https://www.libsdl.org/projects/smpeg/release/smpeg2-2.0.0.tar.gz" + FILENAME "smpeg2-2.0.0.tar.gz" + SHA512 80a779d01e7aa76778ef6ceea8041537db9e4b354df413214c4413c875cb98551891cef98fa0f057cc6a3222e4983da9ae65b86bdad2f87f9e2a6751837e2baf) + +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_DEBUG + -DSMPEG_SKIP_HEADERS=ON) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/smpeg2) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/smpeg2/COPYING ${CURRENT_PACKAGES_DIR}/share/smpeg2/copyright) -- cgit v1.2.3 From 12f8636815aeb4fbee37f4eda6fb9cc8354d8936 Mon Sep 17 00:00:00 2001 From: codicodi Date: Tue, 20 Dec 2016 15:37:45 +0100 Subject: [sdl2] bump version --- ports/sdl2/CONTROL | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/sdl2/CONTROL b/ports/sdl2/CONTROL index 7f10c1954..3e6b8a5ec 100644 --- a/ports/sdl2/CONTROL +++ b/ports/sdl2/CONTROL @@ -1,3 +1,3 @@ Source: sdl2 -Version: 2.0.5 -Description: Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. \ No newline at end of file +Version: 2.0.5-1 +Description: Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. -- cgit v1.2.3 From 32ada00583cb96fd40849eb6b2003b8479b65d89 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 20 Dec 2016 14:45:13 -0800 Subject: Improve error message --- toolsrc/src/vcpkg_Dependencies.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp index 41172ba0f..ae7f697fa 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg_Dependencies.cpp @@ -58,7 +58,7 @@ namespace vcpkg { namespace Dependencies expected maybe_spgh = try_load_port(paths, spec.name()); SourceParagraph* spgh = maybe_spgh.get(); - Checks::check_exit(spgh != nullptr, "Cannot find package"); + Checks::check_exit(spgh != nullptr, "Cannot find package %s", spec.name()); process_dependencies(filter_dependencies(spgh->depends, spec.target_triplet())); was_examined.emplace(spec, install_plan_action{install_plan_type::BUILD_AND_INSTALL, nullptr, std::make_unique(std::move(*spgh))}); } -- cgit v1.2.3 From 8b9e624d0dfd4d0ce833027cdc7ac40bad2fe928 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 20 Dec 2016 14:45:35 -0800 Subject: Improve trim implementation --- toolsrc/src/vcpkg_Strings.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/toolsrc/src/vcpkg_Strings.cpp b/toolsrc/src/vcpkg_Strings.cpp index d2e153ede..46a4b1855 100644 --- a/toolsrc/src/vcpkg_Strings.cpp +++ b/toolsrc/src/vcpkg_Strings.cpp @@ -96,15 +96,15 @@ namespace vcpkg {namespace Strings void trim(std::string* s) { - s->erase(s->begin(), std::find_if_not(s->begin(), s->end(), details::isspace)); s->erase(std::find_if_not(s->rbegin(), s->rend(), details::isspace).base(), s->end()); + s->erase(s->begin(), std::find_if_not(s->begin(), s->end(), details::isspace)); } std::string trimmed(const std::string& s) { - auto whitespace_front = std::find_if_not(s.begin(), s.end(), details::isspace); auto whitespace_back = std::find_if_not(s.rbegin(), s.rend(), details::isspace).base(); - return (whitespace_back <= whitespace_front ? std::string() : std::string(whitespace_front, whitespace_back)); + auto whitespace_front = std::find_if_not(s.begin(), whitespace_back, details::isspace); + return std::string(whitespace_front, whitespace_back); } void trim_all_and_remove_whitespace_strings(std::vector* strings) -- cgit v1.2.3 From a82d7a440509a038a18b22d9de419a8d491bf0ea Mon Sep 17 00:00:00 2001 From: Charlie Barto Date: Tue, 20 Dec 2016 20:36:34 -0500 Subject: work on qt5 5.7.1 --- ports/qt5/CONTROL | 2 +- ports/qt5/portfile.cmake | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ports/qt5/CONTROL b/ports/qt5/CONTROL index e38a2c835..dd52e6a64 100644 --- a/ports/qt5/CONTROL +++ b/ports/qt5/CONTROL @@ -1,4 +1,4 @@ Source: qt5 -Version: 5.7-1 +Version: 5.7.1 Description: Qt5 application framework main components. Webengine, examples and tests not included. Build-Depends: sqlite3, libpq \ No newline at end of file diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake index 3cc3a17bb..2152a80e9 100644 --- a/ports/qt5/portfile.cmake +++ b/ports/qt5/portfile.cmake @@ -1,6 +1,6 @@ include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/qt-5.7.0) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/qt-5.7.1) set(OUTPUT_PATH ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) set(ENV{QTDIR} ${OUTPUT_PATH}/qtbase) set(ENV{PATH} "${OUTPUT_PATH}/qtbase/bin;$ENV{PATH}") @@ -16,13 +16,13 @@ set(ENV{PATH} "${JOM_EXE_PATH};${PYTHON3_EXE_PATH};${PERL_EXE_PATH};$ENV{PATH}") set(ENV{INCLUDE} "${CURRENT_INSTALLED_DIR}/include;$ENV{INCLUDE}") set(ENV{LIB} "${CURRENT_INSTALLED_DIR}/lib;$ENV{LIB}") vcpkg_download_distfile(ARCHIVE_FILE - URLS "http://download.qt.io/official_releases/qt/5.7/5.7.0/single/qt-everywhere-opensource-src-5.7.0.7z" - FILENAME "qt-5.7.0.7z" - SHA512 96f0b6bd221be0ed819bc9b52eefcee1774945e25b89169fa927148c1c4a2d85faf63b1d09ef5067573bda9bbf1270fce5f181d086bfe585ddbad4cd77f7f418 + URLS "http://download.qt.io/official_releases/qt/5.7/5.7.1/single/qt-everywhere-opensource-src-5.7.1.7z" + FILENAME "qt-5.7.1.7z" + SHA512 3ffcf490a1c0107a05113aebbf70015c50d05fbb35439273c243133ddb146d51aacae15ecd6411d563cc8cfe103df896394c365a69bc48fc86c3bce6a1af3107 ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) -if (EXISTS ${CURRENT_BUILDTREES_DIR}/src/qt-everywhere-opensource-src-5.7.0) - file(RENAME ${CURRENT_BUILDTREES_DIR}/src/qt-everywhere-opensource-src-5.7.0 ${CURRENT_BUILDTREES_DIR}/src/qt-5.7.0) +if (EXISTS ${CURRENT_BUILDTREES_DIR}/src/qt-everywhere-opensource-src-5.7.1) + file(RENAME ${CURRENT_BUILDTREES_DIR}/src/qt-everywhere-opensource-src-5.7.1 ${CURRENT_BUILDTREES_DIR}/src/qt-5.7.1) endif() file(MAKE_DIRECTORY ${OUTPUT_PATH}) -- cgit v1.2.3 From 8d9c8a6269ee624d38e4c880171429293835177d Mon Sep 17 00:00:00 2001 From: vlj Date: Sat, 17 Dec 2016 11:42:30 +0100 Subject: Modify shaderc so that it uses spirv-tools lib. --- ports/shaderc/CMakeLists_spirv.txt | 14 +++++++++++ ports/shaderc/CONTROL | 2 +- ports/shaderc/portfile.cmake | 48 +++++--------------------------------- 3 files changed, 21 insertions(+), 43 deletions(-) create mode 100644 ports/shaderc/CMakeLists_spirv.txt diff --git a/ports/shaderc/CMakeLists_spirv.txt b/ports/shaderc/CMakeLists_spirv.txt new file mode 100644 index 000000000..6aa738b1f --- /dev/null +++ b/ports/shaderc/CMakeLists_spirv.txt @@ -0,0 +1,14 @@ +option(SUFFIX_D "Add d Suffix to lib" ${SUFFIX_D}) +if(NOT ${SUFFIX_D}) + find_library(SPIRVTOOLSOPT spirv-tools-opt) + find_library(SPIRVTOOLS spirv-tools) +ELSE() + find_library(SPIRVTOOLSOPT spirv-tools-opt) + find_library(SPIRVTOOLS spirv-tools) +ENDIF() + +add_library(SPIRV-Tools-opt STATIC IMPORTED GLOBAL) +set_property(TARGET SPIRV-Tools-opt PROPERTY IMPORTED_LOCATION "${SPIRVTOOLSOPT}") + +add_library(SPIRV-Tools STATIC IMPORTED GLOBAL) +set_property(TARGET SPIRV-Tools PROPERTY IMPORTED_LOCATION "${SPIRVTOOLS}") \ No newline at end of file diff --git a/ports/shaderc/CONTROL b/ports/shaderc/CONTROL index e1e3d02b8..6cab280a6 100644 --- a/ports/shaderc/CONTROL +++ b/ports/shaderc/CONTROL @@ -1,4 +1,4 @@ Source: shaderc Version: 2df47b51d83ad83cbc2e7f8ff2b56776293e8958 Description: A collection of tools, libraries and tests for shader compilation. -Build-Depends: glslang +Build-Depends: glslang, spirv-tools diff --git a/ports/shaderc/portfile.cmake b/ports/shaderc/portfile.cmake index 542d18598..eb17aa827 100644 --- a/ports/shaderc/portfile.cmake +++ b/ports/shaderc/portfile.cmake @@ -37,48 +37,9 @@ if(NOT EXISTS "${SOURCE_PATH}/.git") ) endif() -set(SPIRVTOOLS_GIT_URL "https://github.com/KhronosGroup/SPIRV-Tools.git") -set(SPIRVTOOLS_GIT_REF "f72189c249ba143c6a89a4cf1e7d53337b2ddd40") -set(SPIRVHEADERS_GIT_URL "https://github.com/KhronosGroup/SPIRV-Headers.git") -set(SPIRVHEADERS_GIT_REF "bd47a9abaefac00be692eae677daed1b977e625c") - -if(NOT EXISTS "${DOWNLOADS}/SPIRV-Tools.git") - message(STATUS "Cloning") - vcpkg_execute_required_process( - COMMAND ${GIT} clone --bare ${SPIRVTOOLS_GIT_URL} ${DOWNLOADS}/SPIRV-Tools.git - WORKING_DIRECTORY ${DOWNLOADS} - LOGNAME clone - ) -endif() -if(NOT EXISTS "${DOWNLOADS}/SPIRV-Headers.git") - message(STATUS "Cloning") - vcpkg_execute_required_process( - COMMAND ${GIT} clone --bare ${SPIRVHEADERS_GIT_URL} ${DOWNLOADS}/SPIRV-Headers.git - WORKING_DIRECTORY ${DOWNLOADS} - LOGNAME clone - ) -endif() - file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}/third_party/glslang) -if(NOT EXISTS "${SOURCE_PATH}/third_party/spirv-tools/.git") - message(STATUS "Adding worktree and patching") - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}) - vcpkg_execute_required_process( - COMMAND ${GIT} worktree add -f --detach ${SOURCE_PATH}/third_party/spirv-tools ${SPIRVTOOLS_GIT_REF} - WORKING_DIRECTORY ${DOWNLOADS}/SPIRV-Tools.git - LOGNAME worktree - ) -endif() -if(NOT EXISTS "${SOURCE_PATH}/third_party/spirv-tools/external/spirv-headers/.git") - message(STATUS "Adding worktree and patching") - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}) - vcpkg_execute_required_process( - COMMAND ${GIT} worktree add -f --detach ${SOURCE_PATH}/third_party/spirv-tools/external/spirv-headers ${SPIRVHEADERS_GIT_REF} - WORKING_DIRECTORY ${DOWNLOADS}/SPIRV-Headers.git - LOGNAME worktree - ) -endif() - +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_spirv.txt DESTINATION ${SOURCE_PATH}/third_party/spirv-tools) +file(RENAME ${SOURCE_PATH}/third_party/spirv-tools/CMakeLists_spirv.txt ${SOURCE_PATH}/third_party/spirv-tools/CMakeLists.txt) file(COPY ${CMAKE_CURRENT_LIST_DIR}/build-version.inc DESTINATION ${SOURCE_PATH}/glslc/src) #Note: glslang and spir tools doesn't export symbol and need to be build as static lib for cmake to work @@ -102,13 +63,16 @@ vcpkg_configure_cmake( vcpkg_install_cmake() -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(GLOB EXES "${CURRENT_PACKAGES_DIR}/bin/*.exe") file(COPY ${EXES} DESTINATION ${CURRENT_PACKAGES_DIR}/tools) #Safe to remove as libs are static file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug) + + +file(WRITE ${CURRENT_PACKAGES_DIR}/include/shaderc.txt) # Handle copyright file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/shaderc) -- cgit v1.2.3 From e88b9c916003b8a4384aa46c53d33ae10c9d5cc4 Mon Sep 17 00:00:00 2001 From: Charlie Barto Date: Wed, 21 Dec 2016 14:56:51 -0500 Subject: bump qt5 version --- ports/qt5/portfile.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake index 2152a80e9..c487d79a2 100644 --- a/ports/qt5/portfile.cmake +++ b/ports/qt5/portfile.cmake @@ -117,7 +117,9 @@ file(REMOVE ${DEBUG_LIB_FILES}) file(GLOB DEBUG_LIB_FILES "${CURRENT_PACKAGES_DIR}/lib/*d.prl") file(REMOVE ${DEBUG_LIB_FILES}) file(GLOB DEBUG_LIB_FILES "${CURRENT_PACKAGES_DIR}/lib/*d.pdb") -file(REMOVE ${DEBUG_LIB_FILES}) +if(DEBUG_LIB_FILES) + file(REMOVE ${DEBUG_LIB_FILES}) +endif() file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Gamepad.lib ${CURRENT_PACKAGES_DIR}/lib/Qt5Gamepad.lib) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Gamepad.prl ${CURRENT_PACKAGES_DIR}/lib/Qt5Gamepad.prl) file(GLOB BINARY_TOOLS "${CURRENT_PACKAGES_DIR}/bin/*.exe") -- cgit v1.2.3 From c0cb3ca00997207be8896475667bdca19938c925 Mon Sep 17 00:00:00 2001 From: Christian Ullrich Date: Fri, 23 Dec 2016 11:14:17 +0100 Subject: Copy DLLs for all project types. $(TargetPath) is a simpler way of getting the primary output than assembling it from multiple variables. In addition, $(OutputType) matches $(TargetExt) only for .exe projects. --- scripts/buildsystems/msbuild/vcpkg.targets | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/buildsystems/msbuild/vcpkg.targets b/scripts/buildsystems/msbuild/vcpkg.targets index 7782551c2..ddae84806 100644 --- a/scripts/buildsystems/msbuild/vcpkg.targets +++ b/scripts/buildsystems/msbuild/vcpkg.targets @@ -41,17 +41,17 @@ - + -- cgit v1.2.3 From 335c15a9d05f6410d3df6133ffc60b04fdfbe20f Mon Sep 17 00:00:00 2001 From: Christian Ullrich Date: Fri, 23 Dec 2016 14:45:29 +0100 Subject: Copy DLLs before attempting to regsvr32. --- scripts/buildsystems/msbuild/vcpkg.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/buildsystems/msbuild/vcpkg.targets b/scripts/buildsystems/msbuild/vcpkg.targets index ddae84806..0c748c1d6 100644 --- a/scripts/buildsystems/msbuild/vcpkg.targets +++ b/scripts/buildsystems/msbuild/vcpkg.targets @@ -41,7 +41,7 @@ - + -- cgit v1.2.3 From daeab46090dba4592b776d2e829ad19b9e6b2bff Mon Sep 17 00:00:00 2001 From: vlj Date: Fri, 23 Dec 2016 19:49:55 +0100 Subject: Add gli. --- ports/gli/CONTROL | 3 +++ ports/gli/portfile.cmake | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 ports/gli/CONTROL create mode 100644 ports/gli/portfile.cmake diff --git a/ports/gli/CONTROL b/ports/gli/CONTROL new file mode 100644 index 000000000..8d89bc2d1 --- /dev/null +++ b/ports/gli/CONTROL @@ -0,0 +1,3 @@ +Source: gli +Version: 0.8.2 +Description: OpenGL Image (GLI) https://gli.g-truc.net diff --git a/ports/gli/portfile.cmake b/ports/gli/portfile.cmake new file mode 100644 index 000000000..60ab1e409 --- /dev/null +++ b/ports/gli/portfile.cmake @@ -0,0 +1,21 @@ +#Header only + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/gli-0.8.2.0) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/g-truc/gli/archive/0.8.2.0.tar.gz" + FILENAME "0.8.2.0.tar.gz" + SHA512 c254a4e1497d0add985e4a882c552db99c512cc0e9cc72145d51a6e7deada817d624d9818099a47136a8a3ef1223a26a34e355e3c713166f0bb062e506059834 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +# Remove glm/CMakeLists.txt +file(REMOVE ${SOURCE_PATH}/glm/CMakeLists.txt) + +# Put the license file where vcpkg expects it +file(COPY ${SOURCE_PATH}/external/glm/copying.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/gli/) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/gli/copying.txt ${CURRENT_PACKAGES_DIR}/share/gli/copyright) + +# Copy the glm header files +file(GLOB HEADER_FILES ${SOURCE_PATH}/gli/*) +file(COPY ${HEADER_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include/gli) -- cgit v1.2.3 From 31d5994dd592422e3daaee325eeae727458c0e09 Mon Sep 17 00:00:00 2001 From: nekko1119 Date: Sat, 24 Dec 2016 05:27:22 +0900 Subject: Fix signed/unsigned mismatch warning --- toolsrc/src/vcpkg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index 6858d5518..4748aeb54 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -134,7 +134,7 @@ static void upgrade_to_slash_terminated_sorted_format(std::vector* // (They are not necessarily sorted alphabetically, e.g. libflac) // Therefore we can detect the entries that represent directories by comparing every element with the next one // and checking if the next has a slash immediately after the current one's length - for (int i = 0; i < lines->size() - 1; i++) + for (size_t i = 0; i < lines->size() - 1; i++) { std::string& current_string = lines->at(i); const std::string& next_string = lines->at(i + 1); -- cgit v1.2.3 From 3d58393ad2ee3d0b33fc202f60d22a327928c403 Mon Sep 17 00:00:00 2001 From: codicodi Date: Sat, 24 Dec 2016 02:02:55 +0100 Subject: [lua] don't export from executables --- ports/lua/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/lua/CMakeLists.txt b/ports/lua/CMakeLists.txt index f929c41c9..68de76788 100644 --- a/ports/lua/CMakeLists.txt +++ b/ports/lua/CMakeLists.txt @@ -25,16 +25,16 @@ src/ltable.c src/ltablib.c src/ltm.c src/lundump.c src/lutf8lib.c src/lvm.c src/ # append headers to sources to make them show up in MSVC GUI LIST(APPEND SRC_LIBLUA ${HDR_LIBLUA}) -IF (BUILD_SHARED_LIBS) - ADD_DEFINITIONS ( -DLUA_BUILD_AS_DLL ) -ENDIF () - # remove warnings ADD_DEFINITIONS (-D_CRT_SECURE_NO_WARNINGS ) #DLL ADD_LIBRARY ( lua ${SRC_LIBLUA} ) +IF (BUILD_SHARED_LIBS) + TARGET_COMPILE_DEFINITIONS (lua PRIVATE -DLUA_BUILD_AS_DLL ) +ENDIF () + INSTALL ( TARGETS lua RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib -- cgit v1.2.3 From 90d814f3e28e64542a9a3cc65c99a94286cbdee2 Mon Sep 17 00:00:00 2001 From: codicodi Date: Sat, 24 Dec 2016 02:03:25 +0100 Subject: [lua] bump version --- ports/lua/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/lua/CONTROL b/ports/lua/CONTROL index ca2a82b14..b284bfa85 100644 --- a/ports/lua/CONTROL +++ b/ports/lua/CONTROL @@ -1,3 +1,3 @@ Source: lua -Version: 5.3.3-1 +Version: 5.3.3-2 Description: a powerful, fast, lightweight, embeddable scripting language -- cgit v1.2.3 From 8bcf57f68ad3f2e8052de4b1b2e5e51fde002dc7 Mon Sep 17 00:00:00 2001 From: flysha Date: Sat, 24 Dec 2016 20:16:31 +0800 Subject: [libbson, mongo-c-driver] bump version to 1.5.1 I upgraded libbson and mongo-c-driver to 1.5.1, but forgot to bump the version, this patch fixed it. --- ports/libbson/CONTROL | 2 +- ports/mongo-c-driver/CONTROL | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/libbson/CONTROL b/ports/libbson/CONTROL index 089e34672..371dfcf0c 100644 --- a/ports/libbson/CONTROL +++ b/ports/libbson/CONTROL @@ -1,3 +1,3 @@ Source: libbson -Version: 1.5.0-rc6 +Version: 1.5.1 Description: libbson is a library providing useful routines related to building, parsing, and iterating BSON documents. \ No newline at end of file diff --git a/ports/mongo-c-driver/CONTROL b/ports/mongo-c-driver/CONTROL index 330ff27af..c77352848 100644 --- a/ports/mongo-c-driver/CONTROL +++ b/ports/mongo-c-driver/CONTROL @@ -1,4 +1,4 @@ Source: mongo-c-driver -Version: 1.5.0-rc6 +Version: 1.5.1 Build-Depends: libbson Description: Client library written in C for MongoDB. \ No newline at end of file -- cgit v1.2.3 From efb81070ced633c52e6672d5d1bc5336cde3f1d2 Mon Sep 17 00:00:00 2001 From: flysha Date: Sat, 24 Dec 2016 21:36:21 +0800 Subject: [aws-sdk-cpp] upgrade to 1.0.47 --- ports/aws-sdk-cpp/CONTROL | 2 +- ports/aws-sdk-cpp/portfile.cmake | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/aws-sdk-cpp/CONTROL b/ports/aws-sdk-cpp/CONTROL index 05ea2fc08..989d3a9eb 100644 --- a/ports/aws-sdk-cpp/CONTROL +++ b/ports/aws-sdk-cpp/CONTROL @@ -1,3 +1,3 @@ Source: aws-sdk-cpp -Version: 1.0.34-1 +Version: 1.0.47 Description: AWS SDK for C++ diff --git a/ports/aws-sdk-cpp/portfile.cmake b/ports/aws-sdk-cpp/portfile.cmake index 1cff4bee7..5313e85b7 100644 --- a/ports/aws-sdk-cpp/portfile.cmake +++ b/ports/aws-sdk-cpp/portfile.cmake @@ -1,9 +1,9 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/aws-sdk-cpp-1.0.34) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/aws-sdk-cpp-1.0.47) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/aws/aws-sdk-cpp/archive/1.0.34.tar.gz" - FILENAME "aws-sdk-cpp-1.0.34.tar.gz" - SHA512 21ca03eb323eecb55c29866b73c07956a36aad7c9c051eb7ca201cfd356c3f9732c89898cf0c89660d6c1279dc52438bb389b37d613bf741bae81bb3e773a3c5 + URLS "https://github.com/aws/aws-sdk-cpp/archive/1.0.47.tar.gz" + FILENAME "aws-sdk-cpp-1.0.47.tar.gz" + SHA512 ce7471bafe2763f1c382eed8afeaf6422058599a3aa11ae52909da668c45d12827fcd06b9b3ce34e3c2fa33297fd2e09421b8a89833d581efaf62b7108232acf ) vcpkg_extract_source_archive(${ARCHIVE}) -- cgit v1.2.3 From 1cc6a9c4ce2d920f8786789cf9913db07bbb4aee Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Sat, 24 Dec 2016 15:26:58 +0100 Subject: [qt5] Explicitly avoid compiling qt dependencies that could be available in vcpkg To avoid problems such as the one described in https://github.com/Microsoft/vcpkg/issues/412 . If a particular dependency is actually needed, it can be added `-qt-` or `-system- to use the vcpkg version, see https://github.com/Microsoft/vcpkg/issues/455 . --- ports/qt5/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake index c487d79a2..41c103870 100644 --- a/ports/qt5/portfile.cmake +++ b/ports/qt5/portfile.cmake @@ -47,6 +47,10 @@ vcpkg_execute_required_process( -debug-and-release -force-debug-info ${QT_RUNTIME_LINKAGE} -qt-zlib -qt-libjpeg + -no-libpng + -no-freetype + -no-pcre + -no-harfbuzz -system-sqlite -nomake examples -nomake tests -skip webengine -qt-sql-sqlite -qt-sql-psql -- cgit v1.2.3 From 91f51a084fec588854ea784f3e8a829540664e43 Mon Sep 17 00:00:00 2001 From: flysha Date: Sun, 25 Dec 2016 18:44:20 +0800 Subject: [antlr4] initial commit --- ports/antlr4/CONTROL | 3 ++ ports/antlr4/crt_mt.patch | 36 ++++++++++++++++++++++ ports/antlr4/portfile.cmake | 74 +++++++++++++++++++++++++++++++++++++++++++++ ports/antlr4/static.patch | 12 ++++++++ 4 files changed, 125 insertions(+) create mode 100644 ports/antlr4/CONTROL create mode 100644 ports/antlr4/crt_mt.patch create mode 100644 ports/antlr4/portfile.cmake create mode 100644 ports/antlr4/static.patch diff --git a/ports/antlr4/CONTROL b/ports/antlr4/CONTROL new file mode 100644 index 000000000..dbcf5219c --- /dev/null +++ b/ports/antlr4/CONTROL @@ -0,0 +1,3 @@ +Source: antlr4 +Version: 4.6 +Description: ANother Tool for Language Recognition \ No newline at end of file diff --git a/ports/antlr4/crt_mt.patch b/ports/antlr4/crt_mt.patch new file mode 100644 index 000000000..d2e8a28da --- /dev/null +++ b/ports/antlr4/crt_mt.patch @@ -0,0 +1,36 @@ +diff --git a/runtime/antlr4cpp-vs2015.vcxproj b/runtime/antlr4cpp-vs2015.vcxproj +index 85fa3da..540f031 100644 +--- a/runtime/antlr4cpp-vs2015.vcxproj ++++ b/runtime/antlr4cpp-vs2015.vcxproj +@@ -201,6 +201,7 @@ + 4251 + true + false ++ MultiThreadedDebug + + + Windows +@@ -239,6 +240,7 @@ + 4251 + true + false ++ MultiThreadedDebug + + + Windows +@@ -281,6 +283,7 @@ + + 4251 + true ++ MultiThreaded + + + Windows +@@ -325,6 +328,7 @@ + + 4251 + true ++ MultiThreaded + + + Windows diff --git a/ports/antlr4/portfile.cmake b/ports/antlr4/portfile.cmake new file mode 100644 index 000000000..8b11c95b0 --- /dev/null +++ b/ports/antlr4/portfile.cmake @@ -0,0 +1,74 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/runtime) + +vcpkg_download_distfile(ARCHIVE + URLS "http://www.antlr.org/download/antlr4-cpp-runtime-4.6-source.zip" + FILENAME "antlr4-cpp-runtime-4.6-source.zip" + SHA512 e123c2227e41ce80da5a3758725a018690ed70a4e10c23da26c966259e6bdafa192f4363f5a7e1181ef9a47bf3cc50d6b0ca7b26c8dd2b19222a7edf54de8de2 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src + PATCHES ${CMAKE_CURRENT_LIST_DIR}/crt_mt.patch +) + +if (${VCPKG_LIBRARY_LINKAGE} STREQUAL static) + set(DEBUG_CONFIG "Debug Static") + set(RELEASE_CONFIG "Release Static") +else() + set(DEBUG_CONFIG "Debug DLL") + set(RELEASE_CONFIG "Release DLL") +endif() + +vcpkg_build_msbuild( + PROJECT_PATH ${SOURCE_PATH}/antlr4cpp-vs2015.vcxproj + DEBUG_CONFIGURATION ${DEBUG_CONFIG} + RELEASE_CONFIGURATION ${RELEASE_CONFIG} +) + +file (MAKE_DIRECTORY + ${CURRENT_PACKAGES_DIR}/include) +FILE(COPY ${SOURCE_PATH}/src/ + DESTINATION ${CURRENT_PACKAGES_DIR}/include + FILES_MATCHING PATTERN "*.h") + +file (MAKE_DIRECTORY + ${CURRENT_PACKAGES_DIR}/lib + ${CURRENT_PACKAGES_DIR}/debug/lib) + +file(COPY ${SOURCE_PATH}/bin/vs-2015/${TRIPLET_SYSTEM_ARCH}/${DEBUG_CONFIG}/antlr4-runtime.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) +file(COPY ${SOURCE_PATH}/bin/vs-2015/${TRIPLET_SYSTEM_ARCH}/${RELEASE_CONFIG}/antlr4-runtime.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + +if (${VCPKG_LIBRARY_LINKAGE} STREQUAL static) + vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include + PATCHES ${CMAKE_CURRENT_LIST_DIR}/static.patch + ) +else() + file (MAKE_DIRECTORY + ${CURRENT_PACKAGES_DIR}/bin + ${CURRENT_PACKAGES_DIR}/debug/bin) + + file(COPY + ${SOURCE_PATH}/bin/vs-2015/${TRIPLET_SYSTEM_ARCH}/${DEBUG_CONFIG}/antlr4-runtime.dll + ${SOURCE_PATH}/bin/vs-2015/${TRIPLET_SYSTEM_ARCH}/${DEBUG_CONFIG}/antlr4-runtime.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) + file(COPY + ${SOURCE_PATH}/bin/vs-2015/${TRIPLET_SYSTEM_ARCH}/${RELEASE_CONFIG}/antlr4-runtime.dll + ${SOURCE_PATH}/bin/vs-2015/${TRIPLET_SYSTEM_ARCH}/${RELEASE_CONFIG}/antlr4-runtime.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/bin) +endif() + + +# license not exist in antlr folder. +vcpkg_download_distfile(LICENSE + URLS https://raw.githubusercontent.com/antlr/antlr4/master/LICENSE.txt + FILENAME "antlr4-copyright" + SHA512 c72ae3d5c9f3f07160405b5ca44f01116a9602d82291d6cd218fcc5ec6e8baf985e4baa2acf3d621079585385708bd171c96ef44dd808e60c40a48bc1f56c9ae +) +file(INSTALL ${LICENSE} DESTINATION ${CURRENT_PACKAGES_DIR}/share/antlr4 RENAME copyright) + +message(STATUS "Installing done") \ No newline at end of file diff --git a/ports/antlr4/static.patch b/ports/antlr4/static.patch new file mode 100644 index 000000000..fb54c5ae4 --- /dev/null +++ b/ports/antlr4/static.patch @@ -0,0 +1,12 @@ +diff --git a/antlr4-common.h b/antlr4-common.h +index 197fd6d..34a62c8 100644 +--- a/antlr4-common.h ++++ b/antlr4-common.h +@@ -34,6 +34,7 @@ + #include + #include + ++#define ANTLR4CPP_STATIC + // Defines for the Guid class and other platform dependent stuff. + #ifdef _WIN32 + #pragma warning (disable: 4250) // Class inherits by dominance. -- cgit v1.2.3 From e67cbc48be72a635a75a24e877e8d7a27fb0cc20 Mon Sep 17 00:00:00 2001 From: Olaf van der Spek Date: Sun, 25 Dec 2016 12:22:46 +0100 Subject: Typo in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 99d8dc0b3..78470dd0c 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Finally, create a New Project (or open an existing one) in Visual Studio 2015 or ## Examples See the [`docs\EXAMPLES.md`](docs/EXAMPLES.md) document for specific walkthroughs, including using a package and adding a new package. -See a 4 mm [demo in video](https://www.youtube.com/watch?v=y41WFKbQFTw). +See a 4 minute [demo in video](https://www.youtube.com/watch?v=y41WFKbQFTw). ## Contributing Vcpkg is built with your contributions. Here are some ways you can contribute: -- cgit v1.2.3 From 7ecf688cca944629a8cf09eaf1276b7dc69c1021 Mon Sep 17 00:00:00 2001 From: codicodi Date: Sun, 25 Dec 2016 14:34:01 +0100 Subject: add liblzma --- ports/liblzma/CMakeLists.txt | 104 ++++++++++++++++++++++++ ports/liblzma/CONTROL | 3 + ports/liblzma/auto-define-lzma-api-static.patch | 14 ++++ ports/liblzma/portfile.cmake | 29 +++++++ 4 files changed, 150 insertions(+) create mode 100644 ports/liblzma/CMakeLists.txt create mode 100644 ports/liblzma/CONTROL create mode 100644 ports/liblzma/auto-define-lzma-api-static.patch create mode 100644 ports/liblzma/portfile.cmake diff --git a/ports/liblzma/CMakeLists.txt b/ports/liblzma/CMakeLists.txt new file mode 100644 index 000000000..5bf723c2f --- /dev/null +++ b/ports/liblzma/CMakeLists.txt @@ -0,0 +1,104 @@ +cmake_minimum_required(VERSION 3.0) +project(liblzma) + +add_definitions(-DHAVE_CONFIG_H) +if(BUILD_SHARED_LIBS) + add_definitions(-DLIBLZMADLL_EXPORTS) + add_definitions(-DDLL_EXPORT) +endif() + +include_directories(windows) +include_directories(src/liblzma/common) +include_directories(src/common) +include_directories(src/liblzma/api) +include_directories(src/liblzma/check) +include_directories(src/liblzma/delta) +include_directories(src/liblzma/lz) +include_directories(src/liblzma/lzma) +include_directories(src/liblzma/rangecoder) +include_directories(src/liblzma/simple) + +add_library(liblzma + src/common/tuklib_cpucores.c + src/common/tuklib_physmem.c + src/liblzma/check/check.c + src/liblzma/check/crc32_fast.c + src/liblzma/check/crc32_table.c + src/liblzma/check/crc64_fast.c + src/liblzma/check/crc64_table.c + src/liblzma/check/sha256.c + src/liblzma/common/alone_decoder.c + src/liblzma/common/alone_encoder.c + src/liblzma/common/auto_decoder.c + src/liblzma/common/block_buffer_decoder.c + src/liblzma/common/block_buffer_encoder.c + src/liblzma/common/block_decoder.c + src/liblzma/common/block_encoder.c + src/liblzma/common/block_header_decoder.c + src/liblzma/common/block_header_encoder.c + src/liblzma/common/block_util.c + src/liblzma/common/common.c + src/liblzma/common/easy_buffer_encoder.c + src/liblzma/common/easy_decoder_memusage.c + src/liblzma/common/easy_encoder.c + src/liblzma/common/easy_encoder_memusage.c + src/liblzma/common/easy_preset.c + src/liblzma/common/filter_buffer_decoder.c + src/liblzma/common/filter_buffer_encoder.c + src/liblzma/common/filter_common.c + src/liblzma/common/filter_decoder.c + src/liblzma/common/filter_encoder.c + src/liblzma/common/filter_flags_decoder.c + src/liblzma/common/filter_flags_encoder.c + src/liblzma/common/hardware_cputhreads.c + src/liblzma/common/hardware_physmem.c + src/liblzma/common/index.c + src/liblzma/common/index_decoder.c + src/liblzma/common/index_encoder.c + src/liblzma/common/index_hash.c + src/liblzma/common/outqueue.c + src/liblzma/common/stream_buffer_decoder.c + src/liblzma/common/stream_buffer_encoder.c + src/liblzma/common/stream_decoder.c + src/liblzma/common/stream_encoder.c + src/liblzma/common/stream_encoder_mt.c + src/liblzma/common/stream_flags_common.c + src/liblzma/common/stream_flags_decoder.c + src/liblzma/common/stream_flags_encoder.c + src/liblzma/common/vli_decoder.c + src/liblzma/common/vli_encoder.c + src/liblzma/common/vli_size.c + src/liblzma/delta/delta_common.c + src/liblzma/delta/delta_decoder.c + src/liblzma/delta/delta_encoder.c + src/liblzma/lzma/fastpos_table.c + src/liblzma/lzma/lzma2_decoder.c + src/liblzma/lzma/lzma2_encoder.c + src/liblzma/lzma/lzma_decoder.c + src/liblzma/lzma/lzma_encoder.c + src/liblzma/lzma/lzma_encoder_optimum_fast.c + src/liblzma/lzma/lzma_encoder_optimum_normal.c + src/liblzma/lzma/lzma_encoder_presets.c + src/liblzma/lz/lz_decoder.c + src/liblzma/lz/lz_encoder.c + src/liblzma/lz/lz_encoder_mf.c + src/liblzma/rangecoder/price_table.c + src/liblzma/simple/arm.c + src/liblzma/simple/armthumb.c + src/liblzma/simple/ia64.c + src/liblzma/simple/powerpc.c + src/liblzma/simple/simple_coder.c + src/liblzma/simple/simple_decoder.c + src/liblzma/simple/simple_encoder.c + src/liblzma/simple/sparc.c + src/liblzma/simple/x86.c) + +install(TARGETS liblzma + RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib) + +if(NOT LIBLZMA_SKIP_HEADERS) + install(DIRECTORY ${PROJECT_SOURCE_DIR}/src/liblzma/api/lzma DESTINATION include) + install(FILES ${PROJECT_SOURCE_DIR}/src/liblzma/api/lzma.h DESTINATION include) +endif() diff --git a/ports/liblzma/CONTROL b/ports/liblzma/CONTROL new file mode 100644 index 000000000..648316130 --- /dev/null +++ b/ports/liblzma/CONTROL @@ -0,0 +1,3 @@ +Source: liblzma +Version: 5.2.2 +Description: Compression library with an API similar to that of zlib. diff --git a/ports/liblzma/auto-define-lzma-api-static.patch b/ports/liblzma/auto-define-lzma-api-static.patch new file mode 100644 index 000000000..b2643fe6a --- /dev/null +++ b/ports/liblzma/auto-define-lzma-api-static.patch @@ -0,0 +1,14 @@ +diff --git a/lzma.h b/lzma.h +index ce675a7..ac0fc98 100644 +--- a/lzma.h ++++ b/lzma.h +@@ -187,6 +187,9 @@ + * need to worry about LZMA_API_STATIC. Also the calling convention is + * omitted on Cygwin but not on MinGW. + */ ++ ++#define LZMA_API_STATIC ++ + #ifndef LZMA_API_IMPORT + # if !defined(LZMA_API_STATIC) && defined(_WIN32) && !defined(__GNUC__) + # define LZMA_API_IMPORT __declspec(dllimport) diff --git a/ports/liblzma/portfile.cmake b/ports/liblzma/portfile.cmake new file mode 100644 index 000000000..bb2b6e083 --- /dev/null +++ b/ports/liblzma/portfile.cmake @@ -0,0 +1,29 @@ + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/xz-5.2.2) +vcpkg_download_distfile(ARCHIVE + URLS "http://tukaani.org/xz/xz-5.2.2.tar.gz" + FILENAME "xz-5.2.2.tar.gz" + SHA512 8d6249f93c5c43e1c8eeb21f93b22330fd54575e20bbb4af3d06721192d9f0ca3351878964c9640238ac410b7dd9f16329793c7be7355c7ca0db92c6db6ab813) + +vcpkg_extract_source_archive(${ARCHIVE}) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS_DEBUG + -DLIBLZMA_SKIP_HEADERS=ON) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/auto-define-lzma-api-static.patch) +endif() + +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/liblzma) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/liblzma/COPYING ${CURRENT_PACKAGES_DIR}/share/liblzma/copyright) -- cgit v1.2.3 From f70486314e3ba1962bd80a894e700a4de7fa55cd Mon Sep 17 00:00:00 2001 From: Jason Yang Date: Tue, 27 Dec 2016 18:07:53 +0800 Subject: [azure-storage-cpp] Upgrade to v2.6.0 --- ports/azure-storage-cpp/CONTROL | 2 +- ports/azure-storage-cpp/portfile.cmake | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/azure-storage-cpp/CONTROL b/ports/azure-storage-cpp/CONTROL index 5fc7dbe13..29c80c703 100644 --- a/ports/azure-storage-cpp/CONTROL +++ b/ports/azure-storage-cpp/CONTROL @@ -1,5 +1,5 @@ Source: azure-storage-cpp -Version: 2.5.0 +Version: 2.6.0 Build-Depends: cpprestsdk Description: Microsoft Azure Storage Client SDK for C++ A client library for working with Microsoft Azure storage services including blobs, files, tables, and queues. This client library enables working with the Microsoft Azure storage services which include the blob service for storing binary and text data, the file service for storing binary and text data, the table service for storing structured non-relational data, and the queue service for storing messages that may be accessed by a client. Microsoft Azure Storage team's blog - http://blogs.msdn.com/b/windowsazurestorage/ \ No newline at end of file diff --git a/ports/azure-storage-cpp/portfile.cmake b/ports/azure-storage-cpp/portfile.cmake index fdc858c1a..d83a6d854 100644 --- a/ports/azure-storage-cpp/portfile.cmake +++ b/ports/azure-storage-cpp/portfile.cmake @@ -1,10 +1,10 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/azure-storage-cpp-2.5.0) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/azure-storage-cpp-2.6.0) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/Azure/azure-storage-cpp/archive/v2.5.0.tar.gz" - FILENAME "azure-storage-cpp/v2.5.0.tar.gz" - SHA512 128e02f4c4f741083b7860a1aacabaeee5616684d6a5f7f1b3a88abf7f74e6c46610ed62def2a743e67a20a1d12604b9c44c202d94b56ca0ca02847a2b6c9e1b + URLS "https://github.com/Azure/azure-storage-cpp/archive/v2.6.0.tar.gz" + FILENAME "azure-storage-cpp/v2.6.0.tar.gz" + SHA512 383fc709b04b7a116b553575f27a95b95a66105fe9b96d412fc4f1938e51288f81e49a9578c02993d0bc2a4771265694117b82fd5beaeaf4c32f81eeb8f9be6a ) vcpkg_extract_source_archive(${ARCHIVE}) -- cgit v1.2.3 From 04b62c7be9868ecd180c29a127e3be4072e25a81 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 27 Dec 2016 14:18:23 -0800 Subject: [gli] Make "header-only" comment same as other ports --- ports/gli/portfile.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ports/gli/portfile.cmake b/ports/gli/portfile.cmake index 60ab1e409..c0854909f 100644 --- a/ports/gli/portfile.cmake +++ b/ports/gli/portfile.cmake @@ -1,5 +1,4 @@ -#Header only - +#header-only library include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/gli-0.8.2.0) vcpkg_download_distfile(ARCHIVE -- cgit v1.2.3 From 2d9f8ff115f77a4355b304e3c9c98441606bc605 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 27 Dec 2016 14:23:20 -0800 Subject: [qt5] Bump version --- ports/qt5/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/qt5/CONTROL b/ports/qt5/CONTROL index dd52e6a64..0b34843f1 100644 --- a/ports/qt5/CONTROL +++ b/ports/qt5/CONTROL @@ -1,4 +1,4 @@ Source: qt5 -Version: 5.7.1 +Version: 5.7.1-1 Description: Qt5 application framework main components. Webengine, examples and tests not included. Build-Depends: sqlite3, libpq \ No newline at end of file -- cgit v1.2.3 From 9a2825a0a40855e2fdca807abdb872edf0283d85 Mon Sep 17 00:00:00 2001 From: codicodi Date: Wed, 28 Dec 2016 12:20:11 +0100 Subject: [icu] update to 58.2 --- ports/icu/CONTROL | 2 +- ports/icu/portfile.cmake | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/icu/CONTROL b/ports/icu/CONTROL index a0d0552d7..bbc4a8082 100644 --- a/ports/icu/CONTROL +++ b/ports/icu/CONTROL @@ -1,3 +1,3 @@ Source: icu -Version: 58.1 +Version: 58.2 Description: Mature and widely used Unicode and localization library. diff --git a/ports/icu/portfile.cmake b/ports/icu/portfile.cmake index a8bdd1d80..1d05824a7 100644 --- a/ports/icu/portfile.cmake +++ b/ports/icu/portfile.cmake @@ -10,9 +10,9 @@ endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/icu) vcpkg_download_distfile(ARCHIVE - URLS "http://download.icu-project.org/files/icu4c/58.1/icu4c-58_1-src.zip" - FILENAME "icu4c-58_1-src.zip" - SHA512 b13b1d8aa5e6a08a5cecaea85252354150064ef98ed7bb66b70d32eac5c80874c11f1fc9e3a667075b867fcc848c33ad90e6cada3a279f65b62cb9d46e25181d) + URLS "http://download.icu-project.org/files/icu4c/58.2/icu4c-58_2-src.zip" + FILENAME "icu4c-58_2-src.zip" + SHA512 b985b553186d11d9e5157fc981af5483c435a7b4f3df9574d253d6229ecaf8af0f722488542c3f64f9726ad25e17978eae970d78300a55479df74495f6745d16) vcpkg_extract_source_archive(${ARCHIVE}) if (TRIPLET_SYSTEM_ARCH MATCHES "x86") -- cgit v1.2.3 From da63f3353190339c67cdbe25d99b6bd6be99ba7d Mon Sep 17 00:00:00 2001 From: codicodi Date: Thu, 29 Dec 2016 01:00:43 +0100 Subject: [sdl2] link to CRT libraries --- ports/sdl2/CONTROL | 2 +- ports/sdl2/dont-ignore-default-libs.patch | 22 ++++++++++++++++++++++ ports/sdl2/portfile.cmake | 6 ++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 ports/sdl2/dont-ignore-default-libs.patch diff --git a/ports/sdl2/CONTROL b/ports/sdl2/CONTROL index 3e6b8a5ec..c0d747691 100644 --- a/ports/sdl2/CONTROL +++ b/ports/sdl2/CONTROL @@ -1,3 +1,3 @@ Source: sdl2 -Version: 2.0.5-1 +Version: 2.0.5-2 Description: Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. diff --git a/ports/sdl2/dont-ignore-default-libs.patch b/ports/sdl2/dont-ignore-default-libs.patch new file mode 100644 index 000000000..c9f4c6079 --- /dev/null +++ b/ports/sdl2/dont-ignore-default-libs.patch @@ -0,0 +1,22 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 54a23f0..91c5736 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1549,7 +1549,7 @@ if(SDL_SHARED) + SOVERSION ${LT_REVISION} + OUTPUT_NAME "SDL2") + endif() +- if(MSVC) ++ if(MSVC AND NOT LIBC) + # Don't try to link with the default set of libraries. + set_target_properties(SDL2 PROPERTIES LINK_FLAGS_RELEASE "/NODEFAULTLIB") + set_target_properties(SDL2 PROPERTIES LINK_FLAGS_DEBUG "/NODEFAULTLIB") +@@ -1564,7 +1564,7 @@ if(SDL_STATIC) + add_library(SDL2-static STATIC ${SOURCE_FILES}) + set_target_properties(SDL2-static PROPERTIES OUTPUT_NAME "SDL2") + set_target_properties(SDL2-static PROPERTIES POSITION_INDEPENDENT_CODE ${SDL_STATIC_PIC}) +- if(MSVC) ++ if(MSVC AND NOT LIBC) + set_target_properties(SDL2-static PROPERTIES LINK_FLAGS_RELEASE "/NODEFAULTLIB") + set_target_properties(SDL2-static PROPERTIES LINK_FLAGS_DEBUG "/NODEFAULTLIB") + set_target_properties(SDL2-static PROPERTIES STATIC_LIBRARY_FLAGS "/NODEFAULTLIB") diff --git a/ports/sdl2/portfile.cmake b/ports/sdl2/portfile.cmake index ba99334eb..185e39665 100644 --- a/ports/sdl2/portfile.cmake +++ b/ports/sdl2/portfile.cmake @@ -7,6 +7,12 @@ vcpkg_download_distfile(ARCHIVE_FILE ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/dont-ignore-default-libs.patch +) + if(VCPKG_CMAKE_SYSTEM_NAME MATCHES "WindowsStore") vcpkg_build_msbuild( PROJECT_PATH ${SOURCE_PATH}/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj -- cgit v1.2.3 From 6741f959bb56e750c0aa871212987a0df228f8e5 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Thu, 29 Dec 2016 10:59:02 +0100 Subject: [qt5] Turn -no-pcre -qt-pcre Despite Qt documentation ( http://doc.qt.io/qt-5/configure-options.html ) `-no-pcre` is not recognized as an option, while `-qt-pcre` is recognized as an option. --- ports/qt5/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake index 41c103870..adcec1c8b 100644 --- a/ports/qt5/portfile.cmake +++ b/ports/qt5/portfile.cmake @@ -49,7 +49,7 @@ vcpkg_execute_required_process( -qt-libjpeg -no-libpng -no-freetype - -no-pcre + -qt-pcre -no-harfbuzz -system-sqlite -nomake examples -nomake tests -skip webengine -- cgit v1.2.3 From 614320e0074ed764f4ffba365e18bf0e32cbce85 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Thu, 29 Dec 2016 10:59:48 +0100 Subject: [qt5] Bump version --- ports/qt5/CONTROL | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/qt5/CONTROL b/ports/qt5/CONTROL index 0b34843f1..40bde5f2a 100644 --- a/ports/qt5/CONTROL +++ b/ports/qt5/CONTROL @@ -1,4 +1,4 @@ Source: qt5 -Version: 5.7.1-1 +Version: 5.7.1-2 Description: Qt5 application framework main components. Webengine, examples and tests not included. -Build-Depends: sqlite3, libpq \ No newline at end of file +Build-Depends: sqlite3, libpq -- cgit v1.2.3 From 2d746d8913405693a18d594759c481929704f36f Mon Sep 17 00:00:00 2001 From: codicodi Date: Fri, 30 Dec 2016 13:11:58 +0100 Subject: [icu] force rebuild of database --- ports/icu/CONTROL | 2 +- ports/icu/portfile.cmake | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ports/icu/CONTROL b/ports/icu/CONTROL index bbc4a8082..80a6eb9a6 100644 --- a/ports/icu/CONTROL +++ b/ports/icu/CONTROL @@ -1,3 +1,3 @@ Source: icu -Version: 58.2 +Version: 58.2-1 Description: Mature and widely used Unicode and localization library. diff --git a/ports/icu/portfile.cmake b/ports/icu/portfile.cmake index 1d05824a7..183db43bd 100644 --- a/ports/icu/portfile.cmake +++ b/ports/icu/portfile.cmake @@ -25,6 +25,11 @@ vcpkg_build_msbuild( PROJECT_PATH ${SOURCE_PATH}/source/allinone/allinone.sln PLATFORM ${BUILD_ARCH}) +# force rebuild of database as it sometimies gets overriden by dummy one +vcpkg_build_msbuild( + PROJECT_PATH ${SOURCE_PATH}/source/data/makedata.vcxproj + PLATFORM ${BUILD_ARCH}) + set(ICU_VERSION 58) if(TRIPLET_SYSTEM_ARCH MATCHES "x64") set(ICU_BIN bin64) -- cgit v1.2.3 From bf559d51ec103b1267ba61798f230f8cca413adb Mon Sep 17 00:00:00 2001 From: codicodi Date: Fri, 30 Dec 2016 13:31:33 +0100 Subject: add lz4 --- ports/lz4/CMakeLists.txt | 26 ++++++++++++++++++++++++++ ports/lz4/CONTROL | 3 +++ ports/lz4/auto-define-import-macro.patch | 28 ++++++++++++++++++++++++++++ ports/lz4/portfile.cmake | 29 +++++++++++++++++++++++++++++ 4 files changed, 86 insertions(+) create mode 100644 ports/lz4/CMakeLists.txt create mode 100644 ports/lz4/CONTROL create mode 100644 ports/lz4/auto-define-import-macro.patch create mode 100644 ports/lz4/portfile.cmake diff --git a/ports/lz4/CMakeLists.txt b/ports/lz4/CMakeLists.txt new file mode 100644 index 000000000..a5366f5ab --- /dev/null +++ b/ports/lz4/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.0) +project(lz4) + +if(BUILD_SHARED_LIBS) + add_definitions(-DLZ4_DLL_EXPORT) +endif() +add_definitions(-DXXH_NAMESPACE=LZ4_) + +add_library(lz4 + lib/lz4.c + lib/lz4frame.c + lib/lz4hc.c + lib/xxhash.c) + +install(TARGETS lz4 + RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib) + +if(NOT LZ4_SKIP_INCLUDES) + install(FILES + lib/lz4.h + lib/lz4frame.h + lib/lz4hc.h + DESTINATION include) +endif() diff --git a/ports/lz4/CONTROL b/ports/lz4/CONTROL new file mode 100644 index 000000000..90be24a5b --- /dev/null +++ b/ports/lz4/CONTROL @@ -0,0 +1,3 @@ +Source: lz4 +Version: 1.7.4.2 +Description: Lossless compression algorithm, providing compression speed at 400 MB/s per core. diff --git a/ports/lz4/auto-define-import-macro.patch b/ports/lz4/auto-define-import-macro.patch new file mode 100644 index 000000000..48b4585ea --- /dev/null +++ b/ports/lz4/auto-define-import-macro.patch @@ -0,0 +1,28 @@ +diff --git a/lz4.h b/lz4.h +index 7420ad8..c1c3e56 100644 +--- a/lz4.h ++++ b/lz4.h +@@ -73,6 +73,9 @@ extern "C" { + * LZ4_DLL_EXPORT : + * Enable exporting of functions when building a Windows DLL + */ ++ ++#define LZ4_DLL_IMPORT 1 ++ + #if defined(LZ4_DLL_EXPORT) && (LZ4_DLL_EXPORT==1) + # define LZ4LIB_API __declspec(dllexport) + #elif defined(LZ4_DLL_IMPORT) && (LZ4_DLL_IMPORT==1) +diff --git a/lz4frame.h b/lz4frame.h +index 3104d2e..4442461 100644 +--- a/lz4frame.h ++++ b/lz4frame.h +@@ -55,6 +55,9 @@ extern "C" { + * LZ4_DLL_EXPORT : + * Enable exporting of functions when building a Windows DLL + */ ++ ++#define LZ4_DLL_IMPORT 1 ++ + #if defined(LZ4_DLL_EXPORT) && (LZ4_DLL_EXPORT==1) + # define LZ4FLIB_API __declspec(dllexport) + #elif defined(LZ4_DLL_IMPORT) && (LZ4_DLL_IMPORT==1) diff --git a/ports/lz4/portfile.cmake b/ports/lz4/portfile.cmake new file mode 100644 index 000000000..9e2153e4b --- /dev/null +++ b/ports/lz4/portfile.cmake @@ -0,0 +1,29 @@ + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/lz4-1.7.4.2) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/lz4/lz4/archive/v1.7.4.2.zip" + FILENAME "lz4-1.7.4.2.zip" + SHA512 c9a65031225ccda43ad4c7622e9f36762c18e58b4aaf43b1a33f219186fb55c43ca354f574a1591188db39f57631351b1b90f96e0c150e28de08dcb65c6759d0) + +vcpkg_extract_source_archive(${ARCHIVE}) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS_DEBUG + -DLZ4_SKIP_INCLUDES=ON) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/auto-define-import-macro.patch) +endif() + +file(COPY ${SOURCE_PATH}/lib/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/lz4) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/lz4/LICENSE ${CURRENT_PACKAGES_DIR}/share/lz4/copyright) -- cgit v1.2.3 From aab12428e51d53a1952da92a6b1a50c4cadc3e4e Mon Sep 17 00:00:00 2001 From: codicodi Date: Fri, 30 Dec 2016 15:27:25 +0100 Subject: [icu] fix typo --- ports/icu/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/icu/portfile.cmake b/ports/icu/portfile.cmake index 183db43bd..f2bf7fb6e 100644 --- a/ports/icu/portfile.cmake +++ b/ports/icu/portfile.cmake @@ -25,7 +25,7 @@ vcpkg_build_msbuild( PROJECT_PATH ${SOURCE_PATH}/source/allinone/allinone.sln PLATFORM ${BUILD_ARCH}) -# force rebuild of database as it sometimies gets overriden by dummy one +# force rebuild of database as it sometimes gets overriden by dummy one vcpkg_build_msbuild( PROJECT_PATH ${SOURCE_PATH}/source/data/makedata.vcxproj PLATFORM ${BUILD_ARCH}) -- cgit v1.2.3 From 2a8d1510b47e0214000653b311c2836ef33d2595 Mon Sep 17 00:00:00 2001 From: Adam Martin Date: Sun, 1 Jan 2017 10:08:03 -0600 Subject: [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() -- cgit v1.2.3 From 044c07ece1aa0e3e46e0c059cb5877b1bc18c76c Mon Sep 17 00:00:00 2001 From: codicodi Date: Mon, 2 Jan 2017 01:31:42 +0100 Subject: add bzip2 --- ports/bzip2/CMakeLists.txt | 36 +++++++++++++++++++++++++++ ports/bzip2/CONTROL | 3 +++ ports/bzip2/auto-define-import-macro.patch | 13 ++++++++++ ports/bzip2/fix-import-export-macros.patch | 40 ++++++++++++++++++++++++++++++ ports/bzip2/portfile.cmake | 35 ++++++++++++++++++++++++++ 5 files changed, 127 insertions(+) create mode 100644 ports/bzip2/CMakeLists.txt create mode 100644 ports/bzip2/CONTROL create mode 100644 ports/bzip2/auto-define-import-macro.patch create mode 100644 ports/bzip2/fix-import-export-macros.patch create mode 100644 ports/bzip2/portfile.cmake diff --git a/ports/bzip2/CMakeLists.txt b/ports/bzip2/CMakeLists.txt new file mode 100644 index 000000000..9f9737da3 --- /dev/null +++ b/ports/bzip2/CMakeLists.txt @@ -0,0 +1,36 @@ +cmake_minimum_required(VERSION 3.0) +project(bzip2) + +if(CMAKE_BUILD_TYPE STREQUAL Debug) + add_definitions(-DBZ_DEBUG) # enable extra assertions +endif() + +set(LIBBZ2_SOURCES + blocksort.c + huffman.c + crctable.c + randtable.c + compress.c + decompress.c + bzlib.c) + +add_library(libbz2 ${LIBBZ2_SOURCES}) +set_target_properties(libbz2 PROPERTIES ARCHIVE_OUTPUT_NAME bz2) # reqiured for FindBzip2 to work +if(BUILD_SHARED_LIBS) + target_compile_definitions(libbz2 PRIVATE -DBZ_BUILD_DLL) +endif() + +install(TARGETS libbz2 + RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib) + +if(NOT BZIP2_SKIP_TOOLS) + add_executable(bzip2 bzip2.c ${LIBBZ2_SOURCES}) + add_executable(bzip2recover bzip2recover.c ${LIBBZ2_SOURCES}) + install(TARGETS bzip2 bzip2recover DESTINATION tools) +endif() + +if(NOT BZIP2_SKIP_HEADERS) + install(FILES bzlib.h DESTINATION include) +endif() diff --git a/ports/bzip2/CONTROL b/ports/bzip2/CONTROL new file mode 100644 index 000000000..365527454 --- /dev/null +++ b/ports/bzip2/CONTROL @@ -0,0 +1,3 @@ +Source: bzip2 +Version: 1.0.6 +Description: High-quality data compressor. diff --git a/ports/bzip2/auto-define-import-macro.patch b/ports/bzip2/auto-define-import-macro.patch new file mode 100644 index 000000000..81492d3a5 --- /dev/null +++ b/ports/bzip2/auto-define-import-macro.patch @@ -0,0 +1,13 @@ +diff --git a/bzlib.h b/bzlib.h +index e3ba1d6..d3bed44 100644 +--- a/bzlib.h ++++ b/bzlib.h +@@ -26,6 +26,8 @@ + extern "C" { + #endif + ++#define BZ_IMPORT ++ + #define BZ_RUN 0 + #define BZ_FLUSH 1 + #define BZ_FINISH 2 diff --git a/ports/bzip2/fix-import-export-macros.patch b/ports/bzip2/fix-import-export-macros.patch new file mode 100644 index 000000000..e3ee8494b --- /dev/null +++ b/ports/bzip2/fix-import-export-macros.patch @@ -0,0 +1,40 @@ +diff --git a/bzlib.h b/bzlib.h +index 8277123..84fbd0a 100644 +--- a/bzlib.h ++++ b/bzlib.h +@@ -65,29 +65,23 @@ typedef + } + bz_stream; + +- +-#ifndef BZ_IMPORT +-#define BZ_EXPORT +-#endif +- + #ifndef BZ_NO_STDIO + /* Need a definitition for FILE */ + #include + #endif + + #ifdef _WIN32 +-# include + # ifdef small + /* windows.h define small to char */ + # undef small + # endif +-# ifdef BZ_EXPORT +-# define BZ_API(func) WINAPI func +-# define BZ_EXTERN extern ++# define BZ_API(func) func ++# if defined(BZ_BUILD_DLL) ++# define BZ_EXTERN __declspec(dllexport) ++# elif defined(BZ_IMPORT) ++# define BZ_EXTERN __declspec(dllimport) + # else +- /* import windows dll dynamically */ +-# define BZ_API(func) (WINAPI * func) +-# define BZ_EXTERN ++# define BZ_EXTERN + # endif + #else + # define BZ_API(func) func diff --git a/ports/bzip2/portfile.cmake b/ports/bzip2/portfile.cmake new file mode 100644 index 000000000..128cdee78 --- /dev/null +++ b/ports/bzip2/portfile.cmake @@ -0,0 +1,35 @@ + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/bzip2-1.0.6) +vcpkg_download_distfile(ARCHIVE + URLS "http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz" + FILENAME "bzip2-1.0.6.tar.gz" + SHA512 00ace5438cfa0c577e5f578d8a808613187eff5217c35164ffe044fbafdfec9e98f4192c02a7d67e01e5a5ccced630583ad1003c37697219b0f147343a3fdd12) + +vcpkg_extract_source_archive(${ARCHIVE}) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/fix-import-export-macros.patch) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS_DEBUG + -DBZIP2_SKIP_HEADERS=ON + -DBZIP2_SKIP_TOOLS=ON) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/auto-define-import-macro.patch) +endif() + +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/bzip2) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/bzip2/LICENSE ${CURRENT_PACKAGES_DIR}/share/bzip2/copyright) -- cgit v1.2.3 From 73164f5881b402bde363c0b5ad84436ae2d055cc Mon Sep 17 00:00:00 2001 From: codicodi Date: Mon, 2 Jan 2017 01:35:12 +0100 Subject: [bzip2] fix indentation --- ports/bzip2/portfile.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/bzip2/portfile.cmake b/ports/bzip2/portfile.cmake index 128cdee78..67f56b6d8 100644 --- a/ports/bzip2/portfile.cmake +++ b/ports/bzip2/portfile.cmake @@ -26,9 +26,9 @@ vcpkg_copy_pdbs() if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) vcpkg_apply_patches( - SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include - PATCHES - ${CMAKE_CURRENT_LIST_DIR}/auto-define-import-macro.patch) + SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/auto-define-import-macro.patch) endif() file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/bzip2) -- cgit v1.2.3 From cab893dd2055c9286266ada6fced6b3ee7f92613 Mon Sep 17 00:00:00 2001 From: flysha Date: Mon, 2 Jan 2017 23:58:26 +0800 Subject: [chakracore] upgrade to 1.4.0 --- ports/chakracore/CONTROL | 2 +- ports/chakracore/portfile.cmake | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/chakracore/CONTROL b/ports/chakracore/CONTROL index 593691bbf..24300fdfa 100644 --- a/ports/chakracore/CONTROL +++ b/ports/chakracore/CONTROL @@ -1,3 +1,3 @@ Source: chakracore -Version: 1.3.1 +Version: 1.4.0 Description: Core part of the Chakra Javascript engine \ No newline at end of file diff --git a/ports/chakracore/portfile.cmake b/ports/chakracore/portfile.cmake index 639cf0f65..d4bec63d2 100644 --- a/ports/chakracore/portfile.cmake +++ b/ports/chakracore/portfile.cmake @@ -4,11 +4,11 @@ endif() include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ChakraCore-1.3.1) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ChakraCore-1.4.0) vcpkg_download_distfile(ARCHIVE_FILE - URLS "https://github.com/Microsoft/ChakraCore/archive/v1.3.1.tar.gz" - FILENAME "ChakraCore-1.3.1.tar.gz" - SHA512 52216a03333e44bce235917cfae5ccd6a756056678d9b81c63ec272d9ce5c6afabc673e7910dd3da54fda7927ea62ede980a4371dbb08f6ce4907121c27dbc53 + URLS "https://github.com/Microsoft/ChakraCore/archive/v1.4.0.tar.gz" + FILENAME "ChakraCore-1.4.0.tar.gz" + SHA512 d515d56ff1c5776ca4663e27daa4d1c7ca58c57f097799de756980771b5701e35639eefa4db5921d7327e6607b8920df3b30677eb467123e04536df0d971cebc ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) -- cgit v1.2.3 From 59c34be2526059ebd3e485ee03f2f3d3c86c05b0 Mon Sep 17 00:00:00 2001 From: Christian Ullrich Date: Tue, 3 Jan 2017 14:06:10 +0100 Subject: 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") -- cgit v1.2.3 From 6f1f66541679955b72c02b21dc2b59b026c7c544 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 3 Jan 2017 13:29:17 -0800 Subject: [zlib] Update to 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..6deff6c0c 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://www.zlib.net/zlib-1.2.10.tar.gz" + FILENAME "zlib1210.zip" + SHA512 5fa71052a418a0f2b345fce28af9941bbd1c6ee276ce506ab3092157f15776ee41f96bb1799657227513b852913f96ac52dae8122a437f34b43933ee48d63ee0 ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) -- cgit v1.2.3 From 25a2bf799459b6ee7833398a61e152386f3679df Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 3 Jan 2017 16:35:02 -0800 Subject: [zlib] Update LICENSE --- ports/zlib/LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/zlib/LICENSE b/ports/zlib/LICENSE index 9b2f94711..ca5fddfe0 100644 --- a/ports/zlib/LICENSE +++ b/ports/zlib/LICENSE @@ -1,4 +1,4 @@ -Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler + Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages -- cgit v1.2.3 From 0db465cec2c12ea762b8b756ab92515c466db01b Mon Sep 17 00:00:00 2001 From: Patrick Bader Date: Wed, 4 Jan 2017 14:30:23 +0100 Subject: 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}) -- cgit v1.2.3 From f8210aa32b5029b7b04742b949311f12336141b0 Mon Sep 17 00:00:00 2001 From: Patrick Bader Date: Wed, 4 Jan 2017 15:17:22 +0100 Subject: [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}) -- cgit v1.2.3 From 6a220edfb8454a4fc1652f82f537518ac620033f Mon Sep 17 00:00:00 2001 From: Patrick Bader Date: Wed, 4 Jan 2017 15:17:22 +0100 Subject: [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}) -- cgit v1.2.3 From 41a68f712a5c4d5000c7bfa37a200c18fef29692 Mon Sep 17 00:00:00 2001 From: sdcb Date: Thu, 5 Jan 2017 15:09:40 +0800 Subject: Add dx port. --- ports/dx/CONTROL | 3 +++ ports/dx/portfile.cmake | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 ports/dx/CONTROL create mode 100644 ports/dx/portfile.cmake diff --git a/ports/dx/CONTROL b/ports/dx/CONTROL new file mode 100644 index 000000000..460e42bdb --- /dev/null +++ b/ports/dx/CONTROL @@ -0,0 +1,3 @@ +Source: dx +Version: 1.0.0 +Description: A modern C++ library for DirectX programming \ No newline at end of file diff --git a/ports/dx/portfile.cmake b/ports/dx/portfile.cmake new file mode 100644 index 000000000..085f30c01 --- /dev/null +++ b/ports/dx/portfile.cmake @@ -0,0 +1,20 @@ +#header-only library +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/dx-1.0.0) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/sdcb/dx/archive/1.0.0.tar.gz" + FILENAME "dx-1.0.0.tar.gz" + SHA512 7d0e0550eb27c3a7d3a9c4b78f29290aaf60c02a7c2fabb6e4769673592bc031f8ed430cd777e02096b9b9a8981c7e05b45448bf5c182704e080e61eaeab62f8 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +file(INSTALL + ${SOURCE_PATH}/dx.h + ${SOURCE_PATH}/debug.h + ${SOURCE_PATH}/handle.h + DESTINATION ${CURRENT_PACKAGES_DIR}/include/dx +) + +file(INSTALL + ${SOURCE_PATH}/LICENSE + DESTINATION ${CURRENT_PACKAGES_DIR}/share/dx RENAME copyright) \ No newline at end of file -- cgit v1.2.3 From cff21e04f578479cdf163612c1a90ecc68eb479b Mon Sep 17 00:00:00 2001 From: codicodi Date: Thu, 5 Jan 2017 15:34:06 +0100 Subject: [freetype] specify dependencies --- ports/freetype/CONTROL | 4 ++-- ports/freetype/portfile.cmake | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ports/freetype/CONTROL b/ports/freetype/CONTROL index 614017c81..74f7e4986 100644 --- a/ports/freetype/CONTROL +++ b/ports/freetype/CONTROL @@ -1,4 +1,4 @@ Source: freetype -Version: 2.6.3-2 -Build-Depends: zlib +Version: 2.6.3-3 +Build-Depends: zlib, bzip2, libpng Description: A library to render fonts. \ No newline at end of file diff --git a/ports/freetype/portfile.cmake b/ports/freetype/portfile.cmake index 8d7bf158f..2e5e30c78 100644 --- a/ports/freetype/portfile.cmake +++ b/ports/freetype/portfile.cmake @@ -17,6 +17,10 @@ vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS -DCONFIG_INSTALL_PATH=share/freetype + -DWITH_ZLIB=ON + -DWITH_BZip2=ON + -DWITH_PNG=ON + -DWITH_HarfBuzz=OFF ) vcpkg_install_cmake() -- cgit v1.2.3 From 29aedfad6cd82cc2c071dc99fa5d6aac74af8d49 Mon Sep 17 00:00:00 2001 From: Patrick Bader Date: Thu, 5 Jan 2017 16:42:52 +0100 Subject: 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 ++ ports/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) -- cgit v1.2.3 From d62dda3b030e31f322aaa47b4aeaa0a12fa3201b Mon Sep 17 00:00:00 2001 From: Patrick Bader Date: Thu, 5 Jan 2017 16:48:04 +0100 Subject: 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}) + -- cgit v1.2.3 From 44c86f56db351da15e5a2b2fcca62656ab8cccbf Mon Sep 17 00:00:00 2001 From: Patrick Bader Date: Thu, 5 Jan 2017 19:39:14 +0100 Subject: 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}) - -- cgit v1.2.3 From f99d143dc3e7cf9b07120256d2801da59653b486 Mon Sep 17 00:00:00 2001 From: codicodi Date: Thu, 5 Jan 2017 21:22:32 +0100 Subject: add libarchive --- ports/libarchive/CONTROL | 4 + .../libarchive/auto-define-libarchive-static.patch | 28 ++++ ports/libarchive/fix-buildsystem.patch | 146 +++++++++++++++++++++ ports/libarchive/portfile.cmake | 50 +++++++ ports/libarchive/use-memset-not-bzero.patch | 26 ++++ 5 files changed, 254 insertions(+) create mode 100644 ports/libarchive/CONTROL create mode 100644 ports/libarchive/auto-define-libarchive-static.patch create mode 100644 ports/libarchive/fix-buildsystem.patch create mode 100644 ports/libarchive/portfile.cmake create mode 100644 ports/libarchive/use-memset-not-bzero.patch diff --git a/ports/libarchive/CONTROL b/ports/libarchive/CONTROL new file mode 100644 index 000000000..c035a891e --- /dev/null +++ b/ports/libarchive/CONTROL @@ -0,0 +1,4 @@ +Source: libarchive +Version: 3.2.2 +Description: Library for reading and writing streaming archives +Build-Depends: zlib, bzip2, libxml2, libiconv, lz4, liblzma, openssl diff --git a/ports/libarchive/auto-define-libarchive-static.patch b/ports/libarchive/auto-define-libarchive-static.patch new file mode 100644 index 000000000..41c953ebe --- /dev/null +++ b/ports/libarchive/auto-define-libarchive-static.patch @@ -0,0 +1,28 @@ +diff --git a/archive.h b/archive.h +index ff401e9..602717e 100644 +--- a/archive.h ++++ b/archive.h +@@ -106,6 +106,9 @@ typedef ssize_t la_ssize_t; + * .lib. The default here assumes you're building a DLL. Only + * libarchive source should ever define __LIBARCHIVE_BUILD. + */ ++ ++#define LIBARCHIVE_STATIC ++ + #if ((defined __WIN32__) || (defined _WIN32) || defined(__CYGWIN__)) && (!defined LIBARCHIVE_STATIC) + # ifdef __LIBARCHIVE_BUILD + # ifdef __GNUC__ +diff --git a/archive_entry.h b/archive_entry.h +index 71b1e87..44246b9 100644 +--- a/archive_entry.h ++++ b/archive_entry.h +@@ -85,6 +85,9 @@ typedef int64_t la_int64_t; + * .lib. The default here assumes you're building a DLL. Only + * libarchive source should ever define __LIBARCHIVE_BUILD. + */ ++ ++#define LIBARCHIVE_STATIC ++ + #if ((defined __WIN32__) || (defined _WIN32) || defined(__CYGWIN__)) && (!defined LIBARCHIVE_STATIC) + # ifdef __LIBARCHIVE_BUILD + # ifdef __GNUC__ diff --git a/ports/libarchive/fix-buildsystem.patch b/ports/libarchive/fix-buildsystem.patch new file mode 100644 index 000000000..2568a8c8f --- /dev/null +++ b/ports/libarchive/fix-buildsystem.patch @@ -0,0 +1,146 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a376fce..2d035a1 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -166,7 +166,7 @@ IF (MSVC) + # result of an assignment. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4706") + # /WX option is the same as gcc's -Werror option. +- SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /WX") ++ #SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /WX") <- breaks x64-debug + # /Oi option enables built-in functions. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /Oi") + ################################################################# +@@ -177,6 +177,7 @@ ENDIF (MSVC) + # Enable CTest/CDash support + include(CTest) + ++OPTION(ENABLE_LZO2 "Enable use of LZO2 library" ON) + OPTION(ENABLE_NETTLE "Enable use of Nettle" ON) + OPTION(ENABLE_OPENSSL "Enable use of OpenSSL" ON) + OPTION(ENABLE_LZMA "Enable the use of the system found LZMA library if found" ON) +@@ -357,7 +358,7 @@ IF(DEFINED __GNUWIN32PATH AND EXISTS "${__GNUWIN32PATH}") + # The zlib and the bzip2 Setup program have installed programs and DLLs into + # "C:/Program Files/GnuWin32" by default. + # This is convenience setting for Windows. +- SET(CMAKE_PREFIX_PATH ${__GNUWIN32PATH} $(CMAKE_PREFIX_PATH)) ++ #SET(CMAKE_PREFIX_PATH ${__GNUWIN32PATH} $(CMAKE_PREFIX_PATH)) + # + # If you didn't use Setup program or installed into nonstandard path, + # cmake cannot find out your zlib or bzip2 libraries and include files, +@@ -397,11 +398,12 @@ IF(ZLIB_FOUND) + # + # Test if ZLIB_WINAPI macro is needed to use. + # +- TRY_MACRO_FOR_LIBRARY( +- "${ZLIB_INCLUDE_DIR}" "${ZLIB_LIBRARIES}" +- RUNS +- "#include \nint main() {uLong f = zlibCompileFlags(); return (f&(1U<<10))?0:-1; }" +- ZLIB_WINAPI) ++ SET(ZLIB_WINAPI OFF) # skip following test, it crashes with weird message box ++ #TRY_MACRO_FOR_LIBRARY( ++ # "${ZLIB_INCLUDE_DIR}" "${ZLIB_LIBRARIES}" ++ # RUNS ++ # "#include \nint main() {uLong f = zlibCompileFlags(); return (f&(1U<<10))?0:-1; }" ++ # ZLIB_WINAPI) + IF(ZLIB_WINAPI) + ADD_DEFINITIONS(-DZLIB_WINAPI) + ELSE(ZLIB_WINAPI) +@@ -483,6 +485,7 @@ ENDIF(LZMA_FOUND) + # + # Find LZO2 + # ++IF(ENABLE_LZO2) + IF (LZO2_INCLUDE_DIR) + # Already in cache, be silent + SET(LZO2_FIND_QUIETLY TRUE) +@@ -504,6 +507,7 @@ IF(LZO2_FOUND) + ENDIF(LZO2_FOUND) + MARK_AS_ADVANCED(CLEAR LZO2_INCLUDE_DIR) + MARK_AS_ADVANCED(CLEAR LZO2_LIBRARY) ++ENDIF() + # + # Find LZ4 + # +@@ -923,7 +927,9 @@ IF(ENABLE_ICONV) + CHECK_ICONV("libc" "") + + # If iconv isn't in libc and we have a libiconv, try that. +- FIND_LIBRARY(LIBICONV_PATH NAMES iconv libiconv) ++ FIND_LIBRARY(LIBICONV_PATH1 NAMES iconv libiconv) ++ FIND_LIBRARY(LIBCHARSET_PATH NAMES charset libcharset) ++ SET(LIBICONV_PATH ${LIBICONV_PATH1} ${LIBCHARSET_PATH}) + IF(NOT HAVE_ICONV AND LIBICONV_PATH) + LIST(APPEND CMAKE_REQUIRED_LIBRARIES ${LIBICONV_PATH}) + # Test if a macro is needed for the library. +@@ -1307,9 +1313,13 @@ CHECK_C_SOURCE_COMPILES( + "#include \nint main() { return major(256); }" + MAJOR_IN_SYSMACROS) + ++CMAKE_PUSH_CHECK_STATE() ++set(CMAKE_REQUIRED_INCLUDES ${LZMA_INCLUDE_DIR}) ++set(CMAKE_REQUIRED_LIBRARIES ${LZMA_LIBRARIES}) + CHECK_C_SOURCE_COMPILES( + "#include \n#if LZMA_VERSION < 50020000\n#error unsupported\n#endif\nint main(void){lzma_stream_encoder_mt(0, 0); return 0;}" + HAVE_LZMA_STREAM_ENCODER_MT) ++CMAKE_POP_CHECK_STATE() + + IF(HAVE_STRERROR_R) + SET(HAVE_DECL_STRERROR_R 1) +@@ -1655,12 +1665,12 @@ INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) + ADD_DEFINITIONS(-DHAVE_CONFIG_H) + + # Handle generation of the libarchive.pc file for pkg-config +-INCLUDE(CreatePkgConfigFile) ++#INCLUDE(CreatePkgConfigFile) + + # + # Register installation of PDF documents. + # +-IF(WIN32 AND NOT CYGWIN) ++IF(0 AND WIN32 AND NOT CYGWIN) + # + # On Windows platform, It's better that we install PDF documents + # on one's computer. +diff --git a/libarchive/CMakeLists.txt b/libarchive/CMakeLists.txt +index 4cc9a2c..ef304c5 100644 +--- a/libarchive/CMakeLists.txt ++++ b/libarchive/CMakeLists.txt +@@ -191,28 +191,24 @@ IF(WIN32 AND NOT CYGWIN) + ENDIF(WIN32 AND NOT CYGWIN) + + # Libarchive is a shared library +-ADD_LIBRARY(archive SHARED ${libarchive_SOURCES} ${include_HEADERS}) ++ADD_LIBRARY(archive ${libarchive_SOURCES} ${include_HEADERS}) + TARGET_LINK_LIBRARIES(archive ${ADDITIONAL_LIBS}) ++IF(BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(archive PROPERTIES SOVERSION ${SOVERSION}) +- +-# archive_static is a static library +-ADD_LIBRARY(archive_static STATIC ${libarchive_SOURCES} ${include_HEADERS}) +-TARGET_LINK_LIBRARIES(archive_static ${ADDITIONAL_LIBS}) +-SET_TARGET_PROPERTIES(archive_static PROPERTIES COMPILE_DEFINITIONS +- LIBARCHIVE_STATIC) +-# On Posix systems, libarchive.so and libarchive.a can co-exist. +-IF(NOT WIN32 OR CYGWIN) +- SET_TARGET_PROPERTIES(archive_static PROPERTIES OUTPUT_NAME archive) +-ENDIF(NOT WIN32 OR CYGWIN) ++ELSE() ++SET_TARGET_PROPERTIES(archive PROPERTIES COMPILE_DEFINITIONS LIBARCHIVE_STATIC) ++ENDIF() + + IF(ENABLE_INSTALL) + # How to install the libraries +- INSTALL(TARGETS archive archive_static ++ INSTALL(TARGETS archive + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +- INSTALL_MAN(${libarchive_MANS}) ++ #INSTALL_MAN(${libarchive_MANS}) ++ IF(NOT ARCHIVE_SKIP_HEADERS) + INSTALL(FILES ${include_HEADERS} DESTINATION include) ++ ENDIF() + ENDIF() + + add_subdirectory(test) diff --git a/ports/libarchive/portfile.cmake b/ports/libarchive/portfile.cmake new file mode 100644 index 000000000..26d175516 --- /dev/null +++ b/ports/libarchive/portfile.cmake @@ -0,0 +1,50 @@ +# libarchive uses winapi functions not available in WindowsStore +if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore) + message(FATAL_ERROR "Error: UWP builds are not supported.") +endif() + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libarchive-3.2.2) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/libarchive/libarchive/archive/v3.2.2.zip" + FILENAME "libarchive-3.2.2.zip" + SHA512 74abe8a66514aa344111f08e08015d2972545f6acf0923ff1ce7267bfc6c195ca562078a11d1c49ca36155c6b782b1f7ad08b71d93cb85fa892373479b0d1182) + +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/fix-buildsystem.patch + ${CMAKE_CURRENT_LIST_DIR}/use-memset-not-bzero.patch) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DENABLE_LZO2=OFF + -DENABLE_NETTLE=OFF + -DENABLE_EXPAT=OFF + -DENABLE_LibGCC=OFF + -DENABLE_CNG=OFF + -DENABLE_TAR=OFF + -DENABLE_CPIO=OFF + -DENABLE_CAT=OFF + -DENABLE_XATTR=OFF + -DENABLE_ACL=OFF + -DENABLE_TEST=OFF + -DPOSIX_REGEX_LIB=NONE + OPTIONS_DEBUG + -DARCHIVE_SKIP_HEADERS=ON) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/auto-define-libarchive-static.patch) +endif() + +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libarchive) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/libarchive/COPYING ${CURRENT_PACKAGES_DIR}/share/libarchive/copyright) diff --git a/ports/libarchive/use-memset-not-bzero.patch b/ports/libarchive/use-memset-not-bzero.patch new file mode 100644 index 000000000..d28ab7409 --- /dev/null +++ b/ports/libarchive/use-memset-not-bzero.patch @@ -0,0 +1,26 @@ +diff --git a/libarchive/archive_write_add_filter_xz.c b/libarchive/archive_write_add_filter_xz.c +index 46a6c38..b0f25a6 100644 +--- a/libarchive/archive_write_add_filter_xz.c ++++ b/libarchive/archive_write_add_filter_xz.c +@@ -233,7 +233,7 @@ archive_compressor_xz_init_stream(struct archive_write_filter *f, + if (f->code == ARCHIVE_FILTER_XZ) { + #ifdef HAVE_LZMA_STREAM_ENCODER_MT + if (data->threads != 1) { +- bzero(&mt_options, sizeof(mt_options)); ++ memset(&mt_options, 0, sizeof(mt_options)); + mt_options.threads = data->threads; + mt_options.timeout = 300; + mt_options.filters = data->lzmafilters; +diff --git a/libarchive/archive_write_set_format_xar.c b/libarchive/archive_write_set_format_xar.c +index a2dbc03..15a013c 100644 +--- a/libarchive/archive_write_set_format_xar.c ++++ b/libarchive/archive_write_set_format_xar.c +@@ -2913,7 +2913,7 @@ compression_init_encoder_xz(struct archive *a, + *strm = lzma_init_data; + #ifdef HAVE_LZMA_STREAM_ENCODER_MT + if (threads > 1) { +- bzero(&mt_options, sizeof(mt_options)); ++ memset(&mt_options, 0, sizeof(mt_options)); + mt_options.threads = threads; + mt_options.timeout = 300; + mt_options.filters = lzmafilters; -- cgit v1.2.3 From 0b5e2e9e76e66b566cf4d3f68146fdbdff2bac05 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 5 Jan 2017 12:47:08 -0800 Subject: Use nested namespace definition --- toolsrc/include/vcpkg_Checks.h | 4 ++-- toolsrc/include/vcpkg_Files.h | 4 ++-- toolsrc/include/vcpkg_Graphs.h | 4 ++-- toolsrc/include/vcpkg_Maps.h | 4 ++-- toolsrc/include/vcpkg_Sets.h | 4 ++-- toolsrc/include/vcpkg_Strings.h | 8 ++++---- toolsrc/include/vcpkg_System.h | 4 ++-- toolsrc/src/vcpkg_Checks.cpp | 4 ++-- toolsrc/src/vcpkg_Files.cpp | 4 ++-- toolsrc/src/vcpkg_Strings.cpp | 8 ++++---- toolsrc/src/vcpkg_System.cpp | 6 +++--- 11 files changed, 27 insertions(+), 27 deletions(-) diff --git a/toolsrc/include/vcpkg_Checks.h b/toolsrc/include/vcpkg_Checks.h index 9d9b21ed6..a58b38ac0 100644 --- a/toolsrc/include/vcpkg_Checks.h +++ b/toolsrc/include/vcpkg_Checks.h @@ -2,7 +2,7 @@ #include "vcpkg_Strings.h" -namespace vcpkg {namespace Checks +namespace vcpkg::Checks { __declspec(noreturn) void unreachable(); @@ -46,4 +46,4 @@ namespace vcpkg {namespace Checks exit_with_message(Strings::format(errorMessageTemplate, errorMessageArgs...).c_str()); } } -}} +} diff --git a/toolsrc/include/vcpkg_Files.h b/toolsrc/include/vcpkg_Files.h index 6c9d0d365..3f9570946 100644 --- a/toolsrc/include/vcpkg_Files.h +++ b/toolsrc/include/vcpkg_Files.h @@ -4,7 +4,7 @@ #include "filesystem_fs.h" #include -namespace vcpkg {namespace Files +namespace vcpkg::Files { static const char* FILESYSTEM_INVALID_CHARACTERS = R"(\/:*?"<>|)"; @@ -53,4 +53,4 @@ namespace vcpkg {namespace Files std::vector non_recursive_find_all_files_in_dir(const fs::path& dir); void print_paths(const std::vector& paths); -}} +} diff --git a/toolsrc/include/vcpkg_Graphs.h b/toolsrc/include/vcpkg_Graphs.h index 9444ac45b..933d9ac67 100644 --- a/toolsrc/include/vcpkg_Graphs.h +++ b/toolsrc/include/vcpkg_Graphs.h @@ -3,7 +3,7 @@ #include #include -namespace vcpkg { namespace Graphs +namespace vcpkg::Graphs { enum class ExplorationStatus { @@ -117,4 +117,4 @@ namespace vcpkg { namespace Graphs private: std::unordered_map> vertices; }; -}} +} diff --git a/toolsrc/include/vcpkg_Maps.h b/toolsrc/include/vcpkg_Maps.h index c67462a39..5e2f92f55 100644 --- a/toolsrc/include/vcpkg_Maps.h +++ b/toolsrc/include/vcpkg_Maps.h @@ -4,7 +4,7 @@ #include #include -namespace vcpkg { namespace Maps +namespace vcpkg::Maps { template std::unordered_set extract_key_set(const std::unordered_map& input_map) @@ -38,4 +38,4 @@ namespace vcpkg { namespace Maps } return key_set; } -}} +} diff --git a/toolsrc/include/vcpkg_Sets.h b/toolsrc/include/vcpkg_Sets.h index 7b330f31c..6dec95b89 100644 --- a/toolsrc/include/vcpkg_Sets.h +++ b/toolsrc/include/vcpkg_Sets.h @@ -3,7 +3,7 @@ #include "vcpkg_Checks.h" #include -namespace vcpkg { namespace Sets +namespace vcpkg::Sets { template void remove_all(std::unordered_set* input_set, Container remove_these) @@ -14,4 +14,4 @@ namespace vcpkg { namespace Sets input_set->erase(r); } } -}} +} diff --git a/toolsrc/include/vcpkg_Strings.h b/toolsrc/include/vcpkg_Strings.h index a117a1a81..28853cb5d 100644 --- a/toolsrc/include/vcpkg_Strings.h +++ b/toolsrc/include/vcpkg_Strings.h @@ -2,7 +2,7 @@ #include -namespace vcpkg {namespace Strings {namespace details +namespace vcpkg::Strings::details { inline const char* to_printf_arg(const std::string& s) { @@ -42,9 +42,9 @@ namespace vcpkg {namespace Strings {namespace details } std::wstring wformat_internal(const wchar_t* fmtstr, ...); -}}} +} -namespace vcpkg {namespace Strings +namespace vcpkg::Strings { template std::string format(const char* fmtstr, const Args&...args) @@ -75,4 +75,4 @@ namespace vcpkg {namespace Strings std::string trimmed(const std::string& s); void trim_all_and_remove_whitespace_strings(std::vector* strings); -}} +} diff --git a/toolsrc/include/vcpkg_System.h b/toolsrc/include/vcpkg_System.h index 1101c9b27..c9195163c 100644 --- a/toolsrc/include/vcpkg_System.h +++ b/toolsrc/include/vcpkg_System.h @@ -3,7 +3,7 @@ #include "vcpkg_Strings.h" #include "filesystem_fs.h" -namespace vcpkg {namespace System +namespace vcpkg::System { fs::path get_exe_path_of_current_process(); @@ -93,4 +93,4 @@ namespace vcpkg {namespace System }; std::wstring wdupenv_str(const wchar_t* varname) noexcept; -}} +} diff --git a/toolsrc/src/vcpkg_Checks.cpp b/toolsrc/src/vcpkg_Checks.cpp index 817ac9e96..46b28e55c 100644 --- a/toolsrc/src/vcpkg_Checks.cpp +++ b/toolsrc/src/vcpkg_Checks.cpp @@ -3,7 +3,7 @@ #include #include "vcpkg_System.h" -namespace vcpkg {namespace Checks +namespace vcpkg::Checks { void unreachable() { @@ -41,4 +41,4 @@ namespace vcpkg {namespace Checks exit_with_message(errorMessage); } } -}} +} diff --git a/toolsrc/src/vcpkg_Files.cpp b/toolsrc/src/vcpkg_Files.cpp index 48283e43f..1d4faa773 100644 --- a/toolsrc/src/vcpkg_Files.cpp +++ b/toolsrc/src/vcpkg_Files.cpp @@ -3,7 +3,7 @@ #include #include "vcpkg_System.h" -namespace vcpkg {namespace Files +namespace vcpkg::Files { static const std::regex FILESYSTEM_INVALID_CHARACTERS_REGEX = std::regex(R"([\/:*?"<>|])"); @@ -140,4 +140,4 @@ namespace vcpkg {namespace Files } System::println(""); } -}} +} diff --git a/toolsrc/src/vcpkg_Strings.cpp b/toolsrc/src/vcpkg_Strings.cpp index 46a4b1855..cf7d3b0ee 100644 --- a/toolsrc/src/vcpkg_Strings.cpp +++ b/toolsrc/src/vcpkg_Strings.cpp @@ -7,7 +7,7 @@ #include #include -namespace vcpkg {namespace Strings {namespace details +namespace vcpkg::Strings::details { // To disambiguate between two overloads static const auto isspace = [](const char c) @@ -40,9 +40,9 @@ namespace vcpkg {namespace Strings {namespace details return output; } -}}} +} -namespace vcpkg {namespace Strings +namespace vcpkg::Strings { std::wstring utf8_to_utf16(const std::string& s) { @@ -119,4 +119,4 @@ namespace vcpkg {namespace Strings return s == ""; }), strings->end()); } -}} +} diff --git a/toolsrc/src/vcpkg_System.cpp b/toolsrc/src/vcpkg_System.cpp index 43eae3412..405dfd1b8 100644 --- a/toolsrc/src/vcpkg_System.cpp +++ b/toolsrc/src/vcpkg_System.cpp @@ -3,7 +3,7 @@ #include #include -namespace vcpkg {namespace System +namespace vcpkg::System { fs::path get_exe_path_of_current_process() { @@ -104,6 +104,6 @@ namespace vcpkg {namespace System double Stopwatch2::microseconds() const { return (reinterpret_cast(&end_time)->QuadPart - - reinterpret_cast(&start_time)->QuadPart) * 1000000.0 / reinterpret_cast(&freq)->QuadPart; + reinterpret_cast(&start_time)->QuadPart) * 1000000.0 / reinterpret_cast(&freq)->QuadPart; } -}} +} -- cgit v1.2.3 From 1565cafb836a8efdb7c39c9c1df1ca4d671f3d90 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 5 Jan 2017 14:09:48 -0800 Subject: Use nullptr --- toolsrc/src/metrics.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/toolsrc/src/metrics.cpp b/toolsrc/src/metrics.cpp index 51c7179c8..1806dad87 100644 --- a/toolsrc/src/metrics.cpp +++ b/toolsrc/src/metrics.cpp @@ -237,13 +237,13 @@ true std::wstring GetSQMUser() { - LONG err = NULL; + LONG err; struct RAII_HKEY { - HKEY hkey = NULL; + HKEY hkey = nullptr; ~RAII_HKEY() { - if (hkey != NULL) + if (hkey != nullptr) RegCloseKey(hkey); } } HKCU_SQMClient; @@ -257,7 +257,7 @@ true std::array buffer; DWORD lType = 0; DWORD dwBufferSize = static_cast(buffer.size() * sizeof(wchar_t)); - err = RegQueryValueExW(HKCU_SQMClient.hkey, L"UserId", NULL, &lType, reinterpret_cast(buffer.data()), &dwBufferSize); + err = RegQueryValueExW(HKCU_SQMClient.hkey, L"UserId", nullptr, &lType, reinterpret_cast(buffer.data()), &dwBufferSize); if (err == ERROR_SUCCESS && lType == REG_SZ && dwBufferSize >= sizeof(wchar_t)) { size_t sz = dwBufferSize / sizeof(wchar_t); -- cgit v1.2.3 From 88b5791b0bcaa9cce7f488bbd03042aa65e4417e Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 5 Jan 2017 14:14:11 -0800 Subject: Use Nested Namespace Definition --- toolsrc/include/coff_file_reader.h | 4 ++-- toolsrc/include/post_build_lint.h | 4 ++-- toolsrc/include/vcpkg_Dependencies.h | 4 ++-- toolsrc/include/vcpkg_Environment.h | 4 ++-- toolsrc/include/vcpkg_Input.h | 4 ++-- toolsrc/src/coff_file_reader.cpp | 4 ++-- toolsrc/src/post_build_lint.cpp | 4 ++-- toolsrc/src/vcpkg_Dependencies.cpp | 4 ++-- toolsrc/src/vcpkg_Environment.cpp | 4 ++-- toolsrc/src/vcpkg_Input.cpp | 4 ++-- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/toolsrc/include/coff_file_reader.h b/toolsrc/include/coff_file_reader.h index edf6910a5..24fbf4576 100644 --- a/toolsrc/include/coff_file_reader.h +++ b/toolsrc/include/coff_file_reader.h @@ -3,7 +3,7 @@ #include "MachineType.h" #include "filesystem_fs.h" -namespace vcpkg {namespace COFFFileReader +namespace vcpkg::COFFFileReader { struct dll_info { @@ -18,4 +18,4 @@ namespace vcpkg {namespace COFFFileReader dll_info read_dll(const fs::path& path); lib_info read_lib(const fs::path& path); -}} +} diff --git a/toolsrc/include/post_build_lint.h b/toolsrc/include/post_build_lint.h index a5fb9149f..215a237aa 100644 --- a/toolsrc/include/post_build_lint.h +++ b/toolsrc/include/post_build_lint.h @@ -2,7 +2,7 @@ #include "package_spec.h" #include "vcpkg_paths.h" -namespace vcpkg {namespace PostBuildLint +namespace vcpkg::PostBuildLint { void perform_all_checks(const package_spec& spec, const vcpkg_paths& paths); -}} +} diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 3616e6be9..4da9de694 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -4,7 +4,7 @@ #include "StatusParagraphs.h" #include "vcpkg_paths.h" -namespace vcpkg {namespace Dependencies +namespace vcpkg::Dependencies { enum class install_plan_type { @@ -27,4 +27,4 @@ namespace vcpkg {namespace Dependencies }; std::vector create_install_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); -}} +} diff --git a/toolsrc/include/vcpkg_Environment.h b/toolsrc/include/vcpkg_Environment.h index 877ac7deb..1e8624d89 100644 --- a/toolsrc/include/vcpkg_Environment.h +++ b/toolsrc/include/vcpkg_Environment.h @@ -1,7 +1,7 @@ #pragma once #include "vcpkg_paths.h" -namespace vcpkg {namespace Environment +namespace vcpkg::Environment { void ensure_nuget_on_path(const vcpkg_paths& paths); @@ -14,4 +14,4 @@ namespace vcpkg {namespace Environment ensure_cmake_on_path(paths); ensure_git_on_path(paths); } -}} +} diff --git a/toolsrc/include/vcpkg_Input.h b/toolsrc/include/vcpkg_Input.h index 5ce90e3b9..3cce334c4 100644 --- a/toolsrc/include/vcpkg_Input.h +++ b/toolsrc/include/vcpkg_Input.h @@ -3,7 +3,7 @@ #include "package_spec.h" #include "vcpkg_paths.h" -namespace vcpkg {namespace Input +namespace vcpkg::Input { package_spec check_and_get_package_spec(const std::string& package_spec_as_string, const triplet& default_target_triplet, const std::string& example_text); @@ -12,4 +12,4 @@ namespace vcpkg {namespace Input void check_triplet(const triplet& t, const vcpkg_paths& paths); void check_triplets(std::vector triplets, const vcpkg_paths& paths); -}} +} diff --git a/toolsrc/src/coff_file_reader.cpp b/toolsrc/src/coff_file_reader.cpp index 1f30ea70b..8ce714bbe 100644 --- a/toolsrc/src/coff_file_reader.cpp +++ b/toolsrc/src/coff_file_reader.cpp @@ -6,7 +6,7 @@ using namespace std; -namespace vcpkg { namespace COFFFileReader +namespace vcpkg::COFFFileReader { template static T reinterpret_bytes(const char* data) @@ -306,4 +306,4 @@ namespace vcpkg { namespace COFFFileReader return {std::vector(machine_types.cbegin(), machine_types.cend())}; } -}} +} diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index 4f0adf677..1fca3a2f6 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -7,7 +7,7 @@ #include "BuildInfo.h" #include -namespace vcpkg { namespace PostBuildLint +namespace vcpkg::PostBuildLint { enum class lint_status { @@ -668,4 +668,4 @@ namespace vcpkg { namespace PostBuildLint System::println("-- Performing post-build validation done"); } -}} +} diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp index ae7f697fa..f1464a605 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg_Dependencies.cpp @@ -9,7 +9,7 @@ #include "vcpkg_Files.h" #include "vcpkg.h" -namespace vcpkg { namespace Dependencies +namespace vcpkg::Dependencies { std::vector create_install_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db) { @@ -72,4 +72,4 @@ namespace vcpkg { namespace Dependencies } return ret; } -}} +} diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index ed70e6881..c7eec3bd0 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -5,7 +5,7 @@ #include "metrics.h" #include "vcpkg_System.h" -namespace vcpkg {namespace Environment +namespace vcpkg::Environment { static const fs::path default_cmake_installation_dir = "C:/Program Files/CMake/bin"; static const fs::path default_cmake_installation_dir_x86 = "C:/Program Files (x86)/CMake/bin"; @@ -83,4 +83,4 @@ namespace vcpkg {namespace Environment // TODO: switch out ExecutionPolicy Bypass with "Remove Mark Of The Web" code and restore RemoteSigned ensure_on_path(nuget_version, L"nuget 2>&1", L"powershell -ExecutionPolicy Bypass scripts\\fetchDependency.ps1 -Dependency nuget"); } -}} +} diff --git a/toolsrc/src/vcpkg_Input.cpp b/toolsrc/src/vcpkg_Input.cpp index 29d487fdb..a8145230c 100644 --- a/toolsrc/src/vcpkg_Input.cpp +++ b/toolsrc/src/vcpkg_Input.cpp @@ -3,7 +3,7 @@ #include "metrics.h" #include "vcpkg_Commands.h" -namespace vcpkg {namespace Input +namespace vcpkg::Input { package_spec check_and_get_package_spec(const std::string& package_spec_as_string, const triplet& default_target_triplet, const std::string& example_text) { @@ -49,4 +49,4 @@ namespace vcpkg {namespace Input check_triplet(spec.target_triplet(), paths); } } -}} +} -- cgit v1.2.3 From 6e29b7b8d4b3a21e46a721f79d184213d1c874a4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 5 Jan 2017 14:21:09 -0800 Subject: Pass by reference --- toolsrc/include/vcpkg_Input.h | 2 +- toolsrc/src/vcpkg_Input.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/toolsrc/include/vcpkg_Input.h b/toolsrc/include/vcpkg_Input.h index 3cce334c4..96cbeecc3 100644 --- a/toolsrc/include/vcpkg_Input.h +++ b/toolsrc/include/vcpkg_Input.h @@ -11,5 +11,5 @@ namespace vcpkg::Input void check_triplet(const triplet& t, const vcpkg_paths& paths); - void check_triplets(std::vector triplets, const vcpkg_paths& paths); + void check_triplets(const std::vector& triplets, const vcpkg_paths& paths); } diff --git a/toolsrc/src/vcpkg_Input.cpp b/toolsrc/src/vcpkg_Input.cpp index a8145230c..365f28cdb 100644 --- a/toolsrc/src/vcpkg_Input.cpp +++ b/toolsrc/src/vcpkg_Input.cpp @@ -42,7 +42,7 @@ namespace vcpkg::Input } } - void check_triplets(std::vector triplets, const vcpkg_paths& paths) + void check_triplets(const std::vector& triplets, const vcpkg_paths& paths) { for (const package_spec& spec : triplets) { -- cgit v1.2.3 From 708e93d82acd4da9c651cc7043dfd32a182ecc11 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 5 Jan 2017 14:25:50 -0800 Subject: Use Nested Namespace Definition --- toolsrc/include/BuildInfo.h | 4 ++-- toolsrc/include/Paragraphs.h | 4 ++-- toolsrc/include/vcpkg_info.h | 4 ++-- toolsrc/include/vcpkglib_helpers.h | 4 ++-- toolsrc/src/BuildInfo.cpp | 4 ++-- toolsrc/src/Paragraphs.cpp | 4 ++-- toolsrc/src/vcpkg_info.cpp | 4 ++-- toolsrc/src/vcpkglib_helpers.cpp | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/toolsrc/include/BuildInfo.h b/toolsrc/include/BuildInfo.h index 49811d521..c90ad7a4e 100644 --- a/toolsrc/include/BuildInfo.h +++ b/toolsrc/include/BuildInfo.h @@ -4,7 +4,7 @@ #include "Paragraphs.h" #include -namespace vcpkg { namespace PostBuildLint +namespace vcpkg::PostBuildLint { enum class LinkageType { @@ -126,4 +126,4 @@ namespace vcpkg { namespace PostBuildLint }; BuildInfo read_build_info(const fs::path& filepath); -}} +} diff --git a/toolsrc/include/Paragraphs.h b/toolsrc/include/Paragraphs.h index 9e9fafe49..761b49759 100644 --- a/toolsrc/include/Paragraphs.h +++ b/toolsrc/include/Paragraphs.h @@ -3,8 +3,8 @@ #include "filesystem_fs.h" #include -namespace vcpkg { namespace Paragraphs +namespace vcpkg::Paragraphs { std::vector> get_paragraphs(const fs::path& control_path); std::vector> parse_paragraphs(const std::string& str); -}} +} diff --git a/toolsrc/include/vcpkg_info.h b/toolsrc/include/vcpkg_info.h index 01da06307..5380e0158 100644 --- a/toolsrc/include/vcpkg_info.h +++ b/toolsrc/include/vcpkg_info.h @@ -2,9 +2,9 @@ #include -namespace vcpkg { namespace Info +namespace vcpkg::Info { const std::string& version(); const std::string& email(); -}} +} diff --git a/toolsrc/include/vcpkglib_helpers.h b/toolsrc/include/vcpkglib_helpers.h index 019bb8c39..8a08513f3 100644 --- a/toolsrc/include/vcpkglib_helpers.h +++ b/toolsrc/include/vcpkglib_helpers.h @@ -2,7 +2,7 @@ #include -namespace vcpkg {namespace details +namespace vcpkg::details { std::string optional_field(const std::unordered_map& fields, const std::string& fieldname); std::string remove_optional_field(std::unordered_map* fields, const std::string& fieldname); @@ -11,4 +11,4 @@ namespace vcpkg {namespace details std::string remove_required_field(std::unordered_map* fields, const std::string& fieldname); std::string shorten_description(const std::string& desc); -}} +} diff --git a/toolsrc/src/BuildInfo.cpp b/toolsrc/src/BuildInfo.cpp index f151a3ea5..a45dc4b72 100644 --- a/toolsrc/src/BuildInfo.cpp +++ b/toolsrc/src/BuildInfo.cpp @@ -2,7 +2,7 @@ #include "vcpkg_Checks.h" #include "vcpkglib_helpers.h" -namespace vcpkg { namespace PostBuildLint +namespace vcpkg::PostBuildLint { const ConfigurationType& BuildType::config() const { @@ -161,4 +161,4 @@ namespace vcpkg { namespace PostBuildLint { return this->m_dll_name; } -}} +} diff --git a/toolsrc/src/Paragraphs.cpp b/toolsrc/src/Paragraphs.cpp index 823b4a85e..d99ad45cf 100644 --- a/toolsrc/src/Paragraphs.cpp +++ b/toolsrc/src/Paragraphs.cpp @@ -1,7 +1,7 @@ #include "Paragraphs.h" #include "vcpkg_Files.h" -namespace vcpkg { namespace Paragraphs +namespace vcpkg::Paragraphs { struct Parser { @@ -160,4 +160,4 @@ namespace vcpkg { namespace Paragraphs { return Parser(str.c_str(), str.c_str() + str.size()).get_paragraphs(); } -}} +} diff --git a/toolsrc/src/vcpkg_info.cpp b/toolsrc/src/vcpkg_info.cpp index 25c09d6da..69bc6a355 100644 --- a/toolsrc/src/vcpkg_info.cpp +++ b/toolsrc/src/vcpkg_info.cpp @@ -6,7 +6,7 @@ #define VCPKG_VERSION_AS_STRING MACRO_TO_STRING(VCPKG_VERSION)"" // Double quotes needed at the end to prevent blank token -namespace vcpkg { namespace Info +namespace vcpkg::Info { const std::string& version() { @@ -31,4 +31,4 @@ namespace vcpkg { namespace Info static const std::string s_email = R"(vcpkg@microsoft.com)"; return s_email; } -}} +} diff --git a/toolsrc/src/vcpkglib_helpers.cpp b/toolsrc/src/vcpkglib_helpers.cpp index d104bb19d..fdc287507 100644 --- a/toolsrc/src/vcpkglib_helpers.cpp +++ b/toolsrc/src/vcpkglib_helpers.cpp @@ -3,7 +3,7 @@ #include #include -namespace vcpkg {namespace details +namespace vcpkg::details { std::string optional_field(const std::unordered_map& fields, const std::string& fieldname) { @@ -53,4 +53,4 @@ namespace vcpkg {namespace details simple_desc.append("..."); return simple_desc; } -}} +} -- cgit v1.2.3 From 64e1bf8de73d18c85776c4cce2f40281f3ebb253 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 5 Jan 2017 14:27:36 -0800 Subject: Use Nested Namespace Definition --- toolsrc/src/tests_paragraph.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolsrc/src/tests_paragraph.cpp b/toolsrc/src/tests_paragraph.cpp index 6d9e46fcf..fb20eee82 100644 --- a/toolsrc/src/tests_paragraph.cpp +++ b/toolsrc/src/tests_paragraph.cpp @@ -7,14 +7,14 @@ using namespace Microsoft::VisualStudio::CppUnitTestFramework; -namespace Microsoft { namespace VisualStudio { namespace CppUnitTestFramework +namespace Microsoft::VisualStudio::CppUnitTestFramework { template <> inline std::wstring ToString(const vcpkg::package_spec_parse_result& t) { return ToString(static_cast(t)); } -}}} +} namespace UnitTest1 { -- cgit v1.2.3 From e5f60816cb6a786aa828aa2845522bb81c02cbe6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 22 Dec 2016 16:43:47 -0800 Subject: Introduce ImmutableSortedVector --- toolsrc/include/ImmutableSortedVector.h | 48 +++++++++++++++++++++++++ toolsrc/include/vcpkg.h | 3 +- toolsrc/src/vcpkg.cpp | 2 +- toolsrc/vcpkgcommon/vcpkgcommon.vcxproj | 1 + toolsrc/vcpkgcommon/vcpkgcommon.vcxproj.filters | 3 ++ 5 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 toolsrc/include/ImmutableSortedVector.h diff --git a/toolsrc/include/ImmutableSortedVector.h b/toolsrc/include/ImmutableSortedVector.h new file mode 100644 index 000000000..681f9fd4d --- /dev/null +++ b/toolsrc/include/ImmutableSortedVector.h @@ -0,0 +1,48 @@ +#pragma once + +#include +#include + +// Add more forwarding functions to the delegate std::vector as needed. +namespace vcpkg +{ + template + class ImmutableSortedVector + { + public: + static ImmutableSortedVector create(std::vector vector) + { + ImmutableSortedVector out; + out.delegate = std::move(vector); + if (!std::is_sorted(out.delegate.cbegin(), out.delegate.cend())) + { + std::sort(out.delegate.begin(), out.delegate.end()); + } + + return out; + } + + typename std::vector::const_iterator begin() const + { + return this->delegate.cbegin(); + } + + typename std::vector::const_iterator end() const + { + return this->delegate.cend(); + } + + typename std::vector::const_iterator cbegin() const + { + return this->delegate.cbegin(); + } + + typename std::vector::const_iterator cend() const + { + return this->delegate.cend(); + } + + private: + std::vector delegate; + }; +} diff --git a/toolsrc/include/vcpkg.h b/toolsrc/include/vcpkg.h index 75dc40b43..b1653d197 100644 --- a/toolsrc/include/vcpkg.h +++ b/toolsrc/include/vcpkg.h @@ -4,6 +4,7 @@ #include "BinaryParagraph.h" #include "StatusParagraphs.h" #include "vcpkg_paths.h" +#include "ImmutableSortedVector.h" namespace vcpkg { @@ -14,7 +15,7 @@ namespace vcpkg struct StatusParagraph_and_associated_files { StatusParagraph pgh; - std::vector files; + ImmutableSortedVector files; }; std::vector get_installed_files(const vcpkg_paths& paths, const StatusParagraphs& status_db); diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index 4748aeb54..eb2184ccb 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -204,7 +204,7 @@ std::vector vcpkg::get_installed_files(con } ), installed_files_of_current_pgh.end()); - StatusParagraph_and_associated_files pgh_and_files = {*pgh, std::move(installed_files_of_current_pgh)}; + StatusParagraph_and_associated_files pgh_and_files = {*pgh, ImmutableSortedVector::create(std::move(installed_files_of_current_pgh))}; installed_files.push_back(std::move(pgh_and_files)); } diff --git a/toolsrc/vcpkgcommon/vcpkgcommon.vcxproj b/toolsrc/vcpkgcommon/vcpkgcommon.vcxproj index 218a826ad..c0d108602 100644 --- a/toolsrc/vcpkgcommon/vcpkgcommon.vcxproj +++ b/toolsrc/vcpkgcommon/vcpkgcommon.vcxproj @@ -128,6 +128,7 @@ + diff --git a/toolsrc/vcpkgcommon/vcpkgcommon.vcxproj.filters b/toolsrc/vcpkgcommon/vcpkgcommon.vcxproj.filters index 4d40bfbe2..bba605c54 100644 --- a/toolsrc/vcpkgcommon/vcpkgcommon.vcxproj.filters +++ b/toolsrc/vcpkgcommon/vcpkgcommon.vcxproj.filters @@ -62,5 +62,8 @@ Header Files + + Header Files + \ No newline at end of file -- cgit v1.2.3 From f4c34bb42dd0fe8217d4d54a9a4a2eeecdb0f0f4 Mon Sep 17 00:00:00 2001 From: Silvio Date: Thu, 5 Jan 2017 23:37:37 +0100 Subject: vcpkg_apply_patches: add QUIET option --- scripts/cmake/vcpkg_apply_patches.cmake | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/scripts/cmake/vcpkg_apply_patches.cmake b/scripts/cmake/vcpkg_apply_patches.cmake index cd3026b6a..d509e36ec 100644 --- a/scripts/cmake/vcpkg_apply_patches.cmake +++ b/scripts/cmake/vcpkg_apply_patches.cmake @@ -1,5 +1,26 @@ +#.rst: +# .. command:: vcpkg_apply_patches +# +# Apply a set of patches to a source tree. +# +# :: +# vcpkg_apply_patches(SOURCE_PATH +# PATCHES patch1 [patch ...] +# ) +# +# ``SOURCE_PATH`` +# The source path in which apply the patches. +# ``PATCHES`` +# A list of patches that are applied to the source tree +# ``QUIET`` +# If this option is passed, the warning message when applyng +# a patch failes is not printed. This is convenient for patches +# that are known to fail even on a clean source tree, and for +# which the standard warning message would be confusing for the user. +# + function(vcpkg_apply_patches) - cmake_parse_arguments(_ap "" "SOURCE_PATH" "PATCHES" ${ARGN}) + cmake_parse_arguments(_ap "QUIET" "SOURCE_PATH" "PATCHES" ${ARGN}) find_program(GIT git) set(PATCHNUM 0) @@ -14,7 +35,7 @@ function(vcpkg_apply_patches) RESULT_VARIABLE error_code ) - if(error_code) + if(error_code AND NOT ${_ap_QUIET}) message(STATUS "Applying patch failed. This is expected if this patch was previously applied.") endif() -- cgit v1.2.3 From 1decb1b52c023cc56e475ea05ec533ae65ce3c8a Mon Sep 17 00:00:00 2001 From: Silvio Date: Thu, 5 Jan 2017 23:38:01 +0100 Subject: cmake: add qmake-related helpers function --- scripts/cmake/vcpkg_build_qmake.cmake | 36 ++++++++++++++++++++++++ scripts/cmake/vcpkg_common_functions.cmake | 2 ++ scripts/cmake/vcpkg_configure_qmake.cmake | 44 ++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 scripts/cmake/vcpkg_build_qmake.cmake create mode 100644 scripts/cmake/vcpkg_configure_qmake.cmake diff --git a/scripts/cmake/vcpkg_build_qmake.cmake b/scripts/cmake/vcpkg_build_qmake.cmake new file mode 100644 index 000000000..263200423 --- /dev/null +++ b/scripts/cmake/vcpkg_build_qmake.cmake @@ -0,0 +1,36 @@ +#.rst: +# .. command:: vcpkg_build_qmake +# +# Build a qmake-based project, previously configured using vcpkg_configure_qmake . +# As the CONFIG qmake option is assumed to be "debug_and_release" (the default value on Windows, see [1]), +# both the debug and release libraries are build in the same build tree. +# +# :: +# vcpkg_build_qmake() +# +# +# [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html + +function(vcpkg_build_qmake) + vcpkg_find_acquire_program("JOM") + + if(NOT JOM) + BUILD_ERROR("vcpkg_install_qmake: impossible to find jom.") + endif() + + # Make sure that the linker finds the libraries used + set(ENV_LIB_BACKUP ENV{LIB}) + set(ENV{LIB} "${CURRENT_INSTALLED_DIR}/lib;${CURRENT_INSTALLED_DIR}/debug/lib;$ENV{LIB}") + + message(STATUS "Package ${TARGET_TRIPLET}") + vcpkg_execute_required_process_repeat( + COUNT 2 + COMMAND ${JOM} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET} + LOGNAME package-${TARGET_TRIPLET} + ) + message(STATUS "Package ${TARGET_TRIPLET} done") + + # Restore the original value of ENV{LIB} + set(ENV{LIB} ENV_LIB_BACKUP) +endfunction() diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake index f1bbdb9e3..ff1fae953 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -5,7 +5,9 @@ include(vcpkg_execute_required_process_repeat) include(vcpkg_find_acquire_program) include(vcpkg_build_cmake) include(vcpkg_build_msbuild) +include(vcpkg_build_qmake) include(vcpkg_install_cmake) include(vcpkg_configure_cmake) +include(vcpkg_configure_qmake) include(vcpkg_apply_patches) include(vcpkg_copy_pdbs) diff --git a/scripts/cmake/vcpkg_configure_qmake.cmake b/scripts/cmake/vcpkg_configure_qmake.cmake new file mode 100644 index 000000000..f51a2f4fb --- /dev/null +++ b/scripts/cmake/vcpkg_configure_qmake.cmake @@ -0,0 +1,44 @@ +#.rst: +# .. command:: vcpkg_configure_qmake +# +# Configure a qmake-based project. +# It is assume that the qmake project CONFIG variable is +# "debug_and_release" (the default value on Windows, see [1]). +# Using this option, only one Makefile for building both Release and Debug +# libraries is generated, that then can be run using the vcpkg_install_qmake +# command. +# +# :: +# vcpkg_configure_qmake(SOURCE_PATH +# [OPTIONS arg1 [arg2 ...]] +# ) +# +# ``PROJECT_PATH`` +# The path to the *.pro qmake project file. +# ``OPTIONS`` +# The options passed to qmake. +# +# [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html + +function(vcpkg_configure_qmake) + cmake_parse_arguments(_csc "" "SOURCE_PATH" "OPTIONS" ${ARGN}) + + # Find qmake exectuable + find_program(QMAKE_COMMAND NAMES qmake) + + if(NOT QMAKE_COMMAND) + BUILD_ERROR("vcpkg_configure_qmake: impossible to find qmake.") + endif() + + # Cleanup build directories + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) + + message(STATUS "Configuring ${TARGET_TRIPLET}") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) + vcpkg_execute_required_process( + COMMAND ${QMAKE_COMMAND} ${_csc_SOURCE_PATH} ${_csc_OPTIONS} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET} + LOGNAME config-${TARGET_TRIPLET} + ) + message(STATUS "Configuring ${TARGET_TRIPLET} done") +endfunction() \ No newline at end of file -- cgit v1.2.3 From 3cad0111fbe288da3ee0dd525447125bbf76f707 Mon Sep 17 00:00:00 2001 From: Silvio Date: Thu, 5 Jan 2017 23:39:00 +0100 Subject: Add qwt port --- ports/qwt/CONTROL | 4 +++ ports/qwt/build-shared-lib.patch | 13 +++++++++ ports/qwt/build-static-lib.patch | 13 +++++++++ ports/qwt/portfile.cmake | 61 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 91 insertions(+) create mode 100644 ports/qwt/CONTROL create mode 100644 ports/qwt/build-shared-lib.patch create mode 100644 ports/qwt/build-static-lib.patch create mode 100644 ports/qwt/portfile.cmake diff --git a/ports/qwt/CONTROL b/ports/qwt/CONTROL new file mode 100644 index 000000000..b457bdead --- /dev/null +++ b/ports/qwt/CONTROL @@ -0,0 +1,4 @@ +Source: qwt +Version: 6.1.3 +Description: Qt widgets library for technical applications +Build-Depends: qt5 diff --git a/ports/qwt/build-shared-lib.patch b/ports/qwt/build-shared-lib.patch new file mode 100644 index 000000000..2a8447d52 --- /dev/null +++ b/ports/qwt/build-shared-lib.patch @@ -0,0 +1,13 @@ +diff --git a/qwtconfig.pri b/qwtconfig.pri +index 756231a..2dc3715 100644 +--- a/qwtconfig.pri ++++ b/qwtconfig.pri +@@ -72,7 +72,7 @@ QWT_INSTALL_FEATURES = $${QWT_INSTALL_PREFIX}/features + # it will be a static library. + ###################################################################### + +-# QWT_CONFIG += QwtDll ++QWT_CONFIG += QwtDll + + ###################################################################### + # QwtPlot enables all classes, that are needed to use the QwtPlot diff --git a/ports/qwt/build-static-lib.patch b/ports/qwt/build-static-lib.patch new file mode 100644 index 000000000..3e1b462ac --- /dev/null +++ b/ports/qwt/build-static-lib.patch @@ -0,0 +1,13 @@ +diff --git a/qwtconfig.pri b/qwtconfig.pri +index 2dc3715..756231a 100644 +--- a/qwtconfig.pri ++++ b/qwtconfig.pri +@@ -72,7 +72,7 @@ QWT_INSTALL_FEATURES = $${QWT_INSTALL_PREFIX}/features + # it will be a static library. + ###################################################################### + +-QWT_CONFIG += QwtDll ++# QWT_CONFIG += QwtDll + + ###################################################################### + # QwtPlot enables all classes, that are needed to use the QwtPlot diff --git a/ports/qwt/portfile.cmake b/ports/qwt/portfile.cmake new file mode 100644 index 000000000..94cb2af91 --- /dev/null +++ b/ports/qwt/portfile.cmake @@ -0,0 +1,61 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/qwt-6.1.3) +vcpkg_download_distfile(ARCHIVE + URLS "https://sourceforge.net/projects/qwt/files/qwt/6.1.3/qwt-6.1.3.zip" + FILENAME "qwt-6.1.3.zip" + SHA512 8f249e23d50f71d14fca37776ea40d8d6931db14d9602e03a343bfb7a9bf55502202103135b77f583c3890a7924220e8a142a01c448dbde311860d89a3b10fc8 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES "${CMAKE_CURRENT_LIST_DIR}/build-shared-lib.patch" + QUIET + ) +else() + vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES "${CMAKE_CURRENT_LIST_DIR}/build-static-lib.patch" + QUIET + ) +endif() + +vcpkg_configure_qmake( + SOURCE_PATH ${SOURCE_PATH} +) + +vcpkg_build_qmake() + +# Install following vcpkg conventions +set(BUILD_DIR ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) + +file(GLOB HEADER_FILES ${SOURCE_PATH}/src/*.h) +file(INSTALL ${HEADER_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include) + +file(INSTALL + ${BUILD_DIR}/lib/qwt.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib +) + +file(INSTALL + ${BUILD_DIR}/lib/qwtd.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib +) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(INSTALL + ${BUILD_DIR}/lib/qwt.dll + DESTINATION ${CURRENT_PACKAGES_DIR}/bin + ) + + file(INSTALL + ${BUILD_DIR}/lib/qwtd.dll + ${BUILD_DIR}/lib/qwtd.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin + ) +endif() + +# Handle copyright +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/qwt) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/qwt/COPYING ${CURRENT_PACKAGES_DIR}/share/qwt/copyright) -- cgit v1.2.3 From ff10939203b7694f21d8e8e0464f092dff1b4eb0 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 5 Jan 2017 15:23:08 -0800 Subject: Refactor pre-install check --- toolsrc/src/commands_installation.cpp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_installation.cpp index 8d940bc9d..c239bf06c 100644 --- a/toolsrc/src/commands_installation.cpp +++ b/toolsrc/src/commands_installation.cpp @@ -164,9 +164,8 @@ namespace vcpkg return output; } - void install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs& status_db) + static ImmutableSortedVector build_list_of_package_files(const fs::path& package_dir) { - const fs::path package_dir = paths.package_dir(binary_paragraph.spec); const std::vector package_file_paths = Files::recursive_find_all_files_in_dir(package_dir); std::vector package_files; const size_t package_remove_char_count = package_dir.generic_string().size() + 1; // +1 for the slash @@ -176,14 +175,27 @@ namespace vcpkg as_string.erase(0, package_remove_char_count); return std::move(as_string); }); - std::sort(package_files.begin(), package_files.end()); - const std::vector& pgh_and_files = get_installed_files(paths, status_db); - const triplet& triplet = binary_paragraph.spec.target_triplet(); + return ImmutableSortedVector::create(std::move(package_files)); + } + + static ImmutableSortedVector build_list_of_installed_files(const std::vector& pgh_and_files, const triplet& triplet) + { std::vector installed_files = extract_files_in_triplet(pgh_and_files, triplet); const size_t installed_remove_char_count = triplet.canonical_name().size() + 1; // +1 for the slash remove_first_n_chars(&installed_files, installed_remove_char_count); - std::sort(installed_files.begin(), installed_files.end()); // Should already be sorted + + return ImmutableSortedVector::create(std::move(installed_files)); + } + + void install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs& status_db) + { + const fs::path package_dir = paths.package_dir(binary_paragraph.spec); + const triplet& triplet = binary_paragraph.spec.target_triplet(); + const std::vector pgh_and_files = get_installed_files(paths, status_db); + + const ImmutableSortedVector package_files = build_list_of_package_files(package_dir); + const ImmutableSortedVector installed_files = build_list_of_installed_files(pgh_and_files, triplet); std::vector intersection; std::set_intersection(package_files.cbegin(), package_files.cend(), -- cgit v1.2.3 From 37a5504855a83e24eb06ca1b5dd16b3dabd68313 Mon Sep 17 00:00:00 2001 From: Patrick Bader Date: Fri, 6 Jan 2017 19:08:31 +0100 Subject: 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 -- cgit v1.2.3 From 937c4e26b074d7ddb603e16186e4efe271e8c230 Mon Sep 17 00:00:00 2001 From: Patrick Bader Date: Fri, 6 Jan 2017 22:05:22 +0100 Subject: 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) -- cgit v1.2.3 From 95ff552b8572fdd0ef8ab01a8d462898ba59580b Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Fri, 6 Jan 2017 23:02:19 +0100 Subject: [qt5] Avoid printing warnings for problems in applying"confguration patches" The `QUIET` option for `vcpkg_apply_patches` was added in https://github.com/Microsoft/vcpkg/commit/f4c34bb42dd0fe8217d4d54a9a4a2eeecdb0f0f4 . Fixes https://github.com/Microsoft/vcpkg/issues/411 . --- ports/qt5/portfile.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake index adcec1c8b..5f0d9f6cb 100644 --- a/ports/qt5/portfile.cmake +++ b/ports/qt5/portfile.cmake @@ -32,11 +32,13 @@ if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL static) vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES "${CMAKE_CURRENT_LIST_DIR}/set-static-qmakespec.patch" + QUIET ) else() vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES "${CMAKE_CURRENT_LIST_DIR}/set-shared-qmakespec.patch" + QUIET ) endif() -- cgit v1.2.3 From fc8228a79b15db1284af5b4cb508e8bdc9fb8079 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Fri, 6 Jan 2017 23:04:20 +0100 Subject: [qt5] Fix tabs/spaces mismatch --- ports/qt5/portfile.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake index 5f0d9f6cb..2b337df02 100644 --- a/ports/qt5/portfile.cmake +++ b/ports/qt5/portfile.cmake @@ -32,13 +32,13 @@ if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL static) vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES "${CMAKE_CURRENT_LIST_DIR}/set-static-qmakespec.patch" - QUIET + QUIET ) else() vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES "${CMAKE_CURRENT_LIST_DIR}/set-shared-qmakespec.patch" - QUIET + QUIET ) endif() -- cgit v1.2.3 From 2bb72e6637ab016a1fa8625b0a673d5ecd74ae4f Mon Sep 17 00:00:00 2001 From: Patrick Bader Date: Fri, 6 Jan 2017 23:20:57 +0100 Subject: [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 -- cgit v1.2.3 From c5dad5306e684972db7456033a7d4b2b920075a3 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 6 Jan 2017 14:57:45 -0800 Subject: [vcpkg_apply_pathces] Fix typo (also trailing whitespace) --- scripts/cmake/vcpkg_apply_patches.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/cmake/vcpkg_apply_patches.cmake b/scripts/cmake/vcpkg_apply_patches.cmake index d509e36ec..e17d53b08 100644 --- a/scripts/cmake/vcpkg_apply_patches.cmake +++ b/scripts/cmake/vcpkg_apply_patches.cmake @@ -11,11 +11,11 @@ # ``SOURCE_PATH`` # The source path in which apply the patches. # ``PATCHES`` -# A list of patches that are applied to the source tree -# ``QUIET`` -# If this option is passed, the warning message when applyng -# a patch failes is not printed. This is convenient for patches -# that are known to fail even on a clean source tree, and for +# A list of patches that are applied to the source tree +# ``QUIET`` +# If this option is passed, the warning message when applyng +# a patch fails is not printed. This is convenient for patches +# that are known to fail even on a clean source tree, and for # which the standard warning message would be confusing for the user. # -- cgit v1.2.3 From 833fbb2ef1edebad21e2131fd023c9151bf3f7d5 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 6 Jan 2017 15:40:37 -0800 Subject: [libvorbis] Add version --- ports/libvorbis/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/libvorbis/CONTROL b/ports/libvorbis/CONTROL index 76181b9e8..258edc4db 100644 --- a/ports/libvorbis/CONTROL +++ b/ports/libvorbis/CONTROL @@ -1,4 +1,4 @@ Source: libvorbis -Version: +Version: 1.3.5-143caf4023a90c09a5eb685fdd46fb9b9c36b1ee Description: Ogg Vorbis is a fully open, non-proprietary, patent-and-royalty-free, general-purpose compressed audio format. Build-Depends: libogg -- cgit v1.2.3 From 3eccec7231da879a18eb16a318e4309e2f921843 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 6 Jan 2017 15:51:53 -0800 Subject: [spriv-tools] Add version and description --- ports/spirv-tools/CONTROL | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/spirv-tools/CONTROL b/ports/spirv-tools/CONTROL index 0e1a82706..eacc40ff9 100644 --- a/ports/spirv-tools/CONTROL +++ b/ports/spirv-tools/CONTROL @@ -1,3 +1,3 @@ Source: spirv-tools -Version: -Description: +Version: 1.1-f72189c249ba143c6a89a4cf1e7d53337b2ddd40 +Description: API and commands for processing SPIR-V modules -- cgit v1.2.3 From 6947f0aea15e5e422bf4e972d0e3c4554b76f1dc Mon Sep 17 00:00:00 2001 From: sdcb Date: Sat, 7 Jan 2017 15:21:19 +0800 Subject: [mongo-c-driver] fix static build --- ports/mongo-c-driver/bson.patch | 24 ++++++++++++++++++++++++ ports/mongo-c-driver/portfile.cmake | 7 +++++++ 2 files changed, 31 insertions(+) create mode 100644 ports/mongo-c-driver/bson.patch diff --git a/ports/mongo-c-driver/bson.patch b/ports/mongo-c-driver/bson.patch new file mode 100644 index 000000000..83291d699 --- /dev/null +++ b/ports/mongo-c-driver/bson.patch @@ -0,0 +1,24 @@ +diff --git a/build/cmake/FindBSON.cmake b/build/cmake/FindBSON.cmake +index 4ac39ea..d11aa1f 100644 +--- a/build/cmake/FindBSON.cmake ++++ b/build/cmake/FindBSON.cmake +@@ -12,6 +12,7 @@ endif () + find_path(BSON_INCLUDE_DIR + NAMES + libbson-1.0/bson.h ++ bson.h + HINTS + ${BSON_ROOT_DIR} + ${_BSON_INCLUDEDIR} +@@ -19,7 +20,10 @@ find_path(BSON_INCLUDE_DIR + include + ) + +-set(BSON_INCLUDE_DIR "${BSON_INCLUDE_DIR}/libbson-1.0") ++set(BSON_INCLUDE_DIR "${BSON_INCLUDE_DIR}") ++if (NOT EXISTS ${BSON_INCLUDE_DIR}/bson.h) ++ set(BSON_INCLUDE_DIR "${BSON_INCLUDE_DIR}/libbson-1.0") ++endif() + + if(WIN32 AND NOT CYGWIN) + if(MSVC) diff --git a/ports/mongo-c-driver/portfile.cmake b/ports/mongo-c-driver/portfile.cmake index 833d7393c..7061faee5 100644 --- a/ports/mongo-c-driver/portfile.cmake +++ b/ports/mongo-c-driver/portfile.cmake @@ -8,10 +8,17 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/bson.patch +) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS -DBSON_ROOT_DIR=${CURRENT_INSTALLED_DIR} + -DBSON_INCLUDE_DIR=${CURRENT_INSTALLED_DIR}/include -DENABLE_TESTS=OFF -DENABLE_EXAMPLES=OFF -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=ON -- cgit v1.2.3 From aa964e8d847a093b9a39bf973b915f51e7fcf091 Mon Sep 17 00:00:00 2001 From: sdcb Date: Sat, 7 Jan 2017 15:44:29 +0800 Subject: set BSON_INCLUDE_DIR is not necessary. --- ports/mongo-c-driver/portfile.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/mongo-c-driver/portfile.cmake b/ports/mongo-c-driver/portfile.cmake index 7061faee5..3d551e084 100644 --- a/ports/mongo-c-driver/portfile.cmake +++ b/ports/mongo-c-driver/portfile.cmake @@ -18,7 +18,6 @@ vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS -DBSON_ROOT_DIR=${CURRENT_INSTALLED_DIR} - -DBSON_INCLUDE_DIR=${CURRENT_INSTALLED_DIR}/include -DENABLE_TESTS=OFF -DENABLE_EXAMPLES=OFF -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=ON -- cgit v1.2.3 From 07fb014193d725da008742d38dd94362de30afde Mon Sep 17 00:00:00 2001 From: Patrick Bader Date: Sat, 7 Jan 2017 11:51:07 +0100 Subject: [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:") -- cgit v1.2.3 From 1f63deb204b555046d525d6ecb3b265e2774f4ba Mon Sep 17 00:00:00 2001 From: Guillaume Dumont Date: Mon, 19 Dec 2016 20:51:53 -0500 Subject: LMDB port --- ports/lmdb/CONTROL | 3 + ports/lmdb/cmake/CMakeLists.txt | 80 + ports/lmdb/cmake/cmake/package-config.cmakein | 13 + ports/lmdb/cmake/cmake/runtest.cmake | 3 + ports/lmdb/cmake/lmdb.def | 58 + ports/lmdb/cmake/lmdbd.def | 58 + ..._45a88275d2a410e683bae4ef44881e0f55fa3c4d.patch | 3932 ++++++++++++++++++++ ports/lmdb/portfile.cmake | 33 + 8 files changed, 4180 insertions(+) create mode 100644 ports/lmdb/CONTROL create mode 100644 ports/lmdb/cmake/CMakeLists.txt create mode 100644 ports/lmdb/cmake/cmake/package-config.cmakein create mode 100644 ports/lmdb/cmake/cmake/runtest.cmake create mode 100644 ports/lmdb/cmake/lmdb.def create mode 100644 ports/lmdb/cmake/lmdbd.def create mode 100644 ports/lmdb/lmdb_45a88275d2a410e683bae4ef44881e0f55fa3c4d.patch create mode 100644 ports/lmdb/portfile.cmake diff --git a/ports/lmdb/CONTROL b/ports/lmdb/CONTROL new file mode 100644 index 000000000..bda09ee71 --- /dev/null +++ b/ports/lmdb/CONTROL @@ -0,0 +1,3 @@ +Source: lmdb +Version: 0.9.18-1 +Description: LMDB is an extraordinarily fast, memory-efficient database \ No newline at end of file diff --git a/ports/lmdb/cmake/CMakeLists.txt b/ports/lmdb/cmake/CMakeLists.txt new file mode 100644 index 000000000..6f63384ea --- /dev/null +++ b/ports/lmdb/cmake/CMakeLists.txt @@ -0,0 +1,80 @@ +cmake_minimum_required(VERSION 2.8) + +file(READ "${CMAKE_CURRENT_SOURCE_DIR}/lmdb.h" VERSION_HEADER) +string(REGEX MATCH ".*MDB_VERSION_MAJOR[ \t]+([0-9])" MAJOR_VERSION_MATCH "${VERSION_HEADER}") +set(LMDB_MAJOR_VERSION ${CMAKE_MATCH_1}) +string(REGEX MATCH ".*MDB_VERSION_MINOR[ \t]+([0-9])" MINOR_VERSION_MATCH "${VERSION_HEADER}") +set(LMDB_MINOR_VERSION ${CMAKE_MATCH_1}) +string(REGEX MATCH ".*MDB_VERSION_PATCH[ \t]+([0-9]+)" PATCH_VERSION_MATCH "${VERSION_HEADER}") +set(LMDB_PATCH_VERSION ${CMAKE_MATCH_1}) + +set(LMDB_VERSION "${LMDB_MAJOR_VERSION}.${LMDB_MINOR_VERSION}.${LMDB_PATCH_VERSION}") + +project(lmdb) + +option(LMDB_BUILD_TOOLS "Build lmdb tools" OFF) +option(LMDB_BUILD_TESTS "Build lmdb tests" OFF) +option(LMDB_INSTALL_HEADERS "Install LMDB header files" ON) +set(LMDB_INCLUDE_INSTALL_DIR include CACHE PATH "Install directory for headers") +set(LMDB_LIBRARY_INSTALL_DIR lib CACHE PATH "Install directory for library") +set(LMDB_RUNTIME_INSTALL_DIR bin CACHE PATH "Install directory for binaries/dlls") +set(LMDB_CONFIG_INSTALL_DIR share/lmdb CACHE PATH "Install directory for cmake config files") + + +if(BUILD_SHARED_LIBS) +set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} /DEF:${CMAKE_CURRENT_SOURCE_DIR}/lmdbd.def") +set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} /DEF:${CMAKE_CURRENT_SOURCE_DIR}/lmdb.def") +endif() + +set(SRCS lmdb mdb.c lmdb.h midl.c midl.h ) +add_library(lmdb ${SRCS}) +set_target_properties(lmdb PROPERTIES DEBUG_POSTFIX d) +target_link_libraries(lmdb PRIVATE ntdll.lib) + +install(TARGETS lmdb DESTINATION lib + EXPORT lmdb-targets + RUNTIME DESTINATION ${LMDB_RUNTIME_INSTALL_DIR} + LIBRARY DESTINATION ${LMDB_LIBRARY_INSTALL_DIR} + ARCHIVE DESTINATION ${LMDB_LIBRARY_INSTALL_DIR} + ) + +if(LMDB_INSTALL_HEADERS) + install(FILES lmdb.h midl.h DESTINATION ${LMDB_INCLUDE_INSTALL_DIR}) +endif() + +include(CMakePackageConfigHelpers) + +set(INSTALL_INCLUDE_DIR ${LMDB_INCLUDE_INSTALL_DIR}) +configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/package-config.cmakein ${CMAKE_CURRENT_BINARY_DIR}/lmdb-config.cmake + INSTALL_DESTINATION ${LMDB_CONFIG_INSTALL_DIR} + PATH_VARS INSTALL_INCLUDE_DIR + ) + +write_basic_package_version_file( ${CMAKE_CURRENT_BINARY_DIR}/lmdb-config-version.cmake VERSION ${LMDB_VERSION} COMPATIBILITY SameMajorVersion ) + +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lmdb-config.cmake ${CMAKE_CURRENT_BINARY_DIR}/lmdb-config-version.cmake + DESTINATION ${LMDB_CONFIG_INSTALL_DIR} ) + + +install(EXPORT lmdb-targets DESTINATION ${LMDB_CONFIG_INSTALL_DIR}) + +if(LMDB_BUILD_TOOLS) + # don't build mdb_dump/load/stat since they will + # not build on windows + foreach(_tool mdb_copy) + add_executable(${_tool} ${_tool}.c) + target_link_libraries(${_tool} lmdb) + endforeach() +endif() + +if(LMDB_BUILD_TESTS) + enable_testing() + # don't use mtest6 since it will only build in static + # build + foreach(_test mtest mtest2 mtest3 mtest4 mtest5) + add_executable(${_test} ${_test}.c) + target_link_libraries(${_test} lmdb) + add_test(NAME ${_test} + COMMAND ${CMAKE_COMMAND} -DTEST=$ ++#include ++#include + + #ifdef __cplusplus + extern "C" { +@@ -172,6 +180,32 @@ typedef int mdb_mode_t; + typedef mode_t mdb_mode_t; + #endif + ++#ifdef _WIN32 ++# define MDB_FMT_Z "I" ++#else ++# define MDB_FMT_Z "z" /**< printf/scanf format modifier for size_t */ ++#endif ++ ++#ifndef MDB_VL32 ++/** Unsigned type used for mapsize, entry counts and page/transaction IDs. ++ * ++ * It is normally size_t, hence the name. Defining MDB_VL32 makes it ++ * uint64_t, but do not try this unless you know what you are doing. ++ */ ++typedef size_t mdb_size_t; ++# define MDB_SIZE_MAX SIZE_MAX /**< max #mdb_size_t */ ++/** #mdb_size_t printf formats, \b t = one of [diouxX] without quotes */ ++# define MDB_PRIy(t) MDB_FMT_Z #t ++/** #mdb_size_t scanf formats, \b t = one of [dioux] without quotes */ ++# define MDB_SCNy(t) MDB_FMT_Z #t ++#else ++typedef uint64_t mdb_size_t; ++# define MDB_SIZE_MAX UINT64_MAX ++# define MDB_PRIy(t) PRI##t##64 ++# define MDB_SCNy(t) SCN##t##64 ++# define mdb_env_create mdb_env_create_vl32 /**< Prevent mixing with non-VL32 builds */ ++#endif ++ + /** An abstraction for a file handle. + * On POSIX systems file handles are small integers. On Windows + * they're opaque pointers. +@@ -194,7 +228,7 @@ typedef int mdb_filehandle_t; + /** Library minor version */ + #define MDB_VERSION_MINOR 9 + /** Library patch version */ +-#define MDB_VERSION_PATCH 18 ++#define MDB_VERSION_PATCH 70 + + /** Combine args a,b,c into a single integer for easy version comparisons */ + #define MDB_VERINT(a,b,c) (((a) << 24) | ((b) << 16) | (c)) +@@ -204,7 +238,7 @@ typedef int mdb_filehandle_t; + MDB_VERINT(MDB_VERSION_MAJOR,MDB_VERSION_MINOR,MDB_VERSION_PATCH) + + /** The release date of this library version */ +-#define MDB_VERSION_DATE "February 5, 2016" ++#define MDB_VERSION_DATE "December 19, 2015" + + /** A stringifier for the version info */ + #define MDB_VERSTR(a,b,c,d) "LMDB " #a "." #b "." #c ": (" d ")" +@@ -306,7 +340,8 @@ typedef void (MDB_rel_func)(MDB_val *item, void *oldptr, void *newptr, void *rel + #define MDB_REVERSEKEY 0x02 + /** use sorted duplicates */ + #define MDB_DUPSORT 0x04 +- /** numeric keys in native byte order: either unsigned int or size_t. ++ /** numeric keys in native byte order, either unsigned int or #mdb_size_t. ++ * (lmdb expects 32-bit int <= size_t <= 32/64-bit mdb_size_t.) + * The keys must all be of the same size. */ + #define MDB_INTEGERKEY 0x08 + /** with #MDB_DUPSORT, sorted dup items have fixed size */ +@@ -383,7 +418,9 @@ typedef enum MDB_cursor_op { + MDB_PREV_NODUP, /**< Position at last data item of previous key */ + MDB_SET, /**< Position at specified key */ + MDB_SET_KEY, /**< Position at specified key, return key + data */ +- MDB_SET_RANGE /**< Position at first key greater than or equal to specified key. */ ++ MDB_SET_RANGE, /**< Position at first key greater than or equal to specified key. */ ++ MDB_PREV_MULTIPLE /**< Position at previous page and return key and up to ++ a page of duplicate data items. Only for #MDB_DUPFIXED */ + } MDB_cursor_op; + + /** @defgroup errors Return Codes +@@ -440,8 +477,10 @@ typedef enum MDB_cursor_op { + #define MDB_BAD_VALSIZE (-30781) + /** The specified DBI was changed unexpectedly */ + #define MDB_BAD_DBI (-30780) ++ /** Unexpected problem - txn should abort */ ++#define MDB_PROBLEM (-30779) + /** The last defined error code */ +-#define MDB_LAST_ERRCODE MDB_BAD_DBI ++#define MDB_LAST_ERRCODE MDB_PROBLEM + /** @} */ + + /** @brief Statistics for a database in the environment */ +@@ -449,18 +488,18 @@ typedef struct MDB_stat { + unsigned int ms_psize; /**< Size of a database page. + This is currently the same for all databases. */ + unsigned int ms_depth; /**< Depth (height) of the B-tree */ +- size_t ms_branch_pages; /**< Number of internal (non-leaf) pages */ +- size_t ms_leaf_pages; /**< Number of leaf pages */ +- size_t ms_overflow_pages; /**< Number of overflow pages */ +- size_t ms_entries; /**< Number of data items */ ++ mdb_size_t ms_branch_pages; /**< Number of internal (non-leaf) pages */ ++ mdb_size_t ms_leaf_pages; /**< Number of leaf pages */ ++ mdb_size_t ms_overflow_pages; /**< Number of overflow pages */ ++ mdb_size_t ms_entries; /**< Number of data items */ + } MDB_stat; + + /** @brief Information about the environment */ + typedef struct MDB_envinfo { + void *me_mapaddr; /**< Address of map, if fixed */ +- size_t me_mapsize; /**< Size of the data memory map */ +- size_t me_last_pgno; /**< ID of the last used page */ +- size_t me_last_txnid; /**< ID of the last committed transaction */ ++ mdb_size_t me_mapsize; /**< Size of the data memory map */ ++ mdb_size_t me_last_pgno; /**< ID of the last used page */ ++ mdb_size_t me_last_txnid; /**< ID of the last committed transaction */ + unsigned int me_maxreaders; /**< max reader slots in the environment */ + unsigned int me_numreaders; /**< max reader slots used in the environment */ + } MDB_envinfo; +@@ -672,6 +711,7 @@ int mdb_env_copyfd(MDB_env *env, mdb_filehandle_t fd); + *
  • #MDB_CP_COMPACT - Perform compaction while copying: omit free + * pages and sequentially renumber all pages in output. This option + * consumes more CPU and runs more slowly than the default. ++ * Currently it fails if the environment has suffered a page leak. + * + * @return A non-zero error value on failure and 0 on success. + */ +@@ -829,7 +869,7 @@ int mdb_env_get_fd(MDB_env *env, mdb_filehandle_t *fd); + * an active write transaction. + * + */ +-int mdb_env_set_mapsize(MDB_env *env, size_t size); ++int mdb_env_set_mapsize(MDB_env *env, mdb_size_t size); + + /** @brief Set the maximum number of threads/reader slots for the environment. + * +@@ -942,6 +982,10 @@ int mdb_env_set_assert(MDB_env *env, MDB_assert_func *func); + *
      + *
    • #MDB_RDONLY + * This transaction will not perform any write operations. ++ *
    • #MDB_NOSYNC ++ * Don't flush system buffers to disk when committing this transaction. ++ *
    • #MDB_NOMETASYNC ++ * Flush system buffers but omit metadata flush when committing this transaction. + *
    + * @param[out] txn Address where the new #MDB_txn handle will be stored + * @return A non-zero error value on failure and 0 on success. Some possible +@@ -974,7 +1018,7 @@ MDB_env *mdb_txn_env(MDB_txn *txn); + * @param[in] txn A transaction handle returned by #mdb_txn_begin() + * @return A transaction ID, valid if input is an active transaction. + */ +-size_t mdb_txn_id(MDB_txn *txn); ++mdb_size_t mdb_txn_id(MDB_txn *txn); + + /** @brief Commit all the operations of a transaction into the database. + * +@@ -1084,7 +1128,8 @@ int mdb_txn_renew(MDB_txn *txn); + * keys must be unique and may have only a single data item. + *
  • #MDB_INTEGERKEY + * Keys are binary integers in native byte order, either unsigned int +- * or size_t, and will be sorted as such. ++ * or #mdb_size_t, and will be sorted as such. ++ * (lmdb expects 32-bit int <= size_t <= 32/64-bit mdb_size_t.) + * The keys must all be of the same size. + *
  • #MDB_DUPFIXED + * This flag may only be used in combination with #MDB_DUPSORT. This option +@@ -1524,7 +1569,7 @@ int mdb_cursor_del(MDB_cursor *cursor, unsigned int flags); + *
  • EINVAL - cursor is not initialized, or an invalid parameter was specified. + * + */ +-int mdb_cursor_count(MDB_cursor *cursor, size_t *countp); ++int mdb_cursor_count(MDB_cursor *cursor, mdb_size_t *countp); + + /** @brief Compare two data items according to a particular database. + * +diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c +index d2e81e4..0110402 100644 +--- a/libraries/liblmdb/mdb.c ++++ b/libraries/liblmdb/mdb.c +@@ -35,9 +35,42 @@ + #ifndef _GNU_SOURCE + #define _GNU_SOURCE 1 + #endif ++#if defined(MDB_VL32) || defined(__WIN64__) ++#define _FILE_OFFSET_BITS 64 ++#endif + #ifdef _WIN32 + #include + #include ++ ++/* We use native NT APIs to setup the memory map, so that we can ++ * let the DB file grow incrementally instead of always preallocating ++ * the full size. These APIs are defined in and ++ * but those headers are meant for driver-level development and ++ * conflict with the regular user-level headers, so we explicitly ++ * declare them here. Using these APIs also means we must link to ++ * ntdll.dll, which is not linked by default in user code. ++ */ ++NTSTATUS WINAPI ++NtCreateSection(OUT PHANDLE sh, IN ACCESS_MASK acc, ++ IN void * oa OPTIONAL, ++ IN PLARGE_INTEGER ms OPTIONAL, ++ IN ULONG pp, IN ULONG aa, IN HANDLE fh OPTIONAL); ++ ++typedef enum _SECTION_INHERIT { ++ ViewShare = 1, ++ ViewUnmap = 2 ++} SECTION_INHERIT; ++ ++NTSTATUS WINAPI ++NtMapViewOfSection(IN PHANDLE sh, IN HANDLE ph, ++ IN OUT PVOID *addr, IN ULONG_PTR zbits, ++ IN SIZE_T cs, IN OUT PLARGE_INTEGER off OPTIONAL, ++ IN OUT PSIZE_T vs, IN SECTION_INHERIT ih, ++ IN ULONG at, IN ULONG pp); ++ ++NTSTATUS WINAPI ++NtClose(HANDLE h); ++ + /** getpid() returns int; MinGW defines pid_t but MinGW64 typedefs it + * as int64 which is wrong. MSVC doesn't define it at all, so just + * don't use it. +@@ -116,7 +149,9 @@ typedef SSIZE_T ssize_t; + #endif + + #if defined(__APPLE__) || defined (BSD) +-# define MDB_USE_POSIX_SEM 1 ++# if !(defined(MDB_USE_POSIX_MUTEX) || defined(MDB_USE_POSIX_SEM)) ++# define MDB_USE_SYSV_SEM 1 ++# endif + # define MDB_FDATASYNC fsync + #elif defined(ANDROID) + # define MDB_FDATASYNC fsync +@@ -127,12 +162,22 @@ typedef SSIZE_T ssize_t; + #ifdef MDB_USE_POSIX_SEM + # define MDB_USE_HASH 1 + #include ++#elif defined(MDB_USE_SYSV_SEM) ++#include ++#include ++#ifdef _SEM_SEMUN_UNDEFINED ++union semun { ++ int val; ++ struct semid_ds *buf; ++ unsigned short *array; ++}; ++#endif /* _SEM_SEMUN_UNDEFINED */ + #else + #define MDB_USE_POSIX_MUTEX 1 +-#endif +-#endif ++#endif /* MDB_USE_POSIX_SEM */ ++#endif /* !_WIN32 */ + +-#if defined(_WIN32) + defined(MDB_USE_POSIX_SEM) \ ++#if defined(_WIN32) + defined(MDB_USE_POSIX_SEM) + defined(MDB_USE_SYSV_SEM) \ + + defined(MDB_USE_POSIX_MUTEX) != 1 + # error "Ambiguous shared-lock implementation" + #endif +@@ -183,7 +228,7 @@ typedef SSIZE_T ssize_t; + + #if (BYTE_ORDER == LITTLE_ENDIAN) == (BYTE_ORDER == BIG_ENDIAN) + # error "Unknown or unsupported endianness (BYTE_ORDER)" +-#elif (-6 & 5) || CHAR_BIT != 8 || UINT_MAX < 0xffffffff || ULONG_MAX % 0xFFFF ++#elif (-6 & 5) || CHAR_BIT!=8 || UINT_MAX!=0xffffffff || MDB_SIZE_MAX%UINT_MAX + # error "Two's complement, reasonably sized integer types, please" + #endif + +@@ -234,6 +279,8 @@ typedef SSIZE_T ssize_t; + #define MDB_NO_ROOT (MDB_LAST_ERRCODE + 10) + #ifdef _WIN32 + #define MDB_OWNERDEAD ((int) WAIT_ABANDONED) ++#elif defined MDB_USE_SYSV_SEM ++#define MDB_OWNERDEAD (MDB_LAST_ERRCODE + 11) + #elif defined(MDB_USE_POSIX_MUTEX) && defined(EOWNERDEAD) + #define MDB_OWNERDEAD EOWNERDEAD /**< #LOCK_MUTEX0() result if dead owner */ + #endif +@@ -256,16 +303,20 @@ typedef SSIZE_T ssize_t; + # define MDB_USE_ROBUST 0 + # else + # define MDB_USE_ROBUST 1 ++# endif ++#endif /* !MDB_USE_ROBUST */ ++ ++#if defined(MDB_USE_POSIX_MUTEX) && (MDB_USE_ROBUST) + /* glibc < 2.12 only provided _np API */ +-# if defined(__GLIBC__) && GLIBC_VER < 0x02000c ++# if (defined(__GLIBC__) && GLIBC_VER < 0x02000c) || \ ++ (defined(PTHREAD_MUTEX_ROBUST_NP) && !defined(PTHREAD_MUTEX_ROBUST)) + # define PTHREAD_MUTEX_ROBUST PTHREAD_MUTEX_ROBUST_NP + # define pthread_mutexattr_setrobust(attr, flag) pthread_mutexattr_setrobust_np(attr, flag) + # define pthread_mutex_consistent(mutex) pthread_mutex_consistent_np(mutex) + # endif +-# endif +-#endif /* MDB_USE_ROBUST */ ++#endif /* MDB_USE_POSIX_MUTEX && MDB_USE_ROBUST */ + +-#if defined(MDB_OWNERDEAD) && MDB_USE_ROBUST ++#if defined(MDB_OWNERDEAD) && (MDB_USE_ROBUST) + #define MDB_ROBUST_SUPPORTED 1 + #endif + +@@ -288,8 +339,10 @@ typedef HANDLE mdb_mutex_t, mdb_mutexref_t; + #define pthread_mutex_lock(x) WaitForSingleObject(*x, INFINITE) + #define pthread_cond_signal(x) SetEvent(*x) + #define pthread_cond_wait(cond,mutex) do{SignalObjectAndWait(*mutex, *cond, INFINITE, FALSE); WaitForSingleObject(*mutex, INFINITE);}while(0) +-#define THREAD_CREATE(thr,start,arg) thr=CreateThread(NULL,0,start,arg,0,NULL) +-#define THREAD_FINISH(thr) WaitForSingleObject(thr, INFINITE) ++#define THREAD_CREATE(thr,start,arg) \ ++ (((thr) = CreateThread(NULL, 0, start, arg, 0, NULL)) ? 0 : ErrCode()) ++#define THREAD_FINISH(thr) \ ++ (WaitForSingleObject(thr, INFINITE) ? ErrCode() : 0) + #define LOCK_MUTEX0(mutex) WaitForSingleObject(mutex, INFINITE) + #define UNLOCK_MUTEX(mutex) ReleaseMutex(mutex) + #define mdb_mutex_consistent(mutex) 0 +@@ -305,12 +358,10 @@ typedef HANDLE mdb_mutex_t, mdb_mutexref_t; + #else + #define MDB_PROCESS_QUERY_LIMITED_INFORMATION 0x1000 + #endif +-#define Z "I" + #else + #define THREAD_RET void * + #define THREAD_CREATE(thr,start,arg) pthread_create(&thr,NULL,start,arg) + #define THREAD_FINISH(thr) pthread_join(thr,NULL) +-#define Z "z" /**< printf format modifier for size_t */ + + /** For MDB_LOCK_FORMAT: True if readers take a pid lock in the lockfile */ + #define MDB_PIDLOCK 1 +@@ -329,12 +380,46 @@ mdb_sem_wait(sem_t *sem) + return rc; + } + ++#elif defined MDB_USE_SYSV_SEM ++ ++typedef struct mdb_mutex { ++ int semid; ++ int semnum; ++ int *locked; ++} mdb_mutex_t[1], *mdb_mutexref_t; ++ ++#define LOCK_MUTEX0(mutex) mdb_sem_wait(mutex) ++#define UNLOCK_MUTEX(mutex) do { \ ++ struct sembuf sb = { 0, 1, SEM_UNDO }; \ ++ sb.sem_num = (mutex)->semnum; \ ++ *(mutex)->locked = 0; \ ++ semop((mutex)->semid, &sb, 1); \ ++} while(0) ++ ++static int ++mdb_sem_wait(mdb_mutexref_t sem) ++{ ++ int rc, *locked = sem->locked; ++ struct sembuf sb = { 0, -1, SEM_UNDO }; ++ sb.sem_num = sem->semnum; ++ do { ++ if (!semop(sem->semid, &sb, 1)) { ++ rc = *locked ? MDB_OWNERDEAD : MDB_SUCCESS; ++ *locked = 1; ++ break; ++ } ++ } while ((rc = errno) == EINTR); ++ return rc; ++} ++ ++#define mdb_mutex_consistent(mutex) 0 ++ + #else /* MDB_USE_POSIX_MUTEX: */ + /** Shared mutex/semaphore as it is stored (mdb_mutex_t), and as + * local variables keep it (mdb_mutexref_t). + * +- * When #mdb_mutexref_t is a pointer declaration and #mdb_mutex_t is +- * not, then it is array[size 1] so it can be assigned to a pointer. ++ * An mdb_mutex_t can be assigned to an mdb_mutexref_t. They can ++ * be the same, or an array[size 1] and a pointer. + * @{ + */ + typedef pthread_mutex_t mdb_mutex_t[1], *mdb_mutexref_t; +@@ -349,7 +434,7 @@ typedef pthread_mutex_t mdb_mutex_t[1], *mdb_mutexref_t; + /** Mark mutex-protected data as repaired, after death of previous owner. + */ + #define mdb_mutex_consistent(mutex) pthread_mutex_consistent(mutex) +-#endif /* MDB_USE_POSIX_SEM */ ++#endif /* MDB_USE_POSIX_SEM || MDB_USE_SYSV_SEM */ + + /** Get the error code for the last failed system function. + */ +@@ -374,12 +459,24 @@ typedef pthread_mutex_t mdb_mutex_t[1], *mdb_mutexref_t; + #define GET_PAGESIZE(x) ((x) = sysconf(_SC_PAGE_SIZE)) + #endif + ++#define Z MDB_FMT_Z /**< printf/scanf format modifier for size_t */ ++#define Yu MDB_PRIy(u) /**< printf format for #mdb_size_t */ ++#define Yd MDB_PRIy(d) /**< printf format for "signed #mdb_size_t" */ ++ + #if defined(_WIN32) || defined(MDB_USE_POSIX_SEM) + #define MNAME_LEN 32 ++#elif defined(MDB_USE_SYSV_SEM) ++#define MNAME_LEN (sizeof(int)) + #else + #define MNAME_LEN (sizeof(pthread_mutex_t)) + #endif + ++#ifdef MDB_USE_SYSV_SEM ++#define SYSV_SEM_FLAG 1 /**< SysV sems in lockfile format */ ++#else ++#define SYSV_SEM_FLAG 0 ++#endif ++ + /** @} */ + + #ifdef MDB_ROBUST_SUPPORTED +@@ -521,7 +618,7 @@ static txnid_t mdb_debug_start; + /** The version number for a database's datafile format. */ + #define MDB_DATA_VERSION ((MDB_DEVEL) ? 999 : 1) + /** The version number for a database's lockfile format. */ +-#define MDB_LOCK_VERSION 1 ++#define MDB_LOCK_VERSION ((MDB_DEVEL) ? 999 : 1) + + /** @brief The max size of a key we can write, or 0 for computed max. + * +@@ -712,6 +809,9 @@ typedef struct MDB_txbody { + uint32_t mtb_format; + #if defined(_WIN32) || defined(MDB_USE_POSIX_SEM) + char mtb_rmname[MNAME_LEN]; ++#elif defined(MDB_USE_SYSV_SEM) ++ int mtb_semid; ++ int mtb_rlocked; + #else + /** Mutex protecting access to this table. + * This is the reader table lock used with LOCK_MUTEX(). +@@ -740,12 +840,19 @@ typedef struct MDB_txninfo { + #define mti_rmname mt1.mtb.mtb_rmname + #define mti_txnid mt1.mtb.mtb_txnid + #define mti_numreaders mt1.mtb.mtb_numreaders ++#ifdef MDB_USE_SYSV_SEM ++#define mti_semid mt1.mtb.mtb_semid ++#define mti_rlocked mt1.mtb.mtb_rlocked ++#endif + char pad[(sizeof(MDB_txbody)+CACHELINE-1) & ~(CACHELINE-1)]; + } mt1; + union { + #if defined(_WIN32) || defined(MDB_USE_POSIX_SEM) + char mt2_wmname[MNAME_LEN]; + #define mti_wmname mt2.mt2_wmname ++#elif defined MDB_USE_SYSV_SEM ++ int mt2_wlocked; ++#define mti_wlocked mt2.mt2_wlocked + #else + mdb_mutex_t mt2_wmutex; + #define mti_wmutex mt2.mt2_wmutex +@@ -760,12 +867,27 @@ typedef struct MDB_txninfo { + ((uint32_t) \ + ((MDB_LOCK_VERSION) \ + /* Flags which describe functionality */ \ ++ + (SYSV_SEM_FLAG << 18) \ + + (((MDB_PIDLOCK) != 0) << 16))) + /** @} */ + +-/** Common header for all page types. +- * Overflow records occupy a number of contiguous pages with no +- * headers on any page after the first. ++/** Common header for all page types. The page type depends on #mp_flags. ++ * ++ * #P_BRANCH and #P_LEAF pages have unsorted '#MDB_node's at the end, with ++ * sorted #mp_ptrs[] entries referring to them. Exception: #P_LEAF2 pages ++ * omit mp_ptrs and pack sorted #MDB_DUPFIXED values after the page header. ++ * ++ * #P_OVERFLOW records occupy one or more contiguous pages where only the ++ * first has a page header. They hold the real data of #F_BIGDATA nodes. ++ * ++ * #P_SUBP sub-pages are small leaf "pages" with duplicate data. ++ * A node with flag #F_DUPDATA but not #F_SUBDATA contains a sub-page. ++ * (Duplicate data can also go in sub-databases, which use normal pages.) ++ * ++ * #P_META pages contain #MDB_meta, the start point of an LMDB snapshot. ++ * ++ * Each non-metapage up to #MDB_meta.%mm_last_pg is reachable exactly once ++ * in the snapshot: Either used by a database or listed in a freeDB record. + */ + typedef struct MDB_page { + #define mp_pgno mp_p.p_pgno +@@ -774,7 +896,7 @@ typedef struct MDB_page { + pgno_t p_pgno; /**< page number */ + struct MDB_page *p_next; /**< for in-memory list of freed pages */ + } mp_p; +- uint16_t mp_pad; ++ uint16_t mp_pad; /**< key size if this is a LEAF2 page */ + /** @defgroup mdb_page Page Flags + * @ingroup internal + * Flags for the page headers. +@@ -841,7 +963,9 @@ typedef struct MDB_page { + /** The number of overflow pages needed to store the given size. */ + #define OVPAGES(size, psize) ((PAGEHDRSZ-1 + (size)) / (psize) + 1) + +- /** Link in #MDB_txn.%mt_loose_pgs list */ ++ /** Link in #MDB_txn.%mt_loose_pgs list. ++ * Kept outside the page header, which is needed when reusing the page. ++ */ + #define NEXT_LOOSE_PAGE(p) (*(MDB_page **)((p) + 2)) + + /** Header for a single key/data pair within a page. +@@ -924,7 +1048,7 @@ typedef struct MDB_node { + #ifdef MISALIGNED_OK + #define COPY_PGNO(dst,src) dst = src + #else +-#if SIZE_MAX > 4294967295UL ++#if MDB_SIZE_MAX > 0xffffffffU + #define COPY_PGNO(dst,src) do { \ + unsigned short *s, *d; \ + s = (unsigned short *)&(src); \ +@@ -965,13 +1089,13 @@ typedef struct MDB_db { + pgno_t md_branch_pages; /**< number of internal pages */ + pgno_t md_leaf_pages; /**< number of leaf pages */ + pgno_t md_overflow_pages; /**< number of overflow pages */ +- size_t md_entries; /**< number of data items */ ++ mdb_size_t md_entries; /**< number of data items */ + pgno_t md_root; /**< the root page of this tree */ + } MDB_db; + +- /** mdb_dbi_open flags */ + #define MDB_VALID 0x8000 /**< DB handle is valid, for me_dbflags */ + #define PERSISTENT_FLAGS (0xffff & ~(MDB_VALID)) ++ /** #mdb_dbi_open() flags */ + #define VALID_FLAGS (MDB_REVERSEKEY|MDB_DUPSORT|MDB_INTEGERKEY|MDB_DUPFIXED|\ + MDB_INTEGERDUP|MDB_REVERSEDUP|MDB_CREATE) + +@@ -995,14 +1119,25 @@ typedef struct MDB_meta { + uint32_t mm_magic; + /** Version number of this file. Must be set to #MDB_DATA_VERSION. */ + uint32_t mm_version; ++#ifdef MDB_VL32 ++ union { /* always zero since we don't support fixed mapping in MDB_VL32 */ ++ MDB_ID mmun_ull; ++ void *mmun_address; ++ } mm_un; ++#define mm_address mm_un.mmun_address ++#else + void *mm_address; /**< address for fixed mapping */ +- size_t mm_mapsize; /**< size of mmap region */ ++#endif ++ pgno_t mm_mapsize; /**< size of mmap region */ + MDB_db mm_dbs[CORE_DBS]; /**< first is free space, 2nd is main db */ + /** The size of pages used in this DB */ + #define mm_psize mm_dbs[FREE_DBI].md_pad + /** Any persistent environment flags. @ref mdb_env */ + #define mm_flags mm_dbs[FREE_DBI].md_flags +- pgno_t mm_last_pg; /**< last used page in file */ ++ /** Last used page in the datafile. ++ * Actually the file may be shorter if the freeDB lists the final pages. ++ */ ++ pgno_t mm_last_pg; + volatile txnid_t mm_txnid; /**< txnid that committed this page */ + } MDB_meta; + +@@ -1039,6 +1174,9 @@ struct MDB_txn { + /** Nested txn under this txn, set together with flag #MDB_TXN_HAS_CHILD */ + MDB_txn *mt_child; + pgno_t mt_next_pgno; /**< next unallocated page */ ++#ifdef MDB_VL32 ++ pgno_t mt_last_pgno; /**< last written page */ ++#endif + /** The ID of this transaction. IDs are integers incrementing from 1. + * Only committed write transactions increment the ID. If a transaction + * aborts, the ID may be re-used by the next writer. +@@ -1052,7 +1190,7 @@ struct MDB_txn { + * in this transaction, linked through #NEXT_LOOSE_PAGE(page). + */ + MDB_page *mt_loose_pgs; +- /* #Number of loose pages (#mt_loose_pgs) */ ++ /** Number of loose pages (#mt_loose_pgs) */ + int mt_loose_count; + /** The sorted list of dirty pages we temporarily wrote to disk + * because the dirty list was full. page numbers in here are +@@ -1085,6 +1223,19 @@ struct MDB_txn { + MDB_cursor **mt_cursors; + /** Array of flags for each DB */ + unsigned char *mt_dbflags; ++#ifdef MDB_VL32 ++ /** List of read-only pages (actually chunks) */ ++ MDB_ID3L mt_rpages; ++ /** We map chunks of 16 pages. Even though Windows uses 4KB pages, all ++ * mappings must begin on 64KB boundaries. So we round off all pgnos to ++ * a chunk boundary. We do the same on Linux for symmetry, and also to ++ * reduce the frequency of mmap/munmap calls. ++ */ ++#define MDB_RPAGE_CHUNK 16 ++#define MDB_TRPAGE_SIZE 4096 /**< size of #mt_rpages array of chunks */ ++#define MDB_TRPAGE_MAX (MDB_TRPAGE_SIZE-1) /**< maximum chunk index */ ++ unsigned int mt_rpcheck; /**< threshold for reclaiming unref'd chunks */ ++#endif + /** Number of DB records in use, or 0 when the txn is finished. + * This number only ever increments until the txn finishes; we + * don't decrement it when individual DB handles are closed. +@@ -1096,7 +1247,9 @@ struct MDB_txn { + * @{ + */ + /** #mdb_txn_begin() flags */ +-#define MDB_TXN_BEGIN_FLAGS MDB_RDONLY ++#define MDB_TXN_BEGIN_FLAGS (MDB_NOMETASYNC|MDB_NOSYNC|MDB_RDONLY) ++#define MDB_TXN_NOMETASYNC MDB_NOMETASYNC /**< don't sync meta for this txn on commit */ ++#define MDB_TXN_NOSYNC MDB_NOSYNC /**< don't sync this txn on commit */ + #define MDB_TXN_RDONLY MDB_RDONLY /**< read-only transaction */ + /* internal txn flags */ + #define MDB_TXN_WRITEMAP MDB_WRITEMAP /**< copy of #MDB_env flag in writers */ +@@ -1162,10 +1315,24 @@ struct MDB_cursor { + #define C_SUB 0x04 /**< Cursor is a sub-cursor */ + #define C_DEL 0x08 /**< last op was a cursor_del */ + #define C_UNTRACK 0x40 /**< Un-track cursor when closing */ ++#define C_WRITEMAP MDB_TXN_WRITEMAP /**< Copy of txn flag */ ++/** Read-only cursor into the txn's original snapshot in the map. ++ * Set for read-only txns, and in #mdb_page_alloc() for #FREE_DBI when ++ * #MDB_DEVEL & 2. Only implements code which is necessary for this. ++ */ ++#define C_ORIG_RDONLY MDB_TXN_RDONLY + /** @} */ + unsigned int mc_flags; /**< @ref mdb_cursor */ + MDB_page *mc_pg[CURSOR_STACK]; /**< stack of pushed pages */ + indx_t mc_ki[CURSOR_STACK]; /**< stack of page indices */ ++#ifdef MDB_VL32 ++ MDB_page *mc_ovpg; /**< a referenced overflow page */ ++# define MC_OVPG(mc) ((mc)->mc_ovpg) ++# define MC_SET_OVPG(mc, pg) ((mc)->mc_ovpg = (pg)) ++#else ++# define MC_OVPG(mc) ((MDB_page *)0) ++# define MC_SET_OVPG(mc, pg) ((void)0) ++#endif + }; + + /** Context for sorted-dup records. +@@ -1195,6 +1362,9 @@ struct MDB_env { + HANDLE me_fd; /**< The main data file */ + HANDLE me_lfd; /**< The lock file */ + HANDLE me_mfd; /**< just for writing the meta pages */ ++#if defined(MDB_VL32) && defined(_WIN32) ++ HANDLE me_fmh; /**< File Mapping handle */ ++#endif + /** Failed to update the meta page. Probably an I/O error. */ + #define MDB_FATAL_ERROR 0x80000000U + /** Some fields are initialized. */ +@@ -1219,7 +1389,7 @@ struct MDB_env { + void *me_pbuf; /**< scratch area for DUPSORT put() */ + MDB_txn *me_txn; /**< current write transaction */ + MDB_txn *me_txn0; /**< prealloc'd write transaction */ +- size_t me_mapsize; /**< size of the data memory map */ ++ mdb_size_t me_mapsize; /**< size of the data memory map */ + off_t me_size; /**< current file size */ + pgno_t me_maxpg; /**< me_mapsize / me_psize */ + MDB_dbx *me_dbxs; /**< array of static DB info */ +@@ -1253,6 +1423,13 @@ struct MDB_env { + mdb_mutex_t me_rmutex; + mdb_mutex_t me_wmutex; + #endif ++#ifdef MDB_VL32 ++ MDB_ID3L me_rpages; /**< like #mt_rpages, but global to env */ ++ pthread_mutex_t me_rpmutex; /**< control access to #me_rpages */ ++#define MDB_ERPAGE_SIZE 16384 ++#define MDB_ERPAGE_MAX (MDB_ERPAGE_SIZE-1) ++ unsigned int me_rpcheck; ++#endif + void *me_userctx; /**< User-settable context */ + MDB_assert_func *me_assert_func; /**< Callback for assertion failures */ + }; +@@ -1298,7 +1475,7 @@ enum { + #define MDB_END_SLOT MDB_NOTLS /**< release any reader slot if #MDB_NOTLS */ + static void mdb_txn_end(MDB_txn *txn, unsigned mode); + +-static int mdb_page_get(MDB_txn *txn, pgno_t pgno, MDB_page **mp, int *lvl); ++static int mdb_page_get(MDB_cursor *mc, pgno_t pgno, MDB_page **mp, int *lvl); + static int mdb_page_search_root(MDB_cursor *mc, + MDB_val *key, int modify); + #define MDB_PS_MODIFY 1 +@@ -1327,7 +1504,7 @@ static int mdb_node_add(MDB_cursor *mc, indx_t indx, + static void mdb_node_del(MDB_cursor *mc, int ksize); + static void mdb_node_shrink(MDB_page *mp, indx_t indx); + static int mdb_node_move(MDB_cursor *csrc, MDB_cursor *cdst, int fromleft); +-static int mdb_node_read(MDB_txn *txn, MDB_node *leaf, MDB_val *data); ++static int mdb_node_read(MDB_cursor *mc, MDB_node *leaf, MDB_val *data); + static size_t mdb_leaf_size(MDB_env *env, MDB_val *key, MDB_val *data); + static size_t mdb_branch_size(MDB_env *env, MDB_val *key); + +@@ -1360,13 +1537,18 @@ static int mdb_reader_check0(MDB_env *env, int rlocked, int *dead); + static MDB_cmp_func mdb_cmp_memn, mdb_cmp_memnr, mdb_cmp_int, mdb_cmp_cint, mdb_cmp_long; + /** @endcond */ + +-/** Compare two items pointing at size_t's of unknown alignment. */ ++/** Compare two items pointing at '#mdb_size_t's of unknown alignment. */ + #ifdef MISALIGNED_OK + # define mdb_cmp_clong mdb_cmp_long + #else + # define mdb_cmp_clong mdb_cmp_cint + #endif + ++/** True if we need #mdb_cmp_clong() instead of \b cmp for #MDB_INTEGERDUP */ ++#define NEED_CMP_CLONG(cmp, ksize) \ ++ (UINT_MAX < MDB_SIZE_MAX && \ ++ (cmp) == mdb_cmp_int && (ksize) == sizeof(mdb_size_t)) ++ + #ifdef _WIN32 + static SECURITY_DESCRIPTOR mdb_null_sd; + static SECURITY_ATTRIBUTES mdb_all_sa; +@@ -1407,6 +1589,7 @@ static char *const mdb_errstr[] = { + "MDB_BAD_TXN: Transaction must abort, has a child, or is invalid", + "MDB_BAD_VALSIZE: Unsupported size of key/DB name/data, or wrong DUPFIXED size", + "MDB_BAD_DBI: The specified DBI handle was closed/changed unexpectedly", ++ "MDB_PROBLEM: Unexpected problem - txn should abort", + }; + + char * +@@ -1417,8 +1600,9 @@ mdb_strerror(int err) + * This works as long as no function between the call to mdb_strerror + * and the actual use of the message uses more than 4K of stack. + */ +- char pad[4096]; +- char buf[1024], *ptr = buf; ++#define MSGSIZE 1024 ++#define PADSIZE 4096 ++ char buf[MSGSIZE+PADSIZE], *ptr = buf; + #endif + int i; + if (!err) +@@ -1450,7 +1634,7 @@ mdb_strerror(int err) + buf[0] = 0; + FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, +- NULL, err, 0, ptr, sizeof(buf), (va_list *)pad); ++ NULL, err, 0, ptr, MSGSIZE, (va_list *)buf+MSGSIZE); + return ptr; + #else + return strerror(err); +@@ -1550,20 +1734,20 @@ mdb_page_list(MDB_page *mp) + case P_LEAF|P_LEAF2: type = "LEAF2 page"; break; + case P_LEAF|P_LEAF2|P_SUBP: type = "LEAF2 sub-page"; break; + case P_OVERFLOW: +- fprintf(stderr, "Overflow page %"Z"u pages %u%s\n", ++ fprintf(stderr, "Overflow page %"Yu" pages %u%s\n", + pgno, mp->mp_pages, state); + return; + case P_META: +- fprintf(stderr, "Meta-page %"Z"u txnid %"Z"u\n", ++ fprintf(stderr, "Meta-page %"Yu" txnid %"Yu"\n", + pgno, ((MDB_meta *)METADATA(mp))->mm_txnid); + return; + default: +- fprintf(stderr, "Bad page %"Z"u flags 0x%u\n", pgno, mp->mp_flags); ++ fprintf(stderr, "Bad page %"Yu" flags 0x%X\n", pgno, mp->mp_flags); + return; + } + + nkeys = NUMKEYS(mp); +- fprintf(stderr, "%s %"Z"u numkeys %d%s\n", type, pgno, nkeys, state); ++ fprintf(stderr, "%s %"Yu" numkeys %d%s\n", type, pgno, nkeys, state); + + for (i=0; imn_data; + nsize = NODESIZE + key.mv_size; + if (IS_BRANCH(mp)) { +- fprintf(stderr, "key %d: page %"Z"u, %s\n", i, NODEPGNO(node), ++ fprintf(stderr, "key %d: page %"Yu", %s\n", i, NODEPGNO(node), + DKEY(&key)); + total += nsize; + } else { +@@ -1674,7 +1858,7 @@ static void mdb_audit(MDB_txn *txn) + } + } + if (freecount + count + NUM_METAS != txn->mt_next_pgno) { +- fprintf(stderr, "audit: %lu freecount: %lu count: %lu total: %lu next_pgno: %lu\n", ++ fprintf(stderr, "audit: %"Yu" freecount: %"Yu" count: %"Yu" total: %"Yu" next_pgno: %"Yu"\n", + txn->mt_txnid, freecount, count+NUM_METAS, + freecount+count+NUM_METAS, txn->mt_next_pgno); + } +@@ -1691,10 +1875,8 @@ int + mdb_dcmp(MDB_txn *txn, MDB_dbi dbi, const MDB_val *a, const MDB_val *b) + { + MDB_cmp_func *dcmp = txn->mt_dbxs[dbi].md_dcmp; +-#if UINT_MAX < SIZE_MAX +- if (dcmp == mdb_cmp_int && a->mv_size == sizeof(size_t)) ++ if (NEED_CMP_CLONG(dcmp, a->mv_size)) + dcmp = mdb_cmp_clong; +-#endif + return dcmp(a, b); + } + +@@ -1774,6 +1956,51 @@ mdb_dlist_free(MDB_txn *txn) + dl[0].mid = 0; + } + ++#ifdef MDB_VL32 ++static void ++mdb_page_unref(MDB_txn *txn, MDB_page *mp) ++{ ++ pgno_t pgno; ++ MDB_ID3L tl = txn->mt_rpages; ++ unsigned x, rem; ++ if (mp->mp_flags & (P_SUBP|P_DIRTY)) ++ return; ++ rem = mp->mp_pgno & (MDB_RPAGE_CHUNK-1); ++ pgno = mp->mp_pgno ^ rem; ++ x = mdb_mid3l_search(tl, pgno); ++ if (x != tl[0].mid && tl[x+1].mid == mp->mp_pgno) ++ x++; ++ if (tl[x].mref) ++ tl[x].mref--; ++} ++#define MDB_PAGE_UNREF(txn, mp) mdb_page_unref(txn, mp) ++ ++static void ++mdb_cursor_unref(MDB_cursor *mc) ++{ ++ int i; ++ if (!mc->mc_snum || !mc->mc_pg[0] || IS_SUBP(mc->mc_pg[0])) ++ return; ++ for (i=0; imc_snum; i++) ++ mdb_page_unref(mc->mc_txn, mc->mc_pg[i]); ++ if (mc->mc_ovpg) { ++ mdb_page_unref(mc->mc_txn, mc->mc_ovpg); ++ mc->mc_ovpg = 0; ++ } ++ mc->mc_snum = mc->mc_top = 0; ++ mc->mc_pg[0] = NULL; ++ mc->mc_flags &= ~C_INITIALIZED; ++} ++#define MDB_CURSOR_UNREF(mc, force) \ ++ (((force) || ((mc)->mc_flags & C_INITIALIZED)) \ ++ ? mdb_cursor_unref(mc) \ ++ : (void)0) ++ ++#else ++#define MDB_PAGE_UNREF(txn, mp) ++#define MDB_CURSOR_UNREF(mc, force) ((void)0) ++#endif /* MDB_VL32 */ ++ + /** Loosen or free a single page. + * Saves single pages to a list for future reuse + * in this same txn. It has been pulled from the freeDB +@@ -1803,7 +2030,7 @@ mdb_page_loose(MDB_cursor *mc, MDB_page *mp) + if (mp != dl[x].mptr) { /* bad cursor? */ + mc->mc_flags &= ~(C_INITIALIZED|C_EOF); + txn->mt_flags |= MDB_TXN_ERROR; +- return MDB_CORRUPTED; ++ return MDB_PROBLEM; + } + /* ok, it's ours */ + loose = 1; +@@ -1815,8 +2042,7 @@ mdb_page_loose(MDB_cursor *mc, MDB_page *mp) + } + } + if (loose) { +- DPRINTF(("loosen db %d page %"Z"u", DDBI(mc), +- mp->mp_pgno)); ++ DPRINTF(("loosen db %d page %"Yu, DDBI(mc), mp->mp_pgno)); + NEXT_LOOSE_PAGE(mp) = txn->mt_loose_pgs; + txn->mt_loose_pgs = mp; + txn->mt_loose_count++; +@@ -1842,7 +2068,7 @@ mdb_pages_xkeep(MDB_cursor *mc, unsigned pflags, int all) + { + enum { Mask = P_SUBP|P_DIRTY|P_LOOSE|P_KEEP }; + MDB_txn *txn = mc->mc_txn; +- MDB_cursor *m3; ++ MDB_cursor *m3, *m0 = mc; + MDB_xcursor *mx; + MDB_page *dp, *mp; + MDB_node *leaf; +@@ -1885,7 +2111,7 @@ mdb_pages_xkeep(MDB_cursor *mc, unsigned pflags, int all) + pgno_t pgno = txn->mt_dbs[i].md_root; + if (pgno == P_INVALID) + continue; +- if ((rc = mdb_page_get(txn, pgno, &dp, &level)) != MDB_SUCCESS) ++ if ((rc = mdb_page_get(m0, pgno, &dp, &level)) != MDB_SUCCESS) + break; + if ((dp->mp_flags & Mask) == pflags && level <= 1) + dp->mp_flags ^= P_KEEP; +@@ -2074,6 +2300,8 @@ mdb_page_dirty(MDB_txn *txn, MDB_page *mp) + * Do not modify the freedB, just merge freeDB records into me_pghead[] + * and move me_pglast to say which records were consumed. Only this + * function can create me_pghead and move me_pglast/mt_next_pgno. ++ * When #MDB_DEVEL & 2, it is not affected by #mdb_freelist_save(): it ++ * then uses the transaction's original snapshot of the freeDB. + * @param[in] mc cursor A cursor handle identifying the transaction and + * database for which we are allocating. + * @param[in] num the number of pages to allocate. +@@ -2111,8 +2339,7 @@ mdb_page_alloc(MDB_cursor *mc, int num, MDB_page **mp) + np = txn->mt_loose_pgs; + txn->mt_loose_pgs = NEXT_LOOSE_PAGE(np); + txn->mt_loose_count--; +- DPRINTF(("db %d use loose page %"Z"u", DDBI(mc), +- np->mp_pgno)); ++ DPRINTF(("db %d use loose page %"Yu, DDBI(mc), np->mp_pgno)); + *mp = np; + return MDB_SUCCESS; + } +@@ -2149,6 +2376,14 @@ mdb_page_alloc(MDB_cursor *mc, int num, MDB_page **mp) + last = env->me_pglast; + oldest = env->me_pgoldest; + mdb_cursor_init(&m2, txn, FREE_DBI, NULL); ++#if (MDB_DEVEL) & 2 /* "& 2" so MDB_DEVEL=1 won't hide bugs breaking freeDB */ ++ /* Use original snapshot. TODO: Should need less care in code ++ * which modifies the database. Maybe we can delete some code? ++ */ ++ m2.mc_flags |= C_ORIG_RDONLY; ++ m2.mc_db = &env->me_metas[(txn->mt_txnid-1) & 1]->mm_dbs[FREE_DBI]; ++ m2.mc_dbflag = (unsigned char *)""; /* probably unnecessary */ ++#endif + if (last) { + op = MDB_SET_RANGE; + key.mv_data = &last; /* will look up last+1 */ +@@ -2189,7 +2424,7 @@ mdb_page_alloc(MDB_cursor *mc, int num, MDB_page **mp) + } + np = m2.mc_pg[m2.mc_top]; + leaf = NODEPTR(np, m2.mc_ki[m2.mc_top]); +- if ((rc = mdb_node_read(txn, leaf, &data)) != MDB_SUCCESS) ++ if ((rc = mdb_node_read(&m2, leaf, &data)) != MDB_SUCCESS) + return rc; + + idl = (MDB_ID *) data.mv_data; +@@ -2206,10 +2441,10 @@ mdb_page_alloc(MDB_cursor *mc, int num, MDB_page **mp) + } + env->me_pglast = last; + #if (MDB_DEBUG) > 1 +- DPRINTF(("IDL read txn %"Z"u root %"Z"u num %u", ++ DPRINTF(("IDL read txn %"Yu" root %"Yu" num %u", + last, txn->mt_dbs[FREE_DBI].md_root, i)); + for (j = i; j; j--) +- DPRINTF(("IDL %"Z"u", idl[j])); ++ DPRINTF(("IDL %"Yu, idl[j])); + #endif + /* Merge in descending sorted order */ + mdb_midl_xmerge(mop, idl); +@@ -2224,6 +2459,20 @@ mdb_page_alloc(MDB_cursor *mc, int num, MDB_page **mp) + rc = MDB_MAP_FULL; + goto fail; + } ++#if defined(_WIN32) && !defined(MDB_VL32) ++ if (!(env->me_flags & MDB_RDONLY)) { ++ void *p; ++ p = (MDB_page *)(env->me_map + env->me_psize * pgno); ++ p = VirtualAlloc(p, env->me_psize * num, MEM_COMMIT, ++ (env->me_flags & MDB_WRITEMAP) ? PAGE_READWRITE: ++ PAGE_READONLY); ++ if (!p) { ++ DPUTS("VirtualAlloc failed"); ++ rc = ErrCode(); ++ goto fail; ++ } ++ } ++#endif + + search_done: + if (env->me_flags & MDB_WRITEMAP) { +@@ -2365,7 +2614,7 @@ mdb_page_touch(MDB_cursor *mc) + (rc = mdb_page_alloc(mc, 1, &np))) + goto fail; + pgno = np->mp_pgno; +- DPRINTF(("touched db %d page %"Z"u -> %"Z"u", DDBI(mc), ++ DPRINTF(("touched db %d page %"Yu" -> %"Yu, DDBI(mc), + mp->mp_pgno, pgno)); + mdb_cassert(mc, mp->mp_pgno != pgno); + mdb_midl_xappend(txn->mt_free_pgs, mp->mp_pgno); +@@ -2389,7 +2638,7 @@ mdb_page_touch(MDB_cursor *mc) + if (mp != dl[x].mptr) { /* bad cursor? */ + mc->mc_flags &= ~(C_INITIALIZED|C_EOF); + txn->mt_flags |= MDB_TXN_ERROR; +- return MDB_CORRUPTED; ++ return MDB_PROBLEM; + } + return 0; + } +@@ -2439,6 +2688,7 @@ done: + } + } + } ++ MDB_PAGE_UNREF(mc->mc_txn, mp); + return 0; + + fail: +@@ -2447,7 +2697,7 @@ fail: + } + + int +-mdb_env_sync(MDB_env *env, int force) ++mdb_env_sync0(MDB_env *env, int force, pgno_t numpgs) + { + int rc = 0; + if (env->me_flags & MDB_RDONLY) +@@ -2456,7 +2706,7 @@ mdb_env_sync(MDB_env *env, int force) + if (env->me_flags & MDB_WRITEMAP) { + int flags = ((env->me_flags & MDB_MAPASYNC) && !force) + ? MS_ASYNC : MS_SYNC; +- if (MDB_MSYNC(env->me_map, env->me_mapsize, flags)) ++ if (MDB_MSYNC(env->me_map, env->me_psize * numpgs, flags)) + rc = ErrCode(); + #ifdef _WIN32 + else if (flags == MS_SYNC && MDB_FDATASYNC(env->me_fd)) +@@ -2476,6 +2726,13 @@ mdb_env_sync(MDB_env *env, int force) + return rc; + } + ++int ++mdb_env_sync(MDB_env *env, int force) ++{ ++ MDB_meta *m = mdb_env_pick_meta(env); ++ return mdb_env_sync0(env, force, m->mm_last_pg+1); ++} ++ + /** Back up parent txn's cursors, then grab the originals for tracking */ + static int + mdb_cursor_shadow(MDB_txn *src, MDB_txn *dst) +@@ -2720,6 +2977,9 @@ mdb_txn_renew0(MDB_txn *txn) + + /* Moved to here to avoid a data race in read TXNs */ + txn->mt_next_pgno = meta->mm_last_pg+1; ++#ifdef MDB_VL32 ++ txn->mt_last_pgno = txn->mt_next_pgno - 1; ++#endif + + txn->mt_flags = flags; + +@@ -2755,7 +3015,7 @@ mdb_txn_renew(MDB_txn *txn) + + rc = mdb_txn_renew0(txn); + if (rc == MDB_SUCCESS) { +- DPRINTF(("renew txn %"Z"u%c %p on mdbenv %p, root page %"Z"u", ++ DPRINTF(("renew txn %"Yu"%c %p on mdbenv %p, root page %"Yu, + txn->mt_txnid, (txn->mt_flags & MDB_TXN_RDONLY) ? 'r' : 'w', + (void *)txn, (void *)txn->mt_env, txn->mt_dbs[MAIN_DBI].md_root)); + } +@@ -2798,6 +3058,17 @@ mdb_txn_begin(MDB_env *env, MDB_txn *parent, unsigned int flags, MDB_txn **ret) + DPRINTF(("calloc: %s", strerror(errno))); + return ENOMEM; + } ++#ifdef MDB_VL32 ++ if (!parent) { ++ txn->mt_rpages = malloc(MDB_TRPAGE_SIZE * sizeof(MDB_ID3)); ++ if (!txn->mt_rpages) { ++ free(txn); ++ return ENOMEM; ++ } ++ txn->mt_rpages[0].mid = 0; ++ txn->mt_rpcheck = MDB_TRPAGE_SIZE/2; ++ } ++#endif + txn->mt_dbxs = env->me_dbxs; /* static */ + txn->mt_dbs = (MDB_db *) ((char *)txn + tsize); + txn->mt_dbflags = (unsigned char *)txn + size - env->me_maxdbs; +@@ -2825,6 +3096,9 @@ mdb_txn_begin(MDB_env *env, MDB_txn *parent, unsigned int flags, MDB_txn **ret) + parent->mt_child = txn; + txn->mt_parent = parent; + txn->mt_numdbs = parent->mt_numdbs; ++#ifdef MDB_VL32 ++ txn->mt_rpages = parent->mt_rpages; ++#endif + memcpy(txn->mt_dbs, parent->mt_dbs, txn->mt_numdbs * sizeof(MDB_db)); + /* Copy parent's mt_dbflags, but clear DB_NEW */ + for (i=0; imt_numdbs; i++) +@@ -2850,12 +3124,16 @@ renew: + rc = mdb_txn_renew0(txn); + } + if (rc) { +- if (txn != env->me_txn0) ++ if (txn != env->me_txn0) { ++#ifdef MDB_VL32 ++ free(txn->mt_rpages); ++#endif + free(txn); ++ } + } else { + txn->mt_flags |= flags; /* could not change txn=me_txn0 earlier */ + *ret = txn; +- DPRINTF(("begin txn %"Z"u%c %p on mdbenv %p, root page %"Z"u", ++ DPRINTF(("begin txn %"Yu"%c %p on mdbenv %p, root page %"Yu, + txn->mt_txnid, (flags & MDB_RDONLY) ? 'r' : 'w', + (void *) txn, (void *) env, txn->mt_dbs[MAIN_DBI].md_root)); + } +@@ -2870,7 +3148,7 @@ mdb_txn_env(MDB_txn *txn) + return txn->mt_env; + } + +-size_t ++mdb_size_t + mdb_txn_id(MDB_txn *txn) + { + if(!txn) return 0; +@@ -2922,7 +3200,7 @@ mdb_txn_end(MDB_txn *txn, unsigned mode) + /* Export or close DBI handles opened in this txn */ + mdb_dbis_update(txn, mode & MDB_END_UPDATE); + +- DPRINTF(("%s txn %"Z"u%c %p on mdbenv %p, root page %"Z"u", ++ DPRINTF(("%s txn %"Yu"%c %p on mdbenv %p, root page %"Yu, + names[mode & MDB_END_OPMASK], + txn->mt_txnid, (txn->mt_flags & MDB_TXN_RDONLY) ? 'r' : 'w', + (void *) txn, (void *)env, txn->mt_dbs[MAIN_DBI].md_root)); +@@ -2976,7 +3254,31 @@ mdb_txn_end(MDB_txn *txn, unsigned mode) + + mdb_midl_free(pghead); + } +- ++#ifdef MDB_VL32 ++ if (!txn->mt_parent) { ++ MDB_ID3L el = env->me_rpages, tl = txn->mt_rpages; ++ unsigned i, x, n = tl[0].mid; ++ pthread_mutex_lock(&env->me_rpmutex); ++ for (i = 1; i <= n; i++) { ++ if (tl[i].mid & (MDB_RPAGE_CHUNK-1)) { ++ /* tmp overflow pages that we didn't share in env */ ++ munmap(tl[i].mptr, tl[i].mcnt * env->me_psize); ++ } else { ++ x = mdb_mid3l_search(el, tl[i].mid); ++ if (tl[i].mptr == el[x].mptr) { ++ el[x].mref--; ++ } else { ++ /* another tmp overflow page */ ++ munmap(tl[i].mptr, tl[i].mcnt * env->me_psize); ++ } ++ } ++ } ++ pthread_mutex_unlock(&env->me_rpmutex); ++ tl[0].mid = 0; ++ if (mode & MDB_END_FREE) ++ free(tl); ++ } ++#endif + if (mode & MDB_END_FREE) + free(txn); + } +@@ -3008,6 +3310,9 @@ mdb_txn_abort(MDB_txn *txn) + + /** Save the freelist as of this transaction to the freeDB. + * This changes the freelist. Keep trying until it stabilizes. ++ * ++ * When (MDB_DEVEL) & 2, the changes do not affect #mdb_page_alloc(), ++ * it then uses the transaction's original snapshot of the freeDB. + */ + static int + mdb_freelist_save(MDB_txn *txn) +@@ -3096,10 +3401,10 @@ mdb_freelist_save(MDB_txn *txn) + #if (MDB_DEBUG) > 1 + { + unsigned int i = free_pgs[0]; +- DPRINTF(("IDL write txn %"Z"u root %"Z"u num %u", ++ DPRINTF(("IDL write txn %"Yu" root %"Yu" num %u", + txn->mt_txnid, txn->mt_dbs[FREE_DBI].md_root, i)); + for (; i; i--) +- DPRINTF(("IDL %"Z"u", free_pgs[i])); ++ DPRINTF(("IDL %"Yu, free_pgs[i])); + } + #endif + continue; +@@ -3210,15 +3515,16 @@ mdb_page_flush(MDB_txn *txn, int keep) + MDB_ID2L dl = txn->mt_u.dirty_list; + unsigned psize = env->me_psize, j; + int i, pagecount = dl[0].mid, rc; +- size_t size = 0, pos = 0; ++ size_t size = 0; ++ off_t pos = 0; + pgno_t pgno = 0; + MDB_page *dp = NULL; + #ifdef _WIN32 + OVERLAPPED ov; + #else + struct iovec iov[MDB_COMMIT_PAGES]; +- ssize_t wpos = 0, wsize = 0, wres; +- size_t next_pos = 1; /* impossible pos, so pos != next_pos */ ++ ssize_t wsize = 0, wres; ++ off_t wpos = 0, next_pos = 1; /* impossible pos, so pos != next_pos */ + int n = 0; + #endif + +@@ -3266,7 +3572,7 @@ mdb_page_flush(MDB_txn *txn, int keep) + * the write offset, to at least save the overhead of a Seek + * system call. + */ +- DPRINTF(("committing page %"Z"u", pgno)); ++ DPRINTF(("committing page %"Yu, pgno)); + memset(&ov, 0, sizeof(ov)); + ov.Offset = pos & 0xffffffff; + ov.OffsetHigh = pos >> 16 >> 16; +@@ -3317,7 +3623,7 @@ retry_seek: + wpos = pos; + wsize = 0; + } +- DPRINTF(("committing page %"Z"u", pgno)); ++ DPRINTF(("committing page %"Yu, pgno)); + next_pos = pos + size; + iov[n].iov_len = size; + iov[n].iov_base = (char *)dp; +@@ -3325,6 +3631,10 @@ retry_seek: + n++; + #endif /* _WIN32 */ + } ++#ifdef MDB_VL32 ++ if (pgno > txn->mt_last_pgno) ++ txn->mt_last_pgno = pgno; ++#endif + + /* MIPS has cache coherency issues, this is a no-op everywhere else + * Note: for any size >= on-chip cache size, entire on-chip cache is +@@ -3526,7 +3836,7 @@ mdb_txn_commit(MDB_txn *txn) + !(txn->mt_flags & (MDB_TXN_DIRTY|MDB_TXN_SPILLS))) + goto done; + +- DPRINTF(("committing txn %"Z"u %p on mdbenv %p, root page %"Z"u", ++ DPRINTF(("committing txn %"Yu" %p on mdbenv %p, root page %"Yu, + txn->mt_txnid, (void*)txn, (void*)env, txn->mt_dbs[MAIN_DBI].md_root)); + + /* Update DB root pointers */ +@@ -3564,9 +3874,12 @@ mdb_txn_commit(MDB_txn *txn) + mdb_audit(txn); + #endif + +- if ((rc = mdb_page_flush(txn, 0)) || +- (rc = mdb_env_sync(env, 0)) || +- (rc = mdb_env_write_meta(txn))) ++ if ((rc = mdb_page_flush(txn, 0))) ++ goto fail; ++ if (!F_ISSET(txn->mt_flags, MDB_TXN_NOSYNC) && ++ (rc = mdb_env_sync0(env, 0, txn->mt_next_pgno))) ++ goto fail; ++ if ((rc = mdb_env_write_meta(txn))) + goto fail; + end_mode = MDB_END_COMMITTED|MDB_END_UPDATE; + +@@ -3621,7 +3934,7 @@ mdb_env_read_header(MDB_env *env, MDB_meta *meta) + p = (MDB_page *)&pbuf; + + if (!F_ISSET(p->mp_flags, P_META)) { +- DPRINTF(("page %"Z"u not a meta page", p->mp_pgno)); ++ DPRINTF(("page %"Yu" not a meta page", p->mp_pgno)); + return MDB_INVALID; + } + +@@ -3691,7 +4004,6 @@ mdb_env_init_meta(MDB_env *env, MDB_meta *meta) + p = calloc(NUM_METAS, psize); + if (!p) + return ENOMEM; +- + p->mp_pgno = 0; + p->mp_flags = P_META; + *(MDB_meta *)METADATA(p) = *meta; +@@ -3722,7 +4034,7 @@ mdb_env_write_meta(MDB_txn *txn) + MDB_env *env; + MDB_meta meta, metab, *mp; + unsigned flags; +- size_t mapsize; ++ mdb_size_t mapsize; + off_t off; + int rc, len, toggle; + char *ptr; +@@ -3734,11 +4046,11 @@ mdb_env_write_meta(MDB_txn *txn) + #endif + + toggle = txn->mt_txnid & 1; +- DPRINTF(("writing meta page %d for root page %"Z"u", ++ DPRINTF(("writing meta page %d for root page %"Yu, + toggle, txn->mt_dbs[MAIN_DBI].md_root)); + + env = txn->mt_env; +- flags = env->me_flags; ++ flags = txn->mt_flags | env->me_flags; + mp = env->me_metas[toggle]; + mapsize = env->me_metas[toggle ^ 1]->mm_mapsize; + /* Persist any increases of mapsize config */ +@@ -3867,6 +4179,9 @@ mdb_env_create(MDB_env **env) + #ifdef MDB_USE_POSIX_SEM + e->me_rmutex = SEM_FAILED; + e->me_wmutex = SEM_FAILED; ++#elif defined MDB_USE_SYSV_SEM ++ e->me_rmutex->semid = -1; ++ e->me_wmutex->semid = -1; + #endif + e->me_pid = getpid(); + GET_PAGESIZE(e->me_os_psize); +@@ -3875,6 +4190,19 @@ mdb_env_create(MDB_env **env) + return MDB_SUCCESS; + } + ++#ifdef _WIN32 ++/** @brief Map a result from an NTAPI call to WIN32. */ ++static DWORD ++mdb_nt2win32(NTSTATUS st) ++{ ++ OVERLAPPED o = {0}; ++ DWORD br; ++ o.Internal = st; ++ GetOverlappedResult(NULL, &o, &br, FALSE); ++ return GetLastError(); ++} ++#endif ++ + static int ESECT + mdb_env_map(MDB_env *env, void *addr) + { +@@ -3882,42 +4210,51 @@ mdb_env_map(MDB_env *env, void *addr) + unsigned int flags = env->me_flags; + #ifdef _WIN32 + int rc; ++ int access = SECTION_MAP_READ; + HANDLE mh; +- LONG sizelo, sizehi; +- size_t msize; ++ void *map; ++ SIZE_T msize; ++ ULONG pageprot = PAGE_READONLY, secprot, alloctype; + ++ if (flags & MDB_WRITEMAP) { ++ access |= SECTION_MAP_WRITE; ++ pageprot = PAGE_READWRITE; ++ } + if (flags & MDB_RDONLY) { +- /* Don't set explicit map size, use whatever exists */ ++ secprot = PAGE_READONLY; + msize = 0; +- sizelo = 0; +- sizehi = 0; ++ alloctype = 0; + } else { ++ secprot = PAGE_READWRITE; + msize = env->me_mapsize; +- sizelo = msize & 0xffffffff; +- sizehi = msize >> 16 >> 16; /* only needed on Win64 */ +- +- /* Windows won't create mappings for zero length files. +- * and won't map more than the file size. +- * Just set the maxsize right now. +- */ +- if (SetFilePointer(env->me_fd, sizelo, &sizehi, 0) != (DWORD)sizelo +- || !SetEndOfFile(env->me_fd) +- || SetFilePointer(env->me_fd, 0, NULL, 0) != 0) +- return ErrCode(); ++ alloctype = MEM_RESERVE; + } + +- mh = CreateFileMapping(env->me_fd, NULL, flags & MDB_WRITEMAP ? +- PAGE_READWRITE : PAGE_READONLY, +- sizehi, sizelo, NULL); +- if (!mh) +- return ErrCode(); +- env->me_map = MapViewOfFileEx(mh, flags & MDB_WRITEMAP ? +- FILE_MAP_WRITE : FILE_MAP_READ, +- 0, 0, msize, addr); +- rc = env->me_map ? 0 : ErrCode(); +- CloseHandle(mh); ++ rc = NtCreateSection(&mh, access, NULL, NULL, secprot, SEC_RESERVE, env->me_fd); + if (rc) +- return rc; ++ return mdb_nt2win32(rc); ++ map = addr; ++#ifdef MDB_VL32 ++ msize = NUM_METAS * env->me_psize; ++#endif ++ rc = NtMapViewOfSection(mh, GetCurrentProcess(), &map, 0, 0, NULL, &msize, ViewUnmap, alloctype, pageprot); ++#ifdef MDB_VL32 ++ env->me_fmh = mh; ++#else ++ NtClose(mh); ++#endif ++ if (rc) ++ return mdb_nt2win32(rc); ++ env->me_map = map; ++#else ++#ifdef MDB_VL32 ++ (void) flags; ++ env->me_map = mmap(addr, NUM_METAS * env->me_psize, PROT_READ, MAP_SHARED, ++ env->me_fd, 0); ++ if (env->me_map == MAP_FAILED) { ++ env->me_map = NULL; ++ return ErrCode(); ++ } + #else + int prot = PROT_READ; + if (flags & MDB_WRITEMAP) { +@@ -3951,6 +4288,7 @@ mdb_env_map(MDB_env *env, void *addr) + */ + if (addr && env->me_map != addr) + return EBUSY; /* TODO: Make a new MDB_* error code? */ ++#endif + + p = (MDB_page *)env->me_map; + env->me_metas[0] = METADATA(p); +@@ -3960,15 +4298,17 @@ mdb_env_map(MDB_env *env, void *addr) + } + + int ESECT +-mdb_env_set_mapsize(MDB_env *env, size_t size) ++mdb_env_set_mapsize(MDB_env *env, mdb_size_t size) + { + /* If env is already open, caller is responsible for making + * sure there are no active txns. + */ + if (env->me_map) { +- int rc; + MDB_meta *meta; ++#ifndef MDB_VL32 + void *old; ++ int rc; ++#endif + if (env->me_txn) + return EINVAL; + meta = mdb_env_pick_meta(env); +@@ -3976,16 +4316,21 @@ mdb_env_set_mapsize(MDB_env *env, size_t size) + size = meta->mm_mapsize; + { + /* Silently round up to minimum if the size is too small */ +- size_t minsize = (meta->mm_last_pg + 1) * env->me_psize; ++ mdb_size_t minsize = (meta->mm_last_pg + 1) * env->me_psize; + if (size < minsize) + size = minsize; + } ++#ifndef MDB_VL32 ++ /* For MDB_VL32 this bit is a noop since we dynamically remap ++ * chunks of the DB anyway. ++ */ + munmap(env->me_map, env->me_mapsize); + env->me_mapsize = size; + old = (env->me_flags & MDB_FIXEDMAP) ? env->me_map : NULL; + rc = mdb_env_map(env, old); + if (rc) + return rc; ++#endif /* !MDB_VL32 */ + } + env->me_mapsize = size; + if (env->me_psize) +@@ -4021,7 +4366,7 @@ mdb_env_get_maxreaders(MDB_env *env, unsigned int *readers) + } + + static int ESECT +-mdb_fsize(HANDLE fd, size_t *size) ++mdb_fsize(HANDLE fd, mdb_size_t *size) + { + #ifdef _WIN32 + LARGE_INTEGER fsize; +@@ -4135,7 +4480,7 @@ mdb_env_open2(MDB_env *env) + /* Make sure mapsize >= committed data size. Even when using + * mm_mapsize, which could be broken in old files (ITS#7789). + */ +- size_t minsize = (meta.mm_last_pg + 1) * meta.mm_psize; ++ mdb_size_t minsize = (meta.mm_last_pg + 1) * meta.mm_psize; + if (env->me_mapsize < minsize) + env->me_mapsize = minsize; + } +@@ -4154,6 +4499,18 @@ mdb_env_open2(MDB_env *env) + return rc; + newenv = 0; + } ++#ifdef _WIN32 ++ /* For FIXEDMAP, make sure the file is non-empty before we attempt to map it */ ++ if (newenv) { ++ char dummy = 0; ++ DWORD len; ++ rc = WriteFile(env->me_fd, &dummy, 1, &len, NULL); ++ if (!rc) { ++ rc = ErrCode(); ++ return rc; ++ } ++ } ++#endif + + rc = mdb_env_map(env, (flags & MDB_FIXEDMAP) ? meta.mm_address : NULL); + if (rc) +@@ -4183,13 +4540,13 @@ mdb_env_open2(MDB_env *env) + + DPRINTF(("opened database version %u, pagesize %u", + meta->mm_version, env->me_psize)); +- DPRINTF(("using meta page %d", (int) (meta->mm_txnid & 1))); +- DPRINTF(("depth: %u", db->md_depth)); +- DPRINTF(("entries: %"Z"u", db->md_entries)); +- DPRINTF(("branch pages: %"Z"u", db->md_branch_pages)); +- DPRINTF(("leaf pages: %"Z"u", db->md_leaf_pages)); +- DPRINTF(("overflow pages: %"Z"u", db->md_overflow_pages)); +- DPRINTF(("root: %"Z"u", db->md_root)); ++ DPRINTF(("using meta page %d", (int) (meta->mm_txnid & 1))); ++ DPRINTF(("depth: %u", db->md_depth)); ++ DPRINTF(("entries: %"Yu, db->md_entries)); ++ DPRINTF(("branch pages: %"Yu, db->md_branch_pages)); ++ DPRINTF(("leaf pages: %"Yu, db->md_leaf_pages)); ++ DPRINTF(("overflow pages: %"Yu, db->md_overflow_pages)); ++ DPRINTF(("root: %"Yu, db->md_root)); + } + #endif + +@@ -4465,6 +4822,10 @@ mdb_env_setup_locks(MDB_env *env, char *lpath, int mode, int *excl) + # define MDB_CLOEXEC 0 + #endif + #endif ++#ifdef MDB_USE_SYSV_SEM ++ int semid; ++ union semun semu; ++#endif + int rc; + off_t size, rsize; + +@@ -4616,19 +4977,42 @@ mdb_env_setup_locks(MDB_env *env, char *lpath, int mode, int *excl) + env->me_wmutex = sem_open(env->me_txns->mti_wmname, + O_CREAT|O_EXCL, mode, 1); + if (env->me_wmutex == SEM_FAILED) goto fail_errno; ++#elif defined(MDB_USE_SYSV_SEM) ++ unsigned short vals[2] = {1, 1}; ++ key_t key = ftok(lpath, 'M'); ++ if (key == -1) ++ goto fail_errno; ++ semid = semget(key, 2, (mode & 0777) | IPC_CREAT); ++ if (semid < 0) ++ goto fail_errno; ++ semu.array = vals; ++ if (semctl(semid, 0, SETALL, semu) < 0) ++ goto fail_errno; ++ env->me_txns->mti_semid = semid; ++ env->me_txns->mti_rlocked = 0; ++ env->me_txns->mti_wlocked = 0; + #else /* MDB_USE_POSIX_MUTEX: */ + pthread_mutexattr_t mattr; + +- if ((rc = pthread_mutexattr_init(&mattr)) +- || (rc = pthread_mutexattr_setpshared(&mattr, PTHREAD_PROCESS_SHARED)) ++ /* Solaris needs this before initing a robust mutex. Otherwise ++ * it may skip the init and return EBUSY "seems someone already ++ * inited" or EINVAL "it was inited differently". ++ */ ++ memset(env->me_txns->mti_rmutex, 0, sizeof(*env->me_txns->mti_rmutex)); ++ memset(env->me_txns->mti_wmutex, 0, sizeof(*env->me_txns->mti_wmutex)); ++ ++ if ((rc = pthread_mutexattr_init(&mattr)) != 0) ++ goto fail; ++ rc = pthread_mutexattr_setpshared(&mattr, PTHREAD_PROCESS_SHARED); + #ifdef MDB_ROBUST_SUPPORTED +- || (rc = pthread_mutexattr_setrobust(&mattr, PTHREAD_MUTEX_ROBUST)) ++ if (!rc) rc = pthread_mutexattr_setrobust(&mattr, PTHREAD_MUTEX_ROBUST); + #endif +- || (rc = pthread_mutex_init(env->me_txns->mti_rmutex, &mattr)) +- || (rc = pthread_mutex_init(env->me_txns->mti_wmutex, &mattr))) +- goto fail; ++ if (!rc) rc = pthread_mutex_init(env->me_txns->mti_rmutex, &mattr); ++ if (!rc) rc = pthread_mutex_init(env->me_txns->mti_wmutex, &mattr); + pthread_mutexattr_destroy(&mattr); +-#endif /* _WIN32 || MDB_USE_POSIX_SEM */ ++ if (rc) ++ goto fail; ++#endif /* _WIN32 || ... */ + + env->me_txns->mti_magic = MDB_MAGIC; + env->me_txns->mti_format = MDB_LOCK_FORMAT; +@@ -4636,6 +5020,9 @@ mdb_env_setup_locks(MDB_env *env, char *lpath, int mode, int *excl) + env->me_txns->mti_numreaders = 0; + + } else { ++#ifdef MDB_USE_SYSV_SEM ++ struct semid_ds buf; ++#endif + if (env->me_txns->mti_magic != MDB_MAGIC) { + DPUTS("lock region has invalid magic"); + rc = MDB_INVALID; +@@ -4661,8 +5048,33 @@ mdb_env_setup_locks(MDB_env *env, char *lpath, int mode, int *excl) + if (env->me_rmutex == SEM_FAILED) goto fail_errno; + env->me_wmutex = sem_open(env->me_txns->mti_wmname, 0); + if (env->me_wmutex == SEM_FAILED) goto fail_errno; ++#elif defined(MDB_USE_SYSV_SEM) ++ semid = env->me_txns->mti_semid; ++ semu.buf = &buf; ++ /* check for read access */ ++ if (semctl(semid, 0, IPC_STAT, semu) < 0) ++ goto fail_errno; ++ /* check for write access */ ++ if (semctl(semid, 0, IPC_SET, semu) < 0) ++ goto fail_errno; + #endif + } ++#ifdef MDB_USE_SYSV_SEM ++ env->me_rmutex->semid = semid; ++ env->me_wmutex->semid = semid; ++ env->me_rmutex->semnum = 0; ++ env->me_wmutex->semnum = 1; ++ env->me_rmutex->locked = &env->me_txns->mti_rlocked; ++ env->me_wmutex->locked = &env->me_txns->mti_wlocked; ++#endif ++#ifdef MDB_VL32 ++#ifdef _WIN32 ++ env->me_rpmutex = CreateMutex(NULL, FALSE, NULL); ++#else ++ pthread_mutex_init(&env->me_rpmutex, NULL); ++#endif ++#endif ++ + return MDB_SUCCESS; + + fail_errno: +@@ -4701,6 +5113,17 @@ mdb_env_open(MDB_env *env, const char *path, unsigned int flags, mdb_mode_t mode + if (env->me_fd!=INVALID_HANDLE_VALUE || (flags & ~(CHANGEABLE|CHANGELESS))) + return EINVAL; + ++#ifdef MDB_VL32 ++ if (flags & MDB_WRITEMAP) { ++ /* silently ignore WRITEMAP in 32 bit mode */ ++ flags ^= MDB_WRITEMAP; ++ } ++ if (flags & MDB_FIXEDMAP) { ++ /* cannot support FIXEDMAP */ ++ return EINVAL; ++ } ++#endif ++ + len = strlen(path); + if (flags & MDB_NOSUBDIR) { + rc = len + sizeof(LOCKSUFF) + len + 1; +@@ -4730,6 +5153,17 @@ mdb_env_open(MDB_env *env, const char *path, unsigned int flags, mdb_mode_t mode + (env->me_dirty_list = calloc(MDB_IDL_UM_SIZE, sizeof(MDB_ID2))))) + rc = ENOMEM; + } ++#ifdef MDB_VL32 ++ if (!rc) { ++ env->me_rpages = malloc(MDB_ERPAGE_SIZE * sizeof(MDB_ID3)); ++ if (!env->me_rpages) { ++ rc = ENOMEM; ++ goto leave; ++ } ++ env->me_rpages[0].mid = 0; ++ env->me_rpcheck = MDB_ERPAGE_SIZE/2; ++ } ++#endif + env->me_flags = flags |= MDB_ENV_ACTIVE; + if (rc) + goto leave; +@@ -4828,6 +5262,16 @@ mdb_env_open(MDB_env *env, const char *path, unsigned int flags, mdb_mode_t mode + txn->mt_dbiseqs = (unsigned int *)(txn->mt_cursors + env->me_maxdbs); + txn->mt_dbflags = (unsigned char *)(txn->mt_dbiseqs + env->me_maxdbs); + txn->mt_env = env; ++#ifdef MDB_VL32 ++ txn->mt_rpages = malloc(MDB_TRPAGE_SIZE * sizeof(MDB_ID3)); ++ if (!txn->mt_rpages) { ++ free(txn); ++ rc = ENOMEM; ++ goto leave; ++ } ++ txn->mt_rpages[0].mid = 0; ++ txn->mt_rpcheck = MDB_TRPAGE_SIZE/2; ++#endif + txn->mt_dbxs = env->me_dbxs; + txn->mt_flags = MDB_TXN_FINISHED; + env->me_txn0 = txn; +@@ -4866,6 +5310,15 @@ mdb_env_close0(MDB_env *env, int excl) + free(env->me_dbflags); + free(env->me_path); + free(env->me_dirty_list); ++#ifdef MDB_VL32 ++ if (env->me_txn0 && env->me_txn0->mt_rpages) ++ free(env->me_txn0->mt_rpages); ++ { unsigned int x; ++ for (x=1; x<=env->me_rpages[0].mid; x++) ++ munmap(env->me_rpages[x].mptr, env->me_rpages[x].mcnt * env->me_psize); ++ } ++ free(env->me_rpages); ++#endif + free(env->me_txn0); + mdb_midl_free(env->me_free_pgs); + +@@ -4883,7 +5336,11 @@ mdb_env_close0(MDB_env *env, int excl) + } + + if (env->me_map) { ++#ifdef MDB_VL32 ++ munmap(env->me_map, NUM_METAS*env->me_psize); ++#else + munmap(env->me_map, env->me_mapsize); ++#endif + } + if (env->me_mfd != env->me_fd && env->me_mfd != INVALID_HANDLE_VALUE) + (void) close(env->me_mfd); +@@ -4924,6 +5381,16 @@ mdb_env_close0(MDB_env *env, int excl) + sem_unlink(env->me_txns->mti_wmname); + } + } ++#elif defined(MDB_USE_SYSV_SEM) ++ if (env->me_rmutex->semid != -1) { ++ /* If we have the filelock: If we are the ++ * only remaining user, clean up semaphores. ++ */ ++ if (excl == 0) ++ mdb_env_excl_lock(env, &excl); ++ if (excl > 0) ++ semctl(env->me_rmutex->semid, 0, IPC_RMID); ++ } + #endif + munmap((void *)env->me_txns, (env->me_maxreaders-1)*sizeof(MDB_reader)+sizeof(MDB_txninfo)); + } +@@ -4938,6 +5405,14 @@ mdb_env_close0(MDB_env *env, int excl) + #endif + (void) close(env->me_lfd); + } ++#ifdef MDB_VL32 ++#ifdef _WIN32 ++ if (env->me_fmh) CloseHandle(env->me_fmh); ++ if (env->me_rpmutex) CloseHandle(env->me_rpmutex); ++#else ++ pthread_mutex_destroy(&env->me_rpmutex); ++#endif ++#endif + + env->me_flags &= ~(MDB_ENV_ACTIVE|MDB_ENV_TXKEY); + } +@@ -4961,18 +5436,18 @@ mdb_env_close(MDB_env *env) + free(env); + } + +-/** Compare two items pointing at aligned size_t's */ ++/** Compare two items pointing at aligned #mdb_size_t's */ + static int + mdb_cmp_long(const MDB_val *a, const MDB_val *b) + { +- return (*(size_t *)a->mv_data < *(size_t *)b->mv_data) ? -1 : +- *(size_t *)a->mv_data > *(size_t *)b->mv_data; ++ return (*(mdb_size_t *)a->mv_data < *(mdb_size_t *)b->mv_data) ? -1 : ++ *(mdb_size_t *)a->mv_data > *(mdb_size_t *)b->mv_data; + } + + /** Compare two items pointing at aligned unsigned int's. + * + * This is also set as #MDB_INTEGERDUP|#MDB_DUPFIXED's #MDB_dbx.%md_dcmp, +- * but #mdb_cmp_clong() is called instead if the data type is size_t. ++ * but #mdb_cmp_clong() is called instead if the data type is #mdb_size_t. + */ + static int + mdb_cmp_int(const MDB_val *a, const MDB_val *b) +@@ -5077,7 +5552,7 @@ mdb_node_search(MDB_cursor *mc, MDB_val *key, int *exactp) + + nkeys = NUMKEYS(mp); + +- DPRINTF(("searching %u keys in %s %spage %"Z"u", ++ DPRINTF(("searching %u keys in %s %spage %"Yu, + nkeys, IS_LEAF(mp) ? "leaf" : "branch", IS_SUBP(mp) ? "sub-" : "", + mdb_dbg_pgno(mp))); + +@@ -5089,7 +5564,7 @@ mdb_node_search(MDB_cursor *mc, MDB_val *key, int *exactp) + * alignment is guaranteed. Use faster mdb_cmp_int. + */ + if (cmp == mdb_cmp_cint && IS_BRANCH(mp)) { +- if (NODEPTR(mp, 1)->mn_ksize == sizeof(size_t)) ++ if (NODEPTR(mp, 1)->mn_ksize == sizeof(mdb_size_t)) + cmp = mdb_cmp_long; + else + cmp = mdb_cmp_int; +@@ -5125,7 +5600,7 @@ mdb_node_search(MDB_cursor *mc, MDB_val *key, int *exactp) + DPRINTF(("found leaf index %u [%s], rc = %i", + i, DKEY(&nodekey), rc)); + else +- DPRINTF(("found branch index %u [%s -> %"Z"u], rc = %i", ++ DPRINTF(("found branch index %u [%s -> %"Yu"], rc = %i", + i, DKEY(&nodekey), NODEPGNO(node), rc)); + #endif + if (rc == 0) +@@ -5173,7 +5648,7 @@ static void + mdb_cursor_pop(MDB_cursor *mc) + { + if (mc->mc_snum) { +- DPRINTF(("popping page %"Z"u off db %d cursor %p", ++ DPRINTF(("popping page %"Yu" off db %d cursor %p", + mc->mc_pg[mc->mc_top]->mp_pgno, DDBI(mc), (void *) mc)); + + mc->mc_snum--; +@@ -5189,7 +5664,7 @@ mdb_cursor_pop(MDB_cursor *mc) + static int + mdb_cursor_push(MDB_cursor *mc, MDB_page *mp) + { +- DPRINTF(("pushing page %"Z"u on db %d cursor %p", mp->mp_pgno, ++ DPRINTF(("pushing page %"Yu" on db %d cursor %p", mp->mp_pgno, + DDBI(mc), (void *) mc)); + + if (mc->mc_snum >= CURSOR_STACK) { +@@ -5204,21 +5679,309 @@ mdb_cursor_push(MDB_cursor *mc, MDB_page *mp) + return MDB_SUCCESS; + } + +-/** Find the address of the page corresponding to a given page number. ++#ifdef MDB_VL32 ++/** Map a read-only page. ++ * There are two levels of tracking in use, a per-txn list and a per-env list. ++ * ref'ing and unref'ing the per-txn list is faster since it requires no ++ * locking. Pages are cached in the per-env list for global reuse, and a lock ++ * is required. Pages are not immediately unmapped when their refcnt goes to ++ * zero; they hang around in case they will be reused again soon. ++ * ++ * When the per-txn list gets full, all pages with refcnt=0 are purged from the ++ * list and their refcnts in the per-env list are decremented. ++ * ++ * When the per-env list gets full, all pages with refcnt=0 are purged from the ++ * list and their pages are unmapped. ++ * ++ * @note "full" means the list has reached its respective rpcheck threshold. ++ * This threshold slowly raises if no pages could be purged on a given check, ++ * and returns to its original value when enough pages were purged. ++ * ++ * If purging doesn't free any slots, filling the per-txn list will return ++ * MDB_TXN_FULL, and filling the per-env list returns MDB_MAP_FULL. ++ * ++ * Reference tracking in a txn is imperfect, pages can linger with non-zero ++ * refcnt even without active references. It was deemed to be too invasive ++ * to add unrefs in every required location. However, all pages are unref'd ++ * at the end of the transaction. This guarantees that no stale references ++ * linger in the per-env list. ++ * ++ * Usually we map chunks of 16 pages at a time, but if an overflow page begins ++ * at the tail of the chunk we extend the chunk to include the entire overflow ++ * page. Unfortunately, pages can be turned into overflow pages after their ++ * chunk was already mapped. In that case we must remap the chunk if the ++ * overflow page is referenced. If the chunk's refcnt is 0 we can just remap ++ * it, otherwise we temporarily map a new chunk just for the overflow page. ++ * ++ * @note this chunk handling means we cannot guarantee that a data item ++ * returned from the DB will stay alive for the duration of the transaction: ++ * We unref pages as soon as a cursor moves away from the page ++ * A subsequent op may cause a purge, which may unmap any unref'd chunks ++ * The caller must copy the data if it must be used later in the same txn. ++ * ++ * Also - our reference counting revolves around cursors, but overflow pages ++ * aren't pointed to by a cursor's page stack. We have to remember them ++ * explicitly, in the added mc_ovpg field. A single cursor can only hold a ++ * reference to one overflow page at a time. ++ * + * @param[in] txn the transaction for this access. + * @param[in] pgno the page number for the page to retrieve. + * @param[out] ret address of a pointer where the page's address will be stored. +- * @param[out] lvl dirty_list inheritance level of found page. 1=current txn, 0=mapped page. + * @return 0 on success, non-zero on failure. + */ + static int +-mdb_page_get(MDB_txn *txn, pgno_t pgno, MDB_page **ret, int *lvl) ++mdb_rpage_get(MDB_txn *txn, pgno_t pg0, MDB_page **ret) + { + MDB_env *env = txn->mt_env; ++ MDB_page *p; ++ MDB_ID3L tl = txn->mt_rpages; ++ MDB_ID3L el = env->me_rpages; ++ MDB_ID3 id3; ++ unsigned x, rem; ++ pgno_t pgno; ++ int rc, retries = 1; ++#ifdef _WIN32 ++ LARGE_INTEGER off; ++ SIZE_T len; ++#define SET_OFF(off,val) off.QuadPart = val ++#define MAP(rc,env,addr,len,off) \ ++ addr = NULL; \ ++ rc = NtMapViewOfSection(env->me_fmh, GetCurrentProcess(), &addr, 0, \ ++ len, &off, &len, ViewUnmap, (env->me_flags & MDB_RDONLY) ? 0 : MEM_RESERVE, PAGE_READONLY); \ ++ if (rc) rc = mdb_nt2win32(rc) ++#else ++ off_t off; ++ size_t len; ++#define SET_OFF(off,val) off = val ++#define MAP(rc,env,addr,len,off) \ ++ addr = mmap(NULL, len, PROT_READ, MAP_SHARED, env->me_fd, off); \ ++ rc = (addr == MAP_FAILED) ? errno : 0 ++#endif ++ ++ /* remember the offset of the actual page number, so we can ++ * return the correct pointer at the end. ++ */ ++ rem = pg0 & (MDB_RPAGE_CHUNK-1); ++ pgno = pg0 ^ rem; ++ ++ id3.mid = 0; ++ x = mdb_mid3l_search(tl, pgno); ++ if (x <= tl[0].mid && tl[x].mid == pgno) { ++ if (x != tl[0].mid && tl[x+1].mid == pg0) ++ x++; ++ /* check for overflow size */ ++ p = (MDB_page *)((char *)tl[x].mptr + rem * env->me_psize); ++ if (IS_OVERFLOW(p) && p->mp_pages + rem > tl[x].mcnt) { ++ id3.mcnt = p->mp_pages + rem; ++ len = id3.mcnt * env->me_psize; ++ SET_OFF(off, pgno * env->me_psize); ++ MAP(rc, env, id3.mptr, len, off); ++ if (rc) ++ return rc; ++ /* check for local-only page */ ++ if (rem) { ++ mdb_tassert(txn, tl[x].mid != pg0); ++ /* hope there's room to insert this locally. ++ * setting mid here tells later code to just insert ++ * this id3 instead of searching for a match. ++ */ ++ id3.mid = pg0; ++ goto notlocal; ++ } else { ++ /* ignore the mapping we got from env, use new one */ ++ tl[x].mptr = id3.mptr; ++ tl[x].mcnt = id3.mcnt; ++ /* if no active ref, see if we can replace in env */ ++ if (!tl[x].mref) { ++ unsigned i; ++ pthread_mutex_lock(&env->me_rpmutex); ++ i = mdb_mid3l_search(el, tl[x].mid); ++ if (el[i].mref == 1) { ++ /* just us, replace it */ ++ munmap(el[i].mptr, el[i].mcnt * env->me_psize); ++ el[i].mptr = tl[x].mptr; ++ el[i].mcnt = tl[x].mcnt; ++ } else { ++ /* there are others, remove ourself */ ++ el[i].mref--; ++ } ++ pthread_mutex_unlock(&env->me_rpmutex); ++ } ++ } ++ } ++ id3.mptr = tl[x].mptr; ++ id3.mcnt = tl[x].mcnt; ++ tl[x].mref++; ++ goto ok; ++ } ++ ++notlocal: ++ if (tl[0].mid >= MDB_TRPAGE_MAX - txn->mt_rpcheck) { ++ unsigned i, y; ++ /* purge unref'd pages from our list and unref in env */ ++ pthread_mutex_lock(&env->me_rpmutex); ++retry: ++ y = 0; ++ for (i=1; i<=tl[0].mid; i++) { ++ if (!tl[i].mref) { ++ if (!y) y = i; ++ /* tmp overflow pages don't go to env */ ++ if (tl[i].mid & (MDB_RPAGE_CHUNK-1)) { ++ munmap(tl[i].mptr, tl[i].mcnt * env->me_psize); ++ continue; ++ } ++ x = mdb_mid3l_search(el, tl[i].mid); ++ el[x].mref--; ++ } ++ } ++ pthread_mutex_unlock(&env->me_rpmutex); ++ if (!y) { ++ /* we didn't find any unref'd chunks. ++ * if we're out of room, fail. ++ */ ++ if (tl[0].mid >= MDB_TRPAGE_MAX) ++ return MDB_TXN_FULL; ++ /* otherwise, raise threshold for next time around ++ * and let this go. ++ */ ++ txn->mt_rpcheck /= 2; ++ } else { ++ /* we found some unused; consolidate the list */ ++ for (i=y+1; i<= tl[0].mid; i++) ++ if (tl[i].mref) ++ tl[y++] = tl[i]; ++ tl[0].mid = y-1; ++ /* decrease the check threshold toward its original value */ ++ if (!txn->mt_rpcheck) ++ txn->mt_rpcheck = 1; ++ while (txn->mt_rpcheck < tl[0].mid && txn->mt_rpcheck < MDB_TRPAGE_SIZE/2) ++ txn->mt_rpcheck *= 2; ++ } ++ } ++ if (tl[0].mid < MDB_TRPAGE_SIZE) { ++ id3.mref = 1; ++ if (id3.mid) ++ goto found; ++ /* don't map past last written page in read-only envs */ ++ if ((env->me_flags & MDB_RDONLY) && pgno + MDB_RPAGE_CHUNK-1 > txn->mt_last_pgno) ++ id3.mcnt = txn->mt_last_pgno + 1 - pgno; ++ else ++ id3.mcnt = MDB_RPAGE_CHUNK; ++ len = id3.mcnt * env->me_psize; ++ id3.mid = pgno; ++ ++ /* search for page in env */ ++ pthread_mutex_lock(&env->me_rpmutex); ++ x = mdb_mid3l_search(el, pgno); ++ if (x <= el[0].mid && el[x].mid == pgno) { ++ id3.mptr = el[x].mptr; ++ id3.mcnt = el[x].mcnt; ++ /* check for overflow size */ ++ p = (MDB_page *)((char *)id3.mptr + rem * env->me_psize); ++ if (IS_OVERFLOW(p) && p->mp_pages + rem > id3.mcnt) { ++ id3.mcnt = p->mp_pages + rem; ++ len = id3.mcnt * env->me_psize; ++ SET_OFF(off, pgno * env->me_psize); ++ MAP(rc, env, id3.mptr, len, off); ++ if (rc) ++ goto fail; ++ if (!el[x].mref) { ++ munmap(el[x].mptr, env->me_psize * el[x].mcnt); ++ el[x].mptr = id3.mptr; ++ el[x].mcnt = id3.mcnt; ++ } else { ++ id3.mid = pg0; ++ pthread_mutex_unlock(&env->me_rpmutex); ++ goto found; ++ } ++ } ++ el[x].mref++; ++ pthread_mutex_unlock(&env->me_rpmutex); ++ goto found; ++ } ++ if (el[0].mid >= MDB_ERPAGE_MAX - env->me_rpcheck) { ++ /* purge unref'd pages */ ++ unsigned i, y = 0; ++ for (i=1; i<=el[0].mid; i++) { ++ if (!el[i].mref) { ++ if (!y) y = i; ++ munmap(el[i].mptr, env->me_psize * el[i].mcnt); ++ } ++ } ++ if (!y) { ++ if (retries) { ++ /* see if we can unref some local pages */ ++ retries--; ++ id3.mid = 0; ++ goto retry; ++ } ++ if (el[0].mid >= MDB_ERPAGE_MAX) { ++ pthread_mutex_unlock(&env->me_rpmutex); ++ return MDB_MAP_FULL; ++ } ++ env->me_rpcheck /= 2; ++ } else { ++ for (i=y+1; i<= el[0].mid; i++) ++ if (el[i].mref) ++ el[y++] = el[i]; ++ el[0].mid = y-1; ++ if (!env->me_rpcheck) ++ env->me_rpcheck = 1; ++ while (env->me_rpcheck < el[0].mid && env->me_rpcheck < MDB_ERPAGE_SIZE/2) ++ env->me_rpcheck *= 2; ++ } ++ } ++ SET_OFF(off, pgno * env->me_psize); ++ MAP(rc, env, id3.mptr, len, off); ++ if (rc) { ++fail: ++ pthread_mutex_unlock(&env->me_rpmutex); ++ return rc; ++ } ++ /* check for overflow size */ ++ p = (MDB_page *)((char *)id3.mptr + rem * env->me_psize); ++ if (IS_OVERFLOW(p) && p->mp_pages + rem > id3.mcnt) { ++ id3.mcnt = p->mp_pages + rem; ++ munmap(id3.mptr, len); ++ len = id3.mcnt * env->me_psize; ++ MAP(rc, env, id3.mptr, len, off); ++ if (rc) ++ goto fail; ++ } ++ mdb_mid3l_insert(el, &id3); ++ pthread_mutex_unlock(&env->me_rpmutex); ++found: ++ mdb_mid3l_insert(tl, &id3); ++ } else { ++ return MDB_TXN_FULL; ++ } ++ok: ++ p = (MDB_page *)((char *)id3.mptr + rem * env->me_psize); ++#if MDB_DEBUG /* we don't need this check any more */ ++ if (IS_OVERFLOW(p)) { ++ mdb_tassert(txn, p->mp_pages + rem <= id3.mcnt); ++ } ++#endif ++ *ret = p; ++ return MDB_SUCCESS; ++} ++#endif ++ ++/** Find the address of the page corresponding to a given page number. ++ * @param[in] mc the cursor accessing the page. ++ * @param[in] pgno the page number for the page to retrieve. ++ * @param[out] ret address of a pointer where the page's address will be stored. ++ * @param[out] lvl dirty_list inheritance level of found page. 1=current txn, 0=mapped page. ++ * @return 0 on success, non-zero on failure. ++ */ ++static int ++mdb_page_get(MDB_cursor *mc, pgno_t pgno, MDB_page **ret, int *lvl) ++{ ++ MDB_txn *txn = mc->mc_txn; + MDB_page *p = NULL; + int level; + +- if (! (txn->mt_flags & (MDB_TXN_RDONLY|MDB_TXN_WRITEMAP))) { ++ if (! (mc->mc_flags & (C_ORIG_RDONLY|C_WRITEMAP))) { + MDB_txn *tx2 = txn; + level = 1; + do { +@@ -5233,8 +5996,7 @@ mdb_page_get(MDB_txn *txn, pgno_t pgno, MDB_page **ret, int *lvl) + MDB_ID pn = pgno << 1; + x = mdb_midl_search(tx2->mt_spill_pgs, pn); + if (x <= tx2->mt_spill_pgs[0] && tx2->mt_spill_pgs[x] == pn) { +- p = (MDB_page *)(env->me_map + env->me_psize * pgno); +- goto done; ++ goto mapped; + } + } + if (dl[0].mid) { +@@ -5248,15 +6010,26 @@ mdb_page_get(MDB_txn *txn, pgno_t pgno, MDB_page **ret, int *lvl) + } while ((tx2 = tx2->mt_parent) != NULL); + } + +- if (pgno < txn->mt_next_pgno) { +- level = 0; +- p = (MDB_page *)(env->me_map + env->me_psize * pgno); +- } else { +- DPRINTF(("page %"Z"u not found", pgno)); ++ if (pgno >= txn->mt_next_pgno) { ++ DPRINTF(("page %"Yu" not found", pgno)); + txn->mt_flags |= MDB_TXN_ERROR; + return MDB_PAGE_NOTFOUND; + } + ++ level = 0; ++ ++mapped: ++ { ++#ifdef MDB_VL32 ++ int rc = mdb_rpage_get(txn, pgno, &p); ++ if (rc) ++ return rc; ++#else ++ MDB_env *env = txn->mt_env; ++ p = (MDB_page *)(env->me_map + env->me_psize * pgno); ++#endif ++ } ++ + done: + *ret = p; + if (lvl) +@@ -5278,13 +6051,13 @@ mdb_page_search_root(MDB_cursor *mc, MDB_val *key, int flags) + MDB_node *node; + indx_t i; + +- DPRINTF(("branch page %"Z"u has %u keys", mp->mp_pgno, NUMKEYS(mp))); ++ DPRINTF(("branch page %"Yu" has %u keys", mp->mp_pgno, NUMKEYS(mp))); + /* Don't assert on branch pages in the FreeDB. We can get here + * while in the process of rebalancing a FreeDB branch page; we must + * let that proceed. ITS#8336 + */ + mdb_cassert(mc, !mc->mc_dbi || NUMKEYS(mp) > 1); +- DPRINTF(("found index 0 to page %"Z"u", NODEPGNO(NODEPTR(mp, 0)))); ++ DPRINTF(("found index 0 to page %"Yu, NODEPGNO(NODEPTR(mp, 0)))); + + if (flags & (MDB_PS_FIRST|MDB_PS_LAST)) { + i = 0; +@@ -5308,7 +6081,7 @@ mdb_page_search_root(MDB_cursor *mc, MDB_val *key, int flags) + mdb_cassert(mc, i < NUMKEYS(mp)); + node = NODEPTR(mp, i); + +- if ((rc = mdb_page_get(mc->mc_txn, NODEPGNO(node), &mp, NULL)) != 0) ++ if ((rc = mdb_page_get(mc, NODEPGNO(node), &mp, NULL)) != 0) + return rc; + + mc->mc_ki[mc->mc_top] = i; +@@ -5329,7 +6102,7 @@ mdb_page_search_root(MDB_cursor *mc, MDB_val *key, int flags) + return MDB_CORRUPTED; + } + +- DPRINTF(("found leaf page %"Z"u for key [%s]", mp->mp_pgno, ++ DPRINTF(("found leaf page %"Yu" for key [%s]", mp->mp_pgno, + key ? DKEY(key) : "null")); + mc->mc_flags |= C_INITIALIZED; + mc->mc_flags &= ~C_EOF; +@@ -5350,7 +6123,7 @@ mdb_page_search_lowest(MDB_cursor *mc) + MDB_node *node = NODEPTR(mp, 0); + int rc; + +- if ((rc = mdb_page_get(mc->mc_txn, NODEPGNO(node), &mp, NULL)) != 0) ++ if ((rc = mdb_page_get(mc, NODEPGNO(node), &mp, NULL)) != 0) + return rc; + + mc->mc_ki[mc->mc_top] = 0; +@@ -5402,7 +6175,7 @@ mdb_page_search(MDB_cursor *mc, MDB_val *key, int flags) + return MDB_NOTFOUND; + if ((leaf->mn_flags & (F_DUPDATA|F_SUBDATA)) != F_SUBDATA) + return MDB_INCOMPATIBLE; /* not a named DB */ +- rc = mdb_node_read(mc->mc_txn, leaf, &data); ++ rc = mdb_node_read(&mc2, leaf, &data); + if (rc) + return rc; + memcpy(&flags, ((char *) data.mv_data + offsetof(MDB_db, md_flags)), +@@ -5425,14 +6198,26 @@ mdb_page_search(MDB_cursor *mc, MDB_val *key, int flags) + } + + mdb_cassert(mc, root > 1); +- if (!mc->mc_pg[0] || mc->mc_pg[0]->mp_pgno != root) +- if ((rc = mdb_page_get(mc->mc_txn, root, &mc->mc_pg[0], NULL)) != 0) ++ if (!mc->mc_pg[0] || mc->mc_pg[0]->mp_pgno != root) { ++#ifdef MDB_VL32 ++ if (mc->mc_pg[0]) ++ MDB_PAGE_UNREF(mc->mc_txn, mc->mc_pg[0]); ++#endif ++ if ((rc = mdb_page_get(mc, root, &mc->mc_pg[0], NULL)) != 0) + return rc; ++ } + ++#ifdef MDB_VL32 ++ { ++ int i; ++ for (i=1; imc_snum; i++) ++ MDB_PAGE_UNREF(mc->mc_txn, mc->mc_pg[i]); ++ } ++#endif + mc->mc_snum = 1; + mc->mc_top = 0; + +- DPRINTF(("db %d root page %"Z"u has flags 0x%X", ++ DPRINTF(("db %d root page %"Yu" has flags 0x%X", + DDBI(mc), root, mc->mc_pg[0]->mp_flags)); + + if (flags & MDB_PS_MODIFY) { +@@ -5457,7 +6242,7 @@ mdb_ovpage_free(MDB_cursor *mc, MDB_page *mp) + MDB_ID pn = pg << 1; + int rc; + +- DPRINTF(("free ov page %"Z"u (%d)", pg, ovpages)); ++ DPRINTF(("free ov page %"Yu" (%d)", pg, ovpages)); + /* If the page is dirty or on the spill list we just acquired it, + * so we should give it back to our current free list, if any. + * Otherwise put it onto the list of pages we freed in this txn. +@@ -5498,7 +6283,7 @@ mdb_ovpage_free(MDB_cursor *mc, MDB_page *mp) + j = ++(dl[0].mid); + dl[j] = ix; /* Unsorted. OK when MDB_TXN_ERROR. */ + txn->mt_flags |= MDB_TXN_ERROR; +- return MDB_CORRUPTED; ++ return MDB_PROBLEM; + } + } + txn->mt_dirty_room++; +@@ -5523,18 +6308,22 @@ release: + } + + /** Return the data associated with a given node. +- * @param[in] txn The transaction for this operation. ++ * @param[in] mc The cursor for this operation. + * @param[in] leaf The node being read. + * @param[out] data Updated to point to the node's data. + * @return 0 on success, non-zero on failure. + */ + static int +-mdb_node_read(MDB_txn *txn, MDB_node *leaf, MDB_val *data) ++mdb_node_read(MDB_cursor *mc, MDB_node *leaf, MDB_val *data) + { + MDB_page *omp; /* overflow page */ + pgno_t pgno; + int rc; + ++ if (MC_OVPG(mc)) { ++ MDB_PAGE_UNREF(mc->mc_txn, MC_OVPG(mc)); ++ MC_SET_OVPG(mc, NULL); ++ } + if (!F_ISSET(leaf->mn_flags, F_BIGDATA)) { + data->mv_size = NODEDSZ(leaf); + data->mv_data = NODEDATA(leaf); +@@ -5545,11 +6334,12 @@ mdb_node_read(MDB_txn *txn, MDB_node *leaf, MDB_val *data) + */ + data->mv_size = NODEDSZ(leaf); + memcpy(&pgno, NODEDATA(leaf), sizeof(pgno)); +- if ((rc = mdb_page_get(txn, pgno, &omp, NULL)) != 0) { +- DPRINTF(("read overflow page %"Z"u failed", pgno)); ++ if ((rc = mdb_page_get(mc, pgno, &omp, NULL)) != 0) { ++ DPRINTF(("read overflow page %"Yu" failed", pgno)); + return rc; + } + data->mv_data = METADATA(omp); ++ MC_SET_OVPG(mc, omp); + + return MDB_SUCCESS; + } +@@ -5560,7 +6350,7 @@ mdb_get(MDB_txn *txn, MDB_dbi dbi, + { + MDB_cursor mc; + MDB_xcursor mx; +- int exact = 0; ++ int exact = 0, rc; + DKBUF; + + DPRINTF(("===> get db %u key [%s]", dbi, DKEY(key))); +@@ -5572,7 +6362,12 @@ mdb_get(MDB_txn *txn, MDB_dbi dbi, + return MDB_BAD_TXN; + + mdb_cursor_init(&mc, txn, dbi, &mx); +- return mdb_cursor_set(&mc, key, data, MDB_SET, &exact); ++ rc = mdb_cursor_set(&mc, key, data, MDB_SET, &exact); ++ /* unref all the pages when MDB_VL32 - caller must copy the data ++ * before doing anything else ++ */ ++ MDB_CURSOR_UNREF(&mc, 1); ++ return rc; + } + + /** Find a sibling for a page. +@@ -5589,13 +6384,19 @@ mdb_cursor_sibling(MDB_cursor *mc, int move_right) + int rc; + MDB_node *indx; + MDB_page *mp; ++#ifdef MDB_VL32 ++ MDB_page *op; ++#endif + + if (mc->mc_snum < 2) { + return MDB_NOTFOUND; /* root has no siblings */ + } + ++#ifdef MDB_VL32 ++ op = mc->mc_pg[mc->mc_top]; ++#endif + mdb_cursor_pop(mc); +- DPRINTF(("parent page is page %"Z"u, index %u", ++ DPRINTF(("parent page is page %"Yu", index %u", + mc->mc_pg[mc->mc_top]->mp_pgno, mc->mc_ki[mc->mc_top])); + + if (move_right ? (mc->mc_ki[mc->mc_top] + 1u >= NUMKEYS(mc->mc_pg[mc->mc_top])) +@@ -5618,8 +6419,10 @@ mdb_cursor_sibling(MDB_cursor *mc, int move_right) + } + mdb_cassert(mc, IS_BRANCH(mc->mc_pg[mc->mc_top])); + ++ MDB_PAGE_UNREF(mc->mc_txn, op); ++ + indx = NODEPTR(mc->mc_pg[mc->mc_top], mc->mc_ki[mc->mc_top]); +- if ((rc = mdb_page_get(mc->mc_txn, NODEPGNO(indx), &mp, NULL)) != 0) { ++ if ((rc = mdb_page_get(mc, NODEPGNO(indx), &mp, NULL)) != 0) { + /* mc will be inconsistent if caller does mc_snum++ as above */ + mc->mc_flags &= ~(C_INITIALIZED|C_EOF); + return rc; +@@ -5640,11 +6443,12 @@ mdb_cursor_next(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) + MDB_node *leaf; + int rc; + +- if (mc->mc_flags & C_EOF) { ++ if ((mc->mc_flags & C_EOF) || ++ ((mc->mc_flags & C_DEL) && op == MDB_NEXT_DUP)) { + return MDB_NOTFOUND; + } +- +- mdb_cassert(mc, mc->mc_flags & C_INITIALIZED); ++ if (!(mc->mc_flags & C_INITIALIZED)) ++ return mdb_cursor_first(mc, key, data); + + mp = mc->mc_pg[mc->mc_top]; + +@@ -5659,6 +6463,9 @@ mdb_cursor_next(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) + return rc; + } + } ++ else { ++ MDB_CURSOR_UNREF(&mc->mc_xcursor->mx_cursor, 0); ++ } + } else { + mc->mc_xcursor->mx_cursor.mc_flags &= ~(C_INITIALIZED|C_EOF); + if (op == MDB_NEXT_DUP) +@@ -5666,7 +6473,7 @@ mdb_cursor_next(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) + } + } + +- DPRINTF(("cursor_next: top page is %"Z"u in cursor %p", ++ DPRINTF(("cursor_next: top page is %"Yu" in cursor %p", + mdb_dbg_pgno(mp), (void *) mc)); + if (mc->mc_flags & C_DEL) { + mc->mc_flags ^= C_DEL; +@@ -5680,12 +6487,12 @@ mdb_cursor_next(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) + return rc; + } + mp = mc->mc_pg[mc->mc_top]; +- DPRINTF(("next page is %"Z"u, key index %u", mp->mp_pgno, mc->mc_ki[mc->mc_top])); ++ DPRINTF(("next page is %"Yu", key index %u", mp->mp_pgno, mc->mc_ki[mc->mc_top])); + } else + mc->mc_ki[mc->mc_top]++; + + skip: +- DPRINTF(("==> cursor points to page %"Z"u with %u keys, key index %u", ++ DPRINTF(("==> cursor points to page %"Yu" with %u keys, key index %u", + mdb_dbg_pgno(mp), NUMKEYS(mp), mc->mc_ki[mc->mc_top])); + + if (IS_LEAF2(mp)) { +@@ -5701,7 +6508,7 @@ skip: + mdb_xcursor_init1(mc, leaf); + } + if (data) { +- if ((rc = mdb_node_read(mc->mc_txn, leaf, data)) != MDB_SUCCESS) ++ if ((rc = mdb_node_read(mc, leaf, data)) != MDB_SUCCESS) + return rc; + + if (F_ISSET(leaf->mn_flags, F_DUPDATA)) { +@@ -5723,7 +6530,12 @@ mdb_cursor_prev(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) + MDB_node *leaf; + int rc; + +- mdb_cassert(mc, mc->mc_flags & C_INITIALIZED); ++ if (!(mc->mc_flags & C_INITIALIZED)) { ++ rc = mdb_cursor_last(mc, key, data); ++ if (rc) ++ return rc; ++ mc->mc_ki[mc->mc_top]++; ++ } + + mp = mc->mc_pg[mc->mc_top]; + +@@ -5740,6 +6552,9 @@ mdb_cursor_prev(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) + return rc; + } + } ++ else { ++ MDB_CURSOR_UNREF(&mc->mc_xcursor->mx_cursor, 0); ++ } + } else { + mc->mc_xcursor->mx_cursor.mc_flags &= ~(C_INITIALIZED|C_EOF); + if (op == MDB_PREV_DUP) +@@ -5747,7 +6562,7 @@ mdb_cursor_prev(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) + } + } + +- DPRINTF(("cursor_prev: top page is %"Z"u in cursor %p", ++ DPRINTF(("cursor_prev: top page is %"Yu" in cursor %p", + mdb_dbg_pgno(mp), (void *) mc)); + + mc->mc_flags &= ~(C_EOF|C_DEL); +@@ -5759,11 +6574,13 @@ mdb_cursor_prev(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) + } + mp = mc->mc_pg[mc->mc_top]; + mc->mc_ki[mc->mc_top] = NUMKEYS(mp) - 1; +- DPRINTF(("prev page is %"Z"u, key index %u", mp->mp_pgno, mc->mc_ki[mc->mc_top])); ++ DPRINTF(("prev page is %"Yu", key index %u", mp->mp_pgno, mc->mc_ki[mc->mc_top])); + } else + mc->mc_ki[mc->mc_top]--; + +- DPRINTF(("==> cursor points to page %"Z"u with %u keys, key index %u", ++ mc->mc_flags &= ~C_EOF; ++ ++ DPRINTF(("==> cursor points to page %"Yu" with %u keys, key index %u", + mdb_dbg_pgno(mp), NUMKEYS(mp), mc->mc_ki[mc->mc_top])); + + if (IS_LEAF2(mp)) { +@@ -5779,7 +6596,7 @@ mdb_cursor_prev(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) + mdb_xcursor_init1(mc, leaf); + } + if (data) { +- if ((rc = mdb_node_read(mc->mc_txn, leaf, data)) != MDB_SUCCESS) ++ if ((rc = mdb_node_read(mc, leaf, data)) != MDB_SUCCESS) + return rc; + + if (F_ISSET(leaf->mn_flags, F_DUPDATA)) { +@@ -5806,8 +6623,10 @@ mdb_cursor_set(MDB_cursor *mc, MDB_val *key, MDB_val *data, + if (key->mv_size == 0) + return MDB_BAD_VALSIZE; + +- if (mc->mc_xcursor) ++ if (mc->mc_xcursor) { ++ MDB_CURSOR_UNREF(&mc->mc_xcursor->mx_cursor, 0); + mc->mc_xcursor->mx_cursor.mc_flags &= ~(C_INITIALIZED|C_EOF); ++ } + + /* See if we're already on the right page */ + if (mc->mc_flags & C_INITIALIZED) { +@@ -5873,6 +6692,7 @@ mdb_cursor_set(MDB_cursor *mc, MDB_val *key, MDB_val *data, + } + } + rc = 0; ++ mc->mc_flags &= ~C_EOF; + goto set2; + } + } +@@ -5961,25 +6781,23 @@ set1: + } else if (op == MDB_GET_BOTH || op == MDB_GET_BOTH_RANGE) { + MDB_val olddata; + MDB_cmp_func *dcmp; +- if ((rc = mdb_node_read(mc->mc_txn, leaf, &olddata)) != MDB_SUCCESS) ++ if ((rc = mdb_node_read(mc, leaf, &olddata)) != MDB_SUCCESS) + return rc; + dcmp = mc->mc_dbx->md_dcmp; +-#if UINT_MAX < SIZE_MAX +- if (dcmp == mdb_cmp_int && olddata.mv_size == sizeof(size_t)) ++ if (NEED_CMP_CLONG(dcmp, olddata.mv_size)) + dcmp = mdb_cmp_clong; +-#endif + rc = dcmp(data, &olddata); + if (rc) { + if (op == MDB_GET_BOTH || rc > 0) + return MDB_NOTFOUND; + rc = 0; +- *data = olddata; + } ++ *data = olddata; + + } else { + if (mc->mc_xcursor) + mc->mc_xcursor->mx_cursor.mc_flags &= ~(C_INITIALIZED|C_EOF); +- if ((rc = mdb_node_read(mc->mc_txn, leaf, data)) != MDB_SUCCESS) ++ if ((rc = mdb_node_read(mc, leaf, data)) != MDB_SUCCESS) + return rc; + } + } +@@ -5999,8 +6817,10 @@ mdb_cursor_first(MDB_cursor *mc, MDB_val *key, MDB_val *data) + int rc; + MDB_node *leaf; + +- if (mc->mc_xcursor) ++ if (mc->mc_xcursor) { ++ MDB_CURSOR_UNREF(&mc->mc_xcursor->mx_cursor, 0); + mc->mc_xcursor->mx_cursor.mc_flags &= ~(C_INITIALIZED|C_EOF); ++ } + + if (!(mc->mc_flags & C_INITIALIZED) || mc->mc_top) { + rc = mdb_page_search(mc, NULL, MDB_PS_FIRST); +@@ -6028,7 +6848,7 @@ mdb_cursor_first(MDB_cursor *mc, MDB_val *key, MDB_val *data) + if (rc) + return rc; + } else { +- if ((rc = mdb_node_read(mc->mc_txn, leaf, data)) != MDB_SUCCESS) ++ if ((rc = mdb_node_read(mc, leaf, data)) != MDB_SUCCESS) + return rc; + } + } +@@ -6043,8 +6863,10 @@ mdb_cursor_last(MDB_cursor *mc, MDB_val *key, MDB_val *data) + int rc; + MDB_node *leaf; + +- if (mc->mc_xcursor) ++ if (mc->mc_xcursor) { ++ MDB_CURSOR_UNREF(&mc->mc_xcursor->mx_cursor, 0); + mc->mc_xcursor->mx_cursor.mc_flags &= ~(C_INITIALIZED|C_EOF); ++ } + + if (!(mc->mc_flags & C_EOF)) { + +@@ -6073,7 +6895,7 @@ mdb_cursor_last(MDB_cursor *mc, MDB_val *key, MDB_val *data) + if (rc) + return rc; + } else { +- if ((rc = mdb_node_read(mc->mc_txn, leaf, data)) != MDB_SUCCESS) ++ if ((rc = mdb_node_read(mc, leaf, data)) != MDB_SUCCESS) + return rc; + } + } +@@ -6119,7 +6941,7 @@ mdb_cursor_get(MDB_cursor *mc, MDB_val *key, MDB_val *data, + if (F_ISSET(leaf->mn_flags, F_DUPDATA)) { + rc = mdb_cursor_get(&mc->mc_xcursor->mx_cursor, data, NULL, MDB_GET_CURRENT); + } else { +- rc = mdb_node_read(mc->mc_txn, leaf, data); ++ rc = mdb_node_read(mc, leaf, data); + } + } + } +@@ -6169,10 +6991,7 @@ mdb_cursor_get(MDB_cursor *mc, MDB_val *key, MDB_val *data, + rc = MDB_INCOMPATIBLE; + break; + } +- if (!(mc->mc_flags & C_INITIALIZED)) +- rc = mdb_cursor_first(mc, key, data); +- else +- rc = mdb_cursor_next(mc, key, data, MDB_NEXT_DUP); ++ rc = mdb_cursor_next(mc, key, data, MDB_NEXT_DUP); + if (rc == MDB_SUCCESS) { + if (mc->mc_xcursor->mx_cursor.mc_flags & C_INITIALIZED) { + MDB_cursor *mx; +@@ -6187,24 +7006,38 @@ fetchm: + } + } + break; ++ case MDB_PREV_MULTIPLE: ++ if (data == NULL) { ++ rc = EINVAL; ++ break; ++ } ++ if (!(mc->mc_db->md_flags & MDB_DUPFIXED)) { ++ rc = MDB_INCOMPATIBLE; ++ break; ++ } ++ if (!(mc->mc_flags & C_INITIALIZED)) ++ rc = mdb_cursor_last(mc, key, data); ++ else ++ rc = MDB_SUCCESS; ++ if (rc == MDB_SUCCESS) { ++ MDB_cursor *mx = &mc->mc_xcursor->mx_cursor; ++ if (mx->mc_flags & C_INITIALIZED) { ++ rc = mdb_cursor_sibling(mx, 0); ++ if (rc == MDB_SUCCESS) ++ goto fetchm; ++ } else { ++ rc = MDB_NOTFOUND; ++ } ++ } ++ break; + case MDB_NEXT: + case MDB_NEXT_DUP: + case MDB_NEXT_NODUP: +- if (!(mc->mc_flags & C_INITIALIZED)) +- rc = mdb_cursor_first(mc, key, data); +- else +- rc = mdb_cursor_next(mc, key, data, op); ++ rc = mdb_cursor_next(mc, key, data, op); + break; + case MDB_PREV: + case MDB_PREV_DUP: + case MDB_PREV_NODUP: +- if (!(mc->mc_flags & C_INITIALIZED)) { +- rc = mdb_cursor_last(mc, key, data); +- if (rc) +- break; +- mc->mc_flags |= C_INITIALIZED; +- mc->mc_ki[mc->mc_top]++; +- } + rc = mdb_cursor_prev(mc, key, data, op); + break; + case MDB_FIRST: +@@ -6225,7 +7058,7 @@ fetchm: + MDB_node *leaf = NODEPTR(mc->mc_pg[mc->mc_top], mc->mc_ki[mc->mc_top]); + if (!F_ISSET(leaf->mn_flags, F_DUPDATA)) { + MDB_GET_KEY(leaf, key); +- rc = mdb_node_read(mc->mc_txn, leaf, data); ++ rc = mdb_node_read(mc, leaf, data); + break; + } + } +@@ -6487,10 +7320,8 @@ more: + if (flags == MDB_CURRENT) + goto current; + dcmp = mc->mc_dbx->md_dcmp; +-#if UINT_MAX < SIZE_MAX +- if (dcmp == mdb_cmp_int && olddata.mv_size == sizeof(size_t)) ++ if (NEED_CMP_CLONG(dcmp, olddata.mv_size)) + dcmp = mdb_cmp_clong; +-#endif + /* does data match? */ + if (!dcmp(data, &olddata)) { + if (flags & (MDB_NODUPDATA|MDB_APPENDDUP)) +@@ -6609,7 +7440,7 @@ current: + int level, ovpages, dpages = OVPAGES(data->mv_size, env->me_psize); + + memcpy(&pg, olddata.mv_data, sizeof(pg)); +- if ((rc2 = mdb_page_get(mc->mc_txn, pg, &omp, &level)) != 0) ++ if ((rc2 = mdb_page_get(mc, pg, &omp, &level)) != 0) + return rc2; + ovpages = omp->mp_pages; + +@@ -6641,8 +7472,13 @@ current: + /* Note - this page is already counted in parent's dirty_room */ + rc2 = mdb_mid2l_insert(mc->mc_txn->mt_u.dirty_list, &id2); + mdb_cassert(mc, rc2 == 0); ++ /* Currently we make the page look as with put() in the ++ * parent txn, in case the user peeks at MDB_RESERVEd ++ * or unused parts. Some users treat ovpages specially. ++ */ + if (!(flags & MDB_RESERVE)) { +- /* Copy end of page, adjusting alignment so ++ /* Skip the part where LMDB will put *data. ++ * Copy end of page, adjusting alignment so + * compiler may copy words instead of bytes. + */ + off = (PAGEHDRSZ + data->mv_size) & -sizeof(size_t); +@@ -6728,7 +7564,7 @@ new_sub: + */ + if (do_sub) { + int xflags, new_dupdata; +- size_t ecount; ++ mdb_size_t ecount; + put_sub: + xdata.mv_size = 0; + xdata.mv_data = ""; +@@ -6810,7 +7646,7 @@ put_sub: + return rc; + bad_sub: + if (rc == MDB_KEYEXIST) /* should not happen, we deleted that item */ +- rc = MDB_CORRUPTED; ++ rc = MDB_PROBLEM; + } + mc->mc_txn->mt_flags |= MDB_TXN_ERROR; + return rc; +@@ -6910,7 +7746,7 @@ mdb_cursor_del(MDB_cursor *mc, unsigned int flags) + pgno_t pg; + + memcpy(&pg, NODEDATA(leaf), sizeof(pg)); +- if ((rc = mdb_page_get(mc->mc_txn, pg, &omp, NULL)) || ++ if ((rc = mdb_page_get(mc, pg, &omp, NULL)) || + (rc = mdb_ovpage_free(mc, omp))) + goto fail; + } +@@ -6939,7 +7775,7 @@ mdb_page_new(MDB_cursor *mc, uint32_t flags, int num, MDB_page **mp) + + if ((rc = mdb_page_alloc(mc, num, &np))) + return rc; +- DPRINTF(("allocated new mpage %"Z"u, page size %u", ++ DPRINTF(("allocated new mpage %"Yu", page size %u", + np->mp_pgno, mc->mc_txn->mt_env->me_psize)); + np->mp_flags = flags | P_DIRTY; + np->mp_lower = (PAGEHDRSZ-PAGEBASE); +@@ -7039,7 +7875,7 @@ mdb_node_add(MDB_cursor *mc, indx_t indx, + + mdb_cassert(mc, mp->mp_upper >= mp->mp_lower); + +- DPRINTF(("add to %s %spage %"Z"u index %i, data size %"Z"u key size %"Z"u [%s]", ++ DPRINTF(("add to %s %spage %"Yu" index %i, data size %"Z"u key size %"Z"u [%s]", + IS_LEAF(mp) ? "leaf" : "branch", + IS_SUBP(mp) ? "sub-" : "", + mdb_dbg_pgno(mp), indx, data ? data->mv_size : 0, +@@ -7080,7 +7916,7 @@ mdb_node_add(MDB_cursor *mc, indx_t indx, + goto full; + if ((rc = mdb_page_new(mc, P_OVERFLOW, ovpages, &ofp))) + return rc; +- DPRINTF(("allocated overflow page %"Z"u", ofp->mp_pgno)); ++ DPRINTF(("allocated overflow page %"Yu, ofp->mp_pgno)); + flags |= F_BIGDATA; + goto update; + } else { +@@ -7137,7 +7973,7 @@ update: + return MDB_SUCCESS; + + full: +- DPRINTF(("not enough room in page %"Z"u, got %u ptrs", ++ DPRINTF(("not enough room in page %"Yu", got %u ptrs", + mdb_dbg_pgno(mp), NUMKEYS(mp))); + DPRINTF(("upper-lower = %u - %u = %"Z"d", mp->mp_upper,mp->mp_lower,room)); + DPRINTF(("node size = %"Z"u", node_size)); +@@ -7160,7 +7996,7 @@ mdb_node_del(MDB_cursor *mc, int ksize) + MDB_node *node; + char *base; + +- DPRINTF(("delete node %u on %s page %"Z"u", indx, ++ DPRINTF(("delete node %u on %s page %"Yu, indx, + IS_LEAF(mp) ? "leaf" : "branch", mdb_dbg_pgno(mp))); + numkeys = NUMKEYS(mp); + mdb_cassert(mc, indx < numkeys); +@@ -7269,7 +8105,8 @@ mdb_xcursor_init0(MDB_cursor *mc) + mx->mx_cursor.mc_dbflag = &mx->mx_dbflag; + mx->mx_cursor.mc_snum = 0; + mx->mx_cursor.mc_top = 0; +- mx->mx_cursor.mc_flags = C_SUB; ++ MC_SET_OVPG(&mx->mx_cursor, NULL); ++ mx->mx_cursor.mc_flags = C_SUB | (mc->mc_flags & (C_ORIG_RDONLY|C_WRITEMAP)); + mx->mx_dbx.md_name.mv_size = 0; + mx->mx_dbx.md_name.mv_data = NULL; + mx->mx_dbx.md_cmp = mc->mc_dbx->md_dcmp; +@@ -7288,12 +8125,12 @@ mdb_xcursor_init1(MDB_cursor *mc, MDB_node *node) + { + MDB_xcursor *mx = mc->mc_xcursor; + ++ mx->mx_cursor.mc_flags &= C_SUB|C_ORIG_RDONLY|C_WRITEMAP; + if (node->mn_flags & F_SUBDATA) { + memcpy(&mx->mx_db, NODEDATA(node), sizeof(MDB_db)); + mx->mx_cursor.mc_pg[0] = 0; + mx->mx_cursor.mc_snum = 0; + mx->mx_cursor.mc_top = 0; +- mx->mx_cursor.mc_flags = C_SUB; + } else { + MDB_page *fp = NODEDATA(node); + mx->mx_db.md_pad = 0; +@@ -7306,7 +8143,7 @@ mdb_xcursor_init1(MDB_cursor *mc, MDB_node *node) + COPY_PGNO(mx->mx_db.md_root, fp->mp_pgno); + mx->mx_cursor.mc_snum = 1; + mx->mx_cursor.mc_top = 0; +- mx->mx_cursor.mc_flags = C_INITIALIZED|C_SUB; ++ mx->mx_cursor.mc_flags |= C_INITIALIZED; + mx->mx_cursor.mc_pg[0] = fp; + mx->mx_cursor.mc_ki[0] = 0; + if (mc->mc_db->md_flags & MDB_DUPFIXED) { +@@ -7316,13 +8153,11 @@ mdb_xcursor_init1(MDB_cursor *mc, MDB_node *node) + mx->mx_db.md_flags |= MDB_INTEGERKEY; + } + } +- DPRINTF(("Sub-db -%u root page %"Z"u", mx->mx_cursor.mc_dbi, ++ DPRINTF(("Sub-db -%u root page %"Yu, mx->mx_cursor.mc_dbi, + mx->mx_db.md_root)); + mx->mx_dbflag = DB_VALID|DB_USRVALID|DB_DIRTY; /* DB_DIRTY guides mdb_cursor_touch */ +-#if UINT_MAX < SIZE_MAX +- if (mx->mx_dbx.md_cmp == mdb_cmp_int && mx->mx_db.md_pad == sizeof(size_t)) ++ if (NEED_CMP_CLONG(mx->mx_dbx.md_cmp, mx->mx_db.md_pad)) + mx->mx_dbx.md_cmp = mdb_cmp_clong; +-#endif + } + + +@@ -7345,7 +8180,7 @@ mdb_xcursor_init2(MDB_cursor *mc, MDB_xcursor *src_mx, int new_dupdata) + mx->mx_cursor.mc_flags |= C_INITIALIZED; + mx->mx_cursor.mc_ki[0] = 0; + mx->mx_dbflag = DB_VALID|DB_USRVALID|DB_DIRTY; /* DB_DIRTY guides mdb_cursor_touch */ +-#if UINT_MAX < SIZE_MAX ++#if UINT_MAX < MDB_SIZE_MAX /* matches mdb_xcursor_init1:NEED_CMP_CLONG() */ + mx->mx_dbx.md_cmp = src_mx->mx_dbx.md_cmp; + #endif + } else if (!(mx->mx_cursor.mc_flags & C_INITIALIZED)) { +@@ -7353,7 +8188,7 @@ mdb_xcursor_init2(MDB_cursor *mc, MDB_xcursor *src_mx, int new_dupdata) + } + mx->mx_db = src_mx->mx_db; + mx->mx_cursor.mc_pg[0] = src_mx->mx_cursor.mc_pg[0]; +- DPRINTF(("Sub-db -%u root page %"Z"u", mx->mx_cursor.mc_dbi, ++ DPRINTF(("Sub-db -%u root page %"Yu, mx->mx_cursor.mc_dbi, + mx->mx_db.md_root)); + } + +@@ -7372,7 +8207,8 @@ mdb_cursor_init(MDB_cursor *mc, MDB_txn *txn, MDB_dbi dbi, MDB_xcursor *mx) + mc->mc_top = 0; + mc->mc_pg[0] = 0; + mc->mc_ki[0] = 0; +- mc->mc_flags = 0; ++ MC_SET_OVPG(mc, NULL); ++ mc->mc_flags = txn->mt_flags & (C_ORIG_RDONLY|C_WRITEMAP); + if (txn->mt_dbs[dbi].md_flags & MDB_DUPSORT) { + mdb_tassert(txn, mx != NULL); + mc->mc_xcursor = mx; +@@ -7437,7 +8273,7 @@ mdb_cursor_renew(MDB_txn *txn, MDB_cursor *mc) + + /* Return the count of duplicate data items for the current key */ + int +-mdb_cursor_count(MDB_cursor *mc, size_t *countp) ++mdb_cursor_count(MDB_cursor *mc, mdb_size_t *countp) + { + MDB_node *leaf; + +@@ -7471,6 +8307,9 @@ mdb_cursor_count(MDB_cursor *mc, size_t *countp) + void + mdb_cursor_close(MDB_cursor *mc) + { ++ if (mc) { ++ MDB_CURSOR_UNREF(mc, 0); ++ } + if (mc && !mc->mc_backup) { + /* remove from txn, if tracked */ + if ((mc->mc_flags & C_UNTRACK) && mc->mc_txn->mt_cursors) { +@@ -7522,7 +8361,7 @@ mdb_update_key(MDB_cursor *mc, MDB_val *key) + char kbuf2[DKBUF_MAXKEYSIZE*2+1]; + k2.mv_data = NODEKEY(node); + k2.mv_size = node->mn_ksize; +- DPRINTF(("update key %u (ofs %u) [%s] to [%s] on page %"Z"u", ++ DPRINTF(("update key %u (ofs %u) [%s] to [%s] on page %"Yu, + indx, ptr, + mdb_dkey(&k2, kbuf2), + DKEY(key), +@@ -7670,7 +8509,7 @@ mdb_node_move(MDB_cursor *csrc, MDB_cursor *cdst, int fromleft) + return rc; + } + +- DPRINTF(("moving %s node %u [%s] on page %"Z"u to node %u on page %"Z"u", ++ DPRINTF(("moving %s node %u [%s] on page %"Yu" to node %u on page %"Yu, + IS_LEAF(csrc->mc_pg[csrc->mc_top]) ? "leaf" : "branch", + csrc->mc_ki[csrc->mc_top], + DKEY(&key), +@@ -7764,7 +8603,7 @@ mdb_node_move(MDB_cursor *csrc, MDB_cursor *cdst, int fromleft) + key.mv_size = NODEKSZ(srcnode); + key.mv_data = NODEKEY(srcnode); + } +- DPRINTF(("update separator for source page %"Z"u to [%s]", ++ DPRINTF(("update separator for source page %"Yu" to [%s]", + csrc->mc_pg[csrc->mc_top]->mp_pgno, DKEY(&key))); + mdb_cursor_copy(csrc, &mn); + mn.mc_snum--; +@@ -7795,7 +8634,7 @@ mdb_node_move(MDB_cursor *csrc, MDB_cursor *cdst, int fromleft) + key.mv_size = NODEKSZ(srcnode); + key.mv_data = NODEKEY(srcnode); + } +- DPRINTF(("update separator for destination page %"Z"u to [%s]", ++ DPRINTF(("update separator for destination page %"Yu" to [%s]", + cdst->mc_pg[cdst->mc_top]->mp_pgno, DKEY(&key))); + mdb_cursor_copy(cdst, &mn); + mn.mc_snum--; +@@ -7841,7 +8680,7 @@ mdb_page_merge(MDB_cursor *csrc, MDB_cursor *cdst) + psrc = csrc->mc_pg[csrc->mc_top]; + pdst = cdst->mc_pg[cdst->mc_top]; + +- DPRINTF(("merging page %"Z"u into %"Z"u", psrc->mp_pgno, pdst->mp_pgno)); ++ DPRINTF(("merging page %"Yu" into %"Yu, psrc->mp_pgno, pdst->mp_pgno)); + + mdb_cassert(csrc, csrc->mc_snum > 1); /* can't merge root page */ + mdb_cassert(csrc, cdst->mc_snum > 1); +@@ -7898,7 +8737,7 @@ mdb_page_merge(MDB_cursor *csrc, MDB_cursor *cdst) + } + } + +- DPRINTF(("dst page %"Z"u now has %u keys (%.1f%% filled)", ++ DPRINTF(("dst page %"Yu" now has %u keys (%.1f%% filled)", + pdst->mp_pgno, NUMKEYS(pdst), + (float)PAGEFILL(cdst->mc_txn->mt_env, pdst) / 10)); + +@@ -7986,6 +8825,7 @@ mdb_cursor_copy(const MDB_cursor *csrc, MDB_cursor *cdst) + cdst->mc_snum = csrc->mc_snum; + cdst->mc_top = csrc->mc_top; + cdst->mc_flags = csrc->mc_flags; ++ MC_SET_OVPG(cdst, MC_OVPG(csrc)); + + for (i=0; imc_snum; i++) { + cdst->mc_pg[i] = csrc->mc_pg[i]; +@@ -8014,14 +8854,14 @@ mdb_rebalance(MDB_cursor *mc) + minkeys = 1; + thresh = FILL_THRESHOLD; + } +- DPRINTF(("rebalancing %s page %"Z"u (has %u keys, %.1f%% full)", ++ DPRINTF(("rebalancing %s page %"Yu" (has %u keys, %.1f%% full)", + IS_LEAF(mc->mc_pg[mc->mc_top]) ? "leaf" : "branch", + mdb_dbg_pgno(mc->mc_pg[mc->mc_top]), NUMKEYS(mc->mc_pg[mc->mc_top]), + (float)PAGEFILL(mc->mc_txn->mt_env, mc->mc_pg[mc->mc_top]) / 10)); + + if (PAGEFILL(mc->mc_txn->mt_env, mc->mc_pg[mc->mc_top]) >= thresh && + NUMKEYS(mc->mc_pg[mc->mc_top]) >= minkeys) { +- DPRINTF(("no need to rebalance page %"Z"u, above fill threshold", ++ DPRINTF(("no need to rebalance page %"Yu", above fill threshold", + mdb_dbg_pgno(mc->mc_pg[mc->mc_top]))); + return MDB_SUCCESS; + } +@@ -8069,7 +8909,7 @@ mdb_rebalance(MDB_cursor *mc) + if (rc) + return rc; + mc->mc_db->md_root = NODEPGNO(NODEPTR(mp, 0)); +- rc = mdb_page_get(mc->mc_txn,mc->mc_db->md_root,&mc->mc_pg[0],NULL); ++ rc = mdb_page_get(mc, mc->mc_db->md_root, &mc->mc_pg[0], NULL); + if (rc) + return rc; + mc->mc_db->md_depth--; +@@ -8130,7 +8970,7 @@ mdb_rebalance(MDB_cursor *mc) + DPUTS("reading right neighbor"); + mn.mc_ki[ptop]++; + node = NODEPTR(mc->mc_pg[ptop], mn.mc_ki[ptop]); +- rc = mdb_page_get(mc->mc_txn,NODEPGNO(node),&mn.mc_pg[mn.mc_top],NULL); ++ rc = mdb_page_get(mc, NODEPGNO(node), &mn.mc_pg[mn.mc_top], NULL); + if (rc) + return rc; + mn.mc_ki[mn.mc_top] = 0; +@@ -8142,7 +8982,7 @@ mdb_rebalance(MDB_cursor *mc) + DPUTS("reading left neighbor"); + mn.mc_ki[ptop]--; + node = NODEPTR(mc->mc_pg[ptop], mn.mc_ki[ptop]); +- rc = mdb_page_get(mc->mc_txn,NODEPGNO(node),&mn.mc_pg[mn.mc_top],NULL); ++ rc = mdb_page_get(mc, NODEPGNO(node), &mn.mc_pg[mn.mc_top], NULL); + if (rc) + return rc; + mn.mc_ki[mn.mc_top] = NUMKEYS(mn.mc_pg[mn.mc_top]) - 1; +@@ -8150,7 +8990,7 @@ mdb_rebalance(MDB_cursor *mc) + fromleft = 1; + } + +- DPRINTF(("found neighbor page %"Z"u (%u keys, %.1f%% full)", ++ DPRINTF(("found neighbor page %"Yu" (%u keys, %.1f%% full)", + mn.mc_pg[mn.mc_top]->mp_pgno, NUMKEYS(mn.mc_pg[mn.mc_top]), + (float)PAGEFILL(mc->mc_txn->mt_env, mn.mc_pg[mn.mc_top]) / 10)); + +@@ -8207,8 +9047,6 @@ mdb_cursor_del0(MDB_cursor *mc) + if (m3->mc_pg[mc->mc_top] == mp) { + if (m3->mc_ki[mc->mc_top] == ki) { + m3->mc_flags |= C_DEL; +- if (mc->mc_db->md_flags & MDB_DUPSORT) +- m3->mc_xcursor->mx_cursor.mc_flags &= ~C_INITIALIZED; + } else if (m3->mc_ki[mc->mc_top] > ki) { + m3->mc_ki[mc->mc_top]--; + } +@@ -8242,11 +9080,21 @@ mdb_cursor_del0(MDB_cursor *mc) + continue; + if (m3->mc_pg[mc->mc_top] == mp) { + /* if m3 points past last node in page, find next sibling */ +- if (m3->mc_ki[mc->mc_top] >= nkeys) { +- rc = mdb_cursor_sibling(m3, 1); +- if (rc == MDB_NOTFOUND) { +- m3->mc_flags |= C_EOF; +- rc = MDB_SUCCESS; ++ if (m3->mc_ki[mc->mc_top] >= mc->mc_ki[mc->mc_top]) { ++ if (m3->mc_ki[mc->mc_top] >= nkeys) { ++ rc = mdb_cursor_sibling(m3, 1); ++ if (rc == MDB_NOTFOUND) { ++ m3->mc_flags |= C_EOF; ++ rc = MDB_SUCCESS; ++ continue; ++ } ++ } ++ if (mc->mc_db->md_flags & MDB_DUPSORT) { ++ MDB_node *node = NODEPTR(m3->mc_pg[m3->mc_top], m3->mc_ki[m3->mc_top]); ++ if (node->mn_flags & F_DUPDATA) { ++ mdb_xcursor_init1(m3, node); ++ m3->mc_xcursor->mx_cursor.mc_flags |= C_DEL; ++ } + } + } + } +@@ -8352,7 +9200,7 @@ mdb_page_split(MDB_cursor *mc, MDB_val *newkey, MDB_val *newdata, pgno_t newpgno + newindx = mc->mc_ki[mc->mc_top]; + nkeys = NUMKEYS(mp); + +- DPRINTF(("-----> splitting %s page %"Z"u and adding [%s] at index %i/%i", ++ DPRINTF(("-----> splitting %s page %"Yu" and adding [%s] at index %i/%i", + IS_LEAF(mp) ? "leaf" : "branch", mp->mp_pgno, + DKEY(newkey), mc->mc_ki[mc->mc_top], nkeys)); + +@@ -8360,7 +9208,7 @@ mdb_page_split(MDB_cursor *mc, MDB_val *newkey, MDB_val *newdata, pgno_t newpgno + if ((rc = mdb_page_new(mc, mp->mp_flags, 1, &rp))) + return rc; + rp->mp_pad = mp->mp_pad; +- DPRINTF(("new right sibling: page %"Z"u", rp->mp_pgno)); ++ DPRINTF(("new right sibling: page %"Yu, rp->mp_pgno)); + + /* Usually when splitting the root page, the cursor + * height is 1. But when called from mdb_update_key, +@@ -8378,7 +9226,7 @@ mdb_page_split(MDB_cursor *mc, MDB_val *newkey, MDB_val *newdata, pgno_t newpgno + mc->mc_pg[0] = pp; + mc->mc_ki[0] = 0; + mc->mc_db->md_root = pp->mp_pgno; +- DPRINTF(("root split! new root = %"Z"u", pp->mp_pgno)); ++ DPRINTF(("root split! new root = %"Yu, pp->mp_pgno)); + new_root = mc->mc_db->md_depth++; + + /* Add left (implicit) pointer. */ +@@ -8395,7 +9243,7 @@ mdb_page_split(MDB_cursor *mc, MDB_val *newkey, MDB_val *newdata, pgno_t newpgno + ptop = 0; + } else { + ptop = mc->mc_top-1; +- DPRINTF(("parent branch page is %"Z"u", mc->mc_pg[ptop]->mp_pgno)); ++ DPRINTF(("parent branch page is %"Yu, mc->mc_pg[ptop]->mp_pgno)); + } + + mdb_cursor_copy(mc, &mn); +@@ -8776,11 +9624,12 @@ mdb_put(MDB_txn *txn, MDB_dbi dbi, + #ifndef MDB_WBUF + #define MDB_WBUF (1024*1024) + #endif ++#define MDB_EOF 0x10 /**< #mdb_env_copyfd1() is done reading */ + +- /** State needed for a compacting copy. */ ++ /** State needed for a double-buffering compacting copy. */ + typedef struct mdb_copy { + pthread_mutex_t mc_mutex; +- pthread_cond_t mc_cond; ++ pthread_cond_t mc_cond; /**< Condition variable for #mc_new */ + char *mc_wbuf[2]; + char *mc_over[2]; + MDB_env *mc_env; +@@ -8789,10 +9638,9 @@ typedef struct mdb_copy { + int mc_olen[2]; + pgno_t mc_next_pgno; + HANDLE mc_fd; +- int mc_status; +- volatile int mc_new; +- int mc_toggle; +- ++ int mc_toggle; /**< Buffer number in provider */ ++ int mc_new; /**< (0-2 buffers to write) | (#MDB_EOF at end) */ ++ volatile int mc_error; /**< Error code, never cleared if set */ + } mdb_copy; + + /** Dedicated writer thread for compacting copy. */ +@@ -8811,20 +9659,16 @@ mdb_env_copythr(void *arg) + #endif + + pthread_mutex_lock(&my->mc_mutex); +- my->mc_new = 0; +- pthread_cond_signal(&my->mc_cond); + for(;;) { + while (!my->mc_new) + pthread_cond_wait(&my->mc_cond, &my->mc_mutex); +- if (my->mc_new < 0) { +- my->mc_new = 0; ++ if (my->mc_new == 0 + MDB_EOF) /* 0 buffers, just EOF */ + break; +- } +- my->mc_new = 0; + wsize = my->mc_wlen[toggle]; + ptr = my->mc_wbuf[toggle]; + again: +- while (wsize > 0) { ++ rc = MDB_SUCCESS; ++ while (wsize > 0 && !my->mc_error) { + DO_WRITE(rc, my->mc_fd, ptr, wsize, len); + if (!rc) { + rc = ErrCode(); +@@ -8840,8 +9684,7 @@ again: + } + } + if (rc) { +- my->mc_status = rc; +- break; ++ my->mc_error = rc; + } + /* If there's an overflow page tail, write it too */ + if (my->mc_olen[toggle]) { +@@ -8852,39 +9695,41 @@ again: + } + my->mc_wlen[toggle] = 0; + toggle ^= 1; ++ /* Return the empty buffer to provider */ ++ my->mc_new--; + pthread_cond_signal(&my->mc_cond); + } +- pthread_cond_signal(&my->mc_cond); + pthread_mutex_unlock(&my->mc_mutex); + return (THREAD_RET)0; + #undef DO_WRITE + } + +- /** Tell the writer thread there's a buffer ready to write */ ++ /** Give buffer and/or #MDB_EOF to writer thread, await unused buffer. ++ * ++ * @param[in] my control structure. ++ * @param[in] adjust (1 to hand off 1 buffer) | (MDB_EOF when ending). ++ */ + static int ESECT +-mdb_env_cthr_toggle(mdb_copy *my, int st) ++mdb_env_cthr_toggle(mdb_copy *my, int adjust) + { +- int toggle = my->mc_toggle ^ 1; + pthread_mutex_lock(&my->mc_mutex); +- if (my->mc_status) { +- pthread_mutex_unlock(&my->mc_mutex); +- return my->mc_status; +- } +- while (my->mc_new == 1) +- pthread_cond_wait(&my->mc_cond, &my->mc_mutex); +- my->mc_new = st; +- my->mc_toggle = toggle; ++ my->mc_new += adjust; + pthread_cond_signal(&my->mc_cond); ++ while (my->mc_new & 2) /* both buffers in use */ ++ pthread_cond_wait(&my->mc_cond, &my->mc_mutex); + pthread_mutex_unlock(&my->mc_mutex); +- return 0; ++ ++ my->mc_toggle ^= (adjust & 1); ++ /* Both threads reset mc_wlen, to be safe from threading errors */ ++ my->mc_wlen[my->mc_toggle] = 0; ++ return my->mc_error; + } + + /** Depth-first tree traversal for compacting copy. */ + static int ESECT + mdb_env_cwalk(mdb_copy *my, pgno_t *pg, int flags) + { +- MDB_cursor mc; +- MDB_txn *txn = my->mc_txn; ++ MDB_cursor mc = {0}; + MDB_node *ni; + MDB_page *mo, *mp, *leaf; + char *buf, *ptr; +@@ -8896,10 +9741,10 @@ mdb_env_cwalk(mdb_copy *my, pgno_t *pg, int flags) + return MDB_SUCCESS; + + mc.mc_snum = 1; +- mc.mc_top = 0; +- mc.mc_txn = txn; ++ mc.mc_txn = my->mc_txn; ++ mc.mc_flags = my->mc_txn->mt_flags & (C_ORIG_RDONLY|C_WRITEMAP); + +- rc = mdb_page_get(my->mc_txn, *pg, &mc.mc_pg[0], NULL); ++ rc = mdb_page_get(&mc, *pg, &mc.mc_pg[0], NULL); + if (rc) + return rc; + rc = mdb_page_search_root(&mc, NULL, MDB_PS_FIRST); +@@ -8943,7 +9788,8 @@ mdb_env_cwalk(mdb_copy *my, pgno_t *pg, int flags) + } + + memcpy(&pg, NODEDATA(ni), sizeof(pg)); +- rc = mdb_page_get(txn, pg, &omp, NULL); ++ memcpy(NODEDATA(ni), &my->mc_next_pgno, sizeof(pgno_t)); ++ rc = mdb_page_get(&mc, pg, &omp, NULL); + if (rc) + goto done; + if (my->mc_wlen[toggle] >= MDB_WBUF) { +@@ -8965,7 +9811,6 @@ mdb_env_cwalk(mdb_copy *my, pgno_t *pg, int flags) + goto done; + toggle = my->mc_toggle; + } +- memcpy(NODEDATA(ni), &mo->mp_pgno, sizeof(pgno_t)); + } else if (ni->mn_flags & F_SUBDATA) { + MDB_db db; + +@@ -8994,7 +9839,7 @@ mdb_env_cwalk(mdb_copy *my, pgno_t *pg, int flags) + again: + ni = NODEPTR(mp, mc.mc_ki[mc.mc_top]); + pg = NODEPGNO(ni); +- rc = mdb_page_get(txn, pg, &mp, NULL); ++ rc = mdb_page_get(&mc, pg, &mp, NULL); + if (rc) + goto done; + mc.mc_top++; +@@ -9043,47 +9888,56 @@ mdb_env_copyfd1(MDB_env *env, HANDLE fd) + { + MDB_meta *mm; + MDB_page *mp; +- mdb_copy my; ++ mdb_copy my = {0}; + MDB_txn *txn = NULL; + pthread_t thr; +- int rc; ++ pgno_t root, new_root; ++ int rc = MDB_SUCCESS; + + #ifdef _WIN32 +- my.mc_mutex = CreateMutex(NULL, FALSE, NULL); +- my.mc_cond = CreateEvent(NULL, FALSE, FALSE, NULL); ++ if (!(my.mc_mutex = CreateMutex(NULL, FALSE, NULL)) || ++ !(my.mc_cond = CreateEvent(NULL, FALSE, FALSE, NULL))) { ++ rc = ErrCode(); ++ goto done; ++ } + my.mc_wbuf[0] = _aligned_malloc(MDB_WBUF*2, env->me_os_psize); +- if (my.mc_wbuf[0] == NULL) +- return errno; ++ if (my.mc_wbuf[0] == NULL) { ++ /* _aligned_malloc() sets errno, but we use Windows error codes */ ++ rc = ERROR_NOT_ENOUGH_MEMORY; ++ goto done; ++ } + #else +- pthread_mutex_init(&my.mc_mutex, NULL); +- pthread_cond_init(&my.mc_cond, NULL); ++ if ((rc = pthread_mutex_init(&my.mc_mutex, NULL)) != 0) ++ return rc; ++ if ((rc = pthread_cond_init(&my.mc_cond, NULL)) != 0) ++ goto done2; + #ifdef HAVE_MEMALIGN + my.mc_wbuf[0] = memalign(env->me_os_psize, MDB_WBUF*2); +- if (my.mc_wbuf[0] == NULL) +- return errno; ++ if (my.mc_wbuf[0] == NULL) { ++ rc = errno; ++ goto done; ++ } + #else +- rc = posix_memalign((void **)&my.mc_wbuf[0], env->me_os_psize, MDB_WBUF*2); +- if (rc) +- return rc; ++ { ++ void *p; ++ if ((rc = posix_memalign(&p, env->me_os_psize, MDB_WBUF*2)) != 0) ++ goto done; ++ my.mc_wbuf[0] = p; ++ } + #endif + #endif + memset(my.mc_wbuf[0], 0, MDB_WBUF*2); + my.mc_wbuf[1] = my.mc_wbuf[0] + MDB_WBUF; +- my.mc_wlen[0] = 0; +- my.mc_wlen[1] = 0; +- my.mc_olen[0] = 0; +- my.mc_olen[1] = 0; + my.mc_next_pgno = NUM_METAS; +- my.mc_status = 0; +- my.mc_new = 1; +- my.mc_toggle = 0; + my.mc_env = env; + my.mc_fd = fd; +- THREAD_CREATE(thr, mdb_env_copythr, &my); ++ rc = THREAD_CREATE(thr, mdb_env_copythr, &my); ++ if (rc) ++ goto done; + + rc = mdb_txn_begin(env, NULL, MDB_RDONLY, &txn); + if (rc) +- return rc; ++ goto finish; + + mp = (MDB_page *)my.mc_wbuf[0]; + memset(mp, 0, NUM_METAS * env->me_psize); +@@ -9099,57 +9953,64 @@ mdb_env_copyfd1(MDB_env *env, HANDLE fd) + *(MDB_meta *)METADATA(mp) = *mm; + mm = (MDB_meta *)METADATA(mp); + +- /* Count the number of free pages, subtract from lastpg to find +- * number of active pages +- */ +- { ++ /* Set metapage 1 with current main DB */ ++ root = new_root = txn->mt_dbs[MAIN_DBI].md_root; ++ if (root != P_INVALID) { ++ /* Count free pages + freeDB pages. Subtract from last_pg ++ * to find the new last_pg, which also becomes the new root. ++ */ + MDB_ID freecount = 0; + MDB_cursor mc; + MDB_val key, data; + mdb_cursor_init(&mc, txn, FREE_DBI, NULL); + while ((rc = mdb_cursor_get(&mc, &key, &data, MDB_NEXT)) == 0) + freecount += *(MDB_ID *)data.mv_data; ++ if (rc != MDB_NOTFOUND) ++ goto finish; + freecount += txn->mt_dbs[FREE_DBI].md_branch_pages + + txn->mt_dbs[FREE_DBI].md_leaf_pages + + txn->mt_dbs[FREE_DBI].md_overflow_pages; + +- /* Set metapage 1 */ +- mm->mm_last_pg = txn->mt_next_pgno - freecount - 1; ++ new_root = txn->mt_next_pgno - 1 - freecount; ++ mm->mm_last_pg = new_root; + mm->mm_dbs[MAIN_DBI] = txn->mt_dbs[MAIN_DBI]; +- if (mm->mm_last_pg > NUM_METAS-1) { +- mm->mm_dbs[MAIN_DBI].md_root = mm->mm_last_pg; +- mm->mm_txnid = 1; +- } else { +- mm->mm_dbs[MAIN_DBI].md_root = P_INVALID; +- } ++ mm->mm_dbs[MAIN_DBI].md_root = new_root; ++ } else { ++ /* When the DB is empty, handle it specially to ++ * fix any breakage like page leaks from ITS#8174. ++ */ ++ mm->mm_dbs[MAIN_DBI].md_flags = txn->mt_dbs[MAIN_DBI].md_flags; ++ } ++ if (root != P_INVALID || mm->mm_dbs[MAIN_DBI].md_flags) { ++ mm->mm_txnid = 1; /* use metapage 1 */ + } ++ + my.mc_wlen[0] = env->me_psize * NUM_METAS; + my.mc_txn = txn; +- pthread_mutex_lock(&my.mc_mutex); +- while(my.mc_new) +- pthread_cond_wait(&my.mc_cond, &my.mc_mutex); +- pthread_mutex_unlock(&my.mc_mutex); +- rc = mdb_env_cwalk(&my, &txn->mt_dbs[MAIN_DBI].md_root, 0); +- if (rc == MDB_SUCCESS && my.mc_wlen[my.mc_toggle]) +- rc = mdb_env_cthr_toggle(&my, 1); +- mdb_env_cthr_toggle(&my, -1); +- pthread_mutex_lock(&my.mc_mutex); +- while(my.mc_new) +- pthread_cond_wait(&my.mc_cond, &my.mc_mutex); +- pthread_mutex_unlock(&my.mc_mutex); +- THREAD_FINISH(thr); ++ rc = mdb_env_cwalk(&my, &root, 0); ++ if (rc == MDB_SUCCESS && root != new_root) { ++ rc = MDB_INCOMPATIBLE; /* page leak or corrupt DB */ ++ } + ++finish: ++ if (rc) ++ my.mc_error = rc; ++ mdb_env_cthr_toggle(&my, 1 | MDB_EOF); ++ rc = THREAD_FINISH(thr); + mdb_txn_abort(txn); ++ ++done: + #ifdef _WIN32 +- CloseHandle(my.mc_cond); +- CloseHandle(my.mc_mutex); +- _aligned_free(my.mc_wbuf[0]); ++ if (my.mc_wbuf[0]) _aligned_free(my.mc_wbuf[0]); ++ if (my.mc_cond) CloseHandle(my.mc_cond); ++ if (my.mc_mutex) CloseHandle(my.mc_mutex); + #else ++ free(my.mc_wbuf[0]); + pthread_cond_destroy(&my.mc_cond); ++done2: + pthread_mutex_destroy(&my.mc_mutex); +- free(my.mc_wbuf[0]); + #endif +- return rc; ++ return rc ? rc : my.mc_error; + } + + /** Copy environment as-is. */ +@@ -9159,7 +10020,7 @@ mdb_env_copyfd0(MDB_env *env, HANDLE fd) + MDB_txn *txn = NULL; + mdb_mutexref_t wmutex = NULL; + int rc; +- size_t wsize, w3; ++ mdb_size_t wsize, w3; + char *ptr; + #ifdef _WIN32 + DWORD len, w2; +@@ -9220,7 +10081,7 @@ mdb_env_copyfd0(MDB_env *env, HANDLE fd) + + w3 = txn->mt_next_pgno * env->me_psize; + { +- size_t fsize = 0; ++ mdb_size_t fsize = 0; + if ((rc = mdb_fsize(env->me_fd, &fsize))) + goto leave; + if (w3 > fsize) +@@ -9659,11 +10520,19 @@ mdb_drop0(MDB_cursor *mc, int subs) + + /* DUPSORT sub-DBs have no ovpages/DBs. Omit scanning leaves. + * This also avoids any P_LEAF2 pages, which have no nodes. ++ * Also if the DB doesn't have sub-DBs and has no overflow ++ * pages, omit scanning leaves. + */ +- if (mc->mc_flags & C_SUB) ++ if ((mc->mc_flags & C_SUB) || ++ (!subs && !mc->mc_db->md_overflow_pages)) + mdb_cursor_pop(mc); + + mdb_cursor_copy(mc, &mx); ++#ifdef MDB_VL32 ++ /* bump refcount for mx's pages */ ++ for (i=0; imc_snum; i++) ++ mdb_page_get(&mx, mc->mc_pg[i]->mp_pgno, &mx.mc_pg[i], NULL); ++#endif + while (mc->mc_snum > 0) { + MDB_page *mp = mc->mc_pg[mc->mc_top]; + unsigned n = NUMKEYS(mp); +@@ -9674,7 +10543,7 @@ mdb_drop0(MDB_cursor *mc, int subs) + MDB_page *omp; + pgno_t pg; + memcpy(&pg, NODEDATA(ni), sizeof(pg)); +- rc = mdb_page_get(txn, pg, &omp, NULL); ++ rc = mdb_page_get(mc, pg, &omp, NULL); + if (rc != 0) + goto done; + mdb_cassert(mc, IS_OVERFLOW(omp)); +@@ -9682,6 +10551,9 @@ mdb_drop0(MDB_cursor *mc, int subs) + pg, omp->mp_pages); + if (rc) + goto done; ++ mc->mc_db->md_overflow_pages -= omp->mp_pages; ++ if (!mc->mc_db->md_overflow_pages && !subs) ++ break; + } else if (subs && (ni->mn_flags & F_SUBDATA)) { + mdb_xcursor_init1(mc, ni); + rc = mdb_drop0(&mc->mc_xcursor->mx_cursor, 0); +@@ -9689,6 +10561,8 @@ mdb_drop0(MDB_cursor *mc, int subs) + goto done; + } + } ++ if (!subs && !mc->mc_db->md_overflow_pages) ++ goto pop; + } else { + if ((rc = mdb_midl_need(&txn->mt_free_pgs, n)) != 0) + goto done; +@@ -9710,6 +10584,7 @@ mdb_drop0(MDB_cursor *mc, int subs) + /* no more siblings, go back to beginning + * of previous level. + */ ++pop: + mdb_cursor_pop(mc); + mc->mc_ki[0] = 0; + for (i=1; imc_snum; i++) { +@@ -9723,6 +10598,8 @@ mdb_drop0(MDB_cursor *mc, int subs) + done: + if (rc) + txn->mt_flags |= MDB_TXN_ERROR; ++ /* drop refcount for mx's pages */ ++ MDB_CURSOR_UNREF(&mx, 0); + } else if (rc == MDB_NOTFOUND) { + rc = MDB_SUCCESS; + } +@@ -9842,7 +10719,7 @@ mdb_reader_list(MDB_env *env, MDB_msg_func *func, void *ctx) + if (mr[i].mr_pid) { + txnid_t txnid = mr[i].mr_txnid; + sprintf(buf, txnid == (txnid_t)-1 ? +- "%10d %"Z"x -\n" : "%10d %"Z"x %"Z"u\n", ++ "%10d %"Z"x -\n" : "%10d %"Z"x %"Yu"\n", + (int)mr[i].mr_pid, (size_t)mr[i].mr_tid, txnid); + if (first) { + first = 0; +@@ -9947,7 +10824,7 @@ mdb_reader_check0(MDB_env *env, int rlocked, int *dead) + } + for (; j + #include "lmdb.h" + +-#ifdef _WIN32 +-#define Z "I" +-#else +-#define Z "z" +-#endif ++#define Yu MDB_PRIy(u) + + #define PRINT 1 + static int mode; +@@ -115,7 +111,7 @@ static int dumpit(MDB_txn *txn, MDB_dbi dbi, char *name) + if (name) + printf("database=%s\n", name); + printf("type=btree\n"); +- printf("mapsize=%" Z "u\n", info.me_mapsize); ++ printf("mapsize=%"Yu"\n", info.me_mapsize); + if (info.me_mapaddr) + printf("mapaddr=%p\n", info.me_mapaddr); + printf("maxreaders=%u\n", info.me_maxreaders); +diff --git a/libraries/liblmdb/mdb_load.c b/libraries/liblmdb/mdb_load.c +index 053cc88..73dfe8c 100644 +--- a/libraries/liblmdb/mdb_load.c ++++ b/libraries/liblmdb/mdb_load.c +@@ -25,7 +25,7 @@ static int mode; + + static char *subname = NULL; + +-static size_t lineno; ++static mdb_size_t lineno; + static int version; + + static int flags; +@@ -38,11 +38,7 @@ static MDB_envinfo info; + + static MDB_val kbuf, dbuf; + +-#ifdef _WIN32 +-#define Z "I" +-#else +-#define Z "z" +-#endif ++#define Yu MDB_PRIy(u) + + #define STRLENOF(s) (sizeof(s)-1) + +@@ -73,7 +69,7 @@ static void readhdr(void) + if (!strncmp(dbuf.mv_data, "VERSION=", STRLENOF("VERSION="))) { + version=atoi((char *)dbuf.mv_data+STRLENOF("VERSION=")); + if (version > 3) { +- fprintf(stderr, "%s: line %" Z "d: unsupported VERSION %d\n", ++ fprintf(stderr, "%s: line %"Yu": unsupported VERSION %d\n", + prog, lineno, version); + exit(EXIT_FAILURE); + } +@@ -83,7 +79,7 @@ static void readhdr(void) + if (!strncmp((char *)dbuf.mv_data+STRLENOF("FORMAT="), "print", STRLENOF("print"))) + mode |= PRINT; + else if (strncmp((char *)dbuf.mv_data+STRLENOF("FORMAT="), "bytevalue", STRLENOF("bytevalue"))) { +- fprintf(stderr, "%s: line %" Z "d: unsupported FORMAT %s\n", ++ fprintf(stderr, "%s: line %"Yu": unsupported FORMAT %s\n", + prog, lineno, (char *)dbuf.mv_data+STRLENOF("FORMAT=")); + exit(EXIT_FAILURE); + } +@@ -94,7 +90,7 @@ static void readhdr(void) + subname = strdup((char *)dbuf.mv_data+STRLENOF("database=")); + } else if (!strncmp(dbuf.mv_data, "type=", STRLENOF("type="))) { + if (strncmp((char *)dbuf.mv_data+STRLENOF("type="), "btree", STRLENOF("btree"))) { +- fprintf(stderr, "%s: line %" Z "d: unsupported type %s\n", ++ fprintf(stderr, "%s: line %"Yu": unsupported type %s\n", + prog, lineno, (char *)dbuf.mv_data+STRLENOF("type=")); + exit(EXIT_FAILURE); + } +@@ -104,7 +100,7 @@ static void readhdr(void) + if (ptr) *ptr = '\0'; + i = sscanf((char *)dbuf.mv_data+STRLENOF("mapaddr="), "%p", &info.me_mapaddr); + if (i != 1) { +- fprintf(stderr, "%s: line %" Z "d: invalid mapaddr %s\n", ++ fprintf(stderr, "%s: line %"Yu": invalid mapaddr %s\n", + prog, lineno, (char *)dbuf.mv_data+STRLENOF("mapaddr=")); + exit(EXIT_FAILURE); + } +@@ -112,9 +108,10 @@ static void readhdr(void) + int i; + ptr = memchr(dbuf.mv_data, '\n', dbuf.mv_size); + if (ptr) *ptr = '\0'; +- i = sscanf((char *)dbuf.mv_data+STRLENOF("mapsize="), "%" Z "u", &info.me_mapsize); ++ i = sscanf((char *)dbuf.mv_data+STRLENOF("mapsize="), ++ "%" MDB_SCNy(u), &info.me_mapsize); + if (i != 1) { +- fprintf(stderr, "%s: line %" Z "d: invalid mapsize %s\n", ++ fprintf(stderr, "%s: line %"Yu": invalid mapsize %s\n", + prog, lineno, (char *)dbuf.mv_data+STRLENOF("mapsize=")); + exit(EXIT_FAILURE); + } +@@ -124,7 +121,7 @@ static void readhdr(void) + if (ptr) *ptr = '\0'; + i = sscanf((char *)dbuf.mv_data+STRLENOF("maxreaders="), "%u", &info.me_maxreaders); + if (i != 1) { +- fprintf(stderr, "%s: line %" Z "d: invalid maxreaders %s\n", ++ fprintf(stderr, "%s: line %"Yu": invalid maxreaders %s\n", + prog, lineno, (char *)dbuf.mv_data+STRLENOF("maxreaders=")); + exit(EXIT_FAILURE); + } +@@ -140,12 +137,12 @@ static void readhdr(void) + if (!dbflags[i].bit) { + ptr = memchr(dbuf.mv_data, '=', dbuf.mv_size); + if (!ptr) { +- fprintf(stderr, "%s: line %" Z "d: unexpected format\n", ++ fprintf(stderr, "%s: line %"Yu": unexpected format\n", + prog, lineno); + exit(EXIT_FAILURE); + } else { + *ptr = '\0'; +- fprintf(stderr, "%s: line %" Z "d: unrecognized keyword ignored: %s\n", ++ fprintf(stderr, "%s: line %"Yu": unrecognized keyword ignored: %s\n", + prog, lineno, (char *)dbuf.mv_data); + } + } +@@ -155,7 +152,7 @@ static void readhdr(void) + + static void badend(void) + { +- fprintf(stderr, "%s: line %" Z "d: unexpected end of input\n", ++ fprintf(stderr, "%s: line %"Yu": unexpected end of input\n", + prog, lineno); + } + +@@ -213,7 +210,7 @@ badend: + buf->mv_data = realloc(buf->mv_data, buf->mv_size*2); + if (!buf->mv_data) { + Eof = 1; +- fprintf(stderr, "%s: line %" Z "d: out of memory, line too long\n", ++ fprintf(stderr, "%s: line %"Yu": out of memory, line too long\n", + prog, lineno); + return EOF; + } +@@ -405,7 +402,7 @@ int main(int argc, char *argv[]) + + rc = readline(&data, &dbuf); + if (rc) { +- fprintf(stderr, "%s: line %" Z "d: failed to read key value\n", prog, lineno); ++ fprintf(stderr, "%s: line %"Yu": failed to read key value\n", prog, lineno); + goto txn_abort; + } + +@@ -420,7 +417,7 @@ int main(int argc, char *argv[]) + if (batch == 100) { + rc = mdb_txn_commit(txn); + if (rc) { +- fprintf(stderr, "%s: line %" Z "d: txn_commit: %s\n", ++ fprintf(stderr, "%s: line %"Yu": txn_commit: %s\n", + prog, lineno, mdb_strerror(rc)); + goto env_close; + } +@@ -440,7 +437,7 @@ int main(int argc, char *argv[]) + rc = mdb_txn_commit(txn); + txn = NULL; + if (rc) { +- fprintf(stderr, "%s: line %" Z "d: txn_commit: %s\n", ++ fprintf(stderr, "%s: line %"Yu": txn_commit: %s\n", + prog, lineno, mdb_strerror(rc)); + goto env_close; + } +diff --git a/libraries/liblmdb/mdb_stat.c b/libraries/liblmdb/mdb_stat.c +index a5cda2f..0343a65 100644 +--- a/libraries/liblmdb/mdb_stat.c ++++ b/libraries/liblmdb/mdb_stat.c +@@ -17,11 +17,8 @@ + #include + #include "lmdb.h" + +-#ifdef _WIN32 +-#define Z "I" +-#else +-#define Z "z" +-#endif ++#define Z MDB_FMT_Z ++#define Yu MDB_PRIy(u) + + static void prstat(MDB_stat *ms) + { +@@ -29,10 +26,10 @@ static void prstat(MDB_stat *ms) + printf(" Page size: %u\n", ms->ms_psize); + #endif + printf(" Tree depth: %u\n", ms->ms_depth); +- printf(" Branch pages: %"Z"u\n", ms->ms_branch_pages); +- printf(" Leaf pages: %"Z"u\n", ms->ms_leaf_pages); +- printf(" Overflow pages: %"Z"u\n", ms->ms_overflow_pages); +- printf(" Entries: %"Z"u\n", ms->ms_entries); ++ printf(" Branch pages: %"Yu"\n", ms->ms_branch_pages); ++ printf(" Leaf pages: %"Yu"\n", ms->ms_leaf_pages); ++ printf(" Overflow pages: %"Yu"\n", ms->ms_overflow_pages); ++ printf(" Entries: %"Yu"\n", ms->ms_entries); + } + + static void usage(char *prog) +@@ -125,11 +122,11 @@ int main(int argc, char *argv[]) + (void)mdb_env_info(env, &mei); + printf("Environment Info\n"); + printf(" Map address: %p\n", mei.me_mapaddr); +- printf(" Map size: %"Z"u\n", mei.me_mapsize); ++ printf(" Map size: %"Yu"\n", mei.me_mapsize); + printf(" Page size: %u\n", mst.ms_psize); +- printf(" Max pages: %"Z"u\n", mei.me_mapsize / mst.ms_psize); +- printf(" Number of pages used: %"Z"u\n", mei.me_last_pgno+1); +- printf(" Last transaction ID: %"Z"u\n", mei.me_last_txnid); ++ printf(" Max pages: %"Yu"\n", mei.me_mapsize / mst.ms_psize); ++ printf(" Number of pages used: %"Yu"\n", mei.me_last_pgno+1); ++ printf(" Last transaction ID: %"Yu"\n", mei.me_last_txnid); + printf(" Max readers: %u\n", mei.me_maxreaders); + printf(" Number of readers used: %u\n", mei.me_numreaders); + } +@@ -156,7 +153,7 @@ int main(int argc, char *argv[]) + if (freinfo) { + MDB_cursor *cursor; + MDB_val key, data; +- size_t pages = 0, *iptr; ++ mdb_size_t pages = 0, *iptr; + + printf("Freelist Status\n"); + dbi = 0; +@@ -176,7 +173,7 @@ int main(int argc, char *argv[]) + pages += *iptr; + if (freinfo > 1) { + char *bad = ""; +- size_t pg, prev; ++ mdb_size_t pg, prev; + ssize_t i, j, span = 0; + j = *iptr++; + for (i = j, prev = 1; --i >= 0; ) { +@@ -187,20 +184,20 @@ int main(int argc, char *argv[]) + pg += span; + for (; i >= span && iptr[i-span] == pg; span++, pg++) ; + } +- printf(" Transaction %"Z"u, %"Z"d pages, maxspan %"Z"d%s\n", +- *(size_t *)key.mv_data, j, span, bad); ++ printf(" Transaction %"Yu", %"Z"d pages, maxspan %"Z"d%s\n", ++ *(mdb_size_t *)key.mv_data, j, span, bad); + if (freinfo > 2) { + for (--j; j >= 0; ) { + pg = iptr[j]; + for (span=1; --j >= 0 && iptr[j] == pg+span; span++) ; +- printf(span>1 ? " %9"Z"u[%"Z"d]\n" : " %9"Z"u\n", ++ printf(span>1 ? " %9"Yu"[%"Z"d]\n" : " %9"Yu"\n", + pg, span); + } + } + } + } + mdb_cursor_close(cursor); +- printf(" Free pages: %"Z"u\n", pages); ++ printf(" Free pages: %"Yu"\n", pages); + } + + rc = mdb_open(txn, subname, 0, &dbi); +diff --git a/libraries/liblmdb/midl.c b/libraries/liblmdb/midl.c +index 5c6d841..9748d8d 100644 +--- a/libraries/liblmdb/midl.c ++++ b/libraries/liblmdb/midl.c +@@ -3,7 +3,7 @@ + /* $OpenLDAP$ */ + /* This work is part of OpenLDAP Software . + * +- * Copyright 2000-2015 The OpenLDAP Foundation. ++ * Copyright 2000-2016 The OpenLDAP Foundation. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without +@@ -354,5 +354,67 @@ int mdb_mid2l_append( MDB_ID2L ids, MDB_ID2 *id ) + return 0; + } + ++#ifdef MDB_VL32 ++unsigned mdb_mid3l_search( MDB_ID3L ids, MDB_ID id ) ++{ ++ /* ++ * binary search of id in ids ++ * if found, returns position of id ++ * if not found, returns first position greater than id ++ */ ++ unsigned base = 0; ++ unsigned cursor = 1; ++ int val = 0; ++ unsigned n = (unsigned)ids[0].mid; ++ ++ while( 0 < n ) { ++ unsigned pivot = n >> 1; ++ cursor = base + pivot + 1; ++ val = CMP( id, ids[cursor].mid ); ++ ++ if( val < 0 ) { ++ n = pivot; ++ ++ } else if ( val > 0 ) { ++ base = cursor; ++ n -= pivot + 1; ++ ++ } else { ++ return cursor; ++ } ++ } ++ ++ if( val > 0 ) { ++ ++cursor; ++ } ++ return cursor; ++} ++ ++int mdb_mid3l_insert( MDB_ID3L ids, MDB_ID3 *id ) ++{ ++ unsigned x, i; ++ ++ x = mdb_mid3l_search( ids, id->mid ); ++ ++ if( x < 1 ) { ++ /* internal error */ ++ return -2; ++ } ++ ++ if ( x <= ids[0].mid && ids[x].mid == id->mid ) { ++ /* duplicate */ ++ return -1; ++ } ++ ++ /* insert id */ ++ ids[0].mid++; ++ for (i=(unsigned)ids[0].mid; i>x; i--) ++ ids[i] = ids[i-1]; ++ ids[x] = *id; ++ ++ return 0; ++} ++#endif /* MDB_VL32 */ ++ + /** @} */ + /** @} */ +diff --git a/libraries/liblmdb/midl.h b/libraries/liblmdb/midl.h +index 2331e78..dc532c4 100644 +--- a/libraries/liblmdb/midl.h ++++ b/libraries/liblmdb/midl.h +@@ -11,7 +11,7 @@ + /* $OpenLDAP$ */ + /* This work is part of OpenLDAP Software . + * +- * Copyright 2000-2015 The OpenLDAP Foundation. ++ * Copyright 2000-2016 The OpenLDAP Foundation. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without +@@ -26,7 +26,7 @@ + #ifndef _MDB_MIDL_H_ + #define _MDB_MIDL_H_ + +-#include ++#include "lmdb.h" + + #ifdef __cplusplus + extern "C" { +@@ -42,7 +42,7 @@ extern "C" { + /** A generic unsigned ID number. These were entryIDs in back-bdb. + * Preferably it should have the same size as a pointer. + */ +-typedef size_t MDB_ID; ++typedef mdb_size_t MDB_ID; + + /** An IDL is an ID List, a sorted array of IDs. The first + * element of the array is a counter for how many actual +@@ -55,7 +55,11 @@ typedef MDB_ID *MDB_IDL; + /* IDL sizes - likely should be even bigger + * limiting factors: sizeof(ID), thread stack size + */ ++#ifdef MDB_VL32 ++#define MDB_IDL_LOGN 14 /* DB_SIZE is 2^14, UM_SIZE is 2^15 */ ++#else + #define MDB_IDL_LOGN 16 /* DB_SIZE is 2^16, UM_SIZE is 2^17 */ ++#endif + #define MDB_IDL_DB_SIZE (1< Date: Mon, 9 Jan 2017 15:54:05 -0800 Subject: 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( -- cgit v1.2.3 From 02964007d6f74dd10db2cb0e05676f03a53c8451 Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Mon, 9 Jan 2017 19:57:31 -0800 Subject: 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( -- cgit v1.2.3 From df3c619b69dc5fbdbb686d01a5db6e4097f9ca61 Mon Sep 17 00:00:00 2001 From: codicodi Date: Tue, 10 Jan 2017 12:04:17 +0100 Subject: add libsigcpp --- ports/libsigcpp/CMakeLists.txt | 57 +++++++++++++++++++++++++++++++ ports/libsigcpp/CONTROL | 3 ++ ports/libsigcpp/dont-import-symbols.patch | 13 +++++++ ports/libsigcpp/portfile.cmake | 28 +++++++++++++++ 4 files changed, 101 insertions(+) create mode 100644 ports/libsigcpp/CMakeLists.txt create mode 100644 ports/libsigcpp/CONTROL create mode 100644 ports/libsigcpp/dont-import-symbols.patch create mode 100644 ports/libsigcpp/portfile.cmake diff --git a/ports/libsigcpp/CMakeLists.txt b/ports/libsigcpp/CMakeLists.txt new file mode 100644 index 000000000..4c44c860d --- /dev/null +++ b/ports/libsigcpp/CMakeLists.txt @@ -0,0 +1,57 @@ +cmake_minimum_required(VERSION 3.0) +project(libsigc++) + +set(SIGCPP_API_VERSION 2.0) + +add_definitions(-DSIGC_BUILD) + +include_directories(./MSVC_Net2013) # config file for windows is there +include_directories(.) + +set(SICGPP_SOURCES + sigc++/connection.cc + sigc++/signal_base.cc + sigc++/trackable.cc + sigc++/adaptors/lambda/lambda.cc + sigc++/functors/slot_base.cc) + +add_library(sigc ${SICGPP_SOURCES}) +set_target_properties(sigc PROPERTIES OUTPUT_NAME sigc-${SIGCPP_API_VERSION}) +install(TARGETS sigc RUNTIME DESTINATION bin ARCHIVE DESTINATION lib) + +if(NOT SIGCPP_SKIP_HEADERS) + install(FILES MSVC_Net2013/sigc++config.h DESTINATION include) + install(FILES sigc++/sigc++.h DESTINATION include/sigc++) + install(FILES sigc++/bind.h DESTINATION include/sigc++) + install(FILES sigc++/bind_return.h DESTINATION include/sigc++) + install(FILES sigc++/connection.h DESTINATION include/sigc++) + install(FILES sigc++/limit_reference.h DESTINATION include/sigc++) + install(FILES sigc++/reference_wrapper.h DESTINATION include/sigc++) + install(FILES sigc++/retype_return.h DESTINATION include/sigc++) + install(FILES sigc++/signal.h DESTINATION include/sigc++) + install(FILES sigc++/signal_base.h DESTINATION include/sigc++) + install(FILES sigc++/slot.h DESTINATION include/sigc++) + install(FILES sigc++/trackable.h DESTINATION include/sigc++) + install(FILES sigc++/type_traits.h DESTINATION include/sigc++) + install(FILES sigc++/visit_each.h DESTINATION include/sigc++) + install(FILES sigc++/adaptors/adaptors.h DESTINATION include/sigc++/adaptors) + install(FILES sigc++/adaptors/adaptor_trait.h DESTINATION include/sigc++/adaptors) + install(FILES sigc++/adaptors/bind.h DESTINATION include/sigc++/adaptors) + install(FILES sigc++/adaptors/bind_return.h DESTINATION include/sigc++/adaptors) + install(FILES sigc++/adaptors/bound_argument.h DESTINATION include/sigc++/adaptors) + install(FILES sigc++/adaptors/compose.h DESTINATION include/sigc++/adaptors) + install(FILES sigc++/adaptors/deduce_result_type.h DESTINATION include/sigc++/adaptors) + install(FILES sigc++/adaptors/exception_catch.h DESTINATION include/sigc++/adaptors) + install(FILES sigc++/adaptors/hide.h DESTINATION include/sigc++/adaptors) + install(FILES sigc++/adaptors/retype.h DESTINATION include/sigc++/adaptors) + install(FILES sigc++/adaptors/retype_return.h DESTINATION include/sigc++/adaptors) + install(FILES sigc++/adaptors/track_obj.h DESTINATION include/sigc++/adaptors) + install(FILES sigc++/adaptors/lambda/base.h DESTINATION include/sigc++/adaptors/lambda) + install(FILES sigc++/adaptors/lambda/select.h DESTINATION include/sigc++/adaptors/lambda) + install(FILES sigc++/functors/functors.h DESTINATION include/sigc++/functors) + install(FILES sigc++/functors/functor_trait.h DESTINATION include/sigc++/functors) + install(FILES sigc++/functors/mem_fun.h DESTINATION include/sigc++/functors) + install(FILES sigc++/functors/ptr_fun.h DESTINATION include/sigc++/functors) + install(FILES sigc++/functors/slot.h DESTINATION include/sigc++/functors) + install(FILES sigc++/functors/slot_base.h DESTINATION include/sigc++/functors) +endif() diff --git a/ports/libsigcpp/CONTROL b/ports/libsigcpp/CONTROL new file mode 100644 index 000000000..02b2e4b83 --- /dev/null +++ b/ports/libsigcpp/CONTROL @@ -0,0 +1,3 @@ +Source: libsigcpp +Version: 2.10 +Description: Typesafe callback framework for C++ diff --git a/ports/libsigcpp/dont-import-symbols.patch b/ports/libsigcpp/dont-import-symbols.patch new file mode 100644 index 000000000..b031d3baf --- /dev/null +++ b/ports/libsigcpp/dont-import-symbols.patch @@ -0,0 +1,13 @@ +diff --git a/sigc++config.h b/sigc++config.h +index e212700..8d7366e 100644 +--- a/sigc++config.h ++++ b/sigc++config.h +@@ -72,6 +72,8 @@ + + #endif /* !SIGC_MSC */ + ++#undef SIGC_DLL ++ + #ifdef SIGC_DLL + # if defined(SIGC_BUILD) && defined(_WINDLL) + # define SIGC_API __declspec(dllexport) diff --git a/ports/libsigcpp/portfile.cmake b/ports/libsigcpp/portfile.cmake new file mode 100644 index 000000000..c98a26717 --- /dev/null +++ b/ports/libsigcpp/portfile.cmake @@ -0,0 +1,28 @@ + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libsigc++-2.10.0) +vcpkg_download_distfile(ARCHIVE + URLS "http://ftp.gnome.org/pub/GNOME/sources/libsigc++/2.10/libsigc++-2.10.0.tar.xz" + FILENAME "libsigc++-2.10.0.tar.xz" + SHA512 5b96df21d6bd6ba41520c7219e77695a86aabc60b7259262c7a9f4b8475ce0e2fd8dc37bcf7c17e24e818ff28c262d682b964c83e215b51bdbe000f3f58794ae) + +vcpkg_extract_source_archive(${ARCHIVE}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS_DEBUG + -DSIGCPP_SKIP_HEADERS=ON) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/dont-import-symbols.patch) +endif() + +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libsigcpp) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/libsigcpp/COPYING ${CURRENT_PACKAGES_DIR}/share/libsigcpp/copyright) -- cgit v1.2.3 From 19cf1282d965f1625dc0c3713c0668fafb61abbc Mon Sep 17 00:00:00 2001 From: codicodi Date: Tue, 10 Jan 2017 12:08:29 +0100 Subject: [libisigc++] tabs to spaces --- ports/libsigcpp/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/libsigcpp/CMakeLists.txt b/ports/libsigcpp/CMakeLists.txt index 4c44c860d..7a669a24e 100644 --- a/ports/libsigcpp/CMakeLists.txt +++ b/ports/libsigcpp/CMakeLists.txt @@ -10,10 +10,10 @@ include_directories(.) set(SICGPP_SOURCES sigc++/connection.cc - sigc++/signal_base.cc - sigc++/trackable.cc - sigc++/adaptors/lambda/lambda.cc - sigc++/functors/slot_base.cc) + sigc++/signal_base.cc + sigc++/trackable.cc + sigc++/adaptors/lambda/lambda.cc + sigc++/functors/slot_base.cc) add_library(sigc ${SICGPP_SOURCES}) set_target_properties(sigc PROPERTIES OUTPUT_NAME sigc-${SIGCPP_API_VERSION}) -- cgit v1.2.3 From f5fb72819614a8c4cb21f67bf887acfc414fc213 Mon Sep 17 00:00:00 2001 From: codicodi Date: Tue, 10 Jan 2017 15:28:45 +0100 Subject: add libffi --- ports/libffi/CMakeLists.txt | 78 ++++++++++ ports/libffi/CONTROL | 3 + ports/libffi/auto-define-static-macro.patch | 14 ++ ports/libffi/export-global-data.patch | 35 +++++ ports/libffi/fficonfig.h | 220 ++++++++++++++++++++++++++++ ports/libffi/portfile.cmake | 38 +++++ 6 files changed, 388 insertions(+) create mode 100644 ports/libffi/CMakeLists.txt create mode 100644 ports/libffi/CONTROL create mode 100644 ports/libffi/auto-define-static-macro.patch create mode 100644 ports/libffi/export-global-data.patch create mode 100644 ports/libffi/fficonfig.h create mode 100644 ports/libffi/portfile.cmake diff --git a/ports/libffi/CMakeLists.txt b/ports/libffi/CMakeLists.txt new file mode 100644 index 000000000..79e9e671d --- /dev/null +++ b/ports/libffi/CMakeLists.txt @@ -0,0 +1,78 @@ +cmake_minimum_required(VERSION 3.0) +project(libffi) + +# config variables for ffi.h.in +set(VERSION 3.1) +if(CMAKE_SIZEOF_VOID_P EQUAL 4) + set(TARGET X86_WIN32) +else() + set(TARGET X86_WIN64) +endif() +set(HAVE_LONG_DOUBLE 0) +set(HAVE_LONG_DOUBLE_VARIANT 0) +set(FFI_EXEC_TRAMPOLINE_TABLE 0) + +# mimic layout of original buildsystem +configure_file(include/ffi.h.in ${CMAKE_BINARY_DIR}/include/ffi.h) +file(COPY ${FFI_CONFIG_FILE} DESTINATION ${CMAKE_BINARY_DIR}) +file(COPY src/x86/ffitarget.h DESTINATION ${CMAKE_BINARY_DIR}/include) + +include_directories(${CMAKE_BINARY_DIR}/include) +include_directories(${CMAKE_BINARY_DIR}) +include_directories(include) + +add_definitions(-DHAVE_CONFIG_H) +add_definitions(-DFFI_BUILDING) +if(BUILD_SHARED_LIBS) + add_definitions(-DFFI_EXPORT_DATA) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +endif() + +if(CMAKE_SIZEOF_VOID_P EQUAL 4) + set(ARCH_ASM_NAME win32) + set(ARCH_ASSEMBLER ml /safeseh) +else() + set(ARCH_ASM_NAME win64) + set(ARCH_ASSEMBLER ml64) +endif() + +execute_process( + COMMAND cl /nologo /EP /I. /Iinclude ${CMAKE_SOURCE_DIR}/src/x86/${ARCH_ASM_NAME}.S + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + OUTPUT_FILE ${ARCH_ASM_NAME}.asm) + +# Produced *.asm file could be just added to sources. +# It works in x64 mode, but for some strange reason MASM returns error code when in x86, +# (even though it didn't report any errors and correctly generated object file) +# which in turn causes MSBUILD to stop. +execute_process( + COMMAND ${ARCH_ASSEMBLER} /c /Zi ${ARCH_ASM_NAME}.asm + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) + +set(FFI_SOURCES + ${CMAKE_BINARY_DIR}/${ARCH_ASM_NAME}.obj + src/x86/ffi.c + src/closures.c + src/java_raw_api.c + src/prep_cif.c + src/raw_api.c + src/types.c) + +if(CMAKE_BUILD_TYPE STREQUAL Debug) + list(APPEND FFI_SOURCES src/debug.c) + add_definitions(-DFFI_DEBUG) +endif() + +add_library(libffi ${FFI_SOURCES}) + +install(TARGETS libffi + RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib) + +if(NOT FFI_SKIP_HEADERS) + install(FILES + ${CMAKE_BINARY_DIR}/include/ffi.h + ${CMAKE_BINARY_DIR}/include/ffitarget.h + DESTINATION include) +endif() diff --git a/ports/libffi/CONTROL b/ports/libffi/CONTROL new file mode 100644 index 000000000..59f4edd5a --- /dev/null +++ b/ports/libffi/CONTROL @@ -0,0 +1,3 @@ +Source: libffi +Version: 3.2.1 +Description: Portable, high level programming interface to various calling conventions diff --git a/ports/libffi/auto-define-static-macro.patch b/ports/libffi/auto-define-static-macro.patch new file mode 100644 index 000000000..468a2fc36 --- /dev/null +++ b/ports/libffi/auto-define-static-macro.patch @@ -0,0 +1,14 @@ +diff --git a/ffi.h b/ffi.h +index 8d5eac2..0b0c2f6 100644 +--- a/ffi.h ++++ b/ffi.h +@@ -174,6 +174,9 @@ typedef struct _ffi_type + /* of the library, but don't worry about that. Besides, */ + /* as a workaround, they can define FFI_BUILDING if they */ + /* *know* they are going to link with the static library. */ ++ ++#define FFI_BUILDING ++ + #if defined _MSC_VER && !defined FFI_BUILDING + #define FFI_EXTERN extern __declspec(dllimport) + #else diff --git a/ports/libffi/export-global-data.patch b/ports/libffi/export-global-data.patch new file mode 100644 index 000000000..9d965f647 --- /dev/null +++ b/ports/libffi/export-global-data.patch @@ -0,0 +1,35 @@ +diff --git a/src/types.c b/src/types.c +index 0de5994..46c8d18 100644 +--- a/src/types.c ++++ b/src/types.c +@@ -31,6 +31,12 @@ + #include + #include + ++#ifdef FFI_EXPORT_DATA ++#define FFI_EXPORT __declspec(dllexport) ++#else ++#define FFI_EXPORT ++#endif ++ + /* Type definitions */ + + #define FFI_TYPEDEF(name, type, id) \ +@@ -38,7 +44,7 @@ struct struct_align_##name { \ + char c; \ + type x; \ + }; \ +-const ffi_type ffi_type_##name = { \ ++FFI_EXPORT const ffi_type ffi_type_##name = { \ + sizeof(type), \ + offsetof(struct struct_align_##name, x), \ + id, NULL \ +@@ -56,7 +62,7 @@ ffi_type ffi_type_##name = { \ + } + + /* Size and alignment are fake here. They must not be 0. */ +-const ffi_type ffi_type_void = { ++FFI_EXPORT const ffi_type ffi_type_void = { + 1, 1, FFI_TYPE_VOID, NULL + }; + diff --git a/ports/libffi/fficonfig.h b/ports/libffi/fficonfig.h new file mode 100644 index 000000000..b5cd2368f --- /dev/null +++ b/ports/libffi/fficonfig.h @@ -0,0 +1,220 @@ +/* fficonfig.h. Generated from fficonfig.h.in by configure. */ +/* fficonfig.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +/* #undef CRAY_STACKSEG_END */ + +/* Define to 1 if using `alloca.c'. */ +/* #undef C_ALLOCA */ + +/* Define to the flags needed for the .section .eh_frame directive. */ +/* #undef EH_FRAME_FLAGS */ + +/* Define this if you want extra debugging. */ +/* #undef FFI_DEBUG */ + +/* Cannot use PROT_EXEC on this target, so, we revert to alternative means */ +/* #undef FFI_EXEC_TRAMPOLINE_TABLE */ + +/* Define this if you want to enable pax emulated trampolines */ +/* #undef FFI_MMAP_EXEC_EMUTRAMP_PAX */ + +/* Cannot use malloc on this target, so, we revert to alternative means */ +/* #undef FFI_MMAP_EXEC_WRIT */ + +/* Define this if you do not want support for the raw API. */ +/* #undef FFI_NO_RAW_API */ + +/* Define this if you do not want support for aggregate types. */ +/* #undef FFI_NO_STRUCTS */ + +/* Define to 1 if you have `alloca', as a function or macro. */ +#define HAVE_ALLOCA 1 + +/* Define to 1 if you have and it should be used (not on Ultrix). + */ +/* #undef HAVE_ALLOCA_H */ + +/* Define if your assembler supports .ascii. */ +#ifndef _WIN64 +#define HAVE_AS_ASCII_PSEUDO_OP 1 +#endif + +/* Define if your assembler supports .cfi_* directives. */ +/* #undef HAVE_AS_CFI_PSEUDO_OP */ + +/* Define if your assembler supports .register. */ +/* #undef HAVE_AS_REGISTER_PSEUDO_OP */ + +/* Define if your assembler and linker support unaligned PC relative relocs. + */ +/* #undef HAVE_AS_SPARC_UA_PCREL */ + +/* Define if your assembler supports .string. */ +#ifndef _WIN64 +#define HAVE_AS_STRING_PSEUDO_OP 1 +#endif + +/* Define if your assembler supports unwind section type. */ +/* #undef HAVE_AS_X86_64_UNWIND_SECTION_TYPE */ + +/* Define if your assembler supports PC relative relocs. */ +#ifndef _WIN64 +#define HAVE_AS_X86_PCREL 1 +#endif + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DLFCN_H */ + +/* Define if __attribute__((visibility("hidden"))) is supported. */ +/* #undef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define if you have the long double type and it is bigger than a double */ +/* #undef HAVE_LONG_DOUBLE */ + +/* Define if you support more than one size of the long double type */ +/* #undef HAVE_LONG_DOUBLE_VARIANT */ + +/* Define to 1 if you have the `memcpy' function. */ +/* #undef HAVE_MEMCPY */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mmap' function. */ +/* #undef HAVE_MMAP */ + +/* Define if mmap with MAP_ANON(YMOUS) works. */ +/* #undef HAVE_MMAP_ANON */ + +/* Define if mmap of /dev/zero works. */ +/* #undef HAVE_MMAP_DEV_ZERO */ + +/* Define if read-only mmap of a plain file works. */ +/* #undef HAVE_MMAP_FILE */ + +/* Define if .eh_frame sections should be read-only. */ +/* #undef HAVE_RO_EH_FRAME */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STRINGS_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_MMAN_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_UNISTD_H */ + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "libffi" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "http://github.com/atgreen/libffi/issues" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libffi" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libffi 3.1" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libffi" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "3.1" + +/* The size of `double', as computed by sizeof. */ +#define SIZEOF_DOUBLE 8 + +/* The size of `long double', as computed by sizeof. */ +#define SIZEOF_LONG_DOUBLE 8 + +/* The size of `size_t', as computed by sizeof. */ +#ifndef _WIN64 +#define SIZEOF_SIZE_T 4 +#else +#define SIZEOF_SIZE_T 8 +#endif + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at runtime. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +/* #undef STACK_DIRECTION */ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define if symbols are underscored. */ +#ifndef _WIN64 +#define SYMBOL_UNDERSCORE 1 +#endif + +/* Define this if you are using Purify and want to suppress spurious messages. + */ +/* #undef USING_PURIFY */ + +/* Version number of package */ +#define VERSION "3.1" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ + + +#ifdef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE +#ifdef LIBFFI_ASM +#define FFI_HIDDEN(name) .hidden name +#else +#define FFI_HIDDEN __attribute__ ((visibility ("hidden"))) +#endif +#else +#ifdef LIBFFI_ASM +#define FFI_HIDDEN(name) +#else +#define FFI_HIDDEN +#endif +#endif + diff --git a/ports/libffi/portfile.cmake b/ports/libffi/portfile.cmake new file mode 100644 index 000000000..2639aa1ba --- /dev/null +++ b/ports/libffi/portfile.cmake @@ -0,0 +1,38 @@ +if(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL x86 AND NOT VCPKG_TARGET_ARCHITECTURE STREQUAL x64) + message(FATAL_ERROR "Architecture not supported") +endif() + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libffi-3.1) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/libffi/libffi/archive/v3.1.zip" + FILENAME "libffi-3.1.zip" + SHA512 a5d4cc638262aecec29e70333119f561588a737fd8f353e18d9bf1bfa7b38eb6aba371778119ea8d35339b458815105d5b110063295b6588a8761b24dac77a7c) + +vcpkg_extract_source_archive(${ARCHIVE}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/export-global-data.patch) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DFFI_CONFIG_FILE=${CMAKE_CURRENT_LIST_DIR}/fficonfig.h + OPTIONS_DEBUG + -DFFI_SKIP_HEADERS=ON) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/auto-define-static-macro.patch) +endif() + +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libffi) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/libffi/LICENSE ${CURRENT_PACKAGES_DIR}/share/libffi/copyright) -- cgit v1.2.3 From 54918bc63af0e776d3419a402338ab156ea6f279 Mon Sep 17 00:00:00 2001 From: codicodi Date: Tue, 10 Jan 2017 15:40:47 +0100 Subject: correct version --- ports/libffi/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/libffi/CONTROL b/ports/libffi/CONTROL index 59f4edd5a..83725f49c 100644 --- a/ports/libffi/CONTROL +++ b/ports/libffi/CONTROL @@ -1,3 +1,3 @@ Source: libffi -Version: 3.2.1 +Version: 3.1 Description: Portable, high level programming interface to various calling conventions -- cgit v1.2.3 From 0ec8e0448ffa97c4e6fbaa05529966df379effb1 Mon Sep 17 00:00:00 2001 From: codicodi Date: Wed, 11 Jan 2017 00:54:32 +0100 Subject: [pixman] enable dynamic build --- ports/pixman/portfile.cmake | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ports/pixman/portfile.cmake b/ports/pixman/portfile.cmake index b4029a26b..ac6de80f0 100644 --- a/ports/pixman/portfile.cmake +++ b/ports/pixman/portfile.cmake @@ -5,10 +5,6 @@ # 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. Building static.") # pixman does not export any symbols. - set(VCPKG_LIBRARY_LINKAGE static) -endif() include(vcpkg_common_functions) @@ -27,6 +23,7 @@ file(RENAME ${SOURCE_PATH}/pixman/CMakeLists_pixman.txt ${SOURCE_PATH}/pixman/CM vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} + OPTIONS -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON ) vcpkg_install_cmake() -- cgit v1.2.3 From 31aae963efa05229ef70339f5df46ac712204062 Mon Sep 17 00:00:00 2001 From: codicodi Date: Wed, 11 Jan 2017 00:55:10 +0100 Subject: [pixman] bump version --- ports/pixman/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/pixman/CONTROL b/ports/pixman/CONTROL index 564c81466..3603242d0 100644 --- a/ports/pixman/CONTROL +++ b/ports/pixman/CONTROL @@ -1,3 +1,3 @@ Source: pixman -Version: 0.34.0 +Version: 0.34.0-1 Description: Pixman is a low-level software library for pixel manipulation, providing features such as image compositing and trapezoid rasterization. -- cgit v1.2.3 From 4f5f52ff470e83fa041ac4c6797bfa4e61ed2501 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 10 Jan 2017 16:02:53 -0800 Subject: Fix error message when looking for PYTHON2 --- ports/fmt/portfile.cmake | 4 ++-- scripts/cmake/vcpkg_find_acquire_program.cmake | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/ports/fmt/portfile.cmake b/ports/fmt/portfile.cmake index 3470dbedb..3ea33e779 100644 --- a/ports/fmt/portfile.cmake +++ b/ports/fmt/portfile.cmake @@ -31,8 +31,8 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE ${CURRENT_PACKAGES_DIR}/include/fmt/format.cc) -file(REMOVE ${CURRENT_PACKAGES_DIR}/include/fmt/ostream.cc) +#file(REMOVE ${CURRENT_PACKAGES_DIR}/include/fmt/format.cc) +#file(REMOVE ${CURRENT_PACKAGES_DIR}/include/fmt/ostream.cc) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/share/fmt/fmt-targets-debug.cmake ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake) file(READ ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake FMT_DEBUG_MODULE) string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" FMT_DEBUG_MODULE "${FMT_DEBUG_MODULE}") diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index b192bc5d7..83e41fe3b 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -46,8 +46,7 @@ function(vcpkg_find_acquire_program VAR) endif() endif() if(PYTHON2 MATCHES "NOTFOUND") - message(FATAL_ERROR "libuv uses the GYP build system, which requires Python 2.7.\n" - "Python 2.7 was not found in the path or by searching inside C:\\Python27.\n" + message(FATAL_ERROR "Python 2.7 was not found in the path or by searching inside C:\\Python27.\n" "There is no portable redistributable for Python 2.7, so you will need to install the MSI located at:\n" " https://www.python.org/ftp/python/2.7.11/python-2.7.11.amd64.msi\n" ) -- cgit v1.2.3 From b966acc5c2572fff68b763024d9b96a2087aad29 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 10 Jan 2017 17:05:58 -0800 Subject: Update CHANGELOG and bump version to v0.0.66 --- CHANGELOG.md | 40 ++++++++++++++++++++++++++++++++++++++++ toolsrc/VERSION.txt | 2 +- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 464d5c3e7..c052325a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,43 @@ +vcpkg (0.0.66) +-------------- + * Add ports: + - antlr4 4.6 + - bzip2 1.0.6 + - dx 1.0.0 + - gli 0.8.2 + - libarchive 3.2.2 + - libffi 3.1 + - liblzma 5.2.2 + - libmodplug 0.8.8.5-bb25b05 + - libsigcpp 2.10 + - lmdb 0.9.18-1 + - lz4 1.7.4.2 + - ogre 1.9.0 + - qwt 6.1.3 + - smpeg2 2.0.0 + - spirv-tools 1.1-f72189c249ba143c6a89a4cf1e7d53337b2ddd40 + * Update ports: + - aws-sdk-cpp 1.0.34-1 -> 1.0.47 + - azure-storage-cpp 2.5.0 -> 2.6.0 + - boost 1.62-8 -> 1.62-9 + - chakracore 1.3.1 -> 1.4.0 + - freetype 2.6.3-2 -> 2.6.3-3 + - icu 58.1 -> 58.2-1 + - libbson 1.5.0-rc6 -> 1.5.1 + - libvorbis -> 1.3.5-143caf4023a90c09a5eb685fdd46fb9b9c36b1ee + - lua 5.3.3-1 -> 5.3.3-2 + - mongo-c-driver 1.5.0-rc6 -> 1.5.1 + - pixman 0.34.0 -> 0.34.0-1 + - qt5 5.7-1 -> 5.7.1-2 + - sdl2 2.0.5 -> 2.0.5-2 + - zlib 1.2.8 -> 1.2.10 + * Improvements in pre-install checks: + - Refactor file-exists-check. Improved clarity and performance. + * Fixes and improvements in existing portfiles and the `vcpkg` tool itself + +-- vcpkg team TUE, 10 Jan 2017 17:15:00 -0800 + + vcpkg (0.0.65) -------------- * Add ports: diff --git a/toolsrc/VERSION.txt b/toolsrc/VERSION.txt index 1c65f15d9..475a4440c 100644 --- a/toolsrc/VERSION.txt +++ b/toolsrc/VERSION.txt @@ -1 +1 @@ -"0.0.65" \ No newline at end of file +"0.0.66" \ No newline at end of file -- cgit v1.2.3 From 07a46c8f49f86d0dd3cd312e1447ba22e79197d6 Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Tue, 10 Jan 2017 17:39:13 -0800 Subject: 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 -- cgit v1.2.3 From 1911fa818225ac02affefd6e85a0626628fcf3e3 Mon Sep 17 00:00:00 2001 From: Albert Ziegenhagel Date: Wed, 11 Jan 2017 11:37:19 +0100 Subject: 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) --- scripts/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}) -- cgit v1.2.3 From 4bf2b196bff38decfacc921a61b8ff4f0a9d5efd Mon Sep 17 00:00:00 2001 From: Albert Ziegenhagel Date: Wed, 11 Jan 2017 12:01:37 +0100 Subject: 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 ++++++ ports/metis/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) -- cgit v1.2.3 From 86b117028b292f9577c160443601e589151cf550 Mon Sep 17 00:00:00 2001 From: Albert Ziegenhagel Date: Wed, 11 Jan 2017 12:13:19 +0100 Subject: 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) -- cgit v1.2.3 From f88b7d667cc9760f3506dbcf0d985d58165afc5a Mon Sep 17 00:00:00 2001 From: flysha Date: Wed, 11 Jan 2017 22:15:08 +0800 Subject: 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) -- cgit v1.2.3 From 09c8abf7abd669ebd330660a50186e41a1839214 Mon Sep 17 00:00:00 2001 From: flysha Date: Wed, 11 Jan 2017 22:42:37 +0800 Subject: 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) -- cgit v1.2.3 From 2eadcd75add69718b9e63779b0701b5bc8e05ffe Mon Sep 17 00:00:00 2001 From: flysha Date: Wed, 11 Jan 2017 22:50:55 +0800 Subject: [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}) -- cgit v1.2.3 From c104c8966f7bf2fa6576d25cc3631894008c94e1 Mon Sep 17 00:00:00 2001 From: flysha Date: Wed, 11 Jan 2017 23:09:29 +0800 Subject: add uvatlas --- ports/uvatlas/CONTROL | 4 ++++ ports/uvatlas/portfile.cmake | 56 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 ports/uvatlas/CONTROL create mode 100644 ports/uvatlas/portfile.cmake diff --git a/ports/uvatlas/CONTROL b/ports/uvatlas/CONTROL new file mode 100644 index 000000000..0e842d8fb --- /dev/null +++ b/ports/uvatlas/CONTROL @@ -0,0 +1,4 @@ +Source: uvatlas +Version: sept2016 +Description: UVAtlas isochart texture atlas +Build-Depends: directxtex, directxmesh \ No newline at end of file diff --git a/ports/uvatlas/portfile.cmake b/ports/uvatlas/portfile.cmake new file mode 100644 index 000000000..9f4bc5308 --- /dev/null +++ b/ports/uvatlas/portfile.cmake @@ -0,0 +1,56 @@ +# 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/UVAtlas-sept2016) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/Microsoft/UVAtlas/archive/sept2016.tar.gz" + FILENAME "UVAtlas-sept2016.tar.gz" + SHA512 326af26c151620cd5082daf3913cf3fbe7bca7d1aaf5cc44cacff54319ffe79b728c24519187c3f9393a846430d0fb9493ffe9473f87d220f5c9ae7dab73f69f +) +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}/UVAtlas/UVAtlas_2015.sln + PLATFORM ${BUILD_ARCH} +) +vcpkg_build_msbuild( + PROJECT_PATH ${SOURCE_PATH}/UVAtlasTool/UVAtlasTool_2015.sln + PLATFORM ${BUILD_ARCH} +) + +file(INSTALL + ${SOURCE_PATH}/Inc/ + DESTINATION ${CURRENT_PACKAGES_DIR}/include) +file(INSTALL + ${SOURCE_PATH}/UVAtlas/Bin/Desktop_2015/${BUILD_ARCH}/Release/UVAtlas.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib) +file(INSTALL + ${SOURCE_PATH}/UVAtlas/Bin/Desktop_2015/${BUILD_ARCH}/Debug/UVAtlas.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) +file(INSTALL + ${SOURCE_PATH}/UVAtlas/Bin/Desktop_2015/${BUILD_ARCH}/Debug/UVAtlas.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) +file(INSTALL + ${SOURCE_PATH}/UVAtlasTool/Bin/Desktop_2015/${BUILD_ARCH}/Release/UVAtlasTool.exe + DESTINATION ${CURRENT_PACKAGES_DIR}/tools) + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/uvatlas) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/uvatlas/LICENSE ${CURRENT_PACKAGES_DIR}/share/uvatlas/copyright) -- cgit v1.2.3 From 719e9c7446a3fb40974c8686e5def4d5e544babc Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Wed, 11 Jan 2017 07:42:54 -0800 Subject: 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 -- cgit v1.2.3 From 00679b66e3d9fd49afd19a88418426fb50c39b08 Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Wed, 11 Jan 2017 10:59:45 -0800 Subject: 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() -- cgit v1.2.3 From 275a59dd9dc9b6ec324ac9eb5460193bfd53b736 Mon Sep 17 00:00:00 2001 From: codicodi Date: Wed, 11 Jan 2017 21:20:53 +0100 Subject: Add glib --- ports/glib/CMakeLists.txt | 161 ++++++++++++++ ports/glib/CONTROL | 4 + ports/glib/cmake/install_headers.cmake | 255 +++++++++++++++++++++++ ports/glib/portfile.cmake | 32 +++ ports/glib/use-libiconv-on-windows.patch | 14 ++ scripts/cmake/vcpkg_common_functions.cmake | 1 + scripts/cmake/vcpkg_copy_tool_dependencies.cmake | 16 ++ 7 files changed, 483 insertions(+) create mode 100644 ports/glib/CMakeLists.txt create mode 100644 ports/glib/CONTROL create mode 100644 ports/glib/cmake/install_headers.cmake create mode 100644 ports/glib/portfile.cmake create mode 100644 ports/glib/use-libiconv-on-windows.patch create mode 100644 scripts/cmake/vcpkg_copy_tool_dependencies.cmake diff --git a/ports/glib/CMakeLists.txt b/ports/glib/CMakeLists.txt new file mode 100644 index 000000000..79d460bab --- /dev/null +++ b/ports/glib/CMakeLists.txt @@ -0,0 +1,161 @@ +cmake_minimum_required(VERSION 3.0) +project(glib) + +set(GLIB_VERSION 2.50.2) +set(GLIB_DLL_SUFFIX 2) +set(GLIB_LIB_SUFFIX 2.0) + +if(CMAKE_BUILD_TYPE STREQUAL Debug) + add_definitions(-DG_ENABLE_DEBUG) +endif() + +if(BUILD_SHARED_LIBS) + set(GLIB_EXPORT_MACRO DLL_EXPORT) +endif() + +set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) + +# find dependencies + +# zlib +find_package(ZLIB REQUIRED) +# pcre +find_path(PCRE_INCLUDE_DIR pcre.h) +if(CMAKE_BUILD_TYPE STREQUAL Debug) + set(PCRE_SUFFIX d) +endif() +find_library(PCRE_LIBRARY pcre${PCRE_SUFFIX}) +# libiconv +find_path(ICONV_INCLUDE_DIR iconv.h) +find_library(ICONV_LIBRARY NAMES iconv libiconv) +# libffi +find_path(FFI_INCLUDE_DIR ffi.h) +find_library(FFI_LIBRARY NAMES ffi libffi) +# libintl(gettext) +find_path(LIBINTL_INCLUDE_DIR libintl.h) +find_library(LIBINTL_LIBRARY NAMES intl libintl) + +#prepare config files +configure_file(config.h.win32 ${CMAKE_SOURCE_DIR}/config.h COPYONLY) +configure_file(glib/glibconfig.h.win32 ${CMAKE_SOURCE_DIR}/glib/glibconfig.h COPYONLY) +configure_file(gmodule/gmoduleconf.h.win32 ${CMAKE_SOURCE_DIR}/gmodule/gmoduleconf.h COPYONLY) +configure_file(gio/gnetworking.h.win32 ${CMAKE_SOURCE_DIR}/gio/gnetworking.h COPYONLY) +add_definitions(-DHAVE_CONFIG_H) + +include_directories(. ./glib) + +# This macro purposely doesn't find nodes with sources that have additional properties set +# Most of such files in glib are PCRE sources which we don't use anyway +macro(extract_vcproj_sources VC_PROJECT OUT_VAR) + file(READ ${VC_PROJECT} ${VC_PROJECT}-CONTENTS) + STRING(REPLACE "\n" ";" ${VC_PROJECT}-CONTENTS "${${VC_PROJECT}-CONTENTS}") # split by lines + foreach(LINE ${${VC_PROJECT}-CONTENTS}) + if(LINE MATCHES "") + string(REPLACE "" "" LINE ${LINE}) + string(STRIP ${LINE} LINE) + file(TO_CMAKE_PATH ${LINE} LINE) + list(APPEND ${OUT_VAR} ${LINE}) + endif() + endforeach() +endmacro() + +# main module +extract_vcproj_sources(build/win32/vs14/glib.vcxproj GLIB_SOURCES) +list(APPEND GLIB_SOURCES glib/libcharset/localcharset.c) # modified internal version with prefixed symbols +add_library(glib ${GLIB_SOURCES}) +target_compile_definitions(glib PRIVATE USE_SYSTEM_PCRE ${GLIB_EXPORT_MACRO} GLIB_COMPILATION G_LOG_DOMAIN="GLib" LIBDIR) +target_link_libraries(glib ws2_32 winmm ${PCRE_LIBRARY} ${ICONV_LIBRARY} ${LIBINTL_LIBRARY}) +target_include_directories(glib PRIVATE ${PCRE_INCLUDE_DIR} ${ICONV_INCLUDE_DIR}) +target_include_directories(glib PUBLIC ${LIBINTL_INCLUDE_DIR}) +list(APPEND GLIB_TARGETS glib) + +# gthread +add_library(gthread gthread/gthread-impl.c) +target_compile_definitions(gthread PRIVATE G_LOG_DOMAIN="GThread") +target_link_libraries(gthread glib ${LIBINTL_LIBRARY}) +target_include_directories(gthread PRIVATE ${LIBINTL_INCLUDE_DIR}) +list(APPEND GLIB_TARGETS gthread) + +# gobject +extract_vcproj_sources(build/win32/vs14/gobject.vcxproj GOBJECT_SOURCES) +add_library(gobject ${GOBJECT_SOURCES}) +target_compile_definitions(gobject PRIVATE GOBJECT_COMPILATION ${GLIB_EXPORT_MACRO} G_LOG_DOMAIN="GLib-GObject") +target_link_libraries(gobject gthread glib ${FFI_LIBRARY}) +target_include_directories(gobject PRIVATE ${FFI_INCLUDE_DIR}) +list(APPEND GLIB_TARGETS gobject) + +# gmodule +add_library(gmodule gmodule/gmodule.c) +target_compile_definitions(gmodule PRIVATE G_LOG_DOMAIN="GModule") +target_link_libraries(gmodule glib ${LIBINTL_LIBRARY}) +target_include_directories(gmodule PRIVATE ${LIBINTL_INCLUDE_DIR}) +list(APPEND GLIB_TARGETS gmodule) + +# gio +extract_vcproj_sources(build/win32/vs14/gio.vcxproj GIO_SOURCES) +add_library(gio ${GIO_SOURCES}) +target_compile_definitions(gio PRIVATE GIO_COMPILATION ${GLIB_EXPORT_MACRO} G_LOG_DOMAIN="GLib-GIO") +target_link_libraries(gio glib gmodule gobject ws2_32 shlwapi dnsapi iphlpapi ${ZLIB_LIBRARIES}) +target_include_directories(gio PRIVATE ./gio ./gmodule ${ZLIB_INCLUDE_DIRS}) +list(APPEND GLIB_TARGETS gio) + +foreach(GTARGET ${GLIB_TARGETS}) + set_target_properties(${GTARGET} PROPERTIES + OUTPUT_NAME ${GTARGET}-${GLIB_DLL_SUFFIX} + ARCHIVE_OUTPUT_NAME ${GTARGET}-${GLIB_LIB_SUFFIX}) +endforeach() + +macro(add_glib_tool TOOL_NAME) + add_executable(${TOOL_NAME} ${ARGN}) + target_link_libraries(${TOOL_NAME} glib) + target_compile_definitions(${TOOL_NAME} PRIVATE GLIB_COMPILATION) + list(APPEND GLIB_TOOLS ${TOOL_NAME}) +endmacro() + +macro(add_gio_tool TOOL_NAME) + add_executable(${TOOL_NAME} ${ARGN}) + target_link_libraries(${TOOL_NAME} glib gio gobject gmodule) + target_include_directories(${TOOL_NAME} PRIVATE ./gmodule ./gio) + target_compile_definitions(${TOOL_NAME} PRIVATE GIO_COMPILATION) + list(APPEND GLIB_TOOLS ${TOOL_NAME}) +endmacro() + +if(NOT GLIB_SKIP_TOOLS) + configure_file(gobject/glib-mkenums.in ${CMAKE_SOURCE_DIR}/gobject/glib-mkenums @ONLY) # uses GLIB_VERSION + install(FILES gobject/glib-mkenums DESTINATION tools) + + add_gio_tool(gdbus gio/gdbus-tool.c) + add_gio_tool(gio-querymodules gio/gio-querymodules.c) + file(GLOB GIO_TOOL_SOURCES gio/gio-tool*.c) + add_gio_tool(gio-tool ${GIO_TOOL_SOURCES}) + set_target_properties(gio-tool PROPERTIES OUTPUT_NAME gio) + add_gio_tool(glib-compile-resources gio/glib-compile-resources.c gio/gvdb/gvdb-builder.c) + add_gio_tool(glib-compile-schemas gio/glib-compile-schemas.c gio/gvdb/gvdb-builder.c) + add_gio_tool(gresource gio/gresource-tool.c) + add_gio_tool(gsettings gio/gsettings-tool.c) + + if(CMAKE_SIZEOF_VOID_P EQUAL 4) + set(WIN win32) + else() + set(WIN win64) + endif() + + add_glib_tool(glib-genmarshal gobject/glib-genmarshal.c) + add_glib_tool(gspawn-${WIN}-helper WIN32 glib/gspawn-win32-helper.c) + add_glib_tool(gspawn-${WIN}-helper-console glib/gspawn-win32-helper-console.c) + + install(TARGETS ${GLIB_TOOLS} RUNTIME DESTINATION tools) +endif() + +install(TARGETS ${GLIB_TARGETS} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) +if(NOT GLIB_SKIP_HEADERS) + include(install_headers) +endif() + +message(STATUS "Link-time dependencies:") +message(STATUS " " ${ZLIB_LIBRARIES}) +message(STATUS " " ${PCRE_LIBRARY}) +message(STATUS " " ${ICONV_LIBRARY}) +message(STATUS " " ${FFI_LIBRARY}) +message(STATUS " " ${LIBINTL_LIBRARY}) diff --git a/ports/glib/CONTROL b/ports/glib/CONTROL new file mode 100644 index 000000000..984d7576a --- /dev/null +++ b/ports/glib/CONTROL @@ -0,0 +1,4 @@ +Source: glib +Version: 2.50.2 +Description: Portable, general-purpose utility library. +Build-Depends: zlib, pcre, libffi, gettext, libiconv diff --git a/ports/glib/cmake/install_headers.cmake b/ports/glib/cmake/install_headers.cmake new file mode 100644 index 000000000..e94a12e49 --- /dev/null +++ b/ports/glib/cmake/install_headers.cmake @@ -0,0 +1,255 @@ +# generated from glib-install.props +install(FILES glib/glib.h DESTINATION include) +install(FILES glib/glibconfig.h DESTINATION include) +install(FILES glib/glib.h DESTINATION include) +install(FILES glib/glib-object.h DESTINATION include) +install(FILES glib/deprecated/gallocator.h DESTINATION include/glib/deprecated) +install(FILES glib/deprecated/gcache.h DESTINATION include/glib/deprecated) +install(FILES glib/deprecated/gcompletion.h DESTINATION include/glib/deprecated) +install(FILES glib/deprecated/gmain.h DESTINATION include/glib/deprecated) +install(FILES glib/deprecated/grel.h DESTINATION include/glib/deprecated) +install(FILES glib/deprecated/gthread.h DESTINATION include/glib/deprecated) +install(FILES glib/glib-autocleanups.h DESTINATION include/glib) +install(FILES glib/galloca.h DESTINATION include/glib) +install(FILES glib/garray.h DESTINATION include/glib) +install(FILES glib/gasyncqueue.h DESTINATION include/glib) +install(FILES glib/gatomic.h DESTINATION include/glib) +install(FILES glib/gbacktrace.h DESTINATION include/glib) +install(FILES glib/gbase64.h DESTINATION include/glib) +install(FILES glib/gbitlock.h DESTINATION include/glib) +install(FILES glib/gbookmarkfile.h DESTINATION include/glib) +install(FILES glib/gbytes.h DESTINATION include/glib) +install(FILES glib/gcharset.h DESTINATION include/glib) +install(FILES glib/gchecksum.h DESTINATION include/glib) +install(FILES glib/gconvert.h DESTINATION include/glib) +install(FILES glib/gdataset.h DESTINATION include/glib) +install(FILES glib/gdate.h DESTINATION include/glib) +install(FILES glib/gdatetime.h DESTINATION include/glib) +install(FILES glib/gdir.h DESTINATION include/glib) +install(FILES glib/genviron.h DESTINATION include/glib) +install(FILES glib/gerror.h DESTINATION include/glib) +install(FILES glib/gfileutils.h DESTINATION include/glib) +install(FILES glib/ggettext.h DESTINATION include/glib) +install(FILES glib/ghash.h DESTINATION include/glib) +install(FILES glib/ghmac.h DESTINATION include/glib) +install(FILES glib/ghook.h DESTINATION include/glib) +install(FILES glib/ghostutils.h DESTINATION include/glib) +install(FILES glib/gi18n.h DESTINATION include/glib) +install(FILES glib/gi18n-lib.h DESTINATION include/glib) +install(FILES glib/giochannel.h DESTINATION include/glib) +install(FILES glib/gkeyfile.h DESTINATION include/glib) +install(FILES glib/glist.h DESTINATION include/glib) +install(FILES glib/gmacros.h DESTINATION include/glib) +install(FILES glib/gmain.h DESTINATION include/glib) +install(FILES glib/gmappedfile.h DESTINATION include/glib) +install(FILES glib/gmarkup.h DESTINATION include/glib) +install(FILES glib/gmem.h DESTINATION include/glib) +install(FILES glib/gmessages.h DESTINATION include/glib) +install(FILES glib/gnode.h DESTINATION include/glib) +install(FILES glib/goption.h DESTINATION include/glib) +install(FILES glib/gpattern.h DESTINATION include/glib) +install(FILES glib/gpoll.h DESTINATION include/glib) +install(FILES glib/gprimes.h DESTINATION include/glib) +install(FILES glib/gqsort.h DESTINATION include/glib) +install(FILES glib/gquark.h DESTINATION include/glib) +install(FILES glib/gqueue.h DESTINATION include/glib) +install(FILES glib/grand.h DESTINATION include/glib) +install(FILES glib/gregex.h DESTINATION include/glib) +install(FILES glib/gscanner.h DESTINATION include/glib) +install(FILES glib/gsequence.h DESTINATION include/glib) +install(FILES glib/gshell.h DESTINATION include/glib) +install(FILES glib/gslice.h DESTINATION include/glib) +install(FILES glib/gslist.h DESTINATION include/glib) +install(FILES glib/gspawn.h DESTINATION include/glib) +install(FILES glib/gstdio.h DESTINATION include/glib) +install(FILES glib/gstrfuncs.h DESTINATION include/glib) +install(FILES glib/gtestutils.h DESTINATION include/glib) +install(FILES glib/gstring.h DESTINATION include/glib) +install(FILES glib/gstringchunk.h DESTINATION include/glib) +install(FILES glib/gthread.h DESTINATION include/glib) +install(FILES glib/gthreadpool.h DESTINATION include/glib) +install(FILES glib/gtimer.h DESTINATION include/glib) +install(FILES glib/gtimezone.h DESTINATION include/glib) +install(FILES glib/gtrashstack.h DESTINATION include/glib) +install(FILES glib/gtree.h DESTINATION include/glib) +install(FILES glib/gtypes.h DESTINATION include/glib) +install(FILES glib/gunicode.h DESTINATION include/glib) +install(FILES glib/gurifuncs.h DESTINATION include/glib) +install(FILES glib/gutils.h DESTINATION include/glib) +install(FILES glib/gvarianttype.h DESTINATION include/glib) +install(FILES glib/gvariant.h DESTINATION include/glib) +install(FILES glib/gversion.h DESTINATION include/glib) +install(FILES glib/gversionmacros.h DESTINATION include/glib) +install(FILES glib/gwin32.h DESTINATION include/glib) +install(FILES glib/gprintf.h DESTINATION include/glib) +install(FILES gmodule/gmodule.h DESTINATION include) +install(FILES gobject/gobject-autocleanups.h DESTINATION include/gobject) +install(FILES gobject/glib-types.h DESTINATION include/gobject) +install(FILES gobject/gbinding.h DESTINATION include/gobject) +install(FILES gobject/gboxed.h DESTINATION include/gobject) +install(FILES gobject/gclosure.h DESTINATION include/gobject) +install(FILES gobject/genums.h DESTINATION include/gobject) +install(FILES gobject/gmarshal.h DESTINATION include/gobject) +install(FILES gobject/gobject.h DESTINATION include/gobject) +install(FILES gobject/gparam.h DESTINATION include/gobject) +install(FILES gobject/gparamspecs.h DESTINATION include/gobject) +install(FILES gobject/gsignal.h DESTINATION include/gobject) +install(FILES gobject/gsourceclosure.h DESTINATION include/gobject) +install(FILES gobject/gtype.h DESTINATION include/gobject) +install(FILES gobject/gtypemodule.h DESTINATION include/gobject) +install(FILES gobject/gtypeplugin.h DESTINATION include/gobject) +install(FILES gobject/gvalue.h DESTINATION include/gobject) +install(FILES gobject/gvaluearray.h DESTINATION include/gobject) +install(FILES gobject/gvaluecollector.h DESTINATION include/gobject) +install(FILES gobject/gvaluetypes.h DESTINATION include/gobject) +install(FILES gobject/gobjectnotifyqueue.c DESTINATION include/gobject) +install(FILES gio/gappinfo.h DESTINATION include/gio) +install(FILES gio/gasyncinitable.h DESTINATION include/gio) +install(FILES gio/gasyncresult.h DESTINATION include/gio) +install(FILES gio/gbufferedinputstream.h DESTINATION include/gio) +install(FILES gio/gbufferedoutputstream.h DESTINATION include/gio) +install(FILES gio/gbytesicon.h DESTINATION include/gio) +install(FILES gio/gcancellable.h DESTINATION include/gio) +install(FILES gio/gcontenttype.h DESTINATION include/gio) +install(FILES gio/gcharsetconverter.h DESTINATION include/gio) +install(FILES gio/gconverter.h DESTINATION include/gio) +install(FILES gio/gconverterinputstream.h DESTINATION include/gio) +install(FILES gio/gconverteroutputstream.h DESTINATION include/gio) +install(FILES gio/gdatagrambased.h DESTINATION include/gio) +install(FILES gio/gdatainputstream.h DESTINATION include/gio) +install(FILES gio/gdataoutputstream.h DESTINATION include/gio) +install(FILES gio/gdrive.h DESTINATION include/gio) +install(FILES gio/gemblem.h DESTINATION include/gio) +install(FILES gio/gemblemedicon.h DESTINATION include/gio) +install(FILES gio/gfile.h DESTINATION include/gio) +install(FILES gio/gfileattribute.h DESTINATION include/gio) +install(FILES gio/gfileenumerator.h DESTINATION include/gio) +install(FILES gio/gfileicon.h DESTINATION include/gio) +install(FILES gio/gfileinfo.h DESTINATION include/gio) +install(FILES gio/gfileinputstream.h DESTINATION include/gio) +install(FILES gio/gfilemonitor.h DESTINATION include/gio) +install(FILES gio/gfilenamecompleter.h DESTINATION include/gio) +install(FILES gio/gfileoutputstream.h DESTINATION include/gio) +install(FILES gio/gfileiostream.h DESTINATION include/gio) +install(FILES gio/gfilterinputstream.h DESTINATION include/gio) +install(FILES gio/gfilteroutputstream.h DESTINATION include/gio) +install(FILES gio/gicon.h DESTINATION include/gio) +install(FILES gio/ginetaddress.h DESTINATION include/gio) +install(FILES gio/ginetaddressmask.h DESTINATION include/gio) +install(FILES gio/ginetsocketaddress.h DESTINATION include/gio) +install(FILES gio/ginputstream.h DESTINATION include/gio) +install(FILES gio/ginitable.h DESTINATION include/gio) +install(FILES gio/gio.h DESTINATION include/gio) +install(FILES gio/gio-autocleanups.h DESTINATION include/gio) +install(FILES gio/giotypes.h DESTINATION include/gio) +install(FILES gio/gioenums.h DESTINATION include/gio) +install(FILES gio/gioerror.h DESTINATION include/gio) +install(FILES gio/giomodule.h DESTINATION include/gio) +install(FILES gio/gioscheduler.h DESTINATION include/gio) +install(FILES gio/giostream.h DESTINATION include/gio) +install(FILES gio/gloadableicon.h DESTINATION include/gio) +install(FILES gio/gmount.h DESTINATION include/gio) +install(FILES gio/gmemoryinputstream.h DESTINATION include/gio) +install(FILES gio/gmemoryoutputstream.h DESTINATION include/gio) +install(FILES gio/gmountoperation.h DESTINATION include/gio) +install(FILES gio/gnativevolumemonitor.h DESTINATION include/gio) +install(FILES gio/gnetworkaddress.h DESTINATION include/gio) +install(FILES gio/gnetworkmonitor.h DESTINATION include/gio) +install(FILES gio/gnetworkservice.h DESTINATION include/gio) +install(FILES gio/goutputstream.h DESTINATION include/gio) +install(FILES gio/gpermission.h DESTINATION include/gio) +install(FILES gio/gpollableinputstream.h DESTINATION include/gio) +install(FILES gio/gpollableoutputstream.h DESTINATION include/gio) +install(FILES gio/gpollableutils.h DESTINATION include/gio) +install(FILES gio/gproxyaddress.h DESTINATION include/gio) +install(FILES gio/gproxy.h DESTINATION include/gio) +install(FILES gio/gproxyaddressenumerator.h DESTINATION include/gio) +install(FILES gio/gproxyresolver.h DESTINATION include/gio) +install(FILES gio/gresolver.h DESTINATION include/gio) +install(FILES gio/gresource.h DESTINATION include/gio) +install(FILES gio/gseekable.h DESTINATION include/gio) +install(FILES gio/gsimpleasyncresult.h DESTINATION include/gio) +install(FILES gio/gsimpleiostream.h DESTINATION include/gio) +install(FILES gio/gsimplepermission.h DESTINATION include/gio) +install(FILES gio/gsocket.h DESTINATION include/gio) +install(FILES gio/gsocketaddress.h DESTINATION include/gio) +install(FILES gio/gsocketaddressenumerator.h DESTINATION include/gio) +install(FILES gio/gsocketclient.h DESTINATION include/gio) +install(FILES gio/gsocketconnectable.h DESTINATION include/gio) +install(FILES gio/gsocketconnection.h DESTINATION include/gio) +install(FILES gio/gsocketcontrolmessage.h DESTINATION include/gio) +install(FILES gio/gsocketlistener.h DESTINATION include/gio) +install(FILES gio/gsocketservice.h DESTINATION include/gio) +install(FILES gio/gsrvtarget.h DESTINATION include/gio) +install(FILES gio/gsimpleproxyresolver.h DESTINATION include/gio) +install(FILES gio/gtask.h DESTINATION include/gio) +install(FILES gio/gsubprocess.h DESTINATION include/gio) +install(FILES gio/gsubprocesslauncher.h DESTINATION include/gio) +install(FILES gio/gtcpconnection.h DESTINATION include/gio) +install(FILES gio/gtcpwrapperconnection.h DESTINATION include/gio) +install(FILES gio/gthreadedsocketservice.h DESTINATION include/gio) +install(FILES gio/gthemedicon.h DESTINATION include/gio) +install(FILES gio/gtlsbackend.h DESTINATION include/gio) +install(FILES gio/gtlscertificate.h DESTINATION include/gio) +install(FILES gio/gtlsclientconnection.h DESTINATION include/gio) +install(FILES gio/gtlsconnection.h DESTINATION include/gio) +install(FILES gio/gtlsdatabase.h DESTINATION include/gio) +install(FILES gio/gtlsfiledatabase.h DESTINATION include/gio) +install(FILES gio/gtlsinteraction.h DESTINATION include/gio) +install(FILES gio/gtlspassword.h DESTINATION include/gio) +install(FILES gio/gtlsserverconnection.h DESTINATION include/gio) +install(FILES gio/gdtlsconnection.h DESTINATION include/gio) +install(FILES gio/gdtlsclientconnection.h DESTINATION include/gio) +install(FILES gio/gdtlsserverconnection.h DESTINATION include/gio) +install(FILES gio/gvfs.h DESTINATION include/gio) +install(FILES gio/gvolume.h DESTINATION include/gio) +install(FILES gio/gvolumemonitor.h DESTINATION include/gio) +install(FILES gio/gzlibcompressor.h DESTINATION include/gio) +install(FILES gio/gzlibdecompressor.h DESTINATION include/gio) +install(FILES gio/glistmodel.h DESTINATION include/gio) +install(FILES gio/gliststore.h DESTINATION include/gio) +install(FILES gio/gapplication.h DESTINATION include/gio) +install(FILES gio/gapplicationcommandline.h DESTINATION include/gio) +install(FILES gio/gactiongroup.h DESTINATION include/gio) +install(FILES gio/gactionmap.h DESTINATION include/gio) +install(FILES gio/gsimpleactiongroup.h DESTINATION include/gio) +install(FILES gio/gremoteactiongroup.h DESTINATION include/gio) +install(FILES gio/gactiongroupexporter.h DESTINATION include/gio) +install(FILES gio/gdbusactiongroup.h DESTINATION include/gio) +install(FILES gio/gaction.h DESTINATION include/gio) +install(FILES gio/gpropertyaction.h DESTINATION include/gio) +install(FILES gio/gsimpleaction.h DESTINATION include/gio) +install(FILES gio/gmenumodel.h DESTINATION include/gio) +install(FILES gio/gmenu.h DESTINATION include/gio) +install(FILES gio/gmenuexporter.h DESTINATION include/gio) +install(FILES gio/gdbusmenumodel.h DESTINATION include/gio) +install(FILES gio/gnotification.h DESTINATION include/gio) +install(FILES gio/gsettingsbackend.h DESTINATION include/gio) +install(FILES gio/gsettingsschema.h DESTINATION include/gio) +install(FILES gio/gsettings.h DESTINATION include/gio) +install(FILES gio/gdbusauthobserver.h DESTINATION include/gio) +install(FILES gio/gcredentials.h DESTINATION include/gio) +install(FILES gio/gdbusutils.h DESTINATION include/gio) +install(FILES gio/gdbuserror.h DESTINATION include/gio) +install(FILES gio/gdbusaddress.h DESTINATION include/gio) +install(FILES gio/gdbusconnection.h DESTINATION include/gio) +install(FILES gio/gdbusmessage.h DESTINATION include/gio) +install(FILES gio/gdbusnameowning.h DESTINATION include/gio) +install(FILES gio/gdbusnamewatching.h DESTINATION include/gio) +install(FILES gio/gdbusproxy.h DESTINATION include/gio) +install(FILES gio/gdbusintrospection.h DESTINATION include/gio) +install(FILES gio/gdbusmethodinvocation.h DESTINATION include/gio) +install(FILES gio/gdbusserver.h DESTINATION include/gio) +install(FILES gio/gdbusinterface.h DESTINATION include/gio) +install(FILES gio/gdbusinterfaceskeleton.h DESTINATION include/gio) +install(FILES gio/gdbusobject.h DESTINATION include/gio) +install(FILES gio/gdbusobjectskeleton.h DESTINATION include/gio) +install(FILES gio/gdbusobjectproxy.h DESTINATION include/gio) +install(FILES gio/gdbusobjectmanager.h DESTINATION include/gio) +install(FILES gio/gdbusobjectmanagerclient.h DESTINATION include/gio) +install(FILES gio/gdbusobjectmanagerserver.h DESTINATION include/gio) +install(FILES gio/gtestdbus.h DESTINATION include/gio) +install(FILES gio/gioenumtypes.h DESTINATION include/gio) +install(FILES gio/gnetworking.h DESTINATION include/gio) +install(FILES gio/gwin32inputstream.h DESTINATION include/gio) +install(FILES gio/gwin32outputstream.h DESTINATION include/gio) diff --git a/ports/glib/portfile.cmake b/ports/glib/portfile.cmake new file mode 100644 index 000000000..c835d8482 --- /dev/null +++ b/ports/glib/portfile.cmake @@ -0,0 +1,32 @@ + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/glib-2.50.2) +vcpkg_download_distfile(ARCHIVE + URLS "https://ftp.gnome.org/pub/gnome/sources/glib/2.50/glib-2.50.2.tar.xz" + FILENAME "glib-2.50.2.tar.xz" + SHA512 63d7b5ece8d7d15b10e06ef10a8e0a4446f30a8d9c97daa3352ec00dfef622728bd42ed24cbf67e553166a0f9e29a3e3d024d1d085b9804fd67608db438b6771) + +vcpkg_extract_source_archive(${ARCHIVE}) +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/use-libiconv-on-windows.patch) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/cmake DESTINATION ${SOURCE_PATH}) +file(REMOVE_RECURSE ${SOURCE_PATH}/glib/pcre) +file(REMOVE ${SOURCE_PATH}/glib/win_iconv.c) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS_DEBUG + -DGLIB_SKIP_HEADERS=ON + -DGLIB_SKIP_TOOLS=ON) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() +vcpkg_copy_tool_dependencies() + +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/glib) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/glib/COPYING ${CURRENT_PACKAGES_DIR}/share/glib/copyright) + diff --git a/ports/glib/use-libiconv-on-windows.patch b/ports/glib/use-libiconv-on-windows.patch new file mode 100644 index 000000000..927de0bb1 --- /dev/null +++ b/ports/glib/use-libiconv-on-windows.patch @@ -0,0 +1,14 @@ +diff --git a/glib/gconvert.c b/glib/gconvert.c +index 3deac78..134ded9 100644 +--- a/glib/gconvert.c ++++ b/glib/gconvert.c +@@ -30,7 +30,8 @@ + #include + + #ifdef G_OS_WIN32 +-#include "win_iconv.c" ++#define USE_LIBICONV_GNU ++#include + #endif + + #ifdef G_PLATFORM_WIN32 diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake index ff1fae953..6e60bf2bc 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -11,3 +11,4 @@ include(vcpkg_configure_cmake) include(vcpkg_configure_qmake) include(vcpkg_apply_patches) include(vcpkg_copy_pdbs) +include(vcpkg_copy_tool_dependencies) diff --git a/scripts/cmake/vcpkg_copy_tool_dependencies.cmake b/scripts/cmake/vcpkg_copy_tool_dependencies.cmake new file mode 100644 index 000000000..d8de15207 --- /dev/null +++ b/scripts/cmake/vcpkg_copy_tool_dependencies.cmake @@ -0,0 +1,16 @@ +# Copy dlls for all tools in ${CURRENT_PACKAGES_DIR}/tools + +function(vcpkg_copy_tool_dependencies) + macro(search_for_dependencies PATH_TO_SEARCH) + file(GLOB TOOLS ${CURRENT_PACKAGES_DIR}/tools/*.exe ${CURRENT_PACKAGES_DIR}/tools/*.dll) + foreach(TOOL ${TOOLS}) + execute_process(COMMAND powershell -noprofile -executionpolicy UnRestricted -nologo + -file ${VCPKG_ROOT_DIR}/scripts/buildsystems/msbuild/applocal.ps1 + -targetBinary ${TOOL} + -installedDir ${PATH_TO_SEARCH} + OUTPUT_VARIABLE OUT) + endforeach() + endmacro() + search_for_dependencies(${CURRENT_PACKAGES_DIR}/bin) + search_for_dependencies(${CURRENT_INSTALLED_DIR}/bin) +endfunction() -- cgit v1.2.3 From 912278d22d497ce344e78cb128ba4930c2ee7f55 Mon Sep 17 00:00:00 2001 From: codicodi Date: Wed, 11 Jan 2017 21:36:21 +0100 Subject: [glib] check settings --- ports/glib/portfile.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ports/glib/portfile.cmake b/ports/glib/portfile.cmake index c835d8482..d1777de1d 100644 --- a/ports/glib/portfile.cmake +++ b/ports/glib/portfile.cmake @@ -1,3 +1,13 @@ + # Glib uses winapi functions not available in WindowsStore +if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore) + message(FATAL_ERROR "Error: UWP builds are currently not supported.") +endif() + +# Glib relies on DllMain +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(STATUS "Warning: Static building not supported. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) +endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/glib-2.50.2) -- cgit v1.2.3 From f4622dce99378894b71c07e7fe989480981b5d56 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 11 Jan 2017 20:54:25 -0800 Subject: [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) -- cgit v1.2.3 From 8e57be16161fca1da94cc9faacb3d4bfaef2c6ec Mon Sep 17 00:00:00 2001 From: ab Date: Thu, 12 Jan 2017 12:28:08 +0100 Subject: 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 -- cgit v1.2.3 From 2f92128e7fa4a56ed0f0e84ed55c344a9b193ab0 Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Thu, 12 Jan 2017 09:20:32 -0800 Subject: 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 -- cgit v1.2.3 From e4b1551988487059fcc0081bd86aaf7353044312 Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Thu, 12 Jan 2017 12:12:45 -0800 Subject: 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} -- cgit v1.2.3 From 30429e68db721f542abf153293b49822c107870e Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Thu, 12 Jan 2017 12:35:24 -0800 Subject: 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() -- cgit v1.2.3 From 41eba85b32193ed3e75d9c6b48c5fdccfdf000a7 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 12 Jan 2017 16:48:51 -0800 Subject: [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 -- cgit v1.2.3 From 5082ea5464f6f816be4fd96270a6faa142b10fb0 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 12 Jan 2017 17:09:45 -0800 Subject: [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 -- cgit v1.2.3 From 963cc56a8cec42a6ed185d78d6a5585272ba2d63 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 12 Jan 2017 17:26:04 -0800 Subject: [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 -- cgit v1.2.3 From 6a4ec92a90849e7cc343bbc8673ce0f063ffd939 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 12 Jan 2017 17:03:21 -0800 Subject: 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 + -- cgit v1.2.3 From 30587111d362bc8c2e0b700549d0fe7d62b9193d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 12 Jan 2017 17:04:32 -0800 Subject: Rename commands_installation to commands_install Names should match the command --- toolsrc/src/commands_install.cpp | 241 ++++++++++++++++++++++++++++++++++ toolsrc/src/commands_installation.cpp | 241 ---------------------------------- toolsrc/vcpkg/vcpkg.vcxproj | 2 +- toolsrc/vcpkg/vcpkg.vcxproj.filters | 6 +- 4 files changed, 245 insertions(+), 245 deletions(-) create mode 100644 toolsrc/src/commands_install.cpp delete mode 100644 toolsrc/src/commands_installation.cpp diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp new file mode 100644 index 000000000..f44852930 --- /dev/null +++ b/toolsrc/src/commands_install.cpp @@ -0,0 +1,241 @@ +#include "vcpkg_Commands.h" +#include "vcpkg.h" +#include "vcpkg_Environment.h" +#include "metrics.h" +#include "vcpkg_Files.h" +#include "vcpkg_System.h" +#include "vcpkg_Dependencies.h" +#include "vcpkg_Input.h" + +namespace vcpkg +{ + using Dependencies::package_spec_with_install_plan; + using Dependencies::install_plan_type; + + static void install_and_write_listfile(const vcpkg_paths& paths, const BinaryParagraph& bpgh) + { + std::vector output; + + const fs::path package_prefix_path = paths.package_dir(bpgh.spec); + const size_t prefix_length = package_prefix_path.native().size(); + + const triplet& target_triplet = bpgh.spec.target_triplet(); + const std::string& target_triplet_as_string = target_triplet.canonical_name(); + std::error_code ec; + fs::create_directory(paths.installed / target_triplet_as_string, ec); + output.push_back(Strings::format(R"(%s)", target_triplet_as_string)); + + for (auto it = fs::recursive_directory_iterator(package_prefix_path); it != fs::recursive_directory_iterator(); ++it) + { + const std::string filename = it->path().filename().generic_string(); + if (fs::is_regular_file(it->status()) && (_stricmp(filename.c_str(), "CONTROL") == 0 || _stricmp(filename.c_str(), "BUILD_INFO") == 0)) + { + // Do not copy the control file + continue; + } + + const std::string suffix = it->path().generic_u8string().substr(prefix_length + 1); + const fs::path target = paths.installed / target_triplet_as_string / suffix; + + auto status = it->status(ec); + if (ec) + { + System::println(System::color::error, "failed: %s: %s", it->path().u8string(), ec.message()); + continue; + } + + if (fs::is_directory(status)) + { + fs::create_directory(target, ec); + if (ec) + { + System::println(System::color::error, "failed: %s: %s", target.u8string(), ec.message()); + } + + // Trailing backslash for directories + output.push_back(Strings::format(R"(%s/%s)", target_triplet_as_string, suffix)); + continue; + } + + if (fs::is_regular_file(status)) + { + if (fs::exists(target)) + { + System::println(System::color::warning, "File %s was already present and will be overwritten", target.u8string(), ec.message()); + } + fs::copy_file(*it, target, fs::copy_options::overwrite_existing, ec); + if (ec) + { + System::println(System::color::error, "failed: %s: %s", target.u8string(), ec.message()); + } + output.push_back(Strings::format(R"(%s/%s)", target_triplet_as_string, suffix)); + continue; + } + + if (!fs::status_known(status)) + { + System::println(System::color::error, "failed: %s: unknown status", it->path().u8string()); + continue; + } + + System::println(System::color::error, "failed: %s: cannot handle file type", it->path().u8string()); + } + + Files::write_all_lines(paths.listfile_path(bpgh), output); + } + + static void remove_first_n_chars(std::vector* strings, const size_t n) + { + for (std::string& s : *strings) + { + s.erase(0, n); + } + }; + + static std::vector extract_files_in_triplet(const std::vector& pgh_and_files, const triplet& triplet) + { + std::vector output; + for (const StatusParagraph_and_associated_files& t : pgh_and_files) + { + if (t.pgh.package.spec.target_triplet() != triplet) + { + continue; + } + + output.insert(output.end(), t.files.cbegin(), t.files.cend()); + } + + std::sort(output.begin(), output.end()); + return output; + } + + static ImmutableSortedVector build_list_of_package_files(const fs::path& package_dir) + { + const std::vector package_file_paths = Files::recursive_find_all_files_in_dir(package_dir); + std::vector package_files; + const size_t package_remove_char_count = package_dir.generic_string().size() + 1; // +1 for the slash + std::transform(package_file_paths.cbegin(), package_file_paths.cend(), std::back_inserter(package_files), [package_remove_char_count](const fs::path& path) + { + std::string as_string = path.generic_string(); + as_string.erase(0, package_remove_char_count); + return std::move(as_string); + }); + + return ImmutableSortedVector::create(std::move(package_files)); + } + + static ImmutableSortedVector build_list_of_installed_files(const std::vector& pgh_and_files, const triplet& triplet) + { + std::vector installed_files = extract_files_in_triplet(pgh_and_files, triplet); + const size_t installed_remove_char_count = triplet.canonical_name().size() + 1; // +1 for the slash + remove_first_n_chars(&installed_files, installed_remove_char_count); + + return ImmutableSortedVector::create(std::move(installed_files)); + } + + void install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs& status_db) + { + const fs::path package_dir = paths.package_dir(binary_paragraph.spec); + const triplet& triplet = binary_paragraph.spec.target_triplet(); + const std::vector pgh_and_files = get_installed_files(paths, status_db); + + const ImmutableSortedVector package_files = build_list_of_package_files(package_dir); + const ImmutableSortedVector installed_files = build_list_of_installed_files(pgh_and_files, triplet); + + std::vector intersection; + std::set_intersection(package_files.cbegin(), package_files.cend(), + installed_files.cbegin(), installed_files.cend(), + std::back_inserter(intersection)); + + if (!intersection.empty()) + { + const fs::path triplet_install_path = paths.installed / triplet.canonical_name(); + System::println(System::color::error, "The following files are already installed in %s and are in conflict with %s", + triplet_install_path.generic_string(), + binary_paragraph.spec); + System::println(""); + for (const std::string& s : intersection) + { + System::println(" %s", s); + } + System::println(""); + exit(EXIT_FAILURE); + } + + StatusParagraph spgh; + spgh.package = binary_paragraph; + spgh.want = want_t::install; + spgh.state = install_state_t::half_installed; + for (auto&& dep : spgh.package.depends) + { + if (status_db.find_installed(dep, spgh.package.spec.target_triplet()) == status_db.end()) + { + Checks::unreachable(); + } + } + write_update(paths, spgh); + status_db.insert(std::make_unique(spgh)); + + install_and_write_listfile(paths, spgh.package); + + spgh.state = install_state_t::installed; + write_update(paths, spgh); + status_db.insert(std::make_unique(spgh)); + } + + 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"); + args.check_min_arg_count(1, example); + StatusParagraphs status_db = database_load_check(paths); + + std::vector specs = Input::check_and_get_package_specs(args.command_arguments, default_target_triplet, example); + Input::check_triplets(specs, paths); + std::vector install_plan = Dependencies::create_install_plan(paths, specs, status_db); + Checks::check_exit(!install_plan.empty(), "Install plan cannot be empty"); + + std::string specs_string = to_string(install_plan[0].spec); + for (size_t i = 1; i < install_plan.size(); ++i) + { + specs_string.push_back(','); + specs_string.append(to_string(install_plan[i].spec)); + } + TrackProperty("installplan", specs_string); + Environment::ensure_utilities_on_path(paths); + + for (const package_spec_with_install_plan& action : install_plan) + { + try + { + if (action.plan.type == install_plan_type::ALREADY_INSTALLED) + { + if (std::find(specs.begin(), specs.end(), action.spec) != specs.end()) + { + System::println(System::color::success, "Package %s is already installed", action.spec); + } + } + 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)); + 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); + } + else if (action.plan.type == install_plan_type::INSTALL) + { + install_package(paths, *action.plan.bpgh, status_db); + System::println(System::color::success, "Package %s is installed", action.spec); + } + else + Checks::unreachable(); + } + catch (const std::exception& e) + { + System::println(System::color::error, "Error: Could not install package %s: %s", action.spec, e.what()); + exit(EXIT_FAILURE); + } + } + + exit(EXIT_SUCCESS); + } +} diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_installation.cpp deleted file mode 100644 index f44852930..000000000 --- a/toolsrc/src/commands_installation.cpp +++ /dev/null @@ -1,241 +0,0 @@ -#include "vcpkg_Commands.h" -#include "vcpkg.h" -#include "vcpkg_Environment.h" -#include "metrics.h" -#include "vcpkg_Files.h" -#include "vcpkg_System.h" -#include "vcpkg_Dependencies.h" -#include "vcpkg_Input.h" - -namespace vcpkg -{ - using Dependencies::package_spec_with_install_plan; - using Dependencies::install_plan_type; - - static void install_and_write_listfile(const vcpkg_paths& paths, const BinaryParagraph& bpgh) - { - std::vector output; - - const fs::path package_prefix_path = paths.package_dir(bpgh.spec); - const size_t prefix_length = package_prefix_path.native().size(); - - const triplet& target_triplet = bpgh.spec.target_triplet(); - const std::string& target_triplet_as_string = target_triplet.canonical_name(); - std::error_code ec; - fs::create_directory(paths.installed / target_triplet_as_string, ec); - output.push_back(Strings::format(R"(%s)", target_triplet_as_string)); - - for (auto it = fs::recursive_directory_iterator(package_prefix_path); it != fs::recursive_directory_iterator(); ++it) - { - const std::string filename = it->path().filename().generic_string(); - if (fs::is_regular_file(it->status()) && (_stricmp(filename.c_str(), "CONTROL") == 0 || _stricmp(filename.c_str(), "BUILD_INFO") == 0)) - { - // Do not copy the control file - continue; - } - - const std::string suffix = it->path().generic_u8string().substr(prefix_length + 1); - const fs::path target = paths.installed / target_triplet_as_string / suffix; - - auto status = it->status(ec); - if (ec) - { - System::println(System::color::error, "failed: %s: %s", it->path().u8string(), ec.message()); - continue; - } - - if (fs::is_directory(status)) - { - fs::create_directory(target, ec); - if (ec) - { - System::println(System::color::error, "failed: %s: %s", target.u8string(), ec.message()); - } - - // Trailing backslash for directories - output.push_back(Strings::format(R"(%s/%s)", target_triplet_as_string, suffix)); - continue; - } - - if (fs::is_regular_file(status)) - { - if (fs::exists(target)) - { - System::println(System::color::warning, "File %s was already present and will be overwritten", target.u8string(), ec.message()); - } - fs::copy_file(*it, target, fs::copy_options::overwrite_existing, ec); - if (ec) - { - System::println(System::color::error, "failed: %s: %s", target.u8string(), ec.message()); - } - output.push_back(Strings::format(R"(%s/%s)", target_triplet_as_string, suffix)); - continue; - } - - if (!fs::status_known(status)) - { - System::println(System::color::error, "failed: %s: unknown status", it->path().u8string()); - continue; - } - - System::println(System::color::error, "failed: %s: cannot handle file type", it->path().u8string()); - } - - Files::write_all_lines(paths.listfile_path(bpgh), output); - } - - static void remove_first_n_chars(std::vector* strings, const size_t n) - { - for (std::string& s : *strings) - { - s.erase(0, n); - } - }; - - static std::vector extract_files_in_triplet(const std::vector& pgh_and_files, const triplet& triplet) - { - std::vector output; - for (const StatusParagraph_and_associated_files& t : pgh_and_files) - { - if (t.pgh.package.spec.target_triplet() != triplet) - { - continue; - } - - output.insert(output.end(), t.files.cbegin(), t.files.cend()); - } - - std::sort(output.begin(), output.end()); - return output; - } - - static ImmutableSortedVector build_list_of_package_files(const fs::path& package_dir) - { - const std::vector package_file_paths = Files::recursive_find_all_files_in_dir(package_dir); - std::vector package_files; - const size_t package_remove_char_count = package_dir.generic_string().size() + 1; // +1 for the slash - std::transform(package_file_paths.cbegin(), package_file_paths.cend(), std::back_inserter(package_files), [package_remove_char_count](const fs::path& path) - { - std::string as_string = path.generic_string(); - as_string.erase(0, package_remove_char_count); - return std::move(as_string); - }); - - return ImmutableSortedVector::create(std::move(package_files)); - } - - static ImmutableSortedVector build_list_of_installed_files(const std::vector& pgh_and_files, const triplet& triplet) - { - std::vector installed_files = extract_files_in_triplet(pgh_and_files, triplet); - const size_t installed_remove_char_count = triplet.canonical_name().size() + 1; // +1 for the slash - remove_first_n_chars(&installed_files, installed_remove_char_count); - - return ImmutableSortedVector::create(std::move(installed_files)); - } - - void install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs& status_db) - { - const fs::path package_dir = paths.package_dir(binary_paragraph.spec); - const triplet& triplet = binary_paragraph.spec.target_triplet(); - const std::vector pgh_and_files = get_installed_files(paths, status_db); - - const ImmutableSortedVector package_files = build_list_of_package_files(package_dir); - const ImmutableSortedVector installed_files = build_list_of_installed_files(pgh_and_files, triplet); - - std::vector intersection; - std::set_intersection(package_files.cbegin(), package_files.cend(), - installed_files.cbegin(), installed_files.cend(), - std::back_inserter(intersection)); - - if (!intersection.empty()) - { - const fs::path triplet_install_path = paths.installed / triplet.canonical_name(); - System::println(System::color::error, "The following files are already installed in %s and are in conflict with %s", - triplet_install_path.generic_string(), - binary_paragraph.spec); - System::println(""); - for (const std::string& s : intersection) - { - System::println(" %s", s); - } - System::println(""); - exit(EXIT_FAILURE); - } - - StatusParagraph spgh; - spgh.package = binary_paragraph; - spgh.want = want_t::install; - spgh.state = install_state_t::half_installed; - for (auto&& dep : spgh.package.depends) - { - if (status_db.find_installed(dep, spgh.package.spec.target_triplet()) == status_db.end()) - { - Checks::unreachable(); - } - } - write_update(paths, spgh); - status_db.insert(std::make_unique(spgh)); - - install_and_write_listfile(paths, spgh.package); - - spgh.state = install_state_t::installed; - write_update(paths, spgh); - status_db.insert(std::make_unique(spgh)); - } - - 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"); - args.check_min_arg_count(1, example); - StatusParagraphs status_db = database_load_check(paths); - - std::vector specs = Input::check_and_get_package_specs(args.command_arguments, default_target_triplet, example); - Input::check_triplets(specs, paths); - std::vector install_plan = Dependencies::create_install_plan(paths, specs, status_db); - Checks::check_exit(!install_plan.empty(), "Install plan cannot be empty"); - - std::string specs_string = to_string(install_plan[0].spec); - for (size_t i = 1; i < install_plan.size(); ++i) - { - specs_string.push_back(','); - specs_string.append(to_string(install_plan[i].spec)); - } - TrackProperty("installplan", specs_string); - Environment::ensure_utilities_on_path(paths); - - for (const package_spec_with_install_plan& action : install_plan) - { - try - { - if (action.plan.type == install_plan_type::ALREADY_INSTALLED) - { - if (std::find(specs.begin(), specs.end(), action.spec) != specs.end()) - { - System::println(System::color::success, "Package %s is already installed", action.spec); - } - } - 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)); - 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); - } - else if (action.plan.type == install_plan_type::INSTALL) - { - install_package(paths, *action.plan.bpgh, status_db); - System::println(System::color::success, "Package %s is installed", action.spec); - } - else - Checks::unreachable(); - } - catch (const std::exception& e) - { - System::println(System::color::error, "Error: Could not install package %s: %s", action.spec, e.what()); - exit(EXIT_FAILURE); - } - } - - exit(EXIT_SUCCESS); - } -} 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 + -- cgit v1.2.3 From 4c51e65d5004311c7c7ba0687e7dba934ba986c1 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 12 Jan 2017 17:05:20 -0800 Subject: Rename commands_integration.cpp to commands_integrate.cpp Filename should match the command name --- toolsrc/src/commands_integrate.cpp | 318 +++++++++++++++++++++++++++++++++++ toolsrc/src/commands_integration.cpp | 318 ----------------------------------- toolsrc/vcpkg/vcpkg.vcxproj | 2 +- toolsrc/vcpkg/vcpkg.vcxproj.filters | 6 +- 4 files changed, 322 insertions(+), 322 deletions(-) create mode 100644 toolsrc/src/commands_integrate.cpp delete mode 100644 toolsrc/src/commands_integration.cpp diff --git a/toolsrc/src/commands_integrate.cpp b/toolsrc/src/commands_integrate.cpp new file mode 100644 index 000000000..e7e5b2d8d --- /dev/null +++ b/toolsrc/src/commands_integrate.cpp @@ -0,0 +1,318 @@ +#define WIN32_LEAN_AND_MEAN +#include +#include +#include "vcpkg_Commands.h" +#include +#include +#include +#include "vcpkg_Environment.h" +#include "vcpkg_Checks.h" +#include "vcpkg_System.h" +#include "vcpkg_Files.h" + +namespace vcpkg +{ + static const std::array old_system_target_files = { + "C:/Program Files (x86)/MSBuild/14.0/Microsoft.Common.Targets/ImportBefore/vcpkg.nuget.targets", + "C:/Program Files (x86)/MSBuild/14.0/Microsoft.Common.Targets/ImportBefore/vcpkg.system.targets" + }; + static const fs::path system_wide_targets_file = "C:/Program Files (x86)/MSBuild/Microsoft.Cpp/v4.0/V140/ImportBefore/Default/vcpkg.system.props"; + + static std::string create_appdata_targets_shortcut(const std::string& target_path) noexcept + { + return Strings::format(R"###( + + + +)###", target_path, target_path); + } + + static std::string create_system_targets_shortcut() noexcept + { + return R"###( + + + + $(LOCALAPPDATA)\vcpkg\vcpkg.user + + + +)###"; + } + + static std::string create_nuget_targets_file(const fs::path& msbuild_vcpkg_targets_file) noexcept + { + const std::string as_string = msbuild_vcpkg_targets_file.string(); + + return Strings::format(R"###( + + + + + + +)###", as_string, as_string); + } + + static std::string create_nuget_props_file() noexcept + { + return R"###( + + + true + + +)###"; + } + + static std::string get_nuget_id(const fs::path& vcpkg_root_dir) + { + std::string dir_id = vcpkg_root_dir.generic_string(); + std::replace(dir_id.begin(), dir_id.end(), '/', '.'); + dir_id.erase(1, 1); // Erasing the ":" + + // NuGet id cannot have invalid characters. We will only use alphanumeric and dot. + dir_id.erase(std::remove_if(dir_id.begin(), dir_id.end(), [](char c) + { + return !isalnum(c) && (c != '.'); + }), dir_id.end()); + + const std::string nuget_id = "vcpkg." + dir_id; + return nuget_id; + } + + static std::string create_nuspec_file(const fs::path& vcpkg_root_dir, const std::string& nuget_id, const std::string& nupkg_version) + { + const std::string nuspec_file_content_template = R"( + + + @NUGET_ID@ + @VERSION@ + cpp-packages + + This package imports all libraries currently installed in @VCPKG_DIR@. This package does not contain any libraries and instead refers to the folder directly (like a symlink). + + + + + + + +)"; + + std::string nuspec_file_content = std::regex_replace(nuspec_file_content_template, std::regex("@NUGET_ID@"), nuget_id); + nuspec_file_content = std::regex_replace(nuspec_file_content, std::regex("@VCPKG_DIR@"), vcpkg_root_dir.string()); + nuspec_file_content = std::regex_replace(nuspec_file_content, std::regex("@VERSION@"), nupkg_version); + return nuspec_file_content; + } + + enum class elevation_prompt_user_choice + { + yes, + no + }; + + static elevation_prompt_user_choice elevated_cmd_execute(const std::string& param) + { + SHELLEXECUTEINFO shExInfo = {0}; + shExInfo.cbSize = sizeof(shExInfo); + shExInfo.fMask = SEE_MASK_NOCLOSEPROCESS; + shExInfo.hwnd = nullptr; + shExInfo.lpVerb = "runas"; + shExInfo.lpFile = "cmd"; // Application to start + + shExInfo.lpParameters = param.c_str(); // Additional parameters + shExInfo.lpDirectory = nullptr; + shExInfo.nShow = SW_HIDE; + shExInfo.hInstApp = nullptr; + + if (!ShellExecuteExA(&shExInfo)) + { + return elevation_prompt_user_choice::no; + } + if (shExInfo.hProcess == nullptr) + { + return elevation_prompt_user_choice::no; + } + WaitForSingleObject(shExInfo.hProcess, INFINITE); + CloseHandle(shExInfo.hProcess); + return elevation_prompt_user_choice::yes; + } + + static fs::path get_appdata_targets_path() + { + return fs::path(System::wdupenv_str(L"LOCALAPPDATA")) / "vcpkg" / "vcpkg.user.targets"; + } + + static void integrate_install(const vcpkg_paths& paths) + { + // TODO: This block of code should eventually be removed + for (auto&& old_system_wide_targets_file : old_system_target_files) + { + if (fs::exists(old_system_wide_targets_file)) + { + const std::string param = Strings::format(R"(/c DEL "%s" /Q > nul)", old_system_wide_targets_file.string()); + elevation_prompt_user_choice user_choice = elevated_cmd_execute(param); + switch (user_choice) + { + case elevation_prompt_user_choice::yes: + break; + case elevation_prompt_user_choice::no: + System::println(System::color::warning, "Warning: Previous integration file was not removed"); + exit(EXIT_FAILURE); + default: + Checks::unreachable(); + } + } + } + + const fs::path tmp_dir = paths.buildsystems / "tmp"; + fs::create_directory(paths.buildsystems); + fs::create_directory(tmp_dir); + + bool should_install_system = true; + if (fs::exists(system_wide_targets_file)) + { + auto system_wide_file_contents = Files::read_contents(system_wide_targets_file); + if (auto contents_data = system_wide_file_contents.get()) + { + std::regex re(R"###()###"); + std::match_results match; + auto found = std::regex_search(*contents_data, match, re); + if (found) + { + int ver = atoi(match[1].str().c_str()); + if (ver >= 1) + should_install_system = false; + } + } + } + + if (should_install_system) + { + const fs::path sys_src_path = tmp_dir / "vcpkg.system.targets"; + std::ofstream(sys_src_path) << create_system_targets_shortcut(); + + const std::string param = Strings::format(R"(/c mkdir "%s" & copy "%s" "%s" /Y > nul)", system_wide_targets_file.parent_path().string(), sys_src_path.string(), system_wide_targets_file.string()); + elevation_prompt_user_choice user_choice = elevated_cmd_execute(param); + switch (user_choice) + { + case elevation_prompt_user_choice::yes: + break; + case elevation_prompt_user_choice::no: + System::println(System::color::warning, "Warning: integration was not applied"); + exit(EXIT_FAILURE); + default: + Checks::unreachable(); + } + + Checks::check_exit(fs::exists(system_wide_targets_file), "Error: failed to copy targets file to %s", system_wide_targets_file.string()); + } + + const fs::path appdata_src_path = tmp_dir / "vcpkg.user.targets"; + std::ofstream(appdata_src_path) << create_appdata_targets_shortcut(paths.buildsystems_msbuild_targets.string()); + auto appdata_dst_path = get_appdata_targets_path(); + + if (!fs::copy_file(appdata_src_path, appdata_dst_path, fs::copy_options::overwrite_existing)) + { + System::println(System::color::error, "Error: Failed to copy file: %s -> %s", appdata_src_path.string(), appdata_dst_path.string()); + exit(EXIT_FAILURE); + } + System::println(System::color::success, "Applied user-wide integration for this vcpkg root."); + System::println("\n" + "All C++ projects can now #include any installed libraries.\n" + "Linking will be handled automatically.\n" + "Installing new libraries will make them instantly available."); + + exit(EXIT_SUCCESS); + } + + static void integrate_remove() + { + auto path = get_appdata_targets_path(); + if (!fs::exists(path)) + { + System::println(System::color::success, "User-wide integration is not installed"); + exit(EXIT_SUCCESS); + } + + const std::wstring cmd_line = Strings::wformat(LR"(DEL "%s")", get_appdata_targets_path().native()); + const int exit_code = System::cmd_execute(cmd_line); + if (exit_code) + { + System::println(System::color::error, "Error: Unable to remove user-wide integration: %d", exit_code); + exit(exit_code); + } + System::println(System::color::success, "User-wide integration was removed"); + exit(EXIT_SUCCESS); + } + + static void integrate_project(const vcpkg_paths& paths) + { + Environment::ensure_nuget_on_path(paths); + + const fs::path& buildsystems_dir = paths.buildsystems; + const fs::path tmp_dir = buildsystems_dir / "tmp"; + fs::create_directory(buildsystems_dir); + fs::create_directory(tmp_dir); + + const fs::path targets_file_path = tmp_dir / "vcpkg.nuget.targets"; + const fs::path props_file_path = tmp_dir / "vcpkg.nuget.props"; + const fs::path nuspec_file_path = tmp_dir / "vcpkg.nuget.nuspec"; + const std::string nuget_id = get_nuget_id(paths.root); + const std::string nupkg_version = "1.0.0"; + + std::ofstream(targets_file_path) << create_nuget_targets_file(paths.buildsystems_msbuild_targets); + std::ofstream(props_file_path) << create_nuget_props_file(); + std::ofstream(nuspec_file_path) << create_nuspec_file(paths.root, nuget_id, nupkg_version); + + // Using all forward slashes for the command line + const std::wstring cmd_line = Strings::wformat(LR"(nuget.exe pack -OutputDirectory "%s" "%s" > nul)", buildsystems_dir.native(), nuspec_file_path.native()); + + const int exit_code = System::cmd_execute(cmd_line); + + const fs::path nuget_package = buildsystems_dir / Strings::format("%s.%s.nupkg", nuget_id, nupkg_version); + if (exit_code != 0 || !fs::exists(nuget_package)) + { + System::println(System::color::error, "Error: NuGet package creation failed"); + exit(EXIT_FAILURE); + } + + System::println(System::color::success, "Created nupkg: %s", nuget_package.string()); + + System::println(R"( +With a project open, go to Tools->NuGet Package Manager->Package Manager Console and paste: + Install-Package %s -Source "%s" +)", nuget_id, buildsystems_dir.generic_string()); + + exit(EXIT_SUCCESS); + } + + const char* const INTEGRATE_COMMAND_HELPSTRING = + " vcpkg integrate install Make installed packages available user-wide. Requires admin privileges on first use\n" + " 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) + { + static const std::string example = Strings::format("Commands:\n" + "%s", INTEGRATE_COMMAND_HELPSTRING); + args.check_exact_arg_count(1, example); + + if (args.command_arguments[0] == "install") + { + return integrate_install(paths); + } + if (args.command_arguments[0] == "remove") + { + return integrate_remove(); + } + if (args.command_arguments[0] == "project") + { + return integrate_project(paths); + } + + System::println(System::color::error, "Unknown parameter %s for integrate", args.command_arguments[0]); + exit(EXIT_FAILURE); + } +} diff --git a/toolsrc/src/commands_integration.cpp b/toolsrc/src/commands_integration.cpp deleted file mode 100644 index e7e5b2d8d..000000000 --- a/toolsrc/src/commands_integration.cpp +++ /dev/null @@ -1,318 +0,0 @@ -#define WIN32_LEAN_AND_MEAN -#include -#include -#include "vcpkg_Commands.h" -#include -#include -#include -#include "vcpkg_Environment.h" -#include "vcpkg_Checks.h" -#include "vcpkg_System.h" -#include "vcpkg_Files.h" - -namespace vcpkg -{ - static const std::array old_system_target_files = { - "C:/Program Files (x86)/MSBuild/14.0/Microsoft.Common.Targets/ImportBefore/vcpkg.nuget.targets", - "C:/Program Files (x86)/MSBuild/14.0/Microsoft.Common.Targets/ImportBefore/vcpkg.system.targets" - }; - static const fs::path system_wide_targets_file = "C:/Program Files (x86)/MSBuild/Microsoft.Cpp/v4.0/V140/ImportBefore/Default/vcpkg.system.props"; - - static std::string create_appdata_targets_shortcut(const std::string& target_path) noexcept - { - return Strings::format(R"###( - - - -)###", target_path, target_path); - } - - static std::string create_system_targets_shortcut() noexcept - { - return R"###( - - - - $(LOCALAPPDATA)\vcpkg\vcpkg.user - - - -)###"; - } - - static std::string create_nuget_targets_file(const fs::path& msbuild_vcpkg_targets_file) noexcept - { - const std::string as_string = msbuild_vcpkg_targets_file.string(); - - return Strings::format(R"###( - - - - - - -)###", as_string, as_string); - } - - static std::string create_nuget_props_file() noexcept - { - return R"###( - - - true - - -)###"; - } - - static std::string get_nuget_id(const fs::path& vcpkg_root_dir) - { - std::string dir_id = vcpkg_root_dir.generic_string(); - std::replace(dir_id.begin(), dir_id.end(), '/', '.'); - dir_id.erase(1, 1); // Erasing the ":" - - // NuGet id cannot have invalid characters. We will only use alphanumeric and dot. - dir_id.erase(std::remove_if(dir_id.begin(), dir_id.end(), [](char c) - { - return !isalnum(c) && (c != '.'); - }), dir_id.end()); - - const std::string nuget_id = "vcpkg." + dir_id; - return nuget_id; - } - - static std::string create_nuspec_file(const fs::path& vcpkg_root_dir, const std::string& nuget_id, const std::string& nupkg_version) - { - const std::string nuspec_file_content_template = R"( - - - @NUGET_ID@ - @VERSION@ - cpp-packages - - This package imports all libraries currently installed in @VCPKG_DIR@. This package does not contain any libraries and instead refers to the folder directly (like a symlink). - - - - - - - -)"; - - std::string nuspec_file_content = std::regex_replace(nuspec_file_content_template, std::regex("@NUGET_ID@"), nuget_id); - nuspec_file_content = std::regex_replace(nuspec_file_content, std::regex("@VCPKG_DIR@"), vcpkg_root_dir.string()); - nuspec_file_content = std::regex_replace(nuspec_file_content, std::regex("@VERSION@"), nupkg_version); - return nuspec_file_content; - } - - enum class elevation_prompt_user_choice - { - yes, - no - }; - - static elevation_prompt_user_choice elevated_cmd_execute(const std::string& param) - { - SHELLEXECUTEINFO shExInfo = {0}; - shExInfo.cbSize = sizeof(shExInfo); - shExInfo.fMask = SEE_MASK_NOCLOSEPROCESS; - shExInfo.hwnd = nullptr; - shExInfo.lpVerb = "runas"; - shExInfo.lpFile = "cmd"; // Application to start - - shExInfo.lpParameters = param.c_str(); // Additional parameters - shExInfo.lpDirectory = nullptr; - shExInfo.nShow = SW_HIDE; - shExInfo.hInstApp = nullptr; - - if (!ShellExecuteExA(&shExInfo)) - { - return elevation_prompt_user_choice::no; - } - if (shExInfo.hProcess == nullptr) - { - return elevation_prompt_user_choice::no; - } - WaitForSingleObject(shExInfo.hProcess, INFINITE); - CloseHandle(shExInfo.hProcess); - return elevation_prompt_user_choice::yes; - } - - static fs::path get_appdata_targets_path() - { - return fs::path(System::wdupenv_str(L"LOCALAPPDATA")) / "vcpkg" / "vcpkg.user.targets"; - } - - static void integrate_install(const vcpkg_paths& paths) - { - // TODO: This block of code should eventually be removed - for (auto&& old_system_wide_targets_file : old_system_target_files) - { - if (fs::exists(old_system_wide_targets_file)) - { - const std::string param = Strings::format(R"(/c DEL "%s" /Q > nul)", old_system_wide_targets_file.string()); - elevation_prompt_user_choice user_choice = elevated_cmd_execute(param); - switch (user_choice) - { - case elevation_prompt_user_choice::yes: - break; - case elevation_prompt_user_choice::no: - System::println(System::color::warning, "Warning: Previous integration file was not removed"); - exit(EXIT_FAILURE); - default: - Checks::unreachable(); - } - } - } - - const fs::path tmp_dir = paths.buildsystems / "tmp"; - fs::create_directory(paths.buildsystems); - fs::create_directory(tmp_dir); - - bool should_install_system = true; - if (fs::exists(system_wide_targets_file)) - { - auto system_wide_file_contents = Files::read_contents(system_wide_targets_file); - if (auto contents_data = system_wide_file_contents.get()) - { - std::regex re(R"###()###"); - std::match_results match; - auto found = std::regex_search(*contents_data, match, re); - if (found) - { - int ver = atoi(match[1].str().c_str()); - if (ver >= 1) - should_install_system = false; - } - } - } - - if (should_install_system) - { - const fs::path sys_src_path = tmp_dir / "vcpkg.system.targets"; - std::ofstream(sys_src_path) << create_system_targets_shortcut(); - - const std::string param = Strings::format(R"(/c mkdir "%s" & copy "%s" "%s" /Y > nul)", system_wide_targets_file.parent_path().string(), sys_src_path.string(), system_wide_targets_file.string()); - elevation_prompt_user_choice user_choice = elevated_cmd_execute(param); - switch (user_choice) - { - case elevation_prompt_user_choice::yes: - break; - case elevation_prompt_user_choice::no: - System::println(System::color::warning, "Warning: integration was not applied"); - exit(EXIT_FAILURE); - default: - Checks::unreachable(); - } - - Checks::check_exit(fs::exists(system_wide_targets_file), "Error: failed to copy targets file to %s", system_wide_targets_file.string()); - } - - const fs::path appdata_src_path = tmp_dir / "vcpkg.user.targets"; - std::ofstream(appdata_src_path) << create_appdata_targets_shortcut(paths.buildsystems_msbuild_targets.string()); - auto appdata_dst_path = get_appdata_targets_path(); - - if (!fs::copy_file(appdata_src_path, appdata_dst_path, fs::copy_options::overwrite_existing)) - { - System::println(System::color::error, "Error: Failed to copy file: %s -> %s", appdata_src_path.string(), appdata_dst_path.string()); - exit(EXIT_FAILURE); - } - System::println(System::color::success, "Applied user-wide integration for this vcpkg root."); - System::println("\n" - "All C++ projects can now #include any installed libraries.\n" - "Linking will be handled automatically.\n" - "Installing new libraries will make them instantly available."); - - exit(EXIT_SUCCESS); - } - - static void integrate_remove() - { - auto path = get_appdata_targets_path(); - if (!fs::exists(path)) - { - System::println(System::color::success, "User-wide integration is not installed"); - exit(EXIT_SUCCESS); - } - - const std::wstring cmd_line = Strings::wformat(LR"(DEL "%s")", get_appdata_targets_path().native()); - const int exit_code = System::cmd_execute(cmd_line); - if (exit_code) - { - System::println(System::color::error, "Error: Unable to remove user-wide integration: %d", exit_code); - exit(exit_code); - } - System::println(System::color::success, "User-wide integration was removed"); - exit(EXIT_SUCCESS); - } - - static void integrate_project(const vcpkg_paths& paths) - { - Environment::ensure_nuget_on_path(paths); - - const fs::path& buildsystems_dir = paths.buildsystems; - const fs::path tmp_dir = buildsystems_dir / "tmp"; - fs::create_directory(buildsystems_dir); - fs::create_directory(tmp_dir); - - const fs::path targets_file_path = tmp_dir / "vcpkg.nuget.targets"; - const fs::path props_file_path = tmp_dir / "vcpkg.nuget.props"; - const fs::path nuspec_file_path = tmp_dir / "vcpkg.nuget.nuspec"; - const std::string nuget_id = get_nuget_id(paths.root); - const std::string nupkg_version = "1.0.0"; - - std::ofstream(targets_file_path) << create_nuget_targets_file(paths.buildsystems_msbuild_targets); - std::ofstream(props_file_path) << create_nuget_props_file(); - std::ofstream(nuspec_file_path) << create_nuspec_file(paths.root, nuget_id, nupkg_version); - - // Using all forward slashes for the command line - const std::wstring cmd_line = Strings::wformat(LR"(nuget.exe pack -OutputDirectory "%s" "%s" > nul)", buildsystems_dir.native(), nuspec_file_path.native()); - - const int exit_code = System::cmd_execute(cmd_line); - - const fs::path nuget_package = buildsystems_dir / Strings::format("%s.%s.nupkg", nuget_id, nupkg_version); - if (exit_code != 0 || !fs::exists(nuget_package)) - { - System::println(System::color::error, "Error: NuGet package creation failed"); - exit(EXIT_FAILURE); - } - - System::println(System::color::success, "Created nupkg: %s", nuget_package.string()); - - System::println(R"( -With a project open, go to Tools->NuGet Package Manager->Package Manager Console and paste: - Install-Package %s -Source "%s" -)", nuget_id, buildsystems_dir.generic_string()); - - exit(EXIT_SUCCESS); - } - - const char* const INTEGRATE_COMMAND_HELPSTRING = - " vcpkg integrate install Make installed packages available user-wide. Requires admin privileges on first use\n" - " 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) - { - static const std::string example = Strings::format("Commands:\n" - "%s", INTEGRATE_COMMAND_HELPSTRING); - args.check_exact_arg_count(1, example); - - if (args.command_arguments[0] == "install") - { - return integrate_install(paths); - } - if (args.command_arguments[0] == "remove") - { - return integrate_remove(); - } - if (args.command_arguments[0] == "project") - { - return integrate_project(paths); - } - - System::println(System::color::error, "Unknown parameter %s for integrate", args.command_arguments[0]); - exit(EXIT_FAILURE); - } -} 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 + -- cgit v1.2.3 From df2a05e8546281135c6ea12430734d74371bcf46 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 12 Jan 2017 17:35:33 -0800 Subject: Introduce Command namespace. Refactoring --- toolsrc/include/vcpkg_Commands.h | 32 ++++----- toolsrc/src/commands_available_commands.cpp | 44 ++++++++++++ toolsrc/src/commands_build.cpp | 80 +++++++++++---------- 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 +-- toolsrc/src/commands_helpers.cpp | 55 +++++++++++++++ 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_other.cpp | 103 ---------------------------- 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 ++- 25 files changed, 205 insertions(+), 206 deletions(-) create mode 100644 toolsrc/src/commands_available_commands.cpp create mode 100644 toolsrc/src/commands_helpers.cpp delete mode 100644 toolsrc/src/commands_other.cpp 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); - } + 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); + PostBuildLint::perform_all_checks(spec, paths); - create_binary_control_file(paths, source_paragraph, target_triplet); + create_binary_control_file(paths, source_paragraph, target_triplet); - // const fs::path port_buildtrees_dir = paths.buildtrees / spec.name; - // delete_directory(port_buildtrees_dir); - } + // 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_helpers.cpp b/toolsrc/src/commands_helpers.cpp new file mode 100644 index 000000000..5d6e519ab --- /dev/null +++ b/toolsrc/src/commands_helpers.cpp @@ -0,0 +1,55 @@ +#include "vcpkg_Commands.h" +#include "vcpkg_System.h" + +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 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_other.cpp b/toolsrc/src/commands_other.cpp deleted file mode 100644 index 6df325100..000000000 --- a/toolsrc/src/commands_other.cpp +++ /dev/null @@ -1,103 +0,0 @@ -#include "vcpkg_Commands.h" -#include "vcpkg_System.h" - -namespace vcpkg -{ - 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)); - } - - 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_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 + -- cgit v1.2.3 From 8e1ed2c9a95fa5b9e0bb0a9849a6e20878696f8c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 12 Jan 2017 17:41:50 -0800 Subject: 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 + -- cgit v1.2.3 From 678721b9a8efc550aee9e5293f1c39a4522428fa Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Thu, 12 Jan 2017 21:25:10 -0800 Subject: 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 -- cgit v1.2.3 From 04bd4b305c3ad306af38811ac464d26941e02b77 Mon Sep 17 00:00:00 2001 From: sdflysha Date: Fri, 13 Jan 2017 13:53:37 +0800 Subject: [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 -- cgit v1.2.3 From cc8851144a871931b93d84bd962364159ad1c424 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 12 Jan 2017 22:03:57 -0800 Subject: 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 | 80 ++++++++++++++---- 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, 234 insertions(+), 175 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); + } + + namespace BuildExternal + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); + } + + namespace Install + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); + } + + namespace Remove + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); + } + + namespace Update + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + } + + namespace Create + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + } + + namespace Edit + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + } + + namespace Search + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + } + + 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); + } - 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 Help + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); - void edit_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); - void create_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + void help_topic_valid_triplet(const vcpkg_paths& paths); - 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); + void print_usage(); - void cache_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + void print_example(const std::string& command_and_arguments); - void integrate_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + std::string create_example_string(const std::string& command_and_arguments); + } - void portsdiff_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + namespace Version + { + void perform_and_exit(const vcpkg_cmd_arguments& args); + } - void help_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); - void help_topic_valid_triplet(const vcpkg_paths& paths); + namespace Contact + { + void perform_and_exit(const vcpkg_cmd_arguments& args); + } - 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 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,37 +1,87 @@ #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) + void help_topic_valid_triplet(const vcpkg_paths& paths) + { + System::println("Available architecture triplets:"); + auto it = fs::directory_iterator(paths.triplets); + for (; it != fs::directory_iterator(); ++it) + { + 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()) { - Commands::Helpers::print_usage(); + print_usage(); exit(EXIT_SUCCESS); } const auto& topic = args.command_arguments[0]; if (topic == "triplet") { - Commands::help_topic_valid_triplet(paths); + help_topic_valid_triplet(paths); } else { System::println(System::color::error, "Error: unknown topic %s", topic); - Commands::Helpers::print_usage(); + print_usage(); exit(EXIT_FAILURE); } exit(EXIT_SUCCESS); } - - void help_topic_valid_triplet(const vcpkg_paths& paths) - { - System::println("Available architecture triplets:"); - auto it = fs::directory_iterator(paths.triplets); - for (; it != fs::directory_iterator(); ++it) - { - System::println(" %s", it->path().stem().filename().string()); - } - } } 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 -- cgit v1.2.3 From bad99afb013e852199d1daa52733a23b34cb2f63 Mon Sep 17 00:00:00 2001 From: Albert Ziegenhagel Date: Fri, 13 Jan 2017 09:49:09 +0100 Subject: Added patch to disable building the static library when BUILD_SHARED_LIB is enabled --- .../szip/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 -- cgit v1.2.3 From fe2c0a3a78f4904288ce958ded767160d1de260c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 13 Jan 2017 02:09:08 -0800 Subject: [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"); -- cgit v1.2.3 From e11e62e8f38783efd5be55e890b78f7c47dc3c94 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 13 Jan 2017 02:21:16 -0800 Subject: 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) -- cgit v1.2.3 From f7d192c20697eba44aac11c6992efe61698c534b Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 13 Jan 2017 15:07:30 -0800 Subject: [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 -- cgit v1.2.3 From 278e6b9ad1443673ef47a104cb5aa73ff4350866 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 13 Jan 2017 15:38:14 -0800 Subject: [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 -- cgit v1.2.3 From bf47d0d386d5490936917ab5bf37d801f6681cc1 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 13 Jan 2017 16:01:52 -0800 Subject: [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 -- cgit v1.2.3 From b415c1377976884d7ed9ac6f54630f4ec7921918 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 13 Jan 2017 16:06:30 -0800 Subject: [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 -- cgit v1.2.3 From ccd3e399f023129a39bb9a402324676a9391a970 Mon Sep 17 00:00:00 2001 From: codicodi Date: Sat, 14 Jan 2017 02:15:34 +0100 Subject: [glib] use win_iconv and add subdir for tools --- ports/glib/CMakeLists.txt | 4 ++-- ports/glib/portfile.cmake | 7 +------ ports/glib/use-libiconv-on-windows.patch | 14 -------------- scripts/cmake/vcpkg_copy_tool_dependencies.cmake | 6 +++--- 4 files changed, 6 insertions(+), 25 deletions(-) delete mode 100644 ports/glib/use-libiconv-on-windows.patch diff --git a/ports/glib/CMakeLists.txt b/ports/glib/CMakeLists.txt index 79d460bab..1cf65d0a7 100644 --- a/ports/glib/CMakeLists.txt +++ b/ports/glib/CMakeLists.txt @@ -123,7 +123,7 @@ endmacro() if(NOT GLIB_SKIP_TOOLS) configure_file(gobject/glib-mkenums.in ${CMAKE_SOURCE_DIR}/gobject/glib-mkenums @ONLY) # uses GLIB_VERSION - install(FILES gobject/glib-mkenums DESTINATION tools) + install(FILES gobject/glib-mkenums DESTINATION tools/glib) add_gio_tool(gdbus gio/gdbus-tool.c) add_gio_tool(gio-querymodules gio/gio-querymodules.c) @@ -145,7 +145,7 @@ if(NOT GLIB_SKIP_TOOLS) add_glib_tool(gspawn-${WIN}-helper WIN32 glib/gspawn-win32-helper.c) add_glib_tool(gspawn-${WIN}-helper-console glib/gspawn-win32-helper-console.c) - install(TARGETS ${GLIB_TOOLS} RUNTIME DESTINATION tools) + install(TARGETS ${GLIB_TOOLS} RUNTIME DESTINATION tools/glib) endif() install(TARGETS ${GLIB_TARGETS} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) diff --git a/ports/glib/portfile.cmake b/ports/glib/portfile.cmake index d1777de1d..b438b2e61 100644 --- a/ports/glib/portfile.cmake +++ b/ports/glib/portfile.cmake @@ -17,15 +17,10 @@ vcpkg_download_distfile(ARCHIVE SHA512 63d7b5ece8d7d15b10e06ef10a8e0a4446f30a8d9c97daa3352ec00dfef622728bd42ed24cbf67e553166a0f9e29a3e3d024d1d085b9804fd67608db438b6771) vcpkg_extract_source_archive(${ARCHIVE}) -vcpkg_apply_patches( - SOURCE_PATH ${SOURCE_PATH} - PATCHES - ${CMAKE_CURRENT_LIST_DIR}/use-libiconv-on-windows.patch) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) file(COPY ${CMAKE_CURRENT_LIST_DIR}/cmake DESTINATION ${SOURCE_PATH}) file(REMOVE_RECURSE ${SOURCE_PATH}/glib/pcre) -file(REMOVE ${SOURCE_PATH}/glib/win_iconv.c) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} @@ -35,7 +30,7 @@ vcpkg_configure_cmake( vcpkg_install_cmake() vcpkg_copy_pdbs() -vcpkg_copy_tool_dependencies() +vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/glib) file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/glib) file(RENAME ${CURRENT_PACKAGES_DIR}/share/glib/COPYING ${CURRENT_PACKAGES_DIR}/share/glib/copyright) diff --git a/ports/glib/use-libiconv-on-windows.patch b/ports/glib/use-libiconv-on-windows.patch deleted file mode 100644 index 927de0bb1..000000000 --- a/ports/glib/use-libiconv-on-windows.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/glib/gconvert.c b/glib/gconvert.c -index 3deac78..134ded9 100644 ---- a/glib/gconvert.c -+++ b/glib/gconvert.c -@@ -30,7 +30,8 @@ - #include - - #ifdef G_OS_WIN32 --#include "win_iconv.c" -+#define USE_LIBICONV_GNU -+#include - #endif - - #ifdef G_PLATFORM_WIN32 diff --git a/scripts/cmake/vcpkg_copy_tool_dependencies.cmake b/scripts/cmake/vcpkg_copy_tool_dependencies.cmake index d8de15207..32c3eba0d 100644 --- a/scripts/cmake/vcpkg_copy_tool_dependencies.cmake +++ b/scripts/cmake/vcpkg_copy_tool_dependencies.cmake @@ -1,8 +1,8 @@ -# Copy dlls for all tools in ${CURRENT_PACKAGES_DIR}/tools +# Copy dlls for all tools in TOOL_DIR -function(vcpkg_copy_tool_dependencies) +function(vcpkg_copy_tool_dependencies TOOL_DIR) macro(search_for_dependencies PATH_TO_SEARCH) - file(GLOB TOOLS ${CURRENT_PACKAGES_DIR}/tools/*.exe ${CURRENT_PACKAGES_DIR}/tools/*.dll) + file(GLOB TOOLS ${TOOL_DIR}/*.exe ${TOOL_DIR}/*.dll) foreach(TOOL ${TOOLS}) execute_process(COMMAND powershell -noprofile -executionpolicy UnRestricted -nologo -file ${VCPKG_ROOT_DIR}/scripts/buildsystems/msbuild/applocal.ps1 -- cgit v1.2.3 From 6a3b19b9e04d304ef9e07a9d99d3abbd17552993 Mon Sep 17 00:00:00 2001 From: codicodi Date: Sat, 14 Jan 2017 02:20:44 +0100 Subject: [glib] hunt down every mention of libiconv --- ports/glib/CMakeLists.txt | 8 ++------ ports/glib/CONTROL | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/ports/glib/CMakeLists.txt b/ports/glib/CMakeLists.txt index 1cf65d0a7..d0358a990 100644 --- a/ports/glib/CMakeLists.txt +++ b/ports/glib/CMakeLists.txt @@ -25,9 +25,6 @@ if(CMAKE_BUILD_TYPE STREQUAL Debug) set(PCRE_SUFFIX d) endif() find_library(PCRE_LIBRARY pcre${PCRE_SUFFIX}) -# libiconv -find_path(ICONV_INCLUDE_DIR iconv.h) -find_library(ICONV_LIBRARY NAMES iconv libiconv) # libffi find_path(FFI_INCLUDE_DIR ffi.h) find_library(FFI_LIBRARY NAMES ffi libffi) @@ -65,8 +62,8 @@ extract_vcproj_sources(build/win32/vs14/glib.vcxproj GLIB_SOURCES) list(APPEND GLIB_SOURCES glib/libcharset/localcharset.c) # modified internal version with prefixed symbols add_library(glib ${GLIB_SOURCES}) target_compile_definitions(glib PRIVATE USE_SYSTEM_PCRE ${GLIB_EXPORT_MACRO} GLIB_COMPILATION G_LOG_DOMAIN="GLib" LIBDIR) -target_link_libraries(glib ws2_32 winmm ${PCRE_LIBRARY} ${ICONV_LIBRARY} ${LIBINTL_LIBRARY}) -target_include_directories(glib PRIVATE ${PCRE_INCLUDE_DIR} ${ICONV_INCLUDE_DIR}) +target_link_libraries(glib ws2_32 winmm ${PCRE_LIBRARY} ${LIBINTL_LIBRARY}) +target_include_directories(glib PRIVATE ${PCRE_INCLUDE_DIR}) target_include_directories(glib PUBLIC ${LIBINTL_INCLUDE_DIR}) list(APPEND GLIB_TARGETS glib) @@ -156,6 +153,5 @@ endif() message(STATUS "Link-time dependencies:") message(STATUS " " ${ZLIB_LIBRARIES}) message(STATUS " " ${PCRE_LIBRARY}) -message(STATUS " " ${ICONV_LIBRARY}) message(STATUS " " ${FFI_LIBRARY}) message(STATUS " " ${LIBINTL_LIBRARY}) diff --git a/ports/glib/CONTROL b/ports/glib/CONTROL index 984d7576a..219abc624 100644 --- a/ports/glib/CONTROL +++ b/ports/glib/CONTROL @@ -1,4 +1,4 @@ Source: glib Version: 2.50.2 Description: Portable, general-purpose utility library. -Build-Depends: zlib, pcre, libffi, gettext, libiconv +Build-Depends: zlib, pcre, libffi, gettext -- cgit v1.2.3 From 2bc4064b1e99b31bd550982011e251f97d5a0aef Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 13 Jan 2017 17:30:48 -0800 Subject: [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 ) -- cgit v1.2.3 From da09df713fe7b68d432108802447eb534a7dd555 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 13 Jan 2017 17:39:12 -0800 Subject: [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" -- cgit v1.2.3 From c5636c4692f1e4f257bf5e6fbcf89a93d4cd60a0 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 13 Jan 2017 17:54:13 -0800 Subject: [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 -- cgit v1.2.3 From 74784355e56df89b5deaf886a546289fcd5eabf9 Mon Sep 17 00:00:00 2001 From: codicodi Date: Sat, 14 Jan 2017 02:55:04 +0100 Subject: [grpc] build statically and preserve debug libs --- ports/grpc/CONTROL | 2 +- ports/grpc/portfile.cmake | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ports/grpc/CONTROL b/ports/grpc/CONTROL index ece5b96ce..b9d19da4c 100644 --- a/ports/grpc/CONTROL +++ b/ports/grpc/CONTROL @@ -1,4 +1,4 @@ Source: grpc -Version: 1.1.0-dev-1674f65 +Version: 1.1.0-dev-1674f65-1 Build-Depends: zlib, openssl, protobuf Description: An RPC library and framework \ No newline at end of file diff --git a/ports/grpc/portfile.cmake b/ports/grpc/portfile.cmake index a54af6e55..ffd71d137 100644 --- a/ports/grpc/portfile.cmake +++ b/ports/grpc/portfile.cmake @@ -1,6 +1,6 @@ -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(STATUS "Warning: Static building not supported yet. Building dynamic.") - set(VCPKG_LIBRARY_LINKAGE dynamic) +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) find_program(GIT git) @@ -55,7 +55,9 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/cmake/gRPC/gRPCTargets-debug.cmake file(INSTALL ${CURRENT_BUILDTREES_DIR}/src/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/grpc RENAME copyright) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/cmake) vcpkg_copy_pdbs() -- cgit v1.2.3 From 5e1c18cd56db66c0a1f4f2816bc7938d47c1376d Mon Sep 17 00:00:00 2001 From: codicodi Date: Sat, 14 Jan 2017 02:55:32 +0100 Subject: Revert "[glib] hunt down every mention of libiconv" This reverts commit 6a3b19b9e04d304ef9e07a9d99d3abbd17552993. --- ports/glib/CMakeLists.txt | 8 ++++++-- ports/glib/CONTROL | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ports/glib/CMakeLists.txt b/ports/glib/CMakeLists.txt index d0358a990..1cf65d0a7 100644 --- a/ports/glib/CMakeLists.txt +++ b/ports/glib/CMakeLists.txt @@ -25,6 +25,9 @@ if(CMAKE_BUILD_TYPE STREQUAL Debug) set(PCRE_SUFFIX d) endif() find_library(PCRE_LIBRARY pcre${PCRE_SUFFIX}) +# libiconv +find_path(ICONV_INCLUDE_DIR iconv.h) +find_library(ICONV_LIBRARY NAMES iconv libiconv) # libffi find_path(FFI_INCLUDE_DIR ffi.h) find_library(FFI_LIBRARY NAMES ffi libffi) @@ -62,8 +65,8 @@ extract_vcproj_sources(build/win32/vs14/glib.vcxproj GLIB_SOURCES) list(APPEND GLIB_SOURCES glib/libcharset/localcharset.c) # modified internal version with prefixed symbols add_library(glib ${GLIB_SOURCES}) target_compile_definitions(glib PRIVATE USE_SYSTEM_PCRE ${GLIB_EXPORT_MACRO} GLIB_COMPILATION G_LOG_DOMAIN="GLib" LIBDIR) -target_link_libraries(glib ws2_32 winmm ${PCRE_LIBRARY} ${LIBINTL_LIBRARY}) -target_include_directories(glib PRIVATE ${PCRE_INCLUDE_DIR}) +target_link_libraries(glib ws2_32 winmm ${PCRE_LIBRARY} ${ICONV_LIBRARY} ${LIBINTL_LIBRARY}) +target_include_directories(glib PRIVATE ${PCRE_INCLUDE_DIR} ${ICONV_INCLUDE_DIR}) target_include_directories(glib PUBLIC ${LIBINTL_INCLUDE_DIR}) list(APPEND GLIB_TARGETS glib) @@ -153,5 +156,6 @@ endif() message(STATUS "Link-time dependencies:") message(STATUS " " ${ZLIB_LIBRARIES}) message(STATUS " " ${PCRE_LIBRARY}) +message(STATUS " " ${ICONV_LIBRARY}) message(STATUS " " ${FFI_LIBRARY}) message(STATUS " " ${LIBINTL_LIBRARY}) diff --git a/ports/glib/CONTROL b/ports/glib/CONTROL index 219abc624..984d7576a 100644 --- a/ports/glib/CONTROL +++ b/ports/glib/CONTROL @@ -1,4 +1,4 @@ Source: glib Version: 2.50.2 Description: Portable, general-purpose utility library. -Build-Depends: zlib, pcre, libffi, gettext +Build-Depends: zlib, pcre, libffi, gettext, libiconv -- cgit v1.2.3 From eb7ccc1223f568d6d2df21b27eb890be93bc8186 Mon Sep 17 00:00:00 2001 From: codicodi Date: Sat, 14 Jan 2017 02:55:41 +0100 Subject: Revert "[glib] use win_iconv and add subdir for tools" This reverts commit ccd3e399f023129a39bb9a402324676a9391a970. --- ports/glib/CMakeLists.txt | 4 ++-- ports/glib/portfile.cmake | 7 ++++++- ports/glib/use-libiconv-on-windows.patch | 14 ++++++++++++++ scripts/cmake/vcpkg_copy_tool_dependencies.cmake | 6 +++--- 4 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 ports/glib/use-libiconv-on-windows.patch diff --git a/ports/glib/CMakeLists.txt b/ports/glib/CMakeLists.txt index 1cf65d0a7..79d460bab 100644 --- a/ports/glib/CMakeLists.txt +++ b/ports/glib/CMakeLists.txt @@ -123,7 +123,7 @@ endmacro() if(NOT GLIB_SKIP_TOOLS) configure_file(gobject/glib-mkenums.in ${CMAKE_SOURCE_DIR}/gobject/glib-mkenums @ONLY) # uses GLIB_VERSION - install(FILES gobject/glib-mkenums DESTINATION tools/glib) + install(FILES gobject/glib-mkenums DESTINATION tools) add_gio_tool(gdbus gio/gdbus-tool.c) add_gio_tool(gio-querymodules gio/gio-querymodules.c) @@ -145,7 +145,7 @@ if(NOT GLIB_SKIP_TOOLS) add_glib_tool(gspawn-${WIN}-helper WIN32 glib/gspawn-win32-helper.c) add_glib_tool(gspawn-${WIN}-helper-console glib/gspawn-win32-helper-console.c) - install(TARGETS ${GLIB_TOOLS} RUNTIME DESTINATION tools/glib) + install(TARGETS ${GLIB_TOOLS} RUNTIME DESTINATION tools) endif() install(TARGETS ${GLIB_TARGETS} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) diff --git a/ports/glib/portfile.cmake b/ports/glib/portfile.cmake index b438b2e61..d1777de1d 100644 --- a/ports/glib/portfile.cmake +++ b/ports/glib/portfile.cmake @@ -17,10 +17,15 @@ vcpkg_download_distfile(ARCHIVE SHA512 63d7b5ece8d7d15b10e06ef10a8e0a4446f30a8d9c97daa3352ec00dfef622728bd42ed24cbf67e553166a0f9e29a3e3d024d1d085b9804fd67608db438b6771) vcpkg_extract_source_archive(${ARCHIVE}) +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/use-libiconv-on-windows.patch) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) file(COPY ${CMAKE_CURRENT_LIST_DIR}/cmake DESTINATION ${SOURCE_PATH}) file(REMOVE_RECURSE ${SOURCE_PATH}/glib/pcre) +file(REMOVE ${SOURCE_PATH}/glib/win_iconv.c) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} @@ -30,7 +35,7 @@ vcpkg_configure_cmake( vcpkg_install_cmake() vcpkg_copy_pdbs() -vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/glib) +vcpkg_copy_tool_dependencies() file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/glib) file(RENAME ${CURRENT_PACKAGES_DIR}/share/glib/COPYING ${CURRENT_PACKAGES_DIR}/share/glib/copyright) diff --git a/ports/glib/use-libiconv-on-windows.patch b/ports/glib/use-libiconv-on-windows.patch new file mode 100644 index 000000000..927de0bb1 --- /dev/null +++ b/ports/glib/use-libiconv-on-windows.patch @@ -0,0 +1,14 @@ +diff --git a/glib/gconvert.c b/glib/gconvert.c +index 3deac78..134ded9 100644 +--- a/glib/gconvert.c ++++ b/glib/gconvert.c +@@ -30,7 +30,8 @@ + #include + + #ifdef G_OS_WIN32 +-#include "win_iconv.c" ++#define USE_LIBICONV_GNU ++#include + #endif + + #ifdef G_PLATFORM_WIN32 diff --git a/scripts/cmake/vcpkg_copy_tool_dependencies.cmake b/scripts/cmake/vcpkg_copy_tool_dependencies.cmake index 32c3eba0d..d8de15207 100644 --- a/scripts/cmake/vcpkg_copy_tool_dependencies.cmake +++ b/scripts/cmake/vcpkg_copy_tool_dependencies.cmake @@ -1,8 +1,8 @@ -# Copy dlls for all tools in TOOL_DIR +# Copy dlls for all tools in ${CURRENT_PACKAGES_DIR}/tools -function(vcpkg_copy_tool_dependencies TOOL_DIR) +function(vcpkg_copy_tool_dependencies) macro(search_for_dependencies PATH_TO_SEARCH) - file(GLOB TOOLS ${TOOL_DIR}/*.exe ${TOOL_DIR}/*.dll) + file(GLOB TOOLS ${CURRENT_PACKAGES_DIR}/tools/*.exe ${CURRENT_PACKAGES_DIR}/tools/*.dll) foreach(TOOL ${TOOLS}) execute_process(COMMAND powershell -noprofile -executionpolicy UnRestricted -nologo -file ${VCPKG_ROOT_DIR}/scripts/buildsystems/msbuild/applocal.ps1 -- cgit v1.2.3 From f5a0a64e44b885fae8d17b811ee3d3f623ffac3e Mon Sep 17 00:00:00 2001 From: codicodi Date: Sat, 14 Jan 2017 02:59:41 +0100 Subject: [glib] tooools --- ports/glib/CMakeLists.txt | 4 ++-- ports/glib/portfile.cmake | 2 +- scripts/cmake/vcpkg_copy_tool_dependencies.cmake | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ports/glib/CMakeLists.txt b/ports/glib/CMakeLists.txt index 79d460bab..1cf65d0a7 100644 --- a/ports/glib/CMakeLists.txt +++ b/ports/glib/CMakeLists.txt @@ -123,7 +123,7 @@ endmacro() if(NOT GLIB_SKIP_TOOLS) configure_file(gobject/glib-mkenums.in ${CMAKE_SOURCE_DIR}/gobject/glib-mkenums @ONLY) # uses GLIB_VERSION - install(FILES gobject/glib-mkenums DESTINATION tools) + install(FILES gobject/glib-mkenums DESTINATION tools/glib) add_gio_tool(gdbus gio/gdbus-tool.c) add_gio_tool(gio-querymodules gio/gio-querymodules.c) @@ -145,7 +145,7 @@ if(NOT GLIB_SKIP_TOOLS) add_glib_tool(gspawn-${WIN}-helper WIN32 glib/gspawn-win32-helper.c) add_glib_tool(gspawn-${WIN}-helper-console glib/gspawn-win32-helper-console.c) - install(TARGETS ${GLIB_TOOLS} RUNTIME DESTINATION tools) + install(TARGETS ${GLIB_TOOLS} RUNTIME DESTINATION tools/glib) endif() install(TARGETS ${GLIB_TARGETS} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) diff --git a/ports/glib/portfile.cmake b/ports/glib/portfile.cmake index d1777de1d..71f1f366c 100644 --- a/ports/glib/portfile.cmake +++ b/ports/glib/portfile.cmake @@ -35,7 +35,7 @@ vcpkg_configure_cmake( vcpkg_install_cmake() vcpkg_copy_pdbs() -vcpkg_copy_tool_dependencies() +vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/glib) file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/glib) file(RENAME ${CURRENT_PACKAGES_DIR}/share/glib/COPYING ${CURRENT_PACKAGES_DIR}/share/glib/copyright) diff --git a/scripts/cmake/vcpkg_copy_tool_dependencies.cmake b/scripts/cmake/vcpkg_copy_tool_dependencies.cmake index d8de15207..432e3c12a 100644 --- a/scripts/cmake/vcpkg_copy_tool_dependencies.cmake +++ b/scripts/cmake/vcpkg_copy_tool_dependencies.cmake @@ -1,8 +1,8 @@ -# Copy dlls for all tools in ${CURRENT_PACKAGES_DIR}/tools +# Copy dlls for all tools in TOOL_DIR -function(vcpkg_copy_tool_dependencies) +function(vcpkg_copy_tool_dependencies TOOL_DIR) macro(search_for_dependencies PATH_TO_SEARCH) - file(GLOB TOOLS ${CURRENT_PACKAGES_DIR}/tools/*.exe ${CURRENT_PACKAGES_DIR}/tools/*.dll) + file(GLOB TOOLS ${TOOL_DIR}/*.exe ${TOOL_DIR}/*.dll) foreach(TOOL ${TOOLS}) execute_process(COMMAND powershell -noprofile -executionpolicy UnRestricted -nologo -file ${VCPKG_ROOT_DIR}/scripts/buildsystems/msbuild/applocal.ps1 -- cgit v1.2.3 From bae23861132c5e746f7450a12fedd5f2b0e6b67c Mon Sep 17 00:00:00 2001 From: sdcb Date: Sat, 14 Jan 2017 11:09:21 +0800 Subject: fix UVAtlas build, I dropped the uvatlas tool. --- ports/uvatlas/CONTROL | 3 +-- ports/uvatlas/portfile.cmake | 54 ++++++++++++++++++++------------------------ 2 files changed, 26 insertions(+), 31 deletions(-) diff --git a/ports/uvatlas/CONTROL b/ports/uvatlas/CONTROL index 0e842d8fb..7fad35659 100644 --- a/ports/uvatlas/CONTROL +++ b/ports/uvatlas/CONTROL @@ -1,4 +1,3 @@ Source: uvatlas Version: sept2016 -Description: UVAtlas isochart texture atlas -Build-Depends: directxtex, directxmesh \ No newline at end of file +Description: UVAtlas isochart texture atlas \ No newline at end of file diff --git a/ports/uvatlas/portfile.cmake b/ports/uvatlas/portfile.cmake index 9f4bc5308..777742996 100644 --- a/ports/uvatlas/portfile.cmake +++ b/ports/uvatlas/portfile.cmake @@ -6,9 +6,9 @@ # 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) +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) @@ -20,37 +20,33 @@ 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}) -ENDIF() - -vcpkg_build_msbuild( - PROJECT_PATH ${SOURCE_PATH}/UVAtlas/UVAtlas_2015.sln - PLATFORM ${BUILD_ARCH} -) -vcpkg_build_msbuild( - PROJECT_PATH ${SOURCE_PATH}/UVAtlasTool/UVAtlasTool_2015.sln - PLATFORM ${BUILD_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}/UVAtlas/UVAtlas_2015.sln + PLATFORM ${BUILD_ARCH} ) -file(INSTALL - ${SOURCE_PATH}/Inc/ +file(INSTALL + ${SOURCE_PATH}/UVAtlas/Inc/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) -file(INSTALL - ${SOURCE_PATH}/UVAtlas/Bin/Desktop_2015/${BUILD_ARCH}/Release/UVAtlas.lib +file(INSTALL + ${SOURCE_PATH}/UVAtlas/Bin/Desktop_2015/${BUILD_ARCH}/Release/UVAtlas.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) -file(INSTALL - ${SOURCE_PATH}/UVAtlas/Bin/Desktop_2015/${BUILD_ARCH}/Debug/UVAtlas.lib +file(INSTALL + ${SOURCE_PATH}/UVAtlas/Bin/Desktop_2015/${BUILD_ARCH}/Debug/UVAtlas.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) -file(INSTALL - ${SOURCE_PATH}/UVAtlas/Bin/Desktop_2015/${BUILD_ARCH}/Debug/UVAtlas.lib +file(INSTALL + ${SOURCE_PATH}/UVAtlas/Bin/Desktop_2015/${BUILD_ARCH}/Debug/UVAtlas.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) -file(INSTALL - ${SOURCE_PATH}/UVAtlasTool/Bin/Desktop_2015/${BUILD_ARCH}/Release/UVAtlasTool.exe - DESTINATION ${CURRENT_PACKAGES_DIR}/tools) # Handle copyright -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/uvatlas) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/uvatlas/LICENSE ${CURRENT_PACKAGES_DIR}/share/uvatlas/copyright) +file(COPY ${SOURCE_PATH}/MIT.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/uvatlas) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/uvatlas/MIT.txt ${CURRENT_PACKAGES_DIR}/share/uvatlas/copyright) + +message(STATUS "Installing done, uvatlastool.exe can be downloaded at: ") +message(STATUS " https://github.com/Microsoft/UVAtlas/releases/download/sept2016/uvatlastool.exe") \ No newline at end of file -- cgit v1.2.3 From fd0adc561dd93c2cdf0762eeefa0438537a6760a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 13 Jan 2017 19:09:42 -0800 Subject: [vcpkg_build/install_cmake] Add option to disable parallel building --- scripts/cmake/vcpkg_build_cmake.cmake | 10 +++++++--- scripts/cmake/vcpkg_install_cmake.cmake | 17 +++++++++++++++-- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/scripts/cmake/vcpkg_build_cmake.cmake b/scripts/cmake/vcpkg_build_cmake.cmake index eb50222ba..6d7cfe643 100644 --- a/scripts/cmake/vcpkg_build_cmake.cmake +++ b/scripts/cmake/vcpkg_build_cmake.cmake @@ -1,5 +1,5 @@ function(vcpkg_build_cmake) - cmake_parse_arguments(_bc "MSVC_64_TOOLSET" "" "" ${ARGN}) + cmake_parse_arguments(_bc "MSVC_64_TOOLSET;DISABLE_PARALLEL" "" "" ${ARGN}) set(MSVC_EXTRA_ARGS) @@ -8,9 +8,13 @@ function(vcpkg_build_cmake) list(APPEND MSVC_EXTRA_ARGS "/p:PreferredToolArchitecture=x64") endif() + if (NOT _bc_DISABLE_PARALLEL) + list(APPEND MSVC_EXTRA_ARGS "/m") + endif() + message(STATUS "Build ${TARGET_TRIPLET}-rel") vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} --build . --config Release -- /p:VCPkgLocalAppDataDisabled=true /m ${MSVC_EXTRA_ARGS} + COMMAND ${CMAKE_COMMAND} --build . --config Release -- /p:VCPkgLocalAppDataDisabled=true ${MSVC_EXTRA_ARGS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel LOGNAME build-${TARGET_TRIPLET}-rel ) @@ -18,7 +22,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 ${MSVC_EXTRA_ARGS} + COMMAND ${CMAKE_COMMAND} --build . --config Debug -- /p:VCPkgLocalAppDataDisabled=true ${MSVC_EXTRA_ARGS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg LOGNAME build-${TARGET_TRIPLET}-dbg ) diff --git a/scripts/cmake/vcpkg_install_cmake.cmake b/scripts/cmake/vcpkg_install_cmake.cmake index 30aff0fe1..f29f3ce5d 100644 --- a/scripts/cmake/vcpkg_install_cmake.cmake +++ b/scripts/cmake/vcpkg_install_cmake.cmake @@ -1,7 +1,20 @@ function(vcpkg_install_cmake) + cmake_parse_arguments(_bc "MSVC_64_TOOLSET;DISABLE_PARALLEL" "" "" ${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() + + if (NOT _bc_DISABLE_PARALLEL) + list(APPEND MSVC_EXTRA_ARGS "/m") + endif() + message(STATUS "Package ${TARGET_TRIPLET}-rel") vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} --build . --config Release --target install -- /m + COMMAND ${CMAKE_COMMAND} --build . --config Release --target install -- /p:VCPkgLocalAppDataDisabled=true ${MSVC_EXTRA_ARGS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel LOGNAME package-${TARGET_TRIPLET}-rel ) @@ -9,7 +22,7 @@ function(vcpkg_install_cmake) message(STATUS "Package ${TARGET_TRIPLET}-dbg") vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} --build . --config Debug --target install -- /m + COMMAND ${CMAKE_COMMAND} --build . --config Debug --target install -- /p:VCPkgLocalAppDataDisabled=true ${MSVC_EXTRA_ARGS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg LOGNAME package-${TARGET_TRIPLET}-dbg ) -- cgit v1.2.3 From 0600d2b842a28dcffc24aec21600b9f2df7549fc Mon Sep 17 00:00:00 2001 From: codicodi Date: Sat, 14 Jan 2017 18:29:00 +0100 Subject: [glib] install gdbus-codegen tool It is required to build gtk+ --- ports/glib/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ports/glib/CMakeLists.txt b/ports/glib/CMakeLists.txt index 1cf65d0a7..341ab1a62 100644 --- a/ports/glib/CMakeLists.txt +++ b/ports/glib/CMakeLists.txt @@ -125,6 +125,11 @@ if(NOT GLIB_SKIP_TOOLS) configure_file(gobject/glib-mkenums.in ${CMAKE_SOURCE_DIR}/gobject/glib-mkenums @ONLY) # uses GLIB_VERSION install(FILES gobject/glib-mkenums DESTINATION tools/glib) + configure_file(gio/gdbus-2.0/codegen/gdbus-codegen.in ${CMAKE_SOURCE_DIR}/gio/gdbus-2.0/codegen/gdbus-codegen COPYONLY) + install(FILES gio/gdbus-2.0/codegen/gdbus-codegen DESTINATION tools/glib) + file(GLOB CODEGEN_SOURCES gio/gdbus-2.0/codegen/*.py) + install(FILES ${CODEGEN_SOURCES} DESTINATION tools/glib/codegen) + add_gio_tool(gdbus gio/gdbus-tool.c) add_gio_tool(gio-querymodules gio/gio-querymodules.c) file(GLOB GIO_TOOL_SOURCES gio/gio-tool*.c) -- cgit v1.2.3 From b2619d58c67842e5dd23eb4fea974c35270ab9dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20W=C3=B6lk?= Date: Sat, 14 Jan 2017 23:56:34 +0100 Subject: Create CONTROL file --- ports/cereal/CONTROL | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 ports/cereal/CONTROL diff --git a/ports/cereal/CONTROL b/ports/cereal/CONTROL new file mode 100644 index 000000000..3c598a735 --- /dev/null +++ b/ports/cereal/CONTROL @@ -0,0 +1,3 @@ +Source: cereal +Version: 1.2.1 +Description: a header-only C++11 serialization library (built in support for binary, XML and JSon) -- cgit v1.2.3 From 23c6f5f2a7d7a1f7a6a131c39837929d170edc23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20W=C3=B6lk?= Date: Sat, 14 Jan 2017 23:57:15 +0100 Subject: Create portfile.cmake for cereal --- ports/cereal/portfile.cmake | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 ports/cereal/portfile.cmake diff --git a/ports/cereal/portfile.cmake b/ports/cereal/portfile.cmake new file mode 100644 index 000000000..ccdf13fd4 --- /dev/null +++ b/ports/cereal/portfile.cmake @@ -0,0 +1,18 @@ +#header-only library +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/cereal-1.2.1) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/USCiLab/cereal/archive/v1.2.1.tar.gz" + FILENAME "cereal-1.2.1.tar.gz" + SHA512 f0050f27433a4b544e7785aa94fc7b14a57eed6d542e25d3d0fda4d27cf55ea55e796be2138bf80809c96c392436513fe42764b3a456938395bf7f7177dd1c73 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/cereal) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/cereal/LICENSE ${CURRENT_PACKAGES_DIR}/share/cereal/copyright) + +# Copy the cereal header files +execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory + ${SOURCE_PATH}/include/cereal/ + ${CURRENT_PACKAGES_DIR}/include/cereal) -- cgit v1.2.3 From 6d42e93c17b2ca7bf3d58be892e05afd1750b59d Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Sun, 15 Jan 2017 19:55:34 +0100 Subject: Use ACE 6.4.1, the latest micro release * ports/ace/portfile.cmake: --- ports/ace/portfile.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/ace/portfile.cmake b/ports/ace/portfile.cmake index 8301fb232..7c5d0e14a 100644 --- a/ports/ace/portfile.cmake +++ b/ports/ace/portfile.cmake @@ -5,9 +5,9 @@ endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ACE_wrappers/ace) vcpkg_download_distfile(ARCHIVE - URLS "http://download.dre.vanderbilt.edu/previous_versions/ACE-6.4.0.zip" - FILENAME "ACE-6.4.0.zip" - SHA512 3543291332b96cf06a966dedda617169e8db051cebbbc4f05cdc2c2c9e7908174f8ed67bc152bbcd57541279d3addb1138f1fc092468e856c2bb04ee6ad2b95a + URLS "http://download.dre.vanderbilt.edu/previous_versions/ACE-6.4.1.zip" + FILENAME "ACE-6.4.1.zip" + SHA512 ef914e02d5107a08bf9f60b4e9b16002cd4a7d2ec7b53fcf30d1563fd8684b963d17c54a8b7cb5efecb24ac291d8dc0002adb7c54dd190abebf35a2db0f5937c ) vcpkg_extract_source_archive(${ARCHIVE}) -- cgit v1.2.3 From 8310c5af0a37bca24429d09cbd693b041efc76c2 Mon Sep 17 00:00:00 2001 From: Scott Date: Sun, 15 Jan 2017 12:08:53 -0800 Subject: FLTK Port --- ports/fltk/CONTROL | 4 ++ ports/fltk/findlibsfix.patch | 51 ++++++++++++++++++++ ports/fltk/portfile.cmake | 112 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 167 insertions(+) create mode 100644 ports/fltk/CONTROL create mode 100644 ports/fltk/findlibsfix.patch create mode 100644 ports/fltk/portfile.cmake diff --git a/ports/fltk/CONTROL b/ports/fltk/CONTROL new file mode 100644 index 000000000..4f8519550 --- /dev/null +++ b/ports/fltk/CONTROL @@ -0,0 +1,4 @@ +Source: fltk +Version: 1.3.4-1 +Description: FLTK (pronounced fulltick) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X. FLTK provides modern GUI functionality without the bloat and supports 3D graphics via OpenGL and its built-in GLUT emulation. +Build-Depends: zlib, libpng, libjpeg-turbo \ No newline at end of file diff --git a/ports/fltk/findlibsfix.patch b/ports/fltk/findlibsfix.patch new file mode 100644 index 000000000..6c2a7158a --- /dev/null +++ b/ports/fltk/findlibsfix.patch @@ -0,0 +1,51 @@ +diff --git a/CMake/resources.cmake b/CMake/resources.cmake +index 37c0c08..b1f52d1 100644 +--- a/CMake/resources.cmake ++++ b/CMake/resources.cmake +@@ -26,10 +26,10 @@ find_file(HAVE_DLFCN_H dlfcn.h) + find_file(HAVE_FREETYPE_H freetype.h PATH_SUFFIXES freetype2 freetype2/freetype) + find_file(HAVE_GL_GL_H GL/gl.h) + find_file(HAVE_GL_GLU_H GL/glu.h) +-find_file(HAVE_LIBPNG_PNG_H libpng/png.h) ++#find_file(HAVE_LIBPNG_PNG_H libpng/png.h) + find_file(HAVE_LOCALE_H locale.h) + find_file(HAVE_OPENGL_GLU_H OpenGL/glu.h) +-find_file(HAVE_PNG_H png.h) ++#find_file(HAVE_PNG_H png.h) + find_file(HAVE_PTHREAD_H pthread.h) + find_file(HAVE_STDIO_H stdio.h) + find_file(HAVE_STRINGS_H strings.h) +@@ -38,6 +38,17 @@ find_file(HAVE_SYS_STDTYPES_H sys/stdtypes.h) + find_file(HAVE_X11_XREGION_H X11/Xregion.h) + find_path(HAVE_XDBE_H Xdbe.h PATH_SUFFIXES X11/extensions extensions) + ++find_package(PNG REQUIRED) ++if(PNG_FOUND) ++ set(LIB_png ${PNG_LIBRARIES}) ++ set(HAVE_PNG_H ${PNG_FOUND}) ++ ++endif() ++find_package(ZLIB REQUIRED) ++if(ZLIB_FOUND) ++ set(LIB_zlib ${ZLIB_LIBRARIES}) ++endif() ++ + if (MSVC) + message(STATUS "Note: The following three headers should all be found!") + message(STATUS "HAVE_GL_GL_H = '${HAVE_GL_GL_H}'") +@@ -92,12 +103,12 @@ find_library(LIB_freetype freetype) + find_library(LIB_GL GL) + find_library(LIB_MesaGL MesaGL) + find_library(LIB_jpeg jpeg) +-find_library(LIB_png png) +-find_library(LIB_zlib z) ++#find_library(LIB_png png) ++#find_library(LIB_zlib z) + + mark_as_advanced(LIB_CAIRO LIB_dl LIB_fontconfig LIB_freetype) + mark_as_advanced(LIB_GL LIB_MesaGL) +-mark_as_advanced(LIB_jpeg LIB_png LIB_zlib) ++mark_as_advanced(LIB_jpeg) + + ####################################################################### + # functions diff --git a/ports/fltk/portfile.cmake b/ports/fltk/portfile.cmake new file mode 100644 index 000000000..a06b83310 --- /dev/null +++ b/ports/fltk/portfile.cmake @@ -0,0 +1,112 @@ +# 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/fltk-1.3.4-1) +vcpkg_download_distfile(ARCHIVE + URLS "http://fltk.org/pub/fltk/1.3.4/fltk-1.3.4-1-source.tar.gz" + FILENAME "fltk.tar.gz" + SHA512 0be1c8e6bb7a8c7ef484941a73868d5e40b90e97a8e5dc747bac2be53a350621975406ecfd4a9bcee8eeb7afd886e75bf7a6d6478fd6c56d16e54059f22f0891 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/fltk-1.3.4-1 + PATCHES "${CMAKE_CURRENT_LIST_DIR}/findlibsfix.patch" +) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(BUILD_SHARED ON) +else() + set(BUILD_SHARED OFF) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DOPTION_BUILD_EXAMPLES=OFF + -DOPTION_BUILD_SHARED_LIBS=${BUILD_SHARED} +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/CMAKE + ${CURRENT_PACKAGES_DIR}/debug/CMAKE + ${CURRENT_PACKAGES_DIR}/debug/include +) +file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/fluid.exe) +file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/fltk-config) + +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fluid.exe) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fltk-config) +vcpkg_copy_pdbs() + +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/libfltk_forms_SHAREDd.dll ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_forms.dll) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/libfltk_gl_SHAREDd.dll ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_gl.dll) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/libfltk_images_SHAREDd.dll ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_images.dll) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/libfltk_SHAREDd.dll ${CURRENT_PACKAGES_DIR}/debug/bin/fltk.dll) + + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/libfltk_forms_SHAREDd.pdb ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_forms.pdb) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/libfltk_gl_SHAREDd.pdb ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_gl.pdb) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/libfltk_images_SHAREDd.pdb ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_images.pdb) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/libfltk_SHAREDd.pdb ${CURRENT_PACKAGES_DIR}/debug/bin/fltk.pdb) + + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_formsd.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_gld.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_imagesd.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fltkd.lib) + + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_forms_SHAREDd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_formsd.lib) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_gl_SHAREDd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_gld.lib) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_images_SHAREDd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_imagesd.lib) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_SHAREDd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/fltkd.lib) + + file(RENAME ${CURRENT_PACKAGES_DIR}/bin/libfltk_forms_SHARED.dll ${CURRENT_PACKAGES_DIR}/bin/fltk_forms.dll) + file(RENAME ${CURRENT_PACKAGES_DIR}/bin/libfltk_gl_SHARED.dll ${CURRENT_PACKAGES_DIR}/bin/fltk_gl.dll) + file(RENAME ${CURRENT_PACKAGES_DIR}/bin/libfltk_images_SHARED.dll ${CURRENT_PACKAGES_DIR}/bin/fltk_images.dll) + file(RENAME ${CURRENT_PACKAGES_DIR}/bin/libfltk_SHARED.dll ${CURRENT_PACKAGES_DIR}/bin/fltk.dll) + + file(RENAME ${CURRENT_PACKAGES_DIR}/bin/libfltk_forms_SHARED.pdb ${CURRENT_PACKAGES_DIR}/bin/fltk_forms.pdb) + file(RENAME ${CURRENT_PACKAGES_DIR}/bin/libfltk_gl_SHARED.pdb ${CURRENT_PACKAGES_DIR}/bin/fltk_gl.pdb) + file(RENAME ${CURRENT_PACKAGES_DIR}/bin/libfltk_images_SHARED.pdb ${CURRENT_PACKAGES_DIR}/bin/fltk_images.pdb) + file(RENAME ${CURRENT_PACKAGES_DIR}/bin/libfltk_SHARED.pdb ${CURRENT_PACKAGES_DIR}/bin/fltk.pdb) + + + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/fltk_forms.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/fltk_gl.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/fltk_images.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/fltk.lib) + + file(RENAME ${CURRENT_PACKAGES_DIR}/lib/fltk_forms_SHARED.lib ${CURRENT_PACKAGES_DIR}/lib/fltk_forms.lib) + file(RENAME ${CURRENT_PACKAGES_DIR}/lib/fltk_gl_SHARED.lib ${CURRENT_PACKAGES_DIR}/lib/fltk_gl.lib) + file(RENAME ${CURRENT_PACKAGES_DIR}/lib/fltk_images_SHARED.lib ${CURRENT_PACKAGES_DIR}/lib/fltk_images.lib) + file(RENAME ${CURRENT_PACKAGES_DIR}/lib/fltk_SHARED.lib ${CURRENT_PACKAGES_DIR}/lib/fltk.lib) + +else() + file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/debug/bin + ${CURRENT_PACKAGES_DIR}/bin + ) + + +endif() + +file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_formsd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_forms.lib) +file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_gld.lib ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_gl.lib) +file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_imagesd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_images.lib) +file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fltkd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/fltk.lib) + + + +file(INSTALL + ${SOURCE_PATH}/COPYING + DESTINATION ${CURRENT_PACKAGES_DIR}/share/fltk + RENAME copyright +) -- cgit v1.2.3 From 2e7f683fde5958bc752b6ee56e436c650ca85a5d Mon Sep 17 00:00:00 2001 From: sdcb Date: Mon, 16 Jan 2017 12:24:26 +0800 Subject: [uvatlas] do not install the debug lib twice --- ports/uvatlas/portfile.cmake | 3 --- 1 file changed, 3 deletions(-) diff --git a/ports/uvatlas/portfile.cmake b/ports/uvatlas/portfile.cmake index 777742996..22b04326c 100644 --- a/ports/uvatlas/portfile.cmake +++ b/ports/uvatlas/portfile.cmake @@ -40,9 +40,6 @@ file(INSTALL file(INSTALL ${SOURCE_PATH}/UVAtlas/Bin/Desktop_2015/${BUILD_ARCH}/Debug/UVAtlas.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) -file(INSTALL - ${SOURCE_PATH}/UVAtlas/Bin/Desktop_2015/${BUILD_ARCH}/Debug/UVAtlas.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) # Handle copyright file(COPY ${SOURCE_PATH}/MIT.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/uvatlas) -- cgit v1.2.3 From 4ace533ad7fd7fe81e72bcb6926f2f6136137b11 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 16 Jan 2017 18:36:47 -0800 Subject: [protobuf] Attempt to make build more consistent --- ports/protobuf/portfile.cmake | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/ports/protobuf/portfile.cmake b/ports/protobuf/portfile.cmake index fa7748381..5853c1e4a 100644 --- a/ports/protobuf/portfile.cmake +++ b/ports/protobuf/portfile.cmake @@ -23,9 +23,21 @@ vcpkg_configure_cmake( -DCMAKE_INSTALL_CMAKEDIR=share/protobuf ) -vcpkg_install_cmake() +# Using 64-bit toolset to avoid occassional Linker Out-of-Memory issues. +vcpkg_install_cmake(MSVC_64_TOOLSET) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +# It appears that at this point the build hasn't actually finished. There is probably +# a process spawned by the build, therefore we need to wait a bit. + +function(protobuf_try_remove_recurse_wait PATH_TO_REMOVE) + file(REMOVE_RECURSE ${PATH_TO_REMOVE}) + if (EXISTS "${PATH_TO_REMOVE}") + execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 5) + file(REMOVE_RECURSE ${PATH_TO_REMOVE}) + endif() +endfunction() + +protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/debug/include) file(READ ${CURRENT_PACKAGES_DIR}/share/protobuf/protobuf-targets-release.cmake RELEASE_MODULE) string(REPLACE "\${_IMPORT_PREFIX}/bin/protoc.exe" "\${_IMPORT_PREFIX}/tools/protoc.exe" RELEASE_MODULE "${RELEASE_MODULE}") @@ -36,11 +48,9 @@ string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" DEBUG_MODULE "${D string(REPLACE "\${_IMPORT_PREFIX}/debug/bin/protoc.exe" "\${_IMPORT_PREFIX}/tools/protoc.exe" DEBUG_MODULE "${DEBUG_MODULE}") file(WRITE ${CURRENT_PACKAGES_DIR}/share/protobuf/protobuf-targets-debug.cmake "${DEBUG_MODULE}") -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) - -file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/protoc.exe) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/protoc.exe) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) +protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/debug/share) +protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/bin) +protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/debug/bin) file(INSTALL ${CURRENT_BUILDTREES_DIR}/src/protobuf-3.0.2/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/protobuf RENAME copyright) file(INSTALL ${CURRENT_BUILDTREES_DIR}/src/protobuf-3.0.2-win32/bin/protoc.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools) -- cgit v1.2.3 From 52ca9608e0603aaba42289e0a27bf8f2d21913b3 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Tue, 17 Jan 2017 10:33:42 +0100 Subject: Use ACE 6.4.2 which got released January 17th 2017 * ports/ace/CONTROL: * ports/ace/portfile.cmake: --- ports/ace/CONTROL | 2 +- ports/ace/portfile.cmake | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/ace/CONTROL b/ports/ace/CONTROL index 352d2b74a..9cc7ae116 100644 --- a/ports/ace/CONTROL +++ b/ports/ace/CONTROL @@ -1,3 +1,3 @@ Source: ace -Version: 6.4.0 +Version: 6.4.2 Description: The ADAPTIVE Communication Environment diff --git a/ports/ace/portfile.cmake b/ports/ace/portfile.cmake index 7c5d0e14a..a06016abd 100644 --- a/ports/ace/portfile.cmake +++ b/ports/ace/portfile.cmake @@ -5,9 +5,9 @@ endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ACE_wrappers/ace) vcpkg_download_distfile(ARCHIVE - URLS "http://download.dre.vanderbilt.edu/previous_versions/ACE-6.4.1.zip" - FILENAME "ACE-6.4.1.zip" - SHA512 ef914e02d5107a08bf9f60b4e9b16002cd4a7d2ec7b53fcf30d1563fd8684b963d17c54a8b7cb5efecb24ac291d8dc0002adb7c54dd190abebf35a2db0f5937c + URLS "http://download.dre.vanderbilt.edu/previous_versions/ACE-6.4.2.zip" + FILENAME "ACE-6.4.2.zip" + SHA512 587872ef1fb197829a085f4449d7beb2f161a782a2a552d26324154ae85fd463092e3c2a4dd0c6d93079ae798cc43269117ea069855b0af6804b49cad0a8c2ca ) vcpkg_extract_source_archive(${ARCHIVE}) -- cgit v1.2.3 From bc874e3db23709c54e0c32c31d9d72ff263edbcb Mon Sep 17 00:00:00 2001 From: Christian Ullrich Date: Mon, 16 Jan 2017 14:43:57 +0100 Subject: Fix Boost dynamic build. Some of the Boost libraries build differently depending on whether BOOST_X_DYN_LINK is defined, so this symbol must be present in the dynamic build, and removing it as part of disabling auto-link was wrong. Reverts half of 5a3881a0. --- ports/boost/CONTROL | 2 +- ports/boost/portfile.cmake | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ports/boost/CONTROL b/ports/boost/CONTROL index 01d6e9858..0abbac659 100644 --- a/ports/boost/CONTROL +++ b/ports/boost/CONTROL @@ -1,4 +1,4 @@ Source: boost -Version: 1.62-10 +Version: 1.62-11 Description: Peer-reviewed portable C++ source libraries Build-Depends: zlib diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake index 3fbd06982..0e25f34bc 100644 --- a/ports/boost/portfile.cmake +++ b/ports/boost/portfile.cmake @@ -113,6 +113,12 @@ file(APPEND ${CURRENT_PACKAGES_DIR}/include/boost/config/user.hpp "\n#define BOOST_ALL_NO_LIB\n" ) +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(APPEND ${CURRENT_PACKAGES_DIR}/include/boost/config/user.hpp + "\n#define BOOST_ALL_DYN_LINK\n" + ) +endif() + file(INSTALL ${SOURCE_PATH}/LICENSE_1_0.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/boost RENAME copyright) message(STATUS "Packaging headers done") -- cgit v1.2.3 From 97a2b5a793c439a8961f1c51dca4117d1cbd1cc2 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 17 Jan 2017 14:45:20 -0800 Subject: [zlib] Update to 1.2.11 --- 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 b12fe9e67..def1ef6be 100644 --- a/ports/zlib/CONTROL +++ b/ports/zlib/CONTROL @@ -1,3 +1,3 @@ Source: zlib -Version: 1.2.10 +Version: 1.2.11 Description: A compression library \ No newline at end of file diff --git a/ports/zlib/portfile.cmake b/ports/zlib/portfile.cmake index 81d54fb4b..26857f187 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.10) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/zlib-1.2.11) vcpkg_download_distfile(ARCHIVE_FILE - URLS "http://www.zlib.net/zlib-1.2.10.tar.gz" - FILENAME "zlib1210.tar.gz" - SHA512 5fa71052a418a0f2b345fce28af9941bbd1c6ee276ce506ab3092157f15776ee41f96bb1799657227513b852913f96ac52dae8122a437f34b43933ee48d63ee0 + URLS "http://www.zlib.net/zlib-1.2.11.tar.gz" + FILENAME "zlib1211.tar.gz" + SHA512 73fd3fff4adeccd4894084c15ddac89890cd10ef105dd5e1835e1e9bbb6a49ff229713bd197d203edfa17c2727700fce65a2a235f07568212d820dca88b528ae ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) -- cgit v1.2.3 From 0d50c6704ddc563f459b901297bbb909adaa6e51 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 17 Jan 2017 15:34:31 -0800 Subject: [zlib] Add sourceforge mirror --- 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 26857f187..0d53d9e89 100644 --- a/ports/zlib/portfile.cmake +++ b/ports/zlib/portfile.cmake @@ -1,7 +1,7 @@ include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/zlib-1.2.11) vcpkg_download_distfile(ARCHIVE_FILE - URLS "http://www.zlib.net/zlib-1.2.11.tar.gz" + URLS "http://www.zlib.net/zlib-1.2.11.tar.gz" "https://downloads.sourceforge.net/project/libpng/zlib/1.2.11/zlib-1.2.11.tar.gz" FILENAME "zlib1211.tar.gz" SHA512 73fd3fff4adeccd4894084c15ddac89890cd10ef105dd5e1835e1e9bbb6a49ff229713bd197d203edfa17c2727700fce65a2a235f07568212d820dca88b528ae ) -- cgit v1.2.3 From 4d9a9d44feea07998878b741daebf110bb86574a Mon Sep 17 00:00:00 2001 From: flysha Date: Wed, 18 Jan 2017 22:20:32 +0800 Subject: [dx] upgrade to 1.0.1 --- ports/dx/CONTROL | 2 +- ports/dx/portfile.cmake | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/dx/CONTROL b/ports/dx/CONTROL index 460e42bdb..ac226a66a 100644 --- a/ports/dx/CONTROL +++ b/ports/dx/CONTROL @@ -1,3 +1,3 @@ Source: dx -Version: 1.0.0 +Version: 1.0.1 Description: A modern C++ library for DirectX programming \ No newline at end of file diff --git a/ports/dx/portfile.cmake b/ports/dx/portfile.cmake index 085f30c01..d607e5ed0 100644 --- a/ports/dx/portfile.cmake +++ b/ports/dx/portfile.cmake @@ -1,10 +1,10 @@ #header-only library include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/dx-1.0.0) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/dx-1.0.1) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/sdcb/dx/archive/1.0.0.tar.gz" - FILENAME "dx-1.0.0.tar.gz" - SHA512 7d0e0550eb27c3a7d3a9c4b78f29290aaf60c02a7c2fabb6e4769673592bc031f8ed430cd777e02096b9b9a8981c7e05b45448bf5c182704e080e61eaeab62f8 + URLS "https://github.com/sdcb/dx/archive/v1.0.1.tar.gz" + FILENAME "dx-1.0.1.tar.gz" + SHA512 b40eb4daf774bfdb394b207bb29652fbf44361f5d8f9b60509c7a3215cd403dbf0c10454979c0c2e97d839496ef20940070a42837375993cd67d58afacc990e0 ) vcpkg_extract_source_archive(${ARCHIVE}) -- cgit v1.2.3 From 93f400baf957c7553e31dbec44990899450562f1 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 18 Jan 2017 13:47:14 -0800 Subject: Update CHANGELOG and bump version to v0.0.67 --- CHANGELOG.md | 34 ++++++++++++++++++++++++++++++++++ toolsrc/VERSION.txt | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c052325a9..103417bad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,37 @@ +vcpkg (0.0.67) +-------------- + * Add ports: + - cereal 1.2.1 + - directxmesh oct2016 + - directxtex dec2016 + - metis 5.1.0 + - sdl2-image 2.0.1 + - szip 2.1 + * Update ports: + - ace 6.4.0 -> 6.4.2 + - boost 1.62-9 -> 1.62-11 + - curl 7.51.0-2 -> 7.51.0-3 + - directxtk oct2016-1 -> dec2016 + - directxtk12 oct2016 -> dec2016 + - freetype 2.6.3-3 -> 2.6.3-4 + - glew 2.0.0 -> 2.0.0-1 + - grpc 1.1.0-dev-1674f65 -> 1.1.0-dev-1674f65-1 + - http-parser 2.7.1 -> 2.7.1-1 + - libssh2 1.8.0 -> 1.8.0-1 + - libwebsockets 2.0.0 -> 2.0.0-1 + - openssl 1.0.2j-1 -> 1.0.2j-2 + - tiff 4.0.6-1 -> 4.0.6-2 + - zlib 1.2.10 -> 1.2.11 + * Add 7z to `vcpkg_find_acquire_program.cmake` + * Enhance `vcpkg_build_cmake.cmake` and `vcpkg_install_cmake.cmake`: + - Add option to disable parallel building (it is enabled by default) + - Add option to use the 64-bit toolset (for the 32-bit builds; output binaries are still 32-bit) + * Fix bug in `applocal.ps1` that would infinitely recurse when there were no depenndencies + * Fixes and improvements in existing portfiles and the `vcpkg` tool itself + +-- vcpkg team WED, 18 Jan 2017 13:45:00 -0800 + + vcpkg (0.0.66) -------------- * Add ports: diff --git a/toolsrc/VERSION.txt b/toolsrc/VERSION.txt index 475a4440c..8afb66b09 100644 --- a/toolsrc/VERSION.txt +++ b/toolsrc/VERSION.txt @@ -1 +1 @@ -"0.0.66" \ No newline at end of file +"0.0.67" \ No newline at end of file -- cgit v1.2.3 From ff40fcaf95a6da48d46ecffc886d6b5d724d004b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 18 Jan 2017 14:29:01 -0800 Subject: [pcre] Update to 8.39. Add sourceforge mirror --- ports/pcre/portfile.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/pcre/portfile.cmake b/ports/pcre/portfile.cmake index 8fd6c8819..87f4ec7cb 100644 --- a/ports/pcre/portfile.cmake +++ b/ports/pcre/portfile.cmake @@ -7,11 +7,11 @@ # include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/pcre-8.38) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/pcre-8.39) vcpkg_download_distfile(ARCHIVE - URLS "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.zip" - FILENAME "pcre-8.38.zip" - SHA512 82f1c2bdd0a6cc086e3734621ac7a2773cb28f42cf5e400b9bbe8c16655465d9367bce82c6db69577c40ec137b30f1b2443a8d91998a514f81e1c2210828a113 + URLS "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.39.zip" "https://downloads.sourceforge.net/project/pcre/pcre/8.39/pcre-8.39.zip" + FILENAME "pcre-8.39.zip" + SHA512 14e6336fe603b7110ba9d54a92af8449bbd4a82fe33d14bc912a048336fc90686464354141316c7890e80e7501af88f657cb7247de6717674e80ba044a279a00 ) vcpkg_extract_source_archive(${ARCHIVE}) -- cgit v1.2.3 From 083dfc4d9cebd816b870186d10fbf591c1f13807 Mon Sep 17 00:00:00 2001 From: Olaf Date: Thu, 19 Jan 2017 14:23:52 +0100 Subject: Package lzo --- ports/lzo/CONTROL | 3 +++ ports/lzo/portfile.cmake | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 ports/lzo/CONTROL create mode 100644 ports/lzo/portfile.cmake diff --git a/ports/lzo/CONTROL b/ports/lzo/CONTROL new file mode 100644 index 000000000..afc3540d2 --- /dev/null +++ b/ports/lzo/CONTROL @@ -0,0 +1,3 @@ +Source: lzo +Version: 2.09 +Description: Lossless data compression library diff --git a/ports/lzo/portfile.cmake b/ports/lzo/portfile.cmake new file mode 100644 index 000000000..a8a91e5e5 --- /dev/null +++ b/ports/lzo/portfile.cmake @@ -0,0 +1,32 @@ +# 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/lzo-2.09) +vcpkg_download_distfile(ARCHIVE + URLS "http://www.oberhumer.com/opensource/lzo/download/lzo-2.09.tar.gz" + FILENAME "lzo-2.09.tar.gz" + SHA512 7c64e5e7d2050d75ac8c59d613f6f7230b74746b1d207666755b07450053c8b73980f12f8a1ec59d2af0bada02beec126aaacb675b8088b5fe65e97ff7e6bfc7 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +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() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + +# Handle copyright +file(COPY ${CURRENT_BUILDTREES_DIR}/src/lzo-2.09/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/lzo) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/lzo/COPYING ${CURRENT_PACKAGES_DIR}/share/lzo/copyright) -- cgit v1.2.3 From d4c63a8a5c9744a1a0bd14b14075b4f4664032bc Mon Sep 17 00:00:00 2001 From: Olaf van der Spek Date: Thu, 19 Jan 2017 14:36:45 +0100 Subject: Replace cpprest by sqlite3 --- docs/EXAMPLES.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/EXAMPLES.md b/docs/EXAMPLES.md index 7862ba354..6302dab07 100644 --- a/docs/EXAMPLES.md +++ b/docs/EXAMPLES.md @@ -64,7 +64,7 @@ Package sqlite3:x86-windows is installed ``` In addition to installing, `vcpkg` caches a pristine copy of the built library inside the `packages\` directory -- in this case, `packages\sqlite3_x86-windows`. This allows you to quickly uninstall and reinstall the library in the future using the `remove` and `install` commands. -We can check that cpprestsdk was successfully installed for x86 windows desktop by running the `list` command. +We can check that sqlite3 was successfully installed for x86 windows desktop by running the `list` command. ``` PS D:\src\vcpkg> .\vcpkg list sqlite3:x86-windows 3.15.0 SQLite is a software library that implements a se... @@ -72,7 +72,7 @@ sqlite3:x86-windows 3.15.0 SQLite is a software library that i To install for other architectures and platforms such as Universal Windows Platform or x64 Desktop, you can suffix the package name with `:`. ``` -PS D:\src\vcpkg> .\vcpkg install cpprestsdk:x86-uwp zlib:x64-windows +PS D:\src\vcpkg> .\vcpkg install sqlite3:x86-uwp zlib:x64-windows ``` See `vcpkg help triplet` for all supported targets. -- cgit v1.2.3 From 882004a819bb943e970128fd30f456e9aab68eaa Mon Sep 17 00:00:00 2001 From: codicodi Date: Thu, 19 Jan 2017 18:06:42 +0100 Subject: add-fontconfig --- ports/fontconfig/CMakeLists.txt | 80 ++++++++ ports/fontconfig/CONTROL | 4 + ports/fontconfig/include/config.h | 267 +++++++++++++++++++++++++ ports/fontconfig/include/fcaliastail.h | 1 + ports/fontconfig/include/fcftaliastail.h | 1 + ports/fontconfig/include/fcobjshash.h | 328 +++++++++++++++++++++++++++++++ ports/fontconfig/include/fcstdint.h | 8 + ports/fontconfig/include/unistd.h | 21 ++ ports/fontconfig/portfile.cmake | 34 ++++ 9 files changed, 744 insertions(+) create mode 100644 ports/fontconfig/CMakeLists.txt create mode 100644 ports/fontconfig/CONTROL create mode 100644 ports/fontconfig/include/config.h create mode 100644 ports/fontconfig/include/fcaliastail.h create mode 100644 ports/fontconfig/include/fcftaliastail.h create mode 100644 ports/fontconfig/include/fcobjshash.h create mode 100644 ports/fontconfig/include/fcstdint.h create mode 100644 ports/fontconfig/include/unistd.h create mode 100644 ports/fontconfig/portfile.cmake diff --git a/ports/fontconfig/CMakeLists.txt b/ports/fontconfig/CMakeLists.txt new file mode 100644 index 000000000..f8412ac94 --- /dev/null +++ b/ports/fontconfig/CMakeLists.txt @@ -0,0 +1,80 @@ +cmake_minimum_required(VERSION 3.0) +project(fontconfig) + +add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS) +add_definitions(-FI${FC_INCLUDE_DIR}/config.h) + +if(CMAKE_BUILD_TYPE STREQUAL Debug) + set(LIB_SUFFIX d) +endif() + +# find dependencies +find_path(ICONV_INCLUDE_DIR iconv.h) +find_library(ICONV_LIBRARY NAMES iconv libiconv) +find_path(FREETYPE_INCLUDE_DIR ft2build.h) +find_library(FREETYPE_LIBRARY freetype${LIB_SUFFIX}) +find_path(EXPAT_INCLUDE_DIR expat.h) +find_library(EXPAT_LIBRARY expat) + +add_library(fontconfig + src/fcatomic.c + src/fcblanks.c + src/fccache.c + src/fccfg.c + src/fccharset.c + src/fccompat.c + src/fcdbg.c + src/fcdefault.c + src/fcdir.c + src/fcformat.c + src/fcfreetype.c + src/fcfs.c + src/fcinit.c + src/fclang.c + src/fclist.c + src/fcmatch.c + src/fcmatrix.c + src/fcname.c + src/fcobjs.c + src/fcpat.c + src/fcrange.c + src/fcserialize.c + src/fcstat.c + src/fcstr.c + src/fcweight.c + src/fcxml.c + src/ftglue.c) + +target_include_directories(fontconfig PRIVATE . + ${FC_INCLUDE_DIR} + ${FREETYPE_INCLUDE_DIR} + ${EXPAT_INCLUDE_DIR} + ${ICONV_INCLUDE_DIR}) + +target_link_libraries(fontconfig + ${FREETYPE_LIBRARY} + ${ICONV_LIBRARY} + ${EXPAT_LIBRARY}) + +install(TARGETS fontconfig + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) + +if(NOT FC_SKIP_HEADERS) + install(FILES + fontconfig/fontconfig.h + fontconfig/fcfreetype.h + fontconfig/fcprivate.h + DESTINATION include/fontconfig) +endif() + +if(NOT FC_SKIP_TOOLS) + set(FC_DEFAULT_FONTS WINDOWSFONTDIR) + set(FC_FONTPATH) + set(FC_CACHEDIR WINDOWSTEMPDIR_FONTCONFIG_CACHE) + set(CONFIGDIR ./fonts/conf.d) + configure_file(fonts.conf.in ${CMAKE_SOURCE_DIR}/fonts.conf @ONLY) + install(FILES fonts.conf DESTINATION tools/fontconfig/fonts) + install(DIRECTORY conf.d DESTINATION tools/fontconfig/fonts FILES_MATCHING PATTERN "*.conf") +endif() diff --git a/ports/fontconfig/CONTROL b/ports/fontconfig/CONTROL new file mode 100644 index 000000000..ecb371f15 --- /dev/null +++ b/ports/fontconfig/CONTROL @@ -0,0 +1,4 @@ +Source: fontconfig +Version: 2.12.1 +Description: Library for configuring and customizing font access. +Build-Depends: freetype, expat, libiconv diff --git a/ports/fontconfig/include/config.h b/ports/fontconfig/include/config.h new file mode 100644 index 000000000..8f21dda01 --- /dev/null +++ b/ports/fontconfig/include/config.h @@ -0,0 +1,267 @@ + +#define FC_CACHEDIR "./" + +/* The normal alignment of `double', in bytes. */ +#define ALIGNOF_DOUBLE 8 + +/* Use libxml2 instead of Expat */ +/* #undef ENABLE_LIBXML2 */ + +/* Additional font directories */ +#define FC_ADD_FONTS "yes" + +/* Architecture prefix to use for cache file names */ +/* #undef FC_ARCHITECTURE */ + +/* System font directory */ +#define FC_DEFAULT_FONTS "c:/windows/fonts" + +/* Define to nothing if C supports flexible array members, and to 1 if it does + not. That way, with a declaration like `struct s { int n; double + d[FLEXIBLE_ARRAY_MEMBER]; };', the struct hack can be used with pre-C99 + compilers. When computing the size of such an object, don't use 'sizeof + (struct s)' as it overestimates the size. Use 'offsetof (struct s, d)' + instead. Don't use 'offsetof (struct s, d[0])', as this doesn't work with + MSVC and with C++ compilers. */ +#define FLEXIBLE_ARRAY_MEMBER /**/ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#define HAVE_DIRENT_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DLFCN_H */ + +/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ +/* #undef HAVE_DOPRNT */ + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the `fstatfs' function. */ +/* #undef HAVE_FSTATFS */ + +/* Define to 1 if you have the `fstatvfs' function. */ +/* #undef HAVE_FSTATVFS */ + +/* FT_Bitmap_Size structure includes y_ppem field */ +#define HAVE_FT_BITMAP_SIZE_Y_PPEM 1 + +/* Define to 1 if you have the `FT_Get_BDF_Property' function. */ +#define HAVE_FT_GET_BDF_PROPERTY 1 + +/* Define to 1 if you have the `FT_Get_Next_Char' function. */ +#define HAVE_FT_GET_NEXT_CHAR 1 + +/* Define to 1 if you have the `FT_Get_PS_Font_Info' function. */ +#define HAVE_FT_GET_PS_FONT_INFO 1 + +/* Define to 1 if you have the `FT_Get_X11_Font_Format' function. */ +#define HAVE_FT_GET_X11_FONT_FORMAT 1 + +/* Define to 1 if you have the `FT_Has_PS_Glyph_Names' function. */ +#define HAVE_FT_HAS_PS_GLYPH_NAMES 1 + +/* Define to 1 if you have the `FT_Select_Size' function. */ +#define HAVE_FT_SELECT_SIZE 1 + +/* Define to 1 if you have the `getexecname' function. */ +/* #undef HAVE_GETEXECNAME */ + +/* Define to 1 if you have the `getopt' function. */ +#define HAVE_GETOPT 1 + +/* Define to 1 if you have the `getopt_long' function. */ +#define HAVE_GETOPT_LONG 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the `getprogname' function. */ +/* #undef HAVE_GETPROGNAME */ + +/* Have Intel __sync_* atomic primitives */ +#define HAVE_INTEL_ATOMIC_PRIMITIVES 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `link' function. */ +/* #undef HAVE_LINK */ + +/* Define to 1 if you have the `lrand48' function. */ +/* #undef HAVE_LRAND48 */ + +/* Define to 1 if you have the `lstat' function. */ +/* #undef HAVE_LSTAT */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mkdtemp' function. */ +/* #undef HAVE_MKDTEMP */ + +/* Define to 1 if you have the `mkostemp' function. */ +/* #undef HAVE_MKOSTEMP */ + +/* Define to 1 if you have the `mkstemp' function. */ +/* #undef HAVE_MKSTEMP */ + +/* Define to 1 if you have a working `mmap' system call. */ +/* #undef HAVE_MMAP */ + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +/* #undef HAVE_NDIR_H */ + +/* Define to 1 if you have the 'posix_fadvise' function. */ +/* #undef HAVE_POSIX_FADVISE */ + +/* Have POSIX threads */ +/* #undef HAVE_PTHREAD */ + +/* Have PTHREAD_PRIO_INHERIT. */ +/* #undef HAVE_PTHREAD_PRIO_INHERIT */ + +/* Define to 1 if you have the `rand' function. */ +#define HAVE_RAND 1 + +/* Define to 1 if you have the `random' function. */ +/* #undef HAVE_RANDOM */ + +/* Define to 1 if you have the `random_r' function. */ +/* #undef HAVE_RANDOM_R */ + +/* Define to 1 if you have the `rand_r' function. */ +/* #undef HAVE_RAND_R */ + +/* Define to 1 if you have the `readlink' function. */ +/* #undef HAVE_READLINK */ + +/* Define to 1 if you have the 'scandir' function. */ +/* #undef HAVE_SCANDIR */ + +/* Define to 1 if you have the 'scandir' function with int (* compar)(const + void *, const void *) */ +/* #undef HAVE_SCANDIR_VOID_P */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SCHED_H */ + +/* Have sched_yield */ +/* #undef HAVE_SCHED_YIELD */ + +/* Have Solaris __machine_*_barrier and atomic_* operations */ +/* #undef HAVE_SOLARIS_ATOMIC_OPS */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STRINGS_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if `d_type' is a member of `struct dirent'. */ +/* #undef HAVE_STRUCT_DIRENT_D_TYPE */ + +/* Define to 1 if `st_mtim' is a member of `struct stat'. */ +/* #undef HAVE_STRUCT_STAT_ST_MTIM */ + +/* Define to 1 if `f_flags' is a member of `struct statfs'. */ +/* #undef HAVE_STRUCT_STATFS_F_FLAGS */ + +/* Define to 1 if `f_fstypename' is a member of `struct statfs'. */ +/* #undef HAVE_STRUCT_STATFS_F_FSTYPENAME */ + +/* Define to 1 if `f_basetype' is a member of `struct statvfs'. */ +/* #undef HAVE_STRUCT_STATVFS_F_BASETYPE */ + +/* Define to 1 if `f_fstypename' is a member of `struct statvfs'. */ +/* #undef HAVE_STRUCT_STATVFS_F_FSTYPENAME */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_DIR_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_MOUNT_H */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_NDIR_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_PARAM_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_STATFS_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_VFS_H */ + +/* Define to 1 if `usLowerOpticalPointSize' is a member of `TT_OS2'. */ +/* #undef HAVE_TT_OS2_USLOWEROPTICALPOINTSIZE */ + +/* Define to 1 if `usUpperOpticalPointSize' is a member of `TT_OS2'. */ +/* #undef HAVE_TT_OS2_USUPPEROPTICALPOINTSIZE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the `vprintf' function. */ +#define HAVE_VPRINTF 1 + +/* Can use #warning in C files */ +#define HAVE_WARNING_CPP_DIRECTIVE 1 + +/* Use xmlparse.h instead of expat.h */ +/* #undef HAVE_XMLPARSE_H */ + +/* Define to 1 if you have the `XML_SetDoctypeDeclHandler' function. */ +#define HAVE_XML_SETDOCTYPEDECLHANDLER 1 + +/* Define to 1 if you have the `_mktemp_s' function. */ +#define HAVE__MKTEMP_S 1 + +/* Define to necessary symbol if this constant + uses a non-standard name on + your system. */ +/* #undef PTHREAD_CREATE_JOINABLE */ + +/* The size of `char', as computed by sizeof. */ +#define SIZEOF_CHAR 1 + +/* The size of `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `short', as computed by sizeof. */ +#define SIZEOF_SHORT 2 + +/* The size of `void*', as computed by sizeof. */ +/* The size of `void *', as computed by sizeof. */ +#if defined(_WIN64) +#define SIZEOF_VOIDP 8 +#define SIZEOF_VOID_P 8 +#else +#define SIZEOF_VOIDP 4 +#define SIZEOF_VOID_P 4 +#endif + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Use iconv. */ +#define USE_ICONV 1 \ No newline at end of file diff --git a/ports/fontconfig/include/fcaliastail.h b/ports/fontconfig/include/fcaliastail.h new file mode 100644 index 000000000..a9eae81f2 --- /dev/null +++ b/ports/fontconfig/include/fcaliastail.h @@ -0,0 +1 @@ +/* intentionally empty */ diff --git a/ports/fontconfig/include/fcftaliastail.h b/ports/fontconfig/include/fcftaliastail.h new file mode 100644 index 000000000..a9eae81f2 --- /dev/null +++ b/ports/fontconfig/include/fcftaliastail.h @@ -0,0 +1 @@ +/* intentionally empty */ diff --git a/ports/fontconfig/include/fcobjshash.h b/ports/fontconfig/include/fcobjshash.h new file mode 100644 index 000000000..1fe860a2f --- /dev/null +++ b/ports/fontconfig/include/fcobjshash.h @@ -0,0 +1,328 @@ +/* ANSI-C code produced by gperf version 3.0.4 */ +/* Command-line: gperf -m 100 src/fcobjshash.gperf */ +/* Computed positions: -k'2-3' */ + +#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ + && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ + && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ + && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ + && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ + && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ + && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ + && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \ + && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \ + && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \ + && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ + && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \ + && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \ + && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \ + && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \ + && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \ + && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \ + && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \ + && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \ + && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \ + && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \ + && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ + && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)) +/* The character set is not based on ISO-646. */ +#error "gperf generated tables don't work with this execution character set. Please report a bug to ." +#endif + +#line 1 "src/fcobjshash.gperf" + +#line 13 "src/fcobjshash.gperf" +struct FcObjectTypeInfo { +int name; +int id; +}; +#include +/* maximum key range = 56, duplicates = 0 */ + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static unsigned int +FcObjectTypeHash (register const char *str, register unsigned int len) +{ + static const unsigned char asso_values[] = + { + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 21, 30, 3, + 36, 45, 60, 3, 15, 0, 60, 60, 0, 9, + 9, 0, 21, 60, 0, 0, 15, 0, 60, 60, + 0, 15, 24, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60 + }; + return len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[1]]; +} + +struct FcObjectTypeNamePool_t + { + char FcObjectTypeNamePool_str4[sizeof("file")]; + char FcObjectTypeNamePool_str5[sizeof("color")]; + char FcObjectTypeNamePool_str7[sizeof("foundry")]; + char FcObjectTypeNamePool_str8[sizeof("fullname")]; + char FcObjectTypeNamePool_str9[sizeof("pixelsize")]; + char FcObjectTypeNamePool_str10[sizeof("prgname")]; + char FcObjectTypeNamePool_str12[sizeof("fullnamelang")]; + char FcObjectTypeNamePool_str13[sizeof("globaladvance")]; + char FcObjectTypeNamePool_str14[sizeof("postscriptname")]; + char FcObjectTypeNamePool_str16[sizeof("hinting")]; + char FcObjectTypeNamePool_str17[sizeof("minspace")]; + char FcObjectTypeNamePool_str18[sizeof("hintstyle")]; + char FcObjectTypeNamePool_str19[sizeof("fontformat")]; + char FcObjectTypeNamePool_str20[sizeof("fontversion")]; + char FcObjectTypeNamePool_str21[sizeof("fontfeatures")]; + char FcObjectTypeNamePool_str22[sizeof("outline")]; + char FcObjectTypeNamePool_str23[sizeof("autohint")]; + char FcObjectTypeNamePool_str24[sizeof("dpi")]; + char FcObjectTypeNamePool_str25[sizeof("hash")]; + char FcObjectTypeNamePool_str26[sizeof("slant")]; + char FcObjectTypeNamePool_str27[sizeof("aspect")]; + char FcObjectTypeNamePool_str28[sizeof("size")]; + char FcObjectTypeNamePool_str29[sizeof("scale")]; + char FcObjectTypeNamePool_str30[sizeof("symbol")]; + char FcObjectTypeNamePool_str31[sizeof("rasterizer")]; + char FcObjectTypeNamePool_str32[sizeof("scalable")]; + char FcObjectTypeNamePool_str33[sizeof("antialias")]; + char FcObjectTypeNamePool_str34[sizeof("lang")]; + char FcObjectTypeNamePool_str35[sizeof("style")]; + char FcObjectTypeNamePool_str36[sizeof("family")]; + char FcObjectTypeNamePool_str37[sizeof("rgba")]; + char FcObjectTypeNamePool_str38[sizeof("namelang")]; + char FcObjectTypeNamePool_str39[sizeof("stylelang")]; + char FcObjectTypeNamePool_str40[sizeof("familylang")]; + char FcObjectTypeNamePool_str41[sizeof("width")]; + char FcObjectTypeNamePool_str42[sizeof("matrix")]; + char FcObjectTypeNamePool_str43[sizeof("charset")]; + char FcObjectTypeNamePool_str45[sizeof("charwidth")]; + char FcObjectTypeNamePool_str46[sizeof("charheight")]; + char FcObjectTypeNamePool_str47[sizeof("embolden")]; + char FcObjectTypeNamePool_str48[sizeof("lcdfilter")]; + char FcObjectTypeNamePool_str49[sizeof("spacing")]; + char FcObjectTypeNamePool_str50[sizeof("index")]; + char FcObjectTypeNamePool_str51[sizeof("weight")]; + char FcObjectTypeNamePool_str52[sizeof("capability")]; + char FcObjectTypeNamePool_str53[sizeof("embeddedbitmap")]; + char FcObjectTypeNamePool_str58[sizeof("decorative")]; + char FcObjectTypeNamePool_str59[sizeof("verticallayout")]; + }; +static const struct FcObjectTypeNamePool_t FcObjectTypeNamePool_contents = + { + "file", + "color", + "foundry", + "fullname", + "pixelsize", + "prgname", + "fullnamelang", + "globaladvance", + "postscriptname", + "hinting", + "minspace", + "hintstyle", + "fontformat", + "fontversion", + "fontfeatures", + "outline", + "autohint", + "dpi", + "hash", + "slant", + "aspect", + "size", + "scale", + "symbol", + "rasterizer", + "scalable", + "antialias", + "lang", + "style", + "family", + "rgba", + "namelang", + "stylelang", + "familylang", + "width", + "matrix", + "charset", + "charwidth", + "charheight", + "embolden", + "lcdfilter", + "spacing", + "index", + "weight", + "capability", + "embeddedbitmap", + "decorative", + "verticallayout" + }; +#define FcObjectTypeNamePool ((const char *) &FcObjectTypeNamePool_contents) +#ifdef __GNUC__ +__inline +#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif +#endif +const struct FcObjectTypeInfo * +FcObjectTypeLookup (register const char *str, register unsigned int len) +{ + enum + { + TOTAL_KEYWORDS = 48, + MIN_WORD_LENGTH = 3, + MAX_WORD_LENGTH = 14, + MIN_HASH_VALUE = 4, + MAX_HASH_VALUE = 59 + }; + + static const struct FcObjectTypeInfo wordlist[] = + { + {-1}, {-1}, {-1}, {-1}, +#line 38 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str4,FC_FILE_OBJECT}, +#line 64 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str5,FC_COLOR_OBJECT}, + {-1}, +#line 31 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str7,FC_FOUNDRY_OBJECT}, +#line 22 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str8,FC_FULLNAME_OBJECT}, +#line 29 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str9,FC_PIXEL_SIZE_OBJECT}, +#line 61 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str10,FC_PRGNAME_OBJECT}, + {-1}, +#line 23 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str12,FC_FULLNAMELANG_OBJECT}, +#line 37 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str13,FC_GLOBAL_ADVANCE_OBJECT}, +#line 63 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str14,FC_POSTSCRIPT_NAME_OBJECT}, + {-1}, +#line 34 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str16,FC_HINTING_OBJECT}, +#line 46 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str17,FC_MINSPACE_OBJECT}, +#line 33 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str18,FC_HINT_STYLE_OBJECT}, +#line 54 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str19,FC_FONTFORMAT_OBJECT}, +#line 52 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str20,FC_FONTVERSION_OBJECT}, +#line 60 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str21,FC_FONT_FEATURES_OBJECT}, +#line 41 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str22,FC_OUTLINE_OBJECT}, +#line 36 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str23,FC_AUTOHINT_OBJECT}, +#line 43 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str24,FC_DPI_OBJECT}, +#line 62 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str25,FC_HASH_OBJECT}, +#line 24 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str26,FC_SLANT_OBJECT}, +#line 28 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str27,FC_ASPECT_OBJECT}, +#line 27 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str28,FC_SIZE_OBJECT}, +#line 45 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str29,FC_SCALE_OBJECT}, +#line 65 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str30,FC_SYMBOL_OBJECT}, +#line 40 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str31,FC_RASTERIZER_OBJECT}, +#line 42 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str32,FC_SCALABLE_OBJECT}, +#line 32 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str33,FC_ANTIALIAS_OBJECT}, +#line 51 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str34,FC_LANG_OBJECT}, +#line 20 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str35,FC_STYLE_OBJECT}, +#line 18 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str36,FC_FAMILY_OBJECT}, +#line 44 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str37,FC_RGBA_OBJECT}, +#line 59 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str38,FC_NAMELANG_OBJECT}, +#line 21 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str39,FC_STYLELANG_OBJECT}, +#line 19 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str40,FC_FAMILYLANG_OBJECT}, +#line 26 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str41,FC_WIDTH_OBJECT}, +#line 49 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str42,FC_MATRIX_OBJECT}, +#line 50 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str43,FC_CHARSET_OBJECT}, + {-1}, +#line 47 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str45,FC_CHAR_WIDTH_OBJECT}, +#line 48 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str46,FC_CHAR_HEIGHT_OBJECT}, +#line 55 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str47,FC_EMBOLDEN_OBJECT}, +#line 58 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str48,FC_LCD_FILTER_OBJECT}, +#line 30 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str49,FC_SPACING_OBJECT}, +#line 39 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str50,FC_INDEX_OBJECT}, +#line 25 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str51,FC_WEIGHT_OBJECT}, +#line 53 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str52,FC_CAPABILITY_OBJECT}, +#line 56 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str53,FC_EMBEDDED_BITMAP_OBJECT}, + {-1}, {-1}, {-1}, {-1}, +#line 57 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str58,FC_DECORATIVE_OBJECT}, +#line 35 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str59,FC_VERTICAL_LAYOUT_OBJECT} + }; + + if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) + { + register int key = FcObjectTypeHash (str, len); + + if (key <= MAX_HASH_VALUE && key >= 0) + { + register int o = wordlist[key].name; + if (o >= 0) + { + register const char *s = o + FcObjectTypeNamePool; + + if (*str == *s && !strcmp (str + 1, s + 1)) + return &wordlist[key]; + } + } + } + return 0; +} diff --git a/ports/fontconfig/include/fcstdint.h b/ports/fontconfig/include/fcstdint.h new file mode 100644 index 000000000..1a8be6ef0 --- /dev/null +++ b/ports/fontconfig/include/fcstdint.h @@ -0,0 +1,8 @@ +#ifndef _FONTCONFIG_SRC_FCSTDINT_H +#define _FONTCONFIG_SRC_FCSTDINT_H 1 +#ifndef _GENERATED_STDINT_H +#define _GENERATED_STDINT_H "fontconfig 2.12.1" +#define _STDINT_HAVE_STDINT_H 1 +#include +#endif +#endif diff --git a/ports/fontconfig/include/unistd.h b/ports/fontconfig/include/unistd.h new file mode 100644 index 000000000..7d04abe29 --- /dev/null +++ b/ports/fontconfig/include/unistd.h @@ -0,0 +1,21 @@ +/* Minimal unistd.h, just to get fontconfig to compile */ +#ifndef UNISTD_H +#define UNISTD_H + +#include + +#ifndef R_OK +#define R_OK 4 +#endif + +#ifndef W_OK +#define W_OK 2 +#endif + +#ifndef F_OK +#define F_OK 0 +#endif + +typedef int mode_t; + +#endif \ No newline at end of file diff --git a/ports/fontconfig/portfile.cmake b/ports/fontconfig/portfile.cmake new file mode 100644 index 000000000..06bff2aa0 --- /dev/null +++ b/ports/fontconfig/portfile.cmake @@ -0,0 +1,34 @@ + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/fontconfig-2.12.1) +vcpkg_download_distfile(ARCHIVE + URLS "https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.12.1.tar.gz" + FILENAME "fontconfig-2.12.1.tar.gz" + SHA512 0959a80522e09551e49ec7b2383b7dfb319d4e1c058ad0b55bb35d3f675acbb7ff08c9c30a8798b731070687f84dd3d2ff7e28aafac6ecfa9d3f85c5847c0955) + +# Download single-header implementation of dirent API for Windows. +vcpkg_download_distfile(DIRENT_H + URLS "https://raw.githubusercontent.com/tronkko/dirent/8b1db5092479a73d47eafd3de739b27e876e6bf3/include/dirent.h" + FILENAME "fontconfig-dirent.h" + SHA512 dc9e63fd9cf4ccffdc052f92933633ef9d09dfcfe3b1d15f1f32c99349babd36a62d02283e3d8ba7766d92817be015eb211f11efc4fa52cc90d532a34d1ae785) + + +vcpkg_extract_source_archive(${ARCHIVE}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +file(COPY ${DIRENT_H} DESTINATION ${SOURCE_PATH}) +file(RENAME ${SOURCE_PATH}/fontconfig-dirent.h ${SOURCE_PATH}/dirent.h) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON + -DFC_INCLUDE_DIR=${CMAKE_CURRENT_LIST_DIR}/include + OPTIONS_DEBUG + -DFC_SKIP_TOOLS=ON + -DFC_SKIP_HEADERS=ON) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/fontconfig) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/fontconfig/COPYING ${CURRENT_PACKAGES_DIR}/share/fontconfig/copyright) -- cgit v1.2.3 From 942ce23ca866e4f4982469453755656681e9109c Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 19 Jan 2017 16:12:07 -0800 Subject: [PRIVACY] fix typo in privacy document. Fixes #566. --- docs/PRIVACY.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/PRIVACY.md b/docs/PRIVACY.md index f50c2938f..ad345c809 100644 --- a/docs/PRIVACY.md +++ b/docs/PRIVACY.md @@ -5,14 +5,14 @@ ## Do you collect telemetry data? What is it used for? We do collect telemetry data from usage of "vcpkg.exe". We explicitly ONLY collect information from invocations of the tool itself; we do NOT add any tracking information into the produced libraries. -We use this information to understand the usage the issue and what we can do to improve the tool. +We use this information to understand usage issues and to guide tool improvements. ## What telemetry is collected? We collect the command line used, the time of invocation, and how long the command took. Some commands also add additional calculated information (such as the full set of libraries to install). We generate a completely random UUID on first use and attach it to each event. For this preview, we do not offer a mechanism to disable this data collection since it is critical for improving the product. In the full release, you will be able to opt-out with a simple configuration. For more information about how Microsoft protects your privacy, see https://privacy.microsoft.com/en-us/privacy. -Here is an example of an event for the command line "vcpkg install zlib": +Here is an example of an event for the command line `vcpkg install zlib`: ``` [{ "ver": 1, @@ -40,7 +40,7 @@ Here is an example of an event for the command line "vcpkg install zlib": } }] ``` -In the source code (included in every release), you can search for calls to the functions "TrackProperty" and "TrackMetric" to see every specific data point we collect. +In the source code (included in `toolsrc\`), you can search for calls to the functions `TrackProperty()` and `TrackMetric()` to see every specific data point we collect. ## Is the data stored on my system? -- cgit v1.2.3 From 030ed271179ac57479d4bfec2e64b9457486d4c5 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 19 Jan 2017 17:38:56 -0800 Subject: Fix integration when $(Platform) is empty --- scripts/buildsystems/msbuild/vcpkg.targets | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/buildsystems/msbuild/vcpkg.targets b/scripts/buildsystems/msbuild/vcpkg.targets index 0c748c1d6..912cf6b8e 100644 --- a/scripts/buildsystems/msbuild/vcpkg.targets +++ b/scripts/buildsystems/msbuild/vcpkg.targets @@ -9,6 +9,16 @@ x86-uwp + + true + x86-windows + + + + true + x86-uwp + + true x64-windows -- cgit v1.2.3 From 1c9ea008be82d00a1f7d7f3762e122d09bd3f41e Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 19 Jan 2017 18:55:07 -0800 Subject: [fltk] Avoid renaming DLLs -- they are referred to by name in LIBs. --- ports/fltk/portfile.cmake | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/ports/fltk/portfile.cmake b/ports/fltk/portfile.cmake index a06b83310..848096dce 100644 --- a/ports/fltk/portfile.cmake +++ b/ports/fltk/portfile.cmake @@ -48,16 +48,6 @@ file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fltk-config) vcpkg_copy_pdbs() if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/libfltk_forms_SHAREDd.dll ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_forms.dll) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/libfltk_gl_SHAREDd.dll ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_gl.dll) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/libfltk_images_SHAREDd.dll ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_images.dll) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/libfltk_SHAREDd.dll ${CURRENT_PACKAGES_DIR}/debug/bin/fltk.dll) - - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/libfltk_forms_SHAREDd.pdb ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_forms.pdb) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/libfltk_gl_SHAREDd.pdb ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_gl.pdb) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/libfltk_images_SHAREDd.pdb ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_images.pdb) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/libfltk_SHAREDd.pdb ${CURRENT_PACKAGES_DIR}/debug/bin/fltk.pdb) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_formsd.lib) file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_gld.lib) file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_imagesd.lib) @@ -68,17 +58,6 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_images_SHAREDd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_imagesd.lib) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_SHAREDd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/fltkd.lib) - file(RENAME ${CURRENT_PACKAGES_DIR}/bin/libfltk_forms_SHARED.dll ${CURRENT_PACKAGES_DIR}/bin/fltk_forms.dll) - file(RENAME ${CURRENT_PACKAGES_DIR}/bin/libfltk_gl_SHARED.dll ${CURRENT_PACKAGES_DIR}/bin/fltk_gl.dll) - file(RENAME ${CURRENT_PACKAGES_DIR}/bin/libfltk_images_SHARED.dll ${CURRENT_PACKAGES_DIR}/bin/fltk_images.dll) - file(RENAME ${CURRENT_PACKAGES_DIR}/bin/libfltk_SHARED.dll ${CURRENT_PACKAGES_DIR}/bin/fltk.dll) - - file(RENAME ${CURRENT_PACKAGES_DIR}/bin/libfltk_forms_SHARED.pdb ${CURRENT_PACKAGES_DIR}/bin/fltk_forms.pdb) - file(RENAME ${CURRENT_PACKAGES_DIR}/bin/libfltk_gl_SHARED.pdb ${CURRENT_PACKAGES_DIR}/bin/fltk_gl.pdb) - file(RENAME ${CURRENT_PACKAGES_DIR}/bin/libfltk_images_SHARED.pdb ${CURRENT_PACKAGES_DIR}/bin/fltk_images.pdb) - file(RENAME ${CURRENT_PACKAGES_DIR}/bin/libfltk_SHARED.pdb ${CURRENT_PACKAGES_DIR}/bin/fltk.pdb) - - file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/fltk_forms.lib) file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/fltk_gl.lib) file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/fltk_images.lib) -- cgit v1.2.3 From 28bd54e0d04fce52577a563956e853f96c060566 Mon Sep 17 00:00:00 2001 From: sdcb Date: Fri, 20 Jan 2017 15:19:23 +0800 Subject: [libmysql] upgrade to 5.7.17 1. upgraded upstream mysql version to 5.7.17 2. simplified the patch size from 12K to 2K 3. enabled static build 4. switched mysql.h file to mysql/mysql.h --- ports/libmysql/0001_cmake.patch | 378 ----------------------------------- ports/libmysql/CONTROL | 4 +- ports/libmysql/boost_and_build.patch | 44 ++++ ports/libmysql/portfile.cmake | 148 +++++++------- 4 files changed, 125 insertions(+), 449 deletions(-) delete mode 100644 ports/libmysql/0001_cmake.patch create mode 100644 ports/libmysql/boost_and_build.patch diff --git a/ports/libmysql/0001_cmake.patch b/ports/libmysql/0001_cmake.patch deleted file mode 100644 index 9defe7fc1..000000000 --- a/ports/libmysql/0001_cmake.patch +++ /dev/null @@ -1,378 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 44842d3..e89eed9 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -118,7 +118,7 @@ IF(DEFINED MYSQL_PROJECT_NAME) - SET(MYSQL_PROJECT_NAME ${MYSQL_PROJECT_NAME} CACHE STRING - ${MYSQL_PROJECT_NAME_DOCSTRING} FORCE) - ELSE() -- SET(MYSQL_PROJECT_NAME "MySQL" CACHE STRING -+ SET(MYSQL_PROJECT_NAME "LibMySQL" CACHE STRING - ${MYSQL_PROJECT_NAME_DOCSTRING} FORCE) - MARK_AS_ADVANCED(MYSQL_PROJECT_NAME) - ENDIF() -@@ -132,6 +132,9 @@ IF(CMAKE_BUILD_TYPE MATCHES "Debug" OR WITH_DEBUG) - ENDIF() - ENDIF() - -+OPTION(FORCE_UNSUPPORTED_COMPILER "Disable compiler version checks" ON) -+MARK_AS_ADVANCED(FORCE_UNSUPPORTED_COMPILER) -+ - OPTION(WITH_DEFAULT_COMPILER_OPTIONS - "Use flags from cmake/build_configurations/compiler_options.cmake" - ON) -@@ -193,46 +196,30 @@ ENDIF() - INCLUDE(character_sets) - INCLUDE(cpu_info) - INCLUDE(zlib) --INCLUDE(lz4) --INCLUDE(libevent) - INCLUDE(ssl) --INCLUDE(readline) --INCLUDE(protobuf) - INCLUDE(mysql_version) - INCLUDE(libutils) - INCLUDE(dtrace) --INCLUDE(plugin) - INCLUDE(install_macros) - INCLUDE(install_layout) - INCLUDE(mysql_add_executable) - - # Handle options --IF(EXISTS ${CMAKE_SOURCE_DIR}/rapid) -- OPTION(WITH_RAPID -- "Build additonal code(plugins) that is located in rapid directory" ON) --ELSE() -- OPTION(WITH_RAPID -- "Build additonal code(plugins) that is located in rapid directory" OFF) --ENDIF() - OPTION(DISABLE_SHARED - "Don't build shared libraries, compile code as position-dependent" OFF) -+MARK_AS_ADVANCED(DISABLE_SHARED) - IF(DISABLE_SHARED) - SET(WITHOUT_DYNAMIC_PLUGINS 1) - ENDIF() - OPTION(ENABLED_PROFILING "Enable profiling" ON) --OPTION(WITHOUT_SERVER OFF) -+SET(WITHOUT_SERVER ON) - IF(UNIX) - OPTION(WITH_VALGRIND "Valgrind instrumentation" OFF) - ENDIF() - IF(WIN32) - OPTION(WITH_MSCRT_DEBUG "MS Visual Studio Debug CRT instrumentation" OFF) - ENDIF() --IF(NOT WITHOUT_SERVER) -- OPTION (WITH_UNIT_TESTS "Compile MySQL with unit tests" ON) --ENDIF() --OPTION(FORCE_UNSUPPORTED_COMPILER "Disable compiler version checks" OFF) --MARK_AS_ADVANCED(WITHOUT_SERVER DISABLE_SHARED FORCE_UNSUPPORTED_COMPILER) -- -+OPTION (WITH_UNIT_TESTS "Compile MySQL with unit tests" OFF) - - include(CheckCSourceCompiles) - include(CheckCXXSourceCompiles) -@@ -452,18 +439,8 @@ ELSE() - SET(DEFAULT_TMPDIR "\"${TMPDIR}\"") - ENDIF() - --INCLUDE(cmake/boost.cmake) -- --IF (CMAKE_SYSTEM_NAME MATCHES "Linux") -- OPTION(WITH_SYSTEMD "Enable installation of systemd support files" OFF) -- IF (WITH_SYSTEMD) -- INCLUDE(cmake/systemd.cmake) -- ENDIF() --ELSE() -- IF (WITH_SYSTEMD) -- MESSAGE(FATAL_ERROR "Installation of systemd support files not supported") -- ENDIF() --ENDIF() -+# Boost is not needed to build libmysql (yet) -+#INCLUDE(cmake/boost.cmake) - - # Run platform tests - INCLUDE(configure.cmake) -@@ -479,76 +456,6 @@ INCLUDE_DIRECTORIES( - MYSQL_CHECK_ZLIB_WITH_COMPRESS() - # Add bundled yassl/taocrypt or system openssl. - MYSQL_CHECK_SSL() --# Add system/bundled editline. --MYSQL_CHECK_EDITLINE() --# Add libevent --MYSQL_CHECK_LIBEVENT() --# Add lz4 library --MYSQL_CHECK_LZ4() --# Add protoc and libprotobuf --IF(NOT WITHOUT_SERVER) -- MYSQL_CHECK_PROTOBUF() --ENDIF() -- --# Check for SYS_thread_selfid system call --CHECK_C_SOURCE_COMPILES(" --#include --#include --#include --int main(int ac, char **av) --{ -- unsigned long long tid = syscall(SYS_thread_selfid); -- return (tid != 0 ? 0 : 1); --}" --HAVE_SYS_THREAD_SELFID) -- --# Check for gettid() system call --CHECK_C_SOURCE_COMPILES(" --#include --#include --#include --int main(int ac, char **av) --{ -- unsigned long long tid = syscall(SYS_gettid); -- return (tid != 0 ? 0 : 1); --}" --HAVE_SYS_GETTID) -- --IF(CMAKE_SYSTEM_NAME MATCHES "Linux") -- # Check for pthread_setname_np -- CHECK_C_SOURCE_COMPILES(" -- #include -- int main(int ac, char **av) -- { -- const char *thread_name= 0; -- int ret = pthread_setname_np(pthread_self(), thread_name); -- return ret; -- }" -- HAVE_PTHREAD_SETNAME_NP) --ENDIF() -- --# Check for pthread_getthreadid_np() --CHECK_C_SOURCE_COMPILES(" --#include --int main(int ac, char **av) --{ -- unsigned long long tid = pthread_getthreadid_np(); -- return (tid != 0 ? 0 : 1); --}" --HAVE_PTHREAD_GETTHREADID_NP) -- --# Check for pthread_self() returning an integer type --CHECK_C_SOURCE_COMPILES(" --#include --#include --int main(int ac, char **av) --{ -- unsigned long long tid = pthread_self(); -- return (tid != 0 ? 0 : 1); --}" --HAVE_INTEGER_PTHREAD_SELF --FAIL_REGEX "warning: incompatible pointer to integer conversion" --) - - # - # Setup maintainer mode options by the end. Platform checks are -@@ -563,18 +470,15 @@ OPTION(MYSQL_MAINTAINER_MODE - - INCLUDE(maintainer) - --IF(WITH_UNIT_TESTS) -+IF(0) #WITH_UNIT_TESTS) - ENABLE_TESTING() - ENDIF() - --IF(NOT WITHOUT_SERVER) -+IF(0) #NOT WITHOUT_SERVER) - SET (MYSQLD_STATIC_PLUGIN_LIBS "" CACHE INTERNAL "") - SET (MYSQLD_STATIC_EMBEDDED_PLUGIN_LIBS "" CACHE INTERNAL "") - # Add storage engines and plugins. - CONFIGURE_PLUGINS() --ELSE() -- # We may still want Cluster client libraries, use -DWITH_NDBCLUSTER=1 -- ADD_SUBDIRECTORY(storage/ndb) - ENDIF() - - ADD_SUBDIRECTORY(include) -@@ -588,61 +492,18 @@ ADD_SUBDIRECTORY(libmysql) - ADD_SUBDIRECTORY(libbinlogevents) - ADD_SUBDIRECTORY(libbinlogstandalone) - --IF(WITH_UNIT_TESTS) -- # Visual Studio 11 needs this extra flag in order to compile gmock. -- IF(WIN32) -- ADD_DEFINITIONS( /D _VARIADIC_MAX=10 ) -- ENDIF() -- # libc++ doesn't have tuple in tr1 -- IF(HAVE_LLVM_LIBCPP) -- ADD_DEFINITIONS(-DGTEST_USE_OWN_TR1_TUPLE=1) -- ENDIF() - -- ADD_SUBDIRECTORY(unittest) -- ADD_SUBDIRECTORY(unittest/examples) -- ADD_SUBDIRECTORY(unittest/mytap) -- ADD_SUBDIRECTORY(unittest/mytap/t) -- IF(WITH_RAPID AND EXISTS ${CMAKE_SOURCE_DIR}/rapid/unittest/gunit) -- ADD_SUBDIRECTORY(rapid/unittest/gunit) -- ENDIF() --ENDIF() - -+SET(WITH_INNOBASE_STORAGE_ENGINE 0) - ADD_SUBDIRECTORY(extra) --ADD_SUBDIRECTORY(client) - ADD_SUBDIRECTORY(sql/share) --ADD_SUBDIRECTORY(libservices) -- --IF(UNIX) -- ADD_SUBDIRECTORY(man) --ENDIF() -- --IF(NOT WITHOUT_SERVER) -- ADD_SUBDIRECTORY(testclients) -- ADD_SUBDIRECTORY(sql) -- OPTION (WITH_EMBEDDED_SERVER "Compile MySQL with embedded server" OFF) -- IF(WITH_EMBEDDED_SERVER) -- ADD_SUBDIRECTORY(libmysqld) -- ADD_SUBDIRECTORY(libmysqld/examples) -- ENDIF(WITH_EMBEDDED_SERVER) --ENDIF() -- --# scripts/mysql_config depends on client and server targets loaded above. --# It is referenced by some of the directories below, so we insert it here. - ADD_SUBDIRECTORY(scripts) -+ADD_SUBDIRECTORY(support-files) - --IF(NOT WITHOUT_SERVER) -- ADD_SUBDIRECTORY(mysql-test) -- ADD_SUBDIRECTORY(mysql-test/lib/My/SafeProcess) -- ADD_SUBDIRECTORY(support-files) -- IF(EXISTS ${CMAKE_SOURCE_DIR}/internal/CMakeLists.txt) -- ADD_SUBDIRECTORY(internal) -- ENDIF() -- ADD_SUBDIRECTORY(packaging/rpm-oel) -- ADD_SUBDIRECTORY(packaging/rpm-fedora) -- ADD_SUBDIRECTORY(packaging/rpm-sles) -- ADD_SUBDIRECTORY(packaging/rpm-docker) -- ADD_SUBDIRECTORY(packaging/deb-in) --ENDIF() -+# -+# Directory where error message database is generated (GenError target) -+# -+FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/sql/share) - - INCLUDE(cmake/abi_check.cmake) - INCLUDE(cmake/tags.cmake) -@@ -680,11 +541,7 @@ ELSE() - SET(CPACK_GENERATOR "TGZ") - ENDIF() - ADD_SUBDIRECTORY(packaging/WiX) --ADD_SUBDIRECTORY(packaging/solaris) - --IF(UNIX) -- INSTALL(FILES Docs/mysql.info DESTINATION ${INSTALL_INFODIR} OPTIONAL COMPONENT Info) --ENDIF() - # - # RPM installs documentation directly from the source tree - # -diff --git a/extra/CMakeLists.txt b/extra/CMakeLists.txt -index 3adf988..9e0ba30 100644 ---- a/extra/CMakeLists.txt -+++ b/extra/CMakeLists.txt -@@ -70,87 +70,4 @@ ADD_DEFINITIONS(-DMUTEX_EVENT) - COPY_OPENSSL_DLLS(copy_openssl_extra) - IF (WIN32 AND WITH_SSL_PATH AND HAVE_CRYPTO_DLL) - ADD_DEPENDENCIES(GenError copy_openssl_extra) --ENDIF() -- -- --MYSQL_ADD_EXECUTABLE(my_print_defaults my_print_defaults.c) --TARGET_LINK_LIBRARIES(my_print_defaults mysys mysys_ssl) --SET_TARGET_PROPERTIES(my_print_defaults PROPERTIES LINKER_LANGUAGE CXX) -- --MYSQL_ADD_EXECUTABLE(perror perror.c) --ADD_DEPENDENCIES(perror GenError) --TARGET_LINK_LIBRARIES(perror mysys mysys_ssl) --SET_TARGET_PROPERTIES(perror PROPERTIES LINKER_LANGUAGE CXX) -- --MYSQL_ADD_EXECUTABLE(resolveip resolveip.c) --TARGET_LINK_LIBRARIES(resolveip mysys mysys_ssl) --SET_TARGET_PROPERTIES(resolveip PROPERTIES LINKER_LANGUAGE CXX) --IF(CMAKE_SYSTEM_NAME STREQUAL "SunOS") -- INCLUDE(CheckFunctionExists) -- INCLUDE(CheckLibraryExists) -- MY_SEARCH_LIBS(inet_aton "nsl;socket;resolv" SOLARIS_NSL) -- TARGET_LINK_LIBRARIES(resolveip ${SOLARIS_NSL}) --ENDIF() -- -- --MYSQL_ADD_EXECUTABLE(replace replace.c) --TARGET_LINK_LIBRARIES(replace mysys) -- --MYSQL_ADD_EXECUTABLE(lz4_decompress lz4_decompress.cc) --TARGET_LINK_LIBRARIES(lz4_decompress ${LZ4_LIBRARY}) -- --MYSQL_ADD_EXECUTABLE(zlib_decompress zlib_decompress.cc) --TARGET_LINK_LIBRARIES(zlib_decompress ${ZLIB_LIBRARY}) -- --IF(WITH_INNOBASE_STORAGE_ENGINE) -- -- IF(LZ4_INCLUDE_DIR AND LZ4_LIBRARY) -- ADD_DEFINITIONS(-DHAVE_LZ4=1) -- INCLUDE_DIRECTORIES(${LZ4_INCLUDE_DIR}) -- ENDIF() -- -- # Add path to the InnoDB headers -- INCLUDE_DIRECTORIES( -- ${CMAKE_SOURCE_DIR}/storage/innobase/include -- ${CMAKE_SOURCE_DIR}/sql -- ) -- # We use the InnoDB code directly in case the code changes. -- ADD_DEFINITIONS("-DUNIV_INNOCHECKSUM") -- SET(INNOBASE_SOURCES -- ../storage/innobase/buf/buf0checksum.cc -- ../storage/innobase/ut/ut0crc32.cc -- ../storage/innobase/ut/ut0ut.cc -- ../storage/innobase/buf/buf0buf.cc -- ../storage/innobase/page/page0zip.cc -- ../storage/innobase/os/os0file.cc -- ) -- -- # Avoid generating Hardware Capabilities due to crc32 instructions -- IF(CMAKE_SYSTEM_NAME MATCHES "SunOS" AND -- CMAKE_SYSTEM_PROCESSOR MATCHES "i386") -- INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/compile_flags.cmake) -- MY_CHECK_CXX_COMPILER_FLAG("-Wa,-nH" HAVE_WA_NH) -- IF(HAVE_WA_NH) -- ADD_COMPILE_FLAGS( -- ../storage/innobase/ut/ut0crc32.cc -- COMPILE_FLAGS "-Wa,-nH" -- ) -- ENDIF() -- ENDIF() -- -- MYSQL_ADD_EXECUTABLE(innochecksum innochecksum.cc ${INNOBASE_SOURCES}) -- TARGET_LINK_LIBRARIES(innochecksum mysys mysys_ssl ${LZ4_LIBRARY}) -- ADD_DEPENDENCIES(innochecksum GenError) --ENDIF() -- --IF(UNIX) -- MYSQL_ADD_EXECUTABLE(resolve_stack_dump resolve_stack_dump.cc) -- TARGET_LINK_LIBRARIES(resolve_stack_dump mysys mysys_ssl) --ENDIF() -- --# In published release builds on Solaris, we need to bundle gcc source. --# PB2 will take care of putting it in extra/ when needed --IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/gcc-4.8.1.tar.bz2) -- INSTALL(FILES gcc-4.8.1.tar.bz2 -- DESTINATION ${INSTALL_MYSQLSHAREDIR} COMPONENT Development) --ENDIF() -+ENDIF() -\ No newline at end of file -diff --git a/mysys/mysys_priv.h b/mysys/mysys_priv.h -index 8b7a554..4353037 100644 ---- a/mysys/mysys_priv.h -+++ b/mysys/mysys_priv.h -@@ -18,6 +18,7 @@ - - #include "my_global.h" - #include "mysql/psi/mysql_thread.h" -+#include "my_sys.h" - - #ifdef HAVE_PSI_INTERFACE - diff --git a/ports/libmysql/CONTROL b/ports/libmysql/CONTROL index 504f14bbb..4e5564972 100644 --- a/ports/libmysql/CONTROL +++ b/ports/libmysql/CONTROL @@ -1,3 +1,3 @@ -Source: libmysql -Version: 5.7.16 +Source: libmysql +Version: 5.7.17 Description: A MySQL client library for C development. \ No newline at end of file diff --git a/ports/libmysql/boost_and_build.patch b/ports/libmysql/boost_and_build.patch new file mode 100644 index 000000000..7fce8ffc5 --- /dev/null +++ b/ports/libmysql/boost_and_build.patch @@ -0,0 +1,44 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 44842d3..e34ab24 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -452,7 +452,7 @@ ELSE() + SET(DEFAULT_TMPDIR "\"${TMPDIR}\"") + ENDIF() + +-INCLUDE(cmake/boost.cmake) ++#INCLUDE(cmake/boost.cmake) + + IF (CMAKE_SYSTEM_NAME MATCHES "Linux") + OPTION(WITH_SYSTEMD "Enable installation of systemd support files" OFF) +diff --git a/client/dump/CMakeLists.txt b/client/dump/CMakeLists.txt +index bae2ce7..4e11516 100644 +--- a/client/dump/CMakeLists.txt ++++ b/client/dump/CMakeLists.txt +@@ -21,12 +21,12 @@ INCLUDE_DIRECTORIES( + ${CMAKE_SOURCE_DIR}/dump + ) + +-IF (CMAKE_CXX_COMPILER_ID STREQUAL "SunPro") ++#IF (CMAKE_CXX_COMPILER_ID STREQUAL "SunPro") + IF (WITHOUT_SERVER) + MESSAGE(STATUS "Not building mysqlpump") + RETURN() + ENDIF() +-ENDIF() ++#ENDIF() + + # Prevent Boost from including external precompiled Boost libraries, use + # threading (not implemented for older Solaris Studio compilers) +diff --git a/mysys/mysys_priv.h b/mysys/mysys_priv.h +index 8b7a554..4353037 100644 +--- a/mysys/mysys_priv.h ++++ b/mysys/mysys_priv.h +@@ -18,6 +18,7 @@ + + #include "my_global.h" + #include "mysql/psi/mysql_thread.h" ++#include "my_sys.h" + + #ifdef HAVE_PSI_INTERFACE + diff --git a/ports/libmysql/portfile.cmake b/ports/libmysql/portfile.cmake index 48412ccc7..2a7f7f33d 100644 --- a/ports/libmysql/portfile.cmake +++ b/ports/libmysql/portfile.cmake @@ -1,70 +1,80 @@ -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(STATUS "Warning: Static building not supported yet. Building dynamic.") - set(VCPKG_LIBRARY_LINKAGE dynamic) -endif() -include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mysql-server-mysql-5.7.16) - -if (EXISTS "${CURRENT_INSTALLED_DIR}/include/mysql.h") - message(FATAL_ERROR "FATAL ERROR: libmysql and libmariadb are incompatible.") -endif() - -vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/mysql/mysql-server/archive/mysql-5.7.16.tar.gz" - FILENAME "mysql-server-mysql-5.7.16.tar.gz" - SHA512 30a3c55ebb15f18ededf814b66c108f18b2ced9c39e08319cdc9559ccf38d494ad9322098f2b04418ddf557e46d9d727be0e514be0ae982ac4f5186aa295b9c6 -) -vcpkg_extract_source_archive(${ARCHIVE}) - -vcpkg_apply_patches( - SOURCE_PATH ${SOURCE_PATH} - PATCHES - ${CMAKE_CURRENT_LIST_DIR}/0001_cmake.patch -) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} -) - -vcpkg_install_cmake() - -# delete debug headers -file(REMOVE_RECURSE - ${CURRENT_PACKAGES_DIR}/debug/include) - -# delete useless vcruntime/scripts/bin/msg file -file(REMOVE_RECURSE - ${CURRENT_PACKAGES_DIR}/share - ${CURRENT_PACKAGES_DIR}/debug/share - ${CURRENT_PACKAGES_DIR}/bin - ${CURRENT_PACKAGES_DIR}/debug/bin - ${CURRENT_PACKAGES_DIR}/lib/debug) - -file(MAKE_DIRECTORY - ${CURRENT_PACKAGES_DIR}/share - ${CURRENT_PACKAGES_DIR}/bin - ${CURRENT_PACKAGES_DIR}/debug/bin) - -# remove misc files -file(REMOVE - ${CURRENT_PACKAGES_DIR}/COPYING - ${CURRENT_PACKAGES_DIR}/my-default.ini - ${CURRENT_PACKAGES_DIR}/README - ${CURRENT_PACKAGES_DIR}/debug/COPYING - ${CURRENT_PACKAGES_DIR}/debug/my-default.ini - ${CURRENT_PACKAGES_DIR}/debug/README) - -# remove mysqlclient.lib -file(REMOVE - ${CURRENT_PACKAGES_DIR}/lib/mysqlclient.lib - ${CURRENT_PACKAGES_DIR}/debug/lib/mysqlclient.lib) - -# correct the dll directory -file (RENAME ${CURRENT_PACKAGES_DIR}/lib/libmysql.dll ${CURRENT_PACKAGES_DIR}/bin/libmysql.dll) -file (RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libmysql.dll ${CURRENT_PACKAGES_DIR}/debug/bin/libmysql.dll) -file (RENAME ${CURRENT_PACKAGES_DIR}/lib/libmysql.pdb ${CURRENT_PACKAGES_DIR}/bin/libmysql.pdb) -file (RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libmysql.pdb ${CURRENT_PACKAGES_DIR}/debug/bin/libmysql.pdb) - -# copy license -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libmysql) +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mysql-server-mysql-5.7.17) + +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/mysql/mysql-server/archive/mysql-5.7.17.tar.gz" + FILENAME "mysql-server-mysql-5.7.17.tar.gz" + SHA512 511027f28f0705f59a08ec369b1ebe5d9a77eb839d545898631f1ebbcb6b4b800f5b88511d3ae5d231c04e09a2d7b2b2d178264d36aeb2bc602cc1b0b248cfba +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/boost_and_build.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DWITHOUT_SERVER=ON + -DWITH_UNIT_TESTS=OFF + -DENABLED_PROFILING=OFF +) + +vcpkg_install_cmake() + +# delete debug headers +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/debug/include) + +# switch mysql into /mysql +file(RENAME ${CURRENT_PACKAGES_DIR}/include ${CURRENT_PACKAGES_DIR}/include2) +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/include) +file(RENAME ${CURRENT_PACKAGES_DIR}/include2 ${CURRENT_PACKAGES_DIR}/include/mysql) + +## delete useless vcruntime/scripts/bin/msg file +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/share + ${CURRENT_PACKAGES_DIR}/debug/share + ${CURRENT_PACKAGES_DIR}/bin + ${CURRENT_PACKAGES_DIR}/debug/bin + ${CURRENT_PACKAGES_DIR}/docs + ${CURRENT_PACKAGES_DIR}/debug/docs + ${CURRENT_PACKAGES_DIR}/lib/debug) + +# remove misc files +file(REMOVE + ${CURRENT_PACKAGES_DIR}/COPYING + ${CURRENT_PACKAGES_DIR}/README + ${CURRENT_PACKAGES_DIR}/debug/COPYING + ${CURRENT_PACKAGES_DIR}/debug/README) + +# remove not-related libs +file (REMOVE + ${CURRENT_PACKAGES_DIR}/lib/mysqlservices.lib + ${CURRENT_PACKAGES_DIR}/debug/lib/mysqlservices.lib) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE + ${CURRENT_PACKAGES_DIR}/lib/libmysql.lib + ${CURRENT_PACKAGES_DIR}/lib/libmysql.dll + ${CURRENT_PACKAGES_DIR}/lib/libmysql.pdb + ${CURRENT_PACKAGES_DIR}/debug/lib/libmysql.lib + ${CURRENT_PACKAGES_DIR}/debug/lib/libmysql.dll + ${CURRENT_PACKAGES_DIR}/debug/lib/libmysql.pdb) +else() + file(REMOVE + ${CURRENT_PACKAGES_DIR}/lib/mysqlclient.lib + ${CURRENT_PACKAGES_DIR}/debug/lib/mysqlclient.lib) + + # correct the dll directory + file (RENAME ${CURRENT_PACKAGES_DIR}/lib/libmysql.dll ${CURRENT_PACKAGES_DIR}/bin/libmysql.dll) + file (RENAME ${CURRENT_PACKAGES_DIR}/lib/libmysql.pdb ${CURRENT_PACKAGES_DIR}/bin/libmysql.pdb) + file (RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libmysql.dll ${CURRENT_PACKAGES_DIR}/debug/bin/libmysql.dll) + file (RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libmysql.pdb ${CURRENT_PACKAGES_DIR}/debug/bin/libmysql.pdb) +endif() + +# copy license +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libmysql) file(RENAME ${CURRENT_PACKAGES_DIR}/share/libmysql/COPYING ${CURRENT_PACKAGES_DIR}/share/libmysql/copyright) \ No newline at end of file -- cgit v1.2.3 From ce9741f71b079dad944e177daf984160bb9ce1bb Mon Sep 17 00:00:00 2001 From: sdcb Date: Fri, 20 Jan 2017 17:06:11 +0800 Subject: [libmariadb] upgrade to 2.3.2 1. upgrade package to 2.3.2 2. enable static build support 3. do not block with libmysql --- ports/libmariadb/CONTROL | 4 +- ports/libmariadb/portfile.cmake | 140 ++++++++++++++++++---------------------- 2 files changed, 65 insertions(+), 79 deletions(-) diff --git a/ports/libmariadb/CONTROL b/ports/libmariadb/CONTROL index b91da0740..a42f79ee5 100644 --- a/ports/libmariadb/CONTROL +++ b/ports/libmariadb/CONTROL @@ -1,3 +1,3 @@ -Source: libmariadb -Version: 2.3.1 +Source: libmariadb +Version: 2.3.2 Description: The MariaDB Connector/C is used to connect applications developed in C/C++ to MariaDB and MySQL databases. \ No newline at end of file diff --git a/ports/libmariadb/portfile.cmake b/ports/libmariadb/portfile.cmake index e6ccfa508..ebca3d7f3 100644 --- a/ports/libmariadb/portfile.cmake +++ b/ports/libmariadb/portfile.cmake @@ -1,77 +1,63 @@ -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(STATUS "Warning: Static building not supported yet. Building dynamic.") - set(VCPKG_LIBRARY_LINKAGE dynamic) -endif() -include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mariadb-connector-c-2.3.1) - -if (EXISTS "${CURRENT_INSTALLED_DIR}/include/mysql.h") - message(FATAL_ERROR "FATAL ERROR: libmysql and libmariadb are incompatible.") -endif() - -vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/MariaDB/mariadb-connector-c/archive/v2.3.1.tar.gz" - FILENAME "mariadb-connector-c-2.3.1.tar.gz" - SHA512 d82f8348201d41dce6820c952a0503a5154c4e9c06feb471fe451a6fb968e5cff04423a64183cbb8e159a1b4e7265c12b5b7aef912f633395d9f1b0436fbfd2d -) -vcpkg_extract_source_archive(${ARCHIVE}) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} -) - -vcpkg_install_cmake() - -# remove debug header -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) - -# fix libmariadb lib & dll directory. -file(MAKE_DIRECTORY - ${CURRENT_PACKAGES_DIR}/bin - ${CURRENT_PACKAGES_DIR}/debug/bin) -file(RENAME - ${CURRENT_PACKAGES_DIR}/lib/mariadb/libmariadb.dll - ${CURRENT_PACKAGES_DIR}/bin/libmariadb.dll) -file(RENAME - ${CURRENT_PACKAGES_DIR}/debug/lib/mariadb/libmariadb.dll - ${CURRENT_PACKAGES_DIR}/debug/bin/libmariadb.dll) -file(RENAME - ${CURRENT_PACKAGES_DIR}/lib/mariadb/libmariadb.lib - ${CURRENT_PACKAGES_DIR}/lib/libmariadb.lib) -file(RENAME - ${CURRENT_PACKAGES_DIR}/debug/lib/mariadb/libmariadb.lib - ${CURRENT_PACKAGES_DIR}/debug/lib/libmariadb.lib) -file(REMOVE - ${CURRENT_PACKAGES_DIR}/lib/mariadb/mariadbclient.lib - ${CURRENT_PACKAGES_DIR}/debug/lib/mariadb/mariadbclient.lib) - -# remove plugin folder -file(REMOVE_RECURSE - ${CURRENT_PACKAGES_DIR}/lib/plugin - ${CURRENT_PACKAGES_DIR}/debug/lib/plugin - ${CURRENT_PACKAGES_DIR}/lib/mariadb - ${CURRENT_PACKAGES_DIR}/debug/lib/mariadb) - -# copy & remove header files -file(GLOB HEADER_FILES ${CURRENT_PACKAGES_DIR}/include/mariadb/*) -file(COPY ${HEADER_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/mariadb) -file(REMOVE - ${CURRENT_PACKAGES_DIR}/include/config-win.h - ${CURRENT_PACKAGES_DIR}/include/dbug.h - ${CURRENT_PACKAGES_DIR}/include/errmsg.h - ${CURRENT_PACKAGES_DIR}/include/getopt.h - ${CURRENT_PACKAGES_DIR}/include/hash.h - ${CURRENT_PACKAGES_DIR}/include/ma_common.h - ${CURRENT_PACKAGES_DIR}/include/ma_dyncol.h - ${CURRENT_PACKAGES_DIR}/include/sha1.h - ${CURRENT_PACKAGES_DIR}/include/thr_alarm.h - ${CURRENT_PACKAGES_DIR}/include/violite.h - ${CURRENT_PACKAGES_DIR}/include/mysql_version.h.in - ${CURRENT_PACKAGES_DIR}/include/my_config.h.in - ${CURRENT_PACKAGES_DIR}/include/CMakeLists.txt - ${CURRENT_PACKAGES_DIR}/include/Makefile.am) - -# copy license file -file(COPY ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/libmariadb) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/libmariadb/COPYING.LIB ${CURRENT_PACKAGES_DIR}/share/libmariadb/copyright) \ No newline at end of file +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mariadb-connector-c-2.3.2) + +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/MariaDB/mariadb-connector-c/archive/v2.3.2.tar.gz" + FILENAME "mariadb-connector-c-2.3.2.tar.gz" + SHA512 f5574756ffce69e3dd15b7f7c14cfd0b4d69e3203ae4b383f05a110918916279ba7c0b9149d0dcb9ec93bbfc0927dfaf88bb40979ba1de710ce148d1fbe033af +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} +) + +vcpkg_install_cmake() + +# remove debug header +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# fix libmariadb lib & dll directory. +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(RENAME + ${CURRENT_PACKAGES_DIR}/lib/mariadb/mariadbclient.lib + ${CURRENT_PACKAGES_DIR}/lib/mariadbclient.lib) + file(RENAME + ${CURRENT_PACKAGES_DIR}/debug/lib/mariadb/mariadbclient.lib + ${CURRENT_PACKAGES_DIR}/debug/lib/mariadbclient.lib) +else() + file(MAKE_DIRECTORY + ${CURRENT_PACKAGES_DIR}/bin + ${CURRENT_PACKAGES_DIR}/debug/bin) + file(RENAME + ${CURRENT_PACKAGES_DIR}/lib/mariadb/libmariadb.dll + ${CURRENT_PACKAGES_DIR}/bin/libmariadb.dll) + file(RENAME + ${CURRENT_PACKAGES_DIR}/debug/lib/mariadb/libmariadb.dll + ${CURRENT_PACKAGES_DIR}/debug/bin/libmariadb.dll) + file(RENAME + ${CURRENT_PACKAGES_DIR}/lib/mariadb/libmariadb.lib + ${CURRENT_PACKAGES_DIR}/lib/libmariadb.lib) + file(RENAME + ${CURRENT_PACKAGES_DIR}/debug/lib/mariadb/libmariadb.lib + ${CURRENT_PACKAGES_DIR}/debug/lib/libmariadb.lib) +endif() + +# remove plugin folder +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/lib/plugin + ${CURRENT_PACKAGES_DIR}/debug/lib/plugin + ${CURRENT_PACKAGES_DIR}/lib/mariadb + ${CURRENT_PACKAGES_DIR}/debug/lib/mariadb) + +# copy & remove header files +file(GLOB HEADER_FILES ${CURRENT_PACKAGES_DIR}/include/mariadb/*) +file(REMOVE + ${CURRENT_PACKAGES_DIR}/include/mariadb/my_config.h.in + ${CURRENT_PACKAGES_DIR}/include/mariadb/mysql_version.h.in + ${CURRENT_PACKAGES_DIR}/include/mariadb/CMakeLists.txt + ${CURRENT_PACKAGES_DIR}/include/mariadb/Makefile.am) + +# copy license file +file(COPY ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/libmariadb) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/libmariadb/COPYING.LIB ${CURRENT_PACKAGES_DIR}/share/libmariadb/copyright) -- cgit v1.2.3 From 1380525e5f92fb0ff576a98343238389dfdd7fad Mon Sep 17 00:00:00 2001 From: codicodi Date: Fri, 20 Jan 2017 13:38:56 +0100 Subject: [fontconfig] install additional license --- ports/fontconfig/portfile.cmake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ports/fontconfig/portfile.cmake b/ports/fontconfig/portfile.cmake index 06bff2aa0..8755ad733 100644 --- a/ports/fontconfig/portfile.cmake +++ b/ports/fontconfig/portfile.cmake @@ -6,12 +6,15 @@ vcpkg_download_distfile(ARCHIVE FILENAME "fontconfig-2.12.1.tar.gz" SHA512 0959a80522e09551e49ec7b2383b7dfb319d4e1c058ad0b55bb35d3f675acbb7ff08c9c30a8798b731070687f84dd3d2ff7e28aafac6ecfa9d3f85c5847c0955) -# Download single-header implementation of dirent API for Windows. +# Download single-header implementation of dirent API for Windows and it's license vcpkg_download_distfile(DIRENT_H URLS "https://raw.githubusercontent.com/tronkko/dirent/8b1db5092479a73d47eafd3de739b27e876e6bf3/include/dirent.h" FILENAME "fontconfig-dirent.h" SHA512 dc9e63fd9cf4ccffdc052f92933633ef9d09dfcfe3b1d15f1f32c99349babd36a62d02283e3d8ba7766d92817be015eb211f11efc4fa52cc90d532a34d1ae785) - +vcpkg_download_distfile(DIRENT_LICENSE + URLS "https://raw.githubusercontent.com/tronkko/dirent/8b1db5092479a73d47eafd3de739b27e876e6bf3/LICENSE" + FILENAME "fontconfig-dirent-license" + SHA512 58c294f80b679252dbee9687ff6bda660fe1ed6f94506e1b9edc19358de98b274b25b3697bdcd34becb28a4f186c6d321a16ab616164e2fb378b37357fc71e4f) vcpkg_extract_source_archive(${ARCHIVE}) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) @@ -32,3 +35,5 @@ vcpkg_copy_pdbs() file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/fontconfig) file(RENAME ${CURRENT_PACKAGES_DIR}/share/fontconfig/COPYING ${CURRENT_PACKAGES_DIR}/share/fontconfig/copyright) +file(COPY ${DIRENT_LICENSE} DESTINATION ${CURRENT_PACKAGES_DIR}/share/fontconfig) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/fontconfig/fontconfig-dirent-license ${CURRENT_PACKAGES_DIR}/share/fontconfig/dirent-for-vs-copyright) -- cgit v1.2.3 From a5b381f1789014db0b9030dddbf82c94799fecca Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 20 Jan 2017 14:38:14 -0800 Subject: [libmysql] Create bin\ and debug\bin\ directories (also make identation consistent) --- ports/libmysql/portfile.cmake | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/ports/libmysql/portfile.cmake b/ports/libmysql/portfile.cmake index 2a7f7f33d..592482544 100644 --- a/ports/libmysql/portfile.cmake +++ b/ports/libmysql/portfile.cmake @@ -2,20 +2,20 @@ include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mysql-server-mysql-5.7.17) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/mysql/mysql-server/archive/mysql-5.7.17.tar.gz" - FILENAME "mysql-server-mysql-5.7.17.tar.gz" - SHA512 511027f28f0705f59a08ec369b1ebe5d9a77eb839d545898631f1ebbcb6b4b800f5b88511d3ae5d231c04e09a2d7b2b2d178264d36aeb2bc602cc1b0b248cfba + URLS "https://github.com/mysql/mysql-server/archive/mysql-5.7.17.tar.gz" + FILENAME "mysql-server-mysql-5.7.17.tar.gz" + SHA512 511027f28f0705f59a08ec369b1ebe5d9a77eb839d545898631f1ebbcb6b4b800f5b88511d3ae5d231c04e09a2d7b2b2d178264d36aeb2bc602cc1b0b248cfba ) vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_apply_patches( - SOURCE_PATH ${SOURCE_PATH} - PATCHES + SOURCE_PATH ${SOURCE_PATH} + PATCHES ${CMAKE_CURRENT_LIST_DIR}/boost_and_build.patch ) vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} + SOURCE_PATH ${SOURCE_PATH} OPTIONS -DWITHOUT_SERVER=ON -DWITH_UNIT_TESTS=OFF @@ -51,12 +51,12 @@ file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/README) # remove not-related libs -file (REMOVE - ${CURRENT_PACKAGES_DIR}/lib/mysqlservices.lib +file (REMOVE + ${CURRENT_PACKAGES_DIR}/lib/mysqlservices.lib ${CURRENT_PACKAGES_DIR}/debug/lib/mysqlservices.lib) if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - file(REMOVE + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/libmysql.lib ${CURRENT_PACKAGES_DIR}/lib/libmysql.dll ${CURRENT_PACKAGES_DIR}/lib/libmysql.pdb @@ -67,8 +67,10 @@ else() file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/mysqlclient.lib ${CURRENT_PACKAGES_DIR}/debug/lib/mysqlclient.lib) - + # correct the dll directory + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin) + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) file (RENAME ${CURRENT_PACKAGES_DIR}/lib/libmysql.dll ${CURRENT_PACKAGES_DIR}/bin/libmysql.dll) file (RENAME ${CURRENT_PACKAGES_DIR}/lib/libmysql.pdb ${CURRENT_PACKAGES_DIR}/bin/libmysql.pdb) file (RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libmysql.dll ${CURRENT_PACKAGES_DIR}/debug/bin/libmysql.dll) -- cgit v1.2.3 From 83dcda1e11ae12c9e56c7e4664f6d7f64f961ee6 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 20 Jan 2017 14:47:06 -0800 Subject: [lzo] Fix compiler error. Add support for non-static triplets. --- ports/lzo/do-not-declare-setargv.patch | 17 +++++++++++++++++ ports/lzo/portfile.cmake | 16 ++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 ports/lzo/do-not-declare-setargv.patch diff --git a/ports/lzo/do-not-declare-setargv.patch b/ports/lzo/do-not-declare-setargv.patch new file mode 100644 index 000000000..48ae31514 --- /dev/null +++ b/ports/lzo/do-not-declare-setargv.patch @@ -0,0 +1,17 @@ +diff --git a/src/lzo_supp.h b/src/lzo_supp.h +index 87307f9..f94a6b0 100644 +--- a/src/lzo_supp.h ++++ b/src/lzo_supp.h +@@ -3643,9 +3643,9 @@ LZO_EXTERN_C int __lzo_cdecl _setargv(void) { return __setargv(); } + #endif + #if (LZO_OS_WIN32 || LZO_OS_WIN64) + #if (LZO_CC_INTELC || LZO_CC_MSC) +-LZO_EXTERN_C int __lzo_cdecl __setargv(void); +-LZO_EXTERN_C int __lzo_cdecl _setargv(void); +-LZO_EXTERN_C int __lzo_cdecl _setargv(void) { return __setargv(); } ++// LZO_EXTERN_C int __lzo_cdecl __setargv(void); ++// LZO_EXTERN_C int __lzo_cdecl _setargv(void); ++// LZO_EXTERN_C int __lzo_cdecl _setargv(void) { return __setargv(); } + #endif + #endif + #if (LZO_OS_EMX) diff --git a/ports/lzo/portfile.cmake b/ports/lzo/portfile.cmake index a8a91e5e5..227ef7ee0 100644 --- a/ports/lzo/portfile.cmake +++ b/ports/lzo/portfile.cmake @@ -15,8 +15,24 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES "${CMAKE_CURRENT_LIST_DIR}/do-not-declare-setargv.patch" +) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + set(ENABLE_STATIC ON) + set(ENABLE_SHARED OFF) +else() + set(ENABLE_STATIC OFF) + set(ENABLE_SHARED ON) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DENABLE_STATIC=${ENABLE_STATIC} + -DENABLE_SHARED=${ENABLE_SHARED} # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 # OPTIONS_RELEASE -DOPTIMIZE=1 # OPTIONS_DEBUG -DDEBUGGABLE=1 -- cgit v1.2.3 From ed8e7ca79dad5b7bcf716efe25d975571e8e8c05 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 20 Jan 2017 17:03:11 -0800 Subject: [lzo] Disable dynamic builds again due to library not having appropriate dllexport annotations. --- ports/lzo/portfile.cmake | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/ports/lzo/portfile.cmake b/ports/lzo/portfile.cmake index 227ef7ee0..6df36269c 100644 --- a/ports/lzo/portfile.cmake +++ b/ports/lzo/portfile.cmake @@ -6,6 +6,11 @@ # 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/lzo-2.09) vcpkg_download_distfile(ARCHIVE @@ -20,19 +25,8 @@ vcpkg_apply_patches( PATCHES "${CMAKE_CURRENT_LIST_DIR}/do-not-declare-setargv.patch" ) -if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - set(ENABLE_STATIC ON) - set(ENABLE_SHARED OFF) -else() - set(ENABLE_STATIC OFF) - set(ENABLE_SHARED ON) -endif() - vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} - OPTIONS - -DENABLE_STATIC=${ENABLE_STATIC} - -DENABLE_SHARED=${ENABLE_SHARED} # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 # OPTIONS_RELEASE -DOPTIMIZE=1 # OPTIONS_DEBUG -DDEBUGGABLE=1 @@ -40,6 +34,8 @@ vcpkg_configure_cmake( vcpkg_install_cmake() +vcpkg_copy_pdbs() + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -- cgit v1.2.3 From 919d8ea1ec449e17262c86838b2e74c44b695dea Mon Sep 17 00:00:00 2001 From: flysha Date: Mon, 23 Jan 2017 21:49:13 +0800 Subject: [mpir] enable static build --- ports/mpir/CONTROL | 4 +- ports/mpir/portfile.cmake | 126 +++++++++++++++++++++++++++------------------- 2 files changed, 75 insertions(+), 55 deletions(-) diff --git a/ports/mpir/CONTROL b/ports/mpir/CONTROL index 6d8646f93..0a1f1601b 100644 --- a/ports/mpir/CONTROL +++ b/ports/mpir/CONTROL @@ -1,3 +1,3 @@ -Source: mpir -Version: 2.7.2 +Source: mpir +Version: 2.7.2-1 Description: Multiple Precision Integers and Rationals. \ No newline at end of file diff --git a/ports/mpir/portfile.cmake b/ports/mpir/portfile.cmake index a3a704407..a57c53328 100644 --- a/ports/mpir/portfile.cmake +++ b/ports/mpir/portfile.cmake @@ -1,53 +1,73 @@ -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(STATUS "Warning: Static building not supported yet. Building dynamic.") - set(VCPKG_LIBRARY_LINKAGE dynamic) -endif() -include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mpir-2.7.2) -vcpkg_download_distfile(ARCHIVE_FILE - URLS "http://mpir.org/mpir-2.7.2.tar.lz" - FILENAME "mpir-2.7.2.tar.lz" - SHA512 2635c167ddbba99364ec741373768e0675d34f94fad8912d5433b95e6fbfdb0510f5e94a707acc42048254bc658c52c6671bb0c0dac31267c4b82b00c3e74efa -) -vcpkg_extract_source_archive(${ARCHIVE_FILE}) - -vcpkg_build_msbuild( - PROJECT_PATH ${SOURCE_PATH}/build.vc14/dll_mpir_gc/dll_mpir_gc.vcxproj -) - -IF (TRIPLET_SYSTEM_ARCH MATCHES "x86") - SET(BUILD_ARCH "Win32") -ELSE() - SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH}) -ENDIF() - -file(INSTALL - ${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/gmp.h - ${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/gmpxx.h - ${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/mpir.h - ${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/mpirxx.h - DESTINATION ${CURRENT_PACKAGES_DIR}/include -) -file(INSTALL - ${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/mpir.dll - ${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/mpir.pdb - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin -) -file(INSTALL - ${SOURCE_PATH}/dll/${BUILD_ARCH}/Release/mpir.dll - ${SOURCE_PATH}/dll/${BUILD_ARCH}/Release/mpir.pdb - DESTINATION ${CURRENT_PACKAGES_DIR}/bin -) -file(INSTALL - ${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/mpir.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib -) -file(INSTALL - ${SOURCE_PATH}/dll/${BUILD_ARCH}/Release/mpir.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/lib -) - -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/mpir RENAME copyright) - -vcpkg_copy_pdbs() -message(STATUS "Installing done") +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mpir-2.7.2) +vcpkg_download_distfile(ARCHIVE_FILE + URLS "http://mpir.org/mpir-2.7.2.tar.bz2" + FILENAME "mpir-2.7.2.tar.bz2" + SHA512 8436a0123201f9e30130ea340331c5a6445dddb58ce1f6c6a3a8303c310ac5b3c279c83b5c520a757cba82c2b14e92da44583e0eec287090cf69cbb29d516a9c +) +vcpkg_extract_source_archive(${ARCHIVE_FILE}) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + vcpkg_build_msbuild( + PROJECT_PATH ${SOURCE_PATH}/build.vc14/dll_mpir_gc/dll_mpir_gc.vcxproj + ) +else() + vcpkg_build_msbuild( + PROJECT_PATH ${SOURCE_PATH}/build.vc14/lib_mpir_gc/lib_mpir_gc.vcxproj + ) +endif() + +IF (TRIPLET_SYSTEM_ARCH MATCHES "x86") + SET(BUILD_ARCH "Win32") +ELSE() + SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH}) +ENDIF() + +if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + file(INSTALL + ${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/gmp.h + ${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/gmpxx.h + ${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/mpir.h + ${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/mpirxx.h + DESTINATION ${CURRENT_PACKAGES_DIR}/include + ) + file(INSTALL + ${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/mpir.dll + ${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/mpir.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin + ) + file(INSTALL + ${SOURCE_PATH}/dll/${BUILD_ARCH}/Release/mpir.dll + ${SOURCE_PATH}/dll/${BUILD_ARCH}/Release/mpir.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/bin + ) + file(INSTALL + ${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/mpir.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib + ) + file(INSTALL + ${SOURCE_PATH}/dll/${BUILD_ARCH}/Release/mpir.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib + ) + file(INSTALL ${SOURCE_PATH}/COPYING.lib DESTINATION ${CURRENT_PACKAGES_DIR}/share/mpir RENAME copyright) + vcpkg_copy_pdbs() +else() + file(INSTALL + ${SOURCE_PATH}/lib/${BUILD_ARCH}/Debug/gmp.h + ${SOURCE_PATH}/lib/${BUILD_ARCH}/Debug/gmpxx.h + ${SOURCE_PATH}/lib/${BUILD_ARCH}/Debug/mpir.h + ${SOURCE_PATH}/lib/${BUILD_ARCH}/Debug/mpirxx.h + DESTINATION ${CURRENT_PACKAGES_DIR}/include + ) + file(INSTALL + ${SOURCE_PATH}/lib/${BUILD_ARCH}/Debug/mpir.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib + ) + file(INSTALL + ${SOURCE_PATH}/lib/${BUILD_ARCH}/Release/mpir.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib + ) + file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/mpir RENAME copyright) +endif() + +message(STATUS "Installing done") -- cgit v1.2.3 From bb639bfa9c0b21fd7fa5dac3531657a03fbb2b7b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 12:53:18 -0800 Subject: [VS2017] Add powershell script to enumerator VS2017 instances --- scripts/findVisualStudioInstallationInstances.ps1 | 41 +++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 scripts/findVisualStudioInstallationInstances.ps1 diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 new file mode 100644 index 000000000..1cb78fa9e --- /dev/null +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -0,0 +1,41 @@ +[CmdletBinding()] +param( + +) + +Import-Module BitsTransfer + +$scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition +$vcpkgRootDir = & $scriptsDir\findFileRecursivelyUp.ps1 $scriptsDir .vcpkg-root + +$downloadsDir = "$vcpkgRootDir\downloads" + +& $scriptsDir\fetchDependency.ps1 "nuget" +$nugetexe = "$downloadsDir\nuget.exe" +$nugetPackageDir = "$downloadsDir\nuget-packages" + +$SetupAPIVersion = "1.3.269-rc" +$url = "https://api.nuget.org/packages/microsoft.visualstudio.setup.configuration.native.$SetupAPIVersion.nupkg" +$downloadName = "microsoft.visualstudio.setup.configuration.native.$SetupAPIVersion.nupkg" +$downloadPath = "$downloadsDir\$downloadName" + +if (!(Test-Path $downloadPath)) +{ + Start-BitsTransfer -Source $url -Destination $downloadPath #-ErrorAction SilentlyContinue +} + +$nugetOutput = & $nugetexe install Microsoft.VisualStudio.Setup.Configuration.Native -Pre -Source $downloadsDir -OutputDirectory $nugetPackageDir 2>&1 + +$SetupConsoleExe = "$nugetPackageDir\Microsoft.VisualStudio.Setup.Configuration.Native.$SetupAPIVersion\tools\x86\Microsoft.VisualStudio.Setup.Configuration.Console.exe" + +if (!(Test-Path $SetupConsoleExe)) +{ + throw $nugetOutput +} + +$consoleOutput = & $SetupConsoleExe 2>&1 + +$key = "InstallationPath = " +$paths = $consoleOutput | Select-String -SimpleMatch $key +$paths = $paths -replace $key, "" +return $paths \ No newline at end of file -- cgit v1.2.3 From e6c127511e213a136cd01a40ced59a2b12015428 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 12:54:03 -0800 Subject: [VS2017] Add powershell script to find any MSBuild with C++ support --- scripts/findAnyMSBuildWithCppPlatformToolset.ps1 | 32 ++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 scripts/findAnyMSBuildWithCppPlatformToolset.ps1 diff --git a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 new file mode 100644 index 000000000..1be4a4e6d --- /dev/null +++ b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 @@ -0,0 +1,32 @@ +[CmdletBinding()] +param( + +) + +$scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition + +# VS2017 +$VisualStudio2017InstallationInstances = & $scriptsDir\findVisualStudioInstallationInstances.ps1 +foreach ($instance in $VisualStudio2017InstallationInstances) +{ + $VCFolder= "$instance\VC\Tools\MSVC\" + + if (Test-Path $VCFolder) + { + return "$instance\MSBuild\15.0\Bin\MSBuild.exe","v141" + } +} + +# VS2015 +$CandidateProgramFiles = "${env:PROGRAMFILES(X86)}", "${env:PROGRAMFILES}" +foreach ($ProgramFiles in $CandidateProgramFiles) +{ + $clExe= "$ProgramFiles\Microsoft Visual Studio 14.0\\VC\bin\cl.exe" + + if (Test-Path $clExe) + { + return "$ProgramFiles\MSBuild\14.0\Bin\MSBuild.exe","v140" + } +} + +throw "Could not find MSBuild with C++ support. VS2015 or above with C++ support need to be installed." \ No newline at end of file -- cgit v1.2.3 From 58aeb684429f107715a1b60500f8e24ea5a95f3c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 12:54:33 -0800 Subject: [VS2017] Enable building vcpkg itself with VS2017 --- scripts/bootstrap.ps1 | 5 ++++- toolsrc/vcpkg/vcpkg.vcxproj | 5 +---- toolsrc/vcpkgcommon/vcpkgcommon.vcxproj | 5 +---- toolsrc/vcpkglib/vcpkglib.vcxproj | 5 +---- toolsrc/vcpkgmetrics/vcpkgmetrics.vcxproj | 5 +---- toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj | 5 +---- toolsrc/vcpkgtest/vcpkgtest.vcxproj | 5 +---- 7 files changed, 10 insertions(+), 25 deletions(-) diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index bcb570b39..a37ed99aa 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -23,7 +23,10 @@ if (!(Test-Path $vcpkgSourcesPath)) try{ pushd $vcpkgSourcesPath - cmd /c "$env:VS140COMNTOOLS..\..\VC\vcvarsall.bat" x86 "&" msbuild "/p:VCPKG_VERSION=-$gitHash" "/p:DISABLE_METRICS=$disableMetrics" /p:Configuration=Release /p:Platform=x86 /m + $msbuildExeWithPlatformToolset = & $scriptsDir\findAnyMSBuildWithCppPlatformToolset.ps1 + $msbuildExe = $msbuildExeWithPlatformToolset[0] + $platformToolset = $msbuildExeWithPlatformToolset[1] + & $msbuildExe "/p:VCPKG_VERSION=-$gitHash" "/p:DISABLE_METRICS=$disableMetrics" /p:Configuration=Release /p:Platform=x86 /p:PlatformToolset=$platformToolset /m Write-Verbose("Placing vcpkg.exe in the correct location") diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/vcpkg/vcpkg.vcxproj index bcec048f5..15673e048 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj +++ b/toolsrc/vcpkg/vcpkg.vcxproj @@ -22,31 +22,28 @@ {34671B80-54F9-46F5-8310-AC429C11D4FB} vcpkg 8.1 + v140 Application true - v140 MultiByte Application false - v140 true MultiByte Application true - v140 MultiByte Application false - v140 true MultiByte diff --git a/toolsrc/vcpkgcommon/vcpkgcommon.vcxproj b/toolsrc/vcpkgcommon/vcpkgcommon.vcxproj index c0d108602..2504a0227 100644 --- a/toolsrc/vcpkgcommon/vcpkgcommon.vcxproj +++ b/toolsrc/vcpkgcommon/vcpkgcommon.vcxproj @@ -22,31 +22,28 @@ {7129F242-F20C-43E7-BBEC-4E15B71890B2} vcpkgcommon 8.1 + v140 StaticLibrary true - v140 MultiByte StaticLibrary false - v140 true MultiByte StaticLibrary true - v140 MultiByte StaticLibrary false - v140 true MultiByte diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index 10cc32935..561b22477 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -22,31 +22,28 @@ {B98C92B7-2874-4537-9D46-D14E5C237F04} vcpkglib 8.1 + v140 StaticLibrary true - v140 MultiByte StaticLibrary false - v140 true MultiByte StaticLibrary true - v140 MultiByte StaticLibrary false - v140 true MultiByte diff --git a/toolsrc/vcpkgmetrics/vcpkgmetrics.vcxproj b/toolsrc/vcpkgmetrics/vcpkgmetrics.vcxproj index 7b7fe89ed..66cf52232 100644 --- a/toolsrc/vcpkgmetrics/vcpkgmetrics.vcxproj +++ b/toolsrc/vcpkgmetrics/vcpkgmetrics.vcxproj @@ -22,31 +22,28 @@ {7226078C-1D2A-4123-9EF1-8DF2B722B8F1} vcpkgmetrics 8.1 + v140 StaticLibrary true - v140 MultiByte StaticLibrary false - v140 true MultiByte StaticLibrary true - v140 MultiByte StaticLibrary false - v140 true MultiByte diff --git a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj index 1e2a85087..dc666c19e 100644 --- a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj +++ b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj @@ -22,31 +22,28 @@ {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE} vcpkgmetricsuploader 8.1 + v140 Application true - v140 MultiByte Application false - v140 true MultiByte Application true - v140 MultiByte Application false - v140 true MultiByte diff --git a/toolsrc/vcpkgtest/vcpkgtest.vcxproj b/toolsrc/vcpkgtest/vcpkgtest.vcxproj index d14f86745..a68d77b46 100644 --- a/toolsrc/vcpkgtest/vcpkgtest.vcxproj +++ b/toolsrc/vcpkgtest/vcpkgtest.vcxproj @@ -38,19 +38,18 @@ Win32Proj vcpkgtest 8.1 + v140 DynamicLibrary true - v140 Unicode false DynamicLibrary false - v140 true Unicode false @@ -58,14 +57,12 @@ DynamicLibrary true - v140 Unicode false DynamicLibrary false - v140 true Unicode false -- cgit v1.2.3 From 6d3ab4579d50f74cbe43373fa16ba875a97a8717 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 15:12:43 -0800 Subject: [vcpkg_paths] Add "scripts" entry --- toolsrc/include/vcpkg_paths.h | 1 + toolsrc/src/vcpkg_paths.cpp | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/toolsrc/include/vcpkg_paths.h b/toolsrc/include/vcpkg_paths.h index a2932070d..ba6defb9f 100644 --- a/toolsrc/include/vcpkg_paths.h +++ b/toolsrc/include/vcpkg_paths.h @@ -24,6 +24,7 @@ namespace vcpkg fs::path ports; fs::path installed; fs::path triplets; + fs::path scripts; fs::path buildsystems; fs::path buildsystems_msbuild_targets; diff --git a/toolsrc/src/vcpkg_paths.cpp b/toolsrc/src/vcpkg_paths.cpp index b7e716307..39e4c8986 100644 --- a/toolsrc/src/vcpkg_paths.cpp +++ b/toolsrc/src/vcpkg_paths.cpp @@ -31,8 +31,9 @@ namespace vcpkg paths.ports = paths.root / "ports"; paths.installed = paths.root / "installed"; paths.triplets = paths.root / "triplets"; + paths.scripts = paths.root / "scripts"; - paths.buildsystems = paths.root / "scripts" / "buildsystems"; + paths.buildsystems = paths.scripts / "buildsystems"; paths.buildsystems_msbuild_targets = paths.buildsystems / "msbuild" / "vcpkg.targets"; paths.vcpkg_dir = paths.installed / "vcpkg"; @@ -40,7 +41,7 @@ namespace vcpkg paths.vcpkg_dir_info = paths.vcpkg_dir / "info"; paths.vcpkg_dir_updates = paths.vcpkg_dir / "updates"; - paths.ports_cmake = paths.root / "scripts" / "ports.cmake"; + paths.ports_cmake = paths.scripts / "ports.cmake"; return paths; } -- cgit v1.2.3 From 3a6571a0191df8ff000384937a6254f378ca23cf Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 15:13:12 -0800 Subject: Add Strings::split() function --- toolsrc/include/vcpkg_Strings.h | 2 ++ toolsrc/src/vcpkg_Strings.cpp | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/toolsrc/include/vcpkg_Strings.h b/toolsrc/include/vcpkg_Strings.h index 28853cb5d..cb5d2334c 100644 --- a/toolsrc/include/vcpkg_Strings.h +++ b/toolsrc/include/vcpkg_Strings.h @@ -75,4 +75,6 @@ namespace vcpkg::Strings std::string trimmed(const std::string& s); void trim_all_and_remove_whitespace_strings(std::vector* strings); + + std::vector split(const std::string& s, const std::string& delimiter); } diff --git a/toolsrc/src/vcpkg_Strings.cpp b/toolsrc/src/vcpkg_Strings.cpp index cf7d3b0ee..16477a45c 100644 --- a/toolsrc/src/vcpkg_Strings.cpp +++ b/toolsrc/src/vcpkg_Strings.cpp @@ -119,4 +119,25 @@ namespace vcpkg::Strings return s == ""; }), strings->end()); } + + std::vector split(const std::string& s, const std::string& delimiter) + { + std::vector output; + + size_t i = 0; + size_t pos = s.find(delimiter); + while (pos != std::string::npos) + { + output.push_back(s.substr(i, pos - i)); + i = ++pos; + pos = s.find(delimiter, pos); + + if (pos == std::string::npos) + { + output.push_back(s.substr(i, s.length())); + } + } + + return output; + } } -- cgit v1.2.3 From 79a00367390dd974170b3abb5ad357d3db8ff5e3 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 15:15:26 -0800 Subject: [VS2017] Add function do get dumpbin.exe --- toolsrc/include/vcpkg_Environment.h | 2 ++ toolsrc/src/vcpkg_Environment.cpp | 50 +++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/toolsrc/include/vcpkg_Environment.h b/toolsrc/include/vcpkg_Environment.h index 1e8624d89..64b2315b9 100644 --- a/toolsrc/include/vcpkg_Environment.h +++ b/toolsrc/include/vcpkg_Environment.h @@ -14,4 +14,6 @@ namespace vcpkg::Environment ensure_cmake_on_path(paths); ensure_git_on_path(paths); } + + const fs::path& get_dumpbin_exe(const vcpkg_paths& paths); } diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index c7eec3bd0..1cbd60341 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -4,6 +4,7 @@ #include "vcpkg_Commands.h" #include "metrics.h" #include "vcpkg_System.h" +#include "vcpkg_Strings.h" namespace vcpkg::Environment { @@ -83,4 +84,53 @@ namespace vcpkg::Environment // TODO: switch out ExecutionPolicy Bypass with "Remove Mark Of The Web" code and restore RemoteSigned ensure_on_path(nuget_version, L"nuget 2>&1", L"powershell -ExecutionPolicy Bypass scripts\\fetchDependency.ps1 -Dependency nuget"); } + + static std::vector get_VS2017_installation_instances(const vcpkg_paths& paths) + { + const fs::path script = paths.scripts / "findVisualStudioInstallationInstances.ps1"; + const std::wstring cmd = Strings::wformat(L"powershell -ExecutionPolicy Bypass %s", script.native()); + System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd); + Checks::check_exit(ec_data.exit_code == 0, "Could not run script to detect VS 2017 instances"); + return Strings::split(ec_data.output, "\n"); + } + + static fs::path find_dumpbin_exe(const vcpkg_paths& paths) + { + const std::vector vs2017_installation_instances = get_VS2017_installation_instances(paths); + std::vector paths_examined; + + // VS2017 + for (const std::string& instance : vs2017_installation_instances) + { + const fs::path dumpbin_path = Strings::format(R"(%s\VC\Tools\MSVC\14.10.24911\bin\HostX86\x86\dumpbin.exe)", instance); + paths_examined.push_back(dumpbin_path); + if (fs::exists(dumpbin_path)) + { + return dumpbin_path; + } + } + + // VS2015 + const fs::path vs2015_cmntools = fs::path(System::wdupenv_str(L"VS140COMNTOOLS")).parent_path(); // TODO: Check why this requires parent_path() call + const fs::path vs2015_dumpbin_exe = vs2015_cmntools.parent_path().parent_path() / "VC" / "bin" / "dumpbin.exe"; + paths_examined.push_back(vs2015_dumpbin_exe); + if (fs::exists(vs2015_dumpbin_exe)) + { + return vs2015_dumpbin_exe; + } + + System::println(System::color::error, "Could not detect dumpbin.exe."); + System::println("The following paths were examined:"); + for (const fs::path& path : paths_examined) + { + System::println(path.generic_string()); + } + exit(EXIT_FAILURE); + } + + const fs::path& get_dumpbin_exe(const vcpkg_paths& paths) + { + static const fs::path dumpbin_exe = find_dumpbin_exe(paths); + return dumpbin_exe; + } } -- cgit v1.2.3 From 9194f36a6c3ac873ca13a4be11745968ae1e263e Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 15:24:31 -0800 Subject: [VS2017] Use Environment::get_dumpbin_exe() --- toolsrc/src/post_build_lint.cpp | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index 1fca3a2f6..af76b7963 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -3,6 +3,7 @@ #include "vcpkg_Files.h" #include #include "vcpkg_System.h" +#include "vcpkg_Environment.h" #include "coff_file_reader.h" #include "BuildInfo.h" #include @@ -15,8 +16,6 @@ namespace vcpkg::PostBuildLint ERROR_DETECTED = 1 }; - static const fs::path DUMPBIN_EXE = R"(%VS140COMNTOOLS%\..\..\VC\bin\dumpbin.exe)"; - static lint_status check_for_files_in_include_directory(const fs::path& package_dir) { const fs::path include_dir = package_dir / "include"; @@ -185,12 +184,12 @@ namespace vcpkg::PostBuildLint return lint_status::SUCCESS; } - static lint_status check_exports_of_dlls(const std::vector& dlls) + static lint_status check_exports_of_dlls(const std::vector& dlls, const fs::path& dumpbin_exe) { std::vector dlls_with_no_exports; for (const fs::path& dll : dlls) { - const std::wstring cmd_line = Strings::wformat(LR"("%s" /exports "%s")", DUMPBIN_EXE.native(), dll.native()); + const std::wstring cmd_line = Strings::wformat(LR"("%s" /exports "%s")", dumpbin_exe.native(), dll.native()); System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd_line); Checks::check_exit(ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line)); @@ -211,7 +210,7 @@ namespace vcpkg::PostBuildLint return lint_status::SUCCESS; } - static lint_status check_uwp_bit_of_dlls(const std::string& expected_system_name, const std::vector& dlls) + static lint_status check_uwp_bit_of_dlls(const std::string& expected_system_name, const std::vector& dlls, const fs::path dumpbin_exe) { if (expected_system_name != "uwp") { @@ -221,7 +220,7 @@ namespace vcpkg::PostBuildLint std::vector dlls_with_improper_uwp_bit; for (const fs::path& dll : dlls) { - const std::wstring cmd_line = Strings::wformat(LR"("%s" /headers "%s")", DUMPBIN_EXE.native(), dll.native()); + const std::wstring cmd_line = Strings::wformat(LR"("%s" /headers "%s")", dumpbin_exe.native(), dll.native()); System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd_line); Checks::check_exit(ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line)); @@ -459,7 +458,7 @@ namespace vcpkg::PostBuildLint BuildType build_type; }; - static lint_status check_crt_linkage_of_libs(const BuildType& expected_build_type, const std::vector& libs) + static lint_status check_crt_linkage_of_libs(const BuildType& expected_build_type, const std::vector& libs, const fs::path dumpbin_exe) { std::vector bad_build_types = BuildType::values(); bad_build_types.erase(std::remove(bad_build_types.begin(), bad_build_types.end(), expected_build_type), bad_build_types.end()); @@ -468,7 +467,7 @@ namespace vcpkg::PostBuildLint for (const fs::path& lib : libs) { - const std::wstring cmd_line = Strings::wformat(LR"("%s" /directives "%s")", DUMPBIN_EXE.native(), lib.native()); + const std::wstring cmd_line = Strings::wformat(LR"("%s" /directives "%s")", dumpbin_exe.native(), lib.native()); System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd_line); Checks::check_exit(ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line)); @@ -505,7 +504,7 @@ namespace vcpkg::PostBuildLint OutdatedDynamicCrt outdated_crt; }; - static lint_status check_outdated_crt_linkage_of_dlls(const std::vector& dlls) + static lint_status check_outdated_crt_linkage_of_dlls(const std::vector& dlls, const fs::path dumpbin_exe) { const std::vector& outdated_crts = OutdatedDynamicCrt::values(); @@ -513,7 +512,7 @@ namespace vcpkg::PostBuildLint for (const fs::path& dll : dlls) { - const std::wstring cmd_line = Strings::wformat(LR"("%s" /dependents "%s")", DUMPBIN_EXE.native(), dll.native()); + const std::wstring cmd_line = Strings::wformat(LR"("%s" /dependents "%s")", dumpbin_exe.native(), dll.native()); System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd_line); Checks::check_exit(ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line)); @@ -575,6 +574,8 @@ namespace vcpkg::PostBuildLint void perform_all_checks(const package_spec& spec, const vcpkg_paths& paths) { + const fs::path dumpbin_exe = Environment::get_dumpbin_exe(paths); + System::println("-- Performing post-build validation"); BuildInfo build_info = read_build_info(paths.build_info_file_path(spec)); @@ -623,11 +624,11 @@ namespace vcpkg::PostBuildLint dlls.insert(dlls.cend(), debug_dlls.cbegin(), debug_dlls.cend()); dlls.insert(dlls.cend(), release_dlls.cbegin(), release_dlls.cend()); - error_count += check_exports_of_dlls(dlls); - error_count += check_uwp_bit_of_dlls(spec.target_triplet().system(), dlls); + error_count += check_exports_of_dlls(dlls, dumpbin_exe); + error_count += check_uwp_bit_of_dlls(spec.target_triplet().system(), dlls, dumpbin_exe); error_count += check_dll_architecture(spec.target_triplet().architecture(), dlls); - error_count += check_outdated_crt_linkage_of_dlls(dlls); + error_count += check_outdated_crt_linkage_of_dlls(dlls, dumpbin_exe); break; } case LinkageType::STATIC: @@ -638,8 +639,8 @@ namespace vcpkg::PostBuildLint error_count += check_bin_folders_are_not_present_in_static_build(package_dir); - error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::DEBUG, linkage_type_value_of(build_info.crt_linkage)), debug_libs); - error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::RELEASE, linkage_type_value_of(build_info.crt_linkage)), release_libs); + error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::DEBUG, linkage_type_value_of(build_info.crt_linkage)), debug_libs, dumpbin_exe); + error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::RELEASE, linkage_type_value_of(build_info.crt_linkage)), release_libs, dumpbin_exe); break; } case LinkageType::UNKNOWN: -- cgit v1.2.3 From 50d5e12390636137fedc1472872a4ae777bf1b2c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 15:30:04 -0800 Subject: [VS2017] Extract function that detects the VS2015 instance, when no VS2017 is found --- toolsrc/src/vcpkg_Environment.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index 1cbd60341..00f7206e3 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -94,6 +94,13 @@ namespace vcpkg::Environment return Strings::split(ec_data.output, "\n"); } + static const fs::path& get_VS2015_installation_instance() + { + static const fs::path vs2015_cmntools = fs::path(System::wdupenv_str(L"VS140COMNTOOLS")).parent_path(); // TODO: Check why this requires parent_path() call + static const fs::path vs2015_path = vs2015_cmntools.parent_path().parent_path(); + return vs2015_path; + } + static fs::path find_dumpbin_exe(const vcpkg_paths& paths) { const std::vector vs2017_installation_instances = get_VS2017_installation_instances(paths); @@ -111,8 +118,7 @@ namespace vcpkg::Environment } // VS2015 - const fs::path vs2015_cmntools = fs::path(System::wdupenv_str(L"VS140COMNTOOLS")).parent_path(); // TODO: Check why this requires parent_path() call - const fs::path vs2015_dumpbin_exe = vs2015_cmntools.parent_path().parent_path() / "VC" / "bin" / "dumpbin.exe"; + const fs::path vs2015_dumpbin_exe = get_VS2015_installation_instance() / "VC" / "bin" / "dumpbin.exe"; paths_examined.push_back(vs2015_dumpbin_exe); if (fs::exists(vs2015_dumpbin_exe)) { -- cgit v1.2.3 From 691f337bb3e56487911615a14cd06c86c029eb4b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 15:48:54 -0800 Subject: [VS2017] Don't depend on a specific MSVC dir name --- toolsrc/src/vcpkg_Environment.cpp | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index 00f7206e3..0f4d4b60a 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -5,6 +5,7 @@ #include "metrics.h" #include "vcpkg_System.h" #include "vcpkg_Strings.h" +#include "vcpkg_Files.h" namespace vcpkg::Environment { @@ -109,11 +110,29 @@ namespace vcpkg::Environment // VS2017 for (const std::string& instance : vs2017_installation_instances) { - const fs::path dumpbin_path = Strings::format(R"(%s\VC\Tools\MSVC\14.10.24911\bin\HostX86\x86\dumpbin.exe)", instance); - paths_examined.push_back(dumpbin_path); - if (fs::exists(dumpbin_path)) + const fs::path msvc_path = Strings::format(R"(%s\VC\Tools\MSVC)", instance); + std::vector msvc_subdirectories; + Files::non_recursive_find_matching_paths_in_dir(msvc_path, [&](const fs::path& current) { - return dumpbin_path; + return fs::is_directory(current); + }, &msvc_subdirectories); + + Checks::check_exit(!msvc_subdirectories.empty(), "No subdirectories were found in %s", msvc_path.generic_string()); + + // Sort them so that latest comes first + std::sort(msvc_subdirectories.begin(), msvc_subdirectories.end(), [&](const fs::path& left, const fs::path& right) + { + return left.filename() > right.filename(); + }); + + for (const fs::path& subdir : msvc_subdirectories) + { + const fs::path dumpbin_path = Strings::format(R"(%s\bin\HostX86\x86\dumpbin.exe)", subdir.generic_string()); + paths_examined.push_back(dumpbin_path); + if (fs::exists(dumpbin_path)) + { + return dumpbin_path; + } } } -- cgit v1.2.3 From c1aca5d4adfe0fedd4636ffb488c6f22bbb33f81 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 16:02:02 -0800 Subject: Build path throuh fs::path APIs instead of Strings::format() --- toolsrc/src/vcpkg_Environment.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index 0f4d4b60a..f6bcd3088 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -127,7 +127,7 @@ namespace vcpkg::Environment for (const fs::path& subdir : msvc_subdirectories) { - const fs::path dumpbin_path = Strings::format(R"(%s\bin\HostX86\x86\dumpbin.exe)", subdir.generic_string()); + const fs::path dumpbin_path = subdir / "bin" / "HostX86" / "x86" / "dumpbin.exe"; paths_examined.push_back(dumpbin_path); if (fs::exists(dumpbin_path)) { -- cgit v1.2.3 From a532b949073a14303cf3092d6b8d83a9e4ee8577 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 16:04:43 -0800 Subject: Formatting --- toolsrc/src/vcpkg_Environment.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index f6bcd3088..3efcfb872 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -113,17 +113,17 @@ namespace vcpkg::Environment const fs::path msvc_path = Strings::format(R"(%s\VC\Tools\MSVC)", instance); std::vector msvc_subdirectories; Files::non_recursive_find_matching_paths_in_dir(msvc_path, [&](const fs::path& current) - { - return fs::is_directory(current); - }, &msvc_subdirectories); + { + return fs::is_directory(current); + }, &msvc_subdirectories); Checks::check_exit(!msvc_subdirectories.empty(), "No subdirectories were found in %s", msvc_path.generic_string()); // Sort them so that latest comes first std::sort(msvc_subdirectories.begin(), msvc_subdirectories.end(), [&](const fs::path& left, const fs::path& right) - { - return left.filename() > right.filename(); - }); + { + return left.filename() > right.filename(); + }); for (const fs::path& subdir : msvc_subdirectories) { -- cgit v1.2.3 From e0e3f6ac21d074b0c043e9d6a2aff769930f07a7 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 16:15:30 -0800 Subject: [VS2017] Add function to get vcvarsall.bat --- toolsrc/include/vcpkg_Environment.h | 2 ++ toolsrc/src/vcpkg_Environment.cpp | 39 +++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/toolsrc/include/vcpkg_Environment.h b/toolsrc/include/vcpkg_Environment.h index 64b2315b9..9161f7ce5 100644 --- a/toolsrc/include/vcpkg_Environment.h +++ b/toolsrc/include/vcpkg_Environment.h @@ -16,4 +16,6 @@ namespace vcpkg::Environment } const fs::path& get_dumpbin_exe(const vcpkg_paths& paths); + + const fs::path& get_vcvarsall_bat(const vcpkg_paths& paths); } diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index 3efcfb872..54541bd45 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -158,4 +158,43 @@ namespace vcpkg::Environment static const fs::path dumpbin_exe = find_dumpbin_exe(paths); return dumpbin_exe; } + + static fs::path find_vcvarsall_bat(const vcpkg_paths& paths) + { + const std::vector vs2017_installation_instances = get_VS2017_installation_instances(paths); + std::vector paths_examined; + + // VS2017 + for (const fs::path& instance : vs2017_installation_instances) + { + const fs::path vcvarsall_bat = instance / "VC" / "Auxiliary" / "Build" / "vcvarsall.bat"; + paths_examined.push_back(vcvarsall_bat); + if (fs::exists(vcvarsall_bat)) + { + return vcvarsall_bat; + } + } + + // VS2015 + const fs::path vs2015_vcvarsall_bat = get_VS2015_installation_instance() / "VC" / "vcvarsall.bat"; + paths_examined.push_back(vs2015_vcvarsall_bat); + if (fs::exists(vs2015_vcvarsall_bat)) + { + return vs2015_vcvarsall_bat; + } + + System::println(System::color::error, "Could not detect vccarsall.bat."); + System::println("The following paths were examined:"); + for (const fs::path& path : paths_examined) + { + System::println(path.generic_string()); + } + exit(EXIT_FAILURE); + } + + const fs::path& get_vcvarsall_bat(const vcpkg_paths& paths) + { + static const fs::path vcvarsall_bat = find_vcvarsall_bat(paths); + return vcvarsall_bat; + } } -- cgit v1.2.3 From 127fbe20263302ee2d877dcfedcf853d0415ce2f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 16:16:19 -0800 Subject: [VS2017] Use Environment::get_vcvarsall_bat() --- toolsrc/src/commands_build.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index 72ebb264b..af1b3dc24 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -30,7 +30,9 @@ namespace vcpkg::Commands::Build 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")", + const fs::path vcvarsall_bat = Environment::get_vcvarsall_bat(paths); + const std::wstring command = Strings::wformat(LR"("%s" %s && cmake -DCMD=BUILD -DPORT=%s -DTARGET_TRIPLET=%s "-DCURRENT_PORT_DIR=%s/." -P "%s")", + vcvarsall_bat.native(), Strings::utf8_to_utf16(target_triplet.architecture()), Strings::utf8_to_utf16(source_paragraph.name), Strings::utf8_to_utf16(target_triplet.canonical_name()), -- cgit v1.2.3 From 612d2041214e90d242a5cad9bcf8b2b52357685d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 16:37:03 -0800 Subject: Remove check for empty MSVC dir. --- toolsrc/src/vcpkg_Environment.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index 54541bd45..de17158b4 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -117,8 +117,6 @@ namespace vcpkg::Environment return fs::is_directory(current); }, &msvc_subdirectories); - Checks::check_exit(!msvc_subdirectories.empty(), "No subdirectories were found in %s", msvc_path.generic_string()); - // Sort them so that latest comes first std::sort(msvc_subdirectories.begin(), msvc_subdirectories.end(), [&](const fs::path& left, const fs::path& right) { -- cgit v1.2.3 From a4b419dc7b6fd533904b5c702053c4a871f72629 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 16:39:05 -0800 Subject: Add comment about trailing backslash in VS140COMNTOOLS --- toolsrc/src/vcpkg_Environment.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index de17158b4..709627878 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -97,7 +97,7 @@ namespace vcpkg::Environment static const fs::path& get_VS2015_installation_instance() { - static const fs::path vs2015_cmntools = fs::path(System::wdupenv_str(L"VS140COMNTOOLS")).parent_path(); // TODO: Check why this requires parent_path() call + static const fs::path vs2015_cmntools = fs::path(System::wdupenv_str(L"VS140COMNTOOLS")).parent_path(); // The call to parent path is needed because the env variable has a trailing backslash static const fs::path vs2015_path = vs2015_cmntools.parent_path().parent_path(); return vs2015_path; } -- cgit v1.2.3 From ac2f2cb478bba52c247ccdab13b9c5ad15cd4947 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 16:46:58 -0800 Subject: Strings::split() now handles trailing delimiters --- toolsrc/src/vcpkg_Strings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/vcpkg_Strings.cpp b/toolsrc/src/vcpkg_Strings.cpp index 16477a45c..e53cfa1ef 100644 --- a/toolsrc/src/vcpkg_Strings.cpp +++ b/toolsrc/src/vcpkg_Strings.cpp @@ -132,7 +132,7 @@ namespace vcpkg::Strings i = ++pos; pos = s.find(delimiter, pos); - if (pos == std::string::npos) + if (pos == std::string::npos && i != s.length()) // The second check is so no items are added if there is nothing after the last delimiter { output.push_back(s.substr(i, s.length())); } -- cgit v1.2.3 From 5d603cbae259e492b8ff034a748573d3f680e7c7 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 16:50:29 -0800 Subject: Improve Strings::split() --- toolsrc/src/vcpkg_Strings.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/toolsrc/src/vcpkg_Strings.cpp b/toolsrc/src/vcpkg_Strings.cpp index e53cfa1ef..b974b0a06 100644 --- a/toolsrc/src/vcpkg_Strings.cpp +++ b/toolsrc/src/vcpkg_Strings.cpp @@ -125,17 +125,16 @@ namespace vcpkg::Strings std::vector output; size_t i = 0; - size_t pos = s.find(delimiter); - while (pos != std::string::npos) + for (size_t pos = s.find(delimiter); pos != std::string::npos; pos = s.find(delimiter, pos)) { output.push_back(s.substr(i, pos - i)); i = ++pos; - pos = s.find(delimiter, pos); + } - if (pos == std::string::npos && i != s.length()) // The second check is so no items are added if there is nothing after the last delimiter - { - output.push_back(s.substr(i, s.length())); - } + // Add the rest of the string after the last delimiter, unless there is nothing after it + if (i != s.length()) + { + output.push_back(s.substr(i, s.length())); } return output; -- cgit v1.2.3 From 522b393901638c3abfc89ff63085ec64367c7671 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 17:02:43 -0800 Subject: Bump version of required CMake to 3.7.2 --- scripts/fetchDependency.ps1 | 30 +++++++++++++++--------------- toolsrc/src/vcpkg_Environment.cpp | 4 ++-- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 2f3d992ba..7e8e1d32c 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -51,12 +51,12 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) { return } - + $title = "Download " + $Dependency $message = ("No suitable version of " + $Dependency + " was found (requires $requiredVersion or higher). Download portable version?") $yesDescription = "Downloads " + $Dependency + " v" + $downloadVersion +" app-locally." - $noDescription = "Does not download " + $Dependency + "." - + $noDescription = "Does not download " + $Dependency + "." + $userAllowedDownload = promptForDownload $title $message $yesDescription $noDescription if (!$userAllowedDownload) { @@ -86,10 +86,10 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) $ExtractionType_NO_EXTRACTION_REQUIRED = 0 $ExtractionType_ZIP = 1 $ExtractionType_SELF_EXTRACTING_7Z = 2 - - + + # Using this to wait for the execution to finish - function Invoke-Command() + function Invoke-Command() { param ( [string]$program = $(throw "Please specify a program" ), [string]$argumentString = "", @@ -99,7 +99,7 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) $psi.FileName = $program $psi.Arguments = $argumentString $proc = [Diagnostics.Process]::Start($psi) - if ( $waitForExit ) + if ( $waitForExit ) { $proc.WaitForExit(); } @@ -120,12 +120,12 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) if($Dependency -eq "cmake") { - $requiredVersion = "3.5.0" - $downloadVersion = "3.5.2" - $url = "https://cmake.org/files/v3.5/cmake-3.5.2-win32-x86.zip" - $downloadName = "cmake-3.5.2-win32-x86.zip" - $expectedDownloadedFileHash = "671073aee66b3480a564d0736792e40570a11e861bb34819bb7ae7858bbdfb80" - $executableFromDownload = "$downloadsDir\cmake-3.5.2-win32-x86\bin\cmake.exe" + $requiredVersion = "3.7.2" + $downloadVersion = "3.7.2" + $url = "https://cmake.org/files/v3.7/cmake-3.7.2-win32-x86.zip" + $downloadName = "cmake-3.7.2-win32-x86.zip" + $expectedDownloadedFileHash = "ec5e299d412e0272e01d4de5bf07718f42c96361f83d51cc39f91bf49cc3e5c3" + $executableFromDownload = "$downloadsDir\cmake-3.7.2-win32-x86\bin\cmake.exe" $extractionType = $ExtractionType_ZIP } elseif($Dependency -eq "nuget") @@ -146,7 +146,7 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) $downloadName = "PortableGit-2.8.3-32-bit.7z.exe" $expectedDownloadedFileHash = "DE52D070219E9C4EC1DB179F2ADBF4B760686C3180608F0382A1F8C7031E72AD" # There is another copy of git.exe in PortableGit\bin. However, an installed version of git add the cmd dir to the PATH. - # Therefore, choosing the cmd dir here as well. + # Therefore, choosing the cmd dir here as well. $executableFromDownload = "$downloadsDir\PortableGit\cmd\git.exe" $extractionType = $ExtractionType_SELF_EXTRACTING_7Z } @@ -186,7 +186,7 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) if (-not (Test-Path $executableFromDownload)) { Invoke-Command $downloadPath "-y" -waitForExit:$true - } + } } else { diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index 709627878..e1eb22969 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -63,7 +63,7 @@ namespace vcpkg::Environment void ensure_cmake_on_path(const vcpkg_paths& paths) { - const fs::path downloaded_cmake = paths.downloads / "cmake-3.5.2-win32-x86" / "bin"; + const fs::path downloaded_cmake = paths.downloads / "cmake-3.7.2-win32-x86" / "bin"; const std::wstring path_buf = Strings::wformat(L"%s;%s;%s;%s", downloaded_cmake.native(), System::wdupenv_str(L"PATH"), @@ -71,7 +71,7 @@ namespace vcpkg::Environment default_cmake_installation_dir_x86.native()); _wputenv_s(L"PATH", path_buf.c_str()); - static constexpr std::array cmake_version = {3,5,0}; + static constexpr std::array cmake_version = {3,7,2}; // TODO: switch out ExecutionPolicy Bypass with "Remove Mark Of The Web" code and restore RemoteSigned ensure_on_path(cmake_version, L"cmake --version 2>&1", L"powershell -ExecutionPolicy Bypass scripts\\fetchDependency.ps1 -Dependency cmake"); } -- cgit v1.2.3 From 4e86b01a36cba7a1e1b883a8d62a6f68c2b6e030 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 17:24:34 -0800 Subject: [Environemnt] Don't depend on present working dir --- toolsrc/src/vcpkg_Environment.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index e1eb22969..22a9252b0 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -14,7 +14,7 @@ namespace vcpkg::Environment static const fs::path default_git_installation_dir = "C:/Program Files/git/cmd"; static const fs::path default_git_installation_dir_x86 = "C:/Program Files (x86)/git/cmd"; - static void ensure_on_path(const std::array& version, const wchar_t* version_check_cmd, const wchar_t* install_cmd) + static void ensure_on_path(const std::array& version, const std::wstring& version_check_cmd, const std::wstring& install_cmd) { System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(version_check_cmd); if (ec_data.exit_code == 0) @@ -57,8 +57,11 @@ namespace vcpkg::Environment _wputenv_s(L"PATH", path_buf.c_str()); static constexpr std::array git_version = {2,0,0}; + static const std::wstring version_check_cmd = L"git --version 2>&1"; + const fs::path script = paths.scripts / "fetchDependency.ps1"; // TODO: switch out ExecutionPolicy Bypass with "Remove Mark Of The Web" code and restore RemoteSigned - ensure_on_path(git_version, L"git --version 2>&1", L"powershell -ExecutionPolicy Bypass scripts\\fetchDependency.ps1 -Dependency git"); + const std::wstring install_cmd = Strings::wformat(L"powershell -ExecutionPolicy Bypass %s -Dependency git", script.native()); + ensure_on_path(git_version, version_check_cmd, install_cmd); } void ensure_cmake_on_path(const vcpkg_paths& paths) @@ -72,8 +75,11 @@ namespace vcpkg::Environment _wputenv_s(L"PATH", path_buf.c_str()); static constexpr std::array cmake_version = {3,7,2}; + static const std::wstring version_check_cmd = L"cmake --version 2>&1"; + const fs::path script = paths.scripts / "fetchDependency.ps1"; // TODO: switch out ExecutionPolicy Bypass with "Remove Mark Of The Web" code and restore RemoteSigned - ensure_on_path(cmake_version, L"cmake --version 2>&1", L"powershell -ExecutionPolicy Bypass scripts\\fetchDependency.ps1 -Dependency cmake"); + const std::wstring install_cmd = Strings::wformat(L"powershell -ExecutionPolicy Bypass %s -Dependency cmake", script.native()); + ensure_on_path(cmake_version, version_check_cmd, install_cmd); } void ensure_nuget_on_path(const vcpkg_paths& paths) @@ -82,8 +88,11 @@ namespace vcpkg::Environment _wputenv_s(L"PATH", path_buf.c_str()); static constexpr std::array nuget_version = {1,0,0}; + static const std::wstring version_check_cmd = L"nuget 2>&1"; + const fs::path script = paths.scripts / "fetchDependency.ps1"; // TODO: switch out ExecutionPolicy Bypass with "Remove Mark Of The Web" code and restore RemoteSigned - ensure_on_path(nuget_version, L"nuget 2>&1", L"powershell -ExecutionPolicy Bypass scripts\\fetchDependency.ps1 -Dependency nuget"); + const std::wstring install_cmd = Strings::wformat(L"powershell -ExecutionPolicy Bypass %s -Dependency nuget", script.native()); + ensure_on_path(nuget_version, version_check_cmd, install_cmd); } static std::vector get_VS2017_installation_instances(const vcpkg_paths& paths) -- cgit v1.2.3 From d9f770ad8d6010a09d6be2ec9a262fc6ce074267 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 17:28:20 -0800 Subject: Improve comment --- toolsrc/src/vcpkg_Environment.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index 22a9252b0..aaa6bb106 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -106,7 +106,7 @@ namespace vcpkg::Environment static const fs::path& get_VS2015_installation_instance() { - static const fs::path vs2015_cmntools = fs::path(System::wdupenv_str(L"VS140COMNTOOLS")).parent_path(); // The call to parent path is needed because the env variable has a trailing backslash + static const fs::path vs2015_cmntools = fs::path(System::wdupenv_str(L"VS140COMNTOOLS")).parent_path(); // The call to parent_path() is needed because the env variable has a trailing backslash static const fs::path vs2015_path = vs2015_cmntools.parent_path().parent_path(); return vs2015_path; } -- cgit v1.2.3 From 44810f267d095986f519d8b41592e83e913c2e56 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 23 Jan 2017 18:26:57 -0800 Subject: [vcpkg integrate] Lower verbosity of MSBuild messages. --- scripts/buildsystems/msbuild/vcpkg.targets | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/buildsystems/msbuild/vcpkg.targets b/scripts/buildsystems/msbuild/vcpkg.targets index 912cf6b8e..26a524ca3 100644 --- a/scripts/buildsystems/msbuild/vcpkg.targets +++ b/scripts/buildsystems/msbuild/vcpkg.targets @@ -57,12 +57,14 @@ Lines="^$(OutputPath)$(TargetName).$(OutputType);" Encoding="Unicode"/> + ConsoleToMSBuild="true" + StandardOutputImportance="Normal"> + ConsoleToMSBuild="true" + StandardOutputImportance="Normal"> -- cgit v1.2.3 From 64bcc326fb98a7ae8249cc50b6305166e8f3ac89 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 17:49:41 -0800 Subject: Improve format of output error messages --- toolsrc/src/vcpkg_Environment.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index aaa6bb106..b6705cc47 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -155,7 +155,7 @@ namespace vcpkg::Environment System::println("The following paths were examined:"); for (const fs::path& path : paths_examined) { - System::println(path.generic_string()); + System::println(" %s", path.generic_string()); } exit(EXIT_FAILURE); } @@ -194,7 +194,7 @@ namespace vcpkg::Environment System::println("The following paths were examined:"); for (const fs::path& path : paths_examined) { - System::println(path.generic_string()); + System::println(" %s",path.generic_string()); } exit(EXIT_FAILURE); } -- cgit v1.2.3 From 2670075bf202529aa23b6c278b589e3c0541076e Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 18:36:22 -0800 Subject: Extract method --- toolsrc/src/vcpkg_Environment.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index b6705cc47..76aa07fb6 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -46,6 +46,13 @@ namespace vcpkg::Environment } } + static std::wstring create_default_install_cmd(const vcpkg_paths& paths, const std::wstring& tool_name) + { + const fs::path script = paths.scripts / "fetchDependency.ps1"; + // TODO: switch out ExecutionPolicy Bypass with "Remove Mark Of The Web" code and restore RemoteSigned + return Strings::wformat(L"powershell -ExecutionPolicy Bypass %s -Dependency %s", script.native(), tool_name); + } + void ensure_git_on_path(const vcpkg_paths& paths) { const fs::path downloaded_git = paths.downloads / "PortableGit" / "cmd"; @@ -58,9 +65,7 @@ namespace vcpkg::Environment static constexpr std::array git_version = {2,0,0}; static const std::wstring version_check_cmd = L"git --version 2>&1"; - const fs::path script = paths.scripts / "fetchDependency.ps1"; - // TODO: switch out ExecutionPolicy Bypass with "Remove Mark Of The Web" code and restore RemoteSigned - const std::wstring install_cmd = Strings::wformat(L"powershell -ExecutionPolicy Bypass %s -Dependency git", script.native()); + const std::wstring install_cmd = create_default_install_cmd(paths, L"git"); ensure_on_path(git_version, version_check_cmd, install_cmd); } @@ -76,9 +81,7 @@ namespace vcpkg::Environment static constexpr std::array cmake_version = {3,7,2}; static const std::wstring version_check_cmd = L"cmake --version 2>&1"; - const fs::path script = paths.scripts / "fetchDependency.ps1"; - // TODO: switch out ExecutionPolicy Bypass with "Remove Mark Of The Web" code and restore RemoteSigned - const std::wstring install_cmd = Strings::wformat(L"powershell -ExecutionPolicy Bypass %s -Dependency cmake", script.native()); + const std::wstring install_cmd = create_default_install_cmd(paths, L"cmake"); ensure_on_path(cmake_version, version_check_cmd, install_cmd); } @@ -89,9 +92,7 @@ namespace vcpkg::Environment static constexpr std::array nuget_version = {1,0,0}; static const std::wstring version_check_cmd = L"nuget 2>&1"; - const fs::path script = paths.scripts / "fetchDependency.ps1"; - // TODO: switch out ExecutionPolicy Bypass with "Remove Mark Of The Web" code and restore RemoteSigned - const std::wstring install_cmd = Strings::wformat(L"powershell -ExecutionPolicy Bypass %s -Dependency nuget", script.native()); + const std::wstring install_cmd = create_default_install_cmd(paths, L"nuget"); ensure_on_path(nuget_version, version_check_cmd, install_cmd); } -- cgit v1.2.3 From 868a7623addee16f19b17718163b7719c4d739e2 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 18:42:34 -0800 Subject: Bump nuget.exe version --- scripts/fetchDependency.ps1 | 8 ++++---- toolsrc/src/vcpkg_Environment.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 7e8e1d32c..eedfb15d1 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -130,11 +130,11 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) } elseif($Dependency -eq "nuget") { - $requiredVersion = "1.0.0" - $downloadVersion = "3.4.3" - $url = "https://dist.nuget.org/win-x86-commandline/v3.4.3/nuget.exe" + $requiredVersion = "3.3.0" + $downloadVersion = "3.5.0" + $url = "https://dist.nuget.org/win-x86-commandline/v3.5.0/nuget.exe" $downloadName = "nuget.exe" - $expectedDownloadedFileHash = "3B1EA72943968D7AF6BACDB4F2F3A048A25AFD14564EF1D8B1C041FDB09EBB0A" + $expectedDownloadedFileHash = "399ec24c26ed54d6887cde61994bb3d1cada7956c1b19ff880f06f060c039918" $executableFromDownload = "$downloadsDir\nuget.exe" $extractionType = $ExtractionType_NO_EXTRACTION_REQUIRED } diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index 76aa07fb6..1a50a604a 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -90,7 +90,7 @@ namespace vcpkg::Environment const std::wstring path_buf = Strings::wformat(L"%s;%s", paths.downloads.native(), System::wdupenv_str(L"PATH")); _wputenv_s(L"PATH", path_buf.c_str()); - static constexpr std::array nuget_version = {1,0,0}; + static constexpr std::array nuget_version = {3,3,0}; static const std::wstring version_check_cmd = L"nuget 2>&1"; const std::wstring install_cmd = create_default_install_cmd(paths, L"nuget"); ensure_on_path(nuget_version, version_check_cmd, install_cmd); -- cgit v1.2.3 From 7c9db95feccf6e9d01d2e1af6c7012685d8e46b6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 18:47:38 -0800 Subject: Bump downloaded git version --- scripts/fetchDependency.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index eedfb15d1..e1ef184ab 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -141,10 +141,10 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) elseif($Dependency -eq "git") { $requiredVersion = "2.0.0" - $downloadVersion = "2.8.3" - $url = "https://github.com/git-for-windows/git/releases/download/v2.8.3.windows.1/PortableGit-2.8.3-32-bit.7z.exe" # We choose the 32-bit version - $downloadName = "PortableGit-2.8.3-32-bit.7z.exe" - $expectedDownloadedFileHash = "DE52D070219E9C4EC1DB179F2ADBF4B760686C3180608F0382A1F8C7031E72AD" + $downloadVersion = "2.11.0" + $url = "https://github.com/git-for-windows/git/releases/download/v2.11.0.windows.3/PortableGit-2.11.0.3-32-bit.7z.exe" # We choose the 32-bit version + $downloadName = "PortableGit-2.11.0.3-32-bit.7z.exe" + $expectedDownloadedFileHash = "8bf3769c37945e991903dd1b988c6b1d97bbf0f3afc9851508974f38bf94dc01" # There is another copy of git.exe in PortableGit\bin. However, an installed version of git add the cmd dir to the PATH. # Therefore, choosing the cmd dir here as well. $executableFromDownload = "$downloadsDir\PortableGit\cmd\git.exe" -- cgit v1.2.3 From 93c3c0648a782b1fa75bae1f200beca6ba871f9a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 19:25:47 -0800 Subject: [VS2017] Enable building with v141 toolset --- scripts/cmake/vcpkg_configure_cmake.cmake | 27 ++++++++++++++++++++------- toolsrc/include/vcpkg_Environment.h | 8 +++++++- toolsrc/src/commands_build.cpp | 7 ++++--- toolsrc/src/vcpkg_Environment.cpp | 10 +++++----- 4 files changed, 36 insertions(+), 16 deletions(-) diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 179703172..128782075 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -4,20 +4,33 @@ function(vcpkg_configure_cmake) if(_csc_GENERATOR) set(GENERATOR ${_csc_GENERATOR}) - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x86") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") set(GENERATOR "Visual Studio 14 2015") - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x64") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") set(GENERATOR "Visual Studio 14 2015 Win64") - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "arm") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") set(GENERATOR "Visual Studio 14 2015 ARM") # elseif(NOT vcpkg_configure_cmake_NINJA MATCHES "NOTFOUND") # set(GENERATOR "Ninja") - elseif(TRIPLET_SYSTEM_ARCH MATCHES "x86") + elseif(TRIPLET_SYSTEM_ARCH MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") set(GENERATOR "Visual Studio 14 2015") - elseif(TRIPLET_SYSTEM_ARCH MATCHES "x64") + elseif(TRIPLET_SYSTEM_ARCH MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") set(GENERATOR "Visual Studio 14 2015 Win64") elseif(TRIPLET_SYSTEM_ARCH MATCHES "arm") - set(GENERATOR "Visual Studio 14 2015 ARM") + set(GENERATOR "Visual Studio 14 2015 ARM" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") + + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") + set(GENERATOR "Visual Studio 15 2017") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") + set(GENERATOR "Visual Studio 15 2017 Win64") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") + set(GENERATOR "Visual Studio 15 2017 ARM") + elseif(TRIPLET_SYSTEM_ARCH MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") + set(GENERATOR "Visual Studio 15 2017") + elseif(TRIPLET_SYSTEM_ARCH MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") + set(GENERATOR "Visual Studio 15 2017 Win64") + elseif(TRIPLET_SYSTEM_ARCH MATCHES "arm") + set(GENERATOR "Visual Studio 15 2017 ARM" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") endif() file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) @@ -33,7 +46,7 @@ function(vcpkg_configure_cmake) elseif(DEFINED VCPKG_LIBRARY_LINKAGE AND VCPKG_LIBRARY_LINKAGE STREQUAL static) list(APPEND _csc_OPTIONS -DBUILD_SHARED_LIBS=OFF) endif() - + list(APPEND _csc_OPTIONS "-DCMAKE_CXX_FLAGS= /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc" diff --git a/toolsrc/include/vcpkg_Environment.h b/toolsrc/include/vcpkg_Environment.h index 9161f7ce5..e4dd47472 100644 --- a/toolsrc/include/vcpkg_Environment.h +++ b/toolsrc/include/vcpkg_Environment.h @@ -17,5 +17,11 @@ namespace vcpkg::Environment const fs::path& get_dumpbin_exe(const vcpkg_paths& paths); - const fs::path& get_vcvarsall_bat(const vcpkg_paths& paths); + struct vcvarsall_and_platform_toolset + { + fs::path path; + std::wstring platform_toolset; + }; + + const vcvarsall_and_platform_toolset& get_vcvarsall_bat(const vcpkg_paths& paths); } diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index af1b3dc24..d9d5d2107 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -30,12 +30,13 @@ namespace vcpkg::Commands::Build const triplet& target_triplet = spec.target_triplet(); const fs::path ports_cmake_script_path = paths.ports_cmake; - const fs::path vcvarsall_bat = Environment::get_vcvarsall_bat(paths); - const std::wstring command = Strings::wformat(LR"("%s" %s && cmake -DCMD=BUILD -DPORT=%s -DTARGET_TRIPLET=%s "-DCURRENT_PORT_DIR=%s/." -P "%s")", - vcvarsall_bat.native(), + const Environment::vcvarsall_and_platform_toolset vcvarsall_bat = Environment::get_vcvarsall_bat(paths); + const std::wstring command = Strings::wformat(LR"("%s" %s && cmake -DCMD=BUILD -DPORT=%s -DTARGET_TRIPLET=%s -DVCPKG_PLATFORM_TOOLSET=%s "-DCURRENT_PORT_DIR=%s/." -P "%s")", + vcvarsall_bat.path.native(), Strings::utf8_to_utf16(target_triplet.architecture()), Strings::utf8_to_utf16(source_paragraph.name), Strings::utf8_to_utf16(target_triplet.canonical_name()), + vcvarsall_bat.platform_toolset, port_dir.generic_wstring(), ports_cmake_script_path.generic_wstring()); diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index 1a50a604a..c204bfaf4 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -167,7 +167,7 @@ namespace vcpkg::Environment return dumpbin_exe; } - static fs::path find_vcvarsall_bat(const vcpkg_paths& paths) + static vcvarsall_and_platform_toolset find_vcvarsall_bat(const vcpkg_paths& paths) { const std::vector vs2017_installation_instances = get_VS2017_installation_instances(paths); std::vector paths_examined; @@ -179,7 +179,7 @@ namespace vcpkg::Environment paths_examined.push_back(vcvarsall_bat); if (fs::exists(vcvarsall_bat)) { - return vcvarsall_bat; + return { vcvarsall_bat , L"v141"}; } } @@ -188,7 +188,7 @@ namespace vcpkg::Environment paths_examined.push_back(vs2015_vcvarsall_bat); if (fs::exists(vs2015_vcvarsall_bat)) { - return vs2015_vcvarsall_bat; + return { vs2015_vcvarsall_bat, L"v140" }; } System::println(System::color::error, "Could not detect vccarsall.bat."); @@ -200,9 +200,9 @@ namespace vcpkg::Environment exit(EXIT_FAILURE); } - const fs::path& get_vcvarsall_bat(const vcpkg_paths& paths) + const vcvarsall_and_platform_toolset& get_vcvarsall_bat(const vcpkg_paths& paths) { - static const fs::path vcvarsall_bat = find_vcvarsall_bat(paths); + static const vcvarsall_and_platform_toolset vcvarsall_bat = find_vcvarsall_bat(paths); return vcvarsall_bat; } } -- cgit v1.2.3 From ab33a7fd49904b5a4ff25af6f87d32ddf15fcd6c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 19:56:07 -0800 Subject: Update CHANGELOG and bump version to v0.0.70 --- CHANGELOG.md | 21 +++++++++++++++++++++ toolsrc/VERSION.txt | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 103417bad..3380cd074 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,24 @@ +vcpkg (0.0.70) +-------------- + * Add ports: + - fltk 1.3.4-1 + - glib 2.50.2 + - lzo 2.09 + - uvatlas sept2016 + * Update ports: + - dx 1.0.0 -> 1.0.1 + - libmysql 5.7.16 -> 5.7.17 + * Add support for Visual Studio 2017 + - Previously, you could use Visual Studio 2017 for your own application and `vcpkg` integration would work, but you needed to have Visual Studio 2015 to build `vcpkg` itself as well as the libraries. This requirement has now been removed + - If both Visual Studio 2015 and Visual Studio 2017 are installed, Visual Studio 2017 tools will be preferred over those of Visual Studio 2015 + * Bump required version & auto-downloaded version of `cmake` to 3.7.2 (was 3.5.x), which includes generators for Visual Studio 2017 + * Bump auto-downloaded version of `nuget` to 3.5.0 (was 3.4.3) + * Bump auto-downloaded version of `git` to 2.11.0 (was 2.8.3) + * Fixes and improvements in existing portfiles and the `vcpkg` tool itself + +-- vcpkg team MON, 23 Jan 2017 19:50:00 -0800 + + vcpkg (0.0.67) -------------- * Add ports: diff --git a/toolsrc/VERSION.txt b/toolsrc/VERSION.txt index 8afb66b09..1759b863b 100644 --- a/toolsrc/VERSION.txt +++ b/toolsrc/VERSION.txt @@ -1 +1 @@ -"0.0.67" \ No newline at end of file +"0.0.70" \ No newline at end of file -- cgit v1.2.3 From ccda20a8584a9fcc89c4dd631e5ef8d4189f1131 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 24 Jan 2017 12:01:11 -0800 Subject: Remove $downloadName variable --- scripts/fetchDependency.ps1 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index e1ef184ab..9269dba8c 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -123,7 +123,7 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) $requiredVersion = "3.7.2" $downloadVersion = "3.7.2" $url = "https://cmake.org/files/v3.7/cmake-3.7.2-win32-x86.zip" - $downloadName = "cmake-3.7.2-win32-x86.zip" + $downloadPath = "$downloadsDir\cmake-3.7.2-win32-x86.zip" $expectedDownloadedFileHash = "ec5e299d412e0272e01d4de5bf07718f42c96361f83d51cc39f91bf49cc3e5c3" $executableFromDownload = "$downloadsDir\cmake-3.7.2-win32-x86\bin\cmake.exe" $extractionType = $ExtractionType_ZIP @@ -133,7 +133,7 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) $requiredVersion = "3.3.0" $downloadVersion = "3.5.0" $url = "https://dist.nuget.org/win-x86-commandline/v3.5.0/nuget.exe" - $downloadName = "nuget.exe" + $downloadPath = "$downloadsDir\nuget.exe" $expectedDownloadedFileHash = "399ec24c26ed54d6887cde61994bb3d1cada7956c1b19ff880f06f060c039918" $executableFromDownload = "$downloadsDir\nuget.exe" $extractionType = $ExtractionType_NO_EXTRACTION_REQUIRED @@ -143,7 +143,7 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) $requiredVersion = "2.0.0" $downloadVersion = "2.11.0" $url = "https://github.com/git-for-windows/git/releases/download/v2.11.0.windows.3/PortableGit-2.11.0.3-32-bit.7z.exe" # We choose the 32-bit version - $downloadName = "PortableGit-2.11.0.3-32-bit.7z.exe" + $downloadPath = "$downloadsDir\PortableGit-2.11.0.3-32-bit.7z.exe" $expectedDownloadedFileHash = "8bf3769c37945e991903dd1b988c6b1d97bbf0f3afc9851508974f38bf94dc01" # There is another copy of git.exe in PortableGit\bin. However, an installed version of git add the cmd dir to the PATH. # Therefore, choosing the cmd dir here as well. @@ -155,7 +155,6 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) throw "Unknown program requested" } - $downloadPath = "$downloadsDir\$downloadName" performDownload $Dependency $url $downloadsDir $downloadPath $downloadVersion $requiredVersion #calculating the hash -- cgit v1.2.3 From d5e7a501e907f06ad1e8bb4ffdebce9a29179d2d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 24 Jan 2017 12:30:14 -0800 Subject: Download nuget.exe in a version-including subfolder in Downloads\ --- scripts/fetchDependency.ps1 | 10 ++++++++-- toolsrc/src/vcpkg_Environment.cpp | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 9269dba8c..d05d16bea 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -133,9 +133,9 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) $requiredVersion = "3.3.0" $downloadVersion = "3.5.0" $url = "https://dist.nuget.org/win-x86-commandline/v3.5.0/nuget.exe" - $downloadPath = "$downloadsDir\nuget.exe" + $downloadPath = "$downloadsDir\nuget-3.5.0\nuget.exe" $expectedDownloadedFileHash = "399ec24c26ed54d6887cde61994bb3d1cada7956c1b19ff880f06f060c039918" - $executableFromDownload = "$downloadsDir\nuget.exe" + $executableFromDownload = $downloadPath $extractionType = $ExtractionType_NO_EXTRACTION_REQUIRED } elseif($Dependency -eq "git") @@ -155,6 +155,12 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) throw "Unknown program requested" } + $downloadSubdir = Split-path $downloadPath -Parent + if (!(Test-Path $downloadSubdir)) + { + New-Item -ItemType Directory -Path $downloadSubdir | Out-Null + } + performDownload $Dependency $url $downloadsDir $downloadPath $downloadVersion $requiredVersion #calculating the hash diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index c204bfaf4..66d33edeb 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -87,7 +87,8 @@ namespace vcpkg::Environment void ensure_nuget_on_path(const vcpkg_paths& paths) { - const std::wstring path_buf = Strings::wformat(L"%s;%s", paths.downloads.native(), System::wdupenv_str(L"PATH")); + const fs::path downloaded_nuget = paths.downloads / "nuget-3.5.0"; + const std::wstring path_buf = Strings::wformat(L"%s;%s", downloaded_nuget.native(), System::wdupenv_str(L"PATH")); _wputenv_s(L"PATH", path_buf.c_str()); static constexpr std::array nuget_version = {3,3,0}; -- cgit v1.2.3 From d96f56736e9696248584506f364ee31acf12ddc3 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 24 Jan 2017 12:32:03 -0800 Subject: Fix path to nuget.exe --- scripts/findVisualStudioInstallationInstances.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index 1cb78fa9e..241b05bc1 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -11,7 +11,7 @@ $vcpkgRootDir = & $scriptsDir\findFileRecursivelyUp.ps1 $scriptsDir .vcpkg-root $downloadsDir = "$vcpkgRootDir\downloads" & $scriptsDir\fetchDependency.ps1 "nuget" -$nugetexe = "$downloadsDir\nuget.exe" +$nugetexe = "$downloadsDir\nuget-3.5.0\nuget.exe" $nugetPackageDir = "$downloadsDir\nuget-packages" $SetupAPIVersion = "1.3.269-rc" -- cgit v1.2.3 From f2ac7a32aaf9e0f374cf3025f6f86561780951eb Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 24 Jan 2017 12:36:46 -0800 Subject: FetchDependency.ps1 now returns the downloaded exe's path --- scripts/fetchDependency.ps1 | 2 ++ scripts/findVisualStudioInstallationInstances.ps1 | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index d05d16bea..b56bf1087 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -202,6 +202,8 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) { throw [System.IO.FileNotFoundException] ("Could not detect or download " + $Dependency) } + + return $downloadPath } SelectProgram $Dependency \ No newline at end of file diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index 241b05bc1..d5faa57d3 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -10,8 +10,7 @@ $vcpkgRootDir = & $scriptsDir\findFileRecursivelyUp.ps1 $scriptsDir .vcpkg-root $downloadsDir = "$vcpkgRootDir\downloads" -& $scriptsDir\fetchDependency.ps1 "nuget" -$nugetexe = "$downloadsDir\nuget-3.5.0\nuget.exe" +$nugetexe = & $scriptsDir\fetchDependency.ps1 "nuget" $nugetPackageDir = "$downloadsDir\nuget-packages" $SetupAPIVersion = "1.3.269-rc" -- cgit v1.2.3 From 6946f2d244703c82219743b701d659c4bea4b9f5 Mon Sep 17 00:00:00 2001 From: codicodi Date: Tue, 24 Jan 2017 21:57:52 +0100 Subject: [libarchive] add one more patch --- .../override-broken-feature-checks.patch | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 ports/libarchive/override-broken-feature-checks.patch diff --git a/ports/libarchive/override-broken-feature-checks.patch b/ports/libarchive/override-broken-feature-checks.patch new file mode 100644 index 000000000..63c65a10f --- /dev/null +++ b/ports/libarchive/override-broken-feature-checks.patch @@ -0,0 +1,55 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2d035a1..1e32afd 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1226,7 +1226,8 @@ CHECK_FUNCTION_EXISTS_GLIBC(localtime_r HAVE_LOCALTIME_R) + CHECK_FUNCTION_EXISTS_GLIBC(lstat HAVE_LSTAT) + CHECK_FUNCTION_EXISTS_GLIBC(lutimes HAVE_LUTIMES) + CHECK_FUNCTION_EXISTS_GLIBC(mbrtowc HAVE_MBRTOWC) +-CHECK_FUNCTION_EXISTS_GLIBC(memmove HAVE_MEMMOVE) ++#CHECK_FUNCTION_EXISTS_GLIBC(memmove HAVE_MEMMOVE) ++set(HAVE_MEMMOVE 1) + CHECK_FUNCTION_EXISTS_GLIBC(mkdir HAVE_MKDIR) + CHECK_FUNCTION_EXISTS_GLIBC(mkfifo HAVE_MKFIFO) + CHECK_FUNCTION_EXISTS_GLIBC(mknod HAVE_MKNOD) +@@ -1257,11 +1258,16 @@ CHECK_FUNCTION_EXISTS_GLIBC(utime HAVE_UTIME) + CHECK_FUNCTION_EXISTS_GLIBC(utimes HAVE_UTIMES) + CHECK_FUNCTION_EXISTS_GLIBC(utimensat HAVE_UTIMENSAT) + CHECK_FUNCTION_EXISTS_GLIBC(vfork HAVE_VFORK) +-CHECK_FUNCTION_EXISTS_GLIBC(wcrtomb HAVE_WCRTOMB) +-CHECK_FUNCTION_EXISTS_GLIBC(wcscmp HAVE_WCSCMP) +-CHECK_FUNCTION_EXISTS_GLIBC(wcscpy HAVE_WCSCPY) +-CHECK_FUNCTION_EXISTS_GLIBC(wcslen HAVE_WCSLEN) +-CHECK_FUNCTION_EXISTS_GLIBC(wctomb HAVE_WCTOMB) ++#CHECK_FUNCTION_EXISTS_GLIBC(wcrtomb HAVE_WCRTOMB) ++set(HAVE_WCRTOMB 1) ++#CHECK_FUNCTION_EXISTS_GLIBC(wcscmp HAVE_WCSCMP) ++set(HAVE_WCSCMP 1) ++#CHECK_FUNCTION_EXISTS_GLIBC(wcscpy HAVE_WCSCPY) ++set(HAVE_WCSCPY 1) ++#CHECK_FUNCTION_EXISTS_GLIBC(wcslen HAVE_WCSLEN) ++set(HAVE_WCSLEN 1) ++#CHECK_FUNCTION_EXISTS_GLIBC(wctomb HAVE_WCTOMB) ++set(HAVE_WCTOMB 1) + CHECK_FUNCTION_EXISTS_GLIBC(_ctime64_s HAVE__CTIME64_S) + CHECK_FUNCTION_EXISTS_GLIBC(_fseeki64 HAVE__FSEEKI64) + CHECK_FUNCTION_EXISTS_GLIBC(_get_timezone HAVE__GET_TIMEZONE) +@@ -1273,10 +1279,14 @@ CHECK_FUNCTION_EXISTS(cygwin_conv_path HAVE_CYGWIN_CONV_PATH) + CHECK_FUNCTION_EXISTS(fseeko HAVE_FSEEKO) + CHECK_FUNCTION_EXISTS(strerror_r HAVE_STRERROR_R) + CHECK_FUNCTION_EXISTS(strftime HAVE_STRFTIME) +-CHECK_FUNCTION_EXISTS(vprintf HAVE_VPRINTF) +-CHECK_FUNCTION_EXISTS(wmemcmp HAVE_WMEMCMP) +-CHECK_FUNCTION_EXISTS(wmemcpy HAVE_WMEMCPY) +-CHECK_FUNCTION_EXISTS(wmemmove HAVE_WMEMMOVE) ++#CHECK_FUNCTION_EXISTS(vprintf HAVE_VPRINTF) ++set(HAVE_VPRINTF 1) ++#CHECK_FUNCTION_EXISTS(wmemcmp HAVE_WMEMCMP) ++set(HAVE_WMEMCMP 1) ++#CHECK_FUNCTION_EXISTS(wmemcpy HAVE_WMEMCPY) ++set(HAVE_WMEMCPY 1) ++#CHECK_FUNCTION_EXISTS(wmemmove HAVE_WMEMMOVE) ++set(HAVE_WMEMMOVE 1) + + CMAKE_POP_CHECK_STATE() # Restore the state of the variables + -- cgit v1.2.3 From 05b82a96aedede08c3a4c5ef9525de944788d9e9 Mon Sep 17 00:00:00 2001 From: codicodi Date: Tue, 24 Jan 2017 21:59:05 +0100 Subject: [libarchive] apply patch --- ports/libarchive/portfile.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ports/libarchive/portfile.cmake b/ports/libarchive/portfile.cmake index 26d175516..731174790 100644 --- a/ports/libarchive/portfile.cmake +++ b/ports/libarchive/portfile.cmake @@ -16,7 +16,8 @@ vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES ${CMAKE_CURRENT_LIST_DIR}/fix-buildsystem.patch - ${CMAKE_CURRENT_LIST_DIR}/use-memset-not-bzero.patch) + ${CMAKE_CURRENT_LIST_DIR}/use-memset-not-bzero.patch + ${CMAKE_CURRENT_LIST_DIR}/override-broken-feature-checks.patch) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} -- cgit v1.2.3 From cf5770d2641bb56830f0ef27ee604313b20b9cb1 Mon Sep 17 00:00:00 2001 From: codicodi Date: Tue, 24 Jan 2017 21:59:24 +0100 Subject: [libarchive] bump version --- ports/libarchive/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/libarchive/CONTROL b/ports/libarchive/CONTROL index c035a891e..43979243c 100644 --- a/ports/libarchive/CONTROL +++ b/ports/libarchive/CONTROL @@ -1,4 +1,4 @@ Source: libarchive -Version: 3.2.2 +Version: 3.2.2-1 Description: Library for reading and writing streaming archives Build-Depends: zlib, bzip2, libxml2, libiconv, lz4, liblzma, openssl -- cgit v1.2.3 From e3c3497dbc03607492f38e54122106bc8f00ca20 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 24 Jan 2017 14:12:27 -0800 Subject: Suppress VS2017's vcvarsall.bat output --- toolsrc/src/commands_build.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index d9d5d2107..e7e005100 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -31,7 +31,7 @@ namespace vcpkg::Commands::Build const fs::path ports_cmake_script_path = paths.ports_cmake; const Environment::vcvarsall_and_platform_toolset vcvarsall_bat = Environment::get_vcvarsall_bat(paths); - const std::wstring command = Strings::wformat(LR"("%s" %s && cmake -DCMD=BUILD -DPORT=%s -DTARGET_TRIPLET=%s -DVCPKG_PLATFORM_TOOLSET=%s "-DCURRENT_PORT_DIR=%s/." -P "%s")", + const std::wstring command = Strings::wformat(LR"("%s" %s >nul 2>&1 && cmake -DCMD=BUILD -DPORT=%s -DTARGET_TRIPLET=%s -DVCPKG_PLATFORM_TOOLSET=%s "-DCURRENT_PORT_DIR=%s/." -P "%s")", vcvarsall_bat.path.native(), Strings::utf8_to_utf16(target_triplet.architecture()), Strings::utf8_to_utf16(source_paragraph.name), -- cgit v1.2.3 From c09e6ff69ac353cee7538d073e9c35dfef392836 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 24 Jan 2017 14:55:07 -0800 Subject: [wt] Suppress reliance on boost autolinking Fixes #558 --- ports/wt/CONTROL | 2 +- ports/wt/add-disable-boost-autolink-option.patch | 26 ++++++++++++++++++++++++ ports/wt/portfile.cmake | 10 +++++++-- 3 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 ports/wt/add-disable-boost-autolink-option.patch diff --git a/ports/wt/CONTROL b/ports/wt/CONTROL index fc71d9aaf..1a89dd378 100644 --- a/ports/wt/CONTROL +++ b/ports/wt/CONTROL @@ -1,4 +1,4 @@ Source: wt -Version: 3.3.6 +Version: 3.3.6-2 Description: Wt is a C++ library for developing web applications Build-Depends: boost, openssl diff --git a/ports/wt/add-disable-boost-autolink-option.patch b/ports/wt/add-disable-boost-autolink-option.patch new file mode 100644 index 000000000..57cb3ed99 --- /dev/null +++ b/ports/wt/add-disable-boost-autolink-option.patch @@ -0,0 +1,26 @@ +diff --git a/cmake/WtFindBoost-cmake.txt b/cmake/WtFindBoost-cmake.txt +index b66741f..377cede 100644 +--- a/cmake/WtFindBoost-cmake.txt ++++ b/cmake/WtFindBoost-cmake.txt +@@ -99,7 +99,7 @@ IF (Boost_FOUND) + SET(BOOST_WTHTTP_MT_FOUND TRUE) + SET(BOOST_WTHTTP_FOUND TRUE) + +- IF(MSVC) ++ IF(MSVC AND NOT DISABLE_BOOST_AUTOLINK) + # use autolink + SET(BOOST_WT_LIBRARIES "") + SET(BOOST_WTHTTP_LIBRARIES "") +diff --git a/src/wt/Dbo/CMakeLists.txt b/src/wt/Dbo/CMakeLists.txt +index 64d3af2..f9c31e0 100644 +--- a/src/wt/Dbo/CMakeLists.txt ++++ b/src/wt/Dbo/CMakeLists.txt +@@ -31,7 +31,7 @@ IF(ENABLE_LIBWTDBO) + StringStream.C + ) + +- IF(MSVC) ++ IF(MSVC AND NOT DISABLE_BOOST_AUTOLINK) + #win32 links automatically against boost libs; specifying too much causes + #trouble + IF(MULTI_THREADED_BUILD) diff --git a/ports/wt/portfile.cmake b/ports/wt/portfile.cmake index 66b1d5a33..f762eface 100644 --- a/ports/wt/portfile.cmake +++ b/ports/wt/portfile.cmake @@ -8,9 +8,13 @@ vcpkg_download_distfile(ARCHIVE_FILE ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) -file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}) +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES ${CMAKE_CURRENT_LIST_DIR}/add-disable-boost-autolink-option.patch +) + vcpkg_configure_cmake( -SOURCE_PATH ${SOURCE_PATH} + SOURCE_PATH ${SOURCE_PATH} OPTIONS -DSHARED_LIBS=ON -DENABLE_SSL=ON @@ -20,6 +24,8 @@ SOURCE_PATH ${SOURCE_PATH} -DENABLE_MYSQL=OFF -DENABLE_QT4=OFF -DBOOST_DYNAMIC=ON + -DDISABLE_BOOST_AUTOLINK=ON + -DENABLE_LIBWTTEST=OFF ) vcpkg_install_cmake() -- cgit v1.2.3 From 33ce94a4565ce68cd02cacda221fccbd756d3949 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 24 Jan 2017 15:17:45 -0800 Subject: [vcpkg integrate] Exit silently if target cannot be found. --- scripts/buildsystems/msbuild/applocal.ps1 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/buildsystems/msbuild/applocal.ps1 b/scripts/buildsystems/msbuild/applocal.ps1 index 46981fad5..55680c1f6 100644 --- a/scripts/buildsystems/msbuild/applocal.ps1 +++ b/scripts/buildsystems/msbuild/applocal.ps1 @@ -2,7 +2,14 @@ param([string]$targetBinary, [string]$installedDir, [string]$tlogFile) function resolve($targetBinary) { - $targetBinaryPath = Resolve-Path $targetBinary + try + { + $targetBinaryPath = Resolve-Path $targetBinary -erroraction stop + } + catch [System.Management.Automation.ItemNotFoundException] + { + return + } $targetBinaryDir = Split-Path $targetBinaryPath -parent $a = $(dumpbin /DEPENDENTS $targetBinary | ? { $_ -match "^ [^ ].*\.dll" } | % { $_ -replace "^ ","" }) -- cgit v1.2.3 From af0727cbc000ff2b9d3d7489c417d69170fc3a5f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 24 Jan 2017 17:51:45 -0800 Subject: Improve detection of VS installation instances --- scripts/findVisualStudioInstallationInstances.ps1 | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index d5faa57d3..a2ce66522 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -32,9 +32,12 @@ if (!(Test-Path $SetupConsoleExe)) throw $nugetOutput } -$consoleOutput = & $SetupConsoleExe 2>&1 +$instances = & $SetupConsoleExe -nologo -value InstallationPath 2>&1 +$instanceCount = $instances.Length +# The last item can be empty +if ($instances[$entryCount - 1] -eq "") +{ + $instances = $instances[0..($instanceCount - 2)] +} -$key = "InstallationPath = " -$paths = $consoleOutput | Select-String -SimpleMatch $key -$paths = $paths -replace $key, "" -return $paths \ No newline at end of file +return $instances -- cgit v1.2.3 From 7fe735c02e37057596396d42b17caef3169415b0 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 24 Jan 2017 18:00:43 -0800 Subject: Add error message when CONTROL file cannot be opened --- toolsrc/src/Paragraphs.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/toolsrc/src/Paragraphs.cpp b/toolsrc/src/Paragraphs.cpp index d99ad45cf..f4592afed 100644 --- a/toolsrc/src/Paragraphs.cpp +++ b/toolsrc/src/Paragraphs.cpp @@ -41,8 +41,8 @@ namespace vcpkg::Paragraphs static bool is_alphanum(char ch) { return (ch >= 'A' && ch <= 'Z') - || (ch >= 'a' && ch <= 'z') - || (ch >= '0' && ch <= '9'); + || (ch >= 'a' && ch <= 'z') + || (ch >= '0' && ch <= '9'); } static bool is_lineend(char ch) @@ -153,7 +153,13 @@ namespace vcpkg::Paragraphs std::vector> get_paragraphs(const fs::path& control_path) { - return parse_paragraphs(Files::read_contents(control_path).get_or_throw()); + const expected contents = Files::read_contents(control_path); + if (auto spgh = contents.get()) + { + return parse_paragraphs(*spgh); + } + + Checks::exit_with_message("Error while reading %s: %s", control_path.generic_string(), contents.error_code().message()); } std::vector> parse_paragraphs(const std::string& str) -- cgit v1.2.3 From 8fd59c59bcabde5ec79e2fba6ba84a0e96bee462 Mon Sep 17 00:00:00 2001 From: flysha Date: Wed, 25 Jan 2017 10:25:38 +0800 Subject: [libmariadb] rollback conflict with libmysql --- ports/libmariadb/portfile.cmake | 8 ++++++++ ports/libmysql/portfile.cmake | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/ports/libmariadb/portfile.cmake b/ports/libmariadb/portfile.cmake index ebca3d7f3..3dba9c7d1 100644 --- a/ports/libmariadb/portfile.cmake +++ b/ports/libmariadb/portfile.cmake @@ -1,3 +1,8 @@ + +if (EXISTS "${CURRENT_INSTALLED_DIR}/include/mysql/mysql.h") + message(FATAL_ERROR "FATAL ERROR: libmysql and libmariadb are incompatible.") +endif() + include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mariadb-connector-c-2.3.2) @@ -57,6 +62,9 @@ file(REMOVE ${CURRENT_PACKAGES_DIR}/include/mariadb/mysql_version.h.in ${CURRENT_PACKAGES_DIR}/include/mariadb/CMakeLists.txt ${CURRENT_PACKAGES_DIR}/include/mariadb/Makefile.am) +file(RENAME + ${CURRENT_PACKAGES_DIR}/include/mariadb + ${CURRENT_PACKAGES_DIR}/include/mysql) # copy license file file(COPY ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/libmariadb) diff --git a/ports/libmysql/portfile.cmake b/ports/libmysql/portfile.cmake index 592482544..4d711fef5 100644 --- a/ports/libmysql/portfile.cmake +++ b/ports/libmysql/portfile.cmake @@ -1,3 +1,7 @@ +if (EXISTS "${CURRENT_INSTALLED_DIR}/include/mysql/mysql.h") + message(FATAL_ERROR "FATAL ERROR: libmysql and libmariadb are incompatible.") +endif() + include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mysql-server-mysql-5.7.17) -- cgit v1.2.3 From 318d32e870f8ee25bdf71c8012115ebb9bc38361 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 24 Jan 2017 18:55:41 -0800 Subject: [vcpkg] Add user-facing notification to prompt rebuilding vcpkg.exe in face of cmake changes. --- scripts/cmake/vcpkg_configure_cmake.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 128782075..5db9b5d05 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -2,6 +2,10 @@ find_program(vcpkg_configure_cmake_NINJA ninja) function(vcpkg_configure_cmake) cmake_parse_arguments(_csc "" "SOURCE_PATH;GENERATOR" "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE" ${ARGN}) + if(NOT VCPKG_PLATFORM_TOOLSET) + message(FATAL_ERROR "Vcpkg has been updated with VS2017 support, however you need to rebuild vcpkg.exe by re-running bootstrap.ps1\n powershell -exec bypass scripts\\bootstrap.ps1\n") + endif() + if(_csc_GENERATOR) set(GENERATOR ${_csc_GENERATOR}) elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") -- cgit v1.2.3 From 9b8afccc9db0959cb3a47d77fd0255096011e245 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 24 Jan 2017 19:08:51 -0800 Subject: Properly convert wchar to char before printing --- toolsrc/src/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/toolsrc/src/main.cpp b/toolsrc/src/main.cpp index 08e65391f..b78319167 100644 --- a/toolsrc/src/main.cpp +++ b/toolsrc/src/main.cpp @@ -13,6 +13,7 @@ #include "vcpkg_Input.h" #include "Paragraphs.h" #include "vcpkg_info.h" +#include "vcpkg_Strings.h" using namespace vcpkg; @@ -242,7 +243,7 @@ int wmain(const int argc, const wchar_t* const* const argv) << "EXCEPTION='" << exc_msg << "'\n" << "CMD=\n"; for (int x = 0; x < argc; ++x) - std::cerr << argv[x] << "|\n"; + std::cerr << Strings::utf16_to_utf8(argv[x]) << "|\n"; std::cerr << "\n"; } -- cgit v1.2.3 From a3aeb99092e8dabe1e3bed020be23d60df1787cf Mon Sep 17 00:00:00 2001 From: Manuel Massing Date: Mon, 9 Jan 2017 11:03:56 +0100 Subject: [boost] Fix zlib detection in debug build --- ports/boost/portfile.cmake | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake index 0e25f34bc..5c272e9cc 100644 --- a/ports/boost/portfile.cmake +++ b/ports/boost/portfile.cmake @@ -31,9 +31,7 @@ endif() message(STATUS "Bootstrapping done") set(B2_OPTIONS - -sZLIB_BINARY=zlib -sZLIB_INCLUDE="${CURRENT_INSTALLED_DIR}\\include" - -sZLIB_LIBPATH="${CURRENT_INSTALLED_DIR}\\lib" -sNO_BZIP2=1 -j$ENV{NUMBER_OF_PROCESSORS} --debug-configuration @@ -65,12 +63,15 @@ if(VCPKG_CMAKE_SYSTEM_NAME MATCHES "WindowsStore") endif() # Add build type specific options -set(B2_OPTIONS_DBG - ${B2_OPTIONS} +set(B2_OPTIONS_DBG + ${B2_OPTIONS} + -sZLIB_BINARY=zlibd -sZLIB_LIBPATH="${CURRENT_INSTALLED_DIR}\\debug\\lib" ) -set(B2_OPTIONS_REL - ${B2_OPTIONS} + +set(B2_OPTIONS_REL + ${B2_OPTIONS} + -sZLIB_BINARY=zlib -sZLIB_LIBPATH="${CURRENT_INSTALLED_DIR}\\lib" ) -- cgit v1.2.3 From 23ac6d0c190df12998f466ddf015ca4bc5dfd847 Mon Sep 17 00:00:00 2001 From: Manuel Massing Date: Mon, 9 Jan 2017 11:04:18 +0100 Subject: [gdal] Link against external libpng --- ports/gdal/CONTROL | 2 +- ports/gdal/portfile.cmake | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ports/gdal/CONTROL b/ports/gdal/CONTROL index 38eccc46d..e22e97ba8 100644 --- a/ports/gdal/CONTROL +++ b/ports/gdal/CONTROL @@ -1,4 +1,4 @@ Source: gdal Version: 1.11.3 Description: The Geographic Data Abstraction Library for reading and writing geospatial raster and vector data. -Build-Depends: proj +Build-Depends: proj, libpng diff --git a/ports/gdal/portfile.cmake b/ports/gdal/portfile.cmake index f198f4f0c..9bf301664 100644 --- a/ports/gdal/portfile.cmake +++ b/ports/gdal/portfile.cmake @@ -32,15 +32,23 @@ file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}" NATIVE_PACKAGES_DIR) file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}/share/gdal" NATIVE_DATA_DIR) file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}/share/gdal/html" NATIVE_HTML_DIR) +# Setup proj4 libraries + include path file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/include" PROJ_INCLUDE_DIR) file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/proj.lib" PROJ_LIBRARY_REL) file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/projd.lib" PROJ_LIBRARY_DBG) +# Setup libpng libraries + include path +file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/include" PNG_INCLUDE_DIR) +file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/libpng16.lib" PNG_LIBRARY_REL) +file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/libpng16d.lib" PNG_LIBRARY_DBG) + set(NMAKE_OPTIONS GDAL_HOME=${NATIVE_PACKAGES_DIR} DATADIR=${NATIVE_DATA_DIR} HTMLDIR=${NATIVE_HTML_DIR} PROJ_INCLUDE=-I${PROJ_INCLUDE_DIR} + PNG_EXTERNAL_LIB=1 + PNGDIR=${PNG_INCLUDE_DIR} MSVC_VER=1900 ) @@ -65,12 +73,14 @@ set(NMAKE_OPTIONS_REL "${NMAKE_OPTIONS}" CXX_CRT_FLAGS=${LINKAGE_FLAGS} PROJ_LIBRARY=${PROJ_LIBRARY_REL} + PNG_LIB=${PNG_LIBRARY_REL} ) set(NMAKE_OPTIONS_DBG "${NMAKE_OPTIONS}" CXX_CRT_FLAGS="${LINKAGE_FLAGS}d" PROJ_LIBRARY=${PROJ_LIBRARY_DBG} + PNG_LIB=${PNG_LIBRARY_DBG} DEBUG=1 ) ################ -- cgit v1.2.3 From 44590c5c1e934fe260618ee1add2cfc63440202d Mon Sep 17 00:00:00 2001 From: Manuel Massing Date: Mon, 9 Jan 2017 11:04:18 +0100 Subject: [boost] Add bzip2 support --- ports/boost/CONTROL | 2 +- ports/boost/portfile.cmake | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ports/boost/CONTROL b/ports/boost/CONTROL index 0abbac659..f5676974a 100644 --- a/ports/boost/CONTROL +++ b/ports/boost/CONTROL @@ -1,4 +1,4 @@ Source: boost Version: 1.62-11 Description: Peer-reviewed portable C++ source libraries -Build-Depends: zlib +Build-Depends: zlib, bzip2 diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake index 5c272e9cc..f9c0a0a34 100644 --- a/ports/boost/portfile.cmake +++ b/ports/boost/portfile.cmake @@ -32,7 +32,7 @@ message(STATUS "Bootstrapping done") set(B2_OPTIONS -sZLIB_INCLUDE="${CURRENT_INSTALLED_DIR}\\include" - -sNO_BZIP2=1 + -sBZIP2_INCLUDE="${CURRENT_INSTALLED_DIR}\\include" -j$ENV{NUMBER_OF_PROCESSORS} --debug-configuration --hash @@ -67,12 +67,16 @@ set(B2_OPTIONS_DBG ${B2_OPTIONS} -sZLIB_BINARY=zlibd -sZLIB_LIBPATH="${CURRENT_INSTALLED_DIR}\\debug\\lib" + -sBZIP2_BINARY=bz2 + -sBZIP2_LIBPATH="${CURRENT_INSTALLED_DIR}\\debug\\lib" ) set(B2_OPTIONS_REL ${B2_OPTIONS} -sZLIB_BINARY=zlib -sZLIB_LIBPATH="${CURRENT_INSTALLED_DIR}\\lib" + -sBZIP2_BINARY=bz2 + -sBZIP2_LIBPATH="${CURRENT_INSTALLED_DIR}\\lib" ) file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) -- cgit v1.2.3 From 2d4fb63bf8f91b021ac2be00a0f966a78bb71f73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E6=9D=B0?= Date: Wed, 25 Jan 2017 22:33:21 +0800 Subject: [directxtk] do not use win10 sdk (can now built without win10 sdk installed) --- ports/directxtk/CONTROL | 2 +- ports/directxtk/portfile.cmake | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/directxtk/CONTROL b/ports/directxtk/CONTROL index 8a3da81a6..97f97ecd9 100644 --- a/ports/directxtk/CONTROL +++ b/ports/directxtk/CONTROL @@ -1,3 +1,3 @@ Source: directxtk -Version: dec2016 +Version: dec2016-1 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 08f8a4537..ebecf5004 100644 --- a/ports/directxtk/portfile.cmake +++ b/ports/directxtk/portfile.cmake @@ -19,19 +19,19 @@ ELSE() ENDIF() vcpkg_build_msbuild( - PROJECT_PATH ${SOURCE_PATH}/DirectXTK_Desktop_2015_Win10.sln + PROJECT_PATH ${SOURCE_PATH}/DirectXTK_Desktop_2015.sln PLATFORM ${BUILD_ARCH} ) file(INSTALL - ${SOURCE_PATH}/Bin/Desktop_2015_Win10/${BUILD_ARCH}/Release/DirectXTK.lib + ${SOURCE_PATH}/Bin/Desktop_2015/${BUILD_ARCH}/Release/DirectXTK.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) file(INSTALL - ${SOURCE_PATH}/Bin/Desktop_2015_Win10/${BUILD_ARCH}/Debug/DirectXTK.lib + ${SOURCE_PATH}/Bin/Desktop_2015/${BUILD_ARCH}/Debug/DirectXTK.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) -set(DXTK_TOOL_PATH ${CURRENT_PACKAGES_DIR}/tools/directxtk) +set(DXTK_TOOL_PATH ${CURRENT_PACKAGES_DIR}/tools) file(MAKE_DIRECTORY ${DXTK_TOOL_PATH}) file(INSTALL -- cgit v1.2.3 From db9ea49377ef1e393d7c8e8ac64b4cfc42bbe99c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E6=9D=B0?= Date: Wed, 25 Jan 2017 22:37:18 +0800 Subject: [directxtk] rollback toolpath --- ports/directxtk/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/directxtk/portfile.cmake b/ports/directxtk/portfile.cmake index ebecf5004..fc4418d75 100644 --- a/ports/directxtk/portfile.cmake +++ b/ports/directxtk/portfile.cmake @@ -31,7 +31,7 @@ file(INSTALL ${SOURCE_PATH}/Bin/Desktop_2015/${BUILD_ARCH}/Debug/DirectXTK.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) -set(DXTK_TOOL_PATH ${CURRENT_PACKAGES_DIR}/tools) +set(DXTK_TOOL_PATH ${CURRENT_PACKAGES_DIR}/tools/directxtk) file(MAKE_DIRECTORY ${DXTK_TOOL_PATH}) file(INSTALL -- cgit v1.2.3 From c42d3b3677d84eaa1e2b9325e1fbf95b2f52fc3c Mon Sep 17 00:00:00 2001 From: Olaf van der Spek Date: Wed, 25 Jan 2017 16:55:36 +0100 Subject: Update CONTROL --- ports/libmariadb/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/libmariadb/CONTROL b/ports/libmariadb/CONTROL index a42f79ee5..26e23810a 100644 --- a/ports/libmariadb/CONTROL +++ b/ports/libmariadb/CONTROL @@ -1,3 +1,3 @@ Source: libmariadb Version: 2.3.2 -Description: The MariaDB Connector/C is used to connect applications developed in C/C++ to MariaDB and MySQL databases. \ No newline at end of file +Description: MariaDB Connector/C is used to connect C/C++ applications to MariaDB and MySQL databases -- cgit v1.2.3 From 73f4c47d761e51cdc0682df88dead76b407f1058 Mon Sep 17 00:00:00 2001 From: Olaf van der Spek Date: Wed, 25 Jan 2017 19:09:01 +0100 Subject: Update commands_update.cpp --- toolsrc/src/commands_update.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/commands_update.cpp b/toolsrc/src/commands_update.cpp index 12b4dad50..021bfe705 100644 --- a/toolsrc/src/commands_update.cpp +++ b/toolsrc/src/commands_update.cpp @@ -84,7 +84,7 @@ namespace vcpkg::Commands::Update { if (maj1 != maj2 || min1 != min2 || rev1 != rev2) { - System::println("Different source is available for vcpkg (%d.%d.%d -> %d.%d.%d). Use scripts\\bootstrap.ps1 to update.", + System::println("Different source is available for vcpkg (%d.%d.%d -> %d.%d.%d). Use powershell -exec bypass scripts/bootstrap.ps1 to update.", maj2, min2, rev2, maj1, min1, rev1); } -- cgit v1.2.3 From 8ea9781f4f1600996d6b339ea77836b8bf298c5f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 25 Jan 2017 12:47:19 -0800 Subject: [boost] Bump version --- ports/boost/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/boost/CONTROL b/ports/boost/CONTROL index 0abbac659..76d19763c 100644 --- a/ports/boost/CONTROL +++ b/ports/boost/CONTROL @@ -1,4 +1,4 @@ Source: boost -Version: 1.62-11 +Version: 1.62-12 Description: Peer-reviewed portable C++ source libraries Build-Depends: zlib -- cgit v1.2.3 From 3d1b72ea05bd4065a3cc5eb57cac1d9277451d0f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 25 Jan 2017 14:20:17 -0800 Subject: Move MachineType.cpp to src\ --- toolsrc/MachineType.cpp | 41 ------------------------------------- toolsrc/src/MachineType.cpp | 41 +++++++++++++++++++++++++++++++++++++ toolsrc/vcpkg/vcpkg.vcxproj | 2 +- toolsrc/vcpkg/vcpkg.vcxproj.filters | 6 +++--- 4 files changed, 45 insertions(+), 45 deletions(-) delete mode 100644 toolsrc/MachineType.cpp create mode 100644 toolsrc/src/MachineType.cpp diff --git a/toolsrc/MachineType.cpp b/toolsrc/MachineType.cpp deleted file mode 100644 index 0115f3e5e..000000000 --- a/toolsrc/MachineType.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include "MachineType.h" -#include "vcpkg_Checks.h" - -namespace vcpkg -{ - MachineType getMachineType(const uint16_t value) - { - MachineType t = static_cast(value); - switch (t) - { - case MachineType::UNKNOWN: - case MachineType::AM33: - case MachineType::AMD64: - case MachineType::ARM: - case MachineType::ARM64: - case MachineType::ARMNT: - case MachineType::EBC: - case MachineType::I386: - case MachineType::IA64: - case MachineType::M32R: - case MachineType::MIPS16: - case MachineType::MIPSFPU: - case MachineType::MIPSFPU16: - case MachineType::POWERPC: - case MachineType::POWERPCFP: - case MachineType::R4000: - case MachineType::RISCV32: - case MachineType::RISCV64: - case MachineType::RISCV128: - case MachineType::SH3: - case MachineType::SH3DSP: - case MachineType::SH4: - case MachineType::SH5: - case MachineType::THUMB: - case MachineType::WCEMIPSV2: - return t; - default: - Checks::exit_with_message("Unknown machine type code 0x%x", value); - } - } -} diff --git a/toolsrc/src/MachineType.cpp b/toolsrc/src/MachineType.cpp new file mode 100644 index 000000000..0115f3e5e --- /dev/null +++ b/toolsrc/src/MachineType.cpp @@ -0,0 +1,41 @@ +#include "MachineType.h" +#include "vcpkg_Checks.h" + +namespace vcpkg +{ + MachineType getMachineType(const uint16_t value) + { + MachineType t = static_cast(value); + switch (t) + { + case MachineType::UNKNOWN: + case MachineType::AM33: + case MachineType::AMD64: + case MachineType::ARM: + case MachineType::ARM64: + case MachineType::ARMNT: + case MachineType::EBC: + case MachineType::I386: + case MachineType::IA64: + case MachineType::M32R: + case MachineType::MIPS16: + case MachineType::MIPSFPU: + case MachineType::MIPSFPU16: + case MachineType::POWERPC: + case MachineType::POWERPCFP: + case MachineType::R4000: + case MachineType::RISCV32: + case MachineType::RISCV64: + case MachineType::RISCV128: + case MachineType::SH3: + case MachineType::SH3DSP: + case MachineType::SH4: + case MachineType::SH5: + case MachineType::THUMB: + case MachineType::WCEMIPSV2: + return t; + default: + Checks::exit_with_message("Unknown machine type code 0x%x", value); + } + } +} diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/vcpkg/vcpkg.vcxproj index 15673e048..8bf3854a1 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj +++ b/toolsrc/vcpkg/vcpkg.vcxproj @@ -125,7 +125,6 @@ - @@ -143,6 +142,7 @@ + diff --git a/toolsrc/vcpkg/vcpkg.vcxproj.filters b/toolsrc/vcpkg/vcpkg.vcxproj.filters index 1f43777b8..7e7ec6912 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj.filters +++ b/toolsrc/vcpkg/vcpkg.vcxproj.filters @@ -66,9 +66,6 @@ Source Files - - Source Files - Source Files @@ -96,6 +93,9 @@ Source Files + + Source Files + -- cgit v1.2.3 From d04e78815a82b52af8b36d14fd68703936199ce3 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 25 Jan 2017 15:05:30 -0800 Subject: [vcpkg] Do not build tests when running scripts\bootstrap.ps1. --- scripts/bootstrap.ps1 | 2 +- toolsrc/dirs.proj | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 toolsrc/dirs.proj diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index a37ed99aa..98ccb40ad 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -26,7 +26,7 @@ try{ $msbuildExeWithPlatformToolset = & $scriptsDir\findAnyMSBuildWithCppPlatformToolset.ps1 $msbuildExe = $msbuildExeWithPlatformToolset[0] $platformToolset = $msbuildExeWithPlatformToolset[1] - & $msbuildExe "/p:VCPKG_VERSION=-$gitHash" "/p:DISABLE_METRICS=$disableMetrics" /p:Configuration=Release /p:Platform=x86 /p:PlatformToolset=$platformToolset /m + & $msbuildExe "/p:VCPKG_VERSION=-$gitHash" "/p:DISABLE_METRICS=$disableMetrics" /p:Configuration=Release /p:Platform=x86 /p:PlatformToolset=$platformToolset /m dirs.proj Write-Verbose("Placing vcpkg.exe in the correct location") diff --git a/toolsrc/dirs.proj b/toolsrc/dirs.proj new file mode 100644 index 000000000..06bfd6b5d --- /dev/null +++ b/toolsrc/dirs.proj @@ -0,0 +1,22 @@ + + + $(MSBuildThisFileDirectory) + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3 From 25872147c1016fea74aac5627880fb7d40c0c1f7 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 25 Jan 2017 16:44:56 -0800 Subject: Add quotes are port name in error message --- toolsrc/src/commands_edit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/commands_edit.cpp b/toolsrc/src/commands_edit.cpp index 3297b5295..cb457a9e2 100644 --- a/toolsrc/src/commands_edit.cpp +++ b/toolsrc/src/commands_edit.cpp @@ -11,7 +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); + Checks::check_exit(fs::is_directory(portpath), R"(Could not find port named "%s")", port_name); // Find editor std::wstring env_EDITOR = System::wdupenv_str(L"EDITOR"); -- cgit v1.2.3 From fe96dcab61c3acdabf446463bf1f538d3148863a Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 25 Jan 2017 17:25:56 -0800 Subject: [gdal] Bump version to correspond with adding external libpng dependency. --- ports/gdal/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/gdal/CONTROL b/ports/gdal/CONTROL index e22e97ba8..16b1caa7e 100644 --- a/ports/gdal/CONTROL +++ b/ports/gdal/CONTROL @@ -1,4 +1,4 @@ Source: gdal -Version: 1.11.3 +Version: 1.11.3-1 Description: The Geographic Data Abstraction Library for reading and writing geospatial raster and vector data. Build-Depends: proj, libpng -- cgit v1.2.3 From 7bd267bc13906bdb7f89cee4e71a53822c473fef Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 25 Jan 2017 17:27:53 -0800 Subject: [boost] Bump version to correspond with added bzip2 dependency. --- ports/boost/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/boost/CONTROL b/ports/boost/CONTROL index f5676974a..039cef721 100644 --- a/ports/boost/CONTROL +++ b/ports/boost/CONTROL @@ -1,4 +1,4 @@ Source: boost -Version: 1.62-11 +Version: 1.62-12 Description: Peer-reviewed portable C++ source libraries Build-Depends: zlib, bzip2 -- cgit v1.2.3 From 8b602f97c83613862837d842263a17850828e953 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 25 Jan 2017 18:32:24 -0800 Subject: [vcpkg_copy_pdbs] Force output to be in en-us. Resolves #587 --- scripts/cmake/vcpkg_copy_pdbs.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/cmake/vcpkg_copy_pdbs.cmake b/scripts/cmake/vcpkg_copy_pdbs.cmake index 10cd1b2d3..61ad97728 100644 --- a/scripts/cmake/vcpkg_copy_pdbs.cmake +++ b/scripts/cmake/vcpkg_copy_pdbs.cmake @@ -13,6 +13,9 @@ function(vcpkg_copy_pdbs) set(DLLS_WITHOUT_MATCHING_PDBS) + set(PREVIOUS_VSLANG $ENV{VSLANG}) + set(ENV{VSLANG} 1033) + foreach(DLL ${DLLS}) execute_process(COMMAND dumpbin /PDBPATH ${DLL} COMMAND findstr PDB @@ -31,6 +34,8 @@ function(vcpkg_copy_pdbs) endif() endforeach() + set(ENV{VSLANG} ${PREVIOUS_VSLANG}) + list(LENGTH DLLS_WITHOUT_MATCHING_PDBS UNMATCHED_DLLS_LENGTH) if(UNMATCHED_DLLS_LENGTH GREATER 0) merge_filelist(MSG DLLS_WITHOUT_MATCHING_PDBS) -- cgit v1.2.3 From a026f0d10c86352a97c4db2f66a0ba5627b2fe17 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 25 Jan 2017 19:07:18 -0800 Subject: Remove vcpkgmetrics.vcxproj. Merge it into vcpkglib.vcxproj --- toolsrc/dirs.proj | 1 - toolsrc/vcpkg.sln | 10 -- toolsrc/vcpkg/vcpkg.vcxproj | 3 - toolsrc/vcpkglib/vcpkglib.vcxproj | 13 +- toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 6 + toolsrc/vcpkgmetrics/vcpkgmetrics.vcxproj | 137 --------------------- toolsrc/vcpkgmetrics/vcpkgmetrics.vcxproj.filters | 27 ---- .../vcpkgmetricsuploader.vcxproj | 4 +- toolsrc/vcpkgtest/vcpkgtest.vcxproj | 3 - 9 files changed, 17 insertions(+), 187 deletions(-) delete mode 100644 toolsrc/vcpkgmetrics/vcpkgmetrics.vcxproj delete mode 100644 toolsrc/vcpkgmetrics/vcpkgmetrics.vcxproj.filters diff --git a/toolsrc/dirs.proj b/toolsrc/dirs.proj index 06bfd6b5d..55de4fcd4 100644 --- a/toolsrc/dirs.proj +++ b/toolsrc/dirs.proj @@ -6,7 +6,6 @@ - diff --git a/toolsrc/vcpkg.sln b/toolsrc/vcpkg.sln index 83051670a..ded66d86e 100644 --- a/toolsrc/vcpkg.sln +++ b/toolsrc/vcpkg.sln @@ -9,8 +9,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcpkgcommon", "vcpkgcommon\ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcpkglib", "vcpkglib\vcpkglib.vcxproj", "{B98C92B7-2874-4537-9D46-D14E5C237F04}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcpkgmetrics", "vcpkgmetrics\vcpkgmetrics.vcxproj", "{7226078C-1D2A-4123-9EF1-8DF2B722B8F1}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcpkgmetricsuploader", "vcpkgmetricsuploader\vcpkgmetricsuploader.vcxproj", "{7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcpkgtest", "vcpkgtest\vcpkgtest.vcxproj", "{F27B8DB0-1279-4AF8-A2E3-1D49C4F0220D}" @@ -47,14 +45,6 @@ Global {B98C92B7-2874-4537-9D46-D14E5C237F04}.Release|x64.Build.0 = Release|x64 {B98C92B7-2874-4537-9D46-D14E5C237F04}.Release|x86.ActiveCfg = Release|Win32 {B98C92B7-2874-4537-9D46-D14E5C237F04}.Release|x86.Build.0 = Release|Win32 - {7226078C-1D2A-4123-9EF1-8DF2B722B8F1}.Debug|x64.ActiveCfg = Debug|x64 - {7226078C-1D2A-4123-9EF1-8DF2B722B8F1}.Debug|x64.Build.0 = Debug|x64 - {7226078C-1D2A-4123-9EF1-8DF2B722B8F1}.Debug|x86.ActiveCfg = Debug|Win32 - {7226078C-1D2A-4123-9EF1-8DF2B722B8F1}.Debug|x86.Build.0 = Debug|Win32 - {7226078C-1D2A-4123-9EF1-8DF2B722B8F1}.Release|x64.ActiveCfg = Release|x64 - {7226078C-1D2A-4123-9EF1-8DF2B722B8F1}.Release|x64.Build.0 = Release|x64 - {7226078C-1D2A-4123-9EF1-8DF2B722B8F1}.Release|x86.ActiveCfg = Release|Win32 - {7226078C-1D2A-4123-9EF1-8DF2B722B8F1}.Release|x86.Build.0 = Release|Win32 {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Debug|x64.ActiveCfg = Debug|x64 {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Debug|x64.Build.0 = Debug|x64 {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Debug|x86.ActiveCfg = Debug|Win32 diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/vcpkg/vcpkg.vcxproj index 8bf3854a1..cf5b56cec 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj +++ b/toolsrc/vcpkg/vcpkg.vcxproj @@ -171,9 +171,6 @@ {b98c92b7-2874-4537-9d46-d14e5c237f04} - - {7226078c-1d2a-4123-9ef1-8df2b722b8f1} - diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index 561b22477..eefc43c26 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -47,6 +47,9 @@ true MultiByte + + 0 + @@ -72,7 +75,7 @@ Disabled true ..\include - VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;%(PreprocessorDefinitions) + DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) @@ -82,7 +85,7 @@ Disabled true ..\include - VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;%(PreprocessorDefinitions) + DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) @@ -94,7 +97,7 @@ true true ..\include - VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;NDEBUG;%(PreprocessorDefinitions) + DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;NDEBUG;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) @@ -110,7 +113,7 @@ true true ..\include - VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;NDEBUG;%(PreprocessorDefinitions) + DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;NDEBUG;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) @@ -121,6 +124,7 @@ + @@ -136,6 +140,7 @@ + diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index e8856235c..9b7a3779f 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -54,6 +54,9 @@ Source Files + + Source Files + @@ -95,5 +98,8 @@ Header Files + + Header Files + \ No newline at end of file diff --git a/toolsrc/vcpkgmetrics/vcpkgmetrics.vcxproj b/toolsrc/vcpkgmetrics/vcpkgmetrics.vcxproj deleted file mode 100644 index 66cf52232..000000000 --- a/toolsrc/vcpkgmetrics/vcpkgmetrics.vcxproj +++ /dev/null @@ -1,137 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {7226078C-1D2A-4123-9EF1-8DF2B722B8F1} - vcpkgmetrics - 8.1 - v140 - - - - StaticLibrary - true - MultiByte - - - StaticLibrary - false - true - MultiByte - - - StaticLibrary - true - MultiByte - - - StaticLibrary - false - true - MultiByte - - - 0 - - - - - - - - - - - - - - - - - - - - - - - Level3 - Disabled - true - ..\include - - - - - Level3 - Disabled - true - ..\include - - - - - Level3 - MaxSpeed - true - true - true - ..\include - DISABLE_METRICS=$(DISABLE_METRICS);_MBCS;NDEBUG;%(PreprocessorDefinitions) - /std:c++latest %(AdditionalOptions) - - - true - true - - - - - Level3 - MaxSpeed - true - true - true - ..\include - DISABLE_METRICS=$(DISABLE_METRICS);_MBCS;NDEBUG;%(PreprocessorDefinitions) - /std:c++latest %(AdditionalOptions) - - - true - true - - - - - DISABLE_METRICS=$(DISABLE_METRICS);_MBCS;%(PreprocessorDefinitions) - DISABLE_METRICS=$(DISABLE_METRICS);_MBCS;%(PreprocessorDefinitions) - /std:c++latest %(AdditionalOptions) - /std:c++latest %(AdditionalOptions) - - - - - - - - - - - - \ No newline at end of file diff --git a/toolsrc/vcpkgmetrics/vcpkgmetrics.vcxproj.filters b/toolsrc/vcpkgmetrics/vcpkgmetrics.vcxproj.filters deleted file mode 100644 index 7116a4247..000000000 --- a/toolsrc/vcpkgmetrics/vcpkgmetrics.vcxproj.filters +++ /dev/null @@ -1,27 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Header Files - - - - - Source Files - - - \ No newline at end of file diff --git a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj index dc666c19e..9160da1e1 100644 --- a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj +++ b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj @@ -131,8 +131,8 @@ {7129f242-f20c-43e7-bbec-4e15b71890b2} - - {7226078c-1d2a-4123-9ef1-8df2b722b8f1} + + {b98c92b7-2874-4537-9d46-d14e5c237f04} diff --git a/toolsrc/vcpkgtest/vcpkgtest.vcxproj b/toolsrc/vcpkgtest/vcpkgtest.vcxproj index a68d77b46..dab95b9aa 100644 --- a/toolsrc/vcpkgtest/vcpkgtest.vcxproj +++ b/toolsrc/vcpkgtest/vcpkgtest.vcxproj @@ -29,9 +29,6 @@ {b98c92b7-2874-4537-9d46-d14e5c237f04} - - {7226078c-1d2a-4123-9ef1-8df2b722b8f1} - {F27B8DB0-1279-4AF8-A2E3-1D49C4F0220D} -- cgit v1.2.3 From b8253457092e4b1eb274fa75da891b9a20305816 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 25 Jan 2017 19:14:53 -0800 Subject: Move all sources (except main.cpp) from vcpkg.vcxproj to vcpkglib.vcxproj --- toolsrc/vcpkg/vcpkg.vcxproj | 43 +----------- toolsrc/vcpkg/vcpkg.vcxproj.filters | 107 ------------------------------ toolsrc/vcpkglib/vcpkglib.vcxproj | 37 ++++++++++- toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 105 +++++++++++++++++++++++++++++ 4 files changed, 144 insertions(+), 148 deletions(-) diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/vcpkg/vcpkg.vcxproj index cf5b56cec..476b1fabc 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj +++ b/toolsrc/vcpkg/vcpkg.vcxproj @@ -124,46 +124,6 @@ winhttp.lib;version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {7129f242-f20c-43e7-bbec-4e15b71890b2} @@ -172,6 +132,9 @@ {b98c92b7-2874-4537-9d46-d14e5c237f04} + + + diff --git a/toolsrc/vcpkg/vcpkg.vcxproj.filters b/toolsrc/vcpkg/vcpkg.vcxproj.filters index 7e7ec6912..04e008bd8 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj.filters +++ b/toolsrc/vcpkg/vcpkg.vcxproj.filters @@ -18,112 +18,5 @@ Source Files - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - \ No newline at end of file diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index eefc43c26..10f1bdcda 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -47,7 +47,7 @@ true MultiByte - + 0 @@ -124,23 +124,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -150,6 +181,10 @@ + + + + diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index 9b7a3779f..41ee0a4bd 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -57,6 +57,84 @@ Source Files + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + @@ -101,5 +179,32 @@ Header Files + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + \ No newline at end of file -- cgit v1.2.3 From 59be40a100910d1f833cd54762e624b7123965ed Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 25 Jan 2017 19:32:50 -0800 Subject: Rename vcpkg.h/cpp to vcpkglib.h/cpp --- toolsrc/include/vcpkg.h | 31 ---- toolsrc/include/vcpkglib.h | 31 ++++ toolsrc/src/commands_build.cpp | 2 +- toolsrc/src/commands_build_external.cpp | 2 +- toolsrc/src/commands_install.cpp | 2 +- toolsrc/src/commands_list.cpp | 2 +- toolsrc/src/commands_owns.cpp | 2 +- toolsrc/src/commands_remove.cpp | 2 +- toolsrc/src/commands_update.cpp | 2 +- toolsrc/src/vcpkg.cpp | 248 ------------------------------ toolsrc/src/vcpkg_Dependencies.cpp | 2 +- toolsrc/src/vcpkglib.cpp | 248 ++++++++++++++++++++++++++++++ toolsrc/vcpkglib/vcpkglib.vcxproj | 4 +- toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 12 +- 14 files changed, 295 insertions(+), 295 deletions(-) delete mode 100644 toolsrc/include/vcpkg.h create mode 100644 toolsrc/include/vcpkglib.h delete mode 100644 toolsrc/src/vcpkg.cpp create mode 100644 toolsrc/src/vcpkglib.cpp diff --git a/toolsrc/include/vcpkg.h b/toolsrc/include/vcpkg.h deleted file mode 100644 index b1653d197..000000000 --- a/toolsrc/include/vcpkg.h +++ /dev/null @@ -1,31 +0,0 @@ -#pragma once - -#include "package_spec.h" -#include "BinaryParagraph.h" -#include "StatusParagraphs.h" -#include "vcpkg_paths.h" -#include "ImmutableSortedVector.h" - -namespace vcpkg -{ - StatusParagraphs database_load_check(const vcpkg_paths& paths); - - void write_update(const vcpkg_paths& paths, const StatusParagraph& p); - - struct StatusParagraph_and_associated_files - { - StatusParagraph pgh; - ImmutableSortedVector files; - }; - - std::vector get_installed_files(const vcpkg_paths& paths, const StatusParagraphs& status_db); - - expected try_load_port(const fs::path& control_path); - - inline expected try_load_port(const vcpkg_paths& paths, const std::string& name) - { - return try_load_port(paths.ports / name); - } - - expected try_load_cached_package(const vcpkg_paths& paths, const package_spec& spec); -} // namespace vcpkg diff --git a/toolsrc/include/vcpkglib.h b/toolsrc/include/vcpkglib.h new file mode 100644 index 000000000..b1653d197 --- /dev/null +++ b/toolsrc/include/vcpkglib.h @@ -0,0 +1,31 @@ +#pragma once + +#include "package_spec.h" +#include "BinaryParagraph.h" +#include "StatusParagraphs.h" +#include "vcpkg_paths.h" +#include "ImmutableSortedVector.h" + +namespace vcpkg +{ + StatusParagraphs database_load_check(const vcpkg_paths& paths); + + void write_update(const vcpkg_paths& paths, const StatusParagraph& p); + + struct StatusParagraph_and_associated_files + { + StatusParagraph pgh; + ImmutableSortedVector files; + }; + + std::vector get_installed_files(const vcpkg_paths& paths, const StatusParagraphs& status_db); + + expected try_load_port(const fs::path& control_path); + + inline expected try_load_port(const vcpkg_paths& paths, const std::string& name) + { + return try_load_port(paths.ports / name); + } + + expected try_load_cached_package(const vcpkg_paths& paths, const package_spec& spec); +} // namespace vcpkg diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index e7e005100..629cbbb5f 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -1,6 +1,6 @@ #include "vcpkg_Commands.h" #include "StatusParagraphs.h" -#include "vcpkg.h" +#include "vcpkglib.h" #include "vcpkg_Input.h" #include "post_build_lint.h" #include "vcpkg_Dependencies.h" diff --git a/toolsrc/src/commands_build_external.cpp b/toolsrc/src/commands_build_external.cpp index 09a9256d7..51dc29e86 100644 --- a/toolsrc/src/commands_build_external.cpp +++ b/toolsrc/src/commands_build_external.cpp @@ -2,7 +2,7 @@ #include "vcpkg_System.h" #include "vcpkg_Environment.h" #include "vcpkg_Input.h" -#include "vcpkg.h" +#include "vcpkglib.h" namespace vcpkg::Commands::BuildExternal { diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index ff517d9b1..6fc0e32f0 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -1,5 +1,5 @@ #include "vcpkg_Commands.h" -#include "vcpkg.h" +#include "vcpkglib.h" #include "vcpkg_Environment.h" #include "metrics.h" #include "vcpkg_Files.h" diff --git a/toolsrc/src/commands_list.cpp b/toolsrc/src/commands_list.cpp index d9c4a52f2..18e95d405 100644 --- a/toolsrc/src/commands_list.cpp +++ b/toolsrc/src/commands_list.cpp @@ -1,5 +1,5 @@ #include "vcpkg_Commands.h" -#include "vcpkg.h" +#include "vcpkglib.h" #include "vcpkg_System.h" #include "vcpkglib_helpers.h" diff --git a/toolsrc/src/commands_owns.cpp b/toolsrc/src/commands_owns.cpp index bb1a7eb9f..fe02b6224 100644 --- a/toolsrc/src/commands_owns.cpp +++ b/toolsrc/src/commands_owns.cpp @@ -1,6 +1,6 @@ #include "vcpkg_Commands.h" #include "vcpkg_System.h" -#include "vcpkg.h" +#include "vcpkglib.h" namespace vcpkg::Commands::Owns { diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index 23d981fc1..4b53f4778 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -1,5 +1,5 @@ #include "vcpkg_Commands.h" -#include "vcpkg.h" +#include "vcpkglib.h" #include "vcpkg_System.h" #include "vcpkg_Input.h" #include diff --git a/toolsrc/src/commands_update.cpp b/toolsrc/src/commands_update.cpp index 021bfe705..d7a554303 100644 --- a/toolsrc/src/commands_update.cpp +++ b/toolsrc/src/commands_update.cpp @@ -1,5 +1,5 @@ #include "vcpkg_Commands.h" -#include "vcpkg.h" +#include "vcpkglib.h" #include "vcpkg_System.h" #include "vcpkg_Files.h" #include "Paragraphs.h" diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp deleted file mode 100644 index eb2184ccb..000000000 --- a/toolsrc/src/vcpkg.cpp +++ /dev/null @@ -1,248 +0,0 @@ -#include "vcpkg.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include "vcpkg_Files.h" -#include "Paragraphs.h" -#include -#include "metrics.h" - -using namespace vcpkg; - -static StatusParagraphs load_current_database(const fs::path& vcpkg_dir_status_file, const fs::path& vcpkg_dir_status_file_old) -{ - if (!fs::exists(vcpkg_dir_status_file)) - { - if (!fs::exists(vcpkg_dir_status_file_old)) - { - // no status file, use empty db - return StatusParagraphs(); - } - - fs::rename(vcpkg_dir_status_file_old, vcpkg_dir_status_file); - } - - auto text = Files::read_contents(vcpkg_dir_status_file).get_or_throw(); - auto pghs = Paragraphs::parse_paragraphs(text); - - std::vector> status_pghs; - for (auto&& p : pghs) - { - status_pghs.push_back(std::make_unique(p)); - } - - return StatusParagraphs(std::move(status_pghs)); -} - -StatusParagraphs vcpkg::database_load_check(const vcpkg_paths& paths) -{ - auto updates_dir = paths.vcpkg_dir_updates; - - std::error_code ec; - fs::create_directory(paths.installed, ec); - fs::create_directory(paths.vcpkg_dir, ec); - fs::create_directory(paths.vcpkg_dir_info, ec); - fs::create_directory(updates_dir, ec); - - const fs::path& status_file = paths.vcpkg_dir_status_file; - const fs::path status_file_old = status_file.parent_path() / "status-old"; - const fs::path status_file_new = status_file.parent_path() / "status-new"; - - StatusParagraphs current_status_db = load_current_database(status_file, status_file_old); - - auto b = fs::directory_iterator(updates_dir); - auto e = fs::directory_iterator(); - if (b == e) - { - // updates directory is empty, control file is up-to-date. - return current_status_db; - } - - for (; b != e; ++b) - { - if (!fs::is_regular_file(b->status())) - continue; - if (b->path().filename() == "incomplete") - continue; - - auto text = Files::read_contents(b->path()).get_or_throw(); - auto pghs = Paragraphs::parse_paragraphs(text); - for (auto&& p : pghs) - { - current_status_db.insert(std::make_unique(p)); - } - } - - std::fstream(status_file_new, std::ios_base::out | std::ios_base::binary | std::ios_base::trunc) << current_status_db; - - if (fs::exists(status_file_old)) - fs::remove(status_file_old); - if (fs::exists(status_file)) - fs::rename(status_file, status_file_old); - fs::rename(status_file_new, status_file); - fs::remove(status_file_old); - - b = fs::directory_iterator(updates_dir); - for (; b != e; ++b) - { - if (!fs::is_regular_file(b->status())) - continue; - fs::remove(b->path()); - } - - return current_status_db; -} - -void vcpkg::write_update(const vcpkg_paths& paths, const StatusParagraph& p) -{ - static int update_id = 0; - auto my_update_id = update_id++; - auto tmp_update_filename = paths.vcpkg_dir_updates / "incomplete"; - auto update_filename = paths.vcpkg_dir_updates / std::to_string(my_update_id); - std::fstream fs(tmp_update_filename, std::ios_base::out | std::ios_base::binary | std::ios_base::trunc); - fs << p; - fs.close(); - fs::rename(tmp_update_filename, update_filename); -} - -static void upgrade_to_slash_terminated_sorted_format(std::vector* lines, const fs::path& listfile_path) -{ - static bool was_tracked = false; - - if (lines->empty()) - { - return; - } - - if (lines->at(0).back() == '/') - { - return; // File already in the new format - } - - if (!was_tracked) - { - was_tracked = true; - TrackProperty("listfile", "update to new format"); - } - - // The files are sorted such that directories are placed just before the files they contain - // (They are not necessarily sorted alphabetically, e.g. libflac) - // Therefore we can detect the entries that represent directories by comparing every element with the next one - // and checking if the next has a slash immediately after the current one's length - for (size_t i = 0; i < lines->size() - 1; i++) - { - std::string& current_string = lines->at(i); - const std::string& next_string = lines->at(i + 1); - - const size_t potential_slash_char_index = current_string.length(); - // Make sure the index exists first - if (next_string.size() > potential_slash_char_index && next_string.at(potential_slash_char_index) == '/') - { - current_string += '/'; // Mark as a directory - } - } - - // After suffixing the directories with a slash, we can now sort. - // We cannot sort before adding the suffixes because the following (actual example): - /* - x86-windows/include/FLAC <<<<<< This would be separated from its group due to sorting - x86-windows/include/FLAC/all.h - x86-windows/include/FLAC/assert.h - x86-windows/include/FLAC/callback.h - x86-windows/include/FLAC++ - x86-windows/include/FLAC++/all.h - x86-windows/include/FLAC++/decoder.h - x86-windows/include/FLAC++/encoder.h - * - x86-windows/include/FLAC/ <<<<<< This will now be kept with its group when sorting - x86-windows/include/FLAC/all.h - x86-windows/include/FLAC/assert.h - x86-windows/include/FLAC/callback.h - x86-windows/include/FLAC++/ - x86-windows/include/FLAC++/all.h - x86-windows/include/FLAC++/decoder.h - x86-windows/include/FLAC++/encoder.h - */ - // Note that after sorting, the FLAC++/ group will be placed before the FLAC/ group - // The new format is lexicographically sorted - std::sort(lines->begin(), lines->end()); - -#if 0 - // Replace the listfile on disk - const fs::path updated_listfile_path = listfile_path.generic_string() + "_updated"; - Files::write_all_lines(updated_listfile_path, *lines); - fs::rename(updated_listfile_path, listfile_path); -#endif -} - -std::vector vcpkg::get_installed_files(const vcpkg_paths& paths, const StatusParagraphs& status_db) -{ - std::vector installed_files; - - for (const std::unique_ptr& pgh : status_db) - { - if (pgh->state != install_state_t::installed) - { - continue; - } - - const fs::path listfile_path = paths.listfile_path(pgh->package); - std::vector installed_files_of_current_pgh = Files::read_all_lines(listfile_path).get_or_throw(); - Strings::trim_all_and_remove_whitespace_strings(&installed_files_of_current_pgh); - upgrade_to_slash_terminated_sorted_format(&installed_files_of_current_pgh, listfile_path); - - // Remove the directories - installed_files_of_current_pgh.erase( - std::remove_if(installed_files_of_current_pgh.begin(), installed_files_of_current_pgh.end(), [](const std::string& file) -> bool - { - return file.back() == '/'; - } - ), installed_files_of_current_pgh.end()); - - StatusParagraph_and_associated_files pgh_and_files = {*pgh, ImmutableSortedVector::create(std::move(installed_files_of_current_pgh))}; - installed_files.push_back(std::move(pgh_and_files)); - } - - return installed_files; -} - -expected vcpkg::try_load_port(const fs::path& path) -{ - try - { - auto pghs = Paragraphs::get_paragraphs(path / "CONTROL"); - Checks::check_exit(pghs.size() == 1, "Invalid control file at %s\\CONTROL", path.string()); - return SourceParagraph(pghs[0]); - } - catch (std::runtime_error const&) - { - } - - return std::errc::no_such_file_or_directory; -} - -expected vcpkg::try_load_cached_package(const vcpkg_paths& paths, const package_spec& spec) -{ - const fs::path path = paths.package_dir(spec) / "CONTROL"; - - auto control_contents_maybe = Files::read_contents(path); - if (auto control_contents = control_contents_maybe.get()) - { - std::vector> pghs; - try - { - pghs = Paragraphs::parse_paragraphs(*control_contents); - } - catch (std::runtime_error) - { - } - Checks::check_exit(pghs.size() == 1, "Invalid control file at %s", path.string()); - return BinaryParagraph(pghs[0]); - } - return control_contents_maybe.error_code(); -} diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp index f1464a605..1daa6de02 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg_Dependencies.cpp @@ -7,7 +7,7 @@ #include #include "vcpkg_Maps.h" #include "vcpkg_Files.h" -#include "vcpkg.h" +#include "vcpkglib.h" namespace vcpkg::Dependencies { diff --git a/toolsrc/src/vcpkglib.cpp b/toolsrc/src/vcpkglib.cpp new file mode 100644 index 000000000..5cea0c585 --- /dev/null +++ b/toolsrc/src/vcpkglib.cpp @@ -0,0 +1,248 @@ +#include "vcpkglib.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include "vcpkg_Files.h" +#include "Paragraphs.h" +#include +#include "metrics.h" + +using namespace vcpkg; + +static StatusParagraphs load_current_database(const fs::path& vcpkg_dir_status_file, const fs::path& vcpkg_dir_status_file_old) +{ + if (!fs::exists(vcpkg_dir_status_file)) + { + if (!fs::exists(vcpkg_dir_status_file_old)) + { + // no status file, use empty db + return StatusParagraphs(); + } + + fs::rename(vcpkg_dir_status_file_old, vcpkg_dir_status_file); + } + + auto text = Files::read_contents(vcpkg_dir_status_file).get_or_throw(); + auto pghs = Paragraphs::parse_paragraphs(text); + + std::vector> status_pghs; + for (auto&& p : pghs) + { + status_pghs.push_back(std::make_unique(p)); + } + + return StatusParagraphs(std::move(status_pghs)); +} + +StatusParagraphs vcpkg::database_load_check(const vcpkg_paths& paths) +{ + auto updates_dir = paths.vcpkg_dir_updates; + + std::error_code ec; + fs::create_directory(paths.installed, ec); + fs::create_directory(paths.vcpkg_dir, ec); + fs::create_directory(paths.vcpkg_dir_info, ec); + fs::create_directory(updates_dir, ec); + + const fs::path& status_file = paths.vcpkg_dir_status_file; + const fs::path status_file_old = status_file.parent_path() / "status-old"; + const fs::path status_file_new = status_file.parent_path() / "status-new"; + + StatusParagraphs current_status_db = load_current_database(status_file, status_file_old); + + auto b = fs::directory_iterator(updates_dir); + auto e = fs::directory_iterator(); + if (b == e) + { + // updates directory is empty, control file is up-to-date. + return current_status_db; + } + + for (; b != e; ++b) + { + if (!fs::is_regular_file(b->status())) + continue; + if (b->path().filename() == "incomplete") + continue; + + auto text = Files::read_contents(b->path()).get_or_throw(); + auto pghs = Paragraphs::parse_paragraphs(text); + for (auto&& p : pghs) + { + current_status_db.insert(std::make_unique(p)); + } + } + + std::fstream(status_file_new, std::ios_base::out | std::ios_base::binary | std::ios_base::trunc) << current_status_db; + + if (fs::exists(status_file_old)) + fs::remove(status_file_old); + if (fs::exists(status_file)) + fs::rename(status_file, status_file_old); + fs::rename(status_file_new, status_file); + fs::remove(status_file_old); + + b = fs::directory_iterator(updates_dir); + for (; b != e; ++b) + { + if (!fs::is_regular_file(b->status())) + continue; + fs::remove(b->path()); + } + + return current_status_db; +} + +void vcpkg::write_update(const vcpkg_paths& paths, const StatusParagraph& p) +{ + static int update_id = 0; + auto my_update_id = update_id++; + auto tmp_update_filename = paths.vcpkg_dir_updates / "incomplete"; + auto update_filename = paths.vcpkg_dir_updates / std::to_string(my_update_id); + std::fstream fs(tmp_update_filename, std::ios_base::out | std::ios_base::binary | std::ios_base::trunc); + fs << p; + fs.close(); + fs::rename(tmp_update_filename, update_filename); +} + +static void upgrade_to_slash_terminated_sorted_format(std::vector* lines, const fs::path& listfile_path) +{ + static bool was_tracked = false; + + if (lines->empty()) + { + return; + } + + if (lines->at(0).back() == '/') + { + return; // File already in the new format + } + + if (!was_tracked) + { + was_tracked = true; + TrackProperty("listfile", "update to new format"); + } + + // The files are sorted such that directories are placed just before the files they contain + // (They are not necessarily sorted alphabetically, e.g. libflac) + // Therefore we can detect the entries that represent directories by comparing every element with the next one + // and checking if the next has a slash immediately after the current one's length + for (size_t i = 0; i < lines->size() - 1; i++) + { + std::string& current_string = lines->at(i); + const std::string& next_string = lines->at(i + 1); + + const size_t potential_slash_char_index = current_string.length(); + // Make sure the index exists first + if (next_string.size() > potential_slash_char_index && next_string.at(potential_slash_char_index) == '/') + { + current_string += '/'; // Mark as a directory + } + } + + // After suffixing the directories with a slash, we can now sort. + // We cannot sort before adding the suffixes because the following (actual example): + /* + x86-windows/include/FLAC <<<<<< This would be separated from its group due to sorting + x86-windows/include/FLAC/all.h + x86-windows/include/FLAC/assert.h + x86-windows/include/FLAC/callback.h + x86-windows/include/FLAC++ + x86-windows/include/FLAC++/all.h + x86-windows/include/FLAC++/decoder.h + x86-windows/include/FLAC++/encoder.h + * + x86-windows/include/FLAC/ <<<<<< This will now be kept with its group when sorting + x86-windows/include/FLAC/all.h + x86-windows/include/FLAC/assert.h + x86-windows/include/FLAC/callback.h + x86-windows/include/FLAC++/ + x86-windows/include/FLAC++/all.h + x86-windows/include/FLAC++/decoder.h + x86-windows/include/FLAC++/encoder.h + */ + // Note that after sorting, the FLAC++/ group will be placed before the FLAC/ group + // The new format is lexicographically sorted + std::sort(lines->begin(), lines->end()); + +#if 0 + // Replace the listfile on disk + const fs::path updated_listfile_path = listfile_path.generic_string() + "_updated"; + Files::write_all_lines(updated_listfile_path, *lines); + fs::rename(updated_listfile_path, listfile_path); +#endif +} + +std::vector vcpkg::get_installed_files(const vcpkg_paths& paths, const StatusParagraphs& status_db) +{ + std::vector installed_files; + + for (const std::unique_ptr& pgh : status_db) + { + if (pgh->state != install_state_t::installed) + { + continue; + } + + const fs::path listfile_path = paths.listfile_path(pgh->package); + std::vector installed_files_of_current_pgh = Files::read_all_lines(listfile_path).get_or_throw(); + Strings::trim_all_and_remove_whitespace_strings(&installed_files_of_current_pgh); + upgrade_to_slash_terminated_sorted_format(&installed_files_of_current_pgh, listfile_path); + + // Remove the directories + installed_files_of_current_pgh.erase( + std::remove_if(installed_files_of_current_pgh.begin(), installed_files_of_current_pgh.end(), [](const std::string& file) -> bool + { + return file.back() == '/'; + } + ), installed_files_of_current_pgh.end()); + + StatusParagraph_and_associated_files pgh_and_files = {*pgh, ImmutableSortedVector::create(std::move(installed_files_of_current_pgh))}; + installed_files.push_back(std::move(pgh_and_files)); + } + + return installed_files; +} + +expected vcpkg::try_load_port(const fs::path& path) +{ + try + { + auto pghs = Paragraphs::get_paragraphs(path / "CONTROL"); + Checks::check_exit(pghs.size() == 1, "Invalid control file at %s\\CONTROL", path.string()); + return SourceParagraph(pghs[0]); + } + catch (std::runtime_error const&) + { + } + + return std::errc::no_such_file_or_directory; +} + +expected vcpkg::try_load_cached_package(const vcpkg_paths& paths, const package_spec& spec) +{ + const fs::path path = paths.package_dir(spec) / "CONTROL"; + + auto control_contents_maybe = Files::read_contents(path); + if (auto control_contents = control_contents_maybe.get()) + { + std::vector> pghs; + try + { + pghs = Paragraphs::parse_paragraphs(*control_contents); + } + catch (std::runtime_error) + { + } + Checks::check_exit(pghs.size() == 1, "Invalid control file at %s", path.string()); + return BinaryParagraph(pghs[0]); + } + return control_contents_maybe.error_code(); +} diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index 10f1bdcda..0247e8cc3 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -136,7 +136,7 @@ - + @@ -172,7 +172,7 @@ - + diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index 41ee0a4bd..41fce6541 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -45,9 +45,6 @@ Source Files - - Source Files - Source Files @@ -135,11 +132,11 @@ Source Files + + Source Files + - - Header Files - Header Files @@ -206,5 +203,8 @@ Header Files + + Header Files + \ No newline at end of file -- cgit v1.2.3 From 31ddf1a80393d825925cf45b4573710423d14233 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 25 Jan 2017 19:34:25 -0800 Subject: Rename main.cpp to vcpkg.cpp --- toolsrc/src/main.cpp | 249 ------------------------------------ toolsrc/src/vcpkg.cpp | 249 ++++++++++++++++++++++++++++++++++++ toolsrc/vcpkg/vcpkg.vcxproj.filters | 2 +- 3 files changed, 250 insertions(+), 250 deletions(-) delete mode 100644 toolsrc/src/main.cpp create mode 100644 toolsrc/src/vcpkg.cpp diff --git a/toolsrc/src/main.cpp b/toolsrc/src/main.cpp deleted file mode 100644 index b78319167..000000000 --- a/toolsrc/src/main.cpp +++ /dev/null @@ -1,249 +0,0 @@ -#define WIN32_LEAN_AND_MEAN -#include - -#include -#include -#include -#include -#include "vcpkg_Commands.h" -#include "metrics.h" -#include -#include "vcpkg_Files.h" -#include "vcpkg_System.h" -#include "vcpkg_Input.h" -#include "Paragraphs.h" -#include "vcpkg_info.h" -#include "vcpkg_Strings.h" - -using namespace vcpkg; - -bool g_debugging = false; - -void invalid_command(const std::string& cmd) -{ - System::println(System::color::error, "invalid command: %s", cmd); - Commands::Help::print_usage(); - exit(EXIT_FAILURE); -} - -static void inner(const vcpkg_cmd_arguments& args) -{ - TrackProperty("command", args.command); - if (args.command.empty()) - { - Commands::Help::print_usage(); - exit(EXIT_FAILURE); - } - - if (auto command_function = Commands::find(args.command, Commands::get_available_commands_type_c())) - { - return command_function(args); - } - - fs::path vcpkg_root_dir; - if (args.vcpkg_root_dir != nullptr) - { - vcpkg_root_dir = fs::absolute(Strings::utf8_to_utf16(*args.vcpkg_root_dir)); - } - else - { - auto vcpkg_root_dir_env = System::wdupenv_str(L"VCPKG_ROOT"); - - if (!vcpkg_root_dir_env.empty()) - { - vcpkg_root_dir = fs::absolute(vcpkg_root_dir_env); - } - else - { - vcpkg_root_dir = Files::find_file_recursively_up(fs::absolute(System::get_exe_path_of_current_process()), ".vcpkg-root"); - } - } - - Checks::check_exit(!vcpkg_root_dir.empty(), "Error: Could not detect vcpkg-root."); - - const expected expected_paths = vcpkg_paths::create(vcpkg_root_dir); - Checks::check_exit(!expected_paths.error_code(), "Error: Invalid vcpkg root directory %s: %s", vcpkg_root_dir.string(), expected_paths.error_code().message()); - const vcpkg_paths paths = expected_paths.get_or_throw(); - int exit_code = _wchdir(paths.root.c_str()); - Checks::check_exit(exit_code == 0, "Changing the working dir failed"); - - if (auto command_function = Commands::find(args.command, Commands::get_available_commands_type_b())) - { - return command_function(args, paths); - } - - triplet default_target_triplet; - if (args.target_triplet != nullptr) - { - default_target_triplet = triplet::from_canonical_name(*args.target_triplet); - } - else - { - const auto vcpkg_default_triplet_env = System::wdupenv_str(L"VCPKG_DEFAULT_TRIPLET"); - if (!vcpkg_default_triplet_env.empty()) - { - default_target_triplet = triplet::from_canonical_name(Strings::utf16_to_utf8(vcpkg_default_triplet_env)); - } - else - { - default_target_triplet = triplet::X86_WINDOWS; - } - } - - Input::check_triplet(default_target_triplet, paths); - - if (auto command_function = Commands::find(args.command, Commands::get_available_commands_type_a())) - { - return command_function(args, paths, default_target_triplet); - } - - return invalid_command(args.command); -} - -static void loadConfig() -{ - fs::path localappdata; - { - // Config path in AppDataLocal - wchar_t* localappdatapath = nullptr; - if (S_OK != SHGetKnownFolderPath(FOLDERID_LocalAppData, 0, nullptr, &localappdatapath)) - __fastfail(1); - localappdata = localappdatapath; - CoTaskMemFree(localappdatapath); - } - - try - { - std::string config_contents = Files::read_contents(localappdata / "vcpkg" / "config").get_or_throw(); - - std::unordered_map keys; - auto pghs = Paragraphs::parse_paragraphs(config_contents); - if (pghs.size() > 0) - keys = pghs[0]; - - for (size_t x = 1; x < pghs.size(); ++x) - { - for (auto&& p : pghs[x]) - keys.insert(p); - } - - auto user_id = keys["User-Id"]; - auto user_time = keys["User-Since"]; - Checks::check_throw(!user_id.empty() && !user_time.empty(), ""); // Use as goto to the catch statement - - SetUserInformation(user_id, user_time); - return; - } - catch (...) - { - } - - // config file not found, could not be read, or invalid - std::string user_id, user_time; - InitUserInformation(user_id, user_time); - SetUserInformation(user_id, user_time); - try - { - std::error_code ec; - fs::create_directory(localappdata / "vcpkg", ec); - std::ofstream(localappdata / "vcpkg" / "config", std::ios_base::out | std::ios_base::trunc) - << "User-Id: " << user_id << "\n" - << "User-Since: " << user_time << "\n"; - } - catch (...) - { - } -} - -static System::Stopwatch2 g_timer; - -static std::string trim_path_from_command_line(const std::string& full_command_line) -{ - Checks::check_exit(full_command_line.size() > 0, "Internal failure - cannot have empty command line"); - - if (full_command_line[0] == '"') - { - auto it = std::find(full_command_line.cbegin() + 1, full_command_line.cend(), '"'); - if (it != full_command_line.cend()) // Skip over the quote - ++it; - while (it != full_command_line.cend() && *it == ' ') // Skip over a space - ++it; - return std::string(it, full_command_line.cend()); - } - - auto it = std::find(full_command_line.cbegin(), full_command_line.cend(), ' '); - while (it != full_command_line.cend() && *it == ' ') - ++it; - return std::string(it, full_command_line.cend()); -} - -int wmain(const int argc, const wchar_t* const* const argv) -{ - if (argc == 0) - std::abort(); - - std::cout.sync_with_stdio(false); - std::cout.imbue(std::locale::classic()); - - g_timer.start(); - atexit([]() - { - g_timer.stop(); - TrackMetric("elapsed_us", g_timer.microseconds()); - Flush(); - }); - - TrackProperty("version", Info::version()); - - const std::string trimmed_command_line = trim_path_from_command_line(Strings::utf16_to_utf8(GetCommandLineW())); - TrackProperty("cmdline", trimmed_command_line); - loadConfig(); - TrackProperty("sqmuser", GetSQMUser()); - - const vcpkg_cmd_arguments args = vcpkg_cmd_arguments::create_from_command_line(argc, argv); - - if (args.printmetrics != opt_bool::unspecified) - SetPrintMetrics(args.printmetrics == opt_bool::enabled); - if (args.sendmetrics != opt_bool::unspecified) - SetSendMetrics(args.sendmetrics == opt_bool::enabled); - - if (args.debug != opt_bool::unspecified) - { - g_debugging = (args.debug == opt_bool::enabled); - } - - if (g_debugging) - { - inner(args); - exit(EXIT_FAILURE); - } - - std::string exc_msg; - try - { - inner(args); - exit(EXIT_FAILURE); - } - catch (std::exception& e) - { - exc_msg = e.what(); - } - catch (...) - { - exc_msg = "unknown error(...)"; - } - TrackProperty("error", exc_msg); - std::cerr - << "vcpkg.exe has crashed.\n" - << "Please send an email to:\n" - << " " << Info::email() << "\n" - << "containing a brief summary of what you were trying to do and the following data blob:\n" - << "\n" - << "Version=" << Info::version() << "\n" - << "EXCEPTION='" << exc_msg << "'\n" - << "CMD=\n"; - for (int x = 0; x < argc; ++x) - std::cerr << Strings::utf16_to_utf8(argv[x]) << "|\n"; - std::cerr - << "\n"; -} diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp new file mode 100644 index 000000000..b78319167 --- /dev/null +++ b/toolsrc/src/vcpkg.cpp @@ -0,0 +1,249 @@ +#define WIN32_LEAN_AND_MEAN +#include + +#include +#include +#include +#include +#include "vcpkg_Commands.h" +#include "metrics.h" +#include +#include "vcpkg_Files.h" +#include "vcpkg_System.h" +#include "vcpkg_Input.h" +#include "Paragraphs.h" +#include "vcpkg_info.h" +#include "vcpkg_Strings.h" + +using namespace vcpkg; + +bool g_debugging = false; + +void invalid_command(const std::string& cmd) +{ + System::println(System::color::error, "invalid command: %s", cmd); + Commands::Help::print_usage(); + exit(EXIT_FAILURE); +} + +static void inner(const vcpkg_cmd_arguments& args) +{ + TrackProperty("command", args.command); + if (args.command.empty()) + { + Commands::Help::print_usage(); + exit(EXIT_FAILURE); + } + + if (auto command_function = Commands::find(args.command, Commands::get_available_commands_type_c())) + { + return command_function(args); + } + + fs::path vcpkg_root_dir; + if (args.vcpkg_root_dir != nullptr) + { + vcpkg_root_dir = fs::absolute(Strings::utf8_to_utf16(*args.vcpkg_root_dir)); + } + else + { + auto vcpkg_root_dir_env = System::wdupenv_str(L"VCPKG_ROOT"); + + if (!vcpkg_root_dir_env.empty()) + { + vcpkg_root_dir = fs::absolute(vcpkg_root_dir_env); + } + else + { + vcpkg_root_dir = Files::find_file_recursively_up(fs::absolute(System::get_exe_path_of_current_process()), ".vcpkg-root"); + } + } + + Checks::check_exit(!vcpkg_root_dir.empty(), "Error: Could not detect vcpkg-root."); + + const expected expected_paths = vcpkg_paths::create(vcpkg_root_dir); + Checks::check_exit(!expected_paths.error_code(), "Error: Invalid vcpkg root directory %s: %s", vcpkg_root_dir.string(), expected_paths.error_code().message()); + const vcpkg_paths paths = expected_paths.get_or_throw(); + int exit_code = _wchdir(paths.root.c_str()); + Checks::check_exit(exit_code == 0, "Changing the working dir failed"); + + if (auto command_function = Commands::find(args.command, Commands::get_available_commands_type_b())) + { + return command_function(args, paths); + } + + triplet default_target_triplet; + if (args.target_triplet != nullptr) + { + default_target_triplet = triplet::from_canonical_name(*args.target_triplet); + } + else + { + const auto vcpkg_default_triplet_env = System::wdupenv_str(L"VCPKG_DEFAULT_TRIPLET"); + if (!vcpkg_default_triplet_env.empty()) + { + default_target_triplet = triplet::from_canonical_name(Strings::utf16_to_utf8(vcpkg_default_triplet_env)); + } + else + { + default_target_triplet = triplet::X86_WINDOWS; + } + } + + Input::check_triplet(default_target_triplet, paths); + + if (auto command_function = Commands::find(args.command, Commands::get_available_commands_type_a())) + { + return command_function(args, paths, default_target_triplet); + } + + return invalid_command(args.command); +} + +static void loadConfig() +{ + fs::path localappdata; + { + // Config path in AppDataLocal + wchar_t* localappdatapath = nullptr; + if (S_OK != SHGetKnownFolderPath(FOLDERID_LocalAppData, 0, nullptr, &localappdatapath)) + __fastfail(1); + localappdata = localappdatapath; + CoTaskMemFree(localappdatapath); + } + + try + { + std::string config_contents = Files::read_contents(localappdata / "vcpkg" / "config").get_or_throw(); + + std::unordered_map keys; + auto pghs = Paragraphs::parse_paragraphs(config_contents); + if (pghs.size() > 0) + keys = pghs[0]; + + for (size_t x = 1; x < pghs.size(); ++x) + { + for (auto&& p : pghs[x]) + keys.insert(p); + } + + auto user_id = keys["User-Id"]; + auto user_time = keys["User-Since"]; + Checks::check_throw(!user_id.empty() && !user_time.empty(), ""); // Use as goto to the catch statement + + SetUserInformation(user_id, user_time); + return; + } + catch (...) + { + } + + // config file not found, could not be read, or invalid + std::string user_id, user_time; + InitUserInformation(user_id, user_time); + SetUserInformation(user_id, user_time); + try + { + std::error_code ec; + fs::create_directory(localappdata / "vcpkg", ec); + std::ofstream(localappdata / "vcpkg" / "config", std::ios_base::out | std::ios_base::trunc) + << "User-Id: " << user_id << "\n" + << "User-Since: " << user_time << "\n"; + } + catch (...) + { + } +} + +static System::Stopwatch2 g_timer; + +static std::string trim_path_from_command_line(const std::string& full_command_line) +{ + Checks::check_exit(full_command_line.size() > 0, "Internal failure - cannot have empty command line"); + + if (full_command_line[0] == '"') + { + auto it = std::find(full_command_line.cbegin() + 1, full_command_line.cend(), '"'); + if (it != full_command_line.cend()) // Skip over the quote + ++it; + while (it != full_command_line.cend() && *it == ' ') // Skip over a space + ++it; + return std::string(it, full_command_line.cend()); + } + + auto it = std::find(full_command_line.cbegin(), full_command_line.cend(), ' '); + while (it != full_command_line.cend() && *it == ' ') + ++it; + return std::string(it, full_command_line.cend()); +} + +int wmain(const int argc, const wchar_t* const* const argv) +{ + if (argc == 0) + std::abort(); + + std::cout.sync_with_stdio(false); + std::cout.imbue(std::locale::classic()); + + g_timer.start(); + atexit([]() + { + g_timer.stop(); + TrackMetric("elapsed_us", g_timer.microseconds()); + Flush(); + }); + + TrackProperty("version", Info::version()); + + const std::string trimmed_command_line = trim_path_from_command_line(Strings::utf16_to_utf8(GetCommandLineW())); + TrackProperty("cmdline", trimmed_command_line); + loadConfig(); + TrackProperty("sqmuser", GetSQMUser()); + + const vcpkg_cmd_arguments args = vcpkg_cmd_arguments::create_from_command_line(argc, argv); + + if (args.printmetrics != opt_bool::unspecified) + SetPrintMetrics(args.printmetrics == opt_bool::enabled); + if (args.sendmetrics != opt_bool::unspecified) + SetSendMetrics(args.sendmetrics == opt_bool::enabled); + + if (args.debug != opt_bool::unspecified) + { + g_debugging = (args.debug == opt_bool::enabled); + } + + if (g_debugging) + { + inner(args); + exit(EXIT_FAILURE); + } + + std::string exc_msg; + try + { + inner(args); + exit(EXIT_FAILURE); + } + catch (std::exception& e) + { + exc_msg = e.what(); + } + catch (...) + { + exc_msg = "unknown error(...)"; + } + TrackProperty("error", exc_msg); + std::cerr + << "vcpkg.exe has crashed.\n" + << "Please send an email to:\n" + << " " << Info::email() << "\n" + << "containing a brief summary of what you were trying to do and the following data blob:\n" + << "\n" + << "Version=" << Info::version() << "\n" + << "EXCEPTION='" << exc_msg << "'\n" + << "CMD=\n"; + for (int x = 0; x < argc; ++x) + std::cerr << Strings::utf16_to_utf8(argv[x]) << "|\n"; + std::cerr + << "\n"; +} diff --git a/toolsrc/vcpkg/vcpkg.vcxproj.filters b/toolsrc/vcpkg/vcpkg.vcxproj.filters index 04e008bd8..ca9723bbf 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj.filters +++ b/toolsrc/vcpkg/vcpkg.vcxproj.filters @@ -15,7 +15,7 @@ - + Source Files -- cgit v1.2.3 From 2a246f26af6771482938d4052e08ce2fdbad92e8 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 25 Jan 2017 19:38:14 -0800 Subject: Change check_throw() to check_exit() --- toolsrc/include/vcpkg_Sets.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/include/vcpkg_Sets.h b/toolsrc/include/vcpkg_Sets.h index 6dec95b89..ec4800864 100644 --- a/toolsrc/include/vcpkg_Sets.h +++ b/toolsrc/include/vcpkg_Sets.h @@ -8,7 +8,7 @@ namespace vcpkg::Sets template void remove_all(std::unordered_set* input_set, Container remove_these) { - Checks::check_throw(input_set != nullptr, "Input set cannot be null"); + Checks::check_exit(input_set != nullptr, "Input set cannot be null"); for (const T& r : remove_these) { input_set->erase(r); -- cgit v1.2.3 From f28125f0138f0257579b3e32612049529cbe504b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 25 Jan 2017 19:50:56 -0800 Subject: Remove vcpkgcommon.vcxproj. Merge it into vcpkglib.vcxproj --- toolsrc/vcpkg.sln | 10 -- toolsrc/vcpkg/vcpkg.vcxproj | 5 +- toolsrc/vcpkgcommon/vcpkgcommon.vcxproj | 142 --------------------- toolsrc/vcpkgcommon/vcpkgcommon.vcxproj.filters | 69 ---------- toolsrc/vcpkglib/vcpkglib.vcxproj | 16 +++ toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 48 +++++++ .../vcpkgmetricsuploader.vcxproj | 3 - toolsrc/vcpkgtest/vcpkgtest.vcxproj | 3 - 8 files changed, 65 insertions(+), 231 deletions(-) delete mode 100644 toolsrc/vcpkgcommon/vcpkgcommon.vcxproj delete mode 100644 toolsrc/vcpkgcommon/vcpkgcommon.vcxproj.filters diff --git a/toolsrc/vcpkg.sln b/toolsrc/vcpkg.sln index ded66d86e..c97756c21 100644 --- a/toolsrc/vcpkg.sln +++ b/toolsrc/vcpkg.sln @@ -5,8 +5,6 @@ VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcpkg", "vcpkg\vcpkg.vcxproj", "{34671B80-54F9-46F5-8310-AC429C11D4FB}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcpkgcommon", "vcpkgcommon\vcpkgcommon.vcxproj", "{7129F242-F20C-43E7-BBEC-4E15B71890B2}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcpkglib", "vcpkglib\vcpkglib.vcxproj", "{B98C92B7-2874-4537-9D46-D14E5C237F04}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcpkgmetricsuploader", "vcpkgmetricsuploader\vcpkgmetricsuploader.vcxproj", "{7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}" @@ -29,14 +27,6 @@ Global {34671B80-54F9-46F5-8310-AC429C11D4FB}.Release|x64.Build.0 = Release|x64 {34671B80-54F9-46F5-8310-AC429C11D4FB}.Release|x86.ActiveCfg = Release|Win32 {34671B80-54F9-46F5-8310-AC429C11D4FB}.Release|x86.Build.0 = Release|Win32 - {7129F242-F20C-43E7-BBEC-4E15B71890B2}.Debug|x64.ActiveCfg = Debug|x64 - {7129F242-F20C-43E7-BBEC-4E15B71890B2}.Debug|x64.Build.0 = Debug|x64 - {7129F242-F20C-43E7-BBEC-4E15B71890B2}.Debug|x86.ActiveCfg = Debug|Win32 - {7129F242-F20C-43E7-BBEC-4E15B71890B2}.Debug|x86.Build.0 = Debug|Win32 - {7129F242-F20C-43E7-BBEC-4E15B71890B2}.Release|x64.ActiveCfg = Release|x64 - {7129F242-F20C-43E7-BBEC-4E15B71890B2}.Release|x64.Build.0 = Release|x64 - {7129F242-F20C-43E7-BBEC-4E15B71890B2}.Release|x86.ActiveCfg = Release|Win32 - {7129F242-F20C-43E7-BBEC-4E15B71890B2}.Release|x86.Build.0 = Release|Win32 {B98C92B7-2874-4537-9D46-D14E5C237F04}.Debug|x64.ActiveCfg = Debug|x64 {B98C92B7-2874-4537-9D46-D14E5C237F04}.Debug|x64.Build.0 = Debug|x64 {B98C92B7-2874-4537-9D46-D14E5C237F04}.Debug|x86.ActiveCfg = Debug|Win32 diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/vcpkg/vcpkg.vcxproj index 476b1fabc..c256173e3 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj +++ b/toolsrc/vcpkg/vcpkg.vcxproj @@ -125,15 +125,12 @@ - - {7129f242-f20c-43e7-bbec-4e15b71890b2} - {b98c92b7-2874-4537-9d46-d14e5c237f04} - + diff --git a/toolsrc/vcpkgcommon/vcpkgcommon.vcxproj b/toolsrc/vcpkgcommon/vcpkgcommon.vcxproj deleted file mode 100644 index 2504a0227..000000000 --- a/toolsrc/vcpkgcommon/vcpkgcommon.vcxproj +++ /dev/null @@ -1,142 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {7129F242-F20C-43E7-BBEC-4E15B71890B2} - vcpkgcommon - 8.1 - v140 - - - - StaticLibrary - true - MultiByte - - - StaticLibrary - false - true - MultiByte - - - StaticLibrary - true - MultiByte - - - StaticLibrary - false - true - MultiByte - - - - - - - - - - - - - - - - - - - - - - - Level3 - Disabled - true - ..\include - /std:c++latest %(AdditionalOptions) - - - - - Level3 - Disabled - true - ..\include - /std:c++latest %(AdditionalOptions) - - - - - Level3 - MaxSpeed - true - true - true - ..\include - _MBCS;NDEBUG;%(PreprocessorDefinitions) - /std:c++latest %(AdditionalOptions) - - - true - true - - - - - Level3 - MaxSpeed - true - true - true - ..\include - _MBCS;NDEBUG;%(PreprocessorDefinitions) - /std:c++latest %(AdditionalOptions) - - - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/toolsrc/vcpkgcommon/vcpkgcommon.vcxproj.filters b/toolsrc/vcpkgcommon/vcpkgcommon.vcxproj.filters deleted file mode 100644 index bba605c54..000000000 --- a/toolsrc/vcpkgcommon/vcpkgcommon.vcxproj.filters +++ /dev/null @@ -1,69 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - \ No newline at end of file diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index 0247e8cc3..0163fe173 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -125,9 +125,12 @@ + + + @@ -135,16 +138,24 @@ + + + + + + + + @@ -172,6 +183,7 @@ + @@ -181,12 +193,16 @@ + + + + diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index 41fce6541..faac8cd67 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -135,6 +135,21 @@ Source Files + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + @@ -206,5 +221,38 @@ Header Files + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + \ No newline at end of file diff --git a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj index 9160da1e1..c925a0b31 100644 --- a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj +++ b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj @@ -128,9 +128,6 @@ - - {7129f242-f20c-43e7-bbec-4e15b71890b2} - {b98c92b7-2874-4537-9d46-d14e5c237f04} diff --git a/toolsrc/vcpkgtest/vcpkgtest.vcxproj b/toolsrc/vcpkgtest/vcpkgtest.vcxproj index dab95b9aa..0fb11eb30 100644 --- a/toolsrc/vcpkgtest/vcpkgtest.vcxproj +++ b/toolsrc/vcpkgtest/vcpkgtest.vcxproj @@ -23,9 +23,6 @@ - - {7129f242-f20c-43e7-bbec-4e15b71890b2} - {b98c92b7-2874-4537-9d46-d14e5c237f04} -- cgit v1.2.3 From c379962a420afaa17e3041f7ba54585a613818cc Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 25 Jan 2017 19:53:07 -0800 Subject: Remove defunct reference to vcpkgcommon.vcxproj --- toolsrc/dirs.proj | 1 - 1 file changed, 1 deletion(-) diff --git a/toolsrc/dirs.proj b/toolsrc/dirs.proj index 55de4fcd4..17d9fa1b0 100644 --- a/toolsrc/dirs.proj +++ b/toolsrc/dirs.proj @@ -5,7 +5,6 @@ - -- cgit v1.2.3 From 490ddfe2f7362c442190f4da9e41386a8a811681 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 25 Jan 2017 21:14:57 -0800 Subject: [libarchive] Disable libiconv support This fixes an issue with the detection code on VS2017. Additionally, it appears that the functionality provided by libiconv is minimal on Windows due to the existance of the Win32 conversion APIs. --- ports/libarchive/CONTROL | 4 ++-- ports/libarchive/portfile.cmake | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ports/libarchive/CONTROL b/ports/libarchive/CONTROL index 43979243c..96f2de7dd 100644 --- a/ports/libarchive/CONTROL +++ b/ports/libarchive/CONTROL @@ -1,4 +1,4 @@ Source: libarchive -Version: 3.2.2-1 +Version: 3.2.2-2 Description: Library for reading and writing streaming archives -Build-Depends: zlib, bzip2, libxml2, libiconv, lz4, liblzma, openssl +Build-Depends: zlib, bzip2, libxml2, lz4, liblzma, openssl diff --git a/ports/libarchive/portfile.cmake b/ports/libarchive/portfile.cmake index 731174790..5a60f1d6d 100644 --- a/ports/libarchive/portfile.cmake +++ b/ports/libarchive/portfile.cmake @@ -33,6 +33,7 @@ vcpkg_configure_cmake( -DENABLE_XATTR=OFF -DENABLE_ACL=OFF -DENABLE_TEST=OFF + -DENABLE_ICONV=OFF -DPOSIX_REGEX_LIB=NONE OPTIONS_DEBUG -DARCHIVE_SKIP_HEADERS=ON) -- cgit v1.2.3 From 95b67ab8e97135538034d220b9658ad9286429c6 Mon Sep 17 00:00:00 2001 From: codicodi Date: Thu, 26 Jan 2017 11:12:55 +0100 Subject: [cairo] update port --- ports/cairo/CMakeLists_cairo.txt | 67 ++++++++++++++++++++++++++++++++++++++-- ports/cairo/CONTROL | 4 +-- ports/cairo/cairo-features.h | 9 ++++++ ports/cairo/portfile.cmake | 10 +++--- 4 files changed, 82 insertions(+), 8 deletions(-) diff --git a/ports/cairo/CMakeLists_cairo.txt b/ports/cairo/CMakeLists_cairo.txt index f445605b9..85cf9457c 100644 --- a/ports/cairo/CMakeLists_cairo.txt +++ b/ports/cairo/CMakeLists_cairo.txt @@ -101,6 +101,8 @@ file(GLOB SOURCES "cairo-tor-scan-converter.c" "cairo-tor22-scan-converter.c" "cairo-clip-tor-scan-converter.c" +"cairo-tag-attributes.c" +"cairo-tag-stack.c" "cairo-toy-font-face.c" "cairo-traps.c" "cairo-tristrip.c" @@ -127,6 +129,7 @@ file(GLOB SOURCES "cairo-type1-subset.c" "cairo-type3-glyph-surface.c" # pdf +"cairo-pdf-interchange.c" "cairo-pdf-operators.c" "cairo-pdf-shading.c" "cairo-pdf-surface.c" @@ -140,6 +143,8 @@ file(GLOB SOURCES "cairo-svg-surface.c" # script surface "cairo-script-surface.c" +# fontconfig + freetype +"cairo-ft-font.c" ) set(CMAKE_DEBUG_POSTFIX "d") @@ -222,11 +227,36 @@ endif() add_library(user32 UNKNOWN IMPORTED) set_property(TARGET user32 PROPERTY IMPORTED_LOCATION "${USER32_LIBRARY}") +# Find dependencies of optional modules + +# Find FreeType +if(CMAKE_BUILD_TYPE STREQUAL Debug) + set(FREETYPE_SUFFIX d) +endif() +find_library(FREETYPE_LIBRARY freetype${FREETYPE_SUFFIX}) +if (FREETYPE_LIBRARY MATCHES NOTFOUND) + message(FATAL_ERROR "The freetype library could not be found. Check to ensure that it is properly installed.") +endif() + +# Cairo needs to be told which features of FreeType are availible +add_definitions( + -DHAVE_FT_GLYPHSLOT_EMBOLDEN=1 + -DHAVE_FT_LIBRARY_SETLCDFILTER=1 + -DHAVE_FT_GLYPHSLOT_OBLIQUE=1 + -DHAVE_FT_LOAD_SFNT_TABLE=1 + -DHAVE_FT_GET_X11_FONT_FORMAT=1) + +# Find FontConfig +find_library(FONTCONFIG_LIBRARY fontconfig) +if (FONTCONFIG_LIBRARY MATCHES NOTFOUND) + message(FATAL_ERROR "The fontconfig library could not be found. Check to ensure that it is properly installed.") +endif() + if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) add_library(cairo ${SOURCES}) # cairo produces a lot of warnings which are disabled here because they otherwise fill up the log files target_compile_options(cairo PUBLIC "/wd4244" PUBLIC "/wd4146" PUBLIC "/wd4312" PUBLIC "/wd4267" PUBLIC "/wd4996" PUBLIC "/wd4311" PUBLIC "/wd4334" PUBLIC "/wd4101") - target_link_libraries(cairo gdi32 msimg32 user32 zlib libpng pixman) + target_link_libraries(cairo gdi32 msimg32 user32 zlib libpng pixman ${FREETYPE_LIBRARY} ${FONTCONFIG_LIBRARY}) install(TARGETS cairo RUNTIME DESTINATION bin @@ -238,7 +268,7 @@ elseif (VCPKG_LIBRARY_LINKAGE STREQUAL static) target_compile_options(cairo-static PUBLIC "/DCAIRO_WIN32_STATIC_BUILD=1") # cairo produces a lot of warnings which are disabled here because they otherwise fill up the log files target_compile_options(cairo-static PUBLIC "/wd4244" PUBLIC "/wd4146" PUBLIC "/wd4312" PUBLIC "/wd4267" PUBLIC "/wd4996" PUBLIC "/wd4311" PUBLIC "/wd4334" PUBLIC "/wd4101") - target_link_libraries(cairo-static gdi32 msimg32 user32 zlib libpng pixman) + target_link_libraries(cairo-static gdi32 msimg32 user32 zlib libpng pixman ${FREETYPE_LIBRARY} ${FONTCONFIG_LIBRARY}) install(TARGETS cairo-static RUNTIME DESTINATION bin @@ -248,3 +278,36 @@ elseif (VCPKG_LIBRARY_LINKAGE STREQUAL static) else() message(FATAL_ERROR "VCPKG_LIBRARY_LINKAGE is not defined or has an unexpected value") endif() + +# GObject support module + +set(CAIRO_GOBJECT_SOURCES + "../util/cairo-gobject/cairo-gobject-enums.c" + "../util/cairo-gobject/cairo-gobject-structs.c") + +# GObject support sources do not include header with export macro +if(BUILD_SHARED_LIBS) + set_source_files_properties( + "../util/cairo-gobject/cairo-gobject-enums.c" + "../util/cairo-gobject/cairo-gobject-structs.c" + PROPERTIES COMPILE_DEFINITIONS cairo_public=__declspec\(dllexport\)) +endif() + +# Make GLib's GObject available +find_library(GLIB_LIBRARY NAMES glib-2.0) +find_library(GOBJECT_LIBRARY NAMES gobject-2.0) +set(GLIB_LIBRARIES ${GLIB_LIBRARY} ${GOBJECT_LIBRARY}) +if (GLIB_LIBRARIES MATCHES NOTFOUND) + message(FATAL_ERROR "The glib library could not be found. Check to ensure that it is properly installed.") +endif() + +add_library(cairo-gobject ${CAIRO_GOBJECT_SOURCES}) +if(BUILD_SHARED_LIBS) + target_link_libraries(cairo-gobject cairo ${GLIB_LIBRARIES}) +else() + target_link_libraries(cairo-gobject cairo-static ${GLIB_LIBRARIES}) +endif() +install(TARGETS cairo-gobject + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) diff --git a/ports/cairo/CONTROL b/ports/cairo/CONTROL index 017569c50..89ba03b79 100644 --- a/ports/cairo/CONTROL +++ b/ports/cairo/CONTROL @@ -1,4 +1,4 @@ Source: cairo -Version: 1.14.6 +Version: 1.15.4 Description: Cairo is a 2D graphics library with support for multiple output devices. Currently supported output targets include the X Window System (via both Xlib and XCB), Quartz, Win32, image buffers, PostScript, PDF, and SVG file output. Experimental backends include OpenGL, BeOS, OS/2, and DirectFB. -Build-Depends: zlib, libpng, pixman +Build-Depends: zlib, libpng, pixman, glib, freetype, fontconfig diff --git a/ports/cairo/cairo-features.h b/ports/cairo/cairo-features.h index b9277b7f7..3a1963974 100644 --- a/ports/cairo/cairo-features.h +++ b/ports/cairo/cairo-features.h @@ -24,4 +24,13 @@ #define CAIRO_HAS_OBSERVER_SURFACE 1 #define CAIRO_HAS_USER_FONT 1 +/* Require GObject */ +#define CAIRO_HAS_GOBJECT_FUNCTIONS 1 + +/* Require FreeType */ +#define CAIRO_HAS_FT_FONT 1 + +/* Require FontConfig */ +#define CAIRO_HAS_FC_FONT 1 + #endif diff --git a/ports/cairo/portfile.cmake b/ports/cairo/portfile.cmake index 2131bd146..57b45e91c 100644 --- a/ports/cairo/portfile.cmake +++ b/ports/cairo/portfile.cmake @@ -7,11 +7,11 @@ # include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/cairo-1.14.6) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/cairo-1.15.4) vcpkg_download_distfile(ARCHIVE - URLS "https://www.cairographics.org/releases/cairo-1.14.6.tar.xz" - FILENAME "cairo-1.14.6.tar.xz" - SHA512 e2aa17a33b95b68d407b53ac321cca15b0c148eb49b8639c75b2af1e75e7b417a2168ea978dabb8581b341f0f45dc042d3b1a56b01ab525b1984015f0865316b + URLS "http://cairographics.org/snapshots/cairo-1.15.4.tar.xz" + FILENAME "cairo-1.15.4.tar.xz" + SHA512 ac3e6879fcf0876bca9f801cdf9e970ef1822644228cdd21962d0bf5db5fc074973f4ae651eb9c76b44fffd405cf0a0c7cbb228dba96b835ea137a2740277ee9 ) vcpkg_extract_source_archive(${ARCHIVE}) @@ -43,6 +43,8 @@ file(COPY "${SOURCE_PATH}/src/cairo-svg.h" "${SOURCE_PATH}/cairo-version.h" "${SOURCE_PATH}/src/cairo-win32.h" +"${SOURCE_PATH}/util/cairo-gobject/cairo-gobject.h" +"${SOURCE_PATH}/src/cairo-ft.h" DESTINATION ${CURRENT_PACKAGES_DIR}/include ) -- cgit v1.2.3 From 1df57b358591a6bf9fa60955a65b8944f20547f2 Mon Sep 17 00:00:00 2001 From: codicodi Date: Thu, 26 Jan 2017 11:25:24 +0100 Subject: [harfbuzz] add glib support --- ports/harfbuzz/portfile.cmake | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/ports/harfbuzz/portfile.cmake b/ports/harfbuzz/portfile.cmake index 911dea860..83f267912 100644 --- a/ports/harfbuzz/portfile.cmake +++ b/ports/harfbuzz/portfile.cmake @@ -21,18 +21,31 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) -file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/include" FREETYPE_INCLUDE_DIR) -file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/debug/lib" FREETYPE_LIB_DIR_DBG) -file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/lib" FREETYPE_LIB_DIR_REL) +file(WRITE ${SOURCE_PATH}/win32/msvc_recommended_pragmas.h "/* I'm expected to exist */") + +# for GObject support, harfbuzz expects glib-mkenums tool (perl script) to be availible in $(PREFIX)/bin +file(COPY ${CURRENT_INSTALLED_DIR}/tools/glib/glib-mkenums DESTINATION ${SOURCE_PATH}/bin) +vcpkg_find_acquire_program(PERL) + +file(TO_NATIVE_PATH "${PERL}" PERL_INTERPRETER) +file(TO_NATIVE_PATH "${SOURCE_PATH}" MKENUMS_TOOL_DIR) + +file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/include" INCLUDE_DIR) +file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/debug/lib" LIB_DIR_DBG) +file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/lib" LIB_DIR_REL) + +set(DEPENDENCIES FREETYPE=1 GLIB=1 GOBJECT=1) vcpkg_execute_required_process( - COMMAND ${NMAKE} -f Makefile.vc CFG=debug FREETYPE=1 FREETYPE_DIR=${FREETYPE_INCLUDE_DIR} ADDITIONAL_LIB_DIR=${FREETYPE_LIB_DIR_DBG} + COMMAND ${NMAKE} -f Makefile.vc CFG=debug ${DEPENDENCIES} FREETYPE_DIR=${INCLUDE_DIR} ADDITIONAL_LIB_DIR=${LIB_DIR_DBG} + PREFIX=${MKENUMS_TOOL_DIR} PERL=${PERL_INTERPRETER} WORKING_DIRECTORY ${SOURCE_PATH}/win32/ LOGNAME nmake-build-${TARGET_TRIPLET}-debug ) vcpkg_execute_required_process( - COMMAND ${NMAKE} -f Makefile.vc CFG=release FREETYPE=1 FREETYPE_DIR=${FREETYPE_INCLUDE_DIR} ADDITIONAL_LIB_DIR=${FREETYPE_LIB_DIR_REL} + COMMAND ${NMAKE} -f Makefile.vc CFG=release ${DEPENDENCIES} FREETYPE_DIR=${INCLUDE_DIR} ADDITIONAL_LIB_DIR=${LIB_DIR_REL} + PREFIX=${MKENUMS_TOOL_DIR} PERL=${PERL_INTERPRETER} WORKING_DIRECTORY ${SOURCE_PATH}/win32/ LOGNAME nmake-build-${TARGET_TRIPLET}-release ) @@ -40,7 +53,7 @@ vcpkg_execute_required_process( file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}/debug" NATIVE_PACKAGES_DIR_DBG) vcpkg_execute_required_process( - COMMAND ${NMAKE} -f Makefile.vc CFG=debug FREETYPE=1 PREFIX=${NATIVE_PACKAGES_DIR_DBG} install + COMMAND ${NMAKE} -f Makefile.vc CFG=debug ${DEPENDENCIES} PREFIX=${NATIVE_PACKAGES_DIR_DBG} install WORKING_DIRECTORY ${SOURCE_PATH}/win32/ LOGNAME nmake-install-${TARGET_TRIPLET}-debug ) @@ -49,11 +62,16 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}" NATIVE_PACKAGES_DIR_REL) vcpkg_execute_required_process( - COMMAND ${NMAKE} -f Makefile.vc CFG=release FREETYPE=1 PREFIX=${NATIVE_PACKAGES_DIR_REL} install + COMMAND ${NMAKE} -f Makefile.vc CFG=release ${DEPENDENCIES} PREFIX=${NATIVE_PACKAGES_DIR_REL} install WORKING_DIRECTORY ${SOURCE_PATH}/win32/ LOGNAME nmake-install-${TARGET_TRIPLET}-release ) +file(GLOB EXECUTABLES + ${CURRENT_PACKAGES_DIR}/bin/*.exe + ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe) +file(REMOVE ${EXECUTABLES}) + # Handle copyright file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/harfbuzz) file(RENAME ${CURRENT_PACKAGES_DIR}/share/harfbuzz/COPYING ${CURRENT_PACKAGES_DIR}/share/harfbuzz/copyright) -- cgit v1.2.3 From 95e1f378fdacb537d3f093aafdd8a36a03c7a3b9 Mon Sep 17 00:00:00 2001 From: codicodi Date: Thu, 26 Jan 2017 11:59:48 +0100 Subject: [harfbuzz] bump version --- ports/harfbuzz/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/harfbuzz/CONTROL b/ports/harfbuzz/CONTROL index eab88ff11..8624853aa 100644 --- a/ports/harfbuzz/CONTROL +++ b/ports/harfbuzz/CONTROL @@ -1,4 +1,4 @@ Source: harfbuzz -Version: 1.3.4 +Version: 1.3.4-1 Description: HarfBuzz OpenType text shaping engine Build-Depends: freetype -- cgit v1.2.3 From d2ef8f847e56f97ab988c3314c3b064497571955 Mon Sep 17 00:00:00 2001 From: codicodi Date: Thu, 26 Jan 2017 12:24:17 +0100 Subject: [harfbuzz] list glib as dependency --- ports/harfbuzz/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/harfbuzz/CONTROL b/ports/harfbuzz/CONTROL index 8624853aa..526dca3b3 100644 --- a/ports/harfbuzz/CONTROL +++ b/ports/harfbuzz/CONTROL @@ -1,4 +1,4 @@ Source: harfbuzz Version: 1.3.4-1 Description: HarfBuzz OpenType text shaping engine -Build-Depends: freetype +Build-Depends: freetype, glib -- cgit v1.2.3 From 4be93bac78aaba43ea562b454dc14ca5a391e570 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 26 Jan 2017 13:08:35 -0800 Subject: [Stopwatch] Specify elapsedNanos = 0 on construction --- toolsrc/src/Stopwatch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/Stopwatch.cpp b/toolsrc/src/Stopwatch.cpp index 550f1ebd8..b0e54e381 100644 --- a/toolsrc/src/Stopwatch.cpp +++ b/toolsrc/src/Stopwatch.cpp @@ -88,7 +88,7 @@ namespace vcpkg return Strings::format("%.4g ns", nanos_as_double); } - Stopwatch::Stopwatch() : m_isRunning(false), m_elapsedNanos(), m_startTick() + Stopwatch::Stopwatch() : m_isRunning(false), m_elapsedNanos(0), m_startTick() { } -- cgit v1.2.3 From fb7cc35f30e98c265c5ea8831987440f37126d2c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 26 Jan 2017 13:28:07 -0800 Subject: [boost] Update to 1.63 --- ports/boost/CONTROL | 2 +- ports/boost/portfile.cmake | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ports/boost/CONTROL b/ports/boost/CONTROL index 039cef721..2cc98f16b 100644 --- a/ports/boost/CONTROL +++ b/ports/boost/CONTROL @@ -1,4 +1,4 @@ Source: boost -Version: 1.62-12 +Version: 1.63 Description: Peer-reviewed portable C++ source libraries Build-Depends: zlib, bzip2 diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake index f9c0a0a34..d8f0a23d1 100644 --- a/ports/boost/portfile.cmake +++ b/ports/boost/portfile.cmake @@ -1,22 +1,22 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/boost_1_62_0) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/boost_1_63_0) vcpkg_download_distfile(ARCHIVE_FILE - URLS "https://sourceforge.net/projects/boost/files/boost/1.62.0/boost_1_62_0.tar.bz2" - FILENAME "boost_1_62_0.tar.bz2" - SHA512 5385ae3d5255a433a704169ad454d8dc2b0b5bcae3fb23defd6570df4ff7d845cf9fcbeebccdc1c5db0eec9f82ee3d90040de9507c8167467c635d3b215463be + URLS "https://sourceforge.net/projects/boost/files/boost/1.63.0/boost_1_63_0.tar.bz2" + FILENAME "boost_1_63_0.tar.bz2" + SHA512 c915c5f5778dee49b8e9d0a40f37f90f56fb1fdb1d8ce92d97bf48bc7bc462212487badfe4bbe30b06196d1149cfb221da12ac54e97499b0d4cb6466813bb4ad ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) # apply boost range hotfix vcpkg_download_distfile(DIFF URLS "https://github.com/boostorg/range/commit/e7ebe14707130cda7b72e0ae5e93b17157fdb6a2.diff" - FILENAME "boost-range-has_range_interator-hotfix_e7ebe14707130cda7b72e0ae5e93b17157fdb6a2.diff" + FILENAME "boost-range-has_range_iterator-hotfix_e7ebe14707130cda7b72e0ae5e93b17157fdb6a2.diff" SHA512 77dad42bfd9bbab2bbddf361d5b7ad3dd6f812f4294c6dd1a677bb4d0191a4fff43bca32fdd4fce05d428562abb6e38afd0fd33ca6a8b5f28481d70cd2f3dd67 ) FILE(READ "${DIFF}" content) STRING(REGEX REPLACE "include/" "" content "${content}") -set(DIFF2 ${CURRENT_BUILDTREES_DIR}/src/boost-range-has_range_interator-hotfix_e7ebe14707130cda7b72e0ae5e93b17157fdb6a2.diff.fixed) +set(DIFF2 ${CURRENT_BUILDTREES_DIR}/src/boost-range-has_range_iterator-hotfix_e7ebe14707130cda7b72e0ae5e93b17157fdb6a2.diff.fixed) FILE(WRITE ${DIFF2} "${content}") vcpkg_apply_patches(SOURCE_PATH ${SOURCE_PATH} PATCHES ${DIFF2}) @@ -63,7 +63,7 @@ if(VCPKG_CMAKE_SYSTEM_NAME MATCHES "WindowsStore") endif() # Add build type specific options -set(B2_OPTIONS_DBG +set(B2_OPTIONS_DBG ${B2_OPTIONS} -sZLIB_BINARY=zlibd -sZLIB_LIBPATH="${CURRENT_INSTALLED_DIR}\\debug\\lib" @@ -71,7 +71,7 @@ set(B2_OPTIONS_DBG -sBZIP2_LIBPATH="${CURRENT_INSTALLED_DIR}\\debug\\lib" ) -set(B2_OPTIONS_REL +set(B2_OPTIONS_REL ${B2_OPTIONS} -sZLIB_BINARY=zlib -sZLIB_LIBPATH="${CURRENT_INSTALLED_DIR}\\lib" @@ -128,7 +128,7 @@ file(INSTALL ${SOURCE_PATH}/LICENSE_1_0.txt DESTINATION ${CURRENT_PACKAGES_DIR}/ message(STATUS "Packaging headers done") # This function makes the static build lib names match the dynamic build lib names which FindBoost.cmake is looking for by default. -# It also renames a couple of "libboost" lib files in the dynamic build (for example libboost_exception-vc140-mt-1_62.lib). +# It also renames a couple of "libboost" lib files in the dynamic build (for example libboost_exception-vc140-mt-1_63.lib). function(boost_rename_libs LIBS) foreach(LIB ${${LIBS}}) get_filename_component(OLD_FILENAME ${LIB} NAME) -- cgit v1.2.3 From 8bc3c1f06267bd49119a0fa1bfea8b9bfdde194f Mon Sep 17 00:00:00 2001 From: Eric Mittelette Date: Thu, 26 Jan 2017 16:27:52 -0800 Subject: add xercesc --- ports/xercesc/CONTROL | 3 +++ ports/xercesc/portfile.cmake | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 ports/xercesc/CONTROL create mode 100644 ports/xercesc/portfile.cmake diff --git a/ports/xercesc/CONTROL b/ports/xercesc/CONTROL new file mode 100644 index 000000000..497ef66c3 --- /dev/null +++ b/ports/xercesc/CONTROL @@ -0,0 +1,3 @@ +Source: xercesc +Version: 3.1.4 +Description: Xerces-C++ is a XML parser, for parsing, generating, manipulating, and validating XML documents using the DOM, SAX, and SAX2 APIs. diff --git a/ports/xercesc/portfile.cmake b/ports/xercesc/portfile.cmake new file mode 100644 index 000000000..bf2a2ee59 --- /dev/null +++ b/ports/xercesc/portfile.cmake @@ -0,0 +1,40 @@ +# 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/xerces-c-3.1.4) + +vcpkg_download_distfile(ARCHIVE + URLS "http://www-us.apache.org/dist//xerces/c/3/sources/xerces-c-3.1.4.zip" + FILENAME "xerces-c-3.1.4.zip" + SHA512 3ba1bf38875bda8a294990dba73143cfd6dbfa158b17f4db1fd0ee9a08a078af969103200eaf8957756f8363c8a661983cc95124b4978eb2162dc0344a85fff8 +) +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}/projects/Win32/VC14/xerces-all/xerces-all.sln + PROJECT_PATH ${SOURCE_PATH}/projects/Win32/VC14/xerces-all/xercesLib/xercesLib.vcxproj + PLATFORM ${BUILD_ARCH}) + + +file(COPY ${SOURCE_PATH}/src/xercesc DESTINATION ${CURRENT_PACKAGES_DIR}/include FILES_MATCHING PATTERN *.hpp) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/xercesc/NLS) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/xercesc/util/MsgLoaders/ICU/resources) + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/xerces) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/xerces/LICENSE ${CURRENT_PACKAGES_DIR}/share/xerces/copyright) -- cgit v1.2.3 From 5de87096b1440a7a3f0ca781620a88f25e8ce060 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 26 Jan 2017 16:43:22 -0800 Subject: Rename xercesc to xerces-c and fix copyright file placement --- ports/xerces-c/CONTROL | 3 +++ ports/xerces-c/portfile.cmake | 40 ++++++++++++++++++++++++++++++++++++++++ ports/xercesc/CONTROL | 3 --- ports/xercesc/portfile.cmake | 40 ---------------------------------------- 4 files changed, 43 insertions(+), 43 deletions(-) create mode 100644 ports/xerces-c/CONTROL create mode 100644 ports/xerces-c/portfile.cmake delete mode 100644 ports/xercesc/CONTROL delete mode 100644 ports/xercesc/portfile.cmake diff --git a/ports/xerces-c/CONTROL b/ports/xerces-c/CONTROL new file mode 100644 index 000000000..822c50387 --- /dev/null +++ b/ports/xerces-c/CONTROL @@ -0,0 +1,3 @@ +Source: xerces-c +Version: 3.1.4 +Description: Xerces-C++ is a XML parser, for parsing, generating, manipulating, and validating XML documents using the DOM, SAX, and SAX2 APIs. diff --git a/ports/xerces-c/portfile.cmake b/ports/xerces-c/portfile.cmake new file mode 100644 index 000000000..5543f80ed --- /dev/null +++ b/ports/xerces-c/portfile.cmake @@ -0,0 +1,40 @@ +# 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/xerces-c-3.1.4) + +vcpkg_download_distfile(ARCHIVE + URLS "http://www-us.apache.org/dist//xerces/c/3/sources/xerces-c-3.1.4.zip" + FILENAME "xerces-c-3.1.4.zip" + SHA512 3ba1bf38875bda8a294990dba73143cfd6dbfa158b17f4db1fd0ee9a08a078af969103200eaf8957756f8363c8a661983cc95124b4978eb2162dc0344a85fff8 +) +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}/projects/Win32/VC14/xerces-all/xerces-all.sln + PROJECT_PATH ${SOURCE_PATH}/projects/Win32/VC14/xerces-all/xercesLib/xercesLib.vcxproj + PLATFORM ${BUILD_ARCH}) + + +file(COPY ${SOURCE_PATH}/src/xercesc DESTINATION ${CURRENT_PACKAGES_DIR}/include FILES_MATCHING PATTERN *.hpp) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/xercesc/NLS) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/xercesc/util/MsgLoaders/ICU/resources) + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/xerces-c) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/xerces-c/LICENSE ${CURRENT_PACKAGES_DIR}/share/xerces-c/copyright) diff --git a/ports/xercesc/CONTROL b/ports/xercesc/CONTROL deleted file mode 100644 index 497ef66c3..000000000 --- a/ports/xercesc/CONTROL +++ /dev/null @@ -1,3 +0,0 @@ -Source: xercesc -Version: 3.1.4 -Description: Xerces-C++ is a XML parser, for parsing, generating, manipulating, and validating XML documents using the DOM, SAX, and SAX2 APIs. diff --git a/ports/xercesc/portfile.cmake b/ports/xercesc/portfile.cmake deleted file mode 100644 index bf2a2ee59..000000000 --- a/ports/xercesc/portfile.cmake +++ /dev/null @@ -1,40 +0,0 @@ -# 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/xerces-c-3.1.4) - -vcpkg_download_distfile(ARCHIVE - URLS "http://www-us.apache.org/dist//xerces/c/3/sources/xerces-c-3.1.4.zip" - FILENAME "xerces-c-3.1.4.zip" - SHA512 3ba1bf38875bda8a294990dba73143cfd6dbfa158b17f4db1fd0ee9a08a078af969103200eaf8957756f8363c8a661983cc95124b4978eb2162dc0344a85fff8 -) -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}/projects/Win32/VC14/xerces-all/xerces-all.sln - PROJECT_PATH ${SOURCE_PATH}/projects/Win32/VC14/xerces-all/xercesLib/xercesLib.vcxproj - PLATFORM ${BUILD_ARCH}) - - -file(COPY ${SOURCE_PATH}/src/xercesc DESTINATION ${CURRENT_PACKAGES_DIR}/include FILES_MATCHING PATTERN *.hpp) - -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/xercesc/NLS) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/xercesc/util/MsgLoaders/ICU/resources) - -# Handle copyright -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/xerces) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/xerces/LICENSE ${CURRENT_PACKAGES_DIR}/share/xerces/copyright) -- cgit v1.2.3 From 5d2f44859248f1ef32d4c79b6b22eec95b18db1a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 27 Jan 2017 13:01:22 -0800 Subject: Use Strings::join() --- toolsrc/src/commands_install.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index 6fc0e32f0..a8ddf35f4 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -153,12 +153,7 @@ namespace vcpkg::Commands::Install System::println(System::color::error, "The following files are already installed in %s and are in conflict with %s", triplet_install_path.generic_string(), binary_paragraph.spec); - System::println(""); - for (const std::string& s : intersection) - { - System::println(" %s", s); - } - System::println(""); + Strings::join(intersection, "\n "); exit(EXIT_FAILURE); } -- cgit v1.2.3 From 6a58bee5e4e1277aea4c6f0f3991645abb738bbf Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 27 Jan 2017 19:06:50 -0800 Subject: [harfbuzz] Uses in-source builds, so we need to clean them every time. --- ports/harfbuzz/CONTROL | 2 +- ports/harfbuzz/portfile.cmake | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ports/harfbuzz/CONTROL b/ports/harfbuzz/CONTROL index 526dca3b3..6a54dc583 100644 --- a/ports/harfbuzz/CONTROL +++ b/ports/harfbuzz/CONTROL @@ -1,4 +1,4 @@ Source: harfbuzz -Version: 1.3.4-1 +Version: 1.3.4-2 Description: HarfBuzz OpenType text shaping engine Build-Depends: freetype, glib diff --git a/ports/harfbuzz/portfile.cmake b/ports/harfbuzz/portfile.cmake index 83f267912..ac3252455 100644 --- a/ports/harfbuzz/portfile.cmake +++ b/ports/harfbuzz/portfile.cmake @@ -11,7 +11,7 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/harfbuzz-1.3.4) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-src/harfbuzz-1.3.4) find_program(NMAKE nmake) vcpkg_download_distfile(ARCHIVE @@ -19,7 +19,9 @@ vcpkg_download_distfile(ARCHIVE FILENAME "harfbuzz-1.3.4.tar.bz2" SHA512 72027ce64d735f1f7ecabcc78ba426d6155cebd564439feb77cefdfc28b00bfd9f6314e6735addaa90cee1d98cf6d2c0b61f77b446ba34e11f7eb7cdfdcd386a ) -vcpkg_extract_source_archive(${ARCHIVE}) +# Harfbuzz only supports in-source builds, so to make sure we get a clean build, we need to re-extract every time +file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-src) +vcpkg_extract_source_archive(${ARCHIVE} ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-src) file(WRITE ${SOURCE_PATH}/win32/msvc_recommended_pragmas.h "/* I'm expected to exist */") -- cgit v1.2.3 From d81c9b94ebde6f47cb92991e9523f22645a112bb Mon Sep 17 00:00:00 2001 From: Christian Ullrich Date: Sat, 28 Jan 2017 17:25:17 +0100 Subject: [openssl] Update to 1.0.2k --- ports/openssl/CMakeLists.txt | 2 +- ports/openssl/CONTROL | 4 ++-- ports/openssl/portfile.cmake | 11 ++++++----- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ports/openssl/CMakeLists.txt b/ports/openssl/CMakeLists.txt index 1fa0f30d0..a82f14d60 100644 --- a/ports/openssl/CMakeLists.txt +++ b/ports/openssl/CMakeLists.txt @@ -3,7 +3,7 @@ project(openssl NONE) include(vcpkg_execute_required_process) include(vcpkg_apply_patches) -set(SOURCE_PATH ${CMAKE_CURRENT_BINARY_DIR}/openssl-1.0.2j) +set(SOURCE_PATH ${CMAKE_CURRENT_BINARY_DIR}/openssl-${OPENSSL_VERSION}) find_program(PERL perl) find_program(NMAKE nmake) diff --git a/ports/openssl/CONTROL b/ports/openssl/CONTROL index ca4aae2e6..2486f0358 100644 --- a/ports/openssl/CONTROL +++ b/ports/openssl/CONTROL @@ -1,3 +1,3 @@ Source: openssl -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 +Version: 1.0.2k-1 +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. diff --git a/ports/openssl/portfile.cmake b/ports/openssl/portfile.cmake index 9b84b7475..b13258119 100644 --- a/ports/openssl/portfile.cmake +++ b/ports/openssl/portfile.cmake @@ -4,7 +4,8 @@ if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") endif() include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/openssl-1.0.2j) +set(OPENSSL_VERSION 1.0.2k) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/openssl-${OPENSSL_VERSION}) vcpkg_find_acquire_program(PERL) find_program(NMAKE nmake) @@ -12,9 +13,9 @@ get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) set(ENV{PATH} "${PERL_EXE_PATH};$ENV{PATH}") vcpkg_download_distfile(OPENSSL_SOURCE_ARCHIVE - URLS "https://www.openssl.org/source/openssl-1.0.2j.tar.gz" - FILENAME "openssl-1.0.2j.tar.gz" - SHA512 7d6ccae4aa3ccec3a5d128da29c68401cdb1210cba6d212d55235fc3bc63d7085e2f119e2bbee7ddff6b7b5eef07c6196156791724cd2caf313a4c2fef724edd + URLS "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz" + FILENAME "openssl-${OPENSSL_VERSION}.tar.gz" + SHA512 0d314b42352f4b1df2c40ca1094abc7e9ad684c5c35ea997efdd58204c70f22a1abcb17291820f0fff3769620a4e06906034203d31eb1a4d540df3e0db294016 ) file(COPY @@ -34,7 +35,7 @@ vcpkg_configure_cmake( -DOPENSSL_SOURCE_ARCHIVE=${OPENSSL_SOURCE_ARCHIVE} -DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH} -DTRIPLET_SYSTEM_ARCH=${TRIPLET_SYSTEM_ARCH} - -DVERSION=1.0.2j + -DVERSION=${OPENSSL_VERSION} -DTARGET_TRIPLET=${TARGET_TRIPLET} ) -- cgit v1.2.3 From 0ce85b546ee8746e5dacb27dcc8c689a55b0735d Mon Sep 17 00:00:00 2001 From: Markus Otto Date: Thu, 26 Jan 2017 01:27:09 +0100 Subject: [libopus] add version 1.1.4 --- ports/libopus/CONTROL | 3 ++ ports/libopus/portfile.cmake | 76 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 ports/libopus/CONTROL create mode 100644 ports/libopus/portfile.cmake diff --git a/ports/libopus/CONTROL b/ports/libopus/CONTROL new file mode 100644 index 000000000..eb1706f3a --- /dev/null +++ b/ports/libopus/CONTROL @@ -0,0 +1,3 @@ +Source: libopus +Version: 1.1.4 +Description: Totally open, royalty-free, highly versatile audio codec diff --git a/ports/libopus/portfile.cmake b/ports/libopus/portfile.cmake new file mode 100644 index 000000000..1fb111dfe --- /dev/null +++ b/ports/libopus/portfile.cmake @@ -0,0 +1,76 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/opus-1.1.4) +vcpkg_download_distfile(ARCHIVE + URLS "http://downloads.xiph.org/releases/opus/opus-1.1.4.tar.gz" + FILENAME "opus-1.1.4.tar.gz" + SHA512 57f14b9e8037eaa02a4d86535d3bbcceca249310fbc9ef1a452cc19dd442d4cf338d5db241d20605c236e22549df2c8266b7486c5f1666b80c532afd52cb3585 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + set(RELEASE_CONFIGURATION "Release") + set(DEBUG_CONFIGURATION "Debug") +else() + set(RELEASE_CONFIGURATION "ReleaseDll") + set(DEBUG_CONFIGURATION "DebugDll") +endif() + +if(TARGET_TRIPLET MATCHES "x86") + set(ARCH_DIR "Win32") +elseif(TARGET_TRIPLET MATCHES "x64") + set(ARCH_DIR "x64") +else() + message("Architecture not supported") +endif() + +function(build_project PROJECT_PATH) + vcpkg_build_msbuild( + PROJECT_PATH ${PROJECT_PATH} + RELEASE_CONFIGURATION ${RELEASE_CONFIGURATION} + DEBUG_CONFIGURATION ${DEBUG_CONFIGURATION} + ) +endfunction(build_project) + + +build_project(${SOURCE_PATH}/win32/VS2015/celt.vcxproj) +build_project(${SOURCE_PATH}/win32/VS2015/silk_common.vcxproj) +build_project(${SOURCE_PATH}/win32/VS2015/silk_float.vcxproj) +build_project(${SOURCE_PATH}/win32/VS2015/silk_fixed.vcxproj) +build_project(${SOURCE_PATH}/win32/VS2015/opus.vcxproj) + + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + # Install release build + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${RELEASE_CONFIGURATION}/opus.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${RELEASE_CONFIGURATION}/celt.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${RELEASE_CONFIGURATION}/silk_common.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${RELEASE_CONFIGURATION}/silk_fixed.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${RELEASE_CONFIGURATION}/silk_float.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/) + + # Install debug build + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/opus.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/opus.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/celt.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/celt.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/silk_common.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/silk_common.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/silk_fixed.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/silk_fixed.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/silk_float.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/silk_float.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) +else() + # Install release build + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${RELEASE_CONFIGURATION}/opus.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${RELEASE_CONFIGURATION}/opus.dll DESTINATION ${CURRENT_PACKAGES_DIR}/bin/) + + # Install debug build + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/opus.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/opus.dll DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/opus.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin/) +endif() + +# Install headers +file(INSTALL ${SOURCE_PATH}/include DESTINATION ${CURRENT_PACKAGES_DIR}/include RENAME opus) + +# Handle copyright +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libopus RENAME copyright) -- cgit v1.2.3 From faf60f0ee3ba35976e13f331a563c68a310cb946 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 28 Jan 2017 20:11:26 -0800 Subject: [opus] Rename libopus to opus to match upstream project's name --- ports/libopus/CONTROL | 3 -- ports/libopus/portfile.cmake | 76 -------------------------------------------- ports/opus/CONTROL | 3 ++ ports/opus/portfile.cmake | 76 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 79 insertions(+), 79 deletions(-) delete mode 100644 ports/libopus/CONTROL delete mode 100644 ports/libopus/portfile.cmake create mode 100644 ports/opus/CONTROL create mode 100644 ports/opus/portfile.cmake diff --git a/ports/libopus/CONTROL b/ports/libopus/CONTROL deleted file mode 100644 index eb1706f3a..000000000 --- a/ports/libopus/CONTROL +++ /dev/null @@ -1,3 +0,0 @@ -Source: libopus -Version: 1.1.4 -Description: Totally open, royalty-free, highly versatile audio codec diff --git a/ports/libopus/portfile.cmake b/ports/libopus/portfile.cmake deleted file mode 100644 index 1fb111dfe..000000000 --- a/ports/libopus/portfile.cmake +++ /dev/null @@ -1,76 +0,0 @@ -include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/opus-1.1.4) -vcpkg_download_distfile(ARCHIVE - URLS "http://downloads.xiph.org/releases/opus/opus-1.1.4.tar.gz" - FILENAME "opus-1.1.4.tar.gz" - SHA512 57f14b9e8037eaa02a4d86535d3bbcceca249310fbc9ef1a452cc19dd442d4cf338d5db241d20605c236e22549df2c8266b7486c5f1666b80c532afd52cb3585 -) -vcpkg_extract_source_archive(${ARCHIVE}) - -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - set(RELEASE_CONFIGURATION "Release") - set(DEBUG_CONFIGURATION "Debug") -else() - set(RELEASE_CONFIGURATION "ReleaseDll") - set(DEBUG_CONFIGURATION "DebugDll") -endif() - -if(TARGET_TRIPLET MATCHES "x86") - set(ARCH_DIR "Win32") -elseif(TARGET_TRIPLET MATCHES "x64") - set(ARCH_DIR "x64") -else() - message("Architecture not supported") -endif() - -function(build_project PROJECT_PATH) - vcpkg_build_msbuild( - PROJECT_PATH ${PROJECT_PATH} - RELEASE_CONFIGURATION ${RELEASE_CONFIGURATION} - DEBUG_CONFIGURATION ${DEBUG_CONFIGURATION} - ) -endfunction(build_project) - - -build_project(${SOURCE_PATH}/win32/VS2015/celt.vcxproj) -build_project(${SOURCE_PATH}/win32/VS2015/silk_common.vcxproj) -build_project(${SOURCE_PATH}/win32/VS2015/silk_float.vcxproj) -build_project(${SOURCE_PATH}/win32/VS2015/silk_fixed.vcxproj) -build_project(${SOURCE_PATH}/win32/VS2015/opus.vcxproj) - - -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - # Install release build - file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${RELEASE_CONFIGURATION}/opus.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/) - file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${RELEASE_CONFIGURATION}/celt.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/) - file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${RELEASE_CONFIGURATION}/silk_common.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/) - file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${RELEASE_CONFIGURATION}/silk_fixed.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/) - file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${RELEASE_CONFIGURATION}/silk_float.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/) - - # Install debug build - file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/opus.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) - file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/opus.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) - file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/celt.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) - file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/celt.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) - file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/silk_common.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) - file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/silk_common.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) - file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/silk_fixed.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) - file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/silk_fixed.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) - file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/silk_float.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) - file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/silk_float.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) -else() - # Install release build - file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${RELEASE_CONFIGURATION}/opus.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/) - file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${RELEASE_CONFIGURATION}/opus.dll DESTINATION ${CURRENT_PACKAGES_DIR}/bin/) - - # Install debug build - file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/opus.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) - file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/opus.dll DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin/) - file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/opus.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin/) -endif() - -# Install headers -file(INSTALL ${SOURCE_PATH}/include DESTINATION ${CURRENT_PACKAGES_DIR}/include RENAME opus) - -# Handle copyright -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libopus RENAME copyright) diff --git a/ports/opus/CONTROL b/ports/opus/CONTROL new file mode 100644 index 000000000..7177b2199 --- /dev/null +++ b/ports/opus/CONTROL @@ -0,0 +1,3 @@ +Source: opus +Version: 1.1.4 +Description: Totally open, royalty-free, highly versatile audio codec diff --git a/ports/opus/portfile.cmake b/ports/opus/portfile.cmake new file mode 100644 index 000000000..a004f09dd --- /dev/null +++ b/ports/opus/portfile.cmake @@ -0,0 +1,76 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/opus-1.1.4) +vcpkg_download_distfile(ARCHIVE + URLS "http://downloads.xiph.org/releases/opus/opus-1.1.4.tar.gz" + FILENAME "opus-1.1.4.tar.gz" + SHA512 57f14b9e8037eaa02a4d86535d3bbcceca249310fbc9ef1a452cc19dd442d4cf338d5db241d20605c236e22549df2c8266b7486c5f1666b80c532afd52cb3585 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + set(RELEASE_CONFIGURATION "Release") + set(DEBUG_CONFIGURATION "Debug") +else() + set(RELEASE_CONFIGURATION "ReleaseDll") + set(DEBUG_CONFIGURATION "DebugDll") +endif() + +if(TARGET_TRIPLET MATCHES "x86") + set(ARCH_DIR "Win32") +elseif(TARGET_TRIPLET MATCHES "x64") + set(ARCH_DIR "x64") +else() + message("Architecture not supported") +endif() + +function(build_project PROJECT_PATH) + vcpkg_build_msbuild( + PROJECT_PATH ${PROJECT_PATH} + RELEASE_CONFIGURATION ${RELEASE_CONFIGURATION} + DEBUG_CONFIGURATION ${DEBUG_CONFIGURATION} + ) +endfunction(build_project) + + +build_project(${SOURCE_PATH}/win32/VS2015/celt.vcxproj) +build_project(${SOURCE_PATH}/win32/VS2015/silk_common.vcxproj) +build_project(${SOURCE_PATH}/win32/VS2015/silk_float.vcxproj) +build_project(${SOURCE_PATH}/win32/VS2015/silk_fixed.vcxproj) +build_project(${SOURCE_PATH}/win32/VS2015/opus.vcxproj) + + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + # Install release build + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${RELEASE_CONFIGURATION}/opus.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${RELEASE_CONFIGURATION}/celt.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${RELEASE_CONFIGURATION}/silk_common.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${RELEASE_CONFIGURATION}/silk_fixed.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${RELEASE_CONFIGURATION}/silk_float.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/) + + # Install debug build + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/opus.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/opus.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/celt.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/celt.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/silk_common.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/silk_common.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/silk_fixed.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/silk_fixed.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/silk_float.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/silk_float.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) +else() + # Install release build + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${RELEASE_CONFIGURATION}/opus.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${RELEASE_CONFIGURATION}/opus.dll DESTINATION ${CURRENT_PACKAGES_DIR}/bin/) + + # Install debug build + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/opus.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/opus.dll DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/opus.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin/) +endif() + +# Install headers +file(INSTALL ${SOURCE_PATH}/include DESTINATION ${CURRENT_PACKAGES_DIR}/include RENAME opus) + +# Handle copyright +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/opus RENAME copyright) -- cgit v1.2.3 From 41942fa9b75e30a155abf238bad737f953ada610 Mon Sep 17 00:00:00 2001 From: codicodi Date: Sun, 29 Jan 2017 18:32:50 +0100 Subject: add atk --- ports/atk/CMakeLists.txt | 129 +++++++++++++++++++++++++++++++++++++++++++++++ ports/atk/CONTROL | 4 ++ ports/atk/portfile.cmake | 28 ++++++++++ 3 files changed, 161 insertions(+) create mode 100644 ports/atk/CMakeLists.txt create mode 100644 ports/atk/CONTROL create mode 100644 ports/atk/portfile.cmake diff --git a/ports/atk/CMakeLists.txt b/ports/atk/CMakeLists.txt new file mode 100644 index 000000000..3762ee27f --- /dev/null +++ b/ports/atk/CMakeLists.txt @@ -0,0 +1,129 @@ +cmake_minimum_required(VERSION 3.0) +project(atk) + +set(ATK_LIB_SUFFIX 1.0) +set(ATK_DLL_SUFFIX 1) +set(GLIB_LIB_VERSION 2.0) + +if(BUILD_SHARED_LIBS) + set(ATK_EXPORT_MACRO DLL_EXPORT) +endif() + +# generate atkmarshal.c and atkmarshal.h source files +# glib-genmarshal should be installed along with glib +if(NOT EXISTS ${CMAKE_SOURCE_DIR}/atk/atkmarshal.h OR NOT EXISTS ${CMAKE_SOURCE_DIR}/atk/atkmarshal.c) + find_program(GLIB_GENMARSHAL glib-genmarshal PATH_SUFFIXES glib) + execute_process( + COMMAND ${GLIB_GENMARSHAL} --prefix=atk_marshal atkmarshal.list --header + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/atk + OUTPUT_FILE ${CMAKE_SOURCE_DIR}/atk/atkmarshal.h) + execute_process( + COMMAND ${GLIB_GENMARSHAL} --prefix=atk_marshal atkmarshal.list --body + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/atk + OUTPUT_FILE ${CMAKE_SOURCE_DIR}/atk/atkmarshal.c) +endif() + +configure_file(config.h.win32 ${CMAKE_SOURCE_DIR}/config.h COPYONLY) +add_definitions(-DHAVE_CONFIG_H) +include_directories(. ./atk) + +find_path(GLIB_INCLUDE_DIR glib.h) +find_library(GLIB_GLIB_LIBRARY glib-${GLIB_LIB_VERSION}) +find_library(GLIB_GOBJECT_LIBRARY gobject-${GLIB_LIB_VERSION}) +find_library(GLIB_GMODULE_LIBRARY gmodule-${GLIB_LIB_VERSION}) +set(GLIB_LIBRARIES ${GLIB_GLIB_LIBRARY} ${GLIB_GOBJECT_LIBRARY} ${GLIB_GMODULE_LIBRARY}) + +find_path(LIBINTL_INCLUDE_DIR libintl.h) +find_library(LIBINTL_LIBRARY NAMES libintl intl) + +set(ATK_SOURCES + atk/atkaction.c + atk/atkcomponent.c + atk/atkdocument.c + atk/atkeditabletext.c + atk/atkgobjectaccessible.c + atk/atkhyperlink.c + atk/atkhyperlinkimpl.c + atk/atkhypertext.c + atk/atkimage.c + atk/atknoopobject.c + atk/atknoopobjectfactory.c + atk/atkobject.c + atk/atkobjectfactory.c + atk/atkplug.c + atk/atkprivate.c + atk/atkrange.c + atk/atkregistry.c + atk/atkrelation.c + atk/atkrelationset.c + atk/atkselection.c + atk/atksocket.c + atk/atkstate.c + atk/atkstateset.c + atk/atkstreamablecontent.c + atk/atktable.c + atk/atktablecell.c + atk/atktext.c + atk/atkutil.c + atk/atkmisc.c + atk/atkvalue.c + atk/atkversion.c + atk/atkwindow.c + atk/atk-enum-types.c) + +add_library(atk ${ATK_SOURCES}) +target_compile_definitions(atk PRIVATE ATK_COMPILATION ${ATK_EXPORT_MACRO} G_DISABLE_SINGLE_INCLUDES ATK_LOCALEDIR="/dummy/share/locale") +target_link_libraries(atk ${LIBINTL_LIBRARY} ${GLIB_LIBRARIES}) +target_include_directories(atk PRIVATE ${GLIB_INCLUDE_DIR} ${LIBINTL_INCLUDE_DIR}) + +set_target_properties(atk PROPERTIES + OUTPUT_NAME atk-${ATK_DLL_SUFFIX} + ARCHIVE_OUTPUT_NAME atk-${ATK_LIB_SUFFIX}) + +install(TARGETS atk RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) + +if(NOT ATK_SKIP_HEADERS) + install(FILES + atk/atk.h + atk/atkaction.h + atk/atkcomponent.h + atk/atkdocument.h + atk/atkeditabletext.h + atk/atkgobjectaccessible.h + atk/atkhyperlink.h + atk/atkhyperlinkimpl.h + atk/atkhypertext.h + atk/atknoopobject.h + atk/atknoopobjectfactory.h + atk/atkobject.h + atk/atkobjectfactory.h + atk/atkplug.h + atk/atkimage.h + atk/atkrange.h + atk/atkregistry.h + atk/atkrelation.h + atk/atkrelationtype.h + atk/atkrelationset.h + atk/atkselection.h + atk/atksocket.h + atk/atkstate.h + atk/atkstateset.h + atk/atkstreamablecontent.h + atk/atktable.h + atk/atktablecell.h + atk/atktext.h + atk/atkutil.h + atk/atkmisc.h + atk/atkvalue.h + atk/atkwindow.h + atk/atkversion.h + atk/atk-enum-types.h + atk/atkversion.h + DESTINATION include/atk) +endif() + +message(STATUS "Link-time dependencies:") +message(STATUS " " ${LIBINTL_LIBRARY}) +foreach(GL ${GLIB_LIBRARIES}) + message(STATUS " " ${GL}) +endforeach() diff --git a/ports/atk/CONTROL b/ports/atk/CONTROL new file mode 100644 index 000000000..7ac71a0c3 --- /dev/null +++ b/ports/atk/CONTROL @@ -0,0 +1,4 @@ +Source: atk +Version: 2.22.0 +Description: GNOME Accessibility Toolkit +Build-Depends: glib, gettext diff --git a/ports/atk/portfile.cmake b/ports/atk/portfile.cmake new file mode 100644 index 000000000..08f4d6593 --- /dev/null +++ b/ports/atk/portfile.cmake @@ -0,0 +1,28 @@ +# ATK uses DllMain +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(STATUS "Warning: Static building not supported. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) +endif() + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/atk-2.22.0) +vcpkg_download_distfile(ARCHIVE + URLS "http://ftp.gnome.org/pub/GNOME/sources/atk/2.22/atk-2.22.0.tar.xz" + FILENAME "atk-2.22.0.tar.xz" + SHA512 af3f6197eb97de869ee706f19564449b02c1444c413e5418323e4bf4c8cf1d98c7c8baa25189f6879d63606d4bc75f33799cb901f4697c087e868bb9a5643cba +) +vcpkg_extract_source_archive(${ARCHIVE}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DCMAKE_PROGRAM_PATH=${CURRENT_INSTALLED_DIR}/tools/glib + OPTIONS_DEBUG + -DATK_SKIP_HEADERS=ON) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/atk) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/atk/COPYING ${CURRENT_PACKAGES_DIR}/share/atk/copyright) -- cgit v1.2.3 From 01c4540a774defebcafb426e4b34bbc9bfab99c9 Mon Sep 17 00:00:00 2001 From: codicodi Date: Sun, 29 Jan 2017 18:46:22 +0100 Subject: add pango --- ports/pango/CMakeLists.txt | 180 +++++++++++++++++++++++++++++++++++++++++++++ ports/pango/CONTROL | 4 + ports/pango/portfile.cmake | 26 +++++++ 3 files changed, 210 insertions(+) create mode 100644 ports/pango/CMakeLists.txt create mode 100644 ports/pango/CONTROL create mode 100644 ports/pango/portfile.cmake diff --git a/ports/pango/CMakeLists.txt b/ports/pango/CMakeLists.txt new file mode 100644 index 000000000..d290d1332 --- /dev/null +++ b/ports/pango/CMakeLists.txt @@ -0,0 +1,180 @@ +cmake_minimum_required(VERSION 3.0) +project(pango) + +set(PANGO_LIB_SUFFIX 1.0) +set(PANGO_DLL_SUFFIX 1) +set(GLIB_LIB_VERSION 2.0) + +configure_file(./config.h.win32 ${CMAKE_SOURCE_DIR}/config.h COPYONLY) +add_definitions(-DHAVE_CONFIG_H) +include_directories(. ./pango) + +# find libintl +find_path(LIBINTL_INCLUDE_DIR libintl.h) +find_library(LIBINTL_LIBRARY NAMES libintl intl) + +# find glib +find_path(GLIB_INCLUDE_DIR glib.h) +find_library(GLIB_GLIB_LIBRARY glib-${GLIB_LIB_VERSION}) +find_library(GLIB_GOBJECT_LIBRARY gobject-${GLIB_LIB_VERSION}) +find_library(GLIB_GMODULE_LIBRARY gmodule-${GLIB_LIB_VERSION}) +set(GLIB_LIBRARIES ${GLIB_GLIB_LIBRARY} ${GLIB_GOBJECT_LIBRARY} ${GLIB_GMODULE_LIBRARY}) + +# find cairo +find_path(CAIRO_INCLUDE_DIR cairo.h) +if(CMAKE_BUILD_TYPE STREQUAL Debug) + set(CAIRO_SUFFIX d) +endif() +find_library(CAIRO_LIBRARY cairo${CAIRO_SUFFIX}) +find_library(CAIRO_GOBJECT_LIBRARY cairo-gobject${CAIRO_SUFFIX}) +set(CAIRO_LIBRARIES ${CAIRO_LIBRARY} ${CAIRO_GOBJECT_LIBRARY}) + +# find fontconfig +find_path(FONTCONFIG_INCLUDE_DIR fontconfig/fontconfig.h) +find_library(FONTCONFIG_LIBRARY fontconfig) + +# find freetype +find_path(FREETYPE_INCLUDE_DIR ft2build.h) +if(CMAKE_BUILD_TYPE STREQUAL Debug) + set(FT_SUFFIX d) +endif() +find_library(FREETYPE_LIBRARY freetype${FT_SUFFIX}) + +# find harfbuzz +find_path(HARFBUZZ_INCLUDE_DIR harfbuzz/hb.h) +find_library(HARFBUZZ_LIBRARY harfbuzz) + +set(FONT_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIR} ${FONTCONFIG_INCLUDE_DIR} ${HARFBUZZ_INCLUDE_DIR}/harfbuzz) +set(FONT_LIBRARIES ${FREETYPE_LIBRARY} ${FONTCONFIG_LIBRARY} ${HARFBUZZ_LIBRARY}) + +macro(pango_add_module MODULE_NAME) + add_library(${MODULE_NAME} ${ARGN}) + target_include_directories(${MODULE_NAME} PRIVATE ${GLIB_INCLUDE_DIR} ${LIBINTL_INCLUDE_DIR}) + target_link_libraries(${MODULE_NAME} ${LIBINTL_LIBRARY} ${GLIB_LIBRARIES}) + target_compile_definitions(${MODULE_NAME} PRIVATE + G_LOG_DOMAIN="Pango" PANGO_ENABLE_BACKEND PANGO_ENABLE_ENGINE + G_DISABLE_SINGLE_INCLUDES SYSCONFDIR="/dummy/etc" LIBDIR="/dummy/lib") + target_compile_definitions(${MODULE_NAME} PRIVATE HAVE_CAIRO_FREETYPE=1) + set_target_properties(${MODULE_NAME} PROPERTIES + OUTPUT_NAME ${MODULE_NAME}-${PANGO_DLL_SUFFIX} + ARCHIVE_OUTPUT_NAME ${MODULE_NAME}-${PANGO_LIB_SUFFIX}) + install(TARGETS ${MODULE_NAME} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) +endmacro() + +pango_add_module(pango + pango/break-arabic.c + pango/break-indic.c + pango/mini-fribidi/fribidi.c + pango/mini-fribidi/fribidi_char_type.c + pango/mini-fribidi/fribidi_types.c + pango/break.c + pango/ellipsize.c + pango/fonts.c + pango/glyphstring.c + pango/modules.c + pango/pango-attributes.c + pango/pango-bidi-type.c + pango/pango-color.c + pango/pango-context.c + pango/pango-coverage.c + pango/pango-engine.c + pango/pango-fontmap.c + pango/pango-fontset.c + pango/pango-glyph-item.c + pango/pango-gravity.c + pango/pango-item.c + pango/pango-language.c + pango/pango-layout.c + pango/pango-markup.c + pango/pango-matrix.c + pango/pango-renderer.c + pango/pango-script.c + pango/pango-tabs.c + pango/pango-utils.c + pango/reorder-items.c + pango/shape.c + pango/pango-enum-types.c) + +pango_add_module(pangowin32 + pango/pangowin32.c + pango/pangowin32-fontcache.c + pango/pangowin32-fontmap.c + pango/pangowin32-shape.c) +target_link_libraries(pangowin32 usp10 pango) + +pango_add_module(pangoft2 + pango/pangofc-font.c + pango/pangofc-fontmap.c + pango/pangofc-decoder.c + pango/pangofc-shape.c + pango/pangoft2.c + pango/pangoft2-fontmap.c + pango/pangoft2-render.c + pango/pango-ot-buffer.c + pango/pango-ot-info.c + pango/pango-ot-ruleset.c + pango/pango-ot-tag.c) +target_link_libraries(pangoft2 pango ${FONT_LIBRARIES}) +target_include_directories(pangoft2 PRIVATE ${FONT_INCLUDE_DIRS}) + +pango_add_module(pangocairo + pango/pangocairo-fcfont.c + pango/pangocairo-fcfontmap.c + pango/pangocairo-win32font.c + pango/pangocairo-win32fontmap.c + pango/pangocairo-context.c + pango/pangocairo-font.c + pango/pangocairo-fontmap.c + pango/pangocairo-render.c) +target_link_libraries(pangocairo ${CAIRO_LIBRARIES} pango pangowin32 pangoft2 ${FONT_LIBRARIES}) +target_include_directories(pangocairo PRIVATE ${CAIRO_INCLUDE_DIR} ${FONT_INCLUDE_DIRS}) + +if(NOT PANGO_SKIP_HEADERS) + install(FILES + pango/pango.h + pango/pango-attributes.h + pango/pango-bidi-type.h + pango/pango-break.h + pango/pango-context.h + pango/pango-coverage.h + pango/pango-engine.h + pango/pango-font.h + pango/pango-fontmap.h + pango/pango-fontset.h + pango/pango-glyph.h + pango/pango-glyph-item.h + pango/pango-gravity.h + pango/pango-item.h + pango/pango-language.h + pango/pango-layout.h + pango/pango-matrix.h + pango/pango-modules.h + pango/pango-renderer.h + pango/pango-script.h + pango/pango-tabs.h + pango/pango-types.h + pango/pango-utils.h + pango/pango-version-macros.h + pango/pangocairo.h + pango/pangowin32.h + pango/pango-features.h + pango/pango-enum-types.h + pango/pangofc-decoder.h + pango/pangofc-font.h + pango/pangofc-fontmap.h + pango/pango-ot.h + pango/pangoft2.h + DESTINATION include/pango) +endif() + +message(STATUS "Link-time dependencies:") +message(STATUS " " ${LIBINTL_LIBRARY}) +foreach(GL ${GLIB_LIBRARIES}) + message(STATUS " " ${GL}) +endforeach() +foreach(CL ${CAIRO_LIBRARIES}) + message(STATUS " " ${CL}) +endforeach() +foreach(FL ${FONT_LIBRARIES}) + message(STATUS " " ${FL}) +endforeach() diff --git a/ports/pango/CONTROL b/ports/pango/CONTROL new file mode 100644 index 000000000..b763f25e8 --- /dev/null +++ b/ports/pango/CONTROL @@ -0,0 +1,4 @@ +Source: pango +Version: 1.40.3 +Description: Text and font handling library. +Build-Depends: glib, gettext, cairo, fontconfig, freetype, harfbuzz diff --git a/ports/pango/portfile.cmake b/ports/pango/portfile.cmake new file mode 100644 index 000000000..07dfc6929 --- /dev/null +++ b/ports/pango/portfile.cmake @@ -0,0 +1,26 @@ + +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(STATUS "Warning: Static building not supported. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) +endif() + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/pango-1.40.3) +vcpkg_download_distfile(ARCHIVE + URLS "http://ftp.gnome.org/pub/GNOME/sources/pango/1.40/pango-1.40.3.tar.xz" + FILENAME "pango-1.40.3.tar.xz" + SHA512 ff82395e8487624dffe212975b72b3383dcebb197a8675c8b409665e3e2e30fc23d9a6c25c3129a115adb7182b2a71a49550dbe881eb7ee9bbc572de6ba18d27) + +vcpkg_extract_source_archive(${ARCHIVE}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS_DEBUG + -DPANGO_SKIP_HEADERS=ON) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/pango) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/pango/COPYING ${CURRENT_PACKAGES_DIR}/share/pango/copyright) -- cgit v1.2.3 From d1595aca30c03c7bfa13eb433cae6a35e7d87de4 Mon Sep 17 00:00:00 2001 From: Scott Date: Sun, 29 Jan 2017 15:38:44 -0800 Subject: Fixed incorrect naming of files Reverting the naming to stick with how the FLTK library naturally decided to name their files. There was an error in the renaming where the incorrect libraries were being renamed. Reverting this fixes build linking issues --- ports/fltk/portfile.cmake | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/ports/fltk/portfile.cmake b/ports/fltk/portfile.cmake index 848096dce..261a03c7f 100644 --- a/ports/fltk/portfile.cmake +++ b/ports/fltk/portfile.cmake @@ -48,25 +48,7 @@ file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fltk-config) vcpkg_copy_pdbs() if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_formsd.lib) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_gld.lib) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_imagesd.lib) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fltkd.lib) - - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_forms_SHAREDd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_formsd.lib) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_gl_SHAREDd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_gld.lib) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_images_SHAREDd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_imagesd.lib) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_SHAREDd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/fltkd.lib) - - file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/fltk_forms.lib) - file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/fltk_gl.lib) - file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/fltk_images.lib) - file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/fltk.lib) - - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/fltk_forms_SHARED.lib ${CURRENT_PACKAGES_DIR}/lib/fltk_forms.lib) - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/fltk_gl_SHARED.lib ${CURRENT_PACKAGES_DIR}/lib/fltk_gl.lib) - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/fltk_images_SHARED.lib ${CURRENT_PACKAGES_DIR}/lib/fltk_images.lib) - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/fltk_SHARED.lib ${CURRENT_PACKAGES_DIR}/lib/fltk.lib) + else() file(REMOVE_RECURSE @@ -77,11 +59,6 @@ else() endif() -file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_formsd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_forms.lib) -file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_gld.lib ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_gl.lib) -file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_imagesd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_images.lib) -file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fltkd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/fltk.lib) - file(INSTALL -- cgit v1.2.3 From 798ae24d96edba63917a769ec196e555385af4dc Mon Sep 17 00:00:00 2001 From: agadoul Date: Mon, 30 Jan 2017 14:35:38 +0100 Subject: use induced library type. --- ports/lcms/CMakeLists.txt | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/ports/lcms/CMakeLists.txt b/ports/lcms/CMakeLists.txt index 85807a0b9..ccb8b6f5a 100644 --- a/ports/lcms/CMakeLists.txt +++ b/ports/lcms/CMakeLists.txt @@ -4,11 +4,6 @@ project(lcms) option(SHARED_LIBRARY "use shared library" ON) -set(LIBRARY_TYPE STATIC) -if(SHARED_LIBRARY) - set(LIBRARY_TYPE SHARED) -endif(SHARED_LIBRARY) - set(SRCS "src/cmstypes.c" "src/cmsvirt.c" @@ -47,9 +42,7 @@ include_directories( "./include" ) -add_library(lcms ${LIBRARY_TYPE} -${SRCS} -) +add_library(lcms ${SRCS}) if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL ) -- cgit v1.2.3 From 4ef429dd9e687f80f9f30042263d817984a10097 Mon Sep 17 00:00:00 2001 From: agadoul Date: Mon, 30 Jan 2017 15:22:39 +0100 Subject: implment reviews. --- ports/lcms/CMakeLists.txt | 6 ++---- ports/lcms/portfile.cmake | 10 +++++++--- ports/lcms/shared.patch | 10 ++++++++++ 3 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 ports/lcms/shared.patch diff --git a/ports/lcms/CMakeLists.txt b/ports/lcms/CMakeLists.txt index ccb8b6f5a..0fedfb95e 100644 --- a/ports/lcms/CMakeLists.txt +++ b/ports/lcms/CMakeLists.txt @@ -2,8 +2,6 @@ cmake_minimum_required(VERSION 3.5) project(lcms) -option(SHARED_LIBRARY "use shared library" ON) - set(SRCS "src/cmstypes.c" "src/cmsvirt.c" @@ -44,7 +42,7 @@ include_directories( add_library(lcms ${SRCS}) -if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL ) +if(NOT SKIP_INSTALL_HEADERS ) install(FILES "./include/lcms2.h" @@ -52,7 +50,7 @@ if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL ) DESTINATION include ) -endif(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL ) +endif(NOT SKIP_INSTALL_HEADERS ) install(TARGETS lcms EXPORT lcms_EXPORT RUNTIME DESTINATION bin diff --git a/ports/lcms/portfile.cmake b/ports/lcms/portfile.cmake index 5c6926071..4487cce6a 100644 --- a/ports/lcms/portfile.cmake +++ b/ports/lcms/portfile.cmake @@ -3,7 +3,6 @@ set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/lcms2-2.8) vcpkg_download_distfile(ARCHIVE URLS "https://sourceforge.net/projects/lcms/files/lcms/2.8/lcms2-2.8.tar.gz/download" - #URLS "C:/Users/d3r55d/Downloads/lcms2-2.8.tar.gz" FILENAME "lcms2-2.8.tar.gz" SHA512 a9478885b4892c79314a2ef9ab560e6655ac8f2d17abae0805e8b871138bb190e21f0e5c805398449f9dad528dc50baaf9e3cce8b8158eb8ff74179be5733f8f ) @@ -18,8 +17,6 @@ endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} - OPTIONS - -DSHARED_LIBRARY=${USE_SHARED_LIBRARY} OPTIONS_DEBUG -DSKIP_INSTALL_HEADERS=ON ) @@ -29,3 +26,10 @@ vcpkg_install_cmake() file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/lcms RENAME copyright) vcpkg_copy_pdbs() + +#patch header files to fix import/export issues +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include + PATCHES "${CMAKE_CURRENT_LIST_DIR}/shared.patch") +endif(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) diff --git a/ports/lcms/shared.patch b/ports/lcms/shared.patch new file mode 100644 index 000000000..b3e7bf75f --- /dev/null +++ b/ports/lcms/shared.patch @@ -0,0 +1,10 @@ +--- lcms2.h Wed Jul 20 08:46:01 2016 ++++ lcms2.h Mon Jan 30 15:01:12 2017 +@@ -212,6 +212,7 @@ + + #endif // CMS_USE_BIG_ENDIAN + ++#define CMS_DLL_BUILD + + // Calling convention -- this is hardly platform and compiler dependent + #ifdef CMS_IS_WINDOWS_ -- cgit v1.2.3 From 90fe56b0156a178b6b5d56f87fa7d4bc68d746ab Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Mon, 30 Jan 2017 14:12:08 -0800 Subject: uwp builds need _CRT_SECURE_NO_WARNINGS and others defined --- ports/bzip2/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ports/bzip2/CMakeLists.txt b/ports/bzip2/CMakeLists.txt index 9f9737da3..d5407cc5f 100644 --- a/ports/bzip2/CMakeLists.txt +++ b/ports/bzip2/CMakeLists.txt @@ -20,6 +20,12 @@ if(BUILD_SHARED_LIBS) target_compile_definitions(libbz2 PRIVATE -DBZ_BUILD_DLL) endif() +if(MSVC) + add_definitions(-D_CRT_SECURE_NO_WARNINGS) + add_definitions(-D_CRT_SECURE_NO_DEPRECATE) + add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) +endif() + install(TARGETS libbz2 RUNTIME DESTINATION bin ARCHIVE DESTINATION lib -- cgit v1.2.3 From 29b4c68f1d16ece3dec9f2bb65f875c914122918 Mon Sep 17 00:00:00 2001 From: Eric Mittelette Date: Mon, 30 Jan 2017 14:17:19 -0800 Subject: add VS2017 in pre requisite --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 78470dd0c..1026e2129 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,8 @@ For short description of available commands, run `vcpkg help`. ## Quick Start Prerequisites: -- Visual Studio 2015 Update 3 +- Visual Studio 2015 Update 3 or +- Visual Studio 2017 - `git.exe` available in your path Clone this repository, then run -- cgit v1.2.3 From e916d52345b5bf6900e48dd48d1d090767326017 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 30 Jan 2017 17:22:46 -0800 Subject: [openssl] Update UWP/WinRT to 1.0.2k --- ports/openssl/CONTROL | 2 +- ports/openssl/portfile-uwp.cmake | 12 +-- ports/openssl/setVSvars.bat | 185 --------------------------------------- 3 files changed, 5 insertions(+), 194 deletions(-) delete mode 100644 ports/openssl/setVSvars.bat diff --git a/ports/openssl/CONTROL b/ports/openssl/CONTROL index 2486f0358..6fb520404 100644 --- a/ports/openssl/CONTROL +++ b/ports/openssl/CONTROL @@ -1,3 +1,3 @@ Source: openssl -Version: 1.0.2k-1 +Version: 1.0.2k-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. diff --git a/ports/openssl/portfile-uwp.cmake b/ports/openssl/portfile-uwp.cmake index f4a0a716b..289c549fc 100644 --- a/ports/openssl/portfile-uwp.cmake +++ b/ports/openssl/portfile-uwp.cmake @@ -26,16 +26,16 @@ endif() include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/openssl-OpenSSL_1_0_2j_WinRT) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/openssl-OpenSSL_1_0_2k_WinRT) vcpkg_find_acquire_program(PERL) get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) set(ENV{PATH} "${PERL_EXE_PATH};$ENV{PATH}") vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/Microsoft/openssl/archive/OpenSSL_1_0_2j_WinRT.zip" - FILENAME "openssl-microsoft-1.0.2j_WinRT.zip" - SHA512 0860d1f5fca7b1345870e866d7bb78f14672c5bb63c56bb04360ee891be542b4b56625ab971ef9b304b792b6cf36c9508bfd812c4a133f6ba8bafdde5e2f8fcf + URLS "https://github.com/Microsoft/openssl/archive/OpenSSL_1_0_2k_WinRT.zip" + FILENAME "openssl-microsoft-1.0.2k_WinRT.zip" + SHA512 afb434ef69c399f690f7ce723fabb228f77a12428f19062c5df3b8b841a2a7881c01150fdcfd2fab23867e3963292874a08ad227b37d168907b507fb1d7fede7 ) vcpkg_extract_source_archive(${ARCHIVE}) @@ -44,10 +44,6 @@ file(REMOVE_RECURSE ${SOURCE_PATH}/tmp32dll) file(REMOVE_RECURSE ${SOURCE_PATH}/out32dll) file(REMOVE_RECURSE ${SOURCE_PATH}/inc32dll) -file(COPY -${CMAKE_CURRENT_LIST_DIR}/setVSvars.bat -DESTINATION ${SOURCE_PATH}/ms) - file(COPY ${CMAKE_CURRENT_LIST_DIR}/make-openssl.bat DESTINATION ${SOURCE_PATH}) diff --git a/ports/openssl/setVSvars.bat b/ports/openssl/setVSvars.bat deleted file mode 100644 index e6ebc0a7d..000000000 --- a/ports/openssl/setVSvars.bat +++ /dev/null @@ -1,185 +0,0 @@ -@echo off -call:set_%1 -exit /b -:set_universal10.0Win32 - call:setVar _VS14VC VisualStudio14VC - call "%_VS14VC%vcvarsall" x86 store - set _VCPlatform=x86 - set _VCLibPlat= - call:setEnv - goto :eof - -:set_universal10.0x64 - call:setVar _VS14VC VisualStudio14VC - call "%_VS14VC%vcvarsall" x64 store - set _VCPlatform=x64 - set _VCLibPlat=amd64 - call:setEnv - goto :eof - -:set_universal10.0arm - call:setVar _VS14VC VisualStudio14VC - call "%_VS14VC%vcvarsall" x86_arm store - set _VCPlatform=ARM - set _VCLibPlat=ARM - call:setEnv - goto :eof - -:set_universal10.0arm64 - call:setVar _VS14VC VisualStudio14VC - call "%_VS14VC%vcvarsall" x86_arm64 store - set _VCPlatform=ARM64 - set _VCLibPlat=ARM64 - call:setEnv - goto :eof - -:set_wp8.1arm - call:setVar _VS12VC VisualStudio12VC - call:setVar _WPKITS81 WindowsPhoneKits8.1 - call:setVar _VS14VC VisualStudio14VC - call "%_VS12VC%\vcvarsall" x86_arm - set PATH=%_VS12VC\Bin%;%PATH% - set INCLUDE=%_WPKITS81%\Include;%_WPKITS81%\Include\abi;%_WPKITS81%\Include\mincore;%_WPKITS81%\Include\minwin;%_WPKITS81%\Include\wrl;%INCLUDE% - set LIB=%_WPKITS81%\lib\ARM;%_VS12VC%\lib\store\ARM; - set LIBPATH=%LIBPATH%;%_VS12VC%\vcpackages;%WindowsSDK_ExecutablePath_x86%\..\..\Tools\MDILXAPCompile\WinMDs;%_VS14VC%\vcpackages; - goto :eof - -:set_wp8.1Win32 - call:setVar _VS12VC VisualStudio12VC - call:setVar _WPKITS81 WindowsPhoneKits8.1 - call:setVar _VS14VC VisualStudio14VC - call "%_VS12VC%\vcvarsall" x86 - set INCLUDE=%_WPKITS81%\Include;%_WPKITS81%\Include\abi;%_WPKITS81%\Include\mincore;%_WPKITS81%\Include\minwin;%_WPKITS81%\Include\wrl;%INCLUDE% - set LIB=%_WPKITS81%\lib\x86;%_VS12VC%\lib\store; - set LIBPATH=%LIBPATH%;%_VS12VC%\vcpackages;%WindowsSDK_ExecutablePath_x86%\..\..\Tools\MDILXAPCompile\WinMDs;%_VS14VC%\vcpackages; - goto :eof - -:set_wp8.0arm - call:setVar _VS11VC VisualStudio11VC - call:setVar _WPKITS80 WindowsPhoneKits8.0 - call "%_VS11VC%\WPSDK\WP80\vcvarsphoneall.bat" x86_arm - goto :eof - -:set_wp8.0Win32 - call:setVar _VS11VC VisualStudio11VC - call:setVar _WPKITS80 WindowsPhoneKits8.0 - call "%_VS11VC%\WPSDK\WP80\vcvarsphoneall.bat" x86 - goto :eof - -:set_ws8.1Win32 - call:setVar _VS12VC VisualStudio12VC - call:setVar _WSKITS81 WindowsKits8.1 - call:setVar _VS14VC VisualStudio14VC - call "%_VS12VC%\vcvarsall" x86 - set INCLUDE=%_VS12VC%\include;%_VS12VC%\atlmfc\include;%_WSKITS81%\Include\um;%_WSKITS81%\Include\shared;%_WSKITS81%\Include\winrt; - set LIB=%_VS12VC%\lib\store;%_VS12VC%\atlmfc\lib;%_WSKITS81%\lib\winv6.3\um\x86; - set LIBPATH=%_WSKITS81%\References\CommonConfiguration\Neutral;%_VS12VC%\atlmfc\lib;%_VS12VC%\lib\store;%_VS12VC%\vcpackages;%WindowsSDK_ExecutablePath_x86%\..\..\Tools\MDILXAPCompile\WinMDs;%_VS14VC%\vcpackages; - goto :eof - -:set_ws8.1x64 - call:setVar _VS12VC VisualStudio12VC - call:setVar _WSKITS81 WindowsKits8.1 - call:setVar _VS14VC VisualStudio14VC - call "%_VS12VC%\vcvarsall" x64 - set INCLUDE=%_VS12VC%\include;%_VS12VC%\atlmfc\include;%_WSKITS81%\Include\um;%_WSKITS81%\Include\shared;%_WSKITS81%\Include\winrt; - set LIB=%_VS12VC%\lib\store\amd64;%_VS12VC%\atlmfc\lib\amd64;%_WSKITS81%\lib\winv6.3\um\x64; - set LIBPATH=%_WSKITS81%\References\CommonConfiguration\Neutral;%_VS12VC%\atlmfc\lib\amd64;%_VS12VC%\lib\store;%_VS12VC%\vcpackages;%WindowsSDK_ExecutablePath_x86%\..\..\Tools\MDILXAPCompile\WinMDs;%_VS14VC%\vcpackages; - goto :eof - -:set_ws8.1arm - call:setVar _VS12VC VisualStudio12VC - call:setVar _WSKITS81 WindowsKits8.1 - call:setVar _VS14VC VisualStudio14VC - call "%_VS12VC%\vcvarsall" x86_arm - set INCLUDE=%_VS12VC%\include;%_VS12VC%\atlmfc\include;%_WSKITS81%\Include\um;%_WSKITS81%\Include\shared;%_WSKITS81%\Include\winrt; - set LIB=%_VS12VC%\lib\store\arm;%_VS12VC%\atlmfc\lib\arm;%_WSKITS81%\lib\winv6.3\um\arm; - set LIBPATH=%_WSKITS81%\References\CommonConfiguration\Neutral;%_VS12VC%\atlmfc\lib\arm;%_VS12VC%\lib\store;%_VS12VC%\vcpackages;%WindowsSDK_ExecutablePath_x86%\..\..\Tools\MDILXAPCompile\WinMDs;%_VS14VC%\vcpackages; - goto :eof - -:setVar - call:set%1 - if "!%1!"=="" echo warning: could not locate %2 - goto :eof - -:setRegVar - for /F "usebackq tokens=2*" %%A IN (`reg query %1 /v %2 2^>nul`) do ( - set %3=%%B - ) - goto :eof - -:setAppend - if exist %1%2 set %3=%1%2 - goto :eof - -:set_VS11VC - if not "%_VS11VC%"=="" goto :eof - call:setRegVar "HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0_Config\Setup\VC" ProductDir _VS11VC - if not "%_VS11VC%"=="" goto :eof - call:setRegVar "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\11.0\Setup\VC" ProductDir _VS11VC - if not "%_VS11VC%"=="" goto :eof - call:setAppend VSSDK110Install \..\VC _VS11VC - if not "%_VS11VC%"=="" goto :eof - call:setAppend VS110COMNTOOLS \..\..\VC _VS11VC - goto :eof - -:set_VS12VC - if not "%_VS12VC%"=="" goto :eof - call:setRegVar "HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0_Config\Setup\VC" ProductDir _VS12VC - if not "%_VS12VC%"=="" goto :eof - call:setRegVar "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0\Setup\VC" ProductDir _VS12VC - if not "%_VS12VC%"=="" goto :eof - call:setAppend VSSDK120Install \..\VC _VS12VC - if not "%_VS12VC%"=="" goto :eof - call:setAppend VS120COMNTOOLS \..\..\VC _VS12VC - goto :eof - -:set_VS14VC - if not "%_VS14VC%"=="" goto :eof - call:setRegVar "HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0_Config\Setup\VC" ProductDir _VS14VC - if not "%_VS14VC%"=="" goto :eof - call:setRegVar "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\Setup\VC" ProductDir _VS14VC - if not "%_VS14VC%"=="" goto :eof - call:setAppend VSSDK140Install \..\VC _VS14VC - if not "%_VS14VC%"=="" goto :eof - call:setAppend VS140COMNTOOLS \..\..\VC _VS14VC - goto :eof - -:set_WPKITS80 - if not "%_WPKITS80%"=="" goto :eof - call:setRegVar "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows Phone\v8.0" InstallationFolder _WPKITS80 - if not "%_WPKITS80%"=="" goto :eof - goto :eof - -:set_WPKITS81 - if not "%_WPKITS81%"=="" goto :eof - call:setRegVar "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows Phone\v8.1" InstallationFolder _WPKITS81 - if not "%_WPKITS81%"=="" goto :eof - goto :eof - -:set_WSKITS81 - if not "%_WSKITS81%"=="" goto :eof - call:setRegVar "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots" KitsRoot81 _WSKITS81 - if not "%_WSKITS81%"=="" goto :eof - goto :eof - -:set_WKITS10 - if not "%_WKITS10%"=="" goto :eof - call:setRegVar "HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0" InstallationFolder _WKITS10 - if not "%_WKITS10%"=="" goto :eof - goto :eof - -:set_WKITS10VER - if not "%_WKITS10VER%"=="" goto :eof - call:setRegVar "HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0" ProductVersion _WKITS10VER - echo %_WKITS10VER% - if not "%_WKITS10VER%"=="" goto :eof - goto :eof - -:setEnv - call:setVar _VS14VC VisualStudio14VC - call:setVar _WKITS10 WindowsKits10.0 - set PATH=%_VS14VCBin%;%PATH% - set "LIBPATH=%_WKITS10%UnionMetadata\Facade;%_VS14VC%vcpackages;%_WKITS10%references\windows.foundation.foundationcontract\1.0.0.0\;%_WKITS10%references\windows.foundation.universalapicontract\1.0.0.0\" - goto :eof - -:end -- cgit v1.2.3 From 872332df343cf01a5b6309a41b1f9c84bcca1bf0 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 18:13:58 -0800 Subject: Remove doVcpkgRelease.ps1 --- scripts/doVcpkgRelease.ps1 | 84 ---------------------------------------------- 1 file changed, 84 deletions(-) delete mode 100644 scripts/doVcpkgRelease.ps1 diff --git a/scripts/doVcpkgRelease.ps1 b/scripts/doVcpkgRelease.ps1 deleted file mode 100644 index fb964d0c3..000000000 --- a/scripts/doVcpkgRelease.ps1 +++ /dev/null @@ -1,84 +0,0 @@ -[CmdletBinding()] -param( - -) -$ErrorActionPreference = "Stop" -$version = git show HEAD:toolsrc/VERSION.txt -#Remove the quotes from the string -$version = $version.Substring(1, $version.length - 2) -$versionRegex = '^\d+\.\d+\.\d+$' -if (!($version -match $versionRegex)) -{ - throw [System.ArgumentException] ("Expected version in the form d.d.d but was " + $version) -} - -Write-Verbose("New version is " + $version) -$gitTagString = "v$version" - -# Intentionally doesn't have ^ (=starts with) to match remote tags as well -$matchingTags = git tag | Where-Object {$_ -match "$gitTagString$"} -if ($matchingTags.Length -gt 0) -{ - throw [System.ArgumentException] ("Git tag matches existing tags: " + $matchingTags) -} - -$gitHash = git rev-parse HEAD -Write-Verbose("Git hash is " + $gitHash) - -$scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition -$vcpkgRootDir = & $scriptsDir\findFileRecursivelyUp.ps1 $scriptsDir .vcpkg-root -$gitStartOfHash = $gitHash.substring(0,6) -$versionWithStartOfHash = "$version-$gitStartOfHash" -$buildPath = "$vcpkgRootDir\build-$versionWithStartOfHash" -$releasePath = "$vcpkgRootDir\release-$versionWithStartOfHash" -Write-Verbose("Build Path " + $buildPath) -Write-Verbose("Release Path " + $releasePath) - -# 0 is metrics disabled, 1 is metrics enabled -for ($disableMetrics = 0; $disableMetrics -le 1; $disableMetrics++) -{ - - if (!(Test-Path $buildPath)) - { - New-Item -ItemType directory -Path $buildPath -force | Out-Null - } - - if (!(Test-Path $releasePath)) - { - New-Item -ItemType directory -Path $releasePath -force | Out-Null - } - - # Partial checkout for building vcpkg - $dotGitDir = "$vcpkgRootDir\.git" - $workTreeForBuildOnly = "$buildPath" - $checkoutForBuildOnly = ".\scripts",".\toolsrc",".vcpkg-root" # Must be relative to the root of the repository - Write-Verbose("Creating partial temporary checkout: $buildPath") - git --git-dir="$dotGitDir" --work-tree="$workTreeForBuildOnly" checkout $gitHash -f -q -- $checkoutForBuildOnly - git reset - - & "$buildPath\scripts\bootstrap.ps1" -disableMetrics $disableMetrics - - # Full checkout which will be a zip along with the executables from the previous step - $workTree = "$releasePath" - $checkoutThisDir = ".\" # Must be relative to the root of the repository - Write-Verbose("Creating temporary checkout: $releasePath") - git --git-dir=$dotGitDir --work-tree=$workTree checkout $gitHash -f -q -- $checkoutThisDir - git reset - - Copy-Item $buildPath\vcpkg.exe $releasePath\vcpkg.exe | Out-Null - Copy-Item $buildPath\scripts\vcpkgmetricsuploader.exe $releasePath\scripts\vcpkgmetricsuploader.exe | Out-Null - - Write-Verbose("Archiving") - $outputArchive = "$vcpkgRootDir\vcpkg-$versionWithStartOfHash.zip" - if ($disableMetrics -ne 0) - { - $outputArchive = "$vcpkgRootDir\vcpkg-$versionWithStartOfHash-external.zip" - } - Compress-Archive -Path "$releasePath\*" -CompressionLevel Optimal -DestinationPath $outputArchive -Force | Out-Null - - Write-Verbose("Removing temporary checkouts: $releasePath") - Remove-Item -recurse $buildPath | Out-Null - Remove-Item -recurse $releasePath | Out-Null - - Write-Verbose("Redistributable archive is: $outputArchive") -} \ No newline at end of file -- cgit v1.2.3 From a26c0288931f7fba284ef9bea5e7cbc655e127ba Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 30 Jan 2017 19:37:07 -0800 Subject: [vcpkg] Fixup 5d2f4485 --- toolsrc/src/commands_install.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index a8ddf35f4..69495bd62 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -153,7 +153,9 @@ namespace vcpkg::Commands::Install System::println(System::color::error, "The following files are already installed in %s and are in conflict with %s", triplet_install_path.generic_string(), binary_paragraph.spec); - Strings::join(intersection, "\n "); + System::print("\n "); + System::println(Strings::join(intersection, "\n ")); + System::println(""); exit(EXIT_FAILURE); } -- cgit v1.2.3 From ae3f4149ed67169c325626ad1a8e8f1efd5be956 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 30 Jan 2017 19:47:14 -0800 Subject: [fltk] Bump version to correspond with binary layout change --- ports/fltk/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/fltk/CONTROL b/ports/fltk/CONTROL index 4f8519550..985c6b1c0 100644 --- a/ports/fltk/CONTROL +++ b/ports/fltk/CONTROL @@ -1,4 +1,4 @@ Source: fltk -Version: 1.3.4-1 +Version: 1.3.4-2 Description: FLTK (pronounced fulltick) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X. FLTK provides modern GUI functionality without the bloat and supports 3D graphics via OpenGL and its built-in GLUT emulation. Build-Depends: zlib, libpng, libjpeg-turbo \ No newline at end of file -- cgit v1.2.3 From 9502d795bb325669df8e4e3b32f6ca60827813f1 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 26 Jan 2017 14:25:36 -0800 Subject: Move & rename remove_plan_type enum --- toolsrc/include/vcpkg_Dependencies.h | 8 ++++++++ toolsrc/src/commands_remove.cpp | 24 ++++++++++-------------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 4da9de694..1c49ccafd 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -26,5 +26,13 @@ namespace vcpkg::Dependencies install_plan_action plan; }; + enum class remove_plan_type + { + NOT_INSTALLED, + DEPENDENCIES_NOT_SATISFIED, + SHOULD_REMOVE + }; + + std::vector create_install_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); } diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index 4b53f4778..bf415d2c0 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -2,10 +2,13 @@ #include "vcpkglib.h" #include "vcpkg_System.h" #include "vcpkg_Input.h" +#include "vcpkg_Dependencies.h" #include namespace vcpkg::Commands::Remove { + using Dependencies::remove_plan_type; + static const std::string OPTION_PURGE = "--purge"; static void delete_directory(const fs::path& directory) @@ -22,14 +25,7 @@ namespace vcpkg::Commands::Remove } } - enum class deinstall_plan - { - not_installed, - dependencies_not_satisfied, - should_deinstall - }; - - static deinstall_plan deinstall_package_plan( + static remove_plan_type deinstall_package_plan( const StatusParagraphs::iterator package_it, const StatusParagraphs& status_db, std::vector& dependencies_out) @@ -38,7 +34,7 @@ namespace vcpkg::Commands::Remove if (package_it == status_db.end() || (*package_it)->state == install_state_t::not_installed) { - return deinstall_plan::not_installed; + return remove_plan_type::NOT_INSTALLED; } auto& pkg = (*package_it)->package; @@ -59,9 +55,9 @@ namespace vcpkg::Commands::Remove } if (!dependencies_out.empty()) - return deinstall_plan::dependencies_not_satisfied; + return remove_plan_type::DEPENDENCIES_NOT_SATISFIED; - return deinstall_plan::should_deinstall; + return remove_plan_type::SHOULD_REMOVE; } static void deinstall_package(const vcpkg_paths& paths, const package_spec& spec, StatusParagraphs& status_db) @@ -79,17 +75,17 @@ namespace vcpkg::Commands::Remove auto plan = deinstall_package_plan(package_it, status_db, deps); switch (plan) { - case deinstall_plan::not_installed: + case remove_plan_type::NOT_INSTALLED: System::println(System::color::success, "Package %s is not installed", spec); return; - case deinstall_plan::dependencies_not_satisfied: + case remove_plan_type::DEPENDENCIES_NOT_SATISFIED: System::println(System::color::error, "Error: Cannot remove package %s:", spec); for (auto&& dep : deps) { System::println(" %s depends on %s", dep->package.displayname(), pkg.package.displayname()); } exit(EXIT_FAILURE); - case deinstall_plan::should_deinstall: + case remove_plan_type::SHOULD_REMOVE: break; default: Checks::unreachable(); -- cgit v1.2.3 From cc81c3de6c74837dc146d7d3de73e4388cfc14dc Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 26 Jan 2017 17:52:54 -0800 Subject: [StatusParagraphs] Replace auto with actual type --- toolsrc/include/StatusParagraphs.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/toolsrc/include/StatusParagraphs.h b/toolsrc/include/StatusParagraphs.h index 7a0f2177d..11491cf4e 100644 --- a/toolsrc/include/StatusParagraphs.h +++ b/toolsrc/include/StatusParagraphs.h @@ -1,6 +1,7 @@ #pragma once #include "StatusParagraph.h" #include +#include namespace vcpkg { @@ -25,22 +26,22 @@ namespace vcpkg friend std::ostream& operator<<(std::ostream&, const StatusParagraphs&); - auto end() + iterator end() { return paragraphs.rend(); } - auto end() const + const_iterator end() const { return paragraphs.rend(); } - auto begin() + iterator begin() { return paragraphs.rbegin(); } - auto begin() const + const_iterator begin() const { return paragraphs.rbegin(); } -- cgit v1.2.3 From 33b46b1fee70996a23a7860f853e95ef80ff3978 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 26 Jan 2017 17:53:45 -0800 Subject: Create a remove plan. NOT used yet --- toolsrc/include/vcpkg_Dependencies.h | 16 +++++++++- toolsrc/src/commands_remove.cpp | 8 +++-- toolsrc/src/vcpkg_Dependencies.cpp | 58 ++++++++++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+), 3 deletions(-) diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 1c49ccafd..528abedfb 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -30,9 +30,23 @@ namespace vcpkg::Dependencies { NOT_INSTALLED, DEPENDENCIES_NOT_SATISFIED, - SHOULD_REMOVE + REMOVE, + REMOVE_USER_REQUESTED }; + struct remove_plan_action + { + remove_plan_type type; + std::unique_ptr bpgh; + }; + + struct package_spec_with_remove_plan + { + package_spec spec; + remove_plan_action plan; + }; std::vector create_install_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); + + std::vector create_remove_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); } diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index bf415d2c0..7b8286f9c 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -7,6 +7,7 @@ namespace vcpkg::Commands::Remove { + using Dependencies::package_spec_with_remove_plan; using Dependencies::remove_plan_type; static const std::string OPTION_PURGE = "--purge"; @@ -57,7 +58,7 @@ namespace vcpkg::Commands::Remove if (!dependencies_out.empty()) return remove_plan_type::DEPENDENCIES_NOT_SATISFIED; - return remove_plan_type::SHOULD_REMOVE; + return remove_plan_type::REMOVE; } static void deinstall_package(const vcpkg_paths& paths, const package_spec& spec, StatusParagraphs& status_db) @@ -85,7 +86,7 @@ namespace vcpkg::Commands::Remove System::println(" %s depends on %s", dep->package.displayname(), pkg.package.displayname()); } exit(EXIT_FAILURE); - case remove_plan_type::SHOULD_REMOVE: + case remove_plan_type::REMOVE: break; default: Checks::unreachable(); @@ -174,6 +175,9 @@ namespace vcpkg::Commands::Remove Input::check_triplets(specs, paths); bool alsoRemoveFolderFromPackages = options.find(OPTION_PURGE) != options.end(); + const std::vector remove_plan = Dependencies::create_remove_plan(paths, specs, status_db); + Checks::check_exit(!remove_plan.empty(), "Remove plan cannot be empty"); + for (const package_spec& spec : specs) { deinstall_package(paths, spec, status_db); diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp index 1daa6de02..4468930c4 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg_Dependencies.cpp @@ -5,6 +5,7 @@ #include "package_spec.h" #include "StatusParagraphs.h" #include +#include #include "vcpkg_Maps.h" #include "vcpkg_Files.h" #include "vcpkglib.h" @@ -72,4 +73,61 @@ namespace vcpkg::Dependencies } return ret; } + + std::vector create_remove_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db) + { + std::unordered_set specs_as_set(specs.cbegin(), specs.cend()); + + std::unordered_map was_examined; // Examine = we have checked its immediate (non-recursive) dependencies + Graphs::Graph graph; + graph.add_vertices(specs); + + std::vector examine_stack(specs); + while (!examine_stack.empty()) + { + const package_spec spec = examine_stack.back(); + examine_stack.pop_back(); + + if (was_examined.find(spec) != was_examined.end()) + { + continue; + } + + auto it = status_db.find(spec); + if (it == status_db.end() || (*it)->state == install_state_t::not_installed) + { + was_examined.emplace(spec, remove_plan_action{ remove_plan_type::NOT_INSTALLED, nullptr}); + continue; + } + + for (const std::unique_ptr& an_installed_package : status_db) + { + if (an_installed_package->want != want_t::install) + continue; + if (an_installed_package->package.spec.target_triplet() != spec.target_triplet()) + continue; + + const std::vector& deps = an_installed_package->package.depends; + if (std::find(deps.begin(), deps.end(), spec.name()) == deps.end()) + { + continue; + } + + graph.add_edge(spec, an_installed_package.get()->package.spec); + examine_stack.push_back(an_installed_package.get()->package.spec); + } + + const remove_plan_type type = specs_as_set.find(spec) != specs_as_set.end() ? remove_plan_type::REMOVE_USER_REQUESTED: remove_plan_type::REMOVE; + was_examined.emplace(spec, remove_plan_action{ type, std::make_unique(std::move((*it)->package))}); + } + + std::vector ret; + + const std::vector pkgs = graph.find_topological_sort(); + for (const package_spec& pkg : pkgs) + { + ret.push_back({ pkg, std::move(was_examined[pkg]) }); + } + return ret; + } } -- cgit v1.2.3 From 4ded91423aa1dfa3ad8bb7a57879f48d58b9b786 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 27 Jan 2017 12:45:54 -0800 Subject: Enable multiprocessor compilation for vcpkg itself --- toolsrc/vcpkg/vcpkg.vcxproj | 4 ++++ toolsrc/vcpkglib/vcpkglib.vcxproj | 4 ++++ toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj | 4 ++++ toolsrc/vcpkgtest/vcpkgtest.vcxproj | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/vcpkg/vcpkg.vcxproj index c256173e3..eea257e7d 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj +++ b/toolsrc/vcpkg/vcpkg.vcxproj @@ -73,6 +73,7 @@ true ..\include /std:c++latest %(AdditionalOptions) + true winhttp.lib;version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) @@ -85,6 +86,7 @@ true ..\include /std:c++latest %(AdditionalOptions) + true winhttp.lib;version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) @@ -100,6 +102,7 @@ ..\include _MBCS;NDEBUG;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) + true true @@ -117,6 +120,7 @@ ..\include _MBCS;NDEBUG;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) + true true diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index 0163fe173..cd220892f 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -77,6 +77,7 @@ ..\include DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) + true @@ -87,6 +88,7 @@ ..\include DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) + true @@ -99,6 +101,7 @@ ..\include DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;NDEBUG;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) + true true @@ -115,6 +118,7 @@ ..\include DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;NDEBUG;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) + true true diff --git a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj index c925a0b31..47687dbcf 100644 --- a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj +++ b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj @@ -73,6 +73,7 @@ true ..\include /std:c++latest %(AdditionalOptions) + true winhttp.lib;version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) @@ -85,6 +86,7 @@ true ..\include /std:c++latest %(AdditionalOptions) + true winhttp.lib;version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) @@ -100,6 +102,7 @@ ..\include _MBCS;NDEBUG;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) + true true @@ -117,6 +120,7 @@ ..\include _MBCS;NDEBUG;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) + true true diff --git a/toolsrc/vcpkgtest/vcpkgtest.vcxproj b/toolsrc/vcpkgtest/vcpkgtest.vcxproj index 0fb11eb30..263cd0658 100644 --- a/toolsrc/vcpkgtest/vcpkgtest.vcxproj +++ b/toolsrc/vcpkgtest/vcpkgtest.vcxproj @@ -97,6 +97,7 @@ true /std:c++latest %(AdditionalOptions) + true Windows @@ -113,6 +114,7 @@ true /std:c++latest %(AdditionalOptions) + true Windows @@ -131,6 +133,7 @@ true /std:c++latest %(AdditionalOptions) + true Windows @@ -151,6 +154,7 @@ true /std:c++latest %(AdditionalOptions) + true Windows -- cgit v1.2.3 From 050e4a0f7a8156bd862f95c06ea298ab6697e147 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 27 Jan 2017 12:49:09 -0800 Subject: Introduce precompiled headers --- toolsrc/include/pch.h | 38 +++++++++++++++++++++++++++++ toolsrc/src/BinaryParagraph.cpp | 1 + toolsrc/src/BuildInfo.cpp | 1 + toolsrc/src/MachineType.cpp | 1 + toolsrc/src/Paragraphs.cpp | 1 + toolsrc/src/SourceParagraph.cpp | 1 + toolsrc/src/StatusParagraph.cpp | 1 + toolsrc/src/StatusParagraphs.cpp | 2 +- toolsrc/src/Stopwatch.cpp | 1 + toolsrc/src/coff_file_reader.cpp | 4 +-- toolsrc/src/commands_available_commands.cpp | 1 + toolsrc/src/commands_build.cpp | 2 +- toolsrc/src/commands_build_external.cpp | 1 + toolsrc/src/commands_cache.cpp | 1 + toolsrc/src/commands_contact.cpp | 1 + toolsrc/src/commands_create.cpp | 1 + toolsrc/src/commands_edit.cpp | 1 + toolsrc/src/commands_hash.cpp | 1 + toolsrc/src/commands_help.cpp | 1 + toolsrc/src/commands_import.cpp | 2 +- toolsrc/src/commands_install.cpp | 1 + toolsrc/src/commands_integrate.cpp | 7 +----- toolsrc/src/commands_list.cpp | 1 + toolsrc/src/commands_owns.cpp | 1 + toolsrc/src/commands_portsdiff.cpp | 6 +---- toolsrc/src/commands_remove.cpp | 2 +- toolsrc/src/commands_search.cpp | 1 + toolsrc/src/commands_update.cpp | 1 + toolsrc/src/commands_version.cpp | 1 + toolsrc/src/metrics.cpp | 12 +-------- toolsrc/src/package_spec.cpp | 2 +- toolsrc/src/package_spec_parse_result.cpp | 4 +-- toolsrc/src/pch.cpp | 1 + toolsrc/src/post_build_lint.cpp | 3 +-- toolsrc/src/triplet.cpp | 2 +- toolsrc/src/vcpkg_Checks.cpp | 3 +-- toolsrc/src/vcpkg_Dependencies.cpp | 5 +--- toolsrc/src/vcpkg_Environment.cpp | 3 +-- toolsrc/src/vcpkg_Files.cpp | 3 +-- toolsrc/src/vcpkg_Input.cpp | 1 + toolsrc/src/vcpkg_Strings.cpp | 8 +----- toolsrc/src/vcpkg_System.cpp | 4 +-- toolsrc/src/vcpkg_cmd_arguments.cpp | 4 +-- toolsrc/src/vcpkg_info.cpp | 1 + toolsrc/src/vcpkg_paths.cpp | 1 + toolsrc/src/vcpkglib.cpp | 10 +------- toolsrc/src/vcpkglib_helpers.cpp | 3 +-- toolsrc/vcpkglib/vcpkglib.vcxproj | 15 ++++++++++++ toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 6 +++++ 49 files changed, 106 insertions(+), 69 deletions(-) create mode 100644 toolsrc/include/pch.h create mode 100644 toolsrc/src/pch.cpp diff --git a/toolsrc/include/pch.h b/toolsrc/include/pch.h new file mode 100644 index 000000000..48aca2b77 --- /dev/null +++ b/toolsrc/include/pch.h @@ -0,0 +1,38 @@ +#pragma once + +#define WIN32_LEAN_AND_MEAN +#define NOMINMAX +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include \ No newline at end of file diff --git a/toolsrc/src/BinaryParagraph.cpp b/toolsrc/src/BinaryParagraph.cpp index ad85a1f8a..eed87eb81 100644 --- a/toolsrc/src/BinaryParagraph.cpp +++ b/toolsrc/src/BinaryParagraph.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "BinaryParagraph.h" #include "vcpkglib_helpers.h" #include "vcpkg_Checks.h" diff --git a/toolsrc/src/BuildInfo.cpp b/toolsrc/src/BuildInfo.cpp index a45dc4b72..b401f9d44 100644 --- a/toolsrc/src/BuildInfo.cpp +++ b/toolsrc/src/BuildInfo.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "BuildInfo.h" #include "vcpkg_Checks.h" #include "vcpkglib_helpers.h" diff --git a/toolsrc/src/MachineType.cpp b/toolsrc/src/MachineType.cpp index 0115f3e5e..81012234d 100644 --- a/toolsrc/src/MachineType.cpp +++ b/toolsrc/src/MachineType.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "MachineType.h" #include "vcpkg_Checks.h" diff --git a/toolsrc/src/Paragraphs.cpp b/toolsrc/src/Paragraphs.cpp index f4592afed..6dde5da7c 100644 --- a/toolsrc/src/Paragraphs.cpp +++ b/toolsrc/src/Paragraphs.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "Paragraphs.h" #include "vcpkg_Files.h" diff --git a/toolsrc/src/SourceParagraph.cpp b/toolsrc/src/SourceParagraph.cpp index bdf15a737..eef4a4734 100644 --- a/toolsrc/src/SourceParagraph.cpp +++ b/toolsrc/src/SourceParagraph.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "SourceParagraph.h" #include "vcpkglib_helpers.h" #include "vcpkg_System.h" diff --git a/toolsrc/src/StatusParagraph.cpp b/toolsrc/src/StatusParagraph.cpp index bf12ae89a..3f07689ca 100644 --- a/toolsrc/src/StatusParagraph.cpp +++ b/toolsrc/src/StatusParagraph.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "StatusParagraph.h" #include "vcpkglib_helpers.h" diff --git a/toolsrc/src/StatusParagraphs.cpp b/toolsrc/src/StatusParagraphs.cpp index 3e23c519a..c2398d2b8 100644 --- a/toolsrc/src/StatusParagraphs.cpp +++ b/toolsrc/src/StatusParagraphs.cpp @@ -1,5 +1,5 @@ +#include "pch.h" #include "StatusParagraphs.h" -#include #include "vcpkg_Checks.h" namespace vcpkg diff --git a/toolsrc/src/Stopwatch.cpp b/toolsrc/src/Stopwatch.cpp index b0e54e381..ec7af60b6 100644 --- a/toolsrc/src/Stopwatch.cpp +++ b/toolsrc/src/Stopwatch.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "Stopwatch.h" #include "vcpkg_Checks.h" diff --git a/toolsrc/src/coff_file_reader.cpp b/toolsrc/src/coff_file_reader.cpp index 8ce714bbe..f48f912c1 100644 --- a/toolsrc/src/coff_file_reader.cpp +++ b/toolsrc/src/coff_file_reader.cpp @@ -1,8 +1,6 @@ +#include "pch.h" #include "coff_file_reader.h" -#include #include "vcpkg_Checks.h" -#include -#include using namespace std; diff --git a/toolsrc/src/commands_available_commands.cpp b/toolsrc/src/commands_available_commands.cpp index 48239587d..56056218b 100644 --- a/toolsrc/src/commands_available_commands.cpp +++ b/toolsrc/src/commands_available_commands.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "vcpkg_Commands.h" namespace vcpkg::Commands diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index 629cbbb5f..22f3af872 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "vcpkg_Commands.h" #include "StatusParagraphs.h" #include "vcpkglib.h" @@ -8,7 +9,6 @@ #include "vcpkg_Environment.h" #include "metrics.h" #include "vcpkg_info.h" -#include namespace vcpkg::Commands::Build { diff --git a/toolsrc/src/commands_build_external.cpp b/toolsrc/src/commands_build_external.cpp index 51dc29e86..5c3fa9857 100644 --- a/toolsrc/src/commands_build_external.cpp +++ b/toolsrc/src/commands_build_external.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "vcpkg_Commands.h" #include "vcpkg_System.h" #include "vcpkg_Environment.h" diff --git a/toolsrc/src/commands_cache.cpp b/toolsrc/src/commands_cache.cpp index 63bf32260..fa49a647f 100644 --- a/toolsrc/src/commands_cache.cpp +++ b/toolsrc/src/commands_cache.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "vcpkg_Commands.h" #include "vcpkg_System.h" #include "vcpkg_Files.h" diff --git a/toolsrc/src/commands_contact.cpp b/toolsrc/src/commands_contact.cpp index 3e3ebc2b4..2be468fb8 100644 --- a/toolsrc/src/commands_contact.cpp +++ b/toolsrc/src/commands_contact.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "vcpkg_Commands.h" #include "vcpkg_System.h" #include "vcpkg_info.h" diff --git a/toolsrc/src/commands_create.cpp b/toolsrc/src/commands_create.cpp index d842d3fab..5042ab97b 100644 --- a/toolsrc/src/commands_create.cpp +++ b/toolsrc/src/commands_create.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "vcpkg_Commands.h" #include "vcpkg_System.h" #include "vcpkg_Environment.h" diff --git a/toolsrc/src/commands_edit.cpp b/toolsrc/src/commands_edit.cpp index cb457a9e2..dff30f7ad 100644 --- a/toolsrc/src/commands_edit.cpp +++ b/toolsrc/src/commands_edit.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "vcpkg_Commands.h" #include "vcpkg_System.h" #include "vcpkg_Input.h" diff --git a/toolsrc/src/commands_hash.cpp b/toolsrc/src/commands_hash.cpp index 7048fb0d9..4c0028f53 100644 --- a/toolsrc/src/commands_hash.cpp +++ b/toolsrc/src/commands_hash.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "vcpkg_Commands.h" #include "vcpkg_System.h" diff --git a/toolsrc/src/commands_help.cpp b/toolsrc/src/commands_help.cpp index e4769752c..6068c22fb 100644 --- a/toolsrc/src/commands_help.cpp +++ b/toolsrc/src/commands_help.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "vcpkg_Commands.h" #include "vcpkg_System.h" diff --git a/toolsrc/src/commands_import.cpp b/toolsrc/src/commands_import.cpp index 14e83e75f..7af2c7185 100644 --- a/toolsrc/src/commands_import.cpp +++ b/toolsrc/src/commands_import.cpp @@ -1,8 +1,8 @@ +#include "pch.h" #include "vcpkg_Commands.h" #include "Paragraphs.h" #include "StatusParagraph.h" #include "vcpkg_Files.h" -#include namespace vcpkg::Commands::Import { diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index 69495bd62..2ae67a497 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "vcpkg_Commands.h" #include "vcpkglib.h" #include "vcpkg_Environment.h" diff --git a/toolsrc/src/commands_integrate.cpp b/toolsrc/src/commands_integrate.cpp index 2bd5027ec..03c51b5a7 100644 --- a/toolsrc/src/commands_integrate.cpp +++ b/toolsrc/src/commands_integrate.cpp @@ -1,10 +1,5 @@ -#define WIN32_LEAN_AND_MEAN -#include -#include +#include "pch.h" #include "vcpkg_Commands.h" -#include -#include -#include #include "vcpkg_Environment.h" #include "vcpkg_Checks.h" #include "vcpkg_System.h" diff --git a/toolsrc/src/commands_list.cpp b/toolsrc/src/commands_list.cpp index 18e95d405..34a9c2fc8 100644 --- a/toolsrc/src/commands_list.cpp +++ b/toolsrc/src/commands_list.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "vcpkg_Commands.h" #include "vcpkglib.h" #include "vcpkg_System.h" diff --git a/toolsrc/src/commands_owns.cpp b/toolsrc/src/commands_owns.cpp index fe02b6224..6c4c20c44 100644 --- a/toolsrc/src/commands_owns.cpp +++ b/toolsrc/src/commands_owns.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "vcpkg_Commands.h" #include "vcpkg_System.h" #include "vcpkglib.h" diff --git a/toolsrc/src/commands_portsdiff.cpp b/toolsrc/src/commands_portsdiff.cpp index 1665d7c47..e75633b3c 100644 --- a/toolsrc/src/commands_portsdiff.cpp +++ b/toolsrc/src/commands_portsdiff.cpp @@ -1,11 +1,7 @@ +#include "pch.h" #include "vcpkg_Commands.h" #include "vcpkg_System.h" -#include -#include #include "vcpkg_Maps.h" -#include -#include -#include #include "Paragraphs.h" #include "SourceParagraph.h" #include "vcpkg_Environment.h" diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index 7b8286f9c..9b37ff11f 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -1,9 +1,9 @@ +#include "pch.h" #include "vcpkg_Commands.h" #include "vcpkglib.h" #include "vcpkg_System.h" #include "vcpkg_Input.h" #include "vcpkg_Dependencies.h" -#include namespace vcpkg::Commands::Remove { diff --git a/toolsrc/src/commands_search.cpp b/toolsrc/src/commands_search.cpp index 3f197b06b..3a3226e4b 100644 --- a/toolsrc/src/commands_search.cpp +++ b/toolsrc/src/commands_search.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "vcpkg_Commands.h" #include "vcpkg_System.h" #include "Paragraphs.h" diff --git a/toolsrc/src/commands_update.cpp b/toolsrc/src/commands_update.cpp index d7a554303..a42ae5341 100644 --- a/toolsrc/src/commands_update.cpp +++ b/toolsrc/src/commands_update.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "vcpkg_Commands.h" #include "vcpkglib.h" #include "vcpkg_System.h" diff --git a/toolsrc/src/commands_version.cpp b/toolsrc/src/commands_version.cpp index e98251601..a521b2567 100644 --- a/toolsrc/src/commands_version.cpp +++ b/toolsrc/src/commands_version.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "vcpkg_Commands.h" #include "vcpkg_System.h" #include "vcpkg_info.h" diff --git a/toolsrc/src/metrics.cpp b/toolsrc/src/metrics.cpp index 1806dad87..263d6eb74 100644 --- a/toolsrc/src/metrics.cpp +++ b/toolsrc/src/metrics.cpp @@ -1,15 +1,5 @@ +#include "pch.h" #include "metrics.h" -#include -#include -#include -#include -#include -#include -#include -#define WIN32_LEAN_AND_MEAN -#include -#include -#include #include "filesystem_fs.h" #include "vcpkg_Strings.h" #include "vcpkg_System.h" diff --git a/toolsrc/src/package_spec.cpp b/toolsrc/src/package_spec.cpp index 86d4393bd..9ba3bdf79 100644 --- a/toolsrc/src/package_spec.cpp +++ b/toolsrc/src/package_spec.cpp @@ -1,5 +1,5 @@ +#include "pch.h" #include "package_spec.h" -#include namespace vcpkg { diff --git a/toolsrc/src/package_spec_parse_result.cpp b/toolsrc/src/package_spec_parse_result.cpp index dc377f656..892232c2e 100644 --- a/toolsrc/src/package_spec_parse_result.cpp +++ b/toolsrc/src/package_spec_parse_result.cpp @@ -1,5 +1,5 @@ -#include -#include +#include "pch.h" +#include "package_spec.h" #include "package_spec_parse_result.h" namespace vcpkg diff --git a/toolsrc/src/pch.cpp b/toolsrc/src/pch.cpp new file mode 100644 index 000000000..17305716a --- /dev/null +++ b/toolsrc/src/pch.cpp @@ -0,0 +1 @@ +#include "pch.h" \ No newline at end of file diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index af76b7963..daf6f49ee 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -1,12 +1,11 @@ +#include "pch.h" #include "vcpkg_paths.h" #include "package_spec.h" #include "vcpkg_Files.h" -#include #include "vcpkg_System.h" #include "vcpkg_Environment.h" #include "coff_file_reader.h" #include "BuildInfo.h" -#include namespace vcpkg::PostBuildLint { diff --git a/toolsrc/src/triplet.cpp b/toolsrc/src/triplet.cpp index a6816b445..e1302d9ed 100644 --- a/toolsrc/src/triplet.cpp +++ b/toolsrc/src/triplet.cpp @@ -1,6 +1,6 @@ +#include "pch.h" #include "triplet.h" #include "vcpkg_Checks.h" -#include namespace vcpkg { diff --git a/toolsrc/src/vcpkg_Checks.cpp b/toolsrc/src/vcpkg_Checks.cpp index 46b28e55c..5c3fef27a 100644 --- a/toolsrc/src/vcpkg_Checks.cpp +++ b/toolsrc/src/vcpkg_Checks.cpp @@ -1,6 +1,5 @@ +#include "pch.h" #include "vcpkg_Checks.h" - -#include #include "vcpkg_System.h" namespace vcpkg::Checks diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp index 4468930c4..3b6db5bbd 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg_Dependencies.cpp @@ -1,12 +1,9 @@ +#include "pch.h" #include "vcpkg_Dependencies.h" -#include #include "vcpkg_Graphs.h" #include "vcpkg_paths.h" #include "package_spec.h" #include "StatusParagraphs.h" -#include -#include -#include "vcpkg_Maps.h" #include "vcpkg_Files.h" #include "vcpkglib.h" diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index 66d33edeb..1babdc547 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -1,5 +1,4 @@ -#include -#include +#include "pch.h" #include "vcpkg_Environment.h" #include "vcpkg_Commands.h" #include "metrics.h" diff --git a/toolsrc/src/vcpkg_Files.cpp b/toolsrc/src/vcpkg_Files.cpp index 1d4faa773..87700238d 100644 --- a/toolsrc/src/vcpkg_Files.cpp +++ b/toolsrc/src/vcpkg_Files.cpp @@ -1,6 +1,5 @@ +#include "pch.h" #include "vcpkg_Files.h" -#include -#include #include "vcpkg_System.h" namespace vcpkg::Files diff --git a/toolsrc/src/vcpkg_Input.cpp b/toolsrc/src/vcpkg_Input.cpp index bf7ccd346..5720cadc0 100644 --- a/toolsrc/src/vcpkg_Input.cpp +++ b/toolsrc/src/vcpkg_Input.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "vcpkg_Input.h" #include "vcpkg_System.h" #include "metrics.h" diff --git a/toolsrc/src/vcpkg_Strings.cpp b/toolsrc/src/vcpkg_Strings.cpp index b974b0a06..5b6d9967c 100644 --- a/toolsrc/src/vcpkg_Strings.cpp +++ b/toolsrc/src/vcpkg_Strings.cpp @@ -1,12 +1,6 @@ +#include "pch.h" #include "vcpkg_Strings.h" -#include -#include -#include -#include -#include -#include - namespace vcpkg::Strings::details { // To disambiguate between two overloads diff --git a/toolsrc/src/vcpkg_System.cpp b/toolsrc/src/vcpkg_System.cpp index 405dfd1b8..754a26741 100644 --- a/toolsrc/src/vcpkg_System.cpp +++ b/toolsrc/src/vcpkg_System.cpp @@ -1,7 +1,5 @@ +#include "pch.h" #include "vcpkg_System.h" -#include -#include -#include namespace vcpkg::System { diff --git a/toolsrc/src/vcpkg_cmd_arguments.cpp b/toolsrc/src/vcpkg_cmd_arguments.cpp index aa1c35965..4a06128a4 100644 --- a/toolsrc/src/vcpkg_cmd_arguments.cpp +++ b/toolsrc/src/vcpkg_cmd_arguments.cpp @@ -1,8 +1,6 @@ -#define WIN32_LEAN_AND_MEAN -#include +#include "pch.h" #include "vcpkg_cmd_arguments.h" #include "vcpkg_Commands.h" -#include #include "metrics.h" #include "vcpkg_System.h" diff --git a/toolsrc/src/vcpkg_info.cpp b/toolsrc/src/vcpkg_info.cpp index 69bc6a355..f8e214998 100644 --- a/toolsrc/src/vcpkg_info.cpp +++ b/toolsrc/src/vcpkg_info.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "vcpkg_info.h" #include "metrics.h" diff --git a/toolsrc/src/vcpkg_paths.cpp b/toolsrc/src/vcpkg_paths.cpp index 39e4c8986..8d7060a02 100644 --- a/toolsrc/src/vcpkg_paths.cpp +++ b/toolsrc/src/vcpkg_paths.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "expected.h" #include "vcpkg_paths.h" #include "metrics.h" diff --git a/toolsrc/src/vcpkglib.cpp b/toolsrc/src/vcpkglib.cpp index 5cea0c585..06487684c 100644 --- a/toolsrc/src/vcpkglib.cpp +++ b/toolsrc/src/vcpkglib.cpp @@ -1,15 +1,7 @@ +#include "pch.h" #include "vcpkglib.h" -#include -#include -#include -#include -#include -#include -#include -#include #include "vcpkg_Files.h" #include "Paragraphs.h" -#include #include "metrics.h" using namespace vcpkg; diff --git a/toolsrc/src/vcpkglib_helpers.cpp b/toolsrc/src/vcpkglib_helpers.cpp index fdc287507..6b96c25cb 100644 --- a/toolsrc/src/vcpkglib_helpers.cpp +++ b/toolsrc/src/vcpkglib_helpers.cpp @@ -1,7 +1,6 @@ +#include "pch.h" #include "vcpkg_Checks.h" #include "vcpkglib_helpers.h" -#include -#include namespace vcpkg::details { diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index cd220892f..bbf18e80d 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -78,6 +78,8 @@ DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) true + Use + pch.h @@ -89,6 +91,8 @@ DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) true + Use + pch.h @@ -102,6 +106,8 @@ DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;NDEBUG;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) true + Use + pch.h true @@ -119,6 +125,8 @@ DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;NDEBUG;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) true + Use + pch.h true @@ -138,6 +146,7 @@ + @@ -186,6 +195,12 @@ + + Create + Create + Create + Create + diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index faac8cd67..0f8b03378 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -150,6 +150,9 @@ Source Files + + Source Files + @@ -254,5 +257,8 @@ Header Files + + Header Files + \ No newline at end of file -- cgit v1.2.3 From 31bf4634d220b9a2ae33380eb301335e85018e46 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 27 Jan 2017 13:30:26 -0800 Subject: Disable MinimalRebuild --- toolsrc/vcpkg/vcpkg.vcxproj | 2 ++ toolsrc/vcpkglib/vcpkglib.vcxproj | 2 ++ toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj | 2 ++ toolsrc/vcpkgtest/vcpkgtest.vcxproj | 2 ++ 4 files changed, 8 insertions(+) diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/vcpkg/vcpkg.vcxproj index eea257e7d..c91bc2a75 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj +++ b/toolsrc/vcpkg/vcpkg.vcxproj @@ -74,6 +74,7 @@ ..\include /std:c++latest %(AdditionalOptions) true + false winhttp.lib;version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) @@ -87,6 +88,7 @@ ..\include /std:c++latest %(AdditionalOptions) true + false winhttp.lib;version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index bbf18e80d..b9722c68e 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -80,6 +80,7 @@ true Use pch.h + false @@ -93,6 +94,7 @@ true Use pch.h + false diff --git a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj index 47687dbcf..b66b7fd9d 100644 --- a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj +++ b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj @@ -74,6 +74,7 @@ ..\include /std:c++latest %(AdditionalOptions) true + false winhttp.lib;version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) @@ -87,6 +88,7 @@ ..\include /std:c++latest %(AdditionalOptions) true + false winhttp.lib;version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) diff --git a/toolsrc/vcpkgtest/vcpkgtest.vcxproj b/toolsrc/vcpkgtest/vcpkgtest.vcxproj index 263cd0658..224500d82 100644 --- a/toolsrc/vcpkgtest/vcpkgtest.vcxproj +++ b/toolsrc/vcpkgtest/vcpkgtest.vcxproj @@ -98,6 +98,7 @@ /std:c++latest %(AdditionalOptions) true + false Windows @@ -115,6 +116,7 @@ /std:c++latest %(AdditionalOptions) true + false Windows -- cgit v1.2.3 From 6f363339d8eb5cd8c7a2dd83787af3a34ff0eb4b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 27 Jan 2017 14:33:54 -0800 Subject: Reorganize pch.h --- toolsrc/include/pch.h | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/toolsrc/include/pch.h b/toolsrc/include/pch.h index 48aca2b77..2c8b5b5f7 100644 --- a/toolsrc/include/pch.h +++ b/toolsrc/include/pch.h @@ -7,32 +7,33 @@ #include #include -#include -#include -#include #include -#include -#include -#include +#include +#include +#include +#include #include #include #include #include -#include + +#include #include -#include + +#include +#include +#include #include +#include +#include #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include -#include -#include \ No newline at end of file +#include +#include -- cgit v1.2.3 From 9da07d4540c0c0bb34fedad649e4e2d5a75bbf09 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 27 Jan 2017 14:37:14 -0800 Subject: Add and to pch.h --- toolsrc/include/pch.h | 3 +++ toolsrc/include/vcpkg_cmd_arguments.h | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/toolsrc/include/pch.h b/toolsrc/include/pch.h index 2c8b5b5f7..56f24f161 100644 --- a/toolsrc/include/pch.h +++ b/toolsrc/include/pch.h @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -34,6 +35,8 @@ #include #include #include +#include #include #include +#include diff --git a/toolsrc/include/vcpkg_cmd_arguments.h b/toolsrc/include/vcpkg_cmd_arguments.h index 2194e6d2c..8ace98586 100644 --- a/toolsrc/include/vcpkg_cmd_arguments.h +++ b/toolsrc/include/vcpkg_cmd_arguments.h @@ -4,7 +4,6 @@ #include #include #include "opt_bool.h" -#include "vcpkg_paths.h" namespace vcpkg { -- cgit v1.2.3 From 4059d4a6b9f9467ff5c58594f7304eef7ba79664 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 27 Jan 2017 17:28:00 -0800 Subject: [package_spec] Make toString() a member function --- toolsrc/include/package_spec.h | 4 ++-- toolsrc/src/commands_build.cpp | 10 +++++----- toolsrc/src/commands_install.cpp | 4 ++-- toolsrc/src/package_spec.cpp | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/toolsrc/include/package_spec.h b/toolsrc/include/package_spec.h index 30dfca5c7..01b4377a5 100644 --- a/toolsrc/include/package_spec.h +++ b/toolsrc/include/package_spec.h @@ -18,13 +18,13 @@ namespace vcpkg std::string dir() const; + std::string toString() const; + private: std::string m_name; triplet m_target_triplet; }; - std::string to_string(const package_spec& spec); - std::string to_printf_arg(const package_spec& spec); bool operator==(const package_spec& left, const package_spec& right); diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index 22f3af872..b6c3cea03 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -44,20 +44,20 @@ namespace vcpkg::Commands::Build timer.start(); int return_code = System::cmd_execute(command); timer.stop(); - TrackMetric("buildtimeus-" + to_string(spec), timer.microseconds()); + TrackMetric("buildtimeus-" + spec.toString(), timer.microseconds()); if (return_code != 0) { - System::println(System::color::error, "Error: building package %s failed", to_string(spec)); + System::println(System::color::error, "Error: building package %s failed", spec.toString()); 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()); + , spec.toString(), Info::version()); TrackProperty("error", "build failed"); - TrackProperty("build_error", to_string(spec)); + TrackProperty("build_error", spec.toString()); exit(EXIT_FAILURE); } @@ -118,7 +118,7 @@ namespace vcpkg::Commands::Build System::println(""); for (const package_spec_with_install_plan& p : unmet_dependencies) { - System::println(" %s", to_string(p.spec)); + System::println(" %s", p.spec.toString()); } System::println(""); exit(EXIT_FAILURE); diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index 2ae67a497..dabce44f6 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -192,11 +192,11 @@ namespace vcpkg::Commands::Install std::vector install_plan = Dependencies::create_install_plan(paths, specs, status_db); Checks::check_exit(!install_plan.empty(), "Install plan cannot be empty"); - std::string specs_string = to_string(install_plan[0].spec); + std::string specs_string = install_plan[0].spec.toString(); for (size_t i = 1; i < install_plan.size(); ++i) { specs_string.push_back(','); - specs_string.append(to_string(install_plan[i].spec)); + specs_string.append(install_plan[i].spec.toString()); } TrackProperty("installplan", specs_string); Environment::ensure_utilities_on_path(paths); diff --git a/toolsrc/src/package_spec.cpp b/toolsrc/src/package_spec.cpp index 9ba3bdf79..7d8d2681d 100644 --- a/toolsrc/src/package_spec.cpp +++ b/toolsrc/src/package_spec.cpp @@ -55,14 +55,14 @@ namespace vcpkg return Strings::format("%s_%s", this->m_name, this->m_target_triplet); } - std::string to_string(const package_spec& spec) + std::string package_spec::toString() const { - return Strings::format("%s:%s", spec.name(), spec.target_triplet()); + return Strings::format("%s:%s", this->name(), this->target_triplet()); } std::string to_printf_arg(const package_spec& spec) { - return to_string(spec); + return spec.toString(); } bool operator==(const package_spec& left, const package_spec& right) @@ -72,6 +72,6 @@ namespace vcpkg std::ostream& operator<<(std::ostream& os, const package_spec& spec) { - return os << to_string(spec); + return os << spec.toString(); } } -- cgit v1.2.3 From 0f0698dc18ec162666ed92b4ac181e512b439b83 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 27 Jan 2017 20:09:40 -0800 Subject: Introduce Strings::Joiner --- toolsrc/include/vcpkg_Strings.h | 50 ++++++++++++++++++++++++++++++++++++++++- toolsrc/src/SourceParagraph.cpp | 4 ++-- toolsrc/src/vcpkg_Strings.cpp | 41 +++++++++++++++++++++------------ 3 files changed, 78 insertions(+), 17 deletions(-) diff --git a/toolsrc/include/vcpkg_Strings.h b/toolsrc/include/vcpkg_Strings.h index cb5d2334c..8d5d7135b 100644 --- a/toolsrc/include/vcpkg_Strings.h +++ b/toolsrc/include/vcpkg_Strings.h @@ -68,7 +68,55 @@ namespace vcpkg::Strings std::string ascii_to_lowercase(const std::string& input); - std::string join(const std::vector& v, const std::string& delimiter); + template + static std::string join(const std::vector& v, const std::string& prefix, const std::string& delimiter, const std::string& suffix, Transformer transformer) + { + if (v.empty()) + { + return std::string(); + } + + std::string output; + size_t size = v.size(); + + output.append(prefix); + output.append(transformer(v.at(0))); + + for (size_t i = 1; i < size; ++i) + { + output.append(delimiter); + output.append(transformer(v.at(i))); + } + + output.append(suffix); + return output; + } + + static std::string join(const std::vector& v, const std::string& prefix, const std::string& delimiter, const std::string& suffix); + + class Joiner + { + public: + static Joiner on(const std::string& delimiter); + + Joiner& prefix(const std::string& prefix); + Joiner& suffix(const std::string& suffix); + + std::string join(const std::vector& v) const; + + template + std::string join(const std::vector& v, Transformer transformer) const + { + return Strings::join(v, this->m_prefix, this->m_delimiter, this->m_suffix, transformer); + } + + private: + explicit Joiner(const std::string& delimiter); + + std::string m_prefix; + std::string m_delimiter; + std::string m_suffix; + }; void trim(std::string* s); diff --git a/toolsrc/src/SourceParagraph.cpp b/toolsrc/src/SourceParagraph.cpp index eef4a4734..8bfe8e84d 100644 --- a/toolsrc/src/SourceParagraph.cpp +++ b/toolsrc/src/SourceParagraph.cpp @@ -53,8 +53,8 @@ namespace vcpkg const std::vector remaining_fields = Maps::extract_keys(fields); const std::vector& valid_fields = get_list_of_valid_fields(); - const std::string remaining_fields_as_string = Strings::join(remaining_fields, "\n "); - const std::string valid_fields_as_string = Strings::join(valid_fields, "\n "); + const std::string remaining_fields_as_string = Strings::Joiner::on("\n ").join(remaining_fields); + const std::string valid_fields_as_string = Strings::Joiner::on("\n ").join(valid_fields); System::println(System::color::error, "Error: There are invalid fields in the Source Paragraph of %s", this->name); System::println("The following fields were not expected:\n\n %s\n\n", remaining_fields_as_string); diff --git a/toolsrc/src/vcpkg_Strings.cpp b/toolsrc/src/vcpkg_Strings.cpp index 5b6d9967c..3b9d6a859 100644 --- a/toolsrc/src/vcpkg_Strings.cpp +++ b/toolsrc/src/vcpkg_Strings.cpp @@ -67,25 +67,38 @@ namespace vcpkg::Strings return output; } - std::string join(const std::vector& v, const std::string& delimiter) + std::string join(const std::vector& v, const std::string& prefix, const std::string& delimiter, const std::string& suffix) { - if (v.empty()) + return join(v, prefix, delimiter, suffix, [](const std::string& i) -> std::string { - return std::string(); - } + return i; + }); + } - std::string output; - size_t size = v.size(); + Joiner Joiner::on(const std::string& delimiter) + { + return Joiner(delimiter); + } - output.append(v.at(0)); + Joiner& Joiner::prefix(const std::string& prefix) + { + this->m_prefix = prefix; + return *this; + } - for (size_t i = 1; i < size; ++i) - { - output.append(delimiter); - output.append(v.at(i)); - } + Joiner& Joiner::suffix(const std::string& suffix) + { + this->m_suffix = suffix; + return *this; + } - return output; + std::string Joiner::join(const std::vector& v) const + { + return Strings::join(v, this->m_prefix, this->m_delimiter, this->m_suffix); + } + + Joiner::Joiner(const std::string& delimiter) : m_prefix(""), m_delimiter(delimiter), m_suffix("") + { } void trim(std::string* s) @@ -119,7 +132,7 @@ namespace vcpkg::Strings std::vector output; size_t i = 0; - for (size_t pos = s.find(delimiter); pos != std::string::npos; pos = s.find(delimiter, pos)) + for (size_t pos = s.find(delimiter); pos != std::string::npos; pos = s.find(delimiter, pos)) { output.push_back(s.substr(i, pos - i)); i = ++pos; -- cgit v1.2.3 From e0577978c512cbc3ea0e05067882b14eedacc679 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 27 Jan 2017 20:21:04 -0800 Subject: Remove unneeded #include directive --- toolsrc/include/package_spec.h | 1 - 1 file changed, 1 deletion(-) diff --git a/toolsrc/include/package_spec.h b/toolsrc/include/package_spec.h index 01b4377a5..b469567c7 100644 --- a/toolsrc/include/package_spec.h +++ b/toolsrc/include/package_spec.h @@ -1,5 +1,4 @@ #pragma once -#include #include "package_spec_parse_result.h" #include "triplet.h" #include "expected.h" -- cgit v1.2.3 From c1562f1d17bf48e96f31c2a61092dd7bc8c3d9d2 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 27 Jan 2017 20:22:33 -0800 Subject: Print remove plan. Fail if --recursive is not passed and there are dependencies --- toolsrc/src/commands_remove.cpp | 80 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 79 insertions(+), 1 deletion(-) diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index 9b37ff11f..8e6a6c227 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -11,6 +11,7 @@ namespace vcpkg::Commands::Remove using Dependencies::remove_plan_type; static const std::string OPTION_PURGE = "--purge"; + static const std::string OPTION_RECURSIVE = "--recursive"; static void delete_directory(const fs::path& directory) { @@ -163,6 +164,67 @@ namespace vcpkg::Commands::Remove System::println(System::color::success, "Package %s was successfully removed", pkg.package.displayname()); } + static void sort_packages_by_name(std::vector* packages) + { + std::sort(packages->begin(), packages->end(), [](const package_spec_with_remove_plan* left, const package_spec_with_remove_plan* right) -> bool + { + return left->spec.name() < right->spec.name(); + }); + } + + static void print_plan(const std::vector& plan) + { + std::vector not_installed; + std::vector remove; + + for (const package_spec_with_remove_plan& i : plan) + { + if (i.plan.type == remove_plan_type::NOT_INSTALLED) + { + not_installed.push_back(&i); + continue; + } + + if (i.plan.type == remove_plan_type::REMOVE || i.plan.type == remove_plan_type::REMOVE_USER_REQUESTED) + { + remove.push_back(&i); + continue; + } + + Checks::unreachable(); + } + + //std::copy_if(plan.cbegin(), plan.cend(), std::back_inserter(not_installed), [](const package_spec_with_remove_plan& i) + // { + // return i.plan.type == remove_plan_type::NOT_INSTALLED; + // }); + + if (!not_installed.empty()) + { + sort_packages_by_name(¬_installed); + System::println("The following packages are not installed, so not removed:\n%s", + Strings::Joiner::on("\n ").prefix(" ").join(not_installed, [](const package_spec_with_remove_plan* p) + { + return p->spec.toString(); + })); + } + + if (!remove.empty()) + { + sort_packages_by_name(&remove); + System::println("The following packages will be removed:\n%s", + Strings::Joiner::on("\n").join(remove, [](const package_spec_with_remove_plan* p) + { + if (p->plan.type == remove_plan_type::REMOVE_USER_REQUESTED) + { + return " " + p->spec.toString(); + } + + return " * " + p->spec.toString(); + })); + } + } + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) { static const std::string example = Commands::Help::create_example_string("remove zlib zlib:x64-windows curl boost"); @@ -173,11 +235,27 @@ namespace vcpkg::Commands::Remove std::vector specs = Input::check_and_get_package_specs(args.command_arguments, default_target_triplet, example); Input::check_triplets(specs, paths); - bool alsoRemoveFolderFromPackages = options.find(OPTION_PURGE) != options.end(); + const bool alsoRemoveFolderFromPackages = options.find(OPTION_PURGE) != options.end(); + const bool isRecursive = options.find(OPTION_PURGE) != options.end(); const std::vector remove_plan = Dependencies::create_remove_plan(paths, specs, status_db); Checks::check_exit(!remove_plan.empty(), "Remove plan cannot be empty"); + print_plan(remove_plan); + + const bool has_non_user_requested_packages = std::find_if(remove_plan.cbegin(), remove_plan.cend(), [](const package_spec_with_remove_plan& package)-> bool + { + return package.plan.type == remove_plan_type::REMOVE; + }) != remove_plan.cend(); + + if (has_non_user_requested_packages && !isRecursive) + { + System::println(System::color::warning, "Additional packages (*) need to be removed to complete this operation.\n" + "If you are sure you want to remove them, run the command with the --recursive option"); + exit(EXIT_FAILURE); + } + + //exit(EXIT_SUCCESS); for (const package_spec& spec : specs) { deinstall_package(paths, spec, status_db); -- cgit v1.2.3 From 661776fe29344c431731e5ae464da4942b38bf79 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 12:34:36 -0800 Subject: Enable recursive `remove` command --- toolsrc/include/vcpkg_Dependencies.h | 5 +- toolsrc/src/commands_remove.cpp | 110 +++++++++-------------------------- toolsrc/src/vcpkg_Dependencies.cpp | 4 +- 3 files changed, 33 insertions(+), 86 deletions(-) diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 528abedfb..2a3030c89 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -29,15 +29,14 @@ namespace vcpkg::Dependencies enum class remove_plan_type { NOT_INSTALLED, - DEPENDENCIES_NOT_SATISFIED, - REMOVE, + REMOVE_AUTO_SELECTED, REMOVE_USER_REQUESTED }; struct remove_plan_action { remove_plan_type type; - std::unique_ptr bpgh; + std::unique_ptr status_pgh; }; struct package_spec_with_remove_plan diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index 8e6a6c227..d95fd7af9 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -27,72 +27,8 @@ namespace vcpkg::Commands::Remove } } - static remove_plan_type deinstall_package_plan( - const StatusParagraphs::iterator package_it, - const StatusParagraphs& status_db, - std::vector& dependencies_out) + static void remove_package(const vcpkg_paths& paths, StatusParagraph& pkg) { - dependencies_out.clear(); - - if (package_it == status_db.end() || (*package_it)->state == install_state_t::not_installed) - { - return remove_plan_type::NOT_INSTALLED; - } - - auto& pkg = (*package_it)->package; - - for (auto&& inst_pkg : status_db) - { - if (inst_pkg->want != want_t::install) - continue; - if (inst_pkg->package.spec.target_triplet() != pkg.spec.target_triplet()) - continue; - - const auto& deps = inst_pkg->package.depends; - - if (std::find(deps.begin(), deps.end(), pkg.spec.name()) != deps.end()) - { - dependencies_out.push_back(inst_pkg.get()); - } - } - - if (!dependencies_out.empty()) - return remove_plan_type::DEPENDENCIES_NOT_SATISFIED; - - return remove_plan_type::REMOVE; - } - - static void deinstall_package(const vcpkg_paths& paths, const package_spec& spec, StatusParagraphs& status_db) - { - auto package_it = status_db.find(spec.name(), spec.target_triplet()); - if (package_it == status_db.end()) - { - System::println(System::color::success, "Package %s is not installed", spec); - return; - } - - auto& pkg = **package_it; - - std::vector deps; - auto plan = deinstall_package_plan(package_it, status_db, deps); - switch (plan) - { - case remove_plan_type::NOT_INSTALLED: - System::println(System::color::success, "Package %s is not installed", spec); - return; - case remove_plan_type::DEPENDENCIES_NOT_SATISFIED: - System::println(System::color::error, "Error: Cannot remove package %s:", spec); - for (auto&& dep : deps) - { - System::println(" %s depends on %s", dep->package.displayname(), pkg.package.displayname()); - } - exit(EXIT_FAILURE); - case remove_plan_type::REMOVE: - break; - default: - Checks::unreachable(); - } - pkg.want = want_t::purge; pkg.state = install_state_t::half_installed; write_update(paths, pkg); @@ -185,7 +121,7 @@ namespace vcpkg::Commands::Remove continue; } - if (i.plan.type == remove_plan_type::REMOVE || i.plan.type == remove_plan_type::REMOVE_USER_REQUESTED) + if (i.plan.type == remove_plan_type::REMOVE_AUTO_SELECTED || i.plan.type == remove_plan_type::REMOVE_USER_REQUESTED) { remove.push_back(&i); continue; @@ -215,12 +151,15 @@ namespace vcpkg::Commands::Remove System::println("The following packages will be removed:\n%s", Strings::Joiner::on("\n").join(remove, [](const package_spec_with_remove_plan* p) { - if (p->plan.type == remove_plan_type::REMOVE_USER_REQUESTED) + switch (p->plan.type) { - return " " + p->spec.toString(); + case remove_plan_type::REMOVE_USER_REQUESTED: + return " " + p->spec.toString(); + case remove_plan_type::REMOVE_AUTO_SELECTED: + return " * " + p->spec.toString(); + default: + Checks::unreachable(); } - - return " * " + p->spec.toString(); })); } } @@ -230,13 +169,13 @@ namespace vcpkg::Commands::Remove 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}); + const std::unordered_set options = args.check_and_get_optional_command_arguments({OPTION_PURGE, OPTION_RECURSIVE}); auto status_db = database_load_check(paths); std::vector specs = Input::check_and_get_package_specs(args.command_arguments, default_target_triplet, example); Input::check_triplets(specs, paths); const bool alsoRemoveFolderFromPackages = options.find(OPTION_PURGE) != options.end(); - const bool isRecursive = options.find(OPTION_PURGE) != options.end(); + const bool isRecursive = options.find(OPTION_RECURSIVE) != options.end(); const std::vector remove_plan = Dependencies::create_remove_plan(paths, specs, status_db); Checks::check_exit(!remove_plan.empty(), "Remove plan cannot be empty"); @@ -245,27 +184,36 @@ namespace vcpkg::Commands::Remove const bool has_non_user_requested_packages = std::find_if(remove_plan.cbegin(), remove_plan.cend(), [](const package_spec_with_remove_plan& package)-> bool { - return package.plan.type == remove_plan_type::REMOVE; + return package.plan.type == remove_plan_type::REMOVE_AUTO_SELECTED; }) != remove_plan.cend(); if (has_non_user_requested_packages && !isRecursive) { System::println(System::color::warning, "Additional packages (*) need to be removed to complete this operation.\n" - "If you are sure you want to remove them, run the command with the --recursive option"); + "If you are sure you want to remove them, run the command with the --recursive option"); exit(EXIT_FAILURE); } - //exit(EXIT_SUCCESS); - for (const package_spec& spec : specs) + for (const package_spec_with_remove_plan& action : remove_plan) { - deinstall_package(paths, spec, status_db); - - if (alsoRemoveFolderFromPackages) + if (action.plan.type == remove_plan_type::NOT_INSTALLED) { - const fs::path spec_package_dir = paths.packages / spec.dir(); - delete_directory(spec_package_dir); + System::println(System::color::success, "Package %s is not installed", action.spec); } + else if (action.plan.type == remove_plan_type::REMOVE_AUTO_SELECTED || action.plan.type == remove_plan_type::REMOVE_USER_REQUESTED) + { + remove_package(paths, *action.plan.status_pgh); + + if (alsoRemoveFolderFromPackages) + { + const fs::path spec_package_dir = paths.packages / action.spec.dir(); + delete_directory(spec_package_dir); + } + } + else + Checks::unreachable(); } + exit(EXIT_SUCCESS); } } diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp index 3b6db5bbd..5de782e73 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg_Dependencies.cpp @@ -114,8 +114,8 @@ namespace vcpkg::Dependencies examine_stack.push_back(an_installed_package.get()->package.spec); } - const remove_plan_type type = specs_as_set.find(spec) != specs_as_set.end() ? remove_plan_type::REMOVE_USER_REQUESTED: remove_plan_type::REMOVE; - was_examined.emplace(spec, remove_plan_action{ type, std::make_unique(std::move((*it)->package))}); + const remove_plan_type type = specs_as_set.find(spec) != specs_as_set.end() ? remove_plan_type::REMOVE_USER_REQUESTED: remove_plan_type::REMOVE_AUTO_SELECTED; + was_examined.emplace(spec, remove_plan_action{ type, std::make_unique(std::move(**it))}); } std::vector ret; -- cgit v1.2.3 From 884cd176b05a76e7fbba924685a0d71c3dea0f9b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 12:36:27 -0800 Subject: Renames and formatting --- toolsrc/include/vcpkg_Dependencies.h | 4 ++-- toolsrc/src/commands_install.cpp | 4 ++-- toolsrc/src/vcpkg_Dependencies.cpp | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 2a3030c89..5b0bf3187 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -16,8 +16,8 @@ namespace vcpkg::Dependencies struct install_plan_action { install_plan_type type; - std::unique_ptr bpgh; - std::unique_ptr spgh; + std::unique_ptr binary_pgh; + std::unique_ptr source_pgh; }; struct package_spec_with_install_plan diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index dabce44f6..e5c5dd013 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -214,14 +214,14 @@ namespace vcpkg::Commands::Install } else if (action.plan.type == install_plan_type::BUILD_AND_INSTALL) { - Commands::Build::build_package(*action.plan.spgh, action.spec, paths, paths.port_dir(action.spec)); + Commands::Build::build_package(*action.plan.source_pgh, 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); } else if (action.plan.type == install_plan_type::INSTALL) { - install_package(paths, *action.plan.bpgh, status_db); + install_package(paths, *action.plan.binary_pgh, status_db); System::println(System::color::success, "Package %s is installed", action.spec); } else diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp index 5de782e73..b0047a772 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg_Dependencies.cpp @@ -66,7 +66,7 @@ namespace vcpkg::Dependencies const std::vector pkgs = graph.find_topological_sort(); for (const package_spec& pkg : pkgs) { - ret.push_back({ pkg, std::move(was_examined[pkg]) }); + ret.push_back({pkg, std::move(was_examined[pkg])}); } return ret; } @@ -93,7 +93,7 @@ namespace vcpkg::Dependencies auto it = status_db.find(spec); if (it == status_db.end() || (*it)->state == install_state_t::not_installed) { - was_examined.emplace(spec, remove_plan_action{ remove_plan_type::NOT_INSTALLED, nullptr}); + was_examined.emplace(spec, remove_plan_action{remove_plan_type::NOT_INSTALLED, nullptr}); continue; } @@ -114,8 +114,8 @@ namespace vcpkg::Dependencies examine_stack.push_back(an_installed_package.get()->package.spec); } - const remove_plan_type type = specs_as_set.find(spec) != specs_as_set.end() ? remove_plan_type::REMOVE_USER_REQUESTED: remove_plan_type::REMOVE_AUTO_SELECTED; - was_examined.emplace(spec, remove_plan_action{ type, std::make_unique(std::move(**it))}); + const remove_plan_type type = specs_as_set.find(spec) != specs_as_set.end() ? remove_plan_type::REMOVE_USER_REQUESTED : remove_plan_type::REMOVE_AUTO_SELECTED; + was_examined.emplace(spec, remove_plan_action{type, std::make_unique(std::move(**it))}); } std::vector ret; @@ -123,7 +123,7 @@ namespace vcpkg::Dependencies const std::vector pkgs = graph.find_topological_sort(); for (const package_spec& pkg : pkgs) { - ret.push_back({ pkg, std::move(was_examined[pkg]) }); + ret.push_back({pkg, std::move(was_examined[pkg])}); } return ret; } -- cgit v1.2.3 From 4d104541674f1975b60c2ccd694d447e25a16359 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 12:45:26 -0800 Subject: Add package_spec::display_name() --- toolsrc/include/package_spec.h | 2 ++ toolsrc/src/BinaryParagraph.cpp | 2 +- toolsrc/src/package_spec.cpp | 7 ++++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/toolsrc/include/package_spec.h b/toolsrc/include/package_spec.h index b469567c7..1bc493756 100644 --- a/toolsrc/include/package_spec.h +++ b/toolsrc/include/package_spec.h @@ -15,6 +15,8 @@ namespace vcpkg const triplet& target_triplet() const; + std::string display_name() const; + std::string dir() const; std::string toString() const; diff --git a/toolsrc/src/BinaryParagraph.cpp b/toolsrc/src/BinaryParagraph.cpp index eed87eb81..f949677a3 100644 --- a/toolsrc/src/BinaryParagraph.cpp +++ b/toolsrc/src/BinaryParagraph.cpp @@ -71,7 +71,7 @@ namespace vcpkg std::string BinaryParagraph::displayname() const { - return Strings::format("%s:%s", this->spec.name(), this->spec.target_triplet()); + return this->spec.display_name(); } std::string BinaryParagraph::dir() const diff --git a/toolsrc/src/package_spec.cpp b/toolsrc/src/package_spec.cpp index 7d8d2681d..2713e219f 100644 --- a/toolsrc/src/package_spec.cpp +++ b/toolsrc/src/package_spec.cpp @@ -50,6 +50,11 @@ namespace vcpkg return this->m_target_triplet; } + std::string package_spec::display_name() const + { + return Strings::format("%s:%s", this->name(), this->target_triplet()); + } + std::string package_spec::dir() const { return Strings::format("%s_%s", this->m_name, this->m_target_triplet); @@ -57,7 +62,7 @@ namespace vcpkg std::string package_spec::toString() const { - return Strings::format("%s:%s", this->name(), this->target_triplet()); + return this->display_name(); } std::string to_printf_arg(const package_spec& spec) -- cgit v1.2.3 From b1f0a09af250296d7483aa28e3a014d2635600b5 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 12:46:35 -0800 Subject: Remove commented-out code --- toolsrc/src/commands_remove.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index d95fd7af9..9a0b6950e 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -130,11 +130,6 @@ namespace vcpkg::Commands::Remove Checks::unreachable(); } - //std::copy_if(plan.cbegin(), plan.cend(), std::back_inserter(not_installed), [](const package_spec_with_remove_plan& i) - // { - // return i.plan.type == remove_plan_type::NOT_INSTALLED; - // }); - if (!not_installed.empty()) { sort_packages_by_name(¬_installed); -- cgit v1.2.3 From 82005ffe7474b5432bb043e3b4859bdd68ea6030 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 12:59:10 -0800 Subject: Improve messages from the `remove` command --- toolsrc/src/commands_remove.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index 9a0b6950e..85154d356 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -97,7 +97,6 @@ namespace vcpkg::Commands::Remove pkg.state = install_state_t::not_installed; write_update(paths, pkg); - System::println(System::color::success, "Package %s was successfully removed", pkg.package.displayname()); } static void sort_packages_by_name(std::vector* packages) @@ -197,12 +196,17 @@ namespace vcpkg::Commands::Remove } else if (action.plan.type == remove_plan_type::REMOVE_AUTO_SELECTED || action.plan.type == remove_plan_type::REMOVE_USER_REQUESTED) { + const std::string display_name = action.spec.display_name(); + System::println("Removing package %s... ", display_name); remove_package(paths, *action.plan.status_pgh); + System::println(System::color::success, "Removing package %s... done", display_name); if (alsoRemoveFolderFromPackages) { const fs::path spec_package_dir = paths.packages / action.spec.dir(); + System::println("Purging package %s... ", display_name); delete_directory(spec_package_dir); + System::println(System::color::success, "Purging package %s... done", display_name); } } else -- cgit v1.2.3 From 9c87fcbd8b7e1cdee148d33ed272ae5ecc83fb60 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 13:37:00 -0800 Subject: Formatting --- toolsrc/src/commands_remove.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index 85154d356..b28fe3283 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -183,7 +183,8 @@ namespace vcpkg::Commands::Remove if (has_non_user_requested_packages && !isRecursive) { - System::println(System::color::warning, "Additional packages (*) need to be removed to complete this operation.\n" + System::println(System::color::warning, + "Additional packages (*) need to be removed to complete this operation.\n" "If you are sure you want to remove them, run the command with the --recursive option"); exit(EXIT_FAILURE); } -- cgit v1.2.3 From e461467affad578d2e13a5c8f18cc37ee3007938 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 13:57:43 -0800 Subject: [Dependencies] User-requested vs autos-elected info is now in a separate enum --- toolsrc/include/vcpkg_Dependencies.h | 12 +++++++++--- toolsrc/src/commands_remove.cpp | 26 ++++++++++++++------------ toolsrc/src/vcpkg_Dependencies.cpp | 6 +++--- 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 5b0bf3187..b987a6b38 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -6,6 +6,12 @@ namespace vcpkg::Dependencies { + enum class request_type + { + USER_REQUESTED, + AUTO_SELECTED + }; + enum class install_plan_type { BUILD_AND_INSTALL, @@ -29,13 +35,13 @@ namespace vcpkg::Dependencies enum class remove_plan_type { NOT_INSTALLED, - REMOVE_AUTO_SELECTED, - REMOVE_USER_REQUESTED + REMOVE }; struct remove_plan_action { - remove_plan_type type; + remove_plan_type plan_type; + request_type request_type; std::unique_ptr status_pgh; }; diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index b28fe3283..2fc560275 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -114,13 +114,13 @@ namespace vcpkg::Commands::Remove for (const package_spec_with_remove_plan& i : plan) { - if (i.plan.type == remove_plan_type::NOT_INSTALLED) + if (i.plan.plan_type == remove_plan_type::NOT_INSTALLED) { not_installed.push_back(&i); continue; } - if (i.plan.type == remove_plan_type::REMOVE_AUTO_SELECTED || i.plan.type == remove_plan_type::REMOVE_USER_REQUESTED) + if (i.plan.plan_type == remove_plan_type::REMOVE) { remove.push_back(&i); continue; @@ -145,15 +145,17 @@ namespace vcpkg::Commands::Remove System::println("The following packages will be removed:\n%s", Strings::Joiner::on("\n").join(remove, [](const package_spec_with_remove_plan* p) { - switch (p->plan.type) + if (p->plan.request_type == Dependencies::request_type::AUTO_SELECTED) { - case remove_plan_type::REMOVE_USER_REQUESTED: - return " " + p->spec.toString(); - case remove_plan_type::REMOVE_AUTO_SELECTED: - return " * " + p->spec.toString(); - default: - Checks::unreachable(); + return " * " + p->spec.toString(); } + + if (p->plan.request_type == Dependencies::request_type::USER_REQUESTED) + { + return " " + p->spec.toString(); + } + + Checks::unreachable(); })); } } @@ -178,7 +180,7 @@ namespace vcpkg::Commands::Remove const bool has_non_user_requested_packages = std::find_if(remove_plan.cbegin(), remove_plan.cend(), [](const package_spec_with_remove_plan& package)-> bool { - return package.plan.type == remove_plan_type::REMOVE_AUTO_SELECTED; + return package.plan.plan_type == remove_plan_type::REMOVE_AUTO_SELECTED; }) != remove_plan.cend(); if (has_non_user_requested_packages && !isRecursive) @@ -191,11 +193,11 @@ namespace vcpkg::Commands::Remove for (const package_spec_with_remove_plan& action : remove_plan) { - if (action.plan.type == remove_plan_type::NOT_INSTALLED) + if (action.plan.plan_type == remove_plan_type::NOT_INSTALLED) { System::println(System::color::success, "Package %s is not installed", action.spec); } - else if (action.plan.type == remove_plan_type::REMOVE_AUTO_SELECTED || action.plan.type == remove_plan_type::REMOVE_USER_REQUESTED) + else if (action.plan.plan_type == remove_plan_type::REMOVE_AUTO_SELECTED || action.plan.plan_type == remove_plan_type::REMOVE_USER_REQUESTED) { const std::string display_name = action.spec.display_name(); System::println("Removing package %s... ", display_name); diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp index b0047a772..669cdfc20 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg_Dependencies.cpp @@ -93,7 +93,7 @@ namespace vcpkg::Dependencies auto it = status_db.find(spec); if (it == status_db.end() || (*it)->state == install_state_t::not_installed) { - was_examined.emplace(spec, remove_plan_action{remove_plan_type::NOT_INSTALLED, nullptr}); + was_examined.emplace(spec, remove_plan_action{remove_plan_type::NOT_INSTALLED, request_type::USER_REQUESTED, nullptr}); continue; } @@ -114,8 +114,8 @@ namespace vcpkg::Dependencies examine_stack.push_back(an_installed_package.get()->package.spec); } - const remove_plan_type type = specs_as_set.find(spec) != specs_as_set.end() ? remove_plan_type::REMOVE_USER_REQUESTED : remove_plan_type::REMOVE_AUTO_SELECTED; - was_examined.emplace(spec, remove_plan_action{type, std::make_unique(std::move(**it))}); + const request_type request_type = specs_as_set.find(spec) != specs_as_set.end() ? request_type::USER_REQUESTED : request_type::AUTO_SELECTED; + was_examined.emplace(spec, remove_plan_action{remove_plan_type::REMOVE, request_type,std::make_unique(std::move(**it))}); } std::vector ret; -- cgit v1.2.3 From b4e9322a11aa2d0d9b0f1c0f960d921ce51e1c0f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 13:58:58 -0800 Subject: Rename field --- toolsrc/include/vcpkg_Dependencies.h | 2 +- toolsrc/src/commands_build.cpp | 2 +- toolsrc/src/commands_install.cpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index b987a6b38..ac4a13e84 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -21,7 +21,7 @@ namespace vcpkg::Dependencies struct install_plan_action { - install_plan_type type; + install_plan_type plan_type; std::unique_ptr binary_pgh; std::unique_ptr source_pgh; }; diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index b6c3cea03..ccc3c8d9f 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -107,7 +107,7 @@ namespace vcpkg::Commands::Build 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; + return p.plan.plan_type == install_plan_type::ALREADY_INSTALLED; }), unmet_dependencies.end()); diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index e5c5dd013..0371cc6e5 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -205,21 +205,21 @@ namespace vcpkg::Commands::Install { try { - if (action.plan.type == install_plan_type::ALREADY_INSTALLED) + if (action.plan.plan_type == install_plan_type::ALREADY_INSTALLED) { if (std::find(specs.begin(), specs.end(), action.spec) != specs.end()) { System::println(System::color::success, "Package %s is already installed", action.spec); } } - else if (action.plan.type == install_plan_type::BUILD_AND_INSTALL) + else if (action.plan.plan_type == install_plan_type::BUILD_AND_INSTALL) { Commands::Build::build_package(*action.plan.source_pgh, 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); } - else if (action.plan.type == install_plan_type::INSTALL) + else if (action.plan.plan_type == install_plan_type::INSTALL) { install_package(paths, *action.plan.binary_pgh, status_db); System::println(System::color::success, "Package %s is installed", action.spec); -- cgit v1.2.3 From a7be90f823d9a3b33e58568c28836be33bda5ac8 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 14:17:26 -0800 Subject: Fix usage of remove_plan_type --- toolsrc/src/commands_remove.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index 2fc560275..b09790efc 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -9,6 +9,7 @@ namespace vcpkg::Commands::Remove { using Dependencies::package_spec_with_remove_plan; using Dependencies::remove_plan_type; + using Dependencies::request_type; static const std::string OPTION_PURGE = "--purge"; static const std::string OPTION_RECURSIVE = "--recursive"; @@ -180,7 +181,7 @@ namespace vcpkg::Commands::Remove const bool has_non_user_requested_packages = std::find_if(remove_plan.cbegin(), remove_plan.cend(), [](const package_spec_with_remove_plan& package)-> bool { - return package.plan.plan_type == remove_plan_type::REMOVE_AUTO_SELECTED; + return package.plan.request_type != request_type::USER_REQUESTED; }) != remove_plan.cend(); if (has_non_user_requested_packages && !isRecursive) @@ -197,7 +198,7 @@ namespace vcpkg::Commands::Remove { System::println(System::color::success, "Package %s is not installed", action.spec); } - else if (action.plan.plan_type == remove_plan_type::REMOVE_AUTO_SELECTED || action.plan.plan_type == remove_plan_type::REMOVE_USER_REQUESTED) + else if (action.plan.plan_type == remove_plan_type::REMOVE) { const std::string display_name = action.spec.display_name(); System::println("Removing package %s... ", display_name); @@ -206,9 +207,8 @@ namespace vcpkg::Commands::Remove if (alsoRemoveFolderFromPackages) { - const fs::path spec_package_dir = paths.packages / action.spec.dir(); System::println("Purging package %s... ", display_name); - delete_directory(spec_package_dir); + delete_directory(paths.packages / action.spec.dir()); System::println(System::color::success, "Purging package %s... done", display_name); } } -- cgit v1.2.3 From 836de4b0748617db6d06b0eef6fe9ccff9980b1f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 15:29:02 -0800 Subject: Fix remove_plan code --- toolsrc/include/vcpkg_Dependencies.h | 2 +- toolsrc/src/vcpkg_Dependencies.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index ac4a13e84..9180cb65e 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -42,7 +42,7 @@ namespace vcpkg::Dependencies { remove_plan_type plan_type; request_type request_type; - std::unique_ptr status_pgh; + StatusParagraph* status_pgh; }; struct package_spec_with_remove_plan diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp index 669cdfc20..bb2ecc666 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg_Dependencies.cpp @@ -90,7 +90,7 @@ namespace vcpkg::Dependencies continue; } - auto it = status_db.find(spec); + const StatusParagraphs::const_iterator it = status_db.find(spec); if (it == status_db.end() || (*it)->state == install_state_t::not_installed) { was_examined.emplace(spec, remove_plan_action{remove_plan_type::NOT_INSTALLED, request_type::USER_REQUESTED, nullptr}); @@ -115,7 +115,7 @@ namespace vcpkg::Dependencies } const request_type request_type = specs_as_set.find(spec) != specs_as_set.end() ? request_type::USER_REQUESTED : request_type::AUTO_SELECTED; - was_examined.emplace(spec, remove_plan_action{remove_plan_type::REMOVE, request_type,std::make_unique(std::move(**it))}); + was_examined.emplace(spec, remove_plan_action{remove_plan_type::REMOVE, request_type,it->get()}); } std::vector ret; -- cgit v1.2.3 From 8de71af4bd94ae1e41bf39a455ed716ac8cdf9bc Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 16:14:48 -0800 Subject: Introduce "optional" alias --- toolsrc/include/vcpkg_Dependencies.h | 5 +++-- toolsrc/include/vcpkg_optional.h | 5 +++++ toolsrc/vcpkglib/vcpkglib.vcxproj | 1 + toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 3 +++ 4 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 toolsrc/include/vcpkg_optional.h diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 9180cb65e..2595d9fb8 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -3,6 +3,7 @@ #include "package_spec.h" #include "StatusParagraphs.h" #include "vcpkg_paths.h" +#include "vcpkg_optional.h" namespace vcpkg::Dependencies { @@ -22,8 +23,8 @@ namespace vcpkg::Dependencies struct install_plan_action { install_plan_type plan_type; - std::unique_ptr binary_pgh; - std::unique_ptr source_pgh; + optional binary_pgh; + optional source_pgh; }; struct package_spec_with_install_plan diff --git a/toolsrc/include/vcpkg_optional.h b/toolsrc/include/vcpkg_optional.h new file mode 100644 index 000000000..7b935bea9 --- /dev/null +++ b/toolsrc/include/vcpkg_optional.h @@ -0,0 +1,5 @@ +#pragma once +#include + +template +using optional = std::unique_ptr; diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index b9722c68e..e6fbfb65a 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -166,6 +166,7 @@ + diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index 0f8b03378..7ddfba6f2 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -260,5 +260,8 @@ Header Files + + Header Files + \ No newline at end of file -- cgit v1.2.3 From 86a5ab7bccce5988682e69c4e1c14fedbf9a13a7 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 16:40:09 -0800 Subject: Use pointer instead of reference for out param --- toolsrc/src/commands_install.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index 0371cc6e5..439424d28 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -134,11 +134,11 @@ namespace vcpkg::Commands::Install return ImmutableSortedVector::create(std::move(installed_files)); } - void install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs& status_db) + void install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs* status_db) { const fs::path package_dir = paths.package_dir(binary_paragraph.spec); const triplet& triplet = binary_paragraph.spec.target_triplet(); - const std::vector pgh_and_files = get_installed_files(paths, status_db); + const std::vector pgh_and_files = get_installed_files(paths, *status_db); const ImmutableSortedVector package_files = build_list_of_package_files(package_dir); const ImmutableSortedVector installed_files = build_list_of_installed_files(pgh_and_files, triplet); @@ -166,19 +166,19 @@ namespace vcpkg::Commands::Install spgh.state = install_state_t::half_installed; for (auto&& dep : spgh.package.depends) { - if (status_db.find_installed(dep, spgh.package.spec.target_triplet()) == status_db.end()) + if (status_db->find_installed(dep, spgh.package.spec.target_triplet()) == status_db->end()) { Checks::unreachable(); } } write_update(paths, spgh); - status_db.insert(std::make_unique(spgh)); + status_db->insert(std::make_unique(spgh)); install_and_write_listfile(paths, spgh.package); spgh.state = install_state_t::installed; write_update(paths, spgh); - status_db.insert(std::make_unique(spgh)); + status_db->insert(std::make_unique(spgh)); } void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) @@ -216,12 +216,12 @@ namespace vcpkg::Commands::Install { Commands::Build::build_package(*action.plan.source_pgh, 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); + install_package(paths, bpgh, &status_db); System::println(System::color::success, "Package %s is installed", action.spec); } else if (action.plan.plan_type == install_plan_type::INSTALL) { - install_package(paths, *action.plan.binary_pgh, status_db); + install_package(paths, *action.plan.binary_pgh, &status_db); System::println(System::color::success, "Package %s is installed", action.spec); } else -- cgit v1.2.3 From 4252d9436e6d4104f6acc5560aef461046aae853 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 16:46:39 -0800 Subject: remove_plan now depends on the spec, instead of StatusParagraph --- toolsrc/include/vcpkg_Dependencies.h | 1 - toolsrc/src/commands_remove.cpp | 6 ++++-- toolsrc/src/vcpkg_Dependencies.cpp | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 2595d9fb8..ba84d1bd1 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -43,7 +43,6 @@ namespace vcpkg::Dependencies { remove_plan_type plan_type; request_type request_type; - StatusParagraph* status_pgh; }; struct package_spec_with_remove_plan diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index b09790efc..5a9467b47 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -28,8 +28,10 @@ namespace vcpkg::Commands::Remove } } - static void remove_package(const vcpkg_paths& paths, StatusParagraph& pkg) + static void remove_package(const vcpkg_paths& paths, const package_spec& spec, StatusParagraphs* status_db) { + StatusParagraph& pkg = **status_db->find(spec.name(), spec.target_triplet()); + pkg.want = want_t::purge; pkg.state = install_state_t::half_installed; write_update(paths, pkg); @@ -202,7 +204,7 @@ namespace vcpkg::Commands::Remove { const std::string display_name = action.spec.display_name(); System::println("Removing package %s... ", display_name); - remove_package(paths, *action.plan.status_pgh); + remove_package(paths, action.spec, &status_db); System::println(System::color::success, "Removing package %s... done", display_name); if (alsoRemoveFolderFromPackages) diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp index bb2ecc666..a534537d2 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg_Dependencies.cpp @@ -93,7 +93,7 @@ namespace vcpkg::Dependencies const StatusParagraphs::const_iterator it = status_db.find(spec); if (it == status_db.end() || (*it)->state == install_state_t::not_installed) { - was_examined.emplace(spec, remove_plan_action{remove_plan_type::NOT_INSTALLED, request_type::USER_REQUESTED, nullptr}); + was_examined.emplace(spec, remove_plan_action{remove_plan_type::NOT_INSTALLED, request_type::USER_REQUESTED}); continue; } @@ -115,7 +115,7 @@ namespace vcpkg::Dependencies } const request_type request_type = specs_as_set.find(spec) != specs_as_set.end() ? request_type::USER_REQUESTED : request_type::AUTO_SELECTED; - was_examined.emplace(spec, remove_plan_action{remove_plan_type::REMOVE, request_type,it->get()}); + was_examined.emplace(spec, remove_plan_action{remove_plan_type::REMOVE}); } std::vector ret; -- cgit v1.2.3 From 4e64dc598a53493a85d65f94c81a33c4862fc89a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 17:52:53 -0800 Subject: [Dependencies] Specify constructors and fix bug with default remove_plan_action init --- toolsrc/include/vcpkg_Dependencies.h | 22 ++++++++++++++++++++++ toolsrc/src/vcpkg_Dependencies.cpp | 34 ++++++++++++++++++++++++++++++---- 2 files changed, 52 insertions(+), 4 deletions(-) diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index ba84d1bd1..b63816089 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -9,12 +9,14 @@ namespace vcpkg::Dependencies { enum class request_type { + UNKNOWN, USER_REQUESTED, AUTO_SELECTED }; enum class install_plan_type { + UNKNOWN, BUILD_AND_INSTALL, INSTALL, ALREADY_INSTALLED @@ -22,6 +24,13 @@ namespace vcpkg::Dependencies struct install_plan_action { + install_plan_action(); + install_plan_action(const install_plan_type& plan_type, optional binary_pgh, optional source_pgh); + install_plan_action(const install_plan_action&) = delete; + install_plan_action(install_plan_action&&) = default; + install_plan_action& operator=(const install_plan_action&) = delete; + install_plan_action& operator=(install_plan_action&&) = default; + install_plan_type plan_type; optional binary_pgh; optional source_pgh; @@ -29,24 +38,37 @@ namespace vcpkg::Dependencies struct package_spec_with_install_plan { + package_spec_with_install_plan(const package_spec& spec, install_plan_action&& plan); + package_spec spec; install_plan_action plan; }; enum class remove_plan_type { + UNKNOWN, NOT_INSTALLED, REMOVE }; struct remove_plan_action { + remove_plan_action(); + remove_plan_action(const remove_plan_type& plan_type, const request_type& request_type); + remove_plan_action(const remove_plan_action&) = delete; + remove_plan_action(remove_plan_action&&) = default; + remove_plan_action& operator=(const remove_plan_action&) = delete; + remove_plan_action& operator=(remove_plan_action&&) = default; + + remove_plan_type plan_type; request_type request_type; }; struct package_spec_with_remove_plan { + package_spec_with_remove_plan(const package_spec& spec, remove_plan_action&& plan); + package_spec spec; remove_plan_action plan; }; diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp index a534537d2..5bd6c3eb9 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg_Dependencies.cpp @@ -9,6 +9,32 @@ namespace vcpkg::Dependencies { + install_plan_action::install_plan_action() : plan_type(install_plan_type::UNKNOWN), binary_pgh(nullptr), source_pgh(nullptr) + { + } + + install_plan_action::install_plan_action(const install_plan_type& plan_type, optional binary_pgh, optional source_pgh) + : plan_type(std::move(plan_type)), binary_pgh(std::move(binary_pgh)), source_pgh(std::move(source_pgh)) + { + } + + package_spec_with_install_plan::package_spec_with_install_plan(const package_spec& spec, install_plan_action&& plan) : spec(spec), plan(std::move(plan)) + { + } + + remove_plan_action::remove_plan_action() : plan_type(remove_plan_type::UNKNOWN), request_type(request_type::UNKNOWN) + { + } + + remove_plan_action::remove_plan_action(const remove_plan_type& plan_type, const Dependencies::request_type& request_type) : plan_type(plan_type), request_type(request_type) + { + } + + package_spec_with_remove_plan::package_spec_with_remove_plan(const package_spec& spec, remove_plan_action&& plan) + : spec(spec), plan(std::move(plan)) + { + } + std::vector create_install_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db) { std::unordered_map was_examined; // Examine = we have checked its immediate (non-recursive) dependencies @@ -66,7 +92,7 @@ namespace vcpkg::Dependencies const std::vector pkgs = graph.find_topological_sort(); for (const package_spec& pkg : pkgs) { - ret.push_back({pkg, std::move(was_examined[pkg])}); + ret.push_back(package_spec_with_install_plan(pkg, std::move(was_examined[pkg]))); } return ret; } @@ -93,7 +119,7 @@ namespace vcpkg::Dependencies const StatusParagraphs::const_iterator it = status_db.find(spec); if (it == status_db.end() || (*it)->state == install_state_t::not_installed) { - was_examined.emplace(spec, remove_plan_action{remove_plan_type::NOT_INSTALLED, request_type::USER_REQUESTED}); + was_examined.emplace(spec, remove_plan_action(remove_plan_type::NOT_INSTALLED, request_type::USER_REQUESTED)); continue; } @@ -115,7 +141,7 @@ namespace vcpkg::Dependencies } const request_type request_type = specs_as_set.find(spec) != specs_as_set.end() ? request_type::USER_REQUESTED : request_type::AUTO_SELECTED; - was_examined.emplace(spec, remove_plan_action{remove_plan_type::REMOVE}); + was_examined.emplace(spec, remove_plan_action(remove_plan_type::REMOVE, request_type)); } std::vector ret; @@ -123,7 +149,7 @@ namespace vcpkg::Dependencies const std::vector pkgs = graph.find_topological_sort(); for (const package_spec& pkg : pkgs) { - ret.push_back({pkg, std::move(was_examined[pkg])}); + ret.push_back(package_spec_with_remove_plan(pkg, std::move(was_examined[pkg]))); } return ret; } -- cgit v1.2.3 From 5c01fc4af871ed1cc1481a53957be1460142a6f2 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 22:04:04 -0800 Subject: Change --recursive option to --recurse --- toolsrc/src/commands_remove.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index 5a9467b47..7e8608e72 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -12,7 +12,7 @@ namespace vcpkg::Commands::Remove using Dependencies::request_type; static const std::string OPTION_PURGE = "--purge"; - static const std::string OPTION_RECURSIVE = "--recursive"; + static const std::string OPTION_RECURSE = "--recurse"; static void delete_directory(const fs::path& directory) { @@ -168,13 +168,13 @@ namespace vcpkg::Commands::Remove 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, OPTION_RECURSIVE}); + const std::unordered_set options = args.check_and_get_optional_command_arguments({OPTION_PURGE, OPTION_RECURSE}); auto status_db = database_load_check(paths); std::vector specs = Input::check_and_get_package_specs(args.command_arguments, default_target_triplet, example); Input::check_triplets(specs, paths); const bool alsoRemoveFolderFromPackages = options.find(OPTION_PURGE) != options.end(); - const bool isRecursive = options.find(OPTION_RECURSIVE) != options.end(); + const bool isRecursive = options.find(OPTION_RECURSE) != options.end(); const std::vector remove_plan = Dependencies::create_remove_plan(paths, specs, status_db); Checks::check_exit(!remove_plan.empty(), "Remove plan cannot be empty"); @@ -190,7 +190,7 @@ namespace vcpkg::Commands::Remove { System::println(System::color::warning, "Additional packages (*) need to be removed to complete this operation.\n" - "If you are sure you want to remove them, run the command with the --recursive option"); + "If you are sure you want to remove them, run the command with the --recurse option"); exit(EXIT_FAILURE); } -- cgit v1.2.3 From e6e325b1cd92bf0b1aa05c84a2a757713f17fa08 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 22:10:08 -0800 Subject: Fix usage of Strings::Joiner --- toolsrc/src/commands_install.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index 439424d28..1f5a2234d 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -155,7 +155,7 @@ namespace vcpkg::Commands::Install triplet_install_path.generic_string(), binary_paragraph.spec); System::print("\n "); - System::println(Strings::join(intersection, "\n ")); + System::println(Strings::Joiner::on("\n ").join(intersection)); System::println(""); exit(EXIT_FAILURE); } -- cgit v1.2.3 From c6ab2a962600b5c1c506b7dbf70d5719c4c8aaf1 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 23:01:33 -0800 Subject: Update CHANGELOG and bump version to v0.0.71 --- CHANGELOG.md | 38 ++++++++++++++++++++++++++++++++++++++ toolsrc/VERSION.txt | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3380cd074..b631be48b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,41 @@ +vcpkg (0.0.71) +-------------- + * Add ports: + - atk 2.22.0 + - fontconfig 2.12.1 + - opus 1.1.4 + - pango 1.40.3 + - xerces-c 3.1.4 + * Update ports: + - boost 1.62-11 -> 1.63 + - cairo 1.14.6 -> 1.15.4 + - directxtk dec2016 -> dec2016-1 + - fltk 1.3.4-1 -> 1.3.4-2 + - gdal 1.11.3 -> 1.11.3-1 + - harfbuzz 1.3.4 -> 1.3.4-2 + - libarchive 3.2.2 -> 3.2.2-2 + - libmariadb 2.3.1 -> 2.3.2 + - mpir 2.7.2 -> 2.7.2-1 + - openssl 1.0.2j-2 -> 1.0.2k-2 + - wt 3.3.6 -> 3.3.6-2 + * Improve `vcpkg remove`: + - Now shows all dependencies that need to be removed instead of just the immediate dependencies + - Add `--recurse` option that removes all dependencies + - Improve messages + * Improve support for Visual Studio 2017 + - Better VS2017 detection + - Fixed various issues with `bootstrap.ps1` and VS2017 support + * Fix `vcpkg_copy_pdbs()` under non-English locale + * Notable changes for buiding the `vcpkg` tool: + - Restructure `vcpkg` project hierarchy. Now only has 4 projects (down from 6). Most of the code now lives under vcpkglib.vcxproj + - Enable multiprocessor compilation + - Disable MinimalRebuild + - Use precompiled headers + * Fixes and improvements in existing portfiles and the `vcpkg` tool itself + +-- vcpkg team MON, 30 Jan 2017 23:00:00 -0800 + + vcpkg (0.0.70) -------------- * Add ports: diff --git a/toolsrc/VERSION.txt b/toolsrc/VERSION.txt index 1759b863b..fcedfa235 100644 --- a/toolsrc/VERSION.txt +++ b/toolsrc/VERSION.txt @@ -1 +1 @@ -"0.0.70" \ No newline at end of file +"0.0.71" \ No newline at end of file -- cgit v1.2.3 From 2a83c5eda6288cba46cb723996f95b0f6b21e61f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 31 Jan 2017 12:59:20 -0800 Subject: [opt_bool] Make members ALL_CAPS --- toolsrc/include/opt_bool.h | 6 +++--- toolsrc/include/vcpkg_cmd_arguments.h | 6 +++--- toolsrc/src/vcpkg.cpp | 12 ++++++------ toolsrc/src/vcpkg_cmd_arguments.cpp | 12 ++++++------ 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/toolsrc/include/opt_bool.h b/toolsrc/include/opt_bool.h index 3856366c8..42133fb7a 100644 --- a/toolsrc/include/opt_bool.h +++ b/toolsrc/include/opt_bool.h @@ -4,8 +4,8 @@ namespace vcpkg { enum class opt_bool { - unspecified, - enabled, - disabled + UNSPECIFIED, + ENABLED, + DISABLED }; } diff --git a/toolsrc/include/vcpkg_cmd_arguments.h b/toolsrc/include/vcpkg_cmd_arguments.h index 8ace98586..79e12841d 100644 --- a/toolsrc/include/vcpkg_cmd_arguments.h +++ b/toolsrc/include/vcpkg_cmd_arguments.h @@ -14,9 +14,9 @@ namespace vcpkg std::unique_ptr vcpkg_root_dir; std::unique_ptr target_triplet; - opt_bool debug = opt_bool::unspecified; - opt_bool sendmetrics = opt_bool::unspecified; - opt_bool printmetrics = opt_bool::unspecified; + opt_bool debug = opt_bool::UNSPECIFIED; + opt_bool sendmetrics = opt_bool::UNSPECIFIED; + opt_bool printmetrics = opt_bool::UNSPECIFIED; std::string command; std::vector command_arguments; diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index b78319167..36bd0a40a 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -202,14 +202,14 @@ int wmain(const int argc, const wchar_t* const* const argv) const vcpkg_cmd_arguments args = vcpkg_cmd_arguments::create_from_command_line(argc, argv); - if (args.printmetrics != opt_bool::unspecified) - SetPrintMetrics(args.printmetrics == opt_bool::enabled); - if (args.sendmetrics != opt_bool::unspecified) - SetSendMetrics(args.sendmetrics == opt_bool::enabled); + if (args.printmetrics != opt_bool::UNSPECIFIED) + SetPrintMetrics(args.printmetrics == opt_bool::ENABLED); + if (args.sendmetrics != opt_bool::UNSPECIFIED) + SetSendMetrics(args.sendmetrics == opt_bool::ENABLED); - if (args.debug != opt_bool::unspecified) + if (args.debug != opt_bool::UNSPECIFIED) { - g_debugging = (args.debug == opt_bool::enabled); + g_debugging = (args.debug == opt_bool::ENABLED); } if (g_debugging) diff --git a/toolsrc/src/vcpkg_cmd_arguments.cpp b/toolsrc/src/vcpkg_cmd_arguments.cpp index 4a06128a4..e0d307077 100644 --- a/toolsrc/src/vcpkg_cmd_arguments.cpp +++ b/toolsrc/src/vcpkg_cmd_arguments.cpp @@ -36,7 +36,7 @@ namespace vcpkg const std::string& option_name, opt_bool& option_field) { - if (option_field != opt_bool::unspecified && option_field != new_setting) + if (option_field != opt_bool::UNSPECIFIED && option_field != new_setting) { System::println(System::color::error, "Error: conflicting values specified for --%s", option_name); TrackProperty("error", "error conflicting switches"); @@ -94,27 +94,27 @@ namespace vcpkg } if (arg == "--debug") { - parse_switch(opt_bool::enabled, "debug", args.debug); + parse_switch(opt_bool::ENABLED, "debug", args.debug); continue; } if (arg == "--sendmetrics") { - parse_switch(opt_bool::enabled, "sendmetrics", args.sendmetrics); + parse_switch(opt_bool::ENABLED, "sendmetrics", args.sendmetrics); continue; } if (arg == "--printmetrics") { - parse_switch(opt_bool::enabled, "printmetrics", args.printmetrics); + parse_switch(opt_bool::ENABLED, "printmetrics", args.printmetrics); continue; } if (arg == "--no-sendmetrics") { - parse_switch(opt_bool::disabled, "sendmetrics", args.sendmetrics); + parse_switch(opt_bool::DISABLED, "sendmetrics", args.sendmetrics); continue; } if (arg == "--no-printmetrics") { - parse_switch(opt_bool::disabled, "printmetrics", args.printmetrics); + parse_switch(opt_bool::DISABLED, "printmetrics", args.printmetrics); continue; } -- cgit v1.2.3 From 8b219333675e42edf21f6c528fe7760d6d465460 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 31 Jan 2017 17:53:08 -0800 Subject: [vcpkg-msbuild] Add troubleshooting message to MSBuild projects with Importance=Normal --- scripts/buildsystems/msbuild/vcpkg.targets | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/buildsystems/msbuild/vcpkg.targets b/scripts/buildsystems/msbuild/vcpkg.targets index 26a524ca3..d1d804e94 100644 --- a/scripts/buildsystems/msbuild/vcpkg.targets +++ b/scripts/buildsystems/msbuild/vcpkg.targets @@ -51,6 +51,11 @@ + + + + + Date: Tue, 31 Jan 2017 18:14:25 -0800 Subject: [boost] Add additional build assertions. --- ports/boost/portfile.cmake | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake index d8f0a23d1..81424078e 100644 --- a/ports/boost/portfile.cmake +++ b/ports/boost/portfile.cmake @@ -79,7 +79,19 @@ set(B2_OPTIONS_REL -sBZIP2_LIBPATH="${CURRENT_INSTALLED_DIR}\\lib" ) -file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) +file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) +if(EXISTS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + message(FATAL_ERROR "Unable to remove directory: ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel\n Files are likely in use.") +endif() + +file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) +if(EXISTS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + message(FATAL_ERROR "Unable to remove directory: ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg\n Files are likely in use.") +endif() + +if(EXISTS ${CURRENT_PACKAGES_DIR}/debug) + message(FATAL_ERROR "Error: directory exists: ${CURRENT_PACKAGES_DIR}/debug\n The previous package was not fully cleared. This is an internal error.") +endif() message(STATUS "Building ${TARGET_TRIPLET}-rel") vcpkg_execute_required_process_repeat( -- cgit v1.2.3 From f02c8f9e6472e5cf5fa1cc4b7273871bd6cf26c8 Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Wed, 1 Feb 2017 06:40:01 -0800 Subject: added patch to add missing NO_DEPRECATE defines for UWP --- ports/libvorbis/0002-Allow-deprecated-functions.patch | 14 ++++++++++++++ ports/libvorbis/portfile.cmake | 4 +++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 ports/libvorbis/0002-Allow-deprecated-functions.patch diff --git a/ports/libvorbis/0002-Allow-deprecated-functions.patch b/ports/libvorbis/0002-Allow-deprecated-functions.patch new file mode 100644 index 000000000..ea1d07e39 --- /dev/null +++ b/ports/libvorbis/0002-Allow-deprecated-functions.patch @@ -0,0 +1,14 @@ +diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt +index 2043294..e273393 100644 +--- a/lib/CMakeLists.txt ++++ b/lib/CMakeLists.txt +@@ -61,6 +61,9 @@ if(MSVC) + list(APPEND VORBIS_SOURCES ../win32/vorbis.def) + list(APPEND VORBISENC_SOURCES ../win32/vorbisenc.def) + list(APPEND VORBISFILE_SOURCES ../win32/vorbisfile.def) ++ add_definitions(-D_CRT_SECURE_NO_WARNINGS) ++ add_definitions(-D_CRT_SECURE_NO_DEPRECATE) ++ add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) + endif() + + include_directories(../include) diff --git a/ports/libvorbis/portfile.cmake b/ports/libvorbis/portfile.cmake index 66bfca07c..85fa1d26b 100644 --- a/ports/libvorbis/portfile.cmake +++ b/ports/libvorbis/portfile.cmake @@ -35,7 +35,9 @@ if(NOT EXISTS "${CURRENT_BUILDTREES_DIR}/src/.git") ) message(STATUS "Patching") vcpkg_execute_required_process( - COMMAND ${GIT} apply ${CMAKE_CURRENT_LIST_DIR}/0001-Add-vorbisenc.c-to-vorbis-library.patch --ignore-whitespace --whitespace=fix + COMMAND ${GIT} apply ${CMAKE_CURRENT_LIST_DIR}/0001-Add-vorbisenc.c-to-vorbis-library.patch + ${CMAKE_CURRENT_LIST_DIR}/0002-Allow-deprecated-functions.patch + --ignore-whitespace --whitespace=fix WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/src LOGNAME patch ) -- cgit v1.2.3 From f2d40c5b81cba14c86d836bc21978c4f3f691538 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 1 Feb 2017 11:38:58 -0800 Subject: Download 32-bit perl instead of 64-bit. Resolves #620 --- scripts/cmake/vcpkg_find_acquire_program.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index ab0cf1587..cd4a554f4 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -8,9 +8,9 @@ function(vcpkg_find_acquire_program VAR) if(VAR MATCHES "PERL") set(PROGNAME perl) set(PATHS ${DOWNLOADS}/tools/perl/perl/bin) - set(URL "http://strawberryperl.com/download/5.20.2.1/strawberry-perl-5.20.2.1-64bit-portable.zip") - set(ARCHIVE "strawberry-perl-5.20.2.1-64bit-portable.zip") - set(HASH 6e14e5580e52da5d35f29b67a52ef9db0e021af1575b4bbd84ebdbf18580522287890bdc21c0d21ddc1b2529d888f8e159dcaa017a3ff06d8fd23d16901bcc8b) + set(URL "http://strawberryperl.com/download/5.24.1.1/strawberry-perl-5.24.1.1-32bit-portable.zip") + set(ARCHIVE "strawberry-perl-5.24.1.1-32bit-portable.zip") + set(HASH a6e685ea24376f50db5f06c5b46075f1d3be25168fa1f27fa9b02e2ac017826cee62a2b43562f9b6c989337a231ba914416c110075457764de2d11f99d5e0f26) elseif(VAR MATCHES "NASM") set(PROGNAME nasm) set(PATHS ${DOWNLOADS}/tools/nasm/nasm-2.11.08) -- cgit v1.2.3 From bd1a10e5b97b073731cbb97e26611edf317c16d5 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 31 Jan 2017 13:31:45 -0800 Subject: Enhance the opt_bool type --- toolsrc/include/opt_bool.h | 28 +++++++++++++++++++++++++--- toolsrc/include/vcpkg_cmd_arguments.h | 6 +++--- toolsrc/src/opt_bool.cpp | 29 +++++++++++++++++++++++++++++ toolsrc/src/vcpkg.cpp | 12 ++++++------ toolsrc/src/vcpkg_cmd_arguments.cpp | 16 ++++++++-------- toolsrc/vcpkglib/vcpkglib.vcxproj | 1 + toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 3 +++ 7 files changed, 75 insertions(+), 20 deletions(-) create mode 100644 toolsrc/src/opt_bool.cpp diff --git a/toolsrc/include/opt_bool.h b/toolsrc/include/opt_bool.h index 42133fb7a..06642a399 100644 --- a/toolsrc/include/opt_bool.h +++ b/toolsrc/include/opt_bool.h @@ -1,11 +1,33 @@ #pragma once -namespace vcpkg +#include +#include + +namespace vcpkg::opt_bool { - enum class opt_bool + enum class type { - UNSPECIFIED, + UNSPECIFIED = 0, ENABLED, DISABLED }; + + type parse(const std::string& s); + + template + type from_map(const std::map& map, const T& key) + { + auto it = map.find(key); + if (it == map.cend()) + { + return type::UNSPECIFIED; + } + + return parse(*it); + } } + +namespace vcpkg +{ + using opt_bool_t = opt_bool::type; +} \ No newline at end of file diff --git a/toolsrc/include/vcpkg_cmd_arguments.h b/toolsrc/include/vcpkg_cmd_arguments.h index 79e12841d..91f7de8ac 100644 --- a/toolsrc/include/vcpkg_cmd_arguments.h +++ b/toolsrc/include/vcpkg_cmd_arguments.h @@ -14,9 +14,9 @@ namespace vcpkg std::unique_ptr vcpkg_root_dir; std::unique_ptr target_triplet; - opt_bool debug = opt_bool::UNSPECIFIED; - opt_bool sendmetrics = opt_bool::UNSPECIFIED; - opt_bool printmetrics = opt_bool::UNSPECIFIED; + opt_bool_t debug = opt_bool_t::UNSPECIFIED; + opt_bool_t sendmetrics = opt_bool_t::UNSPECIFIED; + opt_bool_t printmetrics = opt_bool_t::UNSPECIFIED; std::string command; std::vector command_arguments; diff --git a/toolsrc/src/opt_bool.cpp b/toolsrc/src/opt_bool.cpp new file mode 100644 index 000000000..324936fb4 --- /dev/null +++ b/toolsrc/src/opt_bool.cpp @@ -0,0 +1,29 @@ +#include "pch.h" +#include "opt_bool.h" +#include "vcpkg_Checks.h" + +namespace vcpkg::opt_bool +{ + static const std::string UNSPECIFIED_NAME = "unspecified"; + static const std::string ENABLED_NAME = "enabled"; + static const std::string DISABLED_NAME = "disabled"; + type parse(const std::string& s) + { + if (s == UNSPECIFIED_NAME) + { + return opt_bool_t::UNSPECIFIED; + } + + if (s == ENABLED_NAME) + { + return opt_bool_t::ENABLED; + } + + if (s == DISABLED_NAME) + { + return opt_bool_t::DISABLED; + } + + Checks::exit_with_message("Could not convert string [%s] to opt_bool", s); + } +} diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index 36bd0a40a..3e313c702 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -202,14 +202,14 @@ int wmain(const int argc, const wchar_t* const* const argv) const vcpkg_cmd_arguments args = vcpkg_cmd_arguments::create_from_command_line(argc, argv); - if (args.printmetrics != opt_bool::UNSPECIFIED) - SetPrintMetrics(args.printmetrics == opt_bool::ENABLED); - if (args.sendmetrics != opt_bool::UNSPECIFIED) - SetSendMetrics(args.sendmetrics == opt_bool::ENABLED); + if (args.printmetrics != opt_bool_t::UNSPECIFIED) + SetPrintMetrics(args.printmetrics == opt_bool_t::ENABLED); + if (args.sendmetrics != opt_bool_t::UNSPECIFIED) + SetSendMetrics(args.sendmetrics == opt_bool_t::ENABLED); - if (args.debug != opt_bool::UNSPECIFIED) + if (args.debug != opt_bool_t::UNSPECIFIED) { - g_debugging = (args.debug == opt_bool::ENABLED); + g_debugging = (args.debug == opt_bool_t::ENABLED); } if (g_debugging) diff --git a/toolsrc/src/vcpkg_cmd_arguments.cpp b/toolsrc/src/vcpkg_cmd_arguments.cpp index e0d307077..fdeb6e877 100644 --- a/toolsrc/src/vcpkg_cmd_arguments.cpp +++ b/toolsrc/src/vcpkg_cmd_arguments.cpp @@ -32,11 +32,11 @@ namespace vcpkg } static void parse_switch( - opt_bool new_setting, + opt_bool_t new_setting, const std::string& option_name, - opt_bool& option_field) + opt_bool_t& option_field) { - if (option_field != opt_bool::UNSPECIFIED && option_field != new_setting) + if (option_field != opt_bool_t::UNSPECIFIED && option_field != new_setting) { System::println(System::color::error, "Error: conflicting values specified for --%s", option_name); TrackProperty("error", "error conflicting switches"); @@ -94,27 +94,27 @@ namespace vcpkg } if (arg == "--debug") { - parse_switch(opt_bool::ENABLED, "debug", args.debug); + parse_switch(opt_bool_t::ENABLED, "debug", args.debug); continue; } if (arg == "--sendmetrics") { - parse_switch(opt_bool::ENABLED, "sendmetrics", args.sendmetrics); + parse_switch(opt_bool_t::ENABLED, "sendmetrics", args.sendmetrics); continue; } if (arg == "--printmetrics") { - parse_switch(opt_bool::ENABLED, "printmetrics", args.printmetrics); + parse_switch(opt_bool_t::ENABLED, "printmetrics", args.printmetrics); continue; } if (arg == "--no-sendmetrics") { - parse_switch(opt_bool::DISABLED, "sendmetrics", args.sendmetrics); + parse_switch(opt_bool_t::DISABLED, "sendmetrics", args.sendmetrics); continue; } if (arg == "--no-printmetrics") { - parse_switch(opt_bool::DISABLED, "printmetrics", args.printmetrics); + parse_switch(opt_bool_t::DISABLED, "printmetrics", args.printmetrics); continue; } diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index e6fbfb65a..e0374774c 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -198,6 +198,7 @@ + Create Create diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index 7ddfba6f2..40bde1536 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -153,6 +153,9 @@ Source Files + + Source Files + -- cgit v1.2.3 From 459999786960483f6d46229524500543459968ed Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 31 Jan 2017 17:09:48 -0800 Subject: Introduce BuildPolicies (not used by the post_build checks yet) --- toolsrc/include/BuildInfo.h | 6 +++- toolsrc/include/BuildPolicies.h | 30 +++++++++++++++++++ toolsrc/src/BuildInfo.cpp | 16 ++++++++-- toolsrc/src/BuildPolicies.cpp | 49 +++++++++++++++++++++++++++++++ toolsrc/vcpkglib/vcpkglib.vcxproj | 2 ++ toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 6 ++++ 6 files changed, 105 insertions(+), 4 deletions(-) create mode 100644 toolsrc/include/BuildPolicies.h create mode 100644 toolsrc/src/BuildPolicies.cpp diff --git a/toolsrc/include/BuildInfo.h b/toolsrc/include/BuildInfo.h index c90ad7a4e..1fd032aa2 100644 --- a/toolsrc/include/BuildInfo.h +++ b/toolsrc/include/BuildInfo.h @@ -3,6 +3,8 @@ #include #include "Paragraphs.h" #include +#include "BuildPolicies.h" +#include "opt_bool.h" namespace vcpkg::PostBuildLint { @@ -119,10 +121,12 @@ namespace vcpkg::PostBuildLint struct BuildInfo { - static BuildInfo create(const std::unordered_map& pgh); + static BuildInfo create(std::unordered_map pgh); std::string crt_linkage; std::string library_linkage; + + std::map policies; }; BuildInfo read_build_info(const fs::path& filepath); diff --git a/toolsrc/include/BuildPolicies.h b/toolsrc/include/BuildPolicies.h new file mode 100644 index 000000000..fbe9b0ff3 --- /dev/null +++ b/toolsrc/include/BuildPolicies.h @@ -0,0 +1,30 @@ +#pragma once +#include + +namespace vcpkg::PostBuildLint::BuildPolicies +{ + enum class backing_enum_t + { + UNKNOWN = 0, + DLLS_WITHOUT_LIBS + }; + + struct type + { + static constexpr int length() { return 2; } + constexpr explicit type(backing_enum_t backing_enum) : backing_enum(backing_enum) { } + constexpr operator backing_enum_t() const { return backing_enum; } + + const std::string& toString() const; + const std::string& cmake_variable() const; + + private: + type(); + backing_enum_t backing_enum; + }; + + static constexpr type UNKNOWN(backing_enum_t::UNKNOWN); + static constexpr type DLLS_WITHOUT_LIBS(backing_enum_t::DLLS_WITHOUT_LIBS); + + type parse(const std::string& s); +} diff --git a/toolsrc/src/BuildInfo.cpp b/toolsrc/src/BuildInfo.cpp index b401f9d44..82243ebac 100644 --- a/toolsrc/src/BuildInfo.cpp +++ b/toolsrc/src/BuildInfo.cpp @@ -1,6 +1,7 @@ #include "pch.h" #include "BuildInfo.h" #include "vcpkg_Checks.h" +#include "opt_bool.h" #include "vcpkglib_helpers.h" namespace vcpkg::PostBuildLint @@ -44,11 +45,20 @@ namespace vcpkg::PostBuildLint static const std::string LIBRARY_LINKAGE = "LibraryLinkage"; } - BuildInfo BuildInfo::create(const std::unordered_map& pgh) + BuildInfo BuildInfo::create(std::unordered_map pgh) { BuildInfo build_info; - build_info.crt_linkage = details::required_field(pgh, BuildInfoRequiredField::CRT_LINKAGE); - build_info.library_linkage = details::required_field(pgh, BuildInfoRequiredField::LIBRARY_LINKAGE); + build_info.crt_linkage = details::remove_required_field(&pgh, BuildInfoRequiredField::CRT_LINKAGE); + build_info.library_linkage = details::remove_required_field(&pgh, BuildInfoRequiredField::LIBRARY_LINKAGE); + + // The remaining entries are policies + for (const std::unordered_map::value_type& p : pgh) + { + const BuildPolicies::type policy = BuildPolicies::parse(p.first); + Checks::check_exit(policy != BuildPolicies::UNKNOWN, "Unknown policy found: %s", p.first); + const opt_bool_t status = opt_bool::parse(p.second); + build_info.policies.emplace(policy, status); + } return build_info; } diff --git a/toolsrc/src/BuildPolicies.cpp b/toolsrc/src/BuildPolicies.cpp new file mode 100644 index 000000000..0f7c3c492 --- /dev/null +++ b/toolsrc/src/BuildPolicies.cpp @@ -0,0 +1,49 @@ +#include "pch.h" +#include "BuildPolicies.h" +#include "vcpkg_Checks.h" + +namespace vcpkg::PostBuildLint::BuildPolicies +{ + static const std::string NAME_UNKNOWN = "PolicyUnknown"; + static const std::string NAME_DLLS_WITHOUT_LIBS = "PolicyDLLsWithoutLIBs"; + + const std::string& type::toString() const + { + switch (this->backing_enum) + { + case DLLS_WITHOUT_LIBS: + return NAME_DLLS_WITHOUT_LIBS; + case UNKNOWN: + return NAME_UNKNOWN; + default: + Checks::unreachable(); + } + } + + const std::string& type::cmake_variable() const + { + static const std::string CMAKE_VARIABLE_DLLS_WITHOUT_LIBS = "VCPKG_POLICY_DLLS_WITHOUT_LIBS"; + + switch (this->backing_enum) + { + case DLLS_WITHOUT_LIBS: + return CMAKE_VARIABLE_DLLS_WITHOUT_LIBS; + case UNKNOWN: + Checks::exit_with_message("No CMake command corresponds to UNKNOWN"); + default: + Checks::unreachable(); + } + } + + type::type(): backing_enum(backing_enum_t::UNKNOWN) {} + + type parse(const std::string& s) + { + if (s == NAME_DLLS_WITHOUT_LIBS) + { + return BuildPolicies::DLLS_WITHOUT_LIBS; + } + + return BuildPolicies::UNKNOWN; + } +} diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index e0374774c..802198ccb 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -138,6 +138,7 @@ + @@ -176,6 +177,7 @@ + diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index 40bde1536..4461655d1 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -156,6 +156,9 @@ Source Files + + Source Files + @@ -266,5 +269,8 @@ Header Files + + Header Files + \ No newline at end of file -- cgit v1.2.3 From cd0b7d644b2ba61618b70ae58f50d2e880dbe509 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 31 Jan 2017 18:31:19 -0800 Subject: Add PolicyDLLsWithoutLIBs policy --- scripts/ports.cmake | 6 +++++- toolsrc/src/post_build_lint.cpp | 15 ++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/scripts/ports.cmake b/scripts/ports.cmake index 4e28cbb67..cc01a0619 100644 --- a/scripts/ports.cmake +++ b/scripts/ports.cmake @@ -74,7 +74,11 @@ if(CMD MATCHES "^BUILD$") set(BUILD_INFO_FILE_PATH ${CURRENT_PACKAGES_DIR}/BUILD_INFO) file(WRITE ${BUILD_INFO_FILE_PATH} "CRTLinkage: ${VCPKG_CRT_LINKAGE}\n") - file(APPEND ${BUILD_INFO_FILE_PATH} "LibraryLinkage: ${VCPKG_LIBRARY_LINKAGE}") + file(APPEND ${BUILD_INFO_FILE_PATH} "LibraryLinkage: ${VCPKG_LIBRARY_LINKAGE}\n") + + if (DEFINED VCPKG_POLICY_DLLS_WITHOUT_LIBS) + file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyDLLsWithoutLIBs: ${VCPKG_POLICY_DLLS_WITHOUT_LIBS}\n") + endif() elseif(CMD MATCHES "^CREATE$") file(TO_NATIVE_PATH ${VCPKG_ROOT_DIR} NATIVE_VCPKG_ROOT_DIR) file(TO_NATIVE_PATH ${DOWNLOADS} NATIVE_DOWNLOADS) diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index daf6f49ee..009f8019c 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -368,11 +368,20 @@ namespace vcpkg::PostBuildLint return lint_status::ERROR_DETECTED; } - static lint_status check_lib_files_are_available_if_dlls_are_available(const size_t lib_count, const size_t dll_count, const fs::path& lib_dir) + static lint_status check_lib_files_are_available_if_dlls_are_available(const std::map& policies, const size_t lib_count, const size_t dll_count, const fs::path& lib_dir) { + auto it = policies.find(BuildPolicies::DLLS_WITHOUT_LIBS); + if (it != policies.cend() && it->second == opt_bool_t::DISABLED) + { + return lint_status::SUCCESS; + } + if (lib_count == 0 && dll_count != 0) { System::println(System::color::warning, "Import libs were not present in %s", lib_dir.generic_string()); + System::println(System::color::warning, + "If this is intended, add the following line in the portfile:\n" + " SET(%s disabled)", BuildPolicies::DLLS_WITHOUT_LIBS.cmake_variable()); return lint_status::ERROR_DETECTED; } @@ -616,8 +625,8 @@ namespace vcpkg::PostBuildLint error_count += check_matching_debug_and_release_binaries(debug_dlls, release_dlls); - error_count += check_lib_files_are_available_if_dlls_are_available(debug_libs.size(), debug_dlls.size(), debug_lib_dir); - error_count += check_lib_files_are_available_if_dlls_are_available(release_libs.size(), release_dlls.size(), release_lib_dir); + error_count += check_lib_files_are_available_if_dlls_are_available(build_info.policies, debug_libs.size(), debug_dlls.size(), debug_lib_dir); + error_count += check_lib_files_are_available_if_dlls_are_available(build_info.policies, release_libs.size(), release_dlls.size(), release_lib_dir); std::vector dlls; dlls.insert(dlls.cend(), debug_dlls.cbegin(), debug_dlls.cend()); -- cgit v1.2.3 From c595fac0ffb8de45f390ab591fbc76fa12ca0442 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 31 Jan 2017 18:55:14 -0800 Subject: Add BuildPolicies::values() --- toolsrc/include/BuildPolicies.h | 4 +++- toolsrc/src/BuildPolicies.cpp | 18 ++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/toolsrc/include/BuildPolicies.h b/toolsrc/include/BuildPolicies.h index fbe9b0ff3..8298ffe2d 100644 --- a/toolsrc/include/BuildPolicies.h +++ b/toolsrc/include/BuildPolicies.h @@ -11,7 +11,6 @@ namespace vcpkg::PostBuildLint::BuildPolicies struct type { - static constexpr int length() { return 2; } constexpr explicit type(backing_enum_t backing_enum) : backing_enum(backing_enum) { } constexpr operator backing_enum_t() const { return backing_enum; } @@ -23,6 +22,9 @@ namespace vcpkg::PostBuildLint::BuildPolicies backing_enum_t backing_enum; }; + static constexpr int value_count = 2; + const std::vector& values(); + static constexpr type UNKNOWN(backing_enum_t::UNKNOWN); static constexpr type DLLS_WITHOUT_LIBS(backing_enum_t::DLLS_WITHOUT_LIBS); diff --git a/toolsrc/src/BuildPolicies.cpp b/toolsrc/src/BuildPolicies.cpp index 0f7c3c492..ed0f76c38 100644 --- a/toolsrc/src/BuildPolicies.cpp +++ b/toolsrc/src/BuildPolicies.cpp @@ -26,17 +26,23 @@ namespace vcpkg::PostBuildLint::BuildPolicies switch (this->backing_enum) { - case DLLS_WITHOUT_LIBS: - return CMAKE_VARIABLE_DLLS_WITHOUT_LIBS; - case UNKNOWN: - Checks::exit_with_message("No CMake command corresponds to UNKNOWN"); - default: - Checks::unreachable(); + case DLLS_WITHOUT_LIBS: + return CMAKE_VARIABLE_DLLS_WITHOUT_LIBS; + case UNKNOWN: + Checks::exit_with_message("No CMake command corresponds to UNKNOWN"); + default: + Checks::unreachable(); } } type::type(): backing_enum(backing_enum_t::UNKNOWN) {} + const std::vector& values() + { + static const std::vector& v = {UNKNOWN, DLLS_WITHOUT_LIBS}; + return v; + } + type parse(const std::string& s) { if (s == NAME_DLLS_WITHOUT_LIBS) -- cgit v1.2.3 From a3eaed8f1faacc03dc5abb56d2117096d3413735 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 1 Feb 2017 16:19:27 -0800 Subject: [vcpkg] Add /MP to base compilation flags, enabling parallel builds. --- scripts/cmake/vcpkg_configure_cmake.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 5db9b5d05..c524d12ed 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -53,8 +53,8 @@ function(vcpkg_configure_cmake) list(APPEND _csc_OPTIONS - "-DCMAKE_CXX_FLAGS= /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc" - "-DCMAKE_C_FLAGS= /DWIN32 /D_WINDOWS /W3 /utf-8" + "-DCMAKE_CXX_FLAGS= /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc /MP" + "-DCMAKE_C_FLAGS= /DWIN32 /D_WINDOWS /W3 /utf-8 /MP" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" -- cgit v1.2.3 From 9086fcebdf43ad01892c8f96afc5e676f9b72135 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 1 Feb 2017 13:24:06 -0800 Subject: Rename files in PostBuildLint namespace --- toolsrc/include/BuildInfo.h | 133 ----- toolsrc/include/BuildPolicies.h | 32 -- toolsrc/include/PostBuildLint.h | 8 + toolsrc/include/PostBuildLint_BuildInfo.h | 133 +++++ toolsrc/include/PostBuildLint_BuildPolicies.h | 32 ++ toolsrc/include/post_build_lint.h | 8 - toolsrc/src/BuildInfo.cpp | 175 ------- toolsrc/src/BuildPolicies.cpp | 55 --- toolsrc/src/PostBuildLint.cpp | 680 ++++++++++++++++++++++++++ toolsrc/src/PostBuildLint_BuildInfo.cpp | 175 +++++++ toolsrc/src/PostBuildLint_BuildPolicies.cpp | 55 +++ toolsrc/src/commands_build.cpp | 2 +- toolsrc/src/post_build_lint.cpp | 680 -------------------------- toolsrc/vcpkglib/vcpkglib.vcxproj | 12 +- toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 28 +- 15 files changed, 1104 insertions(+), 1104 deletions(-) delete mode 100644 toolsrc/include/BuildInfo.h delete mode 100644 toolsrc/include/BuildPolicies.h create mode 100644 toolsrc/include/PostBuildLint.h create mode 100644 toolsrc/include/PostBuildLint_BuildInfo.h create mode 100644 toolsrc/include/PostBuildLint_BuildPolicies.h delete mode 100644 toolsrc/include/post_build_lint.h delete mode 100644 toolsrc/src/BuildInfo.cpp delete mode 100644 toolsrc/src/BuildPolicies.cpp create mode 100644 toolsrc/src/PostBuildLint.cpp create mode 100644 toolsrc/src/PostBuildLint_BuildInfo.cpp create mode 100644 toolsrc/src/PostBuildLint_BuildPolicies.cpp delete mode 100644 toolsrc/src/post_build_lint.cpp diff --git a/toolsrc/include/BuildInfo.h b/toolsrc/include/BuildInfo.h deleted file mode 100644 index 1fd032aa2..000000000 --- a/toolsrc/include/BuildInfo.h +++ /dev/null @@ -1,133 +0,0 @@ -#pragma once - -#include -#include "Paragraphs.h" -#include -#include "BuildPolicies.h" -#include "opt_bool.h" - -namespace vcpkg::PostBuildLint -{ - enum class LinkageType - { - DYNAMIC, - STATIC, - UNKNOWN - }; - - LinkageType linkage_type_value_of(const std::string& as_string); - - std::string to_string(const LinkageType& build_info); - - enum class ConfigurationType - { - DEBUG = 1, - RELEASE = 2 - }; - - std::string to_string(const ConfigurationType& conf); - - struct BuildType - { - static BuildType value_of(const ConfigurationType& config, const LinkageType& linkage); - - static const BuildType DEBUG_STATIC; - static const BuildType DEBUG_DYNAMIC; - static const BuildType RELEASE_STATIC; - static const BuildType RELEASE_DYNAMIC; - - static const std::vector& values() - { - static const std::vector v = {DEBUG_STATIC, DEBUG_DYNAMIC, RELEASE_STATIC, RELEASE_DYNAMIC}; - return v; - } - - BuildType() = delete; - - const ConfigurationType& config() const; - const LinkageType& linkage() const; - std::regex crt_regex() const; - std::string toString() const; - - private: - BuildType(const ConfigurationType& config, const LinkageType& linkage, const std::string& crt_regex_as_string) - : m_config(config), m_linkage(linkage), m_crt_regex_as_string(crt_regex_as_string) - { - } - - ConfigurationType m_config; - LinkageType m_linkage; - std::string m_crt_regex_as_string; - }; - - bool operator ==(const BuildType& lhs, const BuildType& rhs); - - bool operator !=(const BuildType& lhs, const BuildType& rhs); - - struct OutdatedDynamicCrt - { - // Old CPP - static const OutdatedDynamicCrt MSVCP100_DLL; - static const OutdatedDynamicCrt MSVCP100D_DLL; - static const OutdatedDynamicCrt MSVCP110_DLL; - static const OutdatedDynamicCrt MSVCP110_WIN_DLL; - static const OutdatedDynamicCrt MSVCP120_DLL; - static const OutdatedDynamicCrt MSVCP120_CLR0400_DLL; - static const OutdatedDynamicCrt MSVCP60_DLL; - static const OutdatedDynamicCrt MSVCP_WIN_DLL; - - // Old C - static const OutdatedDynamicCrt MSVCR100_DLL; - static const OutdatedDynamicCrt MSVCR100D_DLL; - static const OutdatedDynamicCrt MSVCR100_CLR0400_DLL; - static const OutdatedDynamicCrt MSVCR110_DLL; - static const OutdatedDynamicCrt MSVCR120_DLL; - static const OutdatedDynamicCrt MSVCR120_CLR0400_DLL; - static const OutdatedDynamicCrt MSVCRT_DLL; - static const OutdatedDynamicCrt MSVCRT20_DLL; - static const OutdatedDynamicCrt MSVCRT40_DLL; - - static const std::vector& values() - { - static const std::vector v = { - MSVCP100_DLL, MSVCP100D_DLL, - MSVCP110_DLL,MSVCP110_WIN_DLL, - MSVCP120_DLL, MSVCP120_CLR0400_DLL, - MSVCP60_DLL, - MSVCP_WIN_DLL, - - MSVCR100_DLL, MSVCR100D_DLL, MSVCR100_CLR0400_DLL, - MSVCR110_DLL, - MSVCR120_DLL, MSVCR120_CLR0400_DLL, - MSVCRT_DLL, MSVCRT20_DLL,MSVCRT40_DLL - }; - return v; - } - - OutdatedDynamicCrt() = delete; - - std::regex crt_regex() const; - const std::string& toString() const; - - private: - explicit OutdatedDynamicCrt(const std::string& dll_name, const std::string& crt_regex_as_string) - : m_dll_name(dll_name), m_crt_regex_as_string(crt_regex_as_string) - { - } - - std::string m_dll_name; - std::string m_crt_regex_as_string; - }; - - struct BuildInfo - { - static BuildInfo create(std::unordered_map pgh); - - std::string crt_linkage; - std::string library_linkage; - - std::map policies; - }; - - BuildInfo read_build_info(const fs::path& filepath); -} diff --git a/toolsrc/include/BuildPolicies.h b/toolsrc/include/BuildPolicies.h deleted file mode 100644 index 8298ffe2d..000000000 --- a/toolsrc/include/BuildPolicies.h +++ /dev/null @@ -1,32 +0,0 @@ -#pragma once -#include - -namespace vcpkg::PostBuildLint::BuildPolicies -{ - enum class backing_enum_t - { - UNKNOWN = 0, - DLLS_WITHOUT_LIBS - }; - - struct type - { - constexpr explicit type(backing_enum_t backing_enum) : backing_enum(backing_enum) { } - constexpr operator backing_enum_t() const { return backing_enum; } - - const std::string& toString() const; - const std::string& cmake_variable() const; - - private: - type(); - backing_enum_t backing_enum; - }; - - static constexpr int value_count = 2; - const std::vector& values(); - - static constexpr type UNKNOWN(backing_enum_t::UNKNOWN); - static constexpr type DLLS_WITHOUT_LIBS(backing_enum_t::DLLS_WITHOUT_LIBS); - - type parse(const std::string& s); -} diff --git a/toolsrc/include/PostBuildLint.h b/toolsrc/include/PostBuildLint.h new file mode 100644 index 000000000..215a237aa --- /dev/null +++ b/toolsrc/include/PostBuildLint.h @@ -0,0 +1,8 @@ +#pragma once +#include "package_spec.h" +#include "vcpkg_paths.h" + +namespace vcpkg::PostBuildLint +{ + void perform_all_checks(const package_spec& spec, const vcpkg_paths& paths); +} diff --git a/toolsrc/include/PostBuildLint_BuildInfo.h b/toolsrc/include/PostBuildLint_BuildInfo.h new file mode 100644 index 000000000..cf444ce90 --- /dev/null +++ b/toolsrc/include/PostBuildLint_BuildInfo.h @@ -0,0 +1,133 @@ +#pragma once + +#include +#include "Paragraphs.h" +#include +#include "PostBuildLint_BuildPolicies.h" +#include "opt_bool.h" + +namespace vcpkg::PostBuildLint +{ + enum class LinkageType + { + DYNAMIC, + STATIC, + UNKNOWN + }; + + LinkageType linkage_type_value_of(const std::string& as_string); + + std::string to_string(const LinkageType& build_info); + + enum class ConfigurationType + { + DEBUG = 1, + RELEASE = 2 + }; + + std::string to_string(const ConfigurationType& conf); + + struct BuildType + { + static BuildType value_of(const ConfigurationType& config, const LinkageType& linkage); + + static const BuildType DEBUG_STATIC; + static const BuildType DEBUG_DYNAMIC; + static const BuildType RELEASE_STATIC; + static const BuildType RELEASE_DYNAMIC; + + static const std::vector& values() + { + static const std::vector v = {DEBUG_STATIC, DEBUG_DYNAMIC, RELEASE_STATIC, RELEASE_DYNAMIC}; + return v; + } + + BuildType() = delete; + + const ConfigurationType& config() const; + const LinkageType& linkage() const; + std::regex crt_regex() const; + std::string toString() const; + + private: + BuildType(const ConfigurationType& config, const LinkageType& linkage, const std::string& crt_regex_as_string) + : m_config(config), m_linkage(linkage), m_crt_regex_as_string(crt_regex_as_string) + { + } + + ConfigurationType m_config; + LinkageType m_linkage; + std::string m_crt_regex_as_string; + }; + + bool operator ==(const BuildType& lhs, const BuildType& rhs); + + bool operator !=(const BuildType& lhs, const BuildType& rhs); + + struct OutdatedDynamicCrt + { + // Old CPP + static const OutdatedDynamicCrt MSVCP100_DLL; + static const OutdatedDynamicCrt MSVCP100D_DLL; + static const OutdatedDynamicCrt MSVCP110_DLL; + static const OutdatedDynamicCrt MSVCP110_WIN_DLL; + static const OutdatedDynamicCrt MSVCP120_DLL; + static const OutdatedDynamicCrt MSVCP120_CLR0400_DLL; + static const OutdatedDynamicCrt MSVCP60_DLL; + static const OutdatedDynamicCrt MSVCP_WIN_DLL; + + // Old C + static const OutdatedDynamicCrt MSVCR100_DLL; + static const OutdatedDynamicCrt MSVCR100D_DLL; + static const OutdatedDynamicCrt MSVCR100_CLR0400_DLL; + static const OutdatedDynamicCrt MSVCR110_DLL; + static const OutdatedDynamicCrt MSVCR120_DLL; + static const OutdatedDynamicCrt MSVCR120_CLR0400_DLL; + static const OutdatedDynamicCrt MSVCRT_DLL; + static const OutdatedDynamicCrt MSVCRT20_DLL; + static const OutdatedDynamicCrt MSVCRT40_DLL; + + static const std::vector& values() + { + static const std::vector v = { + MSVCP100_DLL, MSVCP100D_DLL, + MSVCP110_DLL,MSVCP110_WIN_DLL, + MSVCP120_DLL, MSVCP120_CLR0400_DLL, + MSVCP60_DLL, + MSVCP_WIN_DLL, + + MSVCR100_DLL, MSVCR100D_DLL, MSVCR100_CLR0400_DLL, + MSVCR110_DLL, + MSVCR120_DLL, MSVCR120_CLR0400_DLL, + MSVCRT_DLL, MSVCRT20_DLL,MSVCRT40_DLL + }; + return v; + } + + OutdatedDynamicCrt() = delete; + + std::regex crt_regex() const; + const std::string& toString() const; + + private: + explicit OutdatedDynamicCrt(const std::string& dll_name, const std::string& crt_regex_as_string) + : m_dll_name(dll_name), m_crt_regex_as_string(crt_regex_as_string) + { + } + + std::string m_dll_name; + std::string m_crt_regex_as_string; + }; + + struct BuildInfo + { + static BuildInfo create(std::unordered_map pgh); + + std::string crt_linkage; + std::string library_linkage; + + std::map policies; + }; + + BuildInfo read_build_info(const fs::path& filepath); +} diff --git a/toolsrc/include/PostBuildLint_BuildPolicies.h b/toolsrc/include/PostBuildLint_BuildPolicies.h new file mode 100644 index 000000000..8298ffe2d --- /dev/null +++ b/toolsrc/include/PostBuildLint_BuildPolicies.h @@ -0,0 +1,32 @@ +#pragma once +#include + +namespace vcpkg::PostBuildLint::BuildPolicies +{ + enum class backing_enum_t + { + UNKNOWN = 0, + DLLS_WITHOUT_LIBS + }; + + struct type + { + constexpr explicit type(backing_enum_t backing_enum) : backing_enum(backing_enum) { } + constexpr operator backing_enum_t() const { return backing_enum; } + + const std::string& toString() const; + const std::string& cmake_variable() const; + + private: + type(); + backing_enum_t backing_enum; + }; + + static constexpr int value_count = 2; + const std::vector& values(); + + static constexpr type UNKNOWN(backing_enum_t::UNKNOWN); + static constexpr type DLLS_WITHOUT_LIBS(backing_enum_t::DLLS_WITHOUT_LIBS); + + type parse(const std::string& s); +} diff --git a/toolsrc/include/post_build_lint.h b/toolsrc/include/post_build_lint.h deleted file mode 100644 index 215a237aa..000000000 --- a/toolsrc/include/post_build_lint.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once -#include "package_spec.h" -#include "vcpkg_paths.h" - -namespace vcpkg::PostBuildLint -{ - void perform_all_checks(const package_spec& spec, const vcpkg_paths& paths); -} diff --git a/toolsrc/src/BuildInfo.cpp b/toolsrc/src/BuildInfo.cpp deleted file mode 100644 index 82243ebac..000000000 --- a/toolsrc/src/BuildInfo.cpp +++ /dev/null @@ -1,175 +0,0 @@ -#include "pch.h" -#include "BuildInfo.h" -#include "vcpkg_Checks.h" -#include "opt_bool.h" -#include "vcpkglib_helpers.h" - -namespace vcpkg::PostBuildLint -{ - const ConfigurationType& BuildType::config() const - { - return this->m_config; - } - - const LinkageType& BuildType::linkage() const - { - return this->m_linkage; - } - - std::regex BuildType::crt_regex() const - { - const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); - return r; - } - - std::string BuildType::toString() const - { - const std::string s = Strings::format("[%s,%s]", to_string(this->m_config), to_string(this->m_linkage)); - return s; - } - - bool operator==(const BuildType& lhs, const BuildType& rhs) - { - return lhs.config() == rhs.config() && lhs.linkage() == rhs.linkage(); - } - - bool operator!=(const BuildType& lhs, const BuildType& rhs) - { - return !(lhs == rhs); - } - - // - namespace BuildInfoRequiredField - { - static const std::string CRT_LINKAGE = "CRTLinkage"; - static const std::string LIBRARY_LINKAGE = "LibraryLinkage"; - } - - BuildInfo BuildInfo::create(std::unordered_map pgh) - { - BuildInfo build_info; - build_info.crt_linkage = details::remove_required_field(&pgh, BuildInfoRequiredField::CRT_LINKAGE); - build_info.library_linkage = details::remove_required_field(&pgh, BuildInfoRequiredField::LIBRARY_LINKAGE); - - // The remaining entries are policies - for (const std::unordered_map::value_type& p : pgh) - { - const BuildPolicies::type policy = BuildPolicies::parse(p.first); - Checks::check_exit(policy != BuildPolicies::UNKNOWN, "Unknown policy found: %s", p.first); - const opt_bool_t status = opt_bool::parse(p.second); - build_info.policies.emplace(policy, status); - } - - return build_info; - } - - const BuildType BuildType::DEBUG_STATIC = BuildType(ConfigurationType::DEBUG, LinkageType::STATIC, R"(/DEFAULTLIB:LIBCMTD)"); - const BuildType BuildType::DEBUG_DYNAMIC = BuildType(ConfigurationType::DEBUG, LinkageType::DYNAMIC, R"(/DEFAULTLIB:MSVCRTD)"); - const BuildType BuildType::RELEASE_STATIC = BuildType(ConfigurationType::RELEASE, LinkageType::STATIC, R"(/DEFAULTLIB:LIBCMT[^D])"); - const BuildType BuildType::RELEASE_DYNAMIC = BuildType(ConfigurationType::RELEASE, LinkageType::DYNAMIC, R"(/DEFAULTLIB:MSVCRT[^D])"); - - LinkageType linkage_type_value_of(const std::string& as_string) - - { - if (as_string == "dynamic") - { - return LinkageType::DYNAMIC; - } - - if (as_string == "static") - { - return LinkageType::STATIC; - } - - return LinkageType::UNKNOWN; - } - - std::string to_string(const LinkageType& build_info) - { - switch (build_info) - { - case LinkageType::STATIC: - return "static"; - case LinkageType::DYNAMIC: - return "dynamic"; - default: - Checks::unreachable(); - } - } - - std::string to_string(const ConfigurationType& conf) - { - switch (conf) - { - case ConfigurationType::DEBUG: - return "Debug"; - case ConfigurationType::RELEASE: - return "Release"; - default: - Checks::unreachable(); - } - } - - BuildType BuildType::value_of(const ConfigurationType& config, const LinkageType& linkage) - { - if (config == ConfigurationType::DEBUG && linkage == LinkageType::STATIC) - { - return DEBUG_STATIC; - } - - if (config == ConfigurationType::DEBUG && linkage == LinkageType::DYNAMIC) - { - return DEBUG_DYNAMIC; - } - - if (config == ConfigurationType::RELEASE && linkage == LinkageType::STATIC) - { - return RELEASE_STATIC; - } - - if (config == ConfigurationType::RELEASE && linkage == LinkageType::DYNAMIC) - { - return RELEASE_DYNAMIC; - } - - Checks::unreachable(); - } - - BuildInfo read_build_info(const fs::path& filepath) - { - const std::vector> pghs = Paragraphs::get_paragraphs(filepath); - Checks::check_exit(pghs.size() == 1, "Invalid BUILD_INFO file for package"); - - return BuildInfo::create(pghs[0]); - } - - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP100_DLL = OutdatedDynamicCrt("msvcp100.dll", R"(msvcp100\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP100D_DLL = OutdatedDynamicCrt("msvcp100d.dll", R"(msvcp100d\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP110_DLL = OutdatedDynamicCrt("msvcp110.dll", R"(msvcp110\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP110_WIN_DLL = OutdatedDynamicCrt("msvcp110_win.dll", R"(msvcp110_win\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP120_DLL = OutdatedDynamicCrt("msvcp120.dll", R"(msvcp120\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP120_CLR0400_DLL = OutdatedDynamicCrt("msvcp120_clr0400.dll", R"(msvcp120_clr0400\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP60_DLL = OutdatedDynamicCrt("msvcp60.dll", R"(msvcp60\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP_WIN_DLL = OutdatedDynamicCrt("msvcp60.dll", R"(msvcp60\.dll)");; - - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR100_DLL = OutdatedDynamicCrt("msvcr100.dll", R"(msvcr100\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR100D_DLL = OutdatedDynamicCrt("msvcr100d.dll", R"(msvcr100d\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR100_CLR0400_DLL = OutdatedDynamicCrt("msvcr100_clr0400.dll", R"(msvcr100_clr0400\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR110_DLL = OutdatedDynamicCrt("msvcr110.dll", R"(msvcr110\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR120_DLL = OutdatedDynamicCrt("msvcr120.dll", R"(msvcr120\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR120_CLR0400_DLL = OutdatedDynamicCrt("msvcr120_clr0400.dll", R"(msvcr120_clr0400\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCRT_DLL = OutdatedDynamicCrt("msvcrt.dll", R"(msvcrt\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCRT20_DLL = OutdatedDynamicCrt("msvcrt20.dll", R"(msvcrt20\.dll)");; - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCRT40_DLL = OutdatedDynamicCrt("msvcrt40.dll", R"(msvcrt40\.dll)");; - - std::regex OutdatedDynamicCrt::crt_regex() const - { - const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); - return r; - } - - const std::string& OutdatedDynamicCrt::toString() const - { - return this->m_dll_name; - } -} diff --git a/toolsrc/src/BuildPolicies.cpp b/toolsrc/src/BuildPolicies.cpp deleted file mode 100644 index ed0f76c38..000000000 --- a/toolsrc/src/BuildPolicies.cpp +++ /dev/null @@ -1,55 +0,0 @@ -#include "pch.h" -#include "BuildPolicies.h" -#include "vcpkg_Checks.h" - -namespace vcpkg::PostBuildLint::BuildPolicies -{ - static const std::string NAME_UNKNOWN = "PolicyUnknown"; - static const std::string NAME_DLLS_WITHOUT_LIBS = "PolicyDLLsWithoutLIBs"; - - const std::string& type::toString() const - { - switch (this->backing_enum) - { - case DLLS_WITHOUT_LIBS: - return NAME_DLLS_WITHOUT_LIBS; - case UNKNOWN: - return NAME_UNKNOWN; - default: - Checks::unreachable(); - } - } - - const std::string& type::cmake_variable() const - { - static const std::string CMAKE_VARIABLE_DLLS_WITHOUT_LIBS = "VCPKG_POLICY_DLLS_WITHOUT_LIBS"; - - switch (this->backing_enum) - { - case DLLS_WITHOUT_LIBS: - return CMAKE_VARIABLE_DLLS_WITHOUT_LIBS; - case UNKNOWN: - Checks::exit_with_message("No CMake command corresponds to UNKNOWN"); - default: - Checks::unreachable(); - } - } - - type::type(): backing_enum(backing_enum_t::UNKNOWN) {} - - const std::vector& values() - { - static const std::vector& v = {UNKNOWN, DLLS_WITHOUT_LIBS}; - return v; - } - - type parse(const std::string& s) - { - if (s == NAME_DLLS_WITHOUT_LIBS) - { - return BuildPolicies::DLLS_WITHOUT_LIBS; - } - - return BuildPolicies::UNKNOWN; - } -} diff --git a/toolsrc/src/PostBuildLint.cpp b/toolsrc/src/PostBuildLint.cpp new file mode 100644 index 000000000..e7e976383 --- /dev/null +++ b/toolsrc/src/PostBuildLint.cpp @@ -0,0 +1,680 @@ +#include "pch.h" +#include "vcpkg_paths.h" +#include "package_spec.h" +#include "vcpkg_Files.h" +#include "vcpkg_System.h" +#include "vcpkg_Environment.h" +#include "coff_file_reader.h" +#include "PostBuildLint_BuildInfo.h" + +namespace vcpkg::PostBuildLint +{ + enum class lint_status + { + SUCCESS = 0, + ERROR_DETECTED = 1 + }; + + static lint_status check_for_files_in_include_directory(const fs::path& package_dir) + { + const fs::path include_dir = package_dir / "include"; + if (!fs::exists(include_dir) || fs::is_empty(include_dir)) + { + System::println(System::color::warning, "The folder /include is empty. This indicates the library was not correctly installed."); + return lint_status::ERROR_DETECTED; + } + + return lint_status::SUCCESS; + } + + static lint_status check_for_files_in_debug_include_directory(const fs::path& package_dir) + { + const fs::path debug_include_dir = package_dir / "debug" / "include"; + std::vector files_found; + + Files::recursive_find_matching_paths_in_dir(debug_include_dir, [&](const fs::path& current) + { + return !fs::is_directory(current) && current.extension() != ".ifc"; + }, &files_found); + + if (!files_found.empty()) + { + System::println(System::color::warning, "Include files should not be duplicated into the /debug/include directory. If this cannot be disabled in the project cmake, use\n" + " file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)" + ); + return lint_status::ERROR_DETECTED; + } + + return lint_status::SUCCESS; + } + + static lint_status check_for_files_in_debug_share_directory(const fs::path& package_dir) + { + const fs::path debug_share = package_dir / "debug" / "share"; + + if (fs::exists(debug_share) && !fs::is_empty(debug_share)) + { + System::println(System::color::warning, "No files should be present in /debug/share"); + return lint_status::ERROR_DETECTED; + } + + return lint_status::SUCCESS; + } + + static lint_status check_folder_lib_cmake(const fs::path& package_dir) + { + const fs::path lib_cmake = package_dir / "lib" / "cmake"; + if (fs::exists(lib_cmake)) + { + System::println(System::color::warning, "The /lib/cmake folder should be moved to just /cmake"); + return lint_status::ERROR_DETECTED; + } + + return lint_status::SUCCESS; + } + + static lint_status check_for_misplaced_cmake_files(const fs::path& package_dir, const package_spec& spec) + { + std::vector misplaced_cmake_files; + Files::recursive_find_files_with_extension_in_dir(package_dir / "cmake", ".cmake", &misplaced_cmake_files); + Files::recursive_find_files_with_extension_in_dir(package_dir / "debug" / "cmake", ".cmake", &misplaced_cmake_files); + Files::recursive_find_files_with_extension_in_dir(package_dir / "lib" / "cmake", ".cmake", &misplaced_cmake_files); + Files::recursive_find_files_with_extension_in_dir(package_dir / "debug" / "lib" / "cmake", ".cmake", &misplaced_cmake_files); + + if (!misplaced_cmake_files.empty()) + { + System::println(System::color::warning, "The following cmake files were found outside /share/%s. Please place cmake files in /share/%s.", spec.name(), spec.name()); + Files::print_paths(misplaced_cmake_files); + return lint_status::ERROR_DETECTED; + } + + return lint_status::SUCCESS; + } + + static lint_status check_folder_debug_lib_cmake(const fs::path& package_dir) + { + const fs::path lib_cmake_debug = package_dir / "debug" / "lib" / "cmake"; + if (fs::exists(lib_cmake_debug)) + { + System::println(System::color::warning, "The /debug/lib/cmake folder should be moved to just /debug/cmake"); + return lint_status::ERROR_DETECTED; + } + + return lint_status::SUCCESS; + } + + static lint_status check_for_dlls_in_lib_dirs(const fs::path& package_dir) + { + std::vector dlls; + Files::recursive_find_files_with_extension_in_dir(package_dir / "lib", ".dll", &dlls); + Files::recursive_find_files_with_extension_in_dir(package_dir / "debug" / "lib", ".dll", &dlls); + + if (!dlls.empty()) + { + System::println(System::color::warning, "\nThe following dlls were found in /lib and /debug/lib. Please move them to /bin or /debug/bin, respectively."); + Files::print_paths(dlls); + return lint_status::ERROR_DETECTED; + } + + return lint_status::SUCCESS; + } + + static lint_status check_for_copyright_file(const package_spec& spec, const vcpkg_paths& paths) + { + const fs::path packages_dir = paths.packages / spec.dir(); + const fs::path copyright_file = packages_dir / "share" / spec.name() / "copyright"; + if (fs::exists(copyright_file)) + { + return lint_status::SUCCESS; + } + const fs::path current_buildtrees_dir = paths.buildtrees / spec.name(); + const fs::path current_buildtrees_dir_src = current_buildtrees_dir / "src"; + + std::vector potential_copyright_files; + // Only searching one level deep + for (auto it = fs::recursive_directory_iterator(current_buildtrees_dir_src); it != fs::recursive_directory_iterator(); ++it) + { + if (it.depth() > 1) + { + continue; + } + + const std::string filename = it->path().filename().string(); + if (filename == "LICENSE" || filename == "LICENSE.txt" || filename == "COPYING") + { + potential_copyright_files.push_back(it->path()); + } + } + + System::println(System::color::warning, "The software license must be available at ${CURRENT_PACKAGES_DIR}/share/%s/copyright .", spec.name()); + if (potential_copyright_files.size() == 1) // if there is only one candidate, provide the cmake lines needed to place it in the proper location + { + const fs::path found_file = potential_copyright_files[0]; + const fs::path relative_path = found_file.string().erase(0, current_buildtrees_dir.string().size() + 1); // The +1 is needed to remove the "/" + System::println("\n file(COPY ${CURRENT_BUILDTREES_DIR}/%s DESTINATION ${CURRENT_PACKAGES_DIR}/share/%s)\n" + " file(RENAME ${CURRENT_PACKAGES_DIR}/share/%s/%s ${CURRENT_PACKAGES_DIR}/share/%s/copyright)", + relative_path.generic_string(), spec.name(), spec.name(), found_file.filename().generic_string(), spec.name()); + return lint_status::ERROR_DETECTED; + } + + if (potential_copyright_files.size() > 1) + { + System::println(System::color::warning, "The following files are potential copyright files:"); + Files::print_paths(potential_copyright_files); + } + + System::println(" %s/share/%s/copyright", packages_dir.generic_string(), spec.name()); + return lint_status::ERROR_DETECTED; + } + + static lint_status check_for_exes(const fs::path& package_dir) + { + std::vector exes; + Files::recursive_find_files_with_extension_in_dir(package_dir / "bin", ".exe", &exes); + Files::recursive_find_files_with_extension_in_dir(package_dir / "debug" / "bin", ".exe", &exes); + + if (!exes.empty()) + { + System::println(System::color::warning, "The following EXEs were found in /bin and /debug/bin. EXEs are not valid distribution targets."); + Files::print_paths(exes); + return lint_status::ERROR_DETECTED; + } + + return lint_status::SUCCESS; + } + + static lint_status check_exports_of_dlls(const std::vector& dlls, const fs::path& dumpbin_exe) + { + std::vector dlls_with_no_exports; + for (const fs::path& dll : dlls) + { + const std::wstring cmd_line = Strings::wformat(LR"("%s" /exports "%s")", dumpbin_exe.native(), dll.native()); + System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd_line); + Checks::check_exit(ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line)); + + if (ec_data.output.find("ordinal hint RVA name") == std::string::npos) + { + dlls_with_no_exports.push_back(dll); + } + } + + if (!dlls_with_no_exports.empty()) + { + System::println(System::color::warning, "The following DLLs have no exports:"); + Files::print_paths(dlls_with_no_exports); + System::println(System::color::warning, "DLLs without any exports are likely a bug in the build script."); + return lint_status::ERROR_DETECTED; + } + + return lint_status::SUCCESS; + } + + static lint_status check_uwp_bit_of_dlls(const std::string& expected_system_name, const std::vector& dlls, const fs::path dumpbin_exe) + { + if (expected_system_name != "uwp") + { + return lint_status::SUCCESS; + } + + std::vector dlls_with_improper_uwp_bit; + for (const fs::path& dll : dlls) + { + const std::wstring cmd_line = Strings::wformat(LR"("%s" /headers "%s")", dumpbin_exe.native(), dll.native()); + System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd_line); + Checks::check_exit(ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line)); + + if (ec_data.output.find("App Container") == std::string::npos) + { + dlls_with_improper_uwp_bit.push_back(dll); + } + } + + if (!dlls_with_improper_uwp_bit.empty()) + { + System::println(System::color::warning, "The following DLLs do not have the App Container bit set:"); + Files::print_paths(dlls_with_improper_uwp_bit); + System::println(System::color::warning, "This bit is required for Windows Store apps."); + return lint_status::ERROR_DETECTED; + } + + return lint_status::SUCCESS; + } + + struct file_and_arch + { + fs::path file; + std::string actual_arch; + }; + + static std::string get_actual_architecture(const MachineType& machine_type) + { + switch (machine_type) + { + case MachineType::AMD64: + case MachineType::IA64: + return "x64"; + case MachineType::I386: + return "x86"; + case MachineType::ARM: + case MachineType::ARMNT: + return "arm"; + default: + return "Machine Type Code = " + std::to_string(static_cast(machine_type)); + } + } + + static void print_invalid_architecture_files(const std::string& expected_architecture, std::vector binaries_with_invalid_architecture) + { + System::println(System::color::warning, "The following files were built for an incorrect architecture:"); + System::println(""); + for (const file_and_arch& b : binaries_with_invalid_architecture) + { + System::println(" %s", b.file.generic_string()); + System::println("Expected %s, but was: %s", expected_architecture, b.actual_arch); + System::println(""); + } + } + + static lint_status check_dll_architecture(const std::string& expected_architecture, const std::vector& files) + { + std::vector binaries_with_invalid_architecture; + + for (const fs::path& file : files) + { + Checks::check_exit(file.extension() == ".dll", "The file extension was not .dll: %s", file.generic_string()); + COFFFileReader::dll_info info = COFFFileReader::read_dll(file); + const std::string actual_architecture = get_actual_architecture(info.machine_type); + + if (expected_architecture != actual_architecture) + { + binaries_with_invalid_architecture.push_back({file, actual_architecture}); + } + } + + if (!binaries_with_invalid_architecture.empty()) + { + print_invalid_architecture_files(expected_architecture, binaries_with_invalid_architecture); + return lint_status::ERROR_DETECTED; + } + + return lint_status::SUCCESS; + } + + static lint_status check_lib_architecture(const std::string& expected_architecture, const std::vector& files) + { + std::vector binaries_with_invalid_architecture; + + for (const fs::path& file : files) + { + Checks::check_exit(file.extension() == ".lib", "The file extension was not .lib: %s", file.generic_string()); + COFFFileReader::lib_info info = COFFFileReader::read_lib(file); + Checks::check_exit(info.machine_types.size() == 1, "Found more than 1 architecture in file %s", file.generic_string()); + + const std::string actual_architecture = get_actual_architecture(info.machine_types.at(0)); + if (expected_architecture != actual_architecture) + { + binaries_with_invalid_architecture.push_back({file, actual_architecture}); + } + } + + if (!binaries_with_invalid_architecture.empty()) + { + print_invalid_architecture_files(expected_architecture, binaries_with_invalid_architecture); + return lint_status::ERROR_DETECTED; + } + + return lint_status::SUCCESS; + } + + static lint_status check_no_dlls_present(const std::vector& dlls) + { + if (dlls.empty()) + { + return lint_status::SUCCESS; + } + + System::println(System::color::warning, "DLLs should not be present in a static build, but the following DLLs were found:"); + Files::print_paths(dlls); + return lint_status::ERROR_DETECTED; + } + + static lint_status check_matching_debug_and_release_binaries(const std::vector& debug_binaries, const std::vector& release_binaries) + { + const size_t debug_count = debug_binaries.size(); + const size_t release_count = release_binaries.size(); + if (debug_count == release_count) + { + return lint_status::SUCCESS; + } + + System::println(System::color::warning, "Mismatching number of debug and release binaries. Found %d for debug but %d for release.", debug_count, release_count); + System::println("Debug binaries"); + Files::print_paths(debug_binaries); + + System::println("Release binaries"); + Files::print_paths(release_binaries); + + if (debug_count == 0) + { + System::println(System::color::warning, "Debug binaries were not found"); + } + if (release_count == 0) + { + System::println(System::color::warning, "Release binaries were not found"); + } + + System::println(""); + + return lint_status::ERROR_DETECTED; + } + + static lint_status check_lib_files_are_available_if_dlls_are_available(const std::map& policies, const size_t lib_count, const size_t dll_count, const fs::path& lib_dir) + { + auto it = policies.find(BuildPolicies::DLLS_WITHOUT_LIBS); + if (it != policies.cend() && it->second == opt_bool_t::DISABLED) + { + return lint_status::SUCCESS; + } + + if (lib_count == 0 && dll_count != 0) + { + System::println(System::color::warning, "Import libs were not present in %s", lib_dir.generic_string()); + System::println(System::color::warning, + "If this is intended, add the following line in the portfile:\n" + " SET(%s disabled)", BuildPolicies::DLLS_WITHOUT_LIBS.cmake_variable()); + return lint_status::ERROR_DETECTED; + } + + return lint_status::SUCCESS; + } + + static lint_status check_no_subdirectories(const fs::path& dir) + { + const std::vector subdirectories = Files::recursive_find_matching_paths_in_dir(dir, [&](const fs::path& current) + { + return fs::is_directory(current); + }); + + if (!subdirectories.empty()) + { + System::println(System::color::warning, "Directory %s should have no subdirectories", dir.generic_string()); + System::println("The following subdirectories were found: "); + Files::print_paths(subdirectories); + return lint_status::ERROR_DETECTED; + } + + return lint_status::SUCCESS; + } + + static lint_status check_bin_folders_are_not_present_in_static_build(const fs::path& package_dir) + { + const fs::path bin = package_dir / "bin"; + const fs::path debug_bin = package_dir / "debug" / "bin"; + + if (!fs::exists(bin) && !fs::exists(debug_bin)) + { + return lint_status::SUCCESS; + } + + if (fs::exists(bin)) + { + System::println(System::color::warning, R"(There should be no bin\ directory in a static build, but %s is present.)", bin.generic_string()); + } + + if (fs::exists(debug_bin)) + { + System::println(System::color::warning, R"(There should be no debug\bin\ directory in a static build, but %s is present.)", debug_bin.generic_string()); + } + + System::println(System::color::warning, R"(If the creation of bin\ and/or debug\bin\ cannot be disabled, use this in the portfile to remove them)" "\n" + "\n" + R"###( if(VCPKG_LIBRARY_LINKAGE STREQUAL static))###""\n" + R"###( file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin))###""\n" + R"###( endif())###" + "\n" + ); + + return lint_status::ERROR_DETECTED; + } + + static lint_status check_no_empty_folders(const fs::path& dir) + { + const std::vector empty_directories = Files::recursive_find_matching_paths_in_dir(dir, [](const fs::path& current) + { + return fs::is_directory(current) && fs::is_empty(current); + }); + + if (!empty_directories.empty()) + { + System::println(System::color::warning, "There should be no empty directories in %s", dir.generic_string()); + System::println("The following empty directories were found: "); + Files::print_paths(empty_directories); + System::println(System::color::warning, "If a directory should be populated but is not, this might indicate an error in the portfile.\n" + "If the directories are not needed and their creation cannot be disabled, use something like this in the portfile to remove them)\n" + "\n" + R"###( file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/a/dir ${CURRENT_PACKAGES_DIR}/some/other/dir))###""\n" + "\n"); + return lint_status::ERROR_DETECTED; + } + + return lint_status::SUCCESS; + } + + struct BuildType_and_file + { + fs::path file; + BuildType build_type; + }; + + static lint_status check_crt_linkage_of_libs(const BuildType& expected_build_type, const std::vector& libs, const fs::path dumpbin_exe) + { + std::vector bad_build_types = BuildType::values(); + bad_build_types.erase(std::remove(bad_build_types.begin(), bad_build_types.end(), expected_build_type), bad_build_types.end()); + + std::vector libs_with_invalid_crt; + + for (const fs::path& lib : libs) + { + const std::wstring cmd_line = Strings::wformat(LR"("%s" /directives "%s")", dumpbin_exe.native(), lib.native()); + System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd_line); + Checks::check_exit(ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line)); + + for (const BuildType& bad_build_type : bad_build_types) + { + if (std::regex_search(ec_data.output.cbegin(), ec_data.output.cend(), bad_build_type.crt_regex())) + { + libs_with_invalid_crt.push_back({lib, bad_build_type}); + break; + } + } + } + + if (!libs_with_invalid_crt.empty()) + { + System::println(System::color::warning, "Expected %s crt linkage, but the following libs had invalid crt linkage:", expected_build_type.toString()); + System::println(""); + for (const BuildType_and_file btf : libs_with_invalid_crt) + { + System::println(" %s: %s", btf.file.generic_string(), btf.build_type.toString()); + } + System::println(""); + + System::println(System::color::warning, "To inspect the lib files, use:\n dumpbin.exe /directives mylibfile.lib"); + return lint_status::ERROR_DETECTED; + } + + return lint_status::SUCCESS; + } + + struct OutdatedDynamicCrt_and_file + { + fs::path file; + OutdatedDynamicCrt outdated_crt; + }; + + static lint_status check_outdated_crt_linkage_of_dlls(const std::vector& dlls, const fs::path dumpbin_exe) + { + const std::vector& outdated_crts = OutdatedDynamicCrt::values(); + + std::vector dlls_with_outdated_crt; + + for (const fs::path& dll : dlls) + { + const std::wstring cmd_line = Strings::wformat(LR"("%s" /dependents "%s")", dumpbin_exe.native(), dll.native()); + System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd_line); + Checks::check_exit(ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line)); + + for (const OutdatedDynamicCrt& outdated_crt : outdated_crts) + { + if (std::regex_search(ec_data.output.cbegin(), ec_data.output.cend(), outdated_crt.crt_regex())) + { + dlls_with_outdated_crt.push_back({dll, outdated_crt}); + break; + } + } + } + + if (!dlls_with_outdated_crt.empty()) + { + System::println(System::color::warning, "Detected outdated dynamic CRT in the following files:"); + System::println(""); + for (const OutdatedDynamicCrt_and_file btf : dlls_with_outdated_crt) + { + System::println(" %s: %s", btf.file.generic_string(), btf.outdated_crt.toString()); + } + System::println(""); + + System::println(System::color::warning, "To inspect the dll files, use:\n dumpbin.exe /dependents mydllfile.dll"); + return lint_status::ERROR_DETECTED; + } + + return lint_status::SUCCESS; + } + + static lint_status check_no_files_in_package_dir_and_debug_dir(const fs::path& package_dir) + { + std::vector misplaced_files; + + Files::non_recursive_find_matching_paths_in_dir(package_dir, [](const fs::path& current) + { + const std::string filename = current.filename().generic_string(); + return !fs::is_directory(current) && !((_stricmp(filename.c_str(), "CONTROL") == 0 || _stricmp(filename.c_str(), "BUILD_INFO") == 0)); + }, &misplaced_files); + + const fs::path debug_dir = package_dir / "debug"; + Files::non_recursive_find_all_files_in_dir(debug_dir, &misplaced_files); + + if (!misplaced_files.empty()) + { + System::println(System::color::warning, "The following files are placed in\n%s and\n%s: ", package_dir.generic_string(), debug_dir.generic_string()); + Files::print_paths(misplaced_files); + System::println(System::color::warning, "Files cannot be present in those directories.\n"); + return lint_status::ERROR_DETECTED; + } + + return lint_status::SUCCESS; + } + + static void operator +=(size_t& left, const lint_status& right) + { + left += static_cast(right); + } + + void perform_all_checks(const package_spec& spec, const vcpkg_paths& paths) + { + const fs::path dumpbin_exe = Environment::get_dumpbin_exe(paths); + + System::println("-- Performing post-build validation"); + + BuildInfo build_info = read_build_info(paths.build_info_file_path(spec)); + const fs::path package_dir = paths.package_dir(spec); + + size_t error_count = 0; + error_count += check_for_files_in_include_directory(package_dir); + error_count += check_for_files_in_debug_include_directory(package_dir); + error_count += check_for_files_in_debug_share_directory(package_dir); + error_count += check_folder_lib_cmake(package_dir); + error_count += check_for_misplaced_cmake_files(package_dir, spec); + error_count += check_folder_debug_lib_cmake(package_dir); + error_count += check_for_dlls_in_lib_dirs(package_dir); + error_count += check_for_copyright_file(spec, paths); + error_count += check_for_exes(package_dir); + + const fs::path debug_lib_dir = package_dir / "debug" / "lib"; + const fs::path release_lib_dir = package_dir / "lib"; + const fs::path debug_bin_dir = package_dir / "debug" / "bin"; + const fs::path release_bin_dir = package_dir / "bin"; + + const std::vector debug_libs = Files::recursive_find_files_with_extension_in_dir(debug_lib_dir, ".lib"); + const std::vector release_libs = Files::recursive_find_files_with_extension_in_dir(release_lib_dir, ".lib"); + + error_count += check_matching_debug_and_release_binaries(debug_libs, release_libs); + + std::vector libs; + libs.insert(libs.cend(), debug_libs.cbegin(), debug_libs.cend()); + libs.insert(libs.cend(), release_libs.cbegin(), release_libs.cend()); + + error_count += check_lib_architecture(spec.target_triplet().architecture(), libs); + + switch (linkage_type_value_of(build_info.library_linkage)) + { + case LinkageType::DYNAMIC: + { + const std::vector debug_dlls = Files::recursive_find_files_with_extension_in_dir(debug_bin_dir, ".dll"); + const std::vector release_dlls = Files::recursive_find_files_with_extension_in_dir(release_bin_dir, ".dll"); + + error_count += check_matching_debug_and_release_binaries(debug_dlls, release_dlls); + + error_count += check_lib_files_are_available_if_dlls_are_available(build_info.policies, debug_libs.size(), debug_dlls.size(), debug_lib_dir); + error_count += check_lib_files_are_available_if_dlls_are_available(build_info.policies, release_libs.size(), release_dlls.size(), release_lib_dir); + + std::vector dlls; + dlls.insert(dlls.cend(), debug_dlls.cbegin(), debug_dlls.cend()); + dlls.insert(dlls.cend(), release_dlls.cbegin(), release_dlls.cend()); + + error_count += check_exports_of_dlls(dlls, dumpbin_exe); + error_count += check_uwp_bit_of_dlls(spec.target_triplet().system(), dlls, dumpbin_exe); + error_count += check_dll_architecture(spec.target_triplet().architecture(), dlls); + + error_count += check_outdated_crt_linkage_of_dlls(dlls, dumpbin_exe); + break; + } + case LinkageType::STATIC: + { + std::vector dlls; + Files::recursive_find_files_with_extension_in_dir(package_dir, ".dll", &dlls); + error_count += check_no_dlls_present(dlls); + + error_count += check_bin_folders_are_not_present_in_static_build(package_dir); + + error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::DEBUG, linkage_type_value_of(build_info.crt_linkage)), debug_libs, dumpbin_exe); + error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::RELEASE, linkage_type_value_of(build_info.crt_linkage)), release_libs, dumpbin_exe); + break; + } + case LinkageType::UNKNOWN: + { + error_count += 1; + System::println(System::color::warning, "Unknown library_linkage architecture: [ %s ]", build_info.library_linkage); + break; + } + default: + Checks::unreachable(); + } +#if 0 + error_count += check_no_subdirectories(package_dir / "lib"); + error_count += check_no_subdirectories(package_dir / "debug" / "lib"); +#endif + + error_count += check_no_empty_folders(package_dir); + error_count += check_no_files_in_package_dir_and_debug_dir(package_dir); + + if (error_count != 0) + { + const fs::path portfile = paths.ports / spec.name() / "portfile.cmake"; + System::println(System::color::error, "Found %u error(s). Please correct the portfile:\n %s", error_count, portfile.string()); + exit(EXIT_FAILURE); + } + + System::println("-- Performing post-build validation done"); + } +} diff --git a/toolsrc/src/PostBuildLint_BuildInfo.cpp b/toolsrc/src/PostBuildLint_BuildInfo.cpp new file mode 100644 index 000000000..59896e168 --- /dev/null +++ b/toolsrc/src/PostBuildLint_BuildInfo.cpp @@ -0,0 +1,175 @@ +#include "pch.h" +#include "PostBuildLint_BuildInfo.h" +#include "vcpkg_Checks.h" +#include "opt_bool.h" +#include "vcpkglib_helpers.h" + +namespace vcpkg::PostBuildLint +{ + const ConfigurationType& BuildType::config() const + { + return this->m_config; + } + + const LinkageType& BuildType::linkage() const + { + return this->m_linkage; + } + + std::regex BuildType::crt_regex() const + { + const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); + return r; + } + + std::string BuildType::toString() const + { + const std::string s = Strings::format("[%s,%s]", to_string(this->m_config), to_string(this->m_linkage)); + return s; + } + + bool operator==(const BuildType& lhs, const BuildType& rhs) + { + return lhs.config() == rhs.config() && lhs.linkage() == rhs.linkage(); + } + + bool operator!=(const BuildType& lhs, const BuildType& rhs) + { + return !(lhs == rhs); + } + + // + namespace BuildInfoRequiredField + { + static const std::string CRT_LINKAGE = "CRTLinkage"; + static const std::string LIBRARY_LINKAGE = "LibraryLinkage"; + } + + BuildInfo BuildInfo::create(std::unordered_map pgh) + { + BuildInfo build_info; + build_info.crt_linkage = details::remove_required_field(&pgh, BuildInfoRequiredField::CRT_LINKAGE); + build_info.library_linkage = details::remove_required_field(&pgh, BuildInfoRequiredField::LIBRARY_LINKAGE); + + // The remaining entries are policies + for (const std::unordered_map::value_type& p : pgh) + { + const BuildPolicies::type policy = BuildPolicies::parse(p.first); + Checks::check_exit(policy != BuildPolicies::UNKNOWN, "Unknown policy found: %s", p.first); + const opt_bool_t status = opt_bool::parse(p.second); + build_info.policies.emplace(policy, status); + } + + return build_info; + } + + const BuildType BuildType::DEBUG_STATIC = BuildType(ConfigurationType::DEBUG, LinkageType::STATIC, R"(/DEFAULTLIB:LIBCMTD)"); + const BuildType BuildType::DEBUG_DYNAMIC = BuildType(ConfigurationType::DEBUG, LinkageType::DYNAMIC, R"(/DEFAULTLIB:MSVCRTD)"); + const BuildType BuildType::RELEASE_STATIC = BuildType(ConfigurationType::RELEASE, LinkageType::STATIC, R"(/DEFAULTLIB:LIBCMT[^D])"); + const BuildType BuildType::RELEASE_DYNAMIC = BuildType(ConfigurationType::RELEASE, LinkageType::DYNAMIC, R"(/DEFAULTLIB:MSVCRT[^D])"); + + LinkageType linkage_type_value_of(const std::string& as_string) + + { + if (as_string == "dynamic") + { + return LinkageType::DYNAMIC; + } + + if (as_string == "static") + { + return LinkageType::STATIC; + } + + return LinkageType::UNKNOWN; + } + + std::string to_string(const LinkageType& build_info) + { + switch (build_info) + { + case LinkageType::STATIC: + return "static"; + case LinkageType::DYNAMIC: + return "dynamic"; + default: + Checks::unreachable(); + } + } + + std::string to_string(const ConfigurationType& conf) + { + switch (conf) + { + case ConfigurationType::DEBUG: + return "Debug"; + case ConfigurationType::RELEASE: + return "Release"; + default: + Checks::unreachable(); + } + } + + BuildType BuildType::value_of(const ConfigurationType& config, const LinkageType& linkage) + { + if (config == ConfigurationType::DEBUG && linkage == LinkageType::STATIC) + { + return DEBUG_STATIC; + } + + if (config == ConfigurationType::DEBUG && linkage == LinkageType::DYNAMIC) + { + return DEBUG_DYNAMIC; + } + + if (config == ConfigurationType::RELEASE && linkage == LinkageType::STATIC) + { + return RELEASE_STATIC; + } + + if (config == ConfigurationType::RELEASE && linkage == LinkageType::DYNAMIC) + { + return RELEASE_DYNAMIC; + } + + Checks::unreachable(); + } + + BuildInfo read_build_info(const fs::path& filepath) + { + const std::vector> pghs = Paragraphs::get_paragraphs(filepath); + Checks::check_exit(pghs.size() == 1, "Invalid BUILD_INFO file for package"); + + return BuildInfo::create(pghs[0]); + } + + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP100_DLL = OutdatedDynamicCrt("msvcp100.dll", R"(msvcp100\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP100D_DLL = OutdatedDynamicCrt("msvcp100d.dll", R"(msvcp100d\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP110_DLL = OutdatedDynamicCrt("msvcp110.dll", R"(msvcp110\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP110_WIN_DLL = OutdatedDynamicCrt("msvcp110_win.dll", R"(msvcp110_win\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP120_DLL = OutdatedDynamicCrt("msvcp120.dll", R"(msvcp120\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP120_CLR0400_DLL = OutdatedDynamicCrt("msvcp120_clr0400.dll", R"(msvcp120_clr0400\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP60_DLL = OutdatedDynamicCrt("msvcp60.dll", R"(msvcp60\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP_WIN_DLL = OutdatedDynamicCrt("msvcp60.dll", R"(msvcp60\.dll)");; + + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR100_DLL = OutdatedDynamicCrt("msvcr100.dll", R"(msvcr100\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR100D_DLL = OutdatedDynamicCrt("msvcr100d.dll", R"(msvcr100d\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR100_CLR0400_DLL = OutdatedDynamicCrt("msvcr100_clr0400.dll", R"(msvcr100_clr0400\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR110_DLL = OutdatedDynamicCrt("msvcr110.dll", R"(msvcr110\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR120_DLL = OutdatedDynamicCrt("msvcr120.dll", R"(msvcr120\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR120_CLR0400_DLL = OutdatedDynamicCrt("msvcr120_clr0400.dll", R"(msvcr120_clr0400\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCRT_DLL = OutdatedDynamicCrt("msvcrt.dll", R"(msvcrt\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCRT20_DLL = OutdatedDynamicCrt("msvcrt20.dll", R"(msvcrt20\.dll)");; + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCRT40_DLL = OutdatedDynamicCrt("msvcrt40.dll", R"(msvcrt40\.dll)");; + + std::regex OutdatedDynamicCrt::crt_regex() const + { + const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); + return r; + } + + const std::string& OutdatedDynamicCrt::toString() const + { + return this->m_dll_name; + } +} diff --git a/toolsrc/src/PostBuildLint_BuildPolicies.cpp b/toolsrc/src/PostBuildLint_BuildPolicies.cpp new file mode 100644 index 000000000..d7d67c991 --- /dev/null +++ b/toolsrc/src/PostBuildLint_BuildPolicies.cpp @@ -0,0 +1,55 @@ +#include "pch.h" +#include "PostBuildLint_BuildPolicies.h" +#include "vcpkg_Checks.h" + +namespace vcpkg::PostBuildLint::BuildPolicies +{ + static const std::string NAME_UNKNOWN = "PolicyUnknown"; + static const std::string NAME_DLLS_WITHOUT_LIBS = "PolicyDLLsWithoutLIBs"; + + const std::string& type::toString() const + { + switch (this->backing_enum) + { + case DLLS_WITHOUT_LIBS: + return NAME_DLLS_WITHOUT_LIBS; + case UNKNOWN: + return NAME_UNKNOWN; + default: + Checks::unreachable(); + } + } + + const std::string& type::cmake_variable() const + { + static const std::string CMAKE_VARIABLE_DLLS_WITHOUT_LIBS = "VCPKG_POLICY_DLLS_WITHOUT_LIBS"; + + switch (this->backing_enum) + { + case DLLS_WITHOUT_LIBS: + return CMAKE_VARIABLE_DLLS_WITHOUT_LIBS; + case UNKNOWN: + Checks::exit_with_message("No CMake command corresponds to UNKNOWN"); + default: + Checks::unreachable(); + } + } + + type::type(): backing_enum(backing_enum_t::UNKNOWN) {} + + const std::vector& values() + { + static const std::vector& v = {UNKNOWN, DLLS_WITHOUT_LIBS}; + return v; + } + + type parse(const std::string& s) + { + if (s == NAME_DLLS_WITHOUT_LIBS) + { + return BuildPolicies::DLLS_WITHOUT_LIBS; + } + + return BuildPolicies::UNKNOWN; + } +} diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index ccc3c8d9f..c5a278450 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -3,7 +3,7 @@ #include "StatusParagraphs.h" #include "vcpkglib.h" #include "vcpkg_Input.h" -#include "post_build_lint.h" +#include "PostBuildLint.h" #include "vcpkg_Dependencies.h" #include "vcpkg_System.h" #include "vcpkg_Environment.h" diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp deleted file mode 100644 index 009f8019c..000000000 --- a/toolsrc/src/post_build_lint.cpp +++ /dev/null @@ -1,680 +0,0 @@ -#include "pch.h" -#include "vcpkg_paths.h" -#include "package_spec.h" -#include "vcpkg_Files.h" -#include "vcpkg_System.h" -#include "vcpkg_Environment.h" -#include "coff_file_reader.h" -#include "BuildInfo.h" - -namespace vcpkg::PostBuildLint -{ - enum class lint_status - { - SUCCESS = 0, - ERROR_DETECTED = 1 - }; - - static lint_status check_for_files_in_include_directory(const fs::path& package_dir) - { - const fs::path include_dir = package_dir / "include"; - if (!fs::exists(include_dir) || fs::is_empty(include_dir)) - { - System::println(System::color::warning, "The folder /include is empty. This indicates the library was not correctly installed."); - return lint_status::ERROR_DETECTED; - } - - return lint_status::SUCCESS; - } - - static lint_status check_for_files_in_debug_include_directory(const fs::path& package_dir) - { - const fs::path debug_include_dir = package_dir / "debug" / "include"; - std::vector files_found; - - Files::recursive_find_matching_paths_in_dir(debug_include_dir, [&](const fs::path& current) - { - return !fs::is_directory(current) && current.extension() != ".ifc"; - }, &files_found); - - if (!files_found.empty()) - { - System::println(System::color::warning, "Include files should not be duplicated into the /debug/include directory. If this cannot be disabled in the project cmake, use\n" - " file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)" - ); - return lint_status::ERROR_DETECTED; - } - - return lint_status::SUCCESS; - } - - static lint_status check_for_files_in_debug_share_directory(const fs::path& package_dir) - { - const fs::path debug_share = package_dir / "debug" / "share"; - - if (fs::exists(debug_share) && !fs::is_empty(debug_share)) - { - System::println(System::color::warning, "No files should be present in /debug/share"); - return lint_status::ERROR_DETECTED; - } - - return lint_status::SUCCESS; - } - - static lint_status check_folder_lib_cmake(const fs::path& package_dir) - { - const fs::path lib_cmake = package_dir / "lib" / "cmake"; - if (fs::exists(lib_cmake)) - { - System::println(System::color::warning, "The /lib/cmake folder should be moved to just /cmake"); - return lint_status::ERROR_DETECTED; - } - - return lint_status::SUCCESS; - } - - static lint_status check_for_misplaced_cmake_files(const fs::path& package_dir, const package_spec& spec) - { - std::vector misplaced_cmake_files; - Files::recursive_find_files_with_extension_in_dir(package_dir / "cmake", ".cmake", &misplaced_cmake_files); - Files::recursive_find_files_with_extension_in_dir(package_dir / "debug" / "cmake", ".cmake", &misplaced_cmake_files); - Files::recursive_find_files_with_extension_in_dir(package_dir / "lib" / "cmake", ".cmake", &misplaced_cmake_files); - Files::recursive_find_files_with_extension_in_dir(package_dir / "debug" / "lib" / "cmake", ".cmake", &misplaced_cmake_files); - - if (!misplaced_cmake_files.empty()) - { - System::println(System::color::warning, "The following cmake files were found outside /share/%s. Please place cmake files in /share/%s.", spec.name(), spec.name()); - Files::print_paths(misplaced_cmake_files); - return lint_status::ERROR_DETECTED; - } - - return lint_status::SUCCESS; - } - - static lint_status check_folder_debug_lib_cmake(const fs::path& package_dir) - { - const fs::path lib_cmake_debug = package_dir / "debug" / "lib" / "cmake"; - if (fs::exists(lib_cmake_debug)) - { - System::println(System::color::warning, "The /debug/lib/cmake folder should be moved to just /debug/cmake"); - return lint_status::ERROR_DETECTED; - } - - return lint_status::SUCCESS; - } - - static lint_status check_for_dlls_in_lib_dirs(const fs::path& package_dir) - { - std::vector dlls; - Files::recursive_find_files_with_extension_in_dir(package_dir / "lib", ".dll", &dlls); - Files::recursive_find_files_with_extension_in_dir(package_dir / "debug" / "lib", ".dll", &dlls); - - if (!dlls.empty()) - { - System::println(System::color::warning, "\nThe following dlls were found in /lib and /debug/lib. Please move them to /bin or /debug/bin, respectively."); - Files::print_paths(dlls); - return lint_status::ERROR_DETECTED; - } - - return lint_status::SUCCESS; - } - - static lint_status check_for_copyright_file(const package_spec& spec, const vcpkg_paths& paths) - { - const fs::path packages_dir = paths.packages / spec.dir(); - const fs::path copyright_file = packages_dir / "share" / spec.name() / "copyright"; - if (fs::exists(copyright_file)) - { - return lint_status::SUCCESS; - } - const fs::path current_buildtrees_dir = paths.buildtrees / spec.name(); - const fs::path current_buildtrees_dir_src = current_buildtrees_dir / "src"; - - std::vector potential_copyright_files; - // Only searching one level deep - for (auto it = fs::recursive_directory_iterator(current_buildtrees_dir_src); it != fs::recursive_directory_iterator(); ++it) - { - if (it.depth() > 1) - { - continue; - } - - const std::string filename = it->path().filename().string(); - if (filename == "LICENSE" || filename == "LICENSE.txt" || filename == "COPYING") - { - potential_copyright_files.push_back(it->path()); - } - } - - System::println(System::color::warning, "The software license must be available at ${CURRENT_PACKAGES_DIR}/share/%s/copyright .", spec.name()); - if (potential_copyright_files.size() == 1) // if there is only one candidate, provide the cmake lines needed to place it in the proper location - { - const fs::path found_file = potential_copyright_files[0]; - const fs::path relative_path = found_file.string().erase(0, current_buildtrees_dir.string().size() + 1); // The +1 is needed to remove the "/" - System::println("\n file(COPY ${CURRENT_BUILDTREES_DIR}/%s DESTINATION ${CURRENT_PACKAGES_DIR}/share/%s)\n" - " file(RENAME ${CURRENT_PACKAGES_DIR}/share/%s/%s ${CURRENT_PACKAGES_DIR}/share/%s/copyright)", - relative_path.generic_string(), spec.name(), spec.name(), found_file.filename().generic_string(), spec.name()); - return lint_status::ERROR_DETECTED; - } - - if (potential_copyright_files.size() > 1) - { - System::println(System::color::warning, "The following files are potential copyright files:"); - Files::print_paths(potential_copyright_files); - } - - System::println(" %s/share/%s/copyright", packages_dir.generic_string(), spec.name()); - return lint_status::ERROR_DETECTED; - } - - static lint_status check_for_exes(const fs::path& package_dir) - { - std::vector exes; - Files::recursive_find_files_with_extension_in_dir(package_dir / "bin", ".exe", &exes); - Files::recursive_find_files_with_extension_in_dir(package_dir / "debug" / "bin", ".exe", &exes); - - if (!exes.empty()) - { - System::println(System::color::warning, "The following EXEs were found in /bin and /debug/bin. EXEs are not valid distribution targets."); - Files::print_paths(exes); - return lint_status::ERROR_DETECTED; - } - - return lint_status::SUCCESS; - } - - static lint_status check_exports_of_dlls(const std::vector& dlls, const fs::path& dumpbin_exe) - { - std::vector dlls_with_no_exports; - for (const fs::path& dll : dlls) - { - const std::wstring cmd_line = Strings::wformat(LR"("%s" /exports "%s")", dumpbin_exe.native(), dll.native()); - System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd_line); - Checks::check_exit(ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line)); - - if (ec_data.output.find("ordinal hint RVA name") == std::string::npos) - { - dlls_with_no_exports.push_back(dll); - } - } - - if (!dlls_with_no_exports.empty()) - { - System::println(System::color::warning, "The following DLLs have no exports:"); - Files::print_paths(dlls_with_no_exports); - System::println(System::color::warning, "DLLs without any exports are likely a bug in the build script."); - return lint_status::ERROR_DETECTED; - } - - return lint_status::SUCCESS; - } - - static lint_status check_uwp_bit_of_dlls(const std::string& expected_system_name, const std::vector& dlls, const fs::path dumpbin_exe) - { - if (expected_system_name != "uwp") - { - return lint_status::SUCCESS; - } - - std::vector dlls_with_improper_uwp_bit; - for (const fs::path& dll : dlls) - { - const std::wstring cmd_line = Strings::wformat(LR"("%s" /headers "%s")", dumpbin_exe.native(), dll.native()); - System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd_line); - Checks::check_exit(ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line)); - - if (ec_data.output.find("App Container") == std::string::npos) - { - dlls_with_improper_uwp_bit.push_back(dll); - } - } - - if (!dlls_with_improper_uwp_bit.empty()) - { - System::println(System::color::warning, "The following DLLs do not have the App Container bit set:"); - Files::print_paths(dlls_with_improper_uwp_bit); - System::println(System::color::warning, "This bit is required for Windows Store apps."); - return lint_status::ERROR_DETECTED; - } - - return lint_status::SUCCESS; - } - - struct file_and_arch - { - fs::path file; - std::string actual_arch; - }; - - static std::string get_actual_architecture(const MachineType& machine_type) - { - switch (machine_type) - { - case MachineType::AMD64: - case MachineType::IA64: - return "x64"; - case MachineType::I386: - return "x86"; - case MachineType::ARM: - case MachineType::ARMNT: - return "arm"; - default: - return "Machine Type Code = " + std::to_string(static_cast(machine_type)); - } - } - - static void print_invalid_architecture_files(const std::string& expected_architecture, std::vector binaries_with_invalid_architecture) - { - System::println(System::color::warning, "The following files were built for an incorrect architecture:"); - System::println(""); - for (const file_and_arch& b : binaries_with_invalid_architecture) - { - System::println(" %s", b.file.generic_string()); - System::println("Expected %s, but was: %s", expected_architecture, b.actual_arch); - System::println(""); - } - } - - static lint_status check_dll_architecture(const std::string& expected_architecture, const std::vector& files) - { - std::vector binaries_with_invalid_architecture; - - for (const fs::path& file : files) - { - Checks::check_exit(file.extension() == ".dll", "The file extension was not .dll: %s", file.generic_string()); - COFFFileReader::dll_info info = COFFFileReader::read_dll(file); - const std::string actual_architecture = get_actual_architecture(info.machine_type); - - if (expected_architecture != actual_architecture) - { - binaries_with_invalid_architecture.push_back({file, actual_architecture}); - } - } - - if (!binaries_with_invalid_architecture.empty()) - { - print_invalid_architecture_files(expected_architecture, binaries_with_invalid_architecture); - return lint_status::ERROR_DETECTED; - } - - return lint_status::SUCCESS; - } - - static lint_status check_lib_architecture(const std::string& expected_architecture, const std::vector& files) - { - std::vector binaries_with_invalid_architecture; - - for (const fs::path& file : files) - { - Checks::check_exit(file.extension() == ".lib", "The file extension was not .lib: %s", file.generic_string()); - COFFFileReader::lib_info info = COFFFileReader::read_lib(file); - Checks::check_exit(info.machine_types.size() == 1, "Found more than 1 architecture in file %s", file.generic_string()); - - const std::string actual_architecture = get_actual_architecture(info.machine_types.at(0)); - if (expected_architecture != actual_architecture) - { - binaries_with_invalid_architecture.push_back({file, actual_architecture}); - } - } - - if (!binaries_with_invalid_architecture.empty()) - { - print_invalid_architecture_files(expected_architecture, binaries_with_invalid_architecture); - return lint_status::ERROR_DETECTED; - } - - return lint_status::SUCCESS; - } - - static lint_status check_no_dlls_present(const std::vector& dlls) - { - if (dlls.empty()) - { - return lint_status::SUCCESS; - } - - System::println(System::color::warning, "DLLs should not be present in a static build, but the following DLLs were found:"); - Files::print_paths(dlls); - return lint_status::ERROR_DETECTED; - } - - static lint_status check_matching_debug_and_release_binaries(const std::vector& debug_binaries, const std::vector& release_binaries) - { - const size_t debug_count = debug_binaries.size(); - const size_t release_count = release_binaries.size(); - if (debug_count == release_count) - { - return lint_status::SUCCESS; - } - - System::println(System::color::warning, "Mismatching number of debug and release binaries. Found %d for debug but %d for release.", debug_count, release_count); - System::println("Debug binaries"); - Files::print_paths(debug_binaries); - - System::println("Release binaries"); - Files::print_paths(release_binaries); - - if (debug_count == 0) - { - System::println(System::color::warning, "Debug binaries were not found"); - } - if (release_count == 0) - { - System::println(System::color::warning, "Release binaries were not found"); - } - - System::println(""); - - return lint_status::ERROR_DETECTED; - } - - static lint_status check_lib_files_are_available_if_dlls_are_available(const std::map& policies, const size_t lib_count, const size_t dll_count, const fs::path& lib_dir) - { - auto it = policies.find(BuildPolicies::DLLS_WITHOUT_LIBS); - if (it != policies.cend() && it->second == opt_bool_t::DISABLED) - { - return lint_status::SUCCESS; - } - - if (lib_count == 0 && dll_count != 0) - { - System::println(System::color::warning, "Import libs were not present in %s", lib_dir.generic_string()); - System::println(System::color::warning, - "If this is intended, add the following line in the portfile:\n" - " SET(%s disabled)", BuildPolicies::DLLS_WITHOUT_LIBS.cmake_variable()); - return lint_status::ERROR_DETECTED; - } - - return lint_status::SUCCESS; - } - - static lint_status check_no_subdirectories(const fs::path& dir) - { - const std::vector subdirectories = Files::recursive_find_matching_paths_in_dir(dir, [&](const fs::path& current) - { - return fs::is_directory(current); - }); - - if (!subdirectories.empty()) - { - System::println(System::color::warning, "Directory %s should have no subdirectories", dir.generic_string()); - System::println("The following subdirectories were found: "); - Files::print_paths(subdirectories); - return lint_status::ERROR_DETECTED; - } - - return lint_status::SUCCESS; - } - - static lint_status check_bin_folders_are_not_present_in_static_build(const fs::path& package_dir) - { - const fs::path bin = package_dir / "bin"; - const fs::path debug_bin = package_dir / "debug" / "bin"; - - if (!fs::exists(bin) && !fs::exists(debug_bin)) - { - return lint_status::SUCCESS; - } - - if (fs::exists(bin)) - { - System::println(System::color::warning, R"(There should be no bin\ directory in a static build, but %s is present.)", bin.generic_string()); - } - - if (fs::exists(debug_bin)) - { - System::println(System::color::warning, R"(There should be no debug\bin\ directory in a static build, but %s is present.)", debug_bin.generic_string()); - } - - System::println(System::color::warning, R"(If the creation of bin\ and/or debug\bin\ cannot be disabled, use this in the portfile to remove them)" "\n" - "\n" - R"###( if(VCPKG_LIBRARY_LINKAGE STREQUAL static))###""\n" - R"###( file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin))###""\n" - R"###( endif())###" - "\n" - ); - - return lint_status::ERROR_DETECTED; - } - - static lint_status check_no_empty_folders(const fs::path& dir) - { - const std::vector empty_directories = Files::recursive_find_matching_paths_in_dir(dir, [](const fs::path& current) - { - return fs::is_directory(current) && fs::is_empty(current); - }); - - if (!empty_directories.empty()) - { - System::println(System::color::warning, "There should be no empty directories in %s", dir.generic_string()); - System::println("The following empty directories were found: "); - Files::print_paths(empty_directories); - System::println(System::color::warning, "If a directory should be populated but is not, this might indicate an error in the portfile.\n" - "If the directories are not needed and their creation cannot be disabled, use something like this in the portfile to remove them)\n" - "\n" - R"###( file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/a/dir ${CURRENT_PACKAGES_DIR}/some/other/dir))###""\n" - "\n"); - return lint_status::ERROR_DETECTED; - } - - return lint_status::SUCCESS; - } - - struct BuildType_and_file - { - fs::path file; - BuildType build_type; - }; - - static lint_status check_crt_linkage_of_libs(const BuildType& expected_build_type, const std::vector& libs, const fs::path dumpbin_exe) - { - std::vector bad_build_types = BuildType::values(); - bad_build_types.erase(std::remove(bad_build_types.begin(), bad_build_types.end(), expected_build_type), bad_build_types.end()); - - std::vector libs_with_invalid_crt; - - for (const fs::path& lib : libs) - { - const std::wstring cmd_line = Strings::wformat(LR"("%s" /directives "%s")", dumpbin_exe.native(), lib.native()); - System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd_line); - Checks::check_exit(ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line)); - - for (const BuildType& bad_build_type : bad_build_types) - { - if (std::regex_search(ec_data.output.cbegin(), ec_data.output.cend(), bad_build_type.crt_regex())) - { - libs_with_invalid_crt.push_back({lib, bad_build_type}); - break; - } - } - } - - if (!libs_with_invalid_crt.empty()) - { - System::println(System::color::warning, "Expected %s crt linkage, but the following libs had invalid crt linkage:", expected_build_type.toString()); - System::println(""); - for (const BuildType_and_file btf : libs_with_invalid_crt) - { - System::println(" %s: %s", btf.file.generic_string(), btf.build_type.toString()); - } - System::println(""); - - System::println(System::color::warning, "To inspect the lib files, use:\n dumpbin.exe /directives mylibfile.lib"); - return lint_status::ERROR_DETECTED; - } - - return lint_status::SUCCESS; - } - - struct OutdatedDynamicCrt_and_file - { - fs::path file; - OutdatedDynamicCrt outdated_crt; - }; - - static lint_status check_outdated_crt_linkage_of_dlls(const std::vector& dlls, const fs::path dumpbin_exe) - { - const std::vector& outdated_crts = OutdatedDynamicCrt::values(); - - std::vector dlls_with_outdated_crt; - - for (const fs::path& dll : dlls) - { - const std::wstring cmd_line = Strings::wformat(LR"("%s" /dependents "%s")", dumpbin_exe.native(), dll.native()); - System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd_line); - Checks::check_exit(ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line)); - - for (const OutdatedDynamicCrt& outdated_crt : outdated_crts) - { - if (std::regex_search(ec_data.output.cbegin(), ec_data.output.cend(), outdated_crt.crt_regex())) - { - dlls_with_outdated_crt.push_back({dll, outdated_crt}); - break; - } - } - } - - if (!dlls_with_outdated_crt.empty()) - { - System::println(System::color::warning, "Detected outdated dynamic CRT in the following files:"); - System::println(""); - for (const OutdatedDynamicCrt_and_file btf : dlls_with_outdated_crt) - { - System::println(" %s: %s", btf.file.generic_string(), btf.outdated_crt.toString()); - } - System::println(""); - - System::println(System::color::warning, "To inspect the dll files, use:\n dumpbin.exe /dependents mydllfile.dll"); - return lint_status::ERROR_DETECTED; - } - - return lint_status::SUCCESS; - } - - static lint_status check_no_files_in_package_dir_and_debug_dir(const fs::path& package_dir) - { - std::vector misplaced_files; - - Files::non_recursive_find_matching_paths_in_dir(package_dir, [](const fs::path& current) - { - const std::string filename = current.filename().generic_string(); - return !fs::is_directory(current) && !((_stricmp(filename.c_str(), "CONTROL") == 0 || _stricmp(filename.c_str(), "BUILD_INFO") == 0)); - }, &misplaced_files); - - const fs::path debug_dir = package_dir / "debug"; - Files::non_recursive_find_all_files_in_dir(debug_dir, &misplaced_files); - - if (!misplaced_files.empty()) - { - System::println(System::color::warning, "The following files are placed in\n%s and\n%s: ", package_dir.generic_string(), debug_dir.generic_string()); - Files::print_paths(misplaced_files); - System::println(System::color::warning, "Files cannot be present in those directories.\n"); - return lint_status::ERROR_DETECTED; - } - - return lint_status::SUCCESS; - } - - static void operator +=(size_t& left, const lint_status& right) - { - left += static_cast(right); - } - - void perform_all_checks(const package_spec& spec, const vcpkg_paths& paths) - { - const fs::path dumpbin_exe = Environment::get_dumpbin_exe(paths); - - System::println("-- Performing post-build validation"); - - BuildInfo build_info = read_build_info(paths.build_info_file_path(spec)); - const fs::path package_dir = paths.package_dir(spec); - - size_t error_count = 0; - error_count += check_for_files_in_include_directory(package_dir); - error_count += check_for_files_in_debug_include_directory(package_dir); - error_count += check_for_files_in_debug_share_directory(package_dir); - error_count += check_folder_lib_cmake(package_dir); - error_count += check_for_misplaced_cmake_files(package_dir, spec); - error_count += check_folder_debug_lib_cmake(package_dir); - error_count += check_for_dlls_in_lib_dirs(package_dir); - error_count += check_for_copyright_file(spec, paths); - error_count += check_for_exes(package_dir); - - const fs::path debug_lib_dir = package_dir / "debug" / "lib"; - const fs::path release_lib_dir = package_dir / "lib"; - const fs::path debug_bin_dir = package_dir / "debug" / "bin"; - const fs::path release_bin_dir = package_dir / "bin"; - - const std::vector debug_libs = Files::recursive_find_files_with_extension_in_dir(debug_lib_dir, ".lib"); - const std::vector release_libs = Files::recursive_find_files_with_extension_in_dir(release_lib_dir, ".lib"); - - error_count += check_matching_debug_and_release_binaries(debug_libs, release_libs); - - std::vector libs; - libs.insert(libs.cend(), debug_libs.cbegin(), debug_libs.cend()); - libs.insert(libs.cend(), release_libs.cbegin(), release_libs.cend()); - - error_count += check_lib_architecture(spec.target_triplet().architecture(), libs); - - switch (linkage_type_value_of(build_info.library_linkage)) - { - case LinkageType::DYNAMIC: - { - const std::vector debug_dlls = Files::recursive_find_files_with_extension_in_dir(debug_bin_dir, ".dll"); - const std::vector release_dlls = Files::recursive_find_files_with_extension_in_dir(release_bin_dir, ".dll"); - - error_count += check_matching_debug_and_release_binaries(debug_dlls, release_dlls); - - error_count += check_lib_files_are_available_if_dlls_are_available(build_info.policies, debug_libs.size(), debug_dlls.size(), debug_lib_dir); - error_count += check_lib_files_are_available_if_dlls_are_available(build_info.policies, release_libs.size(), release_dlls.size(), release_lib_dir); - - std::vector dlls; - dlls.insert(dlls.cend(), debug_dlls.cbegin(), debug_dlls.cend()); - dlls.insert(dlls.cend(), release_dlls.cbegin(), release_dlls.cend()); - - error_count += check_exports_of_dlls(dlls, dumpbin_exe); - error_count += check_uwp_bit_of_dlls(spec.target_triplet().system(), dlls, dumpbin_exe); - error_count += check_dll_architecture(spec.target_triplet().architecture(), dlls); - - error_count += check_outdated_crt_linkage_of_dlls(dlls, dumpbin_exe); - break; - } - case LinkageType::STATIC: - { - std::vector dlls; - Files::recursive_find_files_with_extension_in_dir(package_dir, ".dll", &dlls); - error_count += check_no_dlls_present(dlls); - - error_count += check_bin_folders_are_not_present_in_static_build(package_dir); - - error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::DEBUG, linkage_type_value_of(build_info.crt_linkage)), debug_libs, dumpbin_exe); - error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::RELEASE, linkage_type_value_of(build_info.crt_linkage)), release_libs, dumpbin_exe); - break; - } - case LinkageType::UNKNOWN: - { - error_count += 1; - System::println(System::color::warning, "Unknown library_linkage architecture: [ %s ]", build_info.library_linkage); - break; - } - default: - Checks::unreachable(); - } -#if 0 - error_count += check_no_subdirectories(package_dir / "lib"); - error_count += check_no_subdirectories(package_dir / "debug" / "lib"); -#endif - - error_count += check_no_empty_folders(package_dir); - error_count += check_no_files_in_package_dir_and_debug_dir(package_dir); - - if (error_count != 0) - { - const fs::path portfile = paths.ports / spec.name() / "portfile.cmake"; - System::println(System::color::error, "Found %u error(s). Please correct the portfile:\n %s", error_count, portfile.string()); - exit(EXIT_FAILURE); - } - - System::println("-- Performing post-build validation done"); - } -} diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index 802198ccb..c1730367d 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -137,8 +137,8 @@ - - + + @@ -150,7 +150,7 @@ - + @@ -176,8 +176,8 @@ - - + + @@ -207,7 +207,7 @@ Create Create - + diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index 4461655d1..65d2dd202 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -48,9 +48,6 @@ Source Files - - Source Files - Source Files @@ -123,9 +120,6 @@ Source Files - - Source Files - Source Files @@ -156,7 +150,13 @@ Source Files - + + Source Files + + + Source Files + + Source Files @@ -194,9 +194,6 @@ Header Files - - Header Files - Header Files @@ -212,9 +209,6 @@ Header Files - - Header Files - Header Files @@ -269,7 +263,13 @@ Header Files - + + Header Files + + + Header Files + + Header Files -- cgit v1.2.3 From 7a04aff33e596b843fba2162ab9b05180fc5169c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 1 Feb 2017 13:38:02 -0800 Subject: Split LinkageType into separate h/cpp --- toolsrc/include/PostBuildLint_BuildInfo.h | 12 +--------- toolsrc/include/PostBuildLint_LinkageType.h | 16 ++++++++++++++ toolsrc/src/PostBuildLint_BuildInfo.cpp | 29 ------------------------ toolsrc/src/PostBuildLint_LinkageType.cpp | 34 +++++++++++++++++++++++++++++ toolsrc/vcpkglib/vcpkglib.vcxproj | 2 ++ toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 6 +++++ 6 files changed, 59 insertions(+), 40 deletions(-) create mode 100644 toolsrc/include/PostBuildLint_LinkageType.h create mode 100644 toolsrc/src/PostBuildLint_LinkageType.cpp diff --git a/toolsrc/include/PostBuildLint_BuildInfo.h b/toolsrc/include/PostBuildLint_BuildInfo.h index cf444ce90..5305548e1 100644 --- a/toolsrc/include/PostBuildLint_BuildInfo.h +++ b/toolsrc/include/PostBuildLint_BuildInfo.h @@ -5,20 +5,10 @@ #include #include "PostBuildLint_BuildPolicies.h" #include "opt_bool.h" +#include "PostBuildLint_LinkageType.h" namespace vcpkg::PostBuildLint { - enum class LinkageType - { - DYNAMIC, - STATIC, - UNKNOWN - }; - - LinkageType linkage_type_value_of(const std::string& as_string); - - std::string to_string(const LinkageType& build_info); - enum class ConfigurationType { DEBUG = 1, diff --git a/toolsrc/include/PostBuildLint_LinkageType.h b/toolsrc/include/PostBuildLint_LinkageType.h new file mode 100644 index 000000000..7cca97639 --- /dev/null +++ b/toolsrc/include/PostBuildLint_LinkageType.h @@ -0,0 +1,16 @@ +#pragma once +#include + +namespace vcpkg::PostBuildLint +{ + enum class LinkageType + { + DYNAMIC, + STATIC, + UNKNOWN + }; + + LinkageType linkage_type_value_of(const std::string& as_string); + + std::string to_string(const LinkageType& build_info); +} diff --git a/toolsrc/src/PostBuildLint_BuildInfo.cpp b/toolsrc/src/PostBuildLint_BuildInfo.cpp index 59896e168..e15e2ca73 100644 --- a/toolsrc/src/PostBuildLint_BuildInfo.cpp +++ b/toolsrc/src/PostBuildLint_BuildInfo.cpp @@ -68,35 +68,6 @@ namespace vcpkg::PostBuildLint const BuildType BuildType::RELEASE_STATIC = BuildType(ConfigurationType::RELEASE, LinkageType::STATIC, R"(/DEFAULTLIB:LIBCMT[^D])"); const BuildType BuildType::RELEASE_DYNAMIC = BuildType(ConfigurationType::RELEASE, LinkageType::DYNAMIC, R"(/DEFAULTLIB:MSVCRT[^D])"); - LinkageType linkage_type_value_of(const std::string& as_string) - - { - if (as_string == "dynamic") - { - return LinkageType::DYNAMIC; - } - - if (as_string == "static") - { - return LinkageType::STATIC; - } - - return LinkageType::UNKNOWN; - } - - std::string to_string(const LinkageType& build_info) - { - switch (build_info) - { - case LinkageType::STATIC: - return "static"; - case LinkageType::DYNAMIC: - return "dynamic"; - default: - Checks::unreachable(); - } - } - std::string to_string(const ConfigurationType& conf) { switch (conf) diff --git a/toolsrc/src/PostBuildLint_LinkageType.cpp b/toolsrc/src/PostBuildLint_LinkageType.cpp new file mode 100644 index 000000000..8a3f35be8 --- /dev/null +++ b/toolsrc/src/PostBuildLint_LinkageType.cpp @@ -0,0 +1,34 @@ +#include "pch.h" +#include "PostBuildLint_LinkageType.h" +#include "vcpkg_Checks.h" + +namespace vcpkg::PostBuildLint +{ + LinkageType linkage_type_value_of(const std::string& as_string) + { + if (as_string == "dynamic") + { + return LinkageType::DYNAMIC; + } + + if (as_string == "static") + { + return LinkageType::STATIC; + } + + return LinkageType::UNKNOWN; + } + + std::string to_string(const LinkageType& build_info) + { + switch (build_info) + { + case LinkageType::STATIC: + return "static"; + case LinkageType::DYNAMIC: + return "dynamic"; + default: + Checks::unreachable(); + } + } +} diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index c1730367d..07a3dcf83 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -151,6 +151,7 @@ + @@ -208,6 +209,7 @@ Create + diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index 65d2dd202..7e000258d 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -159,6 +159,9 @@ Source Files + + Source Files + @@ -272,5 +275,8 @@ Header Files + + Header Files + \ No newline at end of file -- cgit v1.2.3 From 4aef2485b9d5cf2dfbb30543963e5714dcc411c4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 1 Feb 2017 13:43:29 -0800 Subject: Split ConfigurationType into separate h/cpp --- toolsrc/include/PostBuildLint_BuildInfo.h | 9 +-------- toolsrc/include/PostBuildLint_ConfigurationType.h | 14 ++++++++++++++ toolsrc/src/PostBuildLint_BuildInfo.cpp | 13 ------------- toolsrc/src/PostBuildLint_ConfigurationType.cpp | 19 +++++++++++++++++++ toolsrc/vcpkglib/vcpkglib.vcxproj | 2 ++ toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 6 ++++++ 6 files changed, 42 insertions(+), 21 deletions(-) create mode 100644 toolsrc/include/PostBuildLint_ConfigurationType.h create mode 100644 toolsrc/src/PostBuildLint_ConfigurationType.cpp diff --git a/toolsrc/include/PostBuildLint_BuildInfo.h b/toolsrc/include/PostBuildLint_BuildInfo.h index 5305548e1..2685b6f7b 100644 --- a/toolsrc/include/PostBuildLint_BuildInfo.h +++ b/toolsrc/include/PostBuildLint_BuildInfo.h @@ -6,17 +6,10 @@ #include "PostBuildLint_BuildPolicies.h" #include "opt_bool.h" #include "PostBuildLint_LinkageType.h" +#include "PostBuildLint_ConfigurationType.h" namespace vcpkg::PostBuildLint { - enum class ConfigurationType - { - DEBUG = 1, - RELEASE = 2 - }; - - std::string to_string(const ConfigurationType& conf); - struct BuildType { static BuildType value_of(const ConfigurationType& config, const LinkageType& linkage); diff --git a/toolsrc/include/PostBuildLint_ConfigurationType.h b/toolsrc/include/PostBuildLint_ConfigurationType.h new file mode 100644 index 000000000..55dede921 --- /dev/null +++ b/toolsrc/include/PostBuildLint_ConfigurationType.h @@ -0,0 +1,14 @@ +#pragma once +#pragma once +#include + +namespace vcpkg::PostBuildLint +{ + enum class ConfigurationType + { + DEBUG = 1, + RELEASE = 2 + }; + + std::string to_string(const ConfigurationType& conf); +} diff --git a/toolsrc/src/PostBuildLint_BuildInfo.cpp b/toolsrc/src/PostBuildLint_BuildInfo.cpp index e15e2ca73..c67c8754f 100644 --- a/toolsrc/src/PostBuildLint_BuildInfo.cpp +++ b/toolsrc/src/PostBuildLint_BuildInfo.cpp @@ -68,19 +68,6 @@ namespace vcpkg::PostBuildLint const BuildType BuildType::RELEASE_STATIC = BuildType(ConfigurationType::RELEASE, LinkageType::STATIC, R"(/DEFAULTLIB:LIBCMT[^D])"); const BuildType BuildType::RELEASE_DYNAMIC = BuildType(ConfigurationType::RELEASE, LinkageType::DYNAMIC, R"(/DEFAULTLIB:MSVCRT[^D])"); - std::string to_string(const ConfigurationType& conf) - { - switch (conf) - { - case ConfigurationType::DEBUG: - return "Debug"; - case ConfigurationType::RELEASE: - return "Release"; - default: - Checks::unreachable(); - } - } - BuildType BuildType::value_of(const ConfigurationType& config, const LinkageType& linkage) { if (config == ConfigurationType::DEBUG && linkage == LinkageType::STATIC) diff --git a/toolsrc/src/PostBuildLint_ConfigurationType.cpp b/toolsrc/src/PostBuildLint_ConfigurationType.cpp new file mode 100644 index 000000000..9c3499cac --- /dev/null +++ b/toolsrc/src/PostBuildLint_ConfigurationType.cpp @@ -0,0 +1,19 @@ +#include "pch.h" +#include "PostBuildLint_ConfigurationType.h" +#include "vcpkg_Checks.h" + +namespace vcpkg::PostBuildLint +{ + std::string to_string(const ConfigurationType& conf) + { + switch (conf) + { + case ConfigurationType::DEBUG: + return "Debug"; + case ConfigurationType::RELEASE: + return "Release"; + default: + Checks::unreachable(); + } + } +} diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index 07a3dcf83..14b476b64 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -151,6 +151,7 @@ + @@ -209,6 +210,7 @@ Create + diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index 7e000258d..72d73344f 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -162,6 +162,9 @@ Source Files + + Source Files + @@ -278,5 +281,8 @@ Header Files + + Header Files + \ No newline at end of file -- cgit v1.2.3 From 0a0a17b7f9eb2aca7f999de1c4b8c63428e1eadf Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 1 Feb 2017 13:49:28 -0800 Subject: Split BuildType into separate h/cpp --- toolsrc/include/PostBuildLint_BuildInfo.h | 39 ------------------ toolsrc/include/PostBuildLint_BuildType.h | 45 ++++++++++++++++++++ toolsrc/src/PostBuildLint_BuildInfo.cpp | 62 ---------------------------- toolsrc/src/PostBuiltLint_BuildType.cpp | 68 +++++++++++++++++++++++++++++++ toolsrc/vcpkglib/vcpkglib.vcxproj | 2 + toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 6 +++ 6 files changed, 121 insertions(+), 101 deletions(-) create mode 100644 toolsrc/include/PostBuildLint_BuildType.h create mode 100644 toolsrc/src/PostBuiltLint_BuildType.cpp diff --git a/toolsrc/include/PostBuildLint_BuildInfo.h b/toolsrc/include/PostBuildLint_BuildInfo.h index 2685b6f7b..b41478ef0 100644 --- a/toolsrc/include/PostBuildLint_BuildInfo.h +++ b/toolsrc/include/PostBuildLint_BuildInfo.h @@ -5,48 +5,9 @@ #include #include "PostBuildLint_BuildPolicies.h" #include "opt_bool.h" -#include "PostBuildLint_LinkageType.h" -#include "PostBuildLint_ConfigurationType.h" namespace vcpkg::PostBuildLint { - struct BuildType - { - static BuildType value_of(const ConfigurationType& config, const LinkageType& linkage); - - static const BuildType DEBUG_STATIC; - static const BuildType DEBUG_DYNAMIC; - static const BuildType RELEASE_STATIC; - static const BuildType RELEASE_DYNAMIC; - - static const std::vector& values() - { - static const std::vector v = {DEBUG_STATIC, DEBUG_DYNAMIC, RELEASE_STATIC, RELEASE_DYNAMIC}; - return v; - } - - BuildType() = delete; - - const ConfigurationType& config() const; - const LinkageType& linkage() const; - std::regex crt_regex() const; - std::string toString() const; - - private: - BuildType(const ConfigurationType& config, const LinkageType& linkage, const std::string& crt_regex_as_string) - : m_config(config), m_linkage(linkage), m_crt_regex_as_string(crt_regex_as_string) - { - } - - ConfigurationType m_config; - LinkageType m_linkage; - std::string m_crt_regex_as_string; - }; - - bool operator ==(const BuildType& lhs, const BuildType& rhs); - - bool operator !=(const BuildType& lhs, const BuildType& rhs); - struct OutdatedDynamicCrt { // Old CPP diff --git a/toolsrc/include/PostBuildLint_BuildType.h b/toolsrc/include/PostBuildLint_BuildType.h new file mode 100644 index 000000000..a5cb24f49 --- /dev/null +++ b/toolsrc/include/PostBuildLint_BuildType.h @@ -0,0 +1,45 @@ +#pragma once +#include "PostBuildLint_ConfigurationType.h" +#include "PostBuildLint_LinkageType.h" +#include +#include + +namespace vcpkg::PostBuildLint +{ + struct BuildType + { + static BuildType value_of(const ConfigurationType& config, const LinkageType& linkage); + + static const BuildType DEBUG_STATIC; + static const BuildType DEBUG_DYNAMIC; + static const BuildType RELEASE_STATIC; + static const BuildType RELEASE_DYNAMIC; + + static const std::vector& values() + { + static const std::vector v = { DEBUG_STATIC, DEBUG_DYNAMIC, RELEASE_STATIC, RELEASE_DYNAMIC }; + return v; + } + + BuildType() = delete; + + const ConfigurationType& config() const; + const LinkageType& linkage() const; + std::regex crt_regex() const; + std::string toString() const; + + private: + BuildType(const ConfigurationType& config, const LinkageType& linkage, const std::string& crt_regex_as_string) + : m_config(config), m_linkage(linkage), m_crt_regex_as_string(crt_regex_as_string) + { + } + + ConfigurationType m_config; + LinkageType m_linkage; + std::string m_crt_regex_as_string; + }; + + bool operator ==(const BuildType& lhs, const BuildType& rhs); + + bool operator !=(const BuildType& lhs, const BuildType& rhs); +} diff --git a/toolsrc/src/PostBuildLint_BuildInfo.cpp b/toolsrc/src/PostBuildLint_BuildInfo.cpp index c67c8754f..1d6d45e10 100644 --- a/toolsrc/src/PostBuildLint_BuildInfo.cpp +++ b/toolsrc/src/PostBuildLint_BuildInfo.cpp @@ -6,38 +6,6 @@ namespace vcpkg::PostBuildLint { - const ConfigurationType& BuildType::config() const - { - return this->m_config; - } - - const LinkageType& BuildType::linkage() const - { - return this->m_linkage; - } - - std::regex BuildType::crt_regex() const - { - const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); - return r; - } - - std::string BuildType::toString() const - { - const std::string s = Strings::format("[%s,%s]", to_string(this->m_config), to_string(this->m_linkage)); - return s; - } - - bool operator==(const BuildType& lhs, const BuildType& rhs) - { - return lhs.config() == rhs.config() && lhs.linkage() == rhs.linkage(); - } - - bool operator!=(const BuildType& lhs, const BuildType& rhs) - { - return !(lhs == rhs); - } - // namespace BuildInfoRequiredField { @@ -63,36 +31,6 @@ namespace vcpkg::PostBuildLint return build_info; } - const BuildType BuildType::DEBUG_STATIC = BuildType(ConfigurationType::DEBUG, LinkageType::STATIC, R"(/DEFAULTLIB:LIBCMTD)"); - const BuildType BuildType::DEBUG_DYNAMIC = BuildType(ConfigurationType::DEBUG, LinkageType::DYNAMIC, R"(/DEFAULTLIB:MSVCRTD)"); - const BuildType BuildType::RELEASE_STATIC = BuildType(ConfigurationType::RELEASE, LinkageType::STATIC, R"(/DEFAULTLIB:LIBCMT[^D])"); - const BuildType BuildType::RELEASE_DYNAMIC = BuildType(ConfigurationType::RELEASE, LinkageType::DYNAMIC, R"(/DEFAULTLIB:MSVCRT[^D])"); - - BuildType BuildType::value_of(const ConfigurationType& config, const LinkageType& linkage) - { - if (config == ConfigurationType::DEBUG && linkage == LinkageType::STATIC) - { - return DEBUG_STATIC; - } - - if (config == ConfigurationType::DEBUG && linkage == LinkageType::DYNAMIC) - { - return DEBUG_DYNAMIC; - } - - if (config == ConfigurationType::RELEASE && linkage == LinkageType::STATIC) - { - return RELEASE_STATIC; - } - - if (config == ConfigurationType::RELEASE && linkage == LinkageType::DYNAMIC) - { - return RELEASE_DYNAMIC; - } - - Checks::unreachable(); - } - BuildInfo read_build_info(const fs::path& filepath) { const std::vector> pghs = Paragraphs::get_paragraphs(filepath); diff --git a/toolsrc/src/PostBuiltLint_BuildType.cpp b/toolsrc/src/PostBuiltLint_BuildType.cpp new file mode 100644 index 000000000..b4e199aee --- /dev/null +++ b/toolsrc/src/PostBuiltLint_BuildType.cpp @@ -0,0 +1,68 @@ +#include "pch.h" +#include "PostBuildLint_BuildType.h" +#include "vcpkg_Checks.h" + +namespace vcpkg::PostBuildLint +{ + const BuildType BuildType::DEBUG_STATIC = BuildType(ConfigurationType::DEBUG, LinkageType::STATIC, R"(/DEFAULTLIB:LIBCMTD)"); + const BuildType BuildType::DEBUG_DYNAMIC = BuildType(ConfigurationType::DEBUG, LinkageType::DYNAMIC, R"(/DEFAULTLIB:MSVCRTD)"); + const BuildType BuildType::RELEASE_STATIC = BuildType(ConfigurationType::RELEASE, LinkageType::STATIC, R"(/DEFAULTLIB:LIBCMT[^D])"); + const BuildType BuildType::RELEASE_DYNAMIC = BuildType(ConfigurationType::RELEASE, LinkageType::DYNAMIC, R"(/DEFAULTLIB:MSVCRT[^D])"); + + BuildType BuildType::value_of(const ConfigurationType& config, const LinkageType& linkage) + { + if (config == ConfigurationType::DEBUG && linkage == LinkageType::STATIC) + { + return DEBUG_STATIC; + } + + if (config == ConfigurationType::DEBUG && linkage == LinkageType::DYNAMIC) + { + return DEBUG_DYNAMIC; + } + + if (config == ConfigurationType::RELEASE && linkage == LinkageType::STATIC) + { + return RELEASE_STATIC; + } + + if (config == ConfigurationType::RELEASE && linkage == LinkageType::DYNAMIC) + { + return RELEASE_DYNAMIC; + } + + Checks::unreachable(); + } + + const ConfigurationType& BuildType::config() const + { + return this->m_config; + } + + const LinkageType& BuildType::linkage() const + { + return this->m_linkage; + } + + std::regex BuildType::crt_regex() const + { + const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); + return r; + } + + std::string BuildType::toString() const + { + const std::string s = Strings::format("[%s,%s]", to_string(this->m_config), to_string(this->m_linkage)); + return s; + } + + bool operator==(const BuildType& lhs, const BuildType& rhs) + { + return lhs.config() == rhs.config() && lhs.linkage() == rhs.linkage(); + } + + bool operator!=(const BuildType& lhs, const BuildType& rhs) + { + return !(lhs == rhs); + } +} diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index 14b476b64..59bf5c214 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -151,6 +151,7 @@ + @@ -212,6 +213,7 @@ + diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index 72d73344f..e9758e485 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -165,6 +165,9 @@ Source Files + + Source Files + @@ -284,5 +287,8 @@ Header Files + + Header Files + \ No newline at end of file -- cgit v1.2.3 From 1d34facb84812bd478f2320857a5a7a3ed327bbf Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 1 Feb 2017 13:54:08 -0800 Subject: Split OutdatedDynamicCrt into separate h/cpp --- toolsrc/include/PostBuildLint_BuildInfo.h | 56 -------------------- toolsrc/include/PostBuildLint_OutdatedDynamicCrt.h | 59 ++++++++++++++++++++++ toolsrc/src/PostBuildLint.cpp | 2 + toolsrc/src/PostBuildLint_BuildInfo.cpp | 29 ----------- toolsrc/src/PostBuildLint_OutdatedDynamicCrt.cpp | 35 +++++++++++++ toolsrc/vcpkglib/vcpkglib.vcxproj | 2 + toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 6 +++ 7 files changed, 104 insertions(+), 85 deletions(-) create mode 100644 toolsrc/include/PostBuildLint_OutdatedDynamicCrt.h create mode 100644 toolsrc/src/PostBuildLint_OutdatedDynamicCrt.cpp diff --git a/toolsrc/include/PostBuildLint_BuildInfo.h b/toolsrc/include/PostBuildLint_BuildInfo.h index b41478ef0..ff996b2b6 100644 --- a/toolsrc/include/PostBuildLint_BuildInfo.h +++ b/toolsrc/include/PostBuildLint_BuildInfo.h @@ -2,67 +2,11 @@ #include #include "Paragraphs.h" -#include #include "PostBuildLint_BuildPolicies.h" #include "opt_bool.h" namespace vcpkg::PostBuildLint { - struct OutdatedDynamicCrt - { - // Old CPP - static const OutdatedDynamicCrt MSVCP100_DLL; - static const OutdatedDynamicCrt MSVCP100D_DLL; - static const OutdatedDynamicCrt MSVCP110_DLL; - static const OutdatedDynamicCrt MSVCP110_WIN_DLL; - static const OutdatedDynamicCrt MSVCP120_DLL; - static const OutdatedDynamicCrt MSVCP120_CLR0400_DLL; - static const OutdatedDynamicCrt MSVCP60_DLL; - static const OutdatedDynamicCrt MSVCP_WIN_DLL; - - // Old C - static const OutdatedDynamicCrt MSVCR100_DLL; - static const OutdatedDynamicCrt MSVCR100D_DLL; - static const OutdatedDynamicCrt MSVCR100_CLR0400_DLL; - static const OutdatedDynamicCrt MSVCR110_DLL; - static const OutdatedDynamicCrt MSVCR120_DLL; - static const OutdatedDynamicCrt MSVCR120_CLR0400_DLL; - static const OutdatedDynamicCrt MSVCRT_DLL; - static const OutdatedDynamicCrt MSVCRT20_DLL; - static const OutdatedDynamicCrt MSVCRT40_DLL; - - static const std::vector& values() - { - static const std::vector v = { - MSVCP100_DLL, MSVCP100D_DLL, - MSVCP110_DLL,MSVCP110_WIN_DLL, - MSVCP120_DLL, MSVCP120_CLR0400_DLL, - MSVCP60_DLL, - MSVCP_WIN_DLL, - - MSVCR100_DLL, MSVCR100D_DLL, MSVCR100_CLR0400_DLL, - MSVCR110_DLL, - MSVCR120_DLL, MSVCR120_CLR0400_DLL, - MSVCRT_DLL, MSVCRT20_DLL,MSVCRT40_DLL - }; - return v; - } - - OutdatedDynamicCrt() = delete; - - std::regex crt_regex() const; - const std::string& toString() const; - - private: - explicit OutdatedDynamicCrt(const std::string& dll_name, const std::string& crt_regex_as_string) - : m_dll_name(dll_name), m_crt_regex_as_string(crt_regex_as_string) - { - } - - std::string m_dll_name; - std::string m_crt_regex_as_string; - }; - struct BuildInfo { static BuildInfo create(std::unordered_map pgh); diff --git a/toolsrc/include/PostBuildLint_OutdatedDynamicCrt.h b/toolsrc/include/PostBuildLint_OutdatedDynamicCrt.h new file mode 100644 index 000000000..484f74cf0 --- /dev/null +++ b/toolsrc/include/PostBuildLint_OutdatedDynamicCrt.h @@ -0,0 +1,59 @@ +#pragma once +#include +#include + +namespace vcpkg::PostBuildLint +{ + struct OutdatedDynamicCrt + { + // Old CPP + static const OutdatedDynamicCrt MSVCP100_DLL; + static const OutdatedDynamicCrt MSVCP100D_DLL; + static const OutdatedDynamicCrt MSVCP110_DLL; + static const OutdatedDynamicCrt MSVCP110_WIN_DLL; + static const OutdatedDynamicCrt MSVCP120_DLL; + static const OutdatedDynamicCrt MSVCP120_CLR0400_DLL; + static const OutdatedDynamicCrt MSVCP60_DLL; + static const OutdatedDynamicCrt MSVCP_WIN_DLL; + + // Old C + static const OutdatedDynamicCrt MSVCR100_DLL; + static const OutdatedDynamicCrt MSVCR100D_DLL; + static const OutdatedDynamicCrt MSVCR100_CLR0400_DLL; + static const OutdatedDynamicCrt MSVCR110_DLL; + static const OutdatedDynamicCrt MSVCR120_DLL; + static const OutdatedDynamicCrt MSVCR120_CLR0400_DLL; + static const OutdatedDynamicCrt MSVCRT_DLL; + static const OutdatedDynamicCrt MSVCRT20_DLL; + static const OutdatedDynamicCrt MSVCRT40_DLL; + + static const std::vector& values() + { + static const std::vector v = { + MSVCP100_DLL, MSVCP100D_DLL, + MSVCP110_DLL,MSVCP110_WIN_DLL, + MSVCP120_DLL, MSVCP120_CLR0400_DLL, + MSVCP60_DLL, + MSVCP_WIN_DLL, + + MSVCR100_DLL, MSVCR100D_DLL, MSVCR100_CLR0400_DLL, + MSVCR110_DLL, + MSVCR120_DLL, MSVCR120_CLR0400_DLL, + MSVCRT_DLL, MSVCRT20_DLL,MSVCRT40_DLL + }; + return v; + } + + OutdatedDynamicCrt() = delete; + + std::regex crt_regex() const; + const std::string& toString() const; + + private: + explicit OutdatedDynamicCrt(const std::string& dll_name, const std::string& crt_regex_as_string) + : m_dll_name(dll_name), m_crt_regex_as_string(crt_regex_as_string) { } + + std::string m_dll_name; + std::string m_crt_regex_as_string; + }; +} diff --git a/toolsrc/src/PostBuildLint.cpp b/toolsrc/src/PostBuildLint.cpp index e7e976383..5954089e9 100644 --- a/toolsrc/src/PostBuildLint.cpp +++ b/toolsrc/src/PostBuildLint.cpp @@ -6,6 +6,8 @@ #include "vcpkg_Environment.h" #include "coff_file_reader.h" #include "PostBuildLint_BuildInfo.h" +#include "PostBuildLint_BuildType.h" +#include "PostBuildLint_OutdatedDynamicCrt.h" namespace vcpkg::PostBuildLint { diff --git a/toolsrc/src/PostBuildLint_BuildInfo.cpp b/toolsrc/src/PostBuildLint_BuildInfo.cpp index 1d6d45e10..63107acd1 100644 --- a/toolsrc/src/PostBuildLint_BuildInfo.cpp +++ b/toolsrc/src/PostBuildLint_BuildInfo.cpp @@ -39,33 +39,4 @@ namespace vcpkg::PostBuildLint return BuildInfo::create(pghs[0]); } - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP100_DLL = OutdatedDynamicCrt("msvcp100.dll", R"(msvcp100\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP100D_DLL = OutdatedDynamicCrt("msvcp100d.dll", R"(msvcp100d\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP110_DLL = OutdatedDynamicCrt("msvcp110.dll", R"(msvcp110\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP110_WIN_DLL = OutdatedDynamicCrt("msvcp110_win.dll", R"(msvcp110_win\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP120_DLL = OutdatedDynamicCrt("msvcp120.dll", R"(msvcp120\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP120_CLR0400_DLL = OutdatedDynamicCrt("msvcp120_clr0400.dll", R"(msvcp120_clr0400\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP60_DLL = OutdatedDynamicCrt("msvcp60.dll", R"(msvcp60\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP_WIN_DLL = OutdatedDynamicCrt("msvcp60.dll", R"(msvcp60\.dll)");; - - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR100_DLL = OutdatedDynamicCrt("msvcr100.dll", R"(msvcr100\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR100D_DLL = OutdatedDynamicCrt("msvcr100d.dll", R"(msvcr100d\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR100_CLR0400_DLL = OutdatedDynamicCrt("msvcr100_clr0400.dll", R"(msvcr100_clr0400\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR110_DLL = OutdatedDynamicCrt("msvcr110.dll", R"(msvcr110\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR120_DLL = OutdatedDynamicCrt("msvcr120.dll", R"(msvcr120\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR120_CLR0400_DLL = OutdatedDynamicCrt("msvcr120_clr0400.dll", R"(msvcr120_clr0400\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCRT_DLL = OutdatedDynamicCrt("msvcrt.dll", R"(msvcrt\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCRT20_DLL = OutdatedDynamicCrt("msvcrt20.dll", R"(msvcrt20\.dll)");; - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCRT40_DLL = OutdatedDynamicCrt("msvcrt40.dll", R"(msvcrt40\.dll)");; - - std::regex OutdatedDynamicCrt::crt_regex() const - { - const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); - return r; - } - - const std::string& OutdatedDynamicCrt::toString() const - { - return this->m_dll_name; - } } diff --git a/toolsrc/src/PostBuildLint_OutdatedDynamicCrt.cpp b/toolsrc/src/PostBuildLint_OutdatedDynamicCrt.cpp new file mode 100644 index 000000000..67965cd93 --- /dev/null +++ b/toolsrc/src/PostBuildLint_OutdatedDynamicCrt.cpp @@ -0,0 +1,35 @@ +#include "pch.h" +#include "PostBuildLint_OutdatedDynamicCrt.h" + +namespace vcpkg::PostBuildLint +{ + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP100_DLL = OutdatedDynamicCrt("msvcp100.dll", R"(msvcp100\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP100D_DLL = OutdatedDynamicCrt("msvcp100d.dll", R"(msvcp100d\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP110_DLL = OutdatedDynamicCrt("msvcp110.dll", R"(msvcp110\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP110_WIN_DLL = OutdatedDynamicCrt("msvcp110_win.dll", R"(msvcp110_win\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP120_DLL = OutdatedDynamicCrt("msvcp120.dll", R"(msvcp120\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP120_CLR0400_DLL = OutdatedDynamicCrt("msvcp120_clr0400.dll", R"(msvcp120_clr0400\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP60_DLL = OutdatedDynamicCrt("msvcp60.dll", R"(msvcp60\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP_WIN_DLL = OutdatedDynamicCrt("msvcp60.dll", R"(msvcp60\.dll)");; + + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR100_DLL = OutdatedDynamicCrt("msvcr100.dll", R"(msvcr100\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR100D_DLL = OutdatedDynamicCrt("msvcr100d.dll", R"(msvcr100d\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR100_CLR0400_DLL = OutdatedDynamicCrt("msvcr100_clr0400.dll", R"(msvcr100_clr0400\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR110_DLL = OutdatedDynamicCrt("msvcr110.dll", R"(msvcr110\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR120_DLL = OutdatedDynamicCrt("msvcr120.dll", R"(msvcr120\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR120_CLR0400_DLL = OutdatedDynamicCrt("msvcr120_clr0400.dll", R"(msvcr120_clr0400\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCRT_DLL = OutdatedDynamicCrt("msvcrt.dll", R"(msvcrt\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCRT20_DLL = OutdatedDynamicCrt("msvcrt20.dll", R"(msvcrt20\.dll)");; + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCRT40_DLL = OutdatedDynamicCrt("msvcrt40.dll", R"(msvcrt40\.dll)");; + + std::regex OutdatedDynamicCrt::crt_regex() const + { + const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); + return r; + } + + const std::string& OutdatedDynamicCrt::toString() const + { + return this->m_dll_name; + } +} diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index 59bf5c214..1217f6765 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -154,6 +154,7 @@ + @@ -213,6 +214,7 @@ + diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index e9758e485..f1bf4f9c9 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -168,6 +168,9 @@ Source Files + + Source Files + @@ -290,5 +293,8 @@ Header Files + + Header Files + \ No newline at end of file -- cgit v1.2.3 From fdc885fb06cb6dcb201099b6520a73fb5034da34 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 1 Feb 2017 18:20:49 -0800 Subject: Fix filename --- toolsrc/src/PostBuildLint_BuildType.cpp | 68 +++++++++++++++++++++++++++++++ toolsrc/src/PostBuiltLint_BuildType.cpp | 68 ------------------------------- toolsrc/vcpkglib/vcpkglib.vcxproj | 2 +- toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 4 +- 4 files changed, 71 insertions(+), 71 deletions(-) create mode 100644 toolsrc/src/PostBuildLint_BuildType.cpp delete mode 100644 toolsrc/src/PostBuiltLint_BuildType.cpp diff --git a/toolsrc/src/PostBuildLint_BuildType.cpp b/toolsrc/src/PostBuildLint_BuildType.cpp new file mode 100644 index 000000000..b4e199aee --- /dev/null +++ b/toolsrc/src/PostBuildLint_BuildType.cpp @@ -0,0 +1,68 @@ +#include "pch.h" +#include "PostBuildLint_BuildType.h" +#include "vcpkg_Checks.h" + +namespace vcpkg::PostBuildLint +{ + const BuildType BuildType::DEBUG_STATIC = BuildType(ConfigurationType::DEBUG, LinkageType::STATIC, R"(/DEFAULTLIB:LIBCMTD)"); + const BuildType BuildType::DEBUG_DYNAMIC = BuildType(ConfigurationType::DEBUG, LinkageType::DYNAMIC, R"(/DEFAULTLIB:MSVCRTD)"); + const BuildType BuildType::RELEASE_STATIC = BuildType(ConfigurationType::RELEASE, LinkageType::STATIC, R"(/DEFAULTLIB:LIBCMT[^D])"); + const BuildType BuildType::RELEASE_DYNAMIC = BuildType(ConfigurationType::RELEASE, LinkageType::DYNAMIC, R"(/DEFAULTLIB:MSVCRT[^D])"); + + BuildType BuildType::value_of(const ConfigurationType& config, const LinkageType& linkage) + { + if (config == ConfigurationType::DEBUG && linkage == LinkageType::STATIC) + { + return DEBUG_STATIC; + } + + if (config == ConfigurationType::DEBUG && linkage == LinkageType::DYNAMIC) + { + return DEBUG_DYNAMIC; + } + + if (config == ConfigurationType::RELEASE && linkage == LinkageType::STATIC) + { + return RELEASE_STATIC; + } + + if (config == ConfigurationType::RELEASE && linkage == LinkageType::DYNAMIC) + { + return RELEASE_DYNAMIC; + } + + Checks::unreachable(); + } + + const ConfigurationType& BuildType::config() const + { + return this->m_config; + } + + const LinkageType& BuildType::linkage() const + { + return this->m_linkage; + } + + std::regex BuildType::crt_regex() const + { + const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); + return r; + } + + std::string BuildType::toString() const + { + const std::string s = Strings::format("[%s,%s]", to_string(this->m_config), to_string(this->m_linkage)); + return s; + } + + bool operator==(const BuildType& lhs, const BuildType& rhs) + { + return lhs.config() == rhs.config() && lhs.linkage() == rhs.linkage(); + } + + bool operator!=(const BuildType& lhs, const BuildType& rhs) + { + return !(lhs == rhs); + } +} diff --git a/toolsrc/src/PostBuiltLint_BuildType.cpp b/toolsrc/src/PostBuiltLint_BuildType.cpp deleted file mode 100644 index b4e199aee..000000000 --- a/toolsrc/src/PostBuiltLint_BuildType.cpp +++ /dev/null @@ -1,68 +0,0 @@ -#include "pch.h" -#include "PostBuildLint_BuildType.h" -#include "vcpkg_Checks.h" - -namespace vcpkg::PostBuildLint -{ - const BuildType BuildType::DEBUG_STATIC = BuildType(ConfigurationType::DEBUG, LinkageType::STATIC, R"(/DEFAULTLIB:LIBCMTD)"); - const BuildType BuildType::DEBUG_DYNAMIC = BuildType(ConfigurationType::DEBUG, LinkageType::DYNAMIC, R"(/DEFAULTLIB:MSVCRTD)"); - const BuildType BuildType::RELEASE_STATIC = BuildType(ConfigurationType::RELEASE, LinkageType::STATIC, R"(/DEFAULTLIB:LIBCMT[^D])"); - const BuildType BuildType::RELEASE_DYNAMIC = BuildType(ConfigurationType::RELEASE, LinkageType::DYNAMIC, R"(/DEFAULTLIB:MSVCRT[^D])"); - - BuildType BuildType::value_of(const ConfigurationType& config, const LinkageType& linkage) - { - if (config == ConfigurationType::DEBUG && linkage == LinkageType::STATIC) - { - return DEBUG_STATIC; - } - - if (config == ConfigurationType::DEBUG && linkage == LinkageType::DYNAMIC) - { - return DEBUG_DYNAMIC; - } - - if (config == ConfigurationType::RELEASE && linkage == LinkageType::STATIC) - { - return RELEASE_STATIC; - } - - if (config == ConfigurationType::RELEASE && linkage == LinkageType::DYNAMIC) - { - return RELEASE_DYNAMIC; - } - - Checks::unreachable(); - } - - const ConfigurationType& BuildType::config() const - { - return this->m_config; - } - - const LinkageType& BuildType::linkage() const - { - return this->m_linkage; - } - - std::regex BuildType::crt_regex() const - { - const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); - return r; - } - - std::string BuildType::toString() const - { - const std::string s = Strings::format("[%s,%s]", to_string(this->m_config), to_string(this->m_linkage)); - return s; - } - - bool operator==(const BuildType& lhs, const BuildType& rhs) - { - return lhs.config() == rhs.config() && lhs.linkage() == rhs.linkage(); - } - - bool operator!=(const BuildType& lhs, const BuildType& rhs) - { - return !(lhs == rhs); - } -} diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index 1217f6765..d002f8d5f 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -215,7 +215,7 @@ - + diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index f1bf4f9c9..3359d9ada 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -165,10 +165,10 @@ Source Files - + Source Files - + Source Files -- cgit v1.2.3 From a2f3a4bf4c67c751e0912ccea6aca2132894c9f8 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 1 Feb 2017 19:02:14 -0800 Subject: [libvorbis] Move patch application outside if() to ensure it applies to previously obtained sources --- ports/libvorbis/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/libvorbis/CONTROL b/ports/libvorbis/CONTROL index 258edc4db..db9b1f530 100644 --- a/ports/libvorbis/CONTROL +++ b/ports/libvorbis/CONTROL @@ -1,4 +1,4 @@ Source: libvorbis -Version: 1.3.5-143caf4023a90c09a5eb685fdd46fb9b9c36b1ee +Version: 1.3.5-1-143caf4023a90c09a5eb685fdd46fb9b9c36b1ee Description: Ogg Vorbis is a fully open, non-proprietary, patent-and-royalty-free, general-purpose compressed audio format. Build-Depends: libogg -- cgit v1.2.3 From 7a080e79163d8e3bdf9eb33b5d761d2d0ca89696 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 1 Feb 2017 19:05:55 -0800 Subject: [libvorbis] Fixup missed commit in a2f3a4b --- ports/libvorbis/portfile.cmake | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/ports/libvorbis/portfile.cmake b/ports/libvorbis/portfile.cmake index 85fa1d26b..757196caf 100644 --- a/ports/libvorbis/portfile.cmake +++ b/ports/libvorbis/portfile.cmake @@ -33,15 +33,12 @@ if(NOT EXISTS "${CURRENT_BUILDTREES_DIR}/src/.git") WORKING_DIRECTORY ${DOWNLOADS}/vorbis.git LOGNAME worktree ) - message(STATUS "Patching") - vcpkg_execute_required_process( - COMMAND ${GIT} apply ${CMAKE_CURRENT_LIST_DIR}/0001-Add-vorbisenc.c-to-vorbis-library.patch - ${CMAKE_CURRENT_LIST_DIR}/0002-Allow-deprecated-functions.patch - --ignore-whitespace --whitespace=fix - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/src - LOGNAME patch - ) endif() +vcpkg_apply_patches(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/0001-Add-vorbisenc.c-to-vorbis-library.patch + ${CMAKE_CURRENT_LIST_DIR}/0002-Allow-deprecated-functions.patch +) file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/include" OGG_INCLUDE) file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/lib/ogg.lib" OGG_LIB_REL) -- cgit v1.2.3 From b2b2c9136918ed3ef85961c5c2885b9562d07d1d Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 2 Feb 2017 15:41:20 -0800 Subject: [vcpkg] Override Boost_COMPILER setting for all packages and toolchain to enable mixing VS2015 and VS2017 --- scripts/buildsystems/vcpkg.cmake | 2 ++ scripts/cmake/vcpkg_configure_cmake.cmake | 1 + 2 files changed, 3 insertions(+) diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 7be93e54d..e7b2b20db 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -57,6 +57,8 @@ if(NOT VCPKG_TOOLCHAIN) ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/manual-link ) + set(Boost_COMPILER "-vc140") + set(CMAKE_PROGRAM_PATH ${CMAKE_PROGRAM_PATH} ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools) option(VCPKG_APPLOCAL_DEPS "Automatically copy dependencies into the output directory for executables." ON) diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index c524d12ed..fbebe13a4 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -58,6 +58,7 @@ function(vcpkg_configure_cmake) "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" + "-DBoost_COMPILER=-vc140" ) if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL dynamic) list(APPEND _csc_OPTIONS_DEBUG -- cgit v1.2.3 From ce9927f7327bc71ade246108a7d984deda6293fd Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 2 Feb 2017 16:00:30 -0800 Subject: Improve error handling if BITS transfer fails --- scripts/fetchDependency.ps1 | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index b56bf1087..8d31b0edb 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -70,15 +70,21 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) if ($Dependency -ne "git") # git fails with BITS { - Start-BitsTransfer -Source $url -Destination $downloadPath -ErrorAction SilentlyContinue + try { + Start-BitsTransfer -Source $url -Destination $downloadPath -ErrorAction Stop + } + catch [System.Exception] { + # If BITS fails for any reason, delete any potentially partially downloaded files and continue + if (Test-Path $downloadPath) + { + Remove-Item $downloadPath + } + } } - else + if (!(Test-Path $downloadPath)) { - if (!(Test-Path $downloadPath)) - { - Write-Host("Downloading $Dependency...") - (New-Object System.Net.WebClient).DownloadFile($url, $downloadPath) - } + Write-Host("Downloading $Dependency...") + (New-Object System.Net.WebClient).DownloadFile($url, $downloadPath) } } -- cgit v1.2.3 From 5aa5f191aef4d40c5a44594418b00e7c47f10339 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 2 Feb 2017 18:03:32 -0800 Subject: [cereal] directly copy folder instead of invoking another cmake to copy --- ports/cereal/portfile.cmake | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ports/cereal/portfile.cmake b/ports/cereal/portfile.cmake index ccdf13fd4..f6555416c 100644 --- a/ports/cereal/portfile.cmake +++ b/ports/cereal/portfile.cmake @@ -13,6 +13,4 @@ file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/cerea file(RENAME ${CURRENT_PACKAGES_DIR}/share/cereal/LICENSE ${CURRENT_PACKAGES_DIR}/share/cereal/copyright) # Copy the cereal header files -execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory - ${SOURCE_PATH}/include/cereal/ - ${CURRENT_PACKAGES_DIR}/include/cereal) +file(COPY ${SOURCE_PATH}/include/cereal DESTINATION ${CURRENT_PACKAGES_DIR}/include) \ No newline at end of file -- cgit v1.2.3 From 62e7557545c17462670b7741d74dd2db4f5612eb Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 2 Feb 2017 18:45:51 -0800 Subject: [fmt] Bump version to 3.0.1-2 to correspond with binary output change in 4f5f52ff47 --- ports/fmt/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/fmt/CONTROL b/ports/fmt/CONTROL index adcb2def4..ce2bfc4e0 100644 --- a/ports/fmt/CONTROL +++ b/ports/fmt/CONTROL @@ -1,3 +1,3 @@ Source: fmt -Version: 3.0.1-1 +Version: 3.0.1-2 Description: Formatting library for C++. It can be used as a safe alternative to printf or as a fast alternative to IOStreams. -- cgit v1.2.3 From 761d56711ef4865c5e6f4076977e55b7b232665a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 2 Feb 2017 18:49:50 -0800 Subject: Add websocketpp --- ports/websocketpp/CONTROL | 3 +++ ports/websocketpp/portfile.cmake | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 ports/websocketpp/CONTROL create mode 100644 ports/websocketpp/portfile.cmake diff --git a/ports/websocketpp/CONTROL b/ports/websocketpp/CONTROL new file mode 100644 index 000000000..c11e64d3e --- /dev/null +++ b/ports/websocketpp/CONTROL @@ -0,0 +1,3 @@ +Source: websocketpp +Version: 0.7.0 +Description: Library that implements RFC6455 The WebSocket Protocol \ No newline at end of file diff --git a/ports/websocketpp/portfile.cmake b/ports/websocketpp/portfile.cmake new file mode 100644 index 000000000..98a4d52e6 --- /dev/null +++ b/ports/websocketpp/portfile.cmake @@ -0,0 +1,24 @@ +#header-only library +include(vcpkg_common_functions) +set(VERSION "0.7.0") +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/websocketpp-${VERSION}) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/zaphoyd/websocketpp/archive/${VERSION}.zip" + FILENAME "websocketpp-${VERSION}.zip" + SHA512 0cfbc5ed7034758b3666b5154854287441ebeef8e18c4e5f39b62559d4f0e9dda63d79021243c447f57b9855209e1813aeb1c6c475fc98aa71ff03933fc7ac0c +) +vcpkg_extract_source_archive(${ARCHIVE}) + +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) + +# Put the license file where vcpkg expects it +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/websocketpp/) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/websocketpp/COPYING ${CURRENT_PACKAGES_DIR}/share/websocketpp/copyright) + +# Copy the header files +file(COPY "${SOURCE_PATH}/websocketpp" DESTINATION "${CURRENT_PACKAGES_DIR}/include" FILES_MATCHING PATTERN "*.hpp") + +set(INSTALL_INCLUDE_DIR "\${CMAKE_CURRENT_LIST_DIR}/../../include") +set(WEBSOCKETPP_VERSION ${VERSION}) +configure_file (${SOURCE_PATH}/websocketpp-config.cmake.in "${CURRENT_PACKAGES_DIR}/share/websocketpp/websocketpp-config.cmake" @ONLY) +configure_file (${SOURCE_PATH}/websocketpp-configVersion.cmake.in "${CURRENT_PACKAGES_DIR}/share/websocketpp/websocketpp-configVersion.cmake" @ONLY) \ No newline at end of file -- cgit v1.2.3 From bfc7a36e923434b000f9d16c621d850444c7125b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 3 Feb 2017 14:38:49 -0800 Subject: [cpprestsdk] Use websocketpp from vcpkg instead of cpprest's copy --- ports/cpprestsdk/CONTROL | 4 ++-- ports/cpprestsdk/portfile.cmake | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ports/cpprestsdk/CONTROL b/ports/cpprestsdk/CONTROL index b3438026f..f284f2b53 100644 --- a/ports/cpprestsdk/CONTROL +++ b/ports/cpprestsdk/CONTROL @@ -1,5 +1,5 @@ Source: cpprestsdk -Version: 2.9.0-1 -Build-Depends: zlib [windows], openssl [windows], boost [windows] +Version: 2.9.0-2 +Build-Depends: zlib [windows], openssl [windows], boost [windows], websocketpp [windows] Description: C++11 JSON, REST, and OAuth library The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services. \ No newline at end of file diff --git a/ports/cpprestsdk/portfile.cmake b/ports/cpprestsdk/portfile.cmake index d1b5fa7f6..f92c5147a 100644 --- a/ports/cpprestsdk/portfile.cmake +++ b/ports/cpprestsdk/portfile.cmake @@ -15,9 +15,13 @@ vcpkg_apply_patches( ${CMAKE_CURRENT_LIST_DIR}/0001_cmake.patch ) +SET(WEBSOCKETPP_PATH "${CURRENT_INSTALLED_DIR}/share/websocketpp") + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH}/Release OPTIONS + -DWEBSOCKETPP_CONFIG=${WEBSOCKETPP_PATH} + -DWEBSOCKETPP_CONFIG_VERSION=${WEBSOCKETPP_PATH} -DBUILD_TESTS=OFF -DBUILD_SAMPLES=OFF -DCPPREST_EXCLUDE_WEBSOCKETS=OFF -- cgit v1.2.3 From ac44d930696cfc190c33f88c9ffa673918166cf5 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 3 Feb 2017 14:39:16 -0800 Subject: [webscoketpp] Fix dependencies --- ports/websocketpp/CONTROL | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/websocketpp/CONTROL b/ports/websocketpp/CONTROL index c11e64d3e..f812dc565 100644 --- a/ports/websocketpp/CONTROL +++ b/ports/websocketpp/CONTROL @@ -1,3 +1,4 @@ Source: websocketpp Version: 0.7.0 +Build-Depends: zlib, openssl, boost Description: Library that implements RFC6455 The WebSocket Protocol \ No newline at end of file -- cgit v1.2.3 From f7dcbe97fffdb5e4a005de7513816fc476aeef81 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 3 Feb 2017 17:46:09 -0800 Subject: [vcpkg] Disable Intel MKL for all internal builds. Fixes #609. --- scripts/cmake/vcpkg_build_cmake.cmake | 11 ++++++++--- scripts/cmake/vcpkg_build_msbuild.cmake | 2 ++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/cmake/vcpkg_build_cmake.cmake b/scripts/cmake/vcpkg_build_cmake.cmake index 6d7cfe643..3e8363a2c 100644 --- a/scripts/cmake/vcpkg_build_cmake.cmake +++ b/scripts/cmake/vcpkg_build_cmake.cmake @@ -1,9 +1,14 @@ function(vcpkg_build_cmake) cmake_parse_arguments(_bc "MSVC_64_TOOLSET;DISABLE_PARALLEL" "" "" ${ARGN}) - set(MSVC_EXTRA_ARGS) + set(MSVC_EXTRA_ARGS + "/p:VCPkgLocalAppDataDisabled=true" + "/p:UseIntelMKL=No" + ) # Specifies the architecture of the toolset, NOT the architecture of the produced binary + # This can help libraries that cause the linker to run out of memory. + # https://support.microsoft.com/en-us/help/2891057/linker-fatal-error-lnk1102-out-of-memory if (_bc_MSVC_64_TOOLSET) list(APPEND MSVC_EXTRA_ARGS "/p:PreferredToolArchitecture=x64") endif() @@ -14,7 +19,7 @@ function(vcpkg_build_cmake) message(STATUS "Build ${TARGET_TRIPLET}-rel") vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} --build . --config Release -- /p:VCPkgLocalAppDataDisabled=true ${MSVC_EXTRA_ARGS} + COMMAND ${CMAKE_COMMAND} --build . --config Release -- ${MSVC_EXTRA_ARGS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel LOGNAME build-${TARGET_TRIPLET}-rel ) @@ -22,7 +27,7 @@ function(vcpkg_build_cmake) message(STATUS "Build ${TARGET_TRIPLET}-dbg") vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} --build . --config Debug -- /p:VCPkgLocalAppDataDisabled=true ${MSVC_EXTRA_ARGS} + COMMAND ${CMAKE_COMMAND} --build . --config Debug -- ${MSVC_EXTRA_ARGS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg LOGNAME build-${TARGET_TRIPLET}-dbg ) diff --git a/scripts/cmake/vcpkg_build_msbuild.cmake b/scripts/cmake/vcpkg_build_msbuild.cmake index df255c745..f4a809e7f 100644 --- a/scripts/cmake/vcpkg_build_msbuild.cmake +++ b/scripts/cmake/vcpkg_build_msbuild.cmake @@ -55,6 +55,7 @@ function(vcpkg_build_msbuild) /p:Configuration=${_csc_RELEASE_CONFIGURATION} /p:Platform=${_csc_PLATFORM} /p:VCPkgLocalAppDataDisabled=true + /p:UseIntelMKL=No /m WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel LOGNAME build-${TARGET_TRIPLET}-rel @@ -67,6 +68,7 @@ function(vcpkg_build_msbuild) /p:Configuration=${_csc_DEBUG_CONFIGURATION} /p:Platform=${_csc_PLATFORM} /p:VCPkgLocalAppDataDisabled=true + /p:UseIntelMKL=No /m WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg LOGNAME build-${TARGET_TRIPLET}-dbg -- cgit v1.2.3 From 5fa7aba4d21ce35b65da02243697319bd23bf2f6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 3 Feb 2017 18:25:43 -0800 Subject: [vcpkg remove] Fix remove --purge not applying to not-installed packages --- toolsrc/src/commands_remove.cpp | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index 7e8608e72..f49104d1e 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -196,26 +196,29 @@ namespace vcpkg::Commands::Remove for (const package_spec_with_remove_plan& action : remove_plan) { - if (action.plan.plan_type == remove_plan_type::NOT_INSTALLED) + const std::string display_name = action.spec.display_name(); + + switch (action.plan.plan_type) { - System::println(System::color::success, "Package %s is not installed", action.spec); + case remove_plan_type::NOT_INSTALLED: + System::println(System::color::success, "Package %s is not installed", display_name); + break; + case remove_plan_type::REMOVE: + System::println("Removing package %s... ", display_name); + remove_package(paths, action.spec, &status_db); + System::println(System::color::success, "Removing package %s... done", display_name); + break; + case remove_plan_type::UNKNOWN: + default: + Checks::unreachable(); } - else if (action.plan.plan_type == remove_plan_type::REMOVE) - { - const std::string display_name = action.spec.display_name(); - System::println("Removing package %s... ", display_name); - remove_package(paths, action.spec, &status_db); - System::println(System::color::success, "Removing package %s... done", display_name); - if (alsoRemoveFolderFromPackages) - { - System::println("Purging package %s... ", display_name); - delete_directory(paths.packages / action.spec.dir()); - System::println(System::color::success, "Purging package %s... done", display_name); - } + if (alsoRemoveFolderFromPackages) + { + System::println("Purging package %s... ", display_name); + delete_directory(paths.packages / action.spec.dir()); + System::println(System::color::success, "Purging package %s... done", display_name); } - else - Checks::unreachable(); } exit(EXIT_SUCCESS); -- cgit v1.2.3 From 20ac877b5e6e182ca449c633516636c173e71f94 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 3 Feb 2017 18:54:38 -0800 Subject: [wt] Apply upstream patch to fix boost 1.63 compat. Fixes #626. --- ports/wt/CONTROL | 2 +- ports/wt/portfile.cmake | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ports/wt/CONTROL b/ports/wt/CONTROL index 1a89dd378..d7ac2c535 100644 --- a/ports/wt/CONTROL +++ b/ports/wt/CONTROL @@ -1,4 +1,4 @@ Source: wt -Version: 3.3.6-2 +Version: 3.3.6-3 Description: Wt is a C++ library for developing web applications Build-Depends: boost, openssl diff --git a/ports/wt/portfile.cmake b/ports/wt/portfile.cmake index f762eface..7e2bdb47c 100644 --- a/ports/wt/portfile.cmake +++ b/ports/wt/portfile.cmake @@ -7,10 +7,15 @@ vcpkg_download_distfile(ARCHIVE_FILE SHA512 d6135713d300bcd3956a4fd673af73be0561eb5d6aa91c47255b966950ddb411217e6a826c1d11c0d941dbb6d006c9926231d7334b21de6256cca331066e18a6 ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) - +vcpkg_download_distfile(PATCH_FILE + URLS "https://github.com/emweb/wt/commit/b944cdc0961f683cd12fc6e60db3d0b328cd46dd.diff" + FILENAME "wt-fix-boost-1-63.diff" + SHA512 0766837ed8852da675b02b45bfbe7a6705ab20f67aa20849df4cc4b93b00dec0b73acea3568bca1046e203119445044c5ea06e33bac5d5d991f6a56b8fe282e1 +) vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES ${CMAKE_CURRENT_LIST_DIR}/add-disable-boost-autolink-option.patch + ${PATCH_FILE} ) vcpkg_configure_cmake( -- cgit v1.2.3 From 85cab47ea46f255dd6c3528e309191ed7c3fd2ff Mon Sep 17 00:00:00 2001 From: sdcb Date: Sat, 4 Feb 2017 11:18:04 +0800 Subject: [aws-sdk-cpp] upgrade to 1.0.61 1. upgrade to 1.0.61 2. disable warning as error temply(fix https://github.com/Microsoft/vcpkg/issues/629 before https://github.com/aws/aws-sdk-cpp/issues/438) 3. using cmake file(append) instead of patch to define #define USE_IMPORT_EXPORT in SDKConfig.h (simplified code) --- ports/aws-sdk-cpp/disable_warning_as_error.patch | 13 +++++++++++++ ports/aws-sdk-cpp/portfile.cmake | 15 ++++++--------- ports/aws-sdk-cpp/shared_define.patch | 10 ---------- 3 files changed, 19 insertions(+), 19 deletions(-) create mode 100644 ports/aws-sdk-cpp/disable_warning_as_error.patch delete mode 100644 ports/aws-sdk-cpp/shared_define.patch diff --git a/ports/aws-sdk-cpp/disable_warning_as_error.patch b/ports/aws-sdk-cpp/disable_warning_as_error.patch new file mode 100644 index 000000000..ec5587eb8 --- /dev/null +++ b/ports/aws-sdk-cpp/disable_warning_as_error.patch @@ -0,0 +1,13 @@ +diff --git a/cmake/compiler_settings.cmake b/cmake/compiler_settings.cmake +index 36795a2..77334ee 100644 +--- a/cmake/compiler_settings.cmake ++++ b/cmake/compiler_settings.cmake +@@ -57,7 +57,7 @@ endif() + if(MSVC) + # warnings as errors, max warning level (4) + if(NOT CMAKE_CXX_FLAGS MATCHES "/WX") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX") ++ #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX") + endif() + + # taken from http://stackoverflow.com/questions/2368811/how-to-set-warning-level-in-cmake diff --git a/ports/aws-sdk-cpp/portfile.cmake b/ports/aws-sdk-cpp/portfile.cmake index 5313e85b7..21219c3c9 100644 --- a/ports/aws-sdk-cpp/portfile.cmake +++ b/ports/aws-sdk-cpp/portfile.cmake @@ -1,9 +1,9 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/aws-sdk-cpp-1.0.47) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/aws-sdk-cpp-1.0.61) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/aws/aws-sdk-cpp/archive/1.0.47.tar.gz" - FILENAME "aws-sdk-cpp-1.0.47.tar.gz" - SHA512 ce7471bafe2763f1c382eed8afeaf6422058599a3aa11ae52909da668c45d12827fcd06b9b3ce34e3c2fa33297fd2e09421b8a89833d581efaf62b7108232acf + URLS "https://github.com/aws/aws-sdk-cpp/archive/1.0.61.tar.gz" + FILENAME "aws-sdk-cpp-1.0.61.tar.gz" + SHA512 aef0a85a32db24dc4fba0fc49c2533074580f3df628e787ff0808f03deea5dac42e19b1edc966706784e98cfed17a350c3eff4f222df7cc756065be56d1fc6a6 ) vcpkg_extract_source_archive(${ARCHIVE}) @@ -11,6 +11,7 @@ vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES ${CMAKE_CURRENT_LIST_DIR}/drop_git.patch + ${CMAKE_CURRENT_LIST_DIR}/disable_warning_as_error.patch ) if(VCPKG_CRT_LINKAGE STREQUAL static) @@ -44,11 +45,7 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(COPY ${DEBUG_LIB_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) file(REMOVE ${LIB_FILES} ${DEBUG_LIB_FILES}) - vcpkg_apply_patches( #define USE_IMPORT_EXPORT in SDKConfig.h - SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include - PATCHES - ${CMAKE_CURRENT_LIST_DIR}/shared_define.patch - ) + file(APPEND ${CURRENT_PACKAGES_DIR}/include/aws/core/SDKConfig.h "#define USE_IMPORT_EXPORT") endif() # Handle copyright diff --git a/ports/aws-sdk-cpp/shared_define.patch b/ports/aws-sdk-cpp/shared_define.patch deleted file mode 100644 index 96657b33e..000000000 --- a/ports/aws-sdk-cpp/shared_define.patch +++ /dev/null @@ -1,10 +0,0 @@ -diff --git a/aws/core/SDKConfig.h b/aws/core/SDKConfig.h -index 130c9dd..66b2630 100644 ---- a/aws/core/SDKConfig.h -+++ b/aws/core/SDKConfig.h -@@ -17,3 +17,4 @@ - - #define JSON_USE_EXCEPTION 0 - -+#define USE_IMPORT_EXPORT -\ No newline at end of file -- cgit v1.2.3 From 504545d2c864623ebddf169b1e402326bfe136f4 Mon Sep 17 00:00:00 2001 From: Ben Harper Date: Mon, 6 Feb 2017 14:44:59 +0200 Subject: Add a workaround for another BITS code path The fix from last week (ce9927f7327bc71ade246108a7d984deda6293fd) worked for downloading most dependencies, but there is still one BITS transfer code path, which this fix addresses. --- scripts/findVisualStudioInstallationInstances.ps1 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index a2ce66522..9d54990a2 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -20,7 +20,21 @@ $downloadPath = "$downloadsDir\$downloadName" if (!(Test-Path $downloadPath)) { - Start-BitsTransfer -Source $url -Destination $downloadPath #-ErrorAction SilentlyContinue + try { + Start-BitsTransfer -Source $url -Destination $downloadPath -ErrorAction Stop + } + catch [System.Exception] { + # If BITS fails for any reason, delete any potentially partially downloaded files and continue + if (Test-Path $downloadPath) + { + Remove-Item $downloadPath + } + } +} +if (!(Test-Path $downloadPath)) +{ + Write-Host("Downloading $downloadName...") + (New-Object System.Net.WebClient).DownloadFile($url, $downloadPath) } $nugetOutput = & $nugetexe install Microsoft.VisualStudio.Setup.Configuration.Native -Pre -Source $downloadsDir -OutputDirectory $nugetPackageDir 2>&1 -- cgit v1.2.3 From 7207316ed405c334be1ac507d76dd45a5979903d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 6 Feb 2017 15:26:35 -0800 Subject: Don't download nupkg. nuget.exe auto-downloads it --- scripts/findVisualStudioInstallationInstances.ps1 | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index 9d54990a2..2c42ef420 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -14,29 +14,6 @@ $nugetexe = & $scriptsDir\fetchDependency.ps1 "nuget" $nugetPackageDir = "$downloadsDir\nuget-packages" $SetupAPIVersion = "1.3.269-rc" -$url = "https://api.nuget.org/packages/microsoft.visualstudio.setup.configuration.native.$SetupAPIVersion.nupkg" -$downloadName = "microsoft.visualstudio.setup.configuration.native.$SetupAPIVersion.nupkg" -$downloadPath = "$downloadsDir\$downloadName" - -if (!(Test-Path $downloadPath)) -{ - try { - Start-BitsTransfer -Source $url -Destination $downloadPath -ErrorAction Stop - } - catch [System.Exception] { - # If BITS fails for any reason, delete any potentially partially downloaded files and continue - if (Test-Path $downloadPath) - { - Remove-Item $downloadPath - } - } -} -if (!(Test-Path $downloadPath)) -{ - Write-Host("Downloading $downloadName...") - (New-Object System.Net.WebClient).DownloadFile($url, $downloadPath) -} - $nugetOutput = & $nugetexe install Microsoft.VisualStudio.Setup.Configuration.Native -Pre -Source $downloadsDir -OutputDirectory $nugetPackageDir 2>&1 $SetupConsoleExe = "$nugetPackageDir\Microsoft.VisualStudio.Setup.Configuration.Native.$SetupAPIVersion\tools\x86\Microsoft.VisualStudio.Setup.Configuration.Console.exe" -- cgit v1.2.3 From 1bfd72480d46845a941f891d232eb8c67b9d146c Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 6 Feb 2017 15:52:48 -0800 Subject: [poco] Fix #475 by adding include path to public interface. --- ports/poco/CONTROL | 2 +- ports/poco/foundation-public-include-pcre.patch | 12 ++++++++++++ ports/poco/portfile.cmake | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 ports/poco/foundation-public-include-pcre.patch diff --git a/ports/poco/CONTROL b/ports/poco/CONTROL index 6f4f7e3b1..ae2758c1f 100644 --- a/ports/poco/CONTROL +++ b/ports/poco/CONTROL @@ -1,4 +1,4 @@ Source: poco -Version: 1.7.6-2 +Version: 1.7.6-3 Build-Depends: zlib, pcre, sqlite3, expat Description: Modern, powerful open source C++ class libraries for building network and internet-based applications that run on desktop, server, mobile and embedded systems. \ No newline at end of file diff --git a/ports/poco/foundation-public-include-pcre.patch b/ports/poco/foundation-public-include-pcre.patch new file mode 100644 index 000000000..ab4403ad8 --- /dev/null +++ b/ports/poco/foundation-public-include-pcre.patch @@ -0,0 +1,12 @@ +diff --git a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt +index 76005b1..efc99b6 100644 +--- a/Foundation/CMakeLists.txt ++++ b/Foundation/CMakeLists.txt +@@ -166,6 +166,7 @@ target_link_libraries( "${LIBNAME}" ${SYSLIBS}) + target_include_directories( "${LIBNAME}" + PUBLIC + $ ++ $ + $ + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src + ) diff --git a/ports/poco/portfile.cmake b/ports/poco/portfile.cmake index 413f19c7e..e774c3c17 100644 --- a/ports/poco/portfile.cmake +++ b/ports/poco/portfile.cmake @@ -13,6 +13,7 @@ vcpkg_apply_patches( PATCHES ${CMAKE_CURRENT_LIST_DIR}/config_h.patch ${CMAKE_CURRENT_LIST_DIR}/find_pcre.patch + ${CMAKE_CURRENT_LIST_DIR}/foundation-public-include-pcre.patch ) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) -- cgit v1.2.3 From acc669e86942dd569884d5241b023a91eed61908 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 6 Feb 2017 15:55:39 -0800 Subject: Update SetupAPI version. Explicitly specify version. Use -nocache --- scripts/findVisualStudioInstallationInstances.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index 2c42ef420..260ee73fe 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -13,8 +13,8 @@ $downloadsDir = "$vcpkgRootDir\downloads" $nugetexe = & $scriptsDir\fetchDependency.ps1 "nuget" $nugetPackageDir = "$downloadsDir\nuget-packages" -$SetupAPIVersion = "1.3.269-rc" -$nugetOutput = & $nugetexe install Microsoft.VisualStudio.Setup.Configuration.Native -Pre -Source $downloadsDir -OutputDirectory $nugetPackageDir 2>&1 +$SetupAPIVersion = "1.5.125-rc" +$nugetOutput = & $nugetexe install Microsoft.VisualStudio.Setup.Configuration.Native -Version $SetupAPIVersion -OutputDirectory $nugetPackageDir -nocache 2>&1 $SetupConsoleExe = "$nugetPackageDir\Microsoft.VisualStudio.Setup.Configuration.Native.$SetupAPIVersion\tools\x86\Microsoft.VisualStudio.Setup.Configuration.Console.exe" -- cgit v1.2.3 From 8d5cbff2954a425731057a206a8e769a5bc53e16 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 7 Feb 2017 15:04:07 -0800 Subject: [examples] Add the manual-link directories to the Examples documentation --- docs/EXAMPLES.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/EXAMPLES.md b/docs/EXAMPLES.md index 6302dab07..cc100c4ca 100644 --- a/docs/EXAMPLES.md +++ b/docs/EXAMPLES.md @@ -150,9 +150,9 @@ PS D:\src\cmake-test\build> .\Debug\main.exe Libraries are installed into the `installed\` subfolder, partitioned by architecture (e.g. x86-windows): * The header files are installed to `installed\x86-windows\include` -* Release `.lib` files are installed to `installed\x86-windows\lib` +* Release `.lib` files are installed to `installed\x86-windows\lib` or `installed\x86-windows\lib\manual-link` * Release `.dll` files are installed to `installed\x86-windows\bin` -* Debug `.lib` files are installed to `installed\x86-windows\debug\lib` +* Debug `.lib` files are installed to `installed\x86-windows\debug\lib` or `installed\x86-windows\debug\lib\manual-link` * Debug `.dll` files are installed to `installed\x86-windows\debug\bin` See your build system specific documentation for how to use prebuilt binaries. -- cgit v1.2.3 From f9616c6994ccf66e2a64e2d62e6a1408694c190c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 7 Feb 2017 17:02:57 -0800 Subject: Add new Policy: Empty Package --- scripts/ports.cmake | 3 + toolsrc/include/PostBuildLint_BuildPolicies.h | 5 +- toolsrc/src/PostBuildLint.cpp | 92 +++++++++++++++------------ toolsrc/src/PostBuildLint_BuildPolicies.cpp | 13 +++- 4 files changed, 72 insertions(+), 41 deletions(-) diff --git a/scripts/ports.cmake b/scripts/ports.cmake index cc01a0619..c03b005ea 100644 --- a/scripts/ports.cmake +++ b/scripts/ports.cmake @@ -79,6 +79,9 @@ if(CMD MATCHES "^BUILD$") if (DEFINED VCPKG_POLICY_DLLS_WITHOUT_LIBS) file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyDLLsWithoutLIBs: ${VCPKG_POLICY_DLLS_WITHOUT_LIBS}\n") endif() + if (DEFINED VCPKG_POLICY_EMPTY_PACKAGE) + file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyEmptyPackage: ${VCPKG_POLICY_EMPTY_PACKAGE}\n") + endif() elseif(CMD MATCHES "^CREATE$") file(TO_NATIVE_PATH ${VCPKG_ROOT_DIR} NATIVE_VCPKG_ROOT_DIR) file(TO_NATIVE_PATH ${DOWNLOADS} NATIVE_DOWNLOADS) diff --git a/toolsrc/include/PostBuildLint_BuildPolicies.h b/toolsrc/include/PostBuildLint_BuildPolicies.h index 8298ffe2d..187ba6d64 100644 --- a/toolsrc/include/PostBuildLint_BuildPolicies.h +++ b/toolsrc/include/PostBuildLint_BuildPolicies.h @@ -6,6 +6,7 @@ namespace vcpkg::PostBuildLint::BuildPolicies enum class backing_enum_t { UNKNOWN = 0, + EMPTY_PACKAGE, DLLS_WITHOUT_LIBS }; @@ -22,10 +23,12 @@ namespace vcpkg::PostBuildLint::BuildPolicies backing_enum_t backing_enum; }; - static constexpr int value_count = 2; + static constexpr int value_count = 3; const std::vector& values(); + static constexpr type UNKNOWN(backing_enum_t::UNKNOWN); + static constexpr type EMPTY_PACKAGE(backing_enum_t::EMPTY_PACKAGE); static constexpr type DLLS_WITHOUT_LIBS(backing_enum_t::DLLS_WITHOUT_LIBS); type parse(const std::string& s); diff --git a/toolsrc/src/PostBuildLint.cpp b/toolsrc/src/PostBuildLint.cpp index 5954089e9..533e28fcf 100644 --- a/toolsrc/src/PostBuildLint.cpp +++ b/toolsrc/src/PostBuildLint.cpp @@ -582,16 +582,21 @@ namespace vcpkg::PostBuildLint left += static_cast(right); } - void perform_all_checks(const package_spec& spec, const vcpkg_paths& paths) + static size_t perform_all_checks_and_return_error_count(const package_spec& spec, const vcpkg_paths& paths) { const fs::path dumpbin_exe = Environment::get_dumpbin_exe(paths); - System::println("-- Performing post-build validation"); - BuildInfo build_info = read_build_info(paths.build_info_file_path(spec)); const fs::path package_dir = paths.package_dir(spec); size_t error_count = 0; + + auto it = build_info.policies.find(BuildPolicies::EMPTY_PACKAGE); + if (it != build_info.policies.cend() && it->second == opt_bool_t::ENABLED) + { + return error_count; + } + error_count += check_for_files_in_include_directory(package_dir); error_count += check_for_files_in_debug_include_directory(package_dir); error_count += check_for_files_in_debug_share_directory(package_dir); @@ -620,56 +625,65 @@ namespace vcpkg::PostBuildLint switch (linkage_type_value_of(build_info.library_linkage)) { - case LinkageType::DYNAMIC: - { - const std::vector debug_dlls = Files::recursive_find_files_with_extension_in_dir(debug_bin_dir, ".dll"); - const std::vector release_dlls = Files::recursive_find_files_with_extension_in_dir(release_bin_dir, ".dll"); + case LinkageType::DYNAMIC: + { + const std::vector debug_dlls = Files::recursive_find_files_with_extension_in_dir(debug_bin_dir, ".dll"); + const std::vector release_dlls = Files::recursive_find_files_with_extension_in_dir(release_bin_dir, ".dll"); - error_count += check_matching_debug_and_release_binaries(debug_dlls, release_dlls); + error_count += check_matching_debug_and_release_binaries(debug_dlls, release_dlls); - error_count += check_lib_files_are_available_if_dlls_are_available(build_info.policies, debug_libs.size(), debug_dlls.size(), debug_lib_dir); - error_count += check_lib_files_are_available_if_dlls_are_available(build_info.policies, release_libs.size(), release_dlls.size(), release_lib_dir); + error_count += check_lib_files_are_available_if_dlls_are_available(build_info.policies, debug_libs.size(), debug_dlls.size(), debug_lib_dir); + error_count += check_lib_files_are_available_if_dlls_are_available(build_info.policies, release_libs.size(), release_dlls.size(), release_lib_dir); - std::vector dlls; - dlls.insert(dlls.cend(), debug_dlls.cbegin(), debug_dlls.cend()); - dlls.insert(dlls.cend(), release_dlls.cbegin(), release_dlls.cend()); + std::vector dlls; + dlls.insert(dlls.cend(), debug_dlls.cbegin(), debug_dlls.cend()); + dlls.insert(dlls.cend(), release_dlls.cbegin(), release_dlls.cend()); - error_count += check_exports_of_dlls(dlls, dumpbin_exe); - error_count += check_uwp_bit_of_dlls(spec.target_triplet().system(), dlls, dumpbin_exe); - error_count += check_dll_architecture(spec.target_triplet().architecture(), dlls); + error_count += check_exports_of_dlls(dlls, dumpbin_exe); + error_count += check_uwp_bit_of_dlls(spec.target_triplet().system(), dlls, dumpbin_exe); + error_count += check_dll_architecture(spec.target_triplet().architecture(), dlls); - error_count += check_outdated_crt_linkage_of_dlls(dlls, dumpbin_exe); - break; - } - case LinkageType::STATIC: - { - std::vector dlls; - Files::recursive_find_files_with_extension_in_dir(package_dir, ".dll", &dlls); - error_count += check_no_dlls_present(dlls); + error_count += check_outdated_crt_linkage_of_dlls(dlls, dumpbin_exe); + break; + } + case LinkageType::STATIC: + { + std::vector dlls; + Files::recursive_find_files_with_extension_in_dir(package_dir, ".dll", &dlls); + error_count += check_no_dlls_present(dlls); - error_count += check_bin_folders_are_not_present_in_static_build(package_dir); + error_count += check_bin_folders_are_not_present_in_static_build(package_dir); - error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::DEBUG, linkage_type_value_of(build_info.crt_linkage)), debug_libs, dumpbin_exe); - error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::RELEASE, linkage_type_value_of(build_info.crt_linkage)), release_libs, dumpbin_exe); - break; - } - case LinkageType::UNKNOWN: - { - error_count += 1; - System::println(System::color::warning, "Unknown library_linkage architecture: [ %s ]", build_info.library_linkage); - break; - } - default: - Checks::unreachable(); + error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::DEBUG, linkage_type_value_of(build_info.crt_linkage)), debug_libs, dumpbin_exe); + error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::RELEASE, linkage_type_value_of(build_info.crt_linkage)), release_libs, dumpbin_exe); + break; + } + case LinkageType::UNKNOWN: + { + error_count += 1; + System::println(System::color::warning, "Unknown library_linkage architecture: [ %s ]", build_info.library_linkage); + break; + } + default: + Checks::unreachable(); } #if 0 - error_count += check_no_subdirectories(package_dir / "lib"); - error_count += check_no_subdirectories(package_dir / "debug" / "lib"); + error_count += check_no_subdirectories(package_dir / "lib"); + error_count += check_no_subdirectories(package_dir / "debug" / "lib"); #endif error_count += check_no_empty_folders(package_dir); error_count += check_no_files_in_package_dir_and_debug_dir(package_dir); + return error_count; + } + + void perform_all_checks(const package_spec& spec, const vcpkg_paths& paths) + { + System::println("-- Performing post-build validation"); + + const size_t error_count = perform_all_checks_and_return_error_count(spec, paths); + if (error_count != 0) { const fs::path portfile = paths.ports / spec.name() / "portfile.cmake"; diff --git a/toolsrc/src/PostBuildLint_BuildPolicies.cpp b/toolsrc/src/PostBuildLint_BuildPolicies.cpp index d7d67c991..4e5ac3cea 100644 --- a/toolsrc/src/PostBuildLint_BuildPolicies.cpp +++ b/toolsrc/src/PostBuildLint_BuildPolicies.cpp @@ -5,12 +5,15 @@ namespace vcpkg::PostBuildLint::BuildPolicies { static const std::string NAME_UNKNOWN = "PolicyUnknown"; + static const std::string NAME_EMPTY_PACKAGE = "PolicyEmptyPackage"; static const std::string NAME_DLLS_WITHOUT_LIBS = "PolicyDLLsWithoutLIBs"; const std::string& type::toString() const { switch (this->backing_enum) { + case EMPTY_PACKAGE: + return NAME_EMPTY_PACKAGE; case DLLS_WITHOUT_LIBS: return NAME_DLLS_WITHOUT_LIBS; case UNKNOWN: @@ -22,10 +25,13 @@ namespace vcpkg::PostBuildLint::BuildPolicies const std::string& type::cmake_variable() const { + static const std::string CMAKE_VARIABLE_EMPTY_PACKAGE = "VCPKG_POLICY_EMPTY_PACKAGE"; static const std::string CMAKE_VARIABLE_DLLS_WITHOUT_LIBS = "VCPKG_POLICY_DLLS_WITHOUT_LIBS"; switch (this->backing_enum) { + case EMPTY_PACKAGE: + return CMAKE_VARIABLE_EMPTY_PACKAGE; case DLLS_WITHOUT_LIBS: return CMAKE_VARIABLE_DLLS_WITHOUT_LIBS; case UNKNOWN: @@ -39,12 +45,17 @@ namespace vcpkg::PostBuildLint::BuildPolicies const std::vector& values() { - static const std::vector& v = {UNKNOWN, DLLS_WITHOUT_LIBS}; + static const std::vector& v = {UNKNOWN, EMPTY_PACKAGE, DLLS_WITHOUT_LIBS}; return v; } type parse(const std::string& s) { + if (s == NAME_EMPTY_PACKAGE) + { + return BuildPolicies::EMPTY_PACKAGE; + } + if (s == NAME_DLLS_WITHOUT_LIBS) { return BuildPolicies::DLLS_WITHOUT_LIBS; -- cgit v1.2.3 From d4fa0b34c08dcfb11bd285846ee5cc061885033d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 7 Feb 2017 17:04:24 -0800 Subject: Add CUDA portfile The intention of this package is for other packages to declare a dependency on CUDA --- ports/cuda/CONTROL | 3 +++ ports/cuda/portfile.cmake | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 ports/cuda/CONTROL create mode 100644 ports/cuda/portfile.cmake diff --git a/ports/cuda/CONTROL b/ports/cuda/CONTROL new file mode 100644 index 000000000..00df3011c --- /dev/null +++ b/ports/cuda/CONTROL @@ -0,0 +1,3 @@ +Source: cuda +Version: 8.0 +Description: A parallel computing platform and programming model \ No newline at end of file diff --git a/ports/cuda/portfile.cmake b/ports/cuda/portfile.cmake new file mode 100644 index 000000000..3b20afe0f --- /dev/null +++ b/ports/cuda/portfile.cmake @@ -0,0 +1,34 @@ +# Due to the complexity involved, this package doesn't install CUDA. It instead verifies that CUDA is installed. +# Other packages can depend on this package to declare a dependency on CUDA. +# If this package is installed, we assume that CUDA is properly installed. + +execute_process( + COMMAND nvcc --version + OUTPUT_VARIABLE NVCC_OUTPUT + RESULT_VARIABLE error_code) + +# Sample output +# NVIDIA (R) Cuda compiler driver +# Copyright (c) 2005-2016 NVIDIA Corporation +# Built on Sat_Sep__3_19:05:48_CDT_2016 +# Cuda compilation tools, release 8.0, V8.0.44 +set(CUDA_REQUIRED_VERSION "V8.0.0") + +if (${error_code}) + message(FATAL_ERROR "CUDA is not installed. Before continuing, please download and install CUDA (${CUDA_REQUIRED_VERSION} or higher) from:" + "\n https://developer.nvidia.com/cuda-downloads \n") +endif() + +string(REGEX MATCH "V([0-9]+)\\.([0-9]+)\\.([0-9]+)" CUDA_VERSION ${NVCC_OUTPUT}) +message(STATUS "Found CUDA ${CUDA_VERSION}") +set(CUDA_VERSION_MAJOR ${CMAKE_MATCH_1}) +#set(CUDA_VERSION_MINOR ${CMAKE_MATCH_2}) +#set(CUDA_VERSION_PATCH ${CMAKE_MATCH_3}) + + +if (${CUDA_VERSION_MAJOR} LESS 8) + message(FATAL_ERROR "CUDA ${CUDA_VERSION} but ${CUDA_REQUIRED_VERSION} is required. Please download and install a more recent version of CUDA from:" + "\n https://developer.nvidia.com/cuda-downloads \n") +endif() + +SET(VCPKG_POLICY_EMPTY_PACKAGE enabled) \ No newline at end of file -- cgit v1.2.3 From 994ebec3ea29994197be64084f33d3653ec428c5 Mon Sep 17 00:00:00 2001 From: sdflysha Date: Wed, 8 Feb 2017 10:50:01 +0800 Subject: [aws-sdk-cpp] bump version to 1.0.61 I created a PR here: https://github.com/Microsoft/vcpkg/pull/631 but forgot to bump the aws-sdk-cpp version, I fixed it here. --- ports/aws-sdk-cpp/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/aws-sdk-cpp/CONTROL b/ports/aws-sdk-cpp/CONTROL index 989d3a9eb..18de04d46 100644 --- a/ports/aws-sdk-cpp/CONTROL +++ b/ports/aws-sdk-cpp/CONTROL @@ -1,3 +1,3 @@ Source: aws-sdk-cpp -Version: 1.0.47 +Version: 1.0.61 Description: AWS SDK for C++ -- cgit v1.2.3 From d36a1b7cb0b8be59e7826a7a699d9951e91abc2c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 7 Feb 2017 22:57:37 -0800 Subject: Remove OutdatedDynamicCrt enum. Replace with vector --- toolsrc/include/PostBuildLint_OutdatedDynamicCrt.h | 59 ------------ toolsrc/src/PostBuildLint.cpp | 107 +++++++++++++-------- toolsrc/src/PostBuildLint_OutdatedDynamicCrt.cpp | 35 ------- toolsrc/vcpkglib/vcpkglib.vcxproj | 2 - toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 6 -- 5 files changed, 69 insertions(+), 140 deletions(-) delete mode 100644 toolsrc/include/PostBuildLint_OutdatedDynamicCrt.h delete mode 100644 toolsrc/src/PostBuildLint_OutdatedDynamicCrt.cpp diff --git a/toolsrc/include/PostBuildLint_OutdatedDynamicCrt.h b/toolsrc/include/PostBuildLint_OutdatedDynamicCrt.h deleted file mode 100644 index 484f74cf0..000000000 --- a/toolsrc/include/PostBuildLint_OutdatedDynamicCrt.h +++ /dev/null @@ -1,59 +0,0 @@ -#pragma once -#include -#include - -namespace vcpkg::PostBuildLint -{ - struct OutdatedDynamicCrt - { - // Old CPP - static const OutdatedDynamicCrt MSVCP100_DLL; - static const OutdatedDynamicCrt MSVCP100D_DLL; - static const OutdatedDynamicCrt MSVCP110_DLL; - static const OutdatedDynamicCrt MSVCP110_WIN_DLL; - static const OutdatedDynamicCrt MSVCP120_DLL; - static const OutdatedDynamicCrt MSVCP120_CLR0400_DLL; - static const OutdatedDynamicCrt MSVCP60_DLL; - static const OutdatedDynamicCrt MSVCP_WIN_DLL; - - // Old C - static const OutdatedDynamicCrt MSVCR100_DLL; - static const OutdatedDynamicCrt MSVCR100D_DLL; - static const OutdatedDynamicCrt MSVCR100_CLR0400_DLL; - static const OutdatedDynamicCrt MSVCR110_DLL; - static const OutdatedDynamicCrt MSVCR120_DLL; - static const OutdatedDynamicCrt MSVCR120_CLR0400_DLL; - static const OutdatedDynamicCrt MSVCRT_DLL; - static const OutdatedDynamicCrt MSVCRT20_DLL; - static const OutdatedDynamicCrt MSVCRT40_DLL; - - static const std::vector& values() - { - static const std::vector v = { - MSVCP100_DLL, MSVCP100D_DLL, - MSVCP110_DLL,MSVCP110_WIN_DLL, - MSVCP120_DLL, MSVCP120_CLR0400_DLL, - MSVCP60_DLL, - MSVCP_WIN_DLL, - - MSVCR100_DLL, MSVCR100D_DLL, MSVCR100_CLR0400_DLL, - MSVCR110_DLL, - MSVCR120_DLL, MSVCR120_CLR0400_DLL, - MSVCRT_DLL, MSVCRT20_DLL,MSVCRT40_DLL - }; - return v; - } - - OutdatedDynamicCrt() = delete; - - std::regex crt_regex() const; - const std::string& toString() const; - - private: - explicit OutdatedDynamicCrt(const std::string& dll_name, const std::string& crt_regex_as_string) - : m_dll_name(dll_name), m_crt_regex_as_string(crt_regex_as_string) { } - - std::string m_dll_name; - std::string m_crt_regex_as_string; - }; -} diff --git a/toolsrc/src/PostBuildLint.cpp b/toolsrc/src/PostBuildLint.cpp index 533e28fcf..7986d913a 100644 --- a/toolsrc/src/PostBuildLint.cpp +++ b/toolsrc/src/PostBuildLint.cpp @@ -7,7 +7,6 @@ #include "coff_file_reader.h" #include "PostBuildLint_BuildInfo.h" #include "PostBuildLint_BuildType.h" -#include "PostBuildLint_OutdatedDynamicCrt.h" namespace vcpkg::PostBuildLint { @@ -17,6 +16,38 @@ namespace vcpkg::PostBuildLint ERROR_DETECTED = 1 }; + struct OutdatedDynamicCrt + { + std::string name; + std::regex regex; + }; + + const std::vector& get_outdated_dynamic_crts() + { + static const std::vector v = { + {"msvcp100.dll", std::regex(R"(msvcp100\.dll)")}, + {"msvcp100d.dll", std::regex(R"(msvcp100d\.dll)")}, + {"msvcp110.dll", std::regex(R"(msvcp110\.dll)")}, + {"msvcp110_win.dll", std::regex(R"(msvcp110_win\.dll)")}, + {"msvcp120.dll", std::regex(R"(msvcp120\.dll)")}, + {"msvcp120_clr0400.dll", std::regex(R"(msvcp120_clr0400\.dll)")}, + {"msvcp60.dll", std::regex(R"(msvcp60\.dll)")}, + {"msvcp60.dll", std::regex(R"(msvcp60\.dll)")}, + + {"msvcr100.dll", std::regex(R"(msvcr100\.dll)")}, + {"msvcr100d.dll", std::regex(R"(msvcr100d\.dll)")}, + {"msvcr100_clr0400.dll", std::regex(R"(msvcr100_clr0400\.dll)")}, + {"msvcr110.dll", std::regex(R"(msvcr110\.dll)")}, + {"msvcr120.dll", std::regex(R"(msvcr120\.dll)")}, + {"msvcr120_clr0400.dll", std::regex(R"(msvcr120_clr0400\.dll)")}, + {"msvcrt.dll", std::regex(R"(msvcrt\.dll)")}, + {"msvcrt20.dll", std::regex(R"(msvcrt20\.dll)")}, + {"msvcrt40.dll", std::regex(R"(msvcrt40\.dll)")} + }; + + return v; + } + static lint_status check_for_files_in_include_directory(const fs::path& package_dir) { const fs::path include_dir = package_dir / "include"; @@ -516,7 +547,7 @@ namespace vcpkg::PostBuildLint static lint_status check_outdated_crt_linkage_of_dlls(const std::vector& dlls, const fs::path dumpbin_exe) { - const std::vector& outdated_crts = OutdatedDynamicCrt::values(); + const std::vector& outdated_crts = get_outdated_dynamic_crts(); std::vector dlls_with_outdated_crt; @@ -528,7 +559,7 @@ namespace vcpkg::PostBuildLint for (const OutdatedDynamicCrt& outdated_crt : outdated_crts) { - if (std::regex_search(ec_data.output.cbegin(), ec_data.output.cend(), outdated_crt.crt_regex())) + if (std::regex_search(ec_data.output.cbegin(), ec_data.output.cend(), outdated_crt.regex)) { dlls_with_outdated_crt.push_back({dll, outdated_crt}); break; @@ -542,7 +573,7 @@ namespace vcpkg::PostBuildLint System::println(""); for (const OutdatedDynamicCrt_and_file btf : dlls_with_outdated_crt) { - System::println(" %s: %s", btf.file.generic_string(), btf.outdated_crt.toString()); + System::println(" %s: %s", btf.file.generic_string(), btf.outdated_crt.name); } System::println(""); @@ -625,47 +656,47 @@ namespace vcpkg::PostBuildLint switch (linkage_type_value_of(build_info.library_linkage)) { - case LinkageType::DYNAMIC: - { - const std::vector debug_dlls = Files::recursive_find_files_with_extension_in_dir(debug_bin_dir, ".dll"); - const std::vector release_dlls = Files::recursive_find_files_with_extension_in_dir(release_bin_dir, ".dll"); + case LinkageType::DYNAMIC: + { + const std::vector debug_dlls = Files::recursive_find_files_with_extension_in_dir(debug_bin_dir, ".dll"); + const std::vector release_dlls = Files::recursive_find_files_with_extension_in_dir(release_bin_dir, ".dll"); - error_count += check_matching_debug_and_release_binaries(debug_dlls, release_dlls); + error_count += check_matching_debug_and_release_binaries(debug_dlls, release_dlls); - error_count += check_lib_files_are_available_if_dlls_are_available(build_info.policies, debug_libs.size(), debug_dlls.size(), debug_lib_dir); - error_count += check_lib_files_are_available_if_dlls_are_available(build_info.policies, release_libs.size(), release_dlls.size(), release_lib_dir); + error_count += check_lib_files_are_available_if_dlls_are_available(build_info.policies, debug_libs.size(), debug_dlls.size(), debug_lib_dir); + error_count += check_lib_files_are_available_if_dlls_are_available(build_info.policies, release_libs.size(), release_dlls.size(), release_lib_dir); - std::vector dlls; - dlls.insert(dlls.cend(), debug_dlls.cbegin(), debug_dlls.cend()); - dlls.insert(dlls.cend(), release_dlls.cbegin(), release_dlls.cend()); + std::vector dlls; + dlls.insert(dlls.cend(), debug_dlls.cbegin(), debug_dlls.cend()); + dlls.insert(dlls.cend(), release_dlls.cbegin(), release_dlls.cend()); - error_count += check_exports_of_dlls(dlls, dumpbin_exe); - error_count += check_uwp_bit_of_dlls(spec.target_triplet().system(), dlls, dumpbin_exe); - error_count += check_dll_architecture(spec.target_triplet().architecture(), dlls); + error_count += check_exports_of_dlls(dlls, dumpbin_exe); + error_count += check_uwp_bit_of_dlls(spec.target_triplet().system(), dlls, dumpbin_exe); + error_count += check_dll_architecture(spec.target_triplet().architecture(), dlls); - error_count += check_outdated_crt_linkage_of_dlls(dlls, dumpbin_exe); - break; - } - case LinkageType::STATIC: - { - std::vector dlls; - Files::recursive_find_files_with_extension_in_dir(package_dir, ".dll", &dlls); - error_count += check_no_dlls_present(dlls); + error_count += check_outdated_crt_linkage_of_dlls(dlls, dumpbin_exe); + break; + } + case LinkageType::STATIC: + { + std::vector dlls; + Files::recursive_find_files_with_extension_in_dir(package_dir, ".dll", &dlls); + error_count += check_no_dlls_present(dlls); - error_count += check_bin_folders_are_not_present_in_static_build(package_dir); + error_count += check_bin_folders_are_not_present_in_static_build(package_dir); - error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::DEBUG, linkage_type_value_of(build_info.crt_linkage)), debug_libs, dumpbin_exe); - error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::RELEASE, linkage_type_value_of(build_info.crt_linkage)), release_libs, dumpbin_exe); - break; - } - case LinkageType::UNKNOWN: - { - error_count += 1; - System::println(System::color::warning, "Unknown library_linkage architecture: [ %s ]", build_info.library_linkage); - break; - } - default: - Checks::unreachable(); + error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::DEBUG, linkage_type_value_of(build_info.crt_linkage)), debug_libs, dumpbin_exe); + error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::RELEASE, linkage_type_value_of(build_info.crt_linkage)), release_libs, dumpbin_exe); + break; + } + case LinkageType::UNKNOWN: + { + error_count += 1; + System::println(System::color::warning, "Unknown library_linkage architecture: [ %s ]", build_info.library_linkage); + break; + } + default: + Checks::unreachable(); } #if 0 error_count += check_no_subdirectories(package_dir / "lib"); diff --git a/toolsrc/src/PostBuildLint_OutdatedDynamicCrt.cpp b/toolsrc/src/PostBuildLint_OutdatedDynamicCrt.cpp deleted file mode 100644 index 67965cd93..000000000 --- a/toolsrc/src/PostBuildLint_OutdatedDynamicCrt.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include "pch.h" -#include "PostBuildLint_OutdatedDynamicCrt.h" - -namespace vcpkg::PostBuildLint -{ - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP100_DLL = OutdatedDynamicCrt("msvcp100.dll", R"(msvcp100\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP100D_DLL = OutdatedDynamicCrt("msvcp100d.dll", R"(msvcp100d\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP110_DLL = OutdatedDynamicCrt("msvcp110.dll", R"(msvcp110\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP110_WIN_DLL = OutdatedDynamicCrt("msvcp110_win.dll", R"(msvcp110_win\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP120_DLL = OutdatedDynamicCrt("msvcp120.dll", R"(msvcp120\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP120_CLR0400_DLL = OutdatedDynamicCrt("msvcp120_clr0400.dll", R"(msvcp120_clr0400\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP60_DLL = OutdatedDynamicCrt("msvcp60.dll", R"(msvcp60\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP_WIN_DLL = OutdatedDynamicCrt("msvcp60.dll", R"(msvcp60\.dll)");; - - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR100_DLL = OutdatedDynamicCrt("msvcr100.dll", R"(msvcr100\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR100D_DLL = OutdatedDynamicCrt("msvcr100d.dll", R"(msvcr100d\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR100_CLR0400_DLL = OutdatedDynamicCrt("msvcr100_clr0400.dll", R"(msvcr100_clr0400\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR110_DLL = OutdatedDynamicCrt("msvcr110.dll", R"(msvcr110\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR120_DLL = OutdatedDynamicCrt("msvcr120.dll", R"(msvcr120\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR120_CLR0400_DLL = OutdatedDynamicCrt("msvcr120_clr0400.dll", R"(msvcr120_clr0400\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCRT_DLL = OutdatedDynamicCrt("msvcrt.dll", R"(msvcrt\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCRT20_DLL = OutdatedDynamicCrt("msvcrt20.dll", R"(msvcrt20\.dll)");; - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCRT40_DLL = OutdatedDynamicCrt("msvcrt40.dll", R"(msvcrt40\.dll)");; - - std::regex OutdatedDynamicCrt::crt_regex() const - { - const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); - return r; - } - - const std::string& OutdatedDynamicCrt::toString() const - { - return this->m_dll_name; - } -} diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index d002f8d5f..2a651e294 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -154,7 +154,6 @@ - @@ -214,7 +213,6 @@ - diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index 3359d9ada..99cbf7037 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -165,9 +165,6 @@ Source Files - - Source Files - Source Files @@ -293,8 +290,5 @@ Header Files - - Header Files - \ No newline at end of file -- cgit v1.2.3 From e1aea256b84d2c1ac5c29db0e5e40ed536e3157f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 8 Feb 2017 02:07:53 -0800 Subject: Fix variable name and guard against 0 instances --- scripts/findVisualStudioInstallationInstances.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index 260ee73fe..951975758 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -25,8 +25,9 @@ if (!(Test-Path $SetupConsoleExe)) $instances = & $SetupConsoleExe -nologo -value InstallationPath 2>&1 $instanceCount = $instances.Length + # The last item can be empty -if ($instances[$entryCount - 1] -eq "") +if ($instanceCount -gt 0 -and $instances[$instanceCount - 1] -eq "") { $instances = $instances[0..($instanceCount - 2)] } -- cgit v1.2.3 From a9f7fc6e90feaad50c1221ef9bd56e2620302215 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 8 Feb 2017 12:36:32 -0800 Subject: Make regex for OutdatedDyanmicCRTs case insensitive --- toolsrc/src/PostBuildLint.cpp | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/toolsrc/src/PostBuildLint.cpp b/toolsrc/src/PostBuildLint.cpp index 7986d913a..90bd55843 100644 --- a/toolsrc/src/PostBuildLint.cpp +++ b/toolsrc/src/PostBuildLint.cpp @@ -20,29 +20,32 @@ namespace vcpkg::PostBuildLint { std::string name; std::regex regex; + + OutdatedDynamicCrt(const std::string& name, const std::string& regex_as_string) + : name(name), regex(std::regex(regex_as_string, std::regex_constants::icase)) {} }; const std::vector& get_outdated_dynamic_crts() { static const std::vector v = { - {"msvcp100.dll", std::regex(R"(msvcp100\.dll)")}, - {"msvcp100d.dll", std::regex(R"(msvcp100d\.dll)")}, - {"msvcp110.dll", std::regex(R"(msvcp110\.dll)")}, - {"msvcp110_win.dll", std::regex(R"(msvcp110_win\.dll)")}, - {"msvcp120.dll", std::regex(R"(msvcp120\.dll)")}, - {"msvcp120_clr0400.dll", std::regex(R"(msvcp120_clr0400\.dll)")}, - {"msvcp60.dll", std::regex(R"(msvcp60\.dll)")}, - {"msvcp60.dll", std::regex(R"(msvcp60\.dll)")}, - - {"msvcr100.dll", std::regex(R"(msvcr100\.dll)")}, - {"msvcr100d.dll", std::regex(R"(msvcr100d\.dll)")}, - {"msvcr100_clr0400.dll", std::regex(R"(msvcr100_clr0400\.dll)")}, - {"msvcr110.dll", std::regex(R"(msvcr110\.dll)")}, - {"msvcr120.dll", std::regex(R"(msvcr120\.dll)")}, - {"msvcr120_clr0400.dll", std::regex(R"(msvcr120_clr0400\.dll)")}, - {"msvcrt.dll", std::regex(R"(msvcrt\.dll)")}, - {"msvcrt20.dll", std::regex(R"(msvcrt20\.dll)")}, - {"msvcrt40.dll", std::regex(R"(msvcrt40\.dll)")} + {"msvcp100.dll", R"(msvcp100\.dll)"}, + {"msvcp100d.dll", R"(msvcp100d\.dll)"}, + {"msvcp110.dll", R"(msvcp110\.dll)"}, + {"msvcp110_win.dll", R"(msvcp110_win\.dll)"}, + {"msvcp120.dll", R"(msvcp120\.dll)"}, + {"msvcp120_clr0400.dll", R"(msvcp120_clr0400\.dll)"}, + {"msvcp60.dll", R"(msvcp60\.dll)"}, + {"msvcp60.dll", R"(msvcp60\.dll)"}, + + {"msvcr100.dll", R"(msvcr100\.dll)"}, + {"msvcr100d.dll", R"(msvcr100d\.dll)"}, + {"msvcr100_clr0400.dll", R"(msvcr100_clr0400\.dll)"}, + {"msvcr110.dll", R"(msvcr110\.dll)"}, + {"msvcr120.dll", R"(msvcr120\.dll)"}, + {"msvcr120_clr0400.dll", R"(msvcr120_clr0400\.dll)"}, + {"msvcrt.dll", R"(msvcrt\.dll)"}, + {"msvcrt20.dll", R"(msvcrt20\.dll)"}, + {"msvcrt40.dll", R"(msvcrt40\.dll)"} }; return v; -- cgit v1.2.3