aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/libsm
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/libsm
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/libsm')
-rw-r--r--vcpkg/ports/libsm/missing-include.patch14
-rw-r--r--vcpkg/ports/libsm/portfile.cmake32
-rw-r--r--vcpkg/ports/libsm/vcpkg.json13
-rw-r--r--vcpkg/ports/libsm/windows.patch22
4 files changed, 81 insertions, 0 deletions
diff --git a/vcpkg/ports/libsm/missing-include.patch b/vcpkg/ports/libsm/missing-include.patch
new file mode 100644
index 0000000..f4f4358
--- /dev/null
+++ b/vcpkg/ports/libsm/missing-include.patch
@@ -0,0 +1,14 @@
+diff --git a/src/sm_genid.c b/src/sm_genid.c
+index 3726eb1d2..082ce89fe 100644
+--- a/src/sm_genid.c
++++ b/src/sm_genid.c
+@@ -90,6 +90,9 @@ in this Software without prior written authorization from The Open Group.
+ # define X_INCLUDE_NETDB_H
+ # define XOS_USE_MTSAFE_NETDBAPI
+ # include <X11/Xos_r.h>
++# ifdef _MSC_VER
++# include <process.h>
++# endif
+
+ #endif /* WIN32 */
+
diff --git a/vcpkg/ports/libsm/portfile.cmake b/vcpkg/ports/libsm/portfile.cmake
new file mode 100644
index 0000000..16f95e1
--- /dev/null
+++ b/vcpkg/ports/libsm/portfile.cmake
@@ -0,0 +1,32 @@
+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/libsm
+ REF a52c79544fcd6b5e2242b9122dfaa34be07aebb2 # 1.2.3
+ SHA512 379e450d90e61d80d4fea8449a582b3eee3968bef137022053cb3bd51fa2815d8fccc43ff11e3b593c4a67ad64e93209c25111a20ac88e38c1f663cd274f5d56
+ HEAD_REF master
+ PATCHES windows.patch
+ missing-include.patch # avoids: warning C4013: '_getpid' undefined; assuming extern returning int
+)
+
+set(ENV{ACLOCAL} "aclocal -I \"${CURRENT_INSTALLED_DIR}/share/xorg/aclocal/\"")
+
+vcpkg_configure_make(
+ SOURCE_PATH "${SOURCE_PATH}"
+ AUTOCONFIG
+)
+
+vcpkg_install_make()
+vcpkg_fixup_pkgconfig()
+
+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)
+endif()
diff --git a/vcpkg/ports/libsm/vcpkg.json b/vcpkg/ports/libsm/vcpkg.json
new file mode 100644
index 0000000..1881bd7
--- /dev/null
+++ b/vcpkg/ports/libsm/vcpkg.json
@@ -0,0 +1,13 @@
+{
+ "name": "libsm",
+ "version": "1.2.3",
+ "port-version": 1,
+ "description": "X Session Management Library",
+ "homepage": "https://gitlab.freedesktop.org/xorg/lib/libsm",
+ "license": null,
+ "dependencies": [
+ "bzip2",
+ "libice",
+ "xorg-macros"
+ ]
+}
diff --git a/vcpkg/ports/libsm/windows.patch b/vcpkg/ports/libsm/windows.patch
new file mode 100644
index 0000000..abf52cb
--- /dev/null
+++ b/vcpkg/ports/libsm/windows.patch
@@ -0,0 +1,22 @@
+diff --git a/src/sm_genid.c b/src/sm_genid.c
+index 1a8b9a0ed..3726eb1d2 100644
+--- a/src/sm_genid.c
++++ b/src/sm_genid.c
+@@ -64,7 +64,9 @@ in this Software without prior written authorization from The Open Group.
+ # include <X11/Xthreads.h>
+ #endif
+ #include <stdio.h>
++#ifdef HAVE_UNISTD_H
+ #include <unistd.h>
++#endif
+
+ #include <time.h>
+ #define Time_t time_t
+@@ -84,6 +86,7 @@ in this Software without prior written authorization from The Open Group.
+
+ # include <X11/Xwinsock.h>
+ # include <X11/Xw32defs.h>
++# include <ws2ipdef.h>
+ # define X_INCLUDE_NETDB_H
+ # define XOS_USE_MTSAFE_NETDBAPI
+ # include <X11/Xos_r.h>