diff options
Diffstat (limited to 'vcpkg/ports/libxaw')
| -rw-r--r-- | vcpkg/ports/libxaw/portfile.cmake | 45 | ||||
| -rw-r--r-- | vcpkg/ports/libxaw/vcpkg.json | 19 | ||||
| -rw-r--r-- | vcpkg/ports/libxaw/win.patch | 98 |
3 files changed, 162 insertions, 0 deletions
diff --git a/vcpkg/ports/libxaw/portfile.cmake b/vcpkg/ports/libxaw/portfile.cmake new file mode 100644 index 0000000..cfb12c3 --- /dev/null +++ b/vcpkg/ports/libxaw/portfile.cmake @@ -0,0 +1,45 @@ +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_check_linkage(ONLY_DYNAMIC_LIBRARY)
+
+if(VCPKG_TARGET_IS_WINDOWS)
+ set(OPTIONS lt_cv_deplibs_check_method=pass_all) # since libxt will always be static
+endif()
+
+vcpkg_from_gitlab(
+ GITLAB_URL https://gitlab.freedesktop.org/xorg
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO lib/libxaw
+ REF 9cfeba9db7f3ac4e0b351969c9ff5ab8f58ec7ef
+ SHA512 52c6e390aa90190ca528716eaa164ae2d79dd3345372ccc263ad1cfd2f1f49edc67df6ac34f2b9847bc099a3188d7d7161d7038565aae008cc12da373b0fc3b2
+ HEAD_REF master
+ PATCHES win.patch
+)
+
+set(ENV{ACLOCAL} "aclocal -I \"${CURRENT_INSTALLED_DIR}/share/xorg/aclocal/\"")
+
+vcpkg_configure_make(
+ SOURCE_PATH "${SOURCE_PATH}"
+ AUTOCONFIG
+ OPTIONS lt_cv_deplibs_check_method=pass_all
+)
+if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
+ set(makefile "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/Makefile")
+ if(EXISTS "${makefile}")
+ vcpkg_replace_string("${makefile}" ".dll.a" ".lib")
+ endif()
+ set(makefile "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/Makefile")
+ if(EXISTS "${makefile}")
+ vcpkg_replace_string("${makefile}" ".dll.a" ".lib")
+ endif()
+endif()
+vcpkg_install_make()
+vcpkg_fixup_pkgconfig()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+
+file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
+endif()
diff --git a/vcpkg/ports/libxaw/vcpkg.json b/vcpkg/ports/libxaw/vcpkg.json new file mode 100644 index 0000000..2d52f48 --- /dev/null +++ b/vcpkg/ports/libxaw/vcpkg.json @@ -0,0 +1,19 @@ +{ + "name": "libxaw", + "version": "1.0.13", + "port-version": 1, + "description": "X Athena Widget Set, based on the X Toolkit Intrinsics (Xt) Library", + "homepage": "https://gitlab.freedesktop.org/xorg/lib/libxaw", + "license": null, + "supports": "!windows | !staticcrt", + "dependencies": [ + "bzip2", + "libx11", + "libxext", + "libxmu", + "libxpm", + "libxt", + "xorg-macros", + "xproto" + ] +} diff --git a/vcpkg/ports/libxaw/win.patch b/vcpkg/ports/libxaw/win.patch new file mode 100644 index 0000000..4582459 --- /dev/null +++ b/vcpkg/ports/libxaw/win.patch @@ -0,0 +1,98 @@ +diff --git a/Makefile.am b/Makefile.am +index 8e039a07f..e99d5d6d2 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -9,8 +9,12 @@ pkgconfig_DATA += xaw6.pc + if PLATFORM_DARWIN + DEFAULT_LIB = libXaw.6.@LIBEXT@ + else ++if PLATFORM_WIN32 ++DEFAULT_LIB = Xaw6.@LIBEXT@ ++else + DEFAULT_LIB = libXaw6.@LIBEXT@ + endif ++endif + + endif + +@@ -20,8 +24,12 @@ pkgconfig_DATA += xaw7.pc + if PLATFORM_DARWIN + DEFAULT_LIB = libXaw.7.@LIBEXT@ + else ++if PLATFORM_WIN32 ++DEFAULT_LIB = Xaw7.@LIBEXT@ ++else + DEFAULT_LIB = libXaw7.@LIBEXT@ + endif ++endif + + endif + +@@ -33,7 +41,7 @@ EXTRA_DIST = \ + old-doc/CHANGES + + install-exec-hook: +- cd $(DESTDIR)$(libdir) && rm -f libXaw.@LIBEXT@ && $(LN_S) $(DEFAULT_LIB) libXaw.@LIBEXT@ ++ cd $(DESTDIR)$(libdir) && rm -f libXaw.@LIBEXT@ && $(LN_S) $(DEFAULT_LIB) Xaw.@LIBEXT@ + + uninstall-local: + -rm -f $(DESTDIR)$(libdir)/libXaw.@LIBEXT@ +diff --git a/src/AsciiSrc.c b/src/AsciiSrc.c +index 875b97c6c..8223e3bf4 100644 +--- a/src/AsciiSrc.c ++++ b/src/AsciiSrc.c +@@ -54,6 +54,10 @@ in this Software without prior written authorization from The Open Group. + #include <sys/types.h> + #include <sys/stat.h> + #include <fcntl.h> ++#ifdef _WIN32 ++#include <io.h> ++typedef int mode_t; ++#endif + + #if (defined(ASCII_STRING) || defined(ASCII_DISK)) + #include <X11/Xaw/AsciiText.h> /* for Widget Classes */ +diff --git a/src/MultiSrc.c b/src/MultiSrc.c +index b4a123c14..dc2146913 100644 +--- a/src/MultiSrc.c ++++ b/src/MultiSrc.c +@@ -74,6 +74,10 @@ in this Software without prior written authorization from The Open Group. + #include <sys/types.h> + #include <sys/stat.h> + #include <fcntl.h> ++#ifdef _WIN32 ++#include <io.h> ++typedef int mode_t; ++#endif + + #define MAGIC_VALUE ((XawTextPosition)-1) + #define streq(a, b) (strcmp((a), (b)) == 0) +diff --git a/src/TextAction.c b/src/TextAction.c +index 43d1d3258..e083c908f 100644 +--- a/src/TextAction.c ++++ b/src/TextAction.c +@@ -29,7 +29,12 @@ in this Software without prior written authorization from The Open Group. + #endif + #include <stdio.h> + #include <stdlib.h> ++#ifdef HAVE_UNISTD_H + #include <unistd.h> ++#endif ++#ifdef _WIN32 ++#define _WILLWINSOCK_ ++#endif + #include <X11/Xos.h> /* for select() and struct timeval */ + #include <ctype.h> + #include <X11/IntrinsicP.h> +@@ -3186,7 +3191,11 @@ InsertChar(Widget w, XEvent *event, String *p _X_UNUSED, Cardinal *n _X_UNUSED) + FD_SET(ConnectionNumber(XtDisplay(w)), &fds); + (void)select(FD_SETSIZE, &fds, NULL, NULL, &tmval); + if (tmval.tv_usec != 500000) ++ #ifndef _WIN32 + usleep(40000); ++ #else ++ Sleep(40); ++ #endif + + StartAction(ctx, NULL); + #ifndef OLDXAW |