Wednesday, November 01, 2023

Re: devel/sdl2: prevent from using linux/input.h if present

On Wed Nov 01, 2023 at 08:09:32PM +0100, Rafael Sadowski wrote:
> OK for this?
>
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/devel/sdl2/Makefile,v
> diff -u -p -r1.52 Makefile
> --- Makefile 13 Oct 2023 22:38:11 -0000 1.52
> +++ Makefile 1 Nov 2023 19:08:26 -0000
> @@ -5,6 +5,7 @@ DISTNAME= SDL2-${V}
> PKGNAME= sdl2-${V}
> CATEGORIES= devel
> SITES= https://www.libsdl.org/release/
> +REVISION= 0
>
> SHARED_LIBS= SDL2 0.14 # 2.28.1
>
> @@ -47,6 +48,8 @@ CONFIGURE_ARGS+= --disable-alsa \
> --disable-x11-shared
> CONFIGURE_ENV+= CPPFLAGS="-I${LOCALBASE}/include" \
> LDFLAGS="-L${LOCALBASE}/lib"
> +
> +CONFIGURE_ENV += ac_cv_header_linux_input_h=no
>
> .if ${MACHINE_ARCH} == "hppa"
> CONFIGURE_ARGS+= --disable-atomic
>

sdl2 has an additional compile tests which set use_input_events.
I don't see another way to disable it without a patch.

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/sdl2/Makefile,v
diff -u -p -r1.52 Makefile
--- Makefile 13 Oct 2023 22:38:11 -0000 1.52
+++ Makefile 1 Nov 2023 19:22:16 -0000
@@ -5,6 +5,7 @@ DISTNAME= SDL2-${V}
PKGNAME= sdl2-${V}
CATEGORIES= devel
SITES= https://www.libsdl.org/release/
+REVISION= 0

SHARED_LIBS= SDL2 0.14 # 2.28.1

@@ -46,7 +47,8 @@ CONFIGURE_ARGS+= --disable-alsa \
--disable-wayland-shared \
--disable-x11-shared
CONFIGURE_ENV+= CPPFLAGS="-I${LOCALBASE}/include" \
- LDFLAGS="-L${LOCALBASE}/lib"
+ LDFLAGS="-L${LOCALBASE}/lib" \
+ ac_cv_header_linux_input_h=no

.if ${MACHINE_ARCH} == "hppa"
CONFIGURE_ARGS+= --disable-atomic
Index: patches/patch-configure
===================================================================
RCS file: patches/patch-configure
diff -N patches/patch-configure
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-configure 1 Nov 2023 19:22:16 -0000
@@ -0,0 +1,13 @@
+prevent from using linux/input.h if present
+Index: configure
+--- configure.orig
++++ configure
+@@ -26427,7 +26427,7 @@ main (void)
+ _ACEOF
+ if ac_fn_c_try_compile "$LINENO"
+ then :
+- use_input_events=yes
++ use_input_events=no
+ fi
+ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $use_input_events" >&5

No comments:

Post a Comment