~ruther/guix-local

4723b9f14d50490fd8f81857beea44059ce33ac4 — Ekaitz Zarraga 1 year, 4 months ago e37d407
gnu: wxwidgets: Add wxWidgets without EGL.

Detected when working on Kicad-9.  wxwidgets was built with EGL but
Kicad was unable to create the OpenGL context.  According to Debian:

<https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1024147;msg=5>

This happens due to Glew having EGL disabled, and would break packages
that use both `wxwidgets` and `glew` together.  We already detected the
issue with PrusaSlicer, that's why we had a separate package for it, but
it also needed extra unrelated changes.

* gnu/packages/wxwidgets.scm (wxwidgets-sans-egl): Add it.
(prusa-wxwidgets): Inherit from it.

Change-Id: Idde2985501b4d06cbb5bbd92030d5516bf7bea07
1 files changed, 17 insertions(+), 6 deletions(-)

M gnu/packages/wxwidgets.scm
M gnu/packages/wxwidgets.scm => gnu/packages/wxwidgets.scm +17 -6
@@ 12,6 12,7 @@
;;; Copyright © 2023 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2023 Malte Frank Gerdes <malte.f.gerdes@gmail.com>
;;; Copyright © 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2025 Ekaitz Zarraga <ekaitz@elenq.tech>
;;;
;;; This file is part of GNU Guix.
;;;


@@ 180,6 181,21 @@ and many other languages.")
       ((#:configure-flags flags #~'())
        #~(append #$flags '("--with-gtk=2")))))))

(define-public wxwidgets-sans-egl
  ;; This is needed for prusaslicer:
  ;; <https://github.com/NixOS/nixpkgs/issues/193135>.)
  ;; and KiCAD:
  ;; <https://forum.kicad.info/t/kicad-8-0-x-could-not-use-opengl-debian-guix/53203/7>
  ;; Relevant debian bug report:
  ;; <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1024147;msg=5>
  ;; Tl;dr; wxWidgets uses EGL but Glew 2.2 doesn't. Leading to errors.
  (package/inherit wxwidgets
    (name "wxwidgets-sans-egl")
    (arguments
       (substitute-keyword-arguments (package-arguments wxwidgets)
         ((#:configure-flags flags)
          #~(cons "--disable-glcanvasegl" #$flags))))))

(define-public wxwidgets-3.0
  (package
    (inherit wxwidgets)


@@ 272,7 288,7 @@ and many other languages.")
  (let ((commit "78aa2dc0ea7ce99dc19adc1140f74c3e2e3f3a26")
        (revision "0"))
    (package
      (inherit wxwidgets)
      (inherit wxwidgets-sans-egl)
      (name "prusa-wxwidgets")
      (version (git-version "3.2.0" revision commit))
      (home-page "https://github.com/prusa3d/wxWidgets")


@@ 293,11 309,6 @@ and many other languages.")
                       (prepend nanosvg)))
      (arguments
       (substitute-keyword-arguments (package-arguments wxwidgets)
         ((#:configure-flags flags)
          ;; To fix 3D rendering in PrusaSlicer, wxWidgets must be compiled with
          ;; "--disable-glcanvasegl" flag (see
          ;; <https://github.com/NixOS/nixpkgs/issues/193135>.)
          #~(cons "--disable-glcanvasegl" #$flags))
         ((#:phases phases)
          #~(modify-phases #$phases
              (add-after 'unpack 'copy-nanosvg-source