Re: [update/fix] graphics/glfw 3.3.2 -> 3.3.4 & fixes cursor hiding

2021-05-09 Thread Benjamin Baier
On Sun, 09 May 2021 07:31:39 +
octeep  wrote:

> On Sun, May 09, 2021 at 02:04:47PM +0800, Theo Buehler wrote:
> > > > +@@ -710,6 +710,8 @@ static GLFWbool initExtensions(void)
> > > > +
> > > > + #if defined(__CYGWIN__)
> > > > + _glfw.x11.xcursor.handle = _glfw_dlopen("libXcursor-1.so");
> > > > ++#elif defined(__OpenBSD__)
> > > > ++_glfw.x11.xcursor.handle = _glfw_dlopen("libXcursor.so.5.0");
> > 
> > I think it would be better to avoid hardcoding the version. I would
> > expect that this also works:
> > 
> >   _glfw.x11.xcursor.handle = _glfw_dlopen("libXcursor.so");
> > 
> > This way you don't need to bump whenver libXcursor is bumped.
> 
> I don't think that will work since there is no libXcursor.so in
> /usr/X11R6/lib?
> 
I think this is using dlopen(3) internally,
so it will find the proper/newest installed version.



Re: [update/fix] graphics/glfw 3.3.2 -> 3.3.4 & fixes cursor hiding

2021-05-09 Thread octeep
On Sun, May 09, 2021 at 02:04:47PM +0800, Theo Buehler wrote:
> > > +@@ -710,6 +710,8 @@ static GLFWbool initExtensions(void)
> > > +
> > > + #if defined(__CYGWIN__)
> > > + _glfw.x11.xcursor.handle = _glfw_dlopen("libXcursor-1.so");
> > > ++#elif defined(__OpenBSD__)
> > > ++_glfw.x11.xcursor.handle = _glfw_dlopen("libXcursor.so.5.0");
> 
> I think it would be better to avoid hardcoding the version. I would
> expect that this also works:
> 
>   _glfw.x11.xcursor.handle = _glfw_dlopen("libXcursor.so");
> 
> This way you don't need to bump whenver libXcursor is bumped.

I don't think that will work since there is no libXcursor.so in
/usr/X11R6/lib?



Re: [update/fix] graphics/glfw 3.3.2 -> 3.3.4 & fixes cursor hiding

2021-05-09 Thread Theo Buehler
On Sun, May 09, 2021 at 07:31:39AM +, octeep wrote:
> On Sun, May 09, 2021 at 02:04:47PM +0800, Theo Buehler wrote:
> > > > +@@ -710,6 +710,8 @@ static GLFWbool initExtensions(void)
> > > > +
> > > > + #if defined(__CYGWIN__)
> > > > + _glfw.x11.xcursor.handle = _glfw_dlopen("libXcursor-1.so");
> > > > ++#elif defined(__OpenBSD__)
> > > > ++_glfw.x11.xcursor.handle = _glfw_dlopen("libXcursor.so.5.0");
> > 
> > I think it would be better to avoid hardcoding the version. I would
> > expect that this also works:
> > 
> >   _glfw.x11.xcursor.handle = _glfw_dlopen("libXcursor.so");
> > 
> > This way you don't need to bump whenver libXcursor is bumped.
> 
> I don't think that will work since there is no libXcursor.so in
> /usr/X11R6/lib?
> 

_glfw_dlopen() is just a wrapper around dlopen(3):

#define _glfw_dlopen(name) dlopen(name, RTLD_LAZY | RTLD_LOCAL)

For dlopen(3) the version information is optional:

 Shared libraries take the following form:

   lib.so[.xx[.yy]]

 When a shared library is specified without a version or with a partial
 version, the same library search rules apply that are used for
 “intrinsic” shared library searches.



[update/fix] graphics/glfw 3.3.2 -> 3.3.4 & fixes cursor hiding

2021-05-09 Thread octeep
In the current port of glfw, it does not correctly detect the libXcursor
library, causing Minecraft >= 1.13 to not hide the cursor properly.

This diff fixes the problem and also updates glfw to 3.3.4

Index: Makefile
===
RCS file: /cvs/ports/graphics/glfw/Makefile,v
retrieving revision 1.5
diff -u -p -r1.5 Makefile
--- Makefile29 Jan 2021 14:31:30 -  1.5
+++ Makefile9 May 2021 03:37:05 -
@@ -1,7 +1,6 @@
-# $OpenBSD: Makefile,v 1.5 2021/01/29 14:31:30 kmos Exp $
-
+# $OpenBSD$
 COMMENT =  open source, multi-platform library for creating windows
-V =3.3.2
+V =3.3.4
 DISTNAME = glfw-${V}
 CATEGORIES =   graphics x11
 
Index: distinfo
===
RCS file: /cvs/ports/graphics/glfw/distinfo,v
retrieving revision 1.3
diff -u -p -r1.3 distinfo
--- distinfo29 Jan 2021 14:31:30 -  1.3
+++ distinfo9 May 2021 03:37:05 -
@@ -1,2 +1,3 @@
-SHA256 (glfw-3.3.2.zip) = CKM6US8p19v3jqs5vXhYV2rcyVIoye/o5LxfDzJh78c=
-SIZE (glfw-3.3.2.zip) = 1434297
+SHA256 (glfw-3.3.4.zip) = 
bbd2c42c660b725e9755eb417e40b373f0d4c03138c9b2e210d02cd308bd99cd
+SIZE (glfw-3.3.4.zip) = 1444675
+
Index: patches/patch-x11_init_c
===
RCS file: patches/patch-x11_init_c
diff -N patches/patch-x11_init_c
--- /dev/null   1 Jan 1970 00:00:00 -
+++ patches/patch-x11_init_c9 May 2021 03:37:05 -
@@ -0,0 +1,14 @@
+$OpenBSD$
+diff --git src/x11_init.c src/x11_init.c
+index 87b3eb78..3d2a0bee 100644
+--- src/x11_init.c
 src/x11_init.c
