Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: solvespace/solvespace
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b1e280e75f7f
Choose a base ref
...
head repository: solvespace/solvespace
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 219df31c53f3
Choose a head ref
  • 1 commit
  • 5 files changed
  • 1 contributor

Commits on Sep 11, 2019

  1. Copy the full SHA
    219df31 View commit details
Showing with 117 additions and 0 deletions.
  1. +3 −0 pkg/snap/.gitignore
  2. +12 −0 pkg/snap/build.sh
  3. +76 −0 pkg/snap/snap/snapcraft.yaml
  4. +16 −0 res/CMakeLists.txt
  5. +10 −0 res/freedesktop/solvespace-snap.desktop
3 changes: 3 additions & 0 deletions pkg/snap/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.snap
solvespace-snap-src
squashfs-root
12 changes: 12 additions & 0 deletions pkg/snap/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh -xe

dir="$(dirname "$(readlink -f "$0")")"
solvespace_snap_src="$dir/solvespace-snap-src"
trap "rm -rf $solvespace_snap_src" EXIT

cd "$dir"

git_root="$(git rev-parse --show-toplevel)"
rsync --filter=":- .gitignore" -r "$git_root"/ "$solvespace_snap_src"

snapcraft "$@"
76 changes: 76 additions & 0 deletions pkg/snap/snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: solvespace
base: core18
summary: Parametric 2d/3d CAD
adopt-info: solvespace
description: |
SOLVESPACE is a free (GPLv3) parametric 3d CAD tool.
Applications include
* modeling 3d parts — draw with extrudes, revolves, and Boolean (union / difference) operations
* modeling 2d parts — draw the part as a single section, and export DXF, PDF, SVG; use 3d assembly to verify fit
* 3d-printed parts — export the STL or other triangle mesh expected by most 3d printers
* preparing CAM data — export 2d vector art for a waterjet machine or laser cutter; or generate STEP or STL, for import into third-party CAM software for machining
* mechanism design — use the constraint solver to simulate planar or spatial linkages, with pin, ball, or slide joints
* plane and solid geometry — replace hand-solved trigonometry and spreadsheets with a live dimensioned drawing
confinement: strict
license: GPL-3.0

layout:
/usr/share/solvespace:
bind: $SNAP/usr/share/solvespace

apps:
solvespace:
command: usr/bin/solvespace
desktop: solvespace.desktop
extensions: [gnome-3-28]
plugs: [opengl, unity7, home, removable-media, gsettings, network]
environment:
__EGL_VENDOR_LIBRARY_DIRS: $SNAP/usr/share/glvnd/egl_vendor.d
cli:
command: usr/bin/solvespace-cli
plugs: [home, removable-media, network]

parts:
solvespace:
plugin: cmake
source: ./solvespace-snap-src
source-type: local
override-pull: |
snapcraftctl pull
version_major=$(grep "solvespace_VERSION_MAJOR" CMakeLists.txt | tr -d "()" | cut -d" " -f2)
version_minor=$(grep "solvespace_VERSION_MINOR" CMakeLists.txt | tr -d "()" | cut -d" " -f2)
version="$version_major.$version_minor~$(git rev-parse --short=8 HEAD)"
snapcraftctl set-version "$version"
git describe --exact-match HEAD && grade="stable" || grade="devel"
snapcraftctl set-grade "$grade"
git submodule update --init extlib/libdxfrw extlib/flatbuffers extlib/q3d
configflags:
- -DCMAKE_INSTALL_PREFIX=/usr
- -DCMAKE_BUILD_TYPE=Release
- -DENABLE_TESTS=OFF
- -DSNAP=ON
build-packages:
- zlib1g-dev
- libpng-dev
- libcairo2-dev
- libfreetype6-dev
- libjson-c-dev
- libfontconfig1-dev
- libgtkmm-3.0-dev
- libpangomm-1.4-dev
- libgl-dev
- libglu-dev
- libspnav-dev
- git
stage-packages:
- libspnav0
- libatkmm-1.6-1v5
- libcairomm-1.0-1v5
- libgtkmm-3.0-1v5
- libglibmm-2.4-1v5
- libpangomm-1.4-1v5
- libsigc++-2.0-0v5
- libglew2.0
- libegl-mesa0
- libdrm2
16 changes: 16 additions & 0 deletions res/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -153,6 +153,22 @@ else()
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${SIZE}/mimetypes
RENAME com.solvespace.SolveSpace.png)
endforeach()
elseif(SNAP)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/freedesktop/solvespace-snap.desktop
DESTINATION /
RENAME solvespace.desktop)

# snapd does not support registering new mime types

install(FILES freedesktop/solvespace-scalable.svg
DESTINATION /meta/icons/hicolor/scalable/apps
RENAME snap.solvespace.svg)

foreach(SIZE 16x16 24x24 32x32 48x48)
install(FILES freedesktop/solvespace-${SIZE}.png
DESTINATION /meta/icons/hicolor/${SIZE}/apps
RENAME snap.solvespace.png)
endforeach()
else()
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/freedesktop/solvespace.desktop.in
10 changes: 10 additions & 0 deletions res/freedesktop/solvespace-snap.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Desktop Entry]
Version=1.0
Name=SolveSpace
Comment=A parametric 2d/3d CAD
Exec=solvespace
MimeType=application/x-solvespace
Icon=${SNAP}/meta/icons/hicolor/scalable/apps/snap.solvespace.svg
Type=Application
Categories=Graphics
Keywords=parametric;cad;2d;3d;