feat(snap): Snap Store packaging for Open CAD Studio

Repackages the released Linux AppImage (--appimage-extract) instead of
rebuilding from source, triggered on completion of the "Release" workflow.
Publishing to the Snap Store only happens once SNAPCRAFT_STORE_CREDENTIALS
is set as a repo secret.

Different from the other OpenAEC snaps in one important way: OCS uses
winit + wgpu (Vulkan/GL), not GTK/WebKit, so this uses explicit
opengl/wayland/x11 plugs and staged Mesa/X11/Wayland runtime libraries
instead of the `gnome` extension.

Higher confidence in the packaging mechanics (build succeeds, produces a
valid .snap) than in the actual runtime GPU/windowing behavior under
strict confinement, which needs real hands-on testing on a Linux desktop
before publishing to stable -- see the PR description.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Nozzit 2026-07-30 14:24:41 +02:00
commit 00952d1996
2 changed files with 253 additions and 0 deletions

84
snap/snapcraft.yaml Normal file
View file

@ -0,0 +1,84 @@
name: open-cad-studio
base: core22
# Versie wordt in CI overschreven met het release-versienummer (zie .github/workflows/snap.yml).
version: '0.0.0'
title: Open CAD Studio
summary: 2D drafting and 3D modeling with native DWG/DXF support
description: |
Open CAD Studio (OCS) is a CAD application for 2D drafting and 3D
modeling, built in Rust. Reads and writes DWG and DXF files natively
(R13 through R2018).
File formats:
- DWG and DXF read/write (R13-R2018)
- STL export, STEP AP203 export, OBJ import
- PDF export (plot layouts)
- WBLOCK, and XREF (attach/reload/auto-resolve external references)
2D drafting:
- Lines, polylines, rectangles, polygons, circles, arcs, ellipses,
splines
- Hatch fills with pattern, scale, and angle editing
- Offset, trim, extend, fillet, break, stretch, lengthen
- Array, mirror, move, copy, rotate, scale, explode
- Double-click text editing, and area/perimeter/centroid measurement
3D modeling:
- Solid primitives (box, sphere, cylinder), extrude, revolve, loft,
sweep, and 3D array
- ACIS tessellation for rendering 3DSOLID/REGION/BODY entities
Open CAD Studio is open source, part of the OpenAEC Foundation family
of applications, and rendered with wgpu for GPU-accelerated 2D/3D
drawing.
grade: stable
confinement: strict
apps:
open-cad-studio:
command: usr/bin/OpenCADStudio
desktop: usr/share/applications/io.github.HakanSeven12.OpenCadStudio.desktop
plugs:
- home # tekeningen openen/opslaan/exporteren in de home-map
- removable-media # idem op externe schijven/USB
- network # licentie-/Patreon-check
- opengl # GPU-toegang voor wgpu (Vulkan/GL)
- wayland
- x11
- desktop
- desktop-legacy
parts:
open-cad-studio:
plugin: nil
# De CI-stap kopieert de gepubliceerde release-AppImage naar de project-root
# als `open-cad-studio.AppImage`; we pakken die uit i.p.v. opnieuw te bouwen
# (dezelfde herverpak-aanpak als de .deb-gebaseerde OpenAEC-snaps, maar dan
# voor een AppImage: `--appimage-extract` levert een kant-en-klare AppDir).
override-build: |
set -eu
chmod +x "${CRAFT_PROJECT_DIR}/open-cad-studio.AppImage"
"${CRAFT_PROJECT_DIR}/open-cad-studio.AppImage" --appimage-extract
mkdir -p "${CRAFT_PART_INSTALL}/usr"
cp -r squashfs-root/usr/. "${CRAFT_PART_INSTALL}/usr/"
# OCS gebruikt winit (X11/Wayland) + wgpu (Vulkan met GL-fallback), geen
# GTK/WebKit — dus GEEN `extensions: [gnome]` (dat is voor de Tauri-apps).
# libvulkan1/mesa-vulkan-drivers zijn een fallback; echte hardware-versnelling
# loopt via de `opengl`-plug naar de host-driver.
stage-packages:
- libvulkan1
- mesa-vulkan-drivers
- libgl1
- libx11-6
- libxcursor1
- libxi6
- libxrandr2
- libxinerama1
- libxkbcommon0
- libxkbcommon-x11-0
- libwayland-client0
- libwayland-cursor0
- libwayland-egl1
- libfontconfig1
- libfreetype6