Browse Source

build: Add support for when the build is sandboxed

When using flatpak-cargo-generator, the crates cannot be placed in the
build dir before the build happens, so we must change the CARGO_HOME env
variable.
merge-requests/1461/merge
Kévin Commaille 2 years ago
parent
commit
cb392256bf
No known key found for this signature in database
GPG Key ID: 29A48C1F03620416
  1. 8
      meson.options
  2. 7
      src/meson.build

8
meson.options

@ -10,3 +10,11 @@ option(
value: 'default',
description: 'The build profile for Fractal. One of "default", "beta", "development" or "hack".'
)
option(
'sandboxed',
type : 'boolean',
value : false,
description: 'Whether the build happens in a sandbox.' +
'When that is the case, cargo will not be able to download the dependencies during' +
'the build so they are assumed to be in meson.project_source_root()/cargo'
)

7
src/meson.build

@ -39,7 +39,12 @@ else
message('Building in release mode')
endif
cargo_env = [ 'CARGO_HOME=' + meson.project_build_root() / 'cargo-home' ]
if get_option('sandboxed')
# This is the path used by flatpak-cargo-generator in flatpak-builder-tools
cargo_env = [ 'CARGO_HOME=' + meson.project_source_root() / 'cargo' ]
else
cargo_env = [ 'CARGO_HOME=' + meson.project_build_root() / 'cargo-home' ]
endif
custom_target(
'cargo-build',

Loading…
Cancel
Save