diff options
| author | Dawid Wróbel <me@dawidwrobel.com> | 2021-05-25 16:55:06 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-25 13:55:06 -0700 |
| commit | 83f9a6c469bcfe5bca6c990099e321427ad0db97 (patch) | |
| tree | 08f5f7e6995eb2c9530a9d3c41dd6882720f789c /ports | |
| parent | a47809ed9e83af1cf31cc59da76def9fe826e83e (diff) | |
| download | vcpkg-83f9a6c469bcfe5bca6c990099e321427ad0db97.tar.gz vcpkg-83f9a6c469bcfe5bca6c990099e321427ad0db97.zip | |
[libtasn1] Add Windows support, update to 4.17 (#16953)
* [libtasn1] add Windows support
* [libtasn1] Supply absolute paths to standard headers in MSVC
* [libgpg-error] only apply MSVC patch on Windows
* [libtasn1] fix ar-lib issue
* [libtasn1] fix #include in sys_types.h as well
* [libtasn1] fix Windows builds
* [libtasn1] update to 4.17
* [libtasn1] fail x64-windows-static-md builds for now
* [libtasn1] update versions
* [libtasn1] wrap paths in double quotes
* [libtasn1] update versions
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
Diffstat (limited to 'ports')
| -rw-r--r-- | ports/libtasn1/msvc_fixes.patch | 86 | ||||
| -rw-r--r-- | ports/libtasn1/portfile.cmake | 31 | ||||
| -rw-r--r-- | ports/libtasn1/vcpkg.json | 15 |
3 files changed, 121 insertions, 11 deletions
diff --git a/ports/libtasn1/msvc_fixes.patch b/ports/libtasn1/msvc_fixes.patch new file mode 100644 index 000000000..0554ff60a --- /dev/null +++ b/ports/libtasn1/msvc_fixes.patch @@ -0,0 +1,86 @@ +diff --git a/src/asn1Coding.c b/src/asn1Coding.c +index 86c1d07..6fcfc4d 100644 +--- a/src/asn1Coding.c ++++ b/src/asn1Coding.c +@@ -23,7 +23,12 @@ + #include <stdio.h> + #include <string.h> + #include <stdlib.h> ++#ifdef HAVE_UNISTD_H + #include <unistd.h> ++#endif ++#ifdef _MSC_VER ++#include <io.h> ++#endif + #include <getopt.h> + #include <assert.h> + +diff --git a/src/asn1Decoding.c b/src/asn1Decoding.c +index c6f192e..3e4e21d 100644 +--- a/src/asn1Decoding.c ++++ b/src/asn1Decoding.c +@@ -23,7 +23,12 @@ + #include <stdio.h> + #include <string.h> + #include <stdlib.h> ++#ifdef HAVE_UNISTD_H + #include <unistd.h> ++#endif ++#ifdef _MSC_VER ++#include <io.h> ++#endif + #include <getopt.h> + #include <sys/types.h> + #include <sys/stat.h> +diff --git a/src/asn1Parser.c b/src/asn1Parser.c +index b6844a8..445c716 100644 +--- a/src/asn1Parser.c ++++ b/src/asn1Parser.c +@@ -23,7 +23,12 @@ + #include <stdio.h> + #include <string.h> + #include <stdlib.h> ++#ifdef HAVE_UNISTD_H + #include <unistd.h> ++#endif ++#ifdef _MSC_VER ++#include <io.h> ++#endif + #include <getopt.h> + #include <assert.h> + +diff --git a/src/benchmark.c b/src/benchmark.c +index 010d58e..6c613df 100644 +--- a/src/benchmark.c ++++ b/src/benchmark.c +@@ -21,9 +21,16 @@ + #include <stdio.h> + #include <string.h> + #include <signal.h> ++#ifndef _MSC_VER + #include <sys/time.h> ++#endif + #include <time.h> ++#ifdef HAVE_UNISTD_H + #include <unistd.h> ++#endif ++#ifdef _MSC_VER ++#include <io.h> ++#endif + #include "benchmark.h" + + int benchmark_must_finish = 0; +diff --git a/src/benchmark.h b/src/benchmark.h +index 3272649..6b6bf32 100644 +--- a/src/benchmark.h ++++ b/src/benchmark.h +@@ -21,7 +21,9 @@ + # define BENCHMARK_H + + #include <config.h> ++#ifndef _MSC_VER + #include <sys/time.h> ++#endif + #include <time.h> + #include <signal.h> + #if defined _WIN32 diff --git a/ports/libtasn1/portfile.cmake b/ports/libtasn1/portfile.cmake index a1b587ea5..80ca7d2b8 100644 --- a/ports/libtasn1/portfile.cmake +++ b/ports/libtasn1/portfile.cmake @@ -1,32 +1,47 @@ -set(VERSION 4.16.0)
+set(VERSION 4.17.0)
+
+if(VCPKG_TARGET_IS_WINDOWS)
+ set(PATCHES msvc_fixes.patch)
+endif()
vcpkg_download_distfile(ARCHIVE
URLS "https://ftp.gnu.org/gnu/libtasn1/libtasn1-${VERSION}.tar.gz"
FILENAME "libtasn1-${VERSION}.tar.gz"
- SHA512 b356249535d5d592f9b59de39d21e26dd0f3f00ea47c9cef292cdd878042ea41ecbb7c8d2f02ac5839f5210092fe92a25acd343260ddf644887b031b167c2e71
+ SHA512 9cbd920196d1e4c8f5aa613259cded2510d40edb583ce20cc2702e2dee9bf32bee85a159c74600ffbebc2af2787e28ed0fe0adf15fc46839283747f4fe166d3d
)
vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
REF ${VERSION}
+ PATCHES
+ ${PATCHES}
)
-# restore the default ac_cv_prog_cc_g flags, otherwise it fails to compile
-set(VCPKG_C_FLAGS "-g -O2")
-set(VCPKG_CXX_FLAGS "-g -O2")
+if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_MINGW)
+ # $LIBS is an environment variable that vcpkg already pre-populated with some libraries.
+ # We need to re-purpose it when passing LIBS option to make to avoid overriding the vcpkg's own list.
+ set(EXTRA_OPTS "LIBS=\"$LIBS -lgettimeofday -lgetopt\"")
+else()
+ # restore the default ac_cv_prog_cc_g flags, otherwise it fails to compile
+ set(EXTRA_OPTS)
+ set(VCPKG_C_FLAGS "-g -O2")
+ set(VCPKG_CXX_FLAGS "-g -O2")
+endif()
set(ENV{GTKDOCIZE} true)
vcpkg_configure_make(
AUTOCONFIG
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
+ --disable-doc
--disable-gtk-doc
+ --disable-gcc-warnings
+ ${EXTRA_OPTS}
)
vcpkg_install_make()
vcpkg_fixup_pkgconfig()
-vcpkg_copy_pdbs()
-file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
-file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/tools" "${CURRENT_PACKAGES_DIR}/debug/share")
+file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
diff --git a/ports/libtasn1/vcpkg.json b/ports/libtasn1/vcpkg.json index b89caf469..f5490dc89 100644 --- a/ports/libtasn1/vcpkg.json +++ b/ports/libtasn1/vcpkg.json @@ -1,8 +1,17 @@ { "name": "libtasn1", - "version": "4.16.0", - "port-version": 1, + "version": "4.17.0", "description": "A secure communications library implementing the SSL, TLS and DTLS protocols", "homepage": "https://www.gnutls.org/", - "supports": "!windows" + "supports": "!uwp", + "dependencies": [ + { + "name": "getopt", + "platform": "windows" + }, + { + "name": "gettimeofday", + "platform": "windows" + } + ] } |
