Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Mar 2022 15:23:42 GMT
From:      Jan Beich <jbeich@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 68e5efff9900 - main - games/veloren: enable evdev-based joystick support
Message-ID:  <202203121523.22CFNglU034000@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by jbeich:

URL: https://cgit.FreeBSD.org/ports/commit/?id=68e5efff9900ab8ee857edf0d38a5bf65d4fcf18

commit 68e5efff9900ab8ee857edf0d38a5bf65d4fcf18
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2021-01-23 14:45:51 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2022-03-12 15:21:20 +0000

    games/veloren: enable evdev-based joystick support
    
    WARN veloren_voxygen::window: Controller input is unsupported on this platform.
    
    Note, requires hgame(4) on FreeBSD >= 13.0, sysutils/iichid or multimedia/webcamd.
---
 games/veloren/Makefile                |  4 +-
 games/veloren/files/patch-gilrs-evdev | 81 +++++++++++++++++++++++++++++++++++
 2 files changed, 84 insertions(+), 1 deletion(-)

diff --git a/games/veloren/Makefile b/games/veloren/Makefile
index d5a013392478..800cab10f4ac 100644
--- a/games/veloren/Makefile
+++ b/games/veloren/Makefile
@@ -1,6 +1,7 @@
 PORTNAME=	veloren
 DISTVERSIONPREFIX=	v
 DISTVERSION=	0.12.0
+PORTREVISION=	1
 CATEGORIES=	games
 MASTER_SITES=	LOCAL/jbeich
 
@@ -18,7 +19,8 @@ BUILD_DEPENDS=	glslang>0:graphics/glslang \
 		shaderc>0:graphics/shaderc \
 		spirv-tools>0:graphics/spirv-tools \
 		libxkbcommon>0:x11/libxkbcommon
-LIB_DEPENDS=	libasound.so:audio/alsa-lib
+LIB_DEPENDS=	libasound.so:audio/alsa-lib \
+		libudev.so:devel/libudev-devd
 RUN_DEPENDS=	${LOCALBASE}/lib/alsa-lib/libasound_module_pcm_oss.so:audio/alsa-plugins \
 		${LOCALBASE}/lib/libvulkan.so:graphics/vulkan-loader
 
diff --git a/games/veloren/files/patch-gilrs-evdev b/games/veloren/files/patch-gilrs-evdev
new file mode 100644
index 000000000000..819316ded7e6
--- /dev/null
+++ b/games/veloren/files/patch-gilrs-evdev
@@ -0,0 +1,81 @@
+https://gitlab.com/gilrs-project/gilrs/-/merge_requests/56
+
+--- cargo-crates/gilrs-0.8.1/src/mapping/mod.rs.orig	1970-01-01 00:00:00 UTC
++++ cargo-crates/gilrs-0.8.1/src/mapping/mod.rs
+@@ -24,14 +24,14 @@ use vec_map::VecMap;
+ use self::parser::{Error as ParserError, ErrorKind as ParserErrorKind, Parser, Token};
+ 
+ /// Platform name used by SDL mappings
+-#[cfg(target_os = "linux")]
++#[cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd"))]
+ const SDL_PLATFORM_NAME: &str = "Linux";
+ #[cfg(target_os = "macos")]
+ const SDL_PLATFORM_NAME: &'static str = "Mac OS X";
+ #[cfg(target_os = "windows")]
+ const SDL_PLATFORM_NAME: &'static str = "Windows";
+ #[cfg(all(
+-    not(target_os = "linux"),
++    not(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd")),
+     not(target_os = "macos"),
+     not(target_os = "windows")
+ ))]
+--- cargo-crates/gilrs-core-0.3.1/Cargo.toml.orig	1970-01-01 00:00:00 UTC
++++ cargo-crates/gilrs-core-0.3.1/Cargo.toml
+@@ -54,16 +54,16 @@ optional = true
+ [target."cfg(target_arch = \"wasm32\")".dev-dependencies.wasm-bindgen-rs]
+ version = "0.2"
+ package = "wasm-bindgen"
+-[target."cfg(target_os = \"linux\")".dependencies.libc]
++[target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\"))".dependencies.libc]
+ version = "0.2"
+ 
+-[target."cfg(target_os = \"linux\")".dependencies.libudev-sys]
++[target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\"))".dependencies.libudev-sys]
+ version = "0.1"
+ 
+-[target."cfg(target_os = \"linux\")".dependencies.nix]
++[target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\"))".dependencies.nix]
+ version = "0.20"
+ 
+-[target."cfg(target_os = \"linux\")".dependencies.vec_map]
++[target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\"))".dependencies.vec_map]
+ version = "0.8"
+ [target."cfg(target_os = \"macos\")".dependencies.core-foundation]
+ version = "0.6"
+--- cargo-crates/gilrs-core-0.3.1/src/platform/linux/ff.rs.orig	1970-01-01 00:00:00 UTC
++++ cargo-crates/gilrs-core-0.3.1/src/platform/linux/ff.rs
+@@ -104,10 +104,10 @@ impl Device {
+ 
+ impl Drop for Device {
+     fn drop(&mut self) {
+-        #[cfg(target_pointer_width = "64")]
+-        let effect = self.effect as u64;
+-        #[cfg(target_pointer_width = "32")]
+-        let effect = self.effect as u32;
++        #[cfg(target_os = "linux")]
++        let effect = self.effect as ::libc::c_ulong;
++        #[cfg(not(target_os = "linux"))]
++        let effect = self.effect as ::libc::c_int;
+ 
+         if let Err(err) = unsafe { ioctl::eviocrmff(self.file.as_raw_fd(), effect) } {
+             error!(
+--- cargo-crates/gilrs-core-0.3.1/src/platform/mod.rs.orig	1970-01-01 00:00:00 UTC
++++ cargo-crates/gilrs-core-0.3.1/src/platform/mod.rs
+@@ -21,7 +21,7 @@
+ 
+ pub use self::platform::*;
+ 
+-#[cfg(target_os = "linux")]
++#[cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd"))]
+ #[path = "linux/mod.rs"]
+ mod platform;
+ 
+@@ -38,7 +38,7 @@ mod platform;
+ mod platform;
+ 
+ #[cfg(all(
+-    not(target_os = "linux"),
++    not(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd")),
+     not(target_os = "macos"),
+     not(target_os = "windows"),
+     not(target_arch = "wasm32")



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202203121523.22CFNglU034000>