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)
|
2021-04-27 01:28:21 +08:00
|
|
|
#remove if merged: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1655
|
2017-01-12 04:36:21 +08:00
|
|
|
endif()
|
2017-01-12 04:20:53 +08:00
|
|
|
|
2021-11-30 04:31:32 +08:00
|
|
|
set(GLIB_MAJOR_MINOR 2.70)
|
2022-03-22 04:42:20 +08:00
|
|
|
set(GLIB_PATCH 5)
|
2022-05-07 02:20:25 +08:00
|
|
|
vcpkg_from_gitlab(
|
|
|
|
GITLAB_URL https://gitlab.gnome.org/
|
2019-03-01 14:58:46 +08:00
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
2022-05-07 02:20:25 +08:00
|
|
|
REPO GNOME/glib
|
|
|
|
REF "${GLIB_MAJOR_MINOR}.${GLIB_PATCH}"
|
|
|
|
SHA512 69c032358e0a0d88414a97e0bc898b5ce2797839a432b95790d03f108e55a79eee2d51bab5e281cc9469e2a57accc0d2c9bbaa80f9369050534387d1a215dd98
|
2017-01-14 09:55:41 +08:00
|
|
|
PATCHES
|
2019-03-01 14:58:46 +08:00
|
|
|
use-libiconv-on-windows.patch
|
2021-11-30 04:31:32 +08:00
|
|
|
libintl.patch
|
2019-03-01 14:58:46 +08:00
|
|
|
)
|
2017-01-12 04:20:53 +08:00
|
|
|
|
2021-04-27 01:28:21 +08:00
|
|
|
if (selinux IN_LIST FEATURES)
|
|
|
|
if(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()
|
|
|
|
list(APPEND OPTIONS -Dselinux=enabled)
|
|
|
|
else()
|
|
|
|
list(APPEND OPTIONS -Dselinux=disabled)
|
2019-09-17 06:10:11 +08:00
|
|
|
endif()
|
|
|
|
|
2021-11-24 12:54:53 +08:00
|
|
|
if (libmount IN_LIST FEATURES)
|
|
|
|
list(APPEND OPTIONS -Dlibmount=enabled)
|
|
|
|
else()
|
|
|
|
list(APPEND OPTIONS -Dlibmount=disabled)
|
|
|
|
endif()
|
|
|
|
|
2021-04-27 01:28:21 +08:00
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
list(APPEND OPTIONS -Diconv=external)
|
|
|
|
endif()
|
2019-09-17 06:10:11 +08:00
|
|
|
|
2021-04-27 01:28:21 +08:00
|
|
|
vcpkg_configure_meson(
|
2022-05-07 02:20:25 +08:00
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2021-04-27 01:28:21 +08:00
|
|
|
OPTIONS
|
|
|
|
-Dinstalled_tests=false
|
|
|
|
${OPTIONS}
|
2021-11-30 04:31:32 +08:00
|
|
|
-Dtests=false
|
|
|
|
-Dxattr=false
|
|
|
|
-Dlibelf=disabled
|
2018-07-10 08:29:28 +08:00
|
|
|
)
|
2017-01-12 04:20:53 +08:00
|
|
|
|
2021-04-27 01:28:21 +08:00
|
|
|
vcpkg_install_meson(ADD_BIN_TO_PATH)
|
2018-07-10 08:29:28 +08:00
|
|
|
|
2017-01-12 04:20:53 +08:00
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2022-05-07 02:20:25 +08:00
|
|
|
set(GLIB_TOOLS gdbus
|
|
|
|
gio
|
|
|
|
gio-querymodules
|
|
|
|
glib-compile-resources
|
|
|
|
glib-compile-schemas
|
|
|
|
gobject-query
|
|
|
|
gresource
|
|
|
|
gsettings
|
|
|
|
)
|
2021-04-27 01:28:21 +08:00
|
|
|
|
|
|
|
if(NOT VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
if(NOT VCPKG_TARGET_IS_OSX)
|
|
|
|
list(APPEND GLIB_TOOLS gapplication)
|
|
|
|
endif()
|
|
|
|
list(APPEND GLIB_TOOLS glib-gettextize gtester)
|
|
|
|
endif()
|
|
|
|
set(GLIB_SCRIPTS gdbus-codegen glib-genmarshal glib-mkenums gtester-report)
|
|
|
|
|
2019-08-31 02:53:11 +08:00
|
|
|
|
2021-04-27 01:28:21 +08:00
|
|
|
if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_TARGET_ARCHITECTURE MATCHES "x64|arm64")
|
|
|
|
list(APPEND GLIB_TOOLS gspawn-win64-helper${VCPKG_EXECUTABLE_SUFFIX}
|
|
|
|
gspawn-win64-helper-console${VCPKG_EXECUTABLE_SUFFIX})
|
|
|
|
elseif(VCPKG_TARGET_IS_WINDOWS AND VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
|
|
|
|
list(APPEND GLIB_TOOLS gspawn-win32-helper${VCPKG_EXECUTABLE_SUFFIX}
|
|
|
|
gspawn-win32-helper-console${VCPKG_EXECUTABLE_SUFFIX})
|
|
|
|
endif()
|
|
|
|
vcpkg_copy_tools(TOOL_NAMES ${GLIB_TOOLS} AUTO_CLEAN)
|
|
|
|
foreach(script IN LISTS GLIB_SCRIPTS)
|
|
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/bin/${script}" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/${script}")
|
|
|
|
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/${script}")
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
|
|
|
|
endif()
|
2022-01-26 02:31:15 +08:00
|
|
|
|
2021-04-27 01:28:21 +08:00
|
|
|
IF(VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
set(SYSTEM_LIBRARIES dnsapi iphlpapi winmm lshlwapi)
|
|
|
|
else()
|
|
|
|
set(SYSTEM_LIBRARIES resolv mount blkid selinux)
|
|
|
|
endif()
|
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/gio-2.0.pc")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/gio-2.0.pc" "\${bindir}" "\${bindir}/../tools/${PORT}")
|
|
|
|
endif()
|
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/gio-2.0.pc")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/gio-2.0.pc" "\${bindir}" "\${bindir}/../../tools/${PORT}")
|
|
|
|
endif()
|
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/glib-2.0.pc")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/glib-2.0.pc" "\${bindir}" "\${bindir}/../tools/${PORT}")
|
|
|
|
endif()
|
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/glib-2.0.pc")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/glib-2.0.pc" "\${bindir}" "\${bindir}/../../tools/${PORT}")
|
|
|
|
endif()
|
|
|
|
vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES ${SYSTEM_LIBRARIES})
|
2020-06-12 12:30:40 +08:00
|
|
|
|
2022-05-07 02:20:25 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
2021-04-27 01:28:21 +08:00
|
|
|
|
|
|
|
# Fix python scripts
|
|
|
|
set(_file "${CURRENT_PACKAGES_DIR}/tools/${PORT}/gdbus-codegen")
|
|
|
|
file(READ "${_file}" _contents)
|
|
|
|
string(REPLACE "elif os.path.basename(filedir) == 'bin':" "elif os.path.basename(filedir) == 'tools':" _contents "${_contents}")
|
|
|
|
string(REPLACE "path = os.path.join(filedir, '..', 'share', 'glib-2.0')" "path = os.path.join(filedir, '../..', 'share', 'glib-2.0')" _contents "${_contents}")
|
|
|
|
string(REPLACE "path = os.path.join(filedir, '..')" "path = os.path.join(filedir, '../../share/glib-2.0')" _contents "${_contents}")
|
|
|
|
string(REPLACE "path = os.path.join('${CURRENT_PACKAGES_DIR}/share', 'glib-2.0')" "path = os.path.join('unuseable/share', 'glib-2.0')" _contents "${_contents}")
|
|
|
|
|
|
|
|
file(WRITE "${_file}" "${_contents}")
|
2021-11-10 03:49:00 +08:00
|
|
|
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/gdb")
|
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/tools/glib/glib-gettextize")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/glib/glib-gettextize" "${CURRENT_PACKAGES_DIR}" "`dirname $0`/../..")
|
|
|
|
endif()
|