2022-11-08 07:40:47 +08:00
|
|
|
vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION}
|
2021-03-12 04:42:05 +08:00
|
|
|
|
|
|
|
vcpkg_download_distfile(ARCHIVE
|
|
|
|
URLS "https://ftp.gnu.org/gnu/libtasn1/libtasn1-${VERSION}.tar.gz"
|
|
|
|
FILENAME "libtasn1-${VERSION}.tar.gz"
|
2022-11-08 07:40:47 +08:00
|
|
|
SHA512 287f5eddfb5e21762d9f14d11997e56b953b980b2b03a97ed4cd6d37909bda1ed7d2cdff9da5d270a21d863ab7e54be6b85c05f1075ac5d8f0198997cf335ef4
|
2021-03-12 04:42:05 +08:00
|
|
|
)
|
|
|
|
|
2022-11-08 07:40:47 +08:00
|
|
|
vcpkg_extract_source_archive(SOURCE_PATH
|
|
|
|
ARCHIVE "${ARCHIVE}"
|
|
|
|
SOURCE_BASE "v${VERSION}"
|
2021-05-26 04:55:06 +08:00
|
|
|
PATCHES
|
2022-11-08 07:40:47 +08:00
|
|
|
msvc_fixes.patch
|
2021-03-12 04:42:05 +08:00
|
|
|
)
|
|
|
|
|
2022-11-08 07:40:47 +08:00
|
|
|
vcpkg_find_acquire_program(BISON)
|
|
|
|
|
2021-10-01 14:58:36 +08:00
|
|
|
set(EXTRA_OPTS "")
|
|
|
|
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
|
2021-05-26 04:55:06 +08:00
|
|
|
# $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.
|
2021-10-01 14:58:36 +08:00
|
|
|
list(APPEND EXTRA_OPTS "LIBS=-lgettimeofday -lgetopt \$LIBS")
|
2021-05-26 04:55:06 +08:00
|
|
|
else()
|
|
|
|
# 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")
|
|
|
|
endif()
|
2021-03-12 04:42:05 +08:00
|
|
|
|
2021-05-27 04:29:52 +08:00
|
|
|
# The upstream doesn't add this macro to the configure
|
|
|
|
if (VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
2021-10-01 14:58:36 +08:00
|
|
|
list(APPEND EXTRA_OPTS "CFLAGS=\$CFLAGS -DASN1_STATIC")
|
2021-05-27 04:29:52 +08:00
|
|
|
endif()
|
|
|
|
|
2021-04-24 04:14:08 +08:00
|
|
|
set(ENV{GTKDOCIZE} true)
|
2021-03-12 04:42:05 +08:00
|
|
|
vcpkg_configure_make(
|
2022-11-08 07:40:47 +08:00
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2021-03-12 04:42:05 +08:00
|
|
|
AUTOCONFIG
|
|
|
|
OPTIONS
|
2021-05-26 04:55:06 +08:00
|
|
|
--disable-doc
|
2021-04-24 04:14:08 +08:00
|
|
|
--disable-gtk-doc
|
2021-05-26 04:55:06 +08:00
|
|
|
--disable-gcc-warnings
|
|
|
|
${EXTRA_OPTS}
|
2022-11-08 07:40:47 +08:00
|
|
|
"YACC=${BISON}"
|
2021-03-12 04:42:05 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_make()
|
2021-04-24 04:14:08 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
2021-03-12 04:42:05 +08:00
|
|
|
|
2022-11-08 07:40:47 +08:00
|
|
|
file(REMOVE_RECURSE
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/share"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug"
|
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_copyright(
|
|
|
|
FILE_LIST
|
|
|
|
"${SOURCE_PATH}/COPYING"
|
|
|
|
"${SOURCE_PATH}/doc/COPYING.LESSER"
|
|
|
|
"${SOURCE_PATH}/doc/COPYING"
|
|
|
|
)
|