diff options
Diffstat (limited to 'vcpkg/ports/xtrans')
| -rw-r--r-- | vcpkg/ports/xtrans/portfile.cmake | 53 | ||||
| -rw-r--r-- | vcpkg/ports/xtrans/symbols.patch | 15 | ||||
| -rw-r--r-- | vcpkg/ports/xtrans/vcpkg.json | 11 | ||||
| -rw-r--r-- | vcpkg/ports/xtrans/win32.patch | 58 |
4 files changed, 137 insertions, 0 deletions
diff --git a/vcpkg/ports/xtrans/portfile.cmake b/vcpkg/ports/xtrans/portfile.cmake new file mode 100644 index 0000000..f561e4c --- /dev/null +++ b/vcpkg/ports/xtrans/portfile.cmake @@ -0,0 +1,53 @@ +set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
+
+if(NOT X_VCPKG_FORCE_VCPKG_X_LIBRARIES AND NOT VCPKG_TARGET_IS_WINDOWS)
+ message(STATUS "Utils and libraries provided by '${PORT}' should be provided by your system! Install the required packages or force vcpkg libraries by setting X_VCPKG_FORCE_VCPKG_X_LIBRARIES in your triplet")
+ set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
+else()
+
+vcpkg_from_gitlab(
+ GITLAB_URL https://gitlab.freedesktop.org/xorg
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO lib/libxtrans
+ REF 3b5df889f58a99980a35a7b4a18eb4e7d2abeac4 #v1.4
+ SHA512 d1a1ecd8aa07d19a8b4936a37109cecd0c965b859a17ea838835230f9326c1a353feef388052df03173562cbf0f3e3764146c3669b1928698cd55ccc4f92992c
+ HEAD_REF master
+ PATCHES win32.patch
+ symbols.patch
+)
+
+set(ENV{ACLOCAL} "aclocal -I \"${CURRENT_INSTALLED_DIR}/share/xorg/aclocal/\"")
+vcpkg_configure_make(
+ SOURCE_PATH ${SOURCE_PATH}
+ AUTOCONFIG
+)
+
+vcpkg_install_make()
+
+file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/xorg")
+file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/${PORT}")
+
+# the include folder is moved since it contains source files. It is not meant as a traditional include folder but as a shared files folder for different x libraries.
+file(RENAME "${CURRENT_PACKAGES_DIR}/include" "${CURRENT_PACKAGES_DIR}/share/${PORT}/include")
+
+file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/lib")
+file(RENAME "${CURRENT_PACKAGES_DIR}/share/${PORT}/pkgconfig/" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig")
+file(RENAME "${CURRENT_PACKAGES_DIR}/share/${PORT}/aclocal/" "${CURRENT_PACKAGES_DIR}/share/xorg/aclocal")
+if(NOT VCPKG_BUILD_TYPE)
+ file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/lib")
+ file(RENAME "${CURRENT_PACKAGES_DIR}/debug/share/${PORT}/pkgconfig" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig")
+ file(RENAME "${CURRENT_PACKAGES_DIR}/debug/share/" "${CURRENT_PACKAGES_DIR}/share/xorg/debug")
+endif()
+vcpkg_fixup_pkgconfig() # must be called after files have been moved
+vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/xtrans.pc" "includedir=\${prefix}/include" "includedir=\${prefix}/share/${PORT}/include")
+if(NOT VCPKG_BUILD_TYPE)
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/xtrans.pc" "includedir=\${prefix}/../include" "includedir=\${prefix}/../share/${PORT}/include")
+endif()
+
+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)
+file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" "")
+endif()
diff --git a/vcpkg/ports/xtrans/symbols.patch b/vcpkg/ports/xtrans/symbols.patch new file mode 100644 index 0000000..2110d31 --- /dev/null +++ b/vcpkg/ports/xtrans/symbols.patch @@ -0,0 +1,15 @@ +diff --git a/Xtransutil.c b/Xtransutil.c
+index 413a02376..2f8af0efc 100644
+--- a/Xtransutil.c
++++ b/Xtransutil.c
+@@ -64,6 +64,10 @@ from The Open Group.
+ #ifdef WIN32
+ #include <X11/Xlibint.h>
+ #include <X11/Xwinsock.h>
++#ifdef _MSC_VER
++# include <direct.h>
++# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
++#endif
+ #endif
+
+ #ifdef X11_t
diff --git a/vcpkg/ports/xtrans/vcpkg.json b/vcpkg/ports/xtrans/vcpkg.json new file mode 100644 index 0000000..190f9c1 --- /dev/null +++ b/vcpkg/ports/xtrans/vcpkg.json @@ -0,0 +1,11 @@ +{ + "name": "xtrans", + "version": "1.4.0", + "port-version": 2, + "description": "xtrans - X Network Transport layer shared code", + "homepage": "https://gitlab.freedesktop.org/xorg/lib/libxtrans", + "license": null, + "dependencies": [ + "xorg-macros" + ] +} diff --git a/vcpkg/ports/xtrans/win32.patch b/vcpkg/ports/xtrans/win32.patch new file mode 100644 index 0000000..dee4c79 --- /dev/null +++ b/vcpkg/ports/xtrans/win32.patch @@ -0,0 +1,58 @@ +diff --git a/Xtrans.h b/Xtrans.h
+index fbf385e01..e52e7cba2 100644
+--- a/Xtrans.h
++++ b/Xtrans.h
+@@ -50,6 +50,10 @@ from The Open Group.
+ #ifndef _XTRANS_H_
+ #define _XTRANS_H_
+
++#if defined(_WIN32) && !defined(WIN32)
++# define WIN32 _WIN32
++#endif
++
+ #include <X11/Xfuncproto.h>
+ #include <X11/Xos.h>
+ #include <X11/Xmd.h>
+diff --git a/Xtransint.h b/Xtransint.h
+index 2156bd52f..735b54301 100644
+--- a/Xtransint.h
++++ b/Xtransint.h
+@@ -72,7 +72,7 @@ from The Open Group.
+ # define XTRANSDEBUG 1
+ #endif
+
+-#ifdef WIN32
++#if defined(WIN32) || defined(_WIN32)
+ # define _WILLWINSOCK_
+ #endif
+
+diff --git a/Xtranssock.c b/Xtranssock.c
+index c29390eaa..f2ef365cc 100644
+--- a/Xtranssock.c
++++ b/Xtranssock.c
+@@ -74,6 +74,10 @@ from the copyright holders.
+ #include <X11/Xthreads.h>
+ #endif
+
++#if defined(_WIN32) && !defined(WIN32)
++# define WIN32 _WIN32
++#endif
++
+ #ifndef WIN32
+
+ #if defined(TCPCONN) || defined(UNIXCONN)
+diff --git a/Xtransutil.c b/Xtransutil.c
+index f15be243c..cc67315e6 100644
+--- a/Xtransutil.c
++++ b/Xtransutil.c
+@@ -54,6 +54,10 @@ from The Open Group.
+ * the internal implementation.
+ */
+
++#if defined(_WIN32) && !defined(WIN32)
++# define WIN32 _WIN32
++#endif
++
+ #ifdef XTHREADS
+ #include <X11/Xthreads.h>
+ #endif
|