Bug 246028 - games/retroarch: Fails to build with UDEV enabled
Summary: games/retroarch: Fails to build with UDEV enabled
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords: needs-patch, needs-qa
Depends on:
Blocks:
 
Reported: 2020-04-29 13:24 UTC by rozhuk.im
Modified: 2020-07-03 09:08 UTC (History)
4 users (show)

See Also:
bugzilla: maintainer-feedback? (greg)
koobs: merge-quarterly?


Attachments
patch (881 bytes, patch)
2020-05-12 08:33 UTC, rozhuk.im
rozhuk.im: maintainer-approval?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description rozhuk.im 2020-04-29 13:24:45 UTC
...
CC input/drivers/udev_input.c
CC input/drivers_joypad/udev_joypad.c
CC input/drivers_hid/libusb_hid.c
input/drivers/udev_input.c:54:10:CC input/drivers_joypad/hid_joypad.c
 fatal error: 'linux/kd.h' file not found
#include <linux/kd.h>
         ^~~~~~~~~~~~
CC input/connect/joypad_connection.c
CC input/connect/connect_ps2adapter.c
1 error generated.
gmake[2]: *** [Makefile:207: obj-unix/release/input/drivers/udev_input.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
...


WAYLAND_BUILD_DEPENDS=	${LOCALBASE}/include/linux/input.h:devel/evdev-proto \
			${LOCALBASE}/include/linux/kd.h:graphics/svgalib

but I unset WAYLAND and set UDEV.
Comment 1 rozhuk.im 2020-04-29 13:27:42 UTC
I install graphics/svgalib by hands, but get next error:
...
CC libretro-common/rthreads/tpool.c
CC tasks/task_decompress.c
LD retroarch
ld: error: undefined symbol: rarch_key_map_linux
>>> referenced by udev_input.c
>>>               obj-unix/release/input/drivers/udev_input.o:(udev_input_init)
c++: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[2]: *** [Makefile:202: retroarch] Error 1
gmake[2]: Leaving directory '/tmp/ports/usr/ports/games/retroarch/work/RetroArch-1.8.5'
...
Comment 2 rozhuk.im 2020-04-29 13:49:20 UTC
By default cores dir is: /usr/local/lib/libretro
but all cores installed to /usr/local/libexec/libretro

can it be fixed too?
Comment 3 Greg V 2020-04-29 16:45:22 UTC
> rarch_key_map_linux

That is ifdef'd to linux||HAVE_WAYLAND too. I guess I'll just set UDEV_IMPLIES=WAYLAND in the next update.

> By default cores dir is: /usr/local/lib/libretro but all cores installed to /usr/local/libexec/libretro

PREFIX/lib/libretro is the modern directory — upstream emulator ports (emulators/mgba, emulators/mesen and emulators/ppsspp) already install their cores there!

Looks like the games/libretro* core ports that were just committed are installing to the wrong directory. Daniel please fix :)
Comment 4 rozhuk.im 2020-04-29 18:45:26 UTC
Greg, please, I'm not ready to wayland :)

Just add
UDEV_BUILD_DEPENDS=	${LOCALBASE}/include/linux/kd.h:graphics/svgalib

and probably some simple regexp patch to fix rarch_key_map_linux.
Comment 5 Daniel Menelkir 2020-04-29 23:41:11 UTC
(In reply to Greg V from comment #3)

Fixed, I'll send a bug report asap.
Comment 6 rozhuk.im 2020-05-12 08:33:24 UTC
Created attachment 214406 [details]
patch

With this build and work ok.
No wayland required.
Comment 7 Li-Wen Hsu freebsd_committer 2020-07-02 04:38:28 UTC
(In reply to rozhuk.im from comment #6)
Greg: are you ok with this patch?
Comment 8 Greg V 2020-07-02 10:05:34 UTC
Does it build with UDEV off?
Comment 9 rozhuk.im 2020-07-02 11:57:58 UTC
(In reply to Greg V from comment #8)

No
input/input_keymaps.c:50:10: fatal error: 'linux/kd.h' file not found
#include <linux/kd.h>
         ^~~~~~~~~~~~

Looks like should fix this.
BUILD_DEPENDS+=	${LOCALBASE}/include/linux/kd.h:graphics/svgalib
Comment 10 Kubilay Kocak freebsd_committer freebsd_triage 2020-07-03 02:26:28 UTC
^Triage: What is the conditionality of this build fix? Is the default build/connfiguration (options, etc) affected?

Note also: Build fixes are:

Approved by: portmgr (blanket: build fix)
MFH: <branch|no> <reason> (if quarterly is affected)
Comment 11 Greg V 2020-07-03 09:08:01 UTC
(In reply to Kubilay Kocak from comment #10)
No, the default configuration is fine. This is about when WAYLAND is off.