2019-05-03 13:57:43 +08:00
|
|
|
# Glib uses winapi functions not available in WindowsStore
|
2020-01-07 07:07:30 +08:00
|
|
|
vcpkg_fail_port_install(ON_TARGET "UWP")
|
2017-01-12 04:36:21 +08:00
|
|
|
|
2018-04-18 07:21:39 +08:00
|
|
|
# Glib relies on DllMain on Windows
|
2020-01-07 07:07:30 +08:00
|
|
|
if (VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
|
2017-01-12 04:36:21 +08:00
|
|
|
endif()
|
2017-01-12 04:20:53 +08:00
|
|
|
|
2017-08-30 21:08:46 +08:00
|
|
|
set(GLIB_VERSION 2.52.3)
|
2017-01-12 04:20:53 +08:00
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2017-04-09 17:15:32 +08:00
|
|
|
URLS "https://ftp.gnome.org/pub/gnome/sources/glib/2.52/glib-${GLIB_VERSION}.tar.xz"
|
2017-03-14 06:29:40 +08:00
|
|
|
FILENAME "glib-${GLIB_VERSION}.tar.xz"
|
2017-08-30 21:08:46 +08:00
|
|
|
SHA512 a068f2519cfb82de8d4b7f004e7c1f15e841cad4046430a83b02b359d011e0c4077cdff447a1687ed7c68f1a11b4cf66b9ed9fc23ab5f0c7c6be84eb0ddc3017)
|
2017-01-12 04:20:53 +08:00
|
|
|
|
2019-03-01 14:58:46 +08:00
|
|
|
vcpkg_extract_source_archive_ex(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
ARCHIVE ${ARCHIVE}
|
|
|
|
REF ${GLIB_VERSION}
|
2017-01-14 09:55:41 +08:00
|
|
|
PATCHES
|
2019-03-01 14:58:46 +08:00
|
|
|
use-libiconv-on-windows.patch
|
2019-05-04 07:21:44 +08:00
|
|
|
arm64-defines.patch
|
|
|
|
fix-arm-builds.patch
|
2019-03-01 14:58:46 +08:00
|
|
|
)
|
2017-01-12 04:20:53 +08:00
|
|
|
|
2020-06-12 12:30:40 +08:00
|
|
|
configure_file(${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt ${SOURCE_PATH}/CMakeLists.txt COPYONLY)
|
2017-01-12 04:20:53 +08:00
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/cmake DESTINATION ${SOURCE_PATH})
|
|
|
|
file(REMOVE_RECURSE ${SOURCE_PATH}/glib/pcre)
|
2018-04-18 07:21:39 +08:00
|
|
|
file(WRITE ${SOURCE_PATH}/glib/pcre/Makefile.in)
|
2017-01-14 09:55:41 +08:00
|
|
|
file(REMOVE ${SOURCE_PATH}/glib/win_iconv.c)
|
2017-01-12 04:20:53 +08:00
|
|
|
|
2019-09-17 06:10:11 +08:00
|
|
|
if (selinux IN_LIST FEATURES AND NOT VCPKG_TARGET_IS_WINDOWS AND NOT EXISTS "/usr/include/selinux")
|
|
|
|
message("Selinux was not found in its typical system location. Your build may fail. You can install Selinux with \"apt-get install selinux\".")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
|
|
selinux HAVE_SELINUX
|
|
|
|
)
|
|
|
|
|
2017-01-12 04:20:53 +08:00
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2017-03-14 06:29:40 +08:00
|
|
|
PREFER_NINJA
|
2019-09-17 06:10:11 +08:00
|
|
|
OPTIONS ${FEATURE_OPTIONS}
|
2017-03-14 06:29:40 +08:00
|
|
|
-DGLIB_VERSION=${GLIB_VERSION}
|
2017-01-12 04:20:53 +08:00
|
|
|
OPTIONS_DEBUG
|
|
|
|
-DGLIB_SKIP_HEADERS=ON
|
2018-04-18 07:21:39 +08:00
|
|
|
-DGLIB_SKIP_TOOLS=ON
|
2018-07-10 08:29:28 +08:00
|
|
|
)
|
2017-01-12 04:20:53 +08:00
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
2018-07-10 08:29:28 +08:00
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-glib TARGET_PATH share/unofficial-glib)
|
|
|
|
|
2017-01-12 04:20:53 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2020-05-08 13:22:28 +08:00
|
|
|
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT})
|
2017-01-12 04:20:53 +08:00
|
|
|
|
2019-08-31 02:53:11 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
|
|
|
|
2020-06-12 12:30:40 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
|
|
|
|
2020-05-08 13:22:28 +08:00
|
|
|
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|