FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Linux: add Flatpak integration. · KmolYuan/solvespace@0b7b8a4 · GitHub

Repository navigation

Commit 0b7b8a4

Browse files
committed
Linux: add Flatpak integration.
To test it, use: $ ./pkg/flatpak/build.sh $ flatpak install ./pkg/flatpak/solvespace.flatpak $ flatpak run com.solvespace.SolveSpace
1 parent bc3e09e commit 0b7b8a4

7 files changed

Lines changed: 211 additions & 21 deletions

File tree

‎pkg/flatpak/.gitignore‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/.flatpak-builder
2+
/build-dir
3+
/repo
4+
*.flatpak

‎pkg/flatpak/build.sh‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh -ex
2+
cd $(dirname $0)
3+
flatpak-builder "$@" --force-clean --repo repo build-dir com.solvespace.SolveSpace.json
4+
flatpak build-bundle repo solvespace.flatpak com.solvespace.SolveSpace
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
{
2+
"app-id": "com.solvespace.SolveSpace",
3+
"runtime": "org.gnome.Platform",
4+
"runtime-version": "3.30",
5+
"sdk": "org.gnome.Sdk",
6+
"finish-args": [
7+
/* Access to display server and OpenGL */
8+
"--share=ipc", "--socket=fallback-x11", "--socket=wayland", "--device=dri",
9+
/* Access to save files */
10+
"--filesystem=home"
11+
],
12+
"cleanup": [
13+
"/include", "/lib/*/include",
14+
"*.a", "*.la", "*.m4", "/lib/libslvs*.so*", "/lib/libglibmm_generate_extra_defs*.so*",
15+
"/share/pkgconfig", "*.pc",
16+
"/share/man", "/share/doc",
17+
"/share/aclocal",
18+
/* mm-common junk */
19+
"/bin/mm-common-prepare",
20+
"/share/mm-common"
21+
],
22+
"command": "solvespace",
23+
"modules": [
24+
{
25+
"name": "mm-common",
26+
"sources": [
27+
{
28+
"type": "archive",
29+
"url": "http://ftp.gnome.org/pub/GNOME/sources/mm-common/0.9/mm-common-0.9.12.tar.xz",
30+
"sha256": "ceffdcce1e5b52742884c233ec604bf6fded12eea9da077ce7a62c02c87e7c0b"
31+
}
32+
]
33+
},
34+
{
35+
"name": "sigc++",
36+
"config-opts": [
37+
"--disable-documentation"
38+
],
39+
"sources": [
40+
{
41+
"type": "archive",
42+
"url": "http://ftp.gnome.org/pub/GNOME/sources/libsigc++/2.10/libsigc++-2.10.1.tar.xz",
43+
"sha256": "c9a25f26178c6cbb147f9904d8c533b5a5c5111a41ac2eb781eb734eea446003"
44+
}
45+
]
46+
},
47+
{
48+
"name": "glibmm",
49+
"config-opts": [
50+
"--disable-documentation"
51+
],
52+
"sources": [
53+
{
54+
"type": "archive",
55+
"url": "http://ftp.gnome.org/pub/GNOME/sources/glibmm/2.58/glibmm-2.58.1.tar.xz",
56+
"sha256": "6e5fe03bdf1e220eeffd543e017fd2fb15bcec9235f0ffd50674aff9362a85f0"
57+
}
58+
]
59+
},
60+
{
61+
"name": "cairomm",
62+
"config-opts": [
63+
"--disable-documentation"
64+
],
65+
"sources": [
66+
{
67+
"type": "archive",
68+
"url": "http://ftp.gnome.org/pub/GNOME/sources/cairomm/1.12/cairomm-1.12.0.tar.xz",
69+
"sha256": "a54ada8394a86182525c0762e6f50db6b9212a2109280d13ec6a0b29bfd1afe6"
70+
}
71+
]
72+
},
73+
{
74+
"name": "pangomm",
75+
"config-opts": [
76+
"--disable-documentation"
77+
],
78+
"sources": [
79+
{
80+
"type": "archive",
81+
"url": "http://ftp.gnome.org/pub/GNOME/sources/pangomm/2.40/pangomm-2.40.2.tar.xz",
82+
"sha256": "0a97aa72513db9088ca3034af923484108746dba146e98ed76842cf858322d05"
83+
}
84+
]
85+
},
86+
{
87+
"name": "atkmm",
88+
"config-opts": [
89+
"--disable-documentation"
90+
],
91+
"sources": [
92+
{
93+
"type": "archive",
94+
"url": "http://ftp.gnome.org/pub/GNOME/sources/atkmm/2.28/atkmm-2.28.0.tar.xz",
95+
"sha256": "4c4cfc917fd42d3879ce997b463428d6982affa0fb660cafcc0bc2d9afcedd3a"
96+
}
97+
]
98+
},
99+
{
100+
"name": "gtkmm",
101+
"config-opts": [
102+
"--disable-documentation"
103+
],
104+
"sources": [
105+
{
106+
"type": "archive",
107+
"url": "http://ftp.gnome.org/pub/GNOME/sources/gtkmm/3.24/gtkmm-3.24.1.tar.xz",
108+
"sha256": "ddfe42ed2458a20a34de252854bcf4b52d3f0c671c045f56b42aa27c7542d2fd"
109+
}
110+
]
111+
},
112+
{
113+
"name": "libjson-c",
114+
"sources": [
115+
{
116+
"type": "archive",
117+
"url": "https://s3.amazonaws.com/json-c_releases/releases/json-c-0.13.1-nodoc.tar.gz",
118+
"sha256": "94a26340c0785fcff4f46ff38609cf84ebcd670df0c8efd75d039cc951d80132"
119+
}
120+
],
121+
"buildsystem": "cmake",
122+
"builddir": true
123+
},
124+
{
125+
"name": "SolveSpace",
126+
"sources": [
127+
{
128+
"type": "git",
129+
"path": "/home/whitequark/Projects/solvespace"
130+
}
131+
],
132+
"buildsystem": "cmake",
133+
"builddir": true,
134+
"config-opts": [
135+
"-DFLATPAK=ON",
136+
"-DENABLE_CLI=OFF",
137+
"-DENABLE_TESTS=OFF"
138+
]
139+
}
140+
]
141+
}

