vcpkg/ports/pthread-stubs/portfile.cmake
Alexander Neumann 552f1ee5f8
[Part1|xwindow PR] Split up to dbus (#22642)
* first batch of xwindow PR ports - up to dbus

* first batch of xwindow PR ports - up to dbus

* format manifest

* version stuff

* remove if block

* version stuff

* fix xcb hash

* fix xproto dependency on meson blocking cross builds

* adjust message

* use X11_xcb_LIB

* version stuff

* put xlib arm64-windows on baseline

* fix dbus on osx and linux

* version stuff

* forget to set the value

* fix --export-dynamic on osx

* version dbus

* ci-retrigger

* add license (needs tool update)

* version adjustments

* version update

* remove unnecessary comments

* v db

* Apply suggestions from code review

Co-authored-by: Billy O'Neal <bion@microsoft.com>

* nitpicks

* rename xau to libxau

* use vcpkg_install_copyright and silence usage

* xtrans silence usage

* format-manifest

* v db

* make license null for ports without exact match

* xdmcp rename to libxdmcp

* merge x11 wrapper into xlib
rename xlib to libx11 to avoid a metaport

* v db

* missed dbus depending on x11.

* v db

* Update scripts/ci.baseline.txt

Co-authored-by: LilyWangLL <94091114+LilyWangLL@users.noreply.github.com>
Co-authored-by: Alexander Neumann <you@example.com>
Co-authored-by: JackBoosY <yuzaiyang@beyondsoft.com>
Co-authored-by: Billy O'Neal <bion@microsoft.com>
2022-08-22 12:26:13 -07:00

52 lines
2.1 KiB
CMake

set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
vcpkg_from_gitlab(
GITLAB_URL https://gitlab.freedesktop.org/xorg
OUT_SOURCE_PATH SOURCE_PATH
REPO lib/pthread-stubs
REF 50f0755a7f894acae168f19c66e52a3f139ca4ec # 0.4.0
SHA512 15fcb2144a8abb7b9b1b8f6d9732759351268fb440c7a59380b0ca6ddf48b74a37ce5afbf777ce58fc1993df0c8d6ffb82e452800ce2fcaf16edcbcc1750e338
HEAD_REF master
)
vcpkg_configure_make(
SOURCE_PATH "${SOURCE_PATH}"
AUTOCONFIG
)
vcpkg_install_make()
vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES pthread)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
# Handle copyright
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
set(_file "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/pthread-stubs.pc")
file(READ "${_file}" _contents)
string(REPLACE "Cflags: -pthread" "Cflags: " _contents "${_contents}")
if(EXISTS "${CURRENT_INSTALLED_DIR}/lib/pthreadVC3.lib")
string(REPLACE "Libs: -pthread" "Libs: -lpthreadVC3" _contents "${_contents}")
endif()
if(EXISTS "${CURRENT_INSTALLED_DIR}/lib/pthreadGC3.lib")
string(REPLACE "Libs: -pthread" "Libs: -lpthreadGC3" _contents "${_contents}")
endif()
file(WRITE "${_file}" "${_contents}")
set(_file "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/pthread-stubs.pc")
file(READ "${_file}" _contents)
string(REPLACE "Cflags: -pthread" "Cflags: " _contents "${_contents}")
if(EXISTS "${CURRENT_INSTALLED_DIR}/debug/lib/pthreadVC3.lib")
string(REPLACE "Libs: -pthread" "Libs: -lpthreadVC3" _contents "${_contents}")
endif()
if(EXISTS "${CURRENT_INSTALLED_DIR}/debug/lib/pthreadGC3.lib")
string(REPLACE "Libs: -pthread" "Libs: -lpthreadGC3" _contents "${_contents}")
endif()
if(EXISTS "${CURRENT_INSTALLED_DIR}/debug/lib/pthreadVC3d.lib")
string(REPLACE "Libs: -pthread" "Libs: -lpthreadVC3d" _contents "${_contents}")
endif()
if(EXISTS "${CURRENT_INSTALLED_DIR}/debug/lib/pthreadGC3d.lib")
string(REPLACE "Libs: -pthread" "Libs: -lpthreadGC3d" _contents "${_contents}")
endif()
file(WRITE "${_file}" "${_contents}")