mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-14 19:28:10 +08:00
[gmime] Update to 3.2.15, use official build system (#42959)
This commit is contained in:
parent
a54ecb2ce9
commit
8a3beb3913
@ -1,58 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
|
||||
project(gmime C)
|
||||
|
||||
set(GMIME_DLL_SUFFIX 3)
|
||||
set(GMIME_LIB_SUFFIX 3.0)
|
||||
|
||||
find_package(ZLIB REQUIRED)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(GLIB2 glib-2.0 gobject-2.0 gmodule-2.0 gio-2.0 IMPORTED_TARGET)
|
||||
find_package(Iconv REQUIRED)
|
||||
|
||||
pkg_check_modules(IDN2 libidn2 IMPORTED_TARGET)
|
||||
|
||||
if(MSVC)
|
||||
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
|
||||
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
|
||||
endif()
|
||||
|
||||
add_definitions(-DHAVE_CONFIG_H)
|
||||
add_definitions(-DG_DISABLE_DEPRECATED)
|
||||
add_definitions(-DG_LOG_DOMAIN="GMime")
|
||||
|
||||
# Source files
|
||||
file(GLOB LIB_SRC gmime/gmime-*.c)
|
||||
list(APPEND LIB_SRC gmime/gmime.c
|
||||
gmime/internet-address.c
|
||||
util/packed.c
|
||||
util/url-scanner.c
|
||||
util/gtrie.c)
|
||||
|
||||
# Headers
|
||||
file(GLOB LIB_HEADERS gmime/gmime-*.h)
|
||||
list(APPEND LIB_HEADERS gmime/gmime.h)
|
||||
list(APPEND LIB_HEADERS gmime/internet-address.h)
|
||||
|
||||
if(MSVC AND BUILD_SHARED_LIBS)
|
||||
set(MSVC_SRC gmime.def)
|
||||
endif()
|
||||
|
||||
add_library(${PROJECT_NAME} ${LIB_SRC} ${MSVC_SRC})
|
||||
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES
|
||||
OUTPUT_NAME ${PROJECT_NAME}-${GMIME_DLL_SUFFIX}
|
||||
ARCHIVE_OUTPUT_NAME ${PROJECT_NAME}-${GMIME_LIB_SUFFIX}
|
||||
)
|
||||
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE . ./util)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE Iconv::Iconv ZLIB::ZLIB PkgConfig::IDN2)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::GLIB2)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE Ws2_32.lib)
|
||||
|
||||
install(TARGETS ${PROJECT_NAME}
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib)
|
||||
|
||||
install(FILES ${LIB_HEADERS} DESTINATION include/gmime)
|
33
ports/gmime/msvc-ssize_t.diff
Normal file
33
ports/gmime/msvc-ssize_t.diff
Normal file
@ -0,0 +1,33 @@
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 9d368e0..c534a09 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -168,6 +168,13 @@ AC_TYPE_MODE_T
|
||||
AC_TYPE_OFF_T
|
||||
AC_TYPE_SIZE_T
|
||||
AC_TYPE_SSIZE_T
|
||||
+AH_BOTTOM([
|
||||
+#ifdef _MSC_VER
|
||||
+#undef ssize_t;
|
||||
+#include <BaseTsd.h>
|
||||
+typedef SSIZE_T ssize_t;
|
||||
+#endif
|
||||
+])
|
||||
AC_TYPE_UINT32_T
|
||||
AC_TYPE_UINT64_T
|
||||
AC_TYPE_UINT8_T
|
||||
diff --git a/gmime/gmime.h b/gmime/gmime.h
|
||||
index ef6b93e..d3696ac 100644
|
||||
--- a/gmime/gmime.h
|
||||
+++ b/gmime/gmime.h
|
||||
@@ -22,6 +22,10 @@
|
||||
#ifndef __GMIME_H__
|
||||
#define __GMIME_H__
|
||||
|
||||
+#ifdef _MSC_VER
|
||||
+#include <BaseTsd.h>
|
||||
+typedef SSIZE_T ssize_t;
|
||||
+#endif
|
||||
#include <glib.h>
|
||||
#include <gmime/gmime-version.h>
|
||||
#include <gmime/gmime-error.h>
|
@ -1,38 +1,71 @@
|
||||
set(LIB_NAME gmime)
|
||||
set(LIB_VERSION 3.2.6)
|
||||
|
||||
set(LIB_FILENAME ${LIB_NAME}-${LIB_VERSION}.tar.xz)
|
||||
|
||||
vcpkg_download_distfile(ARCHIVE
|
||||
URLS "https://download.gnome.org/sources/gmime/3.2/${LIB_FILENAME}"
|
||||
FILENAME "${LIB_FILENAME}"
|
||||
SHA512 a60d3f9f1aa8490865c22cd9539544e9c9f3ceb4037b9749cf9e5c279f97aa88fc4cd077bf2aff314ba0db2a1b7bbe76f9b1ca5a17fffcbd6315ecebc5414a3d
|
||||
URLS https://github.com/jstedfast/gmime/releases/download/${VERSION}/gmime-${VERSION}.tar.xz
|
||||
FILENAME "gmime-${VERSION}.tar.xz"
|
||||
SHA512 cafb89854b2441508bf940fd6f991739d30fb137b8928ad33e8e4d2a0293a6460e4d1318e73c3ee9e5a964b692f36e7a4eb5f2930c6998698bd9edf866629655
|
||||
)
|
||||
|
||||
vcpkg_extract_source_archive(
|
||||
SOURCE_PATH
|
||||
ARCHIVE "${ARCHIVE}"
|
||||
SOURCE_BASE "${LIB_VERSION}"
|
||||
PATCHES
|
||||
subdirs.diff
|
||||
msvc-ssize_t.diff
|
||||
)
|
||||
|
||||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
|
||||
set(ENV{ACLOCAL} "aclocal -I \"${CURRENT_INSTALLED_DIR}/share/aclocal/\"") # for glib
|
||||
set(ENV{GTKDOCIZE} true)
|
||||
|
||||
# We can use file supplied with original sources
|
||||
configure_file("${SOURCE_PATH}/build/vs2017/unistd.h" "${SOURCE_PATH}" COPYONLY)
|
||||
configure_file("${SOURCE_PATH}/build/vs2017/config.h" "${SOURCE_PATH}" COPYONLY)
|
||||
configure_file("${SOURCE_PATH}/build/vs2017/gmime.def" "${SOURCE_PATH}" COPYONLY)
|
||||
vcpkg_find_acquire_program(PKGCONFIG)
|
||||
vcpkg_cmake_configure(
|
||||
vcpkg_list(SET options)
|
||||
set(iconv_detect_h "${CURRENT_HOST_INSTALLED_DIR}/share/${PORT}/iconv-detect-${VCPKG_CMAKE_SYSTEM_NAME}.h")
|
||||
if(EXISTS "${iconv_detect_h}")
|
||||
vcpkg_list(APPEND options "ac_cv_have_iconv_detect_h=yes")
|
||||
elseif(VCPKG_CROSSCOMPILING)
|
||||
vcpkg_list(APPEND options "ac_cv_have_iconv_detect_h=no")
|
||||
endif()
|
||||
|
||||
if("crypto" IN_LIST FEATURES)
|
||||
vcpkg_list(APPEND options "--enable-crypto")
|
||||
else()
|
||||
vcpkg_list(APPEND options "--disable-crypto")
|
||||
endif()
|
||||
|
||||
vcpkg_configure_make(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
AUTOCONFIG
|
||||
ADD_BIN_TO_PATH # for iconv-detect
|
||||
OPTIONS
|
||||
"-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}"
|
||||
${options}
|
||||
--disable-crypto
|
||||
--disable-glibtest
|
||||
--disable-introspection
|
||||
--disable-vala
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
if(EXISTS "${iconv_detect_h}")
|
||||
file(COPY_FILE "${iconv_detect_h}" "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/iconv-detect.h")
|
||||
if(NOT VCPKG_BUILD_TYPE)
|
||||
file(COPY_FILE "${iconv_detect_h}" "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/iconv-detect.h")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
|
||||
file(COPY "${SOURCE_PATH}/build/vs2017/unistd.h" DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel")
|
||||
if(NOT VCPKG_BUILD_TYPE)
|
||||
file(COPY "${SOURCE_PATH}/build/vs2017/unistd.h" DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
vcpkg_install_make()
|
||||
vcpkg_copy_pdbs()
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
if(NOT VCPKG_CROSSCOMPILING)
|
||||
file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/iconv-detect.h"
|
||||
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}"
|
||||
RENAME "iconv-detect-${VCPKG_CMAKE_SYSTEM_NAME}.h"
|
||||
)
|
||||
endif()
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
|
||||
# License and man
|
||||
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${LIB_NAME}" RENAME copyright)
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
|
||||
|
16
ports/gmime/subdirs.diff
Normal file
16
ports/gmime/subdirs.diff
Normal file
@ -0,0 +1,16 @@
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index c004167..0fafe72 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -2,10 +2,9 @@
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
-SUBDIRS = m4 build util gmime tests docs
|
||||
+SUBDIRS = m4 build util gmime
|
||||
|
||||
if !PLATFORM_WIN32
|
||||
-SUBDIRS += examples
|
||||
endif
|
||||
|
||||
SUBDIRS += tools .
|
@ -1,19 +1,29 @@
|
||||
{
|
||||
"name": "gmime",
|
||||
"version": "3.2.6",
|
||||
"port-version": 6,
|
||||
"version": "3.2.15",
|
||||
"description": "GMime is a C/C++ library which may be used for the creation and parsing of messages using the Multipurpose Internet Mail Extension (MIME).",
|
||||
"homepage": "https://developer.gnome.org/gmime/",
|
||||
"homepage": "https://github.com/jstedfast/gmime",
|
||||
"license": "LGPL-2.1-or-later",
|
||||
"supports": "windows & !xbox",
|
||||
"supports": "!xbox",
|
||||
"dependencies": [
|
||||
"glib",
|
||||
"libiconv",
|
||||
"libidn2",
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"name": "gmime",
|
||||
"host": true
|
||||
},
|
||||
"libiconv",
|
||||
"libidn2",
|
||||
"zlib"
|
||||
]
|
||||
],
|
||||
"features": {
|
||||
"crypto": {
|
||||
"description": "PGP and S/MIME support",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "gpgme",
|
||||
"default-features": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
15
ports/gmime/win32_ssize_t.diff
Normal file
15
ports/gmime/win32_ssize_t.diff
Normal file
@ -0,0 +1,15 @@
|
||||
diff --git a/gmime/gmime.h b/gmime/gmime.h
|
||||
index ef6b93e..d3696ac 100644
|
||||
--- a/gmime/gmime.h
|
||||
+++ b/gmime/gmime.h
|
||||
@@ -22,6 +22,10 @@
|
||||
#ifndef __GMIME_H__
|
||||
#define __GMIME_H__
|
||||
|
||||
+#ifdef _MSC_VER
|
||||
+#include <BaseTsd.h>
|
||||
+typedef SSIZE_T ssize_t;
|
||||
+#endif
|
||||
#include <glib.h>
|
||||
#include <gmime/gmime-version.h>
|
||||
#include <gmime/gmime-error.h>
|
11
scripts/test_ports/vcpkg-ci-gmime/portfile.cmake
Normal file
11
scripts/test_ports/vcpkg-ci-gmime/portfile.cmake
Normal file
@ -0,0 +1,11 @@
|
||||
SET(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
||||
|
||||
vcpkg_find_acquire_program(PKGCONFIG)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${CURRENT_PORT_DIR}/project"
|
||||
OPTIONS
|
||||
"-DFEATURES=${FEATURES}"
|
||||
"-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}"
|
||||
)
|
||||
vcpkg_cmake_build()
|
15
scripts/test_ports/vcpkg-ci-gmime/project/CMakeLists.txt
Normal file
15
scripts/test_ports/vcpkg-ci-gmime/project/CMakeLists.txt
Normal file
@ -0,0 +1,15 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
|
||||
project(vcpkg-ci-gmime C)
|
||||
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(gmime REQUIRED IMPORTED_TARGET gmime-3.0)
|
||||
|
||||
add_executable(main main.c)
|
||||
target_link_libraries(main PRIVATE PkgConfig::gmime)
|
||||
|
||||
if("crypto" IN_LIST FEATURES)
|
||||
target_compile_definitions(main PRIVATE ENABLE_CRYPTO)
|
||||
endif()
|
26
scripts/test_ports/vcpkg-ci-gmime/project/main.c
Normal file
26
scripts/test_ports/vcpkg-ci-gmime/project/main.c
Normal file
@ -0,0 +1,26 @@
|
||||
#include <glib.h>
|
||||
#include <gmime/gmime.h>
|
||||
|
||||
void verify_callback(GMimeObject *parent, GMimeObject *part, gpointer user_data)
|
||||
{
|
||||
#ifdef ENABLE_CRYPTO
|
||||
if (GMIME_IS_MULTIPART_SIGNED(part))
|
||||
{
|
||||
GMimeMultipartSigned *mps = (GMimeMultipartSigned *)part;
|
||||
GError *err = NULL;
|
||||
GMimeSignatureList *signatures = g_mime_multipart_signed_verify(mps, GMIME_VERIFY_NONE, &err);
|
||||
g_object_unref(signatures);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
g_mime_init();
|
||||
GMimeParser *parser = g_mime_parser_new();
|
||||
GMimeMessage *message = g_mime_parser_construct_message(parser, NULL);
|
||||
g_mime_message_foreach(message, verify_callback, NULL);
|
||||
g_object_unref(message);
|
||||
g_object_unref(parser);
|
||||
return 0;
|
||||
}
|
31
scripts/test_ports/vcpkg-ci-gmime/vcpkg.json
Normal file
31
scripts/test_ports/vcpkg-ci-gmime/vcpkg.json
Normal file
@ -0,0 +1,31 @@
|
||||
{
|
||||
"name": "vcpkg-ci-gmime",
|
||||
"version-string": "ci",
|
||||
"description": "Validates gmime",
|
||||
"dependencies": [
|
||||
"gmime",
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
}
|
||||
],
|
||||
"default-features": [
|
||||
{
|
||||
"name": "crypto",
|
||||
"platform": "!windows | mingw"
|
||||
}
|
||||
],
|
||||
"features": {
|
||||
"crypto": {
|
||||
"description": "gmime[crypo]",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "gmime",
|
||||
"features": [
|
||||
"crypto"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
@ -3193,8 +3193,8 @@
|
||||
"port-version": 4
|
||||
},
|
||||
"gmime": {
|
||||
"baseline": "3.2.6",
|
||||
"port-version": 6
|
||||
"baseline": "3.2.15",
|
||||
"port-version": 0
|
||||
},
|
||||
"gmmlib": {
|
||||
"baseline": "22.5.2",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "0317c90380341a0639221bed8e70dbf37de46b0c",
|
||||
"version": "3.2.15",
|
||||
"port-version": 0
|
||||
},
|
||||
{
|
||||
"git-tree": "93e8b6f02474e1edb7e99db85020d864ee071ce0",
|
||||
"version": "3.2.6",
|
||||
|
Loading…
x
Reference in New Issue
Block a user