@@ -49,14 +49,14 @@ function exists(path) {
49
49
return result ;
50
50
}
51
51
52
- if ( ! exists ( `${ path } /.flatpak /repo` ) ) {
52
+ if ( ! exists ( `${ path } /.frun /repo` ) ) {
53
53
const { runtime, sdk } = manifest ;
54
54
const runtime_version = manifest [ "runtime-version" ] ;
55
55
// initializes repo
56
56
await run ( [
57
57
"flatpak" ,
58
58
"build-init" ,
59
- `${ path } /.flatpak /repo` ,
59
+ `${ path } /.frun /repo` ,
60
60
flatpak_id ,
61
61
sdk ,
62
62
runtime ,
@@ -71,9 +71,9 @@ const prefix = [
71
71
"--disable-updates" ,
72
72
] ;
73
73
const suffix = [
74
- `--state-dir=${ path } /.flatpak /flatpak-builder` ,
74
+ `--state-dir=${ path } /.frun /flatpak-builder` ,
75
75
`--stop-at=${ app_module . name } ` ,
76
- `${ path } /.flatpak /repo` ,
76
+ `${ path } /.frun /repo` ,
77
77
Gio . File . new_for_path ( path ) . get_relative_path ( manifest_file ) ,
78
78
] ;
79
79
@@ -93,23 +93,23 @@ async function buildModules() {
93
93
] ) ;
94
94
}
95
95
96
- if ( ! exists ( `${ path } /.flatpak /flatpak-builder` ) ) {
96
+ if ( ! exists ( `${ path } /.frun /flatpak-builder` ) ) {
97
97
await downloadSources ( ) ;
98
98
await buildModules ( ) ;
99
99
}
100
100
101
101
// builds workbench
102
- if ( ! exists ( `${ path } /_build` ) ) {
102
+ if ( ! exists ( `${ path } /.frun/ _build` ) ) {
103
103
await buildCommand ( [
104
104
"meson" ,
105
105
"--prefix" ,
106
106
"/app" ,
107
- "_build" ,
107
+ ".frun/ _build" ,
108
108
"-Dprofile=development" ,
109
109
] ) ;
110
110
}
111
111
112
- await buildCommand ( [ "meson" , "install" , "-C" , "_build" ] ) ;
112
+ await buildCommand ( [ "meson" , "install" , "-C" , ".frun/ _build" ] ) ;
113
113
// await buildCommand([
114
114
// `troll/gjspack/bin/gjspack`,
115
115
// `--appid=${flatpak_id}`,
@@ -123,10 +123,12 @@ await buildCommand(["meson", "install", "-C", "_build"]);
123
123
// ]);
124
124
125
125
// starts workbench
126
- const command = argv [ "--" ] . length ? argv [ "--" ] : [ manifest . command ] ;
127
- await runCommand ( command ) ;
126
+ if ( argv . build !== true ) {
127
+ const command = argv [ "--" ] . length ? argv [ "--" ] : [ manifest . command ] ;
128
+ await runCommand ( command ) ;
129
+ }
128
130
129
- function buildCommand ( argv ) {
131
+ function getCommonArguments ( ) {
130
132
let PATH =
131
133
"/app/bin:/app/bin:/app/bin:/usr/bin:${home}/.var/app/com.visualstudio.code/data/node_modules/bin:/app/bin:/usr/bin" ;
132
134
const append_path = manifest [ "build-options" ] ?. [ "append-path" ] ;
@@ -137,6 +139,10 @@ function buildCommand(argv) {
137
139
manifest [ "build-options" ] ?. [ "append-ls-library-path" ] ;
138
140
if ( append_ld_library_path ) LD_LIBRARY_PATH += `:${ append_ld_library_path } ` ;
139
141
142
+ return [ `--env=PATH=${ PATH } ` , `--env=LD_LIBRARY_PATH=${ LD_LIBRARY_PATH } ` ] ;
143
+ }
144
+
145
+ function buildCommand ( argv ) {
140
146
const PKG_CONFIG_PATH =
141
147
"/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib64/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig:/app/lib/pkgconfig:/app/share/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig" ;
142
148
@@ -145,12 +151,11 @@ function buildCommand(argv) {
145
151
"build" ,
146
152
"--share=network" ,
147
153
`--filesystem=${ path } ` ,
148
- `--filesystem=${ path } /.flatpak/repo` ,
149
- `--env=PATH=${ PATH } ` ,
150
- `--env=LD_LIBRARY_PATH=${ LD_LIBRARY_PATH } ` ,
154
+ `--filesystem=${ path } /.frun/repo` ,
155
+ ...getCommonArguments ( ) ,
151
156
`--env=PKG_CONFIG_PATH=${ PKG_CONFIG_PATH } ` ,
152
- `--filesystem=${ path } /_build` ,
153
- `${ path } /.flatpak /repo` ,
157
+ `--filesystem=${ path } /.frun/ _build` ,
158
+ `${ path } /.frun /repo` ,
154
159
...argv ,
155
160
] ) ;
156
161
}
@@ -165,12 +170,14 @@ async function runCommand(argv) {
165
170
`--bind-mount=/run/user/1000/doc=/run/user/1000/doc/by-app/${ flatpak_id } ` ,
166
171
...manifest [ "finish-args" ] ,
167
172
173
+ ...getCommonArguments ( ) ,
174
+
168
175
// Non default permissions, see Permissions.js
169
176
// consider getting installed overrides instead with
170
177
// flatpak override --user --show re.sonny.Workbench.Devel
171
178
"--share=network" ,
172
179
"--socket=pulseaudio" ,
173
- "--device=input" ,
180
+ "--device=all" , // using "all" instead of "device" for broader compatibility
174
181
175
182
"--talk-name=org.freedesktop.portal.*" ,
176
183
"--talk-name=org.a11y.Bus" ,
@@ -183,7 +190,7 @@ async function runCommand(argv) {
183
190
`--filesystem=${ home } /.cache/fontconfig:ro` ,
184
191
`--bind-mount=/run/host/user-fonts-cache=${ home } /.cache/fontconfig` ,
185
192
`--bind-mount=/run/host/font-dirs.xml=${ home } /.cache/font-dirs.xml` ,
186
- `${ path } /.flatpak /repo` ,
193
+ `${ path } /.frun /repo` ,
187
194
...argv ,
188
195
] ,
189
196
{ verbose : true } ,
@@ -233,7 +240,7 @@ async function exec(argv, { cancellable = null /*, verbose = false*/ }) {
233
240
// ? Gio.SubprocessFlags.NONE
234
241
// : Gio.SubprocessFlags.STDOUT_SILENCE;
235
242
236
- const flags = Gio . SubprocessFlags . NONE ;
243
+ const flags = Gio . SubprocessFlags . STDIN_INHERIT ;
237
244
238
245
const proc = new Gio . Subprocess ( {
239
246
argv,
0 commit comments