@@ -49,14 +49,14 @@ function exists(path) {
4949 return result ;
5050}
5151
52- if ( ! exists ( `${ path } /.flatpak /repo` ) ) {
52+ if ( ! exists ( `${ path } /.frun /repo` ) ) {
5353 const { runtime, sdk } = manifest ;
5454 const runtime_version = manifest [ "runtime-version" ] ;
5555 // initializes repo
5656 await run ( [
5757 "flatpak" ,
5858 "build-init" ,
59- `${ path } /.flatpak /repo` ,
59+ `${ path } /.frun /repo` ,
6060 flatpak_id ,
6161 sdk ,
6262 runtime ,
@@ -71,9 +71,9 @@ const prefix = [
7171 "--disable-updates" ,
7272] ;
7373const suffix = [
74- `--state-dir=${ path } /.flatpak /flatpak-builder` ,
74+ `--state-dir=${ path } /.frun /flatpak-builder` ,
7575 `--stop-at=${ app_module . name } ` ,
76- `${ path } /.flatpak /repo` ,
76+ `${ path } /.frun /repo` ,
7777 Gio . File . new_for_path ( path ) . get_relative_path ( manifest_file ) ,
7878] ;
7979
@@ -93,23 +93,23 @@ async function buildModules() {
9393 ] ) ;
9494}
9595
96- if ( ! exists ( `${ path } /.flatpak /flatpak-builder` ) ) {
96+ if ( ! exists ( `${ path } /.frun /flatpak-builder` ) ) {
9797 await downloadSources ( ) ;
9898 await buildModules ( ) ;
9999}
100100
101101// builds workbench
102- if ( ! exists ( `${ path } /_build` ) ) {
102+ if ( ! exists ( `${ path } /.frun/ _build` ) ) {
103103 await buildCommand ( [
104104 "meson" ,
105105 "--prefix" ,
106106 "/app" ,
107- "_build" ,
107+ ".frun/ _build" ,
108108 "-Dprofile=development" ,
109109 ] ) ;
110110}
111111
112- await buildCommand ( [ "meson" , "install" , "-C" , "_build" ] ) ;
112+ await buildCommand ( [ "meson" , "install" , "-C" , ".frun/ _build" ] ) ;
113113// await buildCommand([
114114// `troll/gjspack/bin/gjspack`,
115115// `--appid=${flatpak_id}`,
@@ -123,10 +123,12 @@ await buildCommand(["meson", "install", "-C", "_build"]);
123123// ]);
124124
125125// 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+ }
128130
129- function buildCommand ( argv ) {
131+ function getCommonArguments ( ) {
130132 let PATH =
131133 "/app/bin:/app/bin:/app/bin:/usr/bin:${home}/.var/app/com.visualstudio.code/data/node_modules/bin:/app/bin:/usr/bin" ;
132134 const append_path = manifest [ "build-options" ] ?. [ "append-path" ] ;
@@ -137,6 +139,10 @@ function buildCommand(argv) {
137139 manifest [ "build-options" ] ?. [ "append-ls-library-path" ] ;
138140 if ( append_ld_library_path ) LD_LIBRARY_PATH += `:${ append_ld_library_path } ` ;
139141
142+ return [ `--env=PATH=${ PATH } ` , `--env=LD_LIBRARY_PATH=${ LD_LIBRARY_PATH } ` ] ;
143+ }
144+
145+ function buildCommand ( argv ) {
140146 const PKG_CONFIG_PATH =
141147 "/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" ;
142148
@@ -145,12 +151,11 @@ function buildCommand(argv) {
145151 "build" ,
146152 "--share=network" ,
147153 `--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 ( ) ,
151156 `--env=PKG_CONFIG_PATH=${ PKG_CONFIG_PATH } ` ,
152- `--filesystem=${ path } /_build` ,
153- `${ path } /.flatpak /repo` ,
157+ `--filesystem=${ path } /.frun/ _build` ,
158+ `${ path } /.frun /repo` ,
154159 ...argv ,
155160 ] ) ;
156161}
@@ -165,12 +170,14 @@ async function runCommand(argv) {
165170 `--bind-mount=/run/user/1000/doc=/run/user/1000/doc/by-app/${ flatpak_id } ` ,
166171 ...manifest [ "finish-args" ] ,
167172
173+ ...getCommonArguments ( ) ,
174+
168175 // Non default permissions, see Permissions.js
169176 // consider getting installed overrides instead with
170177 // flatpak override --user --show re.sonny.Workbench.Devel
171178 "--share=network" ,
172179 "--socket=pulseaudio" ,
173- "--device=input" ,
180+ "--device=all" , // using "all" instead of "device" for broader compatibility
174181
175182 "--talk-name=org.freedesktop.portal.*" ,
176183 "--talk-name=org.a11y.Bus" ,
@@ -183,7 +190,7 @@ async function runCommand(argv) {
183190 `--filesystem=${ home } /.cache/fontconfig:ro` ,
184191 `--bind-mount=/run/host/user-fonts-cache=${ home } /.cache/fontconfig` ,
185192 `--bind-mount=/run/host/font-dirs.xml=${ home } /.cache/font-dirs.xml` ,
186- `${ path } /.flatpak /repo` ,
193+ `${ path } /.frun /repo` ,
187194 ...argv ,
188195 ] ,
189196 { verbose : true } ,
@@ -233,7 +240,7 @@ async function exec(argv, { cancellable = null /*, verbose = false*/ }) {
233240 // ? Gio.SubprocessFlags.NONE
234241 // : Gio.SubprocessFlags.STDOUT_SILENCE;
235242
236- const flags = Gio . SubprocessFlags . NONE ;
243+ const flags = Gio . SubprocessFlags . STDIN_INHERIT ;
237244
238245 const proc = new Gio . Subprocess ( {
239246 argv,
0 commit comments