Hi!
OpenSCAD is a script-based 3D modeling application. Their last official
release is from January 2021. The project is very much alive though, but
they haven't had any new releases since then, claiming they want to
stabilize some things first.
In the meantime, most people seem to use their nightly builds, as the
last release is already heavily outdated.
My goal is to create a package `openscad-nightly` which is based on a
recent commit and can be updated easily.
Since 2021 a lot of things have changed, so I'm struggling with getting
everything to run.
With the build process I have had some issues first, but have since
been able to get the build to finish (without the testing phase for now).
My current package definition is attached to this mail.
I have intentionally left the check phase in the build, so that it fails
after compiling and linking, so I can inspect the build directory
afterwards (I'm using `--keep-failed` on the build).
When the application is built and I try to run it though, I'm getting
the following error:
```plaintext
/tmp/guix-build-openscad-nightly--2025.04.28.535d96f.drv-10/build/openscad-nightly
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use
QT_QPA_PLATFORM=wayland to run on Wayland anyway.
Gtk-Message: 15:29:23.647: Failed to load module "canberra-gtk-module"
Gtk-Message: 15:29:23.647: Failed to load module "canberra-gtk-module"
Could not initialize localization (application path is
'/tmp/guix-build-openscad-nightly--2025.04.28.535d96f.drv-10/build').
qt.glx: qglx_findConfig: Failed to finding matching FBConfig for
QSurfaceFormat(version 2.0, options
QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize -1,
redBufferSize 1, greenBufferSize 1, blueBufferSize 1, alphaBufferSize
-1, stencilBufferSize -1, samples -1, swapBehavior
QSurfaceFormat::SingleBuffer, swapInterval 1, colorSpace
QSurfaceFormat::DefaultColorSpace, profile QSurfaceFormat::NoProfile)
qt.glx: qglx_findConfig: Failed to finding matching FBConfig for
QSurfaceFormat(version 2.0, options
QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize -1,
redBufferSize 1, greenBufferSize 1, blueBufferSize 1, alphaBufferSize
-1, stencilBufferSize -1, samples -1, swapBehavior
QSurfaceFormat::SingleBuffer, swapInterval 1, colorSpace
QSurfaceFormat::DefaultColorSpace, profile QSurfaceFormat::NoProfile)
qt.glx: qglx_findConfig: Failed to finding matching FBConfig for
QSurfaceFormat(version 2.0, options
QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize -1,
redBufferSize 1, greenBufferSize 1, blueBufferSize 1, alphaBufferSize
-1, stencilBufferSize -1, samples -1, swapBehavior
QSurfaceFormat::SingleBuffer, swapInterval 1, colorSpace
QSurfaceFormat::DefaultColorSpace, profile QSurfaceFormat::NoProfile)
qt.glx: qglx_findConfig: Failed to finding matching FBConfig for
QSurfaceFormat(version 2.0, options
QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize -1,
redBufferSize 1, greenBufferSize 1, blueBufferSize 1, alphaBufferSize
-1, stencilBufferSize -1, samples -1, swapBehavior
QSurfaceFormat::SingleBuffer, swapInterval 1, colorSpace
QSurfaceFormat::DefaultColorSpace, profile QSurfaceFormat::NoProfile)
Could not initialize GLX
[1] 3793683 IOT instruction (core dumped)
```
I've asked for advice at the [openscad
project](https://github.com/openscad/openscad/issues/5880), but it looks
like it's now down to an issue specific to guix.
It's probably something simple, but as I'm relatively new to both guix
and cmake and have no experience with GLX, EGL, etc., I've been
struggling with this for a few days already, without making any progress.
Does anyone have a clue or can at least point me in the right direction?
Thanks!
nomike
(define-public openscad-nightly
(let ((commit "535d96fe28931d92ca4af7cdddb18dd006fb4125")
(revision "2025.04.28"))
(package
(name "openscad-nightly")
(version (git-version "" revision commit))
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/openscad/openscad")
(commit commit)
(recursive? #t)))
(sha256
(base32 "0srfpjw5y6nqxypfzjzjkdckzb40r1ylhlzp52wr29yi7ahsmp83"))
(file-name (git-file-name name version)))
)
(build-system cmake-build-system)
(arguments
(list
#:configure-flags
#~(list "-DCMAKE_BUILD_TYPE=Release"
"-DUSE_BUILTIN_OPENCSG=ON"
"-DMANIFOLD_PYBIND=OFF"
"-DMANIFOLD_TEST=OFF"
"-DENABLE_TESTS=OFF"
"-DEXPERIMENTAL=ON"
"-DSNAPSHOT=ON"
"-DSUFFIX=nightly"
"-DUSE_BUILTIN_CLIPPER2=OFF"
(string-append "-DOPENSCAD_VERSION=" #$revision)
(string-append "-DOPENSCAD_COMMIT=" #$commit)
"-DENABLE_GLX=OFF")
#:phases
#~(modify-phases %standard-phases
; (delete 'check)
(add-after 'unpack 'patch-source
(lambda* (#:key inputs #:allow-other-keys)
;; https://github.com/openscad/openscad/issues/5877
(substitute* "cmake/Modules/FindLib3MF.cmake"
(("PC_LIB3MF_INCLUDE_DIRS")
"PC_LIB3MF_INCLUDEDIR"))
(substitute* "CMakeLists.txt"
;; Use the system sanitizers-cmake module.
(("\\$\\{CMAKE_SOURCE_DIR\\}/submodules/sanitizers-cmake/cmake")
(string-append (assoc-ref inputs "sanitizers-cmake")
"/share/sanitizers-cmake/cmake")))))
(add-after 'unpack 'patch-source
(lambda* (#:key inputs #:allow-other-keys)
(substitute* "cmake/Modules/FindLib3MF.cmake"
(("PC_LIB3MF_INCLUDE_DIRS")
"PC_LIB3MF_INCLUDEDIR"))
(substitute* "CMakeLists.txt"
;; Use the system sanitizers-cmake module.
(("\\$\\{CMAKE_SOURCE_DIR\\}/submodules/sanitizers-cmake/cmake")
(string-append (assoc-ref inputs "sanitizers-cmake")
"/share/sanitizers-cmake/cmake")))))
)))