+@@ -710,6 +710,8 @@ static GLFWbool initExtensions(void)
+ 
+ #if defined(__CYGWIN__)
+ _glfw.x11.xcursor.handle = _glfw_dlopen("libXcursor-1.so");
++#elif defined(__OpenBSD__)
++_glfw.x11.xcursor.handle = _glfw_dlopen("libXcursor.so.5.0");
+ #else
+ _glfw.x11.xcursor.handle = _glfw_dlopen("libXcursor.so.1");
+ #endif




Re: [update/fix] graphics/glfw 3.3.2 -> 3.3.4 & fixes cursor hiding

2021-05-09 Thread Kurt Mosiejczuk
On Sun, May 09, 2021 at 08:04:47AM +0200, Theo Buehler wrote:
> > > +@@ -710,6 +710,8 @@ static GLFWbool initExtensions(void)
> > > + 
> > > + #if defined(__CYGWIN__)
> > > + _glfw.x11.xcursor.handle = _glfw_dlopen("libXcursor-1.so");
> > > ++#elif defined(__OpenBSD__)
> > > ++_glfw.x11.xcursor.handle = _glfw_dlopen("libXcursor.so.5.0");

> I think it would be better to avoid hardcoding the version. I would
> expect that this also works:

>   _glfw.x11.xcursor.handle = _glfw_dlopen("libXcursor.so");

> This way you don't need to bump whenver libXcursor is bumped.

Yup. That was already pointed out to me by Brad. I've corrected it.

--Kurt



Re: [update/fix] graphics/glfw 3.3.2 -> 3.3.4 & fixes cursor hiding

2021-05-08 Thread Theo Buehler
> > +@@ -710,6 +710,8 @@ static GLFWbool initExtensions(void)
> > + 
> > + #if defined(__CYGWIN__)
> > + _glfw.x11.xcursor.handle = _glfw_dlopen("libXcursor-1.so");
> > ++#elif defined(__OpenBSD__)
> > ++_glfw.x11.xcursor.handle = _glfw_dlopen("libXcursor.so.5.0");

I think it would be better to avoid hardcoding the version. I would
expect that this also works:

  _glfw.x11.xcursor.handle = _glfw_dlopen("libXcursor.so");

This way you don't need to bump whenver libXcursor is bumped.



Re: [update/fix] graphics/glfw 3.3.2 -> 3.3.4 & fixes cursor hiding

2021-05-08 Thread Kurt Mosiejczuk
On Sun, May 09, 2021 at 03:45:51AM +, octeep wrote:
> In the current port of glfw, it does not correctly detect the libXcursor
> library, causing Minecraft >= 1.13 to not hide the cursor properly.

> This diff fixes the problem and also updates glfw to 3.3.4

Yup. As soon as the game started, the arrow winked out. 

Committed. Thanks!

--Kurt

> Index: Makefile
> ===
> RCS file: /cvs/ports/graphics/glfw/Makefile,v
> retrieving revision 1.5
> diff -u -p -r1.5 Makefile
> --- Makefile  29 Jan 2021 14:31:30 -  1.5
> +++ Makefile  9 May 2021 03:37:05 -
> @@ -1,7 +1,6 @@
> -# $OpenBSD: Makefile,v 1.5 2021/01/29 14:31:30 kmos Exp $
> -
> +# $OpenBSD$
>  COMMENT =open source, multi-platform library for creating windows
> -V =  3.3.2
> +V =  3.3.4
>  DISTNAME =   glfw-${V}
>  CATEGORIES = graphics x11
>  
> Index: distinfo
> ===
> RCS file: /cvs/ports/graphics/glfw/distinfo,v
> retrieving revision 1.3
> diff -u -p -r1.3 distinfo
> --- distinfo  29 Jan 2021 14:31:30 -  1.3
> +++ distinfo  9 May 2021 03:37:05 -
> @@ -1,2 +1,3 @@
> -SHA256 (glfw-3.3.2.zip) = CKM6US8p19v3jqs5vXhYV2rcyVIoye/o5LxfDzJh78c=
> -SIZE (glfw-3.3.2.zip) = 1434297
> +SHA256 (glfw-3.3.4.zip) = 
> bbd2c42c660b725e9755eb417e40b373f0d4c03138c9b2e210d02cd308bd99cd
> +SIZE (glfw-3.3.4.zip) = 1444675
> +
> Index: patches/patch-x11_init_c
> ===
> RCS file: patches/patch-x11_init_c
> diff -N patches/patch-x11_init_c
> --- /dev/null 1 Jan 1970 00:00:00 -
> +++ patches/patch-x11_init_c  9 May 2021 03:37:05 -
> @@ -0,0 +1,14 @@
> +$OpenBSD$
> +diff --git src/x11_init.c src/x11_init.c
> +index 87b3eb78..3d2a0bee 100644
> +--- src/x11_init.c
>  src/x11_init.c
> +@@ -710,6 +710,8 @@ static GLFWbool initExtensions(void)
> + 
> + #if defined(__CYGWIN__)
> + _glfw.x11.xcursor.handle = _glfw_dlopen("libXcursor-1.so");
> ++#elif defined(__OpenBSD__)
> ++_glfw.x11.xcursor.handle = _glfw_dlopen("libXcursor.so.5.0");
> + #else
> + _glfw.x11.xcursor.handle = _glfw_dlopen("libXcursor.so.1");
> + #endif
> 
>