Move Gir.toml into the corresponding subdirectories

This commit is contained in:
Sebastian Dröge 2020-10-30 17:52:12 +02:00
parent ff64c6606a
commit f657a56947
18 changed files with 53 additions and 44 deletions

View file

@ -66,29 +66,38 @@ def build_gir_if_needed(updated_submodule):
return False
return True
def regen_crates(path, level=0):
for entry in listdir(path):
entry_file = join(path, entry)
if isdir(entry_file):
if level < 2 and not regen_crates(entry_file, level + 1):
return False
elif entry == 'Gir.toml':
print('==> Regenerating "{}"...'.format(entry_file))
def regen_crates():
for entry in [f for f in listdir('.') if isfile(join('.', f))]:
if entry.startswith('Gir_Gst') and entry.endswith('.toml'):
print('==> Regenerating "{}"...'.format(entry))
args = ['./gir/target/release/gir', '-c', entry_file, '-o', path, '-d', 'gir-files']
if level > 1:
args.append('-m')
args.append('sys')
error = False
try:
run_command(['./gir/target/release/gir', '-c', entry])
error = run_command(args) is False
except Exception as err:
print('The following error occurred: {}'.format(err))
error = True
if error is True:
line = input('Do you want to continue? [y/N] ').strip().lower()
if line != 'y':
sys.exit(1)
return False
print('<== Done!')
return True
def main():
if def_check_submodule("gir-files") == FAILURE:
return 1
if not build_gir_if_needed(def_check_submodule("gir")):
return 1
print('=> Regenerating crates...')
if not regen_crates():
if not regen_crates("."):
return 1
if not run_command(['cargo', 'fmt']):
return 1

View file

@ -1,9 +1,9 @@
[options]
girs_dir = "gir-files"
girs_dir = "../gir-files"
library = "GstApp"
version = "1.0"
min_cfg_version = "1.8"
target_path = "gstreamer-app"
target_path = "."
work_mode = "normal"
concurrency = "send+sync"
generate_safety_asserts = true

View file

@ -1,9 +1,9 @@
[options]
girs_dir = "gir-files"
girs_dir = "../gir-files"
library = "GstAudio"
version = "1.0"
min_cfg_version = "1.8"
target_path = "gstreamer-audio"
target_path = "."
work_mode = "normal"
concurrency = "send+sync"
generate_safety_asserts = true

View file

@ -1,9 +1,9 @@
[options]
girs_dir = "gir-files"
girs_dir = "../gir-files"
library = "GstBase"
version = "1.0"
min_cfg_version = "1.8"
target_path = "gstreamer-base"
target_path = "."
work_mode = "normal"
concurrency = "send+sync"
generate_safety_asserts = true

View file

@ -1,9 +1,9 @@
[options]
girs_dir = "gir-files"
girs_dir = "../gir-files"
library = "GstCheck"
version = "1.0"
min_cfg_version = "1.8"
target_path = "gstreamer-check"
target_path = "."
work_mode = "normal"
concurrency = "send+sync"
generate_safety_asserts = true

View file

@ -1,9 +1,9 @@
[options]
girs_dir = "gir-files"
girs_dir = "../gir-files"
library = "GstController"
version = "1.0"
min_cfg_version = "1.8"
target_path = "gstreamer-controller"
target_path = "."
work_mode = "normal"
concurrency = "send+sync"
generate_safety_asserts = true

View file

@ -1,9 +1,9 @@
[options]
girs_dir = "gir-files"
girs_dir = "../gir-files"
library = "GES"
version = "1.0"
min_cfg_version = "1.8"
target_path = "gstreamer-editing-services"
target_path = "."
work_mode = "normal"
generate_safety_asserts = true
single_version_file = true

View file

@ -1,9 +1,9 @@
[options]
girs_dir = "gir-files"
girs_dir = "../gir-files"
library = "GstGL"
version = "1.0"
min_cfg_version = "1.14"
target_path = "gstreamer-gl"
target_path = "."
work_mode = "normal"
concurrency = "send+sync"
generate_safety_asserts = true

View file

@ -1,9 +1,9 @@
[options]
girs_dir = "gir-files"
girs_dir = "../gir-files"
library = "GstNet"
version = "1.0"
min_cfg_version = "1.8"
target_path = "gstreamer-net"
target_path = "."
work_mode = "normal"
concurrency = "send+sync"
generate_safety_asserts = true

View file

@ -1,9 +1,9 @@
[options]
girs_dir = "gir-files"
girs_dir = "../gir-files"
library = "GstPbutils"
version = "1.0"
min_cfg_version = "1.8"
target_path = "gstreamer-pbutils"
target_path = "."
work_mode = "normal"
concurrency = "send+sync"
generate_safety_asserts = true

View file

@ -1,9 +1,9 @@
[options]
girs_dir = "gir-files"
girs_dir = "../gir-files"
library = "GstPlayer"
version = "1.0"
min_cfg_version = "1.12"
target_path = "gstreamer-player"
target_path = "."
work_mode = "normal"
concurrency = "send+sync"
generate_safety_asserts = true

View file

@ -1,9 +1,9 @@
[options]
girs_dir = "gir-files"
girs_dir = "../gir-files"
library = "GstRtp"
version = "1.0"
min_cfg_version = "1.8"
target_path = "gstreamer-rtp"
target_path = "."
work_mode = "normal"
concurrency = "send+sync"
generate_safety_asserts = true

View file

@ -1,9 +1,9 @@
[options]
girs_dir = "gir-files"
girs_dir = "../gir-files"
library = "GstRtspServer"
version = "1.0"
min_cfg_version = "1.8"
target_path = "gstreamer-rtsp-server"
target_path = "."
work_mode = "normal"
concurrency = "send+sync"
generate_safety_asserts = true

View file

@ -1,9 +1,9 @@
[options]
girs_dir = "gir-files"
girs_dir = "../gir-files"
library = "GstRtsp"
version = "1.0"
min_cfg_version = "1.8"
target_path = "gstreamer-rtsp"
target_path = "."
work_mode = "normal"
concurrency = "send+sync"
generate_safety_asserts = true

View file

@ -1,9 +1,9 @@
[options]
girs_dir = "gir-files"
girs_dir = "../gir-files"
library = "GstSdp"
version = "1.0"
min_cfg_version = "1.8"
target_path = "gstreamer-sdp"
target_path = "."
work_mode = "normal"
concurrency = "send"
generate_safety_asserts = true

View file

@ -1,9 +1,9 @@
[options]
girs_dir = "gir-files"
girs_dir = "../gir-files"
library = "GstVideo"
version = "1.0"
min_cfg_version = "1.8"
target_path = "gstreamer-video"
target_path = "."
work_mode = "normal"
concurrency = "send+sync"
generate_safety_asserts = true

View file

@ -1,9 +1,9 @@
[options]
girs_dir = "gir-files"
girs_dir = "../gir-files"
library = "GstWebRTC"
version = "1.0"
min_cfg_version = "1.14"
target_path = "gstreamer-webrtc"
target_path = "."
work_mode = "normal"
concurrency = "send+sync"
generate_safety_asserts = true

View file

@ -1,9 +1,9 @@
[options]
girs_dir = "gir-files"
girs_dir = "../gir-files"
library = "Gst"
version = "1.0"
min_cfg_version = "1.8"
target_path = "gstreamer"
target_path = "."
work_mode = "normal"
concurrency = "send+sync"
generate_safety_asserts = true