build: Replace missing crates.io dependency with Purism-hosted one

This commit is contained in:
Dorota Czaplejewicz
2022-04-04 16:56:28 +00:00
parent b5142ac765
commit d19050e06d
6 changed files with 18 additions and 7 deletions

4
Cargo.deps.online Normal file
View File

@ -0,0 +1,4 @@
# Dependencies which are only used with online, crates.io builds.
[patch.crates-io]
# Dependency was yanked, but gio 0.7 needs it.
fragile = { git = "https://source.puri.sm/dorota.czaplejewicz/fragile.git", tag = "0.3.0" }

1
debian/cargo/config vendored
View File

@ -9,4 +9,3 @@ replace-with = 'vendored-sources'
[source.vendored-sources] [source.vendored-sources]
directory = '/usr/share/cargo/registry' directory = '/usr/share/cargo/registry'

2
debian/rules vendored
View File

@ -38,6 +38,6 @@ endif
# causing Cargo to refuse to build with a crates.io copy # causing Cargo to refuse to build with a crates.io copy
override_dh_auto_configure: override_dh_auto_configure:
[ ! -f Cargo.lock ] || rm Cargo.lock [ ! -f Cargo.lock ] || rm Cargo.lock
dh_auto_configure -- -Dnewer=$(newer) dh_auto_configure -- -Dnewer=$(newer) -Donline=false
override_dh_autoreconf: override_dh_autoreconf:

View File

@ -96,19 +96,23 @@ cargo_toml_base = configure_file(
configuration: path_data, configuration: path_data,
) )
cargo_patch = []
cargo_deps = files('Cargo.deps')
if get_option('newer') == true if get_option('newer') == true
cargo_build_flags += ['--features', 'glib_v0_14'] cargo_build_flags += ['--features', 'glib_v0_14']
cargo_deps = files('Cargo.deps.newer') cargo_deps = files('Cargo.deps.newer')
else
cargo_deps = files('Cargo.deps')
if get_option('online') == true
cargo_patch = [files('Cargo.deps.online')]
endif
endif endif
cat = find_program('cat') cat = find_program('cat')
cargo_toml = custom_target( cargo_toml = custom_target(
'Cargo.toml', 'Cargo.toml',
output: 'Cargo.toml', output: 'Cargo.toml',
command: [cat, cargo_toml_base, cargo_deps], command: [cat, cargo_toml_base, cargo_deps] + cargo_patch,
capture: true, capture: true,
) )

View File

@ -11,6 +11,10 @@ option('newer',
type: 'boolean', value: false, type: 'boolean', value: false,
description: 'Build with dependencies newer than those of Byzantium') description: 'Build with dependencies newer than those of Byzantium')
option('online',
type: 'boolean', value: true,
description: 'Pull packages from the internet while building, as opposed to a local regstry.')
option('strict', option('strict',
type: 'boolean', value: true, type: 'boolean', value: true,
description: 'Turn more warnings into errors') description: 'Turn more warnings into errors')