On 2022/11/17 15:39:53 +0000, Klemens Nanni <k...@openbsd.org> wrote:
> I see now.
> 
> meson tries to install the same picom.desktop twice, so we might as well
> drop the second attempt and use the first file for @sample in PLIST.

Agreed, I haven't realized the two picom.desktop files are the same!

> git detection can also be neutered a tad simpler.

sure; sometimes i fall for having more '-' than what strictly needed ;)

> Here's your diff with a slightly simpler meson.build patch.
> 
> So I have the following in my ~/.xsession
>       picom --daemon --config /dev/null --vsync --backend glx

due to -Dopengl=false all the backends except for xrender were
disabled.  Thanks to brynet for hinting at eglGetProcAddress, I've
come up with the patch below.  Not sure how i've used it is
idiomatic...

eglGetProcAddress("glEGLImageTargetTexStorageEXT") should always
succeed because during the egl backend initialisation it checks
whether the GL_EXT_EGL_image_storage extension is supported.

i still don't know why we need such patch; looking at repology
freebsd, crux and fedora are already distributing the picom-10
package, and looking at their Makefile/recipe/whatever they don't seem
to do any fancy stuff.

sdk managed to link it by adding a dependency on libOSMesa, maybe
that's the way?

i'm also bundling another patch to fix a printf...

> Updating with your patch now gives me
>       $ picom --config /dev/null --vsync --backend glx
>       [ 11/17/22 19:33:29.791 get_cfg ERROR ] Backend "glx" is only available 
> as part of the legacy backends.
>       [ 11/17/22 19:33:29.792 session_init FATAL ERROR ] Failed to get 
> configuration, usually mean you have specified invalid options.
>       [ 11/17/22 19:33:29.792 main FATAL ERROR ] Failed to create new session.
> 
> https://github.com/yshui/picom/releases/tag/v10-rc1 says we can use
> the `legacy-backends' option or switch to the "egl" one, but neither
> works for me:
>       $ picom --config /dev/null --vsync --backend glx --legacy-backends
>       [ 11/17/22 19:38:21.287 init_render ERROR ] GLX backend support not 
> compiled in.
>       [ 11/17/22 19:38:21.287 session_init FATAL ERROR ] Failed to initialize 
> the backend

now this works

>       $ picom --config /dev/null --vsync --backend egl
>       [ 11/17/22 19:35:26.762 get_cfg WARN ] The egl backend is still 
> experimental, use with care.
>       [ 11/17/22 19:35:26.762 get_cfg ERROR ] Backend "egl" is only available 
> as part of the legacy backends.
>       [ 11/17/22 19:35:26.762 session_init FATAL ERROR ] Failed to get 
> configuration, usually mean you have specified invalid options.
>       [ 11/17/22 19:35:26.762 main FATAL ERROR ] Failed to create new session.

and this too.

I've tried the egl, glx and xrender backend.  All seem to work fine
here (amdgpu) althought I hit one usual (for me) hang: after some time
I've left picom running on the system mostly idle the graphic froze,
network & co were still fine.  Sadly, it's not a regression for me (:

Index: Makefile
===================================================================
RCS file: /home/cvs/ports/x11/picom/Makefile,v
retrieving revision 1.7
diff -u -p -r1.7 Makefile
--- Makefile    11 Mar 2022 20:16:55 -0000      1.7
+++ Makefile    18 Nov 2022 08:08:28 -0000
@@ -2,14 +2,14 @@ COMMENT =     lightweight compositor for X11
 
 GH_ACCOUNT =   yshui
 GH_PROJECT =   picom
-GH_TAGNAME =   v9.1
+GH_TAGNAME =   v10
 
 CATEGORIES =   x11
 
 # MPL 2.0
 PERMIT_PACKAGE =       Yes
 
-WANTLIB += GL X11 X11-xcb c config dbus-1 ev m pcre pixman-1
+WANTLIB += EGL GL X11 X11-xcb c config dbus-1 ev m pcre pixman-1
 WANTLIB += xcb-composite xcb-damage xcb-glx xcb-image xcb-present
 WANTLIB += xcb-randr xcb-render-util xcb-render xcb-shape xcb-sync
 WANTLIB += xcb-xfixes xcb-xinerama xcb
@@ -34,6 +34,7 @@ LIB_DEPENDS =         devel/libconfig \
 CONFIGURE_ARGS +=      -Dwith_docs=true \
                        -Dunittest=true \
                        -Dcompton=false
+
 CONFIGURE_ENV  +=      CPPFLAGS="${CPPFLAGS} -I${LOCALBASE}/include" \
                        LDFLAGS="${LDFLAGS} -L${LOCALBASE}/lib"
 
Index: distinfo
===================================================================
RCS file: /home/cvs/ports/x11/picom/distinfo,v
retrieving revision 1.4
diff -u -p -r1.4 distinfo
--- distinfo    14 Feb 2022 13:04:05 -0000      1.4
+++ distinfo    17 Nov 2022 15:49:57 -0000
@@ -1,2 +1,2 @@
-SHA256 (picom-9.1.tar.gz) = hwCscb1JbJEmLIV24pyzrs8rTvSMBDlKkpUJ08s3uH0=
-SIZE (picom-9.1.tar.gz) = 263924
+SHA256 (picom-10.tar.gz) = 6EAwTDKfB5cgWWMwKJTFXhHXfPUaIsCnIINEzm/Qojg=
+SIZE (picom-10.tar.gz) = 286728
Index: pkg/PLIST
===================================================================
RCS file: /home/cvs/ports/x11/picom/pkg/PLIST,v
retrieving revision 1.3
diff -u -p -r1.3 PLIST
--- pkg/PLIST   11 Mar 2022 20:16:55 -0000      1.3
+++ pkg/PLIST   17 Nov 2022 15:49:57 -0000
@@ -3,6 +3,7 @@ bin/picom-trans
 @man man/man1/picom-trans.1
 @man man/man1/picom.1
 share/applications/picom.desktop
+@sample ${SYSCONFDIR}/xdg/autostart/picom.desktop
 share/examples/picom/
 share/examples/picom/picom.sample.conf
 share/icons/hicolor/48x48/apps/picom.png
Index: patches/patch-meson_build
===================================================================
RCS file: patches/patch-meson_build
diff -N patches/patch-meson_build
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-meson_build   18 Nov 2022 08:31:25 -0000
@@ -0,0 +1,24 @@
+- ignore git
+- autostart file in /etc/ needs PLIST @sample
+
+Index: meson.build
+--- meson.build.orig
++++ meson.build
+@@ -7,8 +7,7 @@ cc = meson.get_compiler('c')
+ version = 'v'+meson.project_version()
+ 
+ # use git describe if that's available
+-git = find_program('git', required: false)
+-if git.found()
++if false
+       gitv = run_command('git', 'rev-parse', '--short=5', 'HEAD', check: 
false)
+       if gitv.returncode() == 0
+               version = 'vgit-'+gitv.stdout().strip()
+@@ -73,7 +72,6 @@ subdir('man')
+ 
+ install_data('bin/picom-trans', install_dir: get_option('bindir'))
+ install_data('picom.desktop', install_dir: 'share/applications')
+-install_data('picom.desktop', install_dir: get_option('sysconfdir') / 'xdg' / 
'autostart')
+ 
+ if get_option('compton')
+       install_data('compton.desktop', install_dir: 'share/applications')
Index: patches/patch-src_backend_gl_egl_c
===================================================================
RCS file: patches/patch-src_backend_gl_egl_c
diff -N patches/patch-src_backend_gl_egl_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_backend_gl_egl_c  18 Nov 2022 08:31:25 -0000
@@ -0,0 +1,42 @@
+glEGLImageTargetTexStorageEXT fails to link because its pointer should
+be retrieved via eglGetProcAddress.
+
+Index: src/backend/gl/egl.c
+--- src/backend/gl/egl.c.orig
++++ src/backend/gl/egl.c
+@@ -36,6 +36,8 @@ struct egl_data {
+       EGLContext ctx;
+ };
+ 
++static void (*imageTargetTexStorageFn)(GLenum, GLeglImageOES, const GLint *);
++
+ /**
+  * Free a glx_texture_t.
+  */
+@@ -215,6 +217,17 @@ static backend_t *egl_init(session_t *ps) {
+ 
+       success = true;
+ 
++      /* 
++       * should always succeed since if we reach this point
++       * it's ensured we have the GL_EXT_EGL_image_storage
++       * extension.
++       */
++      imageTargetTexStorageFn = 
eglGetProcAddress("glEGLImageTargetTexStorageEXT");
++      if (imageTargetTexStorageFn == NULL) {
++              log_error("don't have glEGLImageTargetTexStorageEXT!");
++              success = false;
++      }
++
+ end:
+       if (!success) {
+               egl_deinit(&gd->gl.base);
+@@ -270,7 +283,7 @@ egl_bind_pixmap(backend_t *base, xcb_pixmap_t pixmap, 
+       wd->dim = 0;
+       wd->inner->refcount = 1;
+       glBindTexture(GL_TEXTURE_2D, inner->texture);
+-      glEGLImageTargetTexStorageEXT(GL_TEXTURE_2D, eglpixmap->image, NULL);
++      imageTargetTexStorageFn(GL_TEXTURE_2D, eglpixmap->image, NULL);
+       glBindTexture(GL_TEXTURE_2D, 0);
+ 
+       gl_check_err();
Index: patches/patch-src_picom_c
===================================================================
RCS file: patches/patch-src_picom_c
diff -N patches/patch-src_picom_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_picom_c   18 Nov 2022 08:31:25 -0000
@@ -0,0 +1,16 @@
+fix uint64_t printing
+
+Index: src/picom.c
+--- src/picom.c.orig
++++ src/picom.c
+@@ -539,8 +539,8 @@ static bool initialize_backend(session_t *ps) {
+                               } else {
+                                       shader->attributes = 0;
+                               }
+-                              log_debug("Shader %s has attributes %ld", 
shader->key,
+-                                        shader->attributes);
++                              log_debug("Shader %s has attributes %"PRIu64,
++                                        shader->key, shader->attributes);
+                       }
+               }
+ 

Reply via email to