‎res/CMakeLists.txt‎

Lines changed: 44 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -126,28 +126,51 @@ elseif(APPLE)
126126
else()
127127
add_resource(freedesktop/solvespace-48x48.png)
128128

129-
configure_file(
130-
${CMAKE_CURRENT_SOURCE_DIR}/freedesktop/solvespace.desktop.in
131-
${CMAKE_CURRENT_BINARY_DIR}/freedesktop/solvespace.desktop)
132-
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/freedesktop/solvespace.desktop
133-
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
134-
135-
install(FILES freedesktop/solvespace-slvs.xml
136-
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/mime/packages)
137-
138-
foreach(SIZE 16x16 24x24 32x32 48x48)
139-
install(FILES freedesktop/solvespace-${SIZE}.png
140-
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${SIZE}/apps
141-
RENAME solvespace.png)
142-
install(FILES freedesktop/solvespace-${SIZE}.png
143-
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${SIZE}/mimetypes
144-
RENAME application.x-solvespace.png)
145-
endforeach()
129+
if(FLATPAK)
130+
configure_file(
131+
${CMAKE_CURRENT_SOURCE_DIR}/freedesktop/solvespace-flatpak.desktop.in
132+
${CMAKE_CURRENT_BINARY_DIR}/freedesktop/solvespace-flatpak.desktop)
133+
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/freedesktop/solvespace-flatpak.desktop
134+
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications
135+
RENAME com.solvespace.SolveSpace.desktop)
146136

147-
foreach(SIZE 16x16 24x24 32x32 48x48)
148-
install(FILES freedesktop/solvespace-${SIZE}.xpm
149-
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pixmaps)
150-
endforeach()
137+
install(FILES freedesktop/solvespace-flatpak-mime.xml
138+
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/mime/packages
139+
RENAME com.solvespace.SolveSpace-slvs.xml)
140+
141+
foreach(SIZE 16x16 24x24 32x32 48x48)
142+
install(FILES freedesktop/solvespace-${SIZE}.png
143+
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${SIZE}/apps
144+
RENAME com.solvespace.SolveSpace.png)
145+
install(FILES freedesktop/solvespace-${SIZE}.png
146+
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${SIZE}/mimetypes
147+
RENAME com.solvespace.SolveSpace.png)
148+
endforeach()
149+
else()
150+
configure_file(
151+
${CMAKE_CURRENT_SOURCE_DIR}/freedesktop/solvespace.desktop.in
152+
${CMAKE_CURRENT_BINARY_DIR}/freedesktop/solvespace.desktop)
153+
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/freedesktop/solvespace.desktop
154+
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
155+
156+
install(FILES freedesktop/solvespace-mime.xml
157+
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/mime/packages
158+
RENAME solvespace-slvs.xml)
159+
160+
foreach(SIZE 16x16 24x24 32x32 48x48)
161+
install(FILES freedesktop/solvespace-${SIZE}.png
162+
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${SIZE}/apps
163+
RENAME solvespace.png)
164+
install(FILES freedesktop/solvespace-${SIZE}.png
165+
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${SIZE}/mimetypes
166+
RENAME application.x-solvespace.png)
167+
endforeach()
168+
169+
foreach(SIZE 16x16 24x24 32x32 48x48)
170+
install(FILES freedesktop/solvespace-${SIZE}.xpm
171+
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pixmaps)
172+
endforeach()
173+
endif()
151174
endif()
152175

153176
add_resources(
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
3+
<mime-type type="application/x-solvespace">
4+
<comment xml:lang="en">SolveSpace model</comment>
5+
<generic-icon name="com.solvespace.SolveSpace"/>
6+
<glob pattern="*.slvs"/>
7+
</mime-type>
8+
</mime-info>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[Desktop Entry]
2+
Version=1.0
3+
Name=SolveSpace
4+
Comment=A parametric 2d/3d CAD
5+
Exec=${CMAKE_INSTALL_FULL_BINDIR}/solvespace
6+
MimeType=application/x-solvespace
7+
Icon=com.solvespace.SolveSpace
8+
Type=Application
9+
Categories=Graphics
10+
Keywords=parametric;cad;2d;3d;

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL