Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/build-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,6 @@
"ios": "d82c51bd81eafa77fd322c39ce7e6d663a5b860359ace6ed98060c87092e4845"
}
},
"ca_bundle_sha256": "3ff344e30b9b1ed2971044eabb438a08f2e2245ddb5f8ab1a3ad8b63ab4eaf91"
"ca_bundle_sha256": "f66dff1bdf8f96060b8177976f8b7d9254bc89bc4db933d769f7384d28480bc9"
}
}
15 changes: 10 additions & 5 deletions cmake/GStreamer/Download.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,18 @@ endfunction()
function(gstreamer_download_sdk PLATFORM VERSION FILENAME DESTINATION_DIR RESULT_VAR)
cmake_parse_arguments(_DL "ALLOW_FAILURE" "" "" ${ARGN})

gstreamer_get_package_url("${PLATFORM}" "${VERSION}" _url)
# S3 mirror only (populated by mirror-gstreamer.yml) — upstream can change
# or vanish under a stable release. The .sha256sum sidecar is not mirrored,
# so the in-tree pinned checksum is the only integrity source.
gstreamer_get_s3_mirror_url("${PLATFORM}" "${VERSION}" _s3_url)
gstreamer_fetch_checksum("${PLATFORM}" "${VERSION}" _hash)
if(NOT _s3_url)
message(FATAL_ERROR "gstreamer_download_sdk: No S3 mirror for platform '${PLATFORM}'")
endif()
set(_urls "${_s3_url}")

set(_urls "${_url}")
if(_s3_url)
list(APPEND _urls "${_s3_url}")
gstreamer_get_fallback_checksum("${PLATFORM}" "${VERSION}" _hash)
if(NOT _hash)
_gstreamer_fallback_or_warn("${PLATFORM}" "${VERSION}" _hash "No pinned checksum")
endif()

set(_args
Expand Down
2 changes: 1 addition & 1 deletion tools/setup/install_dependencies/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def list_packages(platform: str | None = None) -> None:
print("=" * 40)
for pkg in MACOS_PACKAGES:
print(f" - {pkg}")
print("\nGStreamer: Downloaded from gstreamer.freedesktop.org")
print("\nGStreamer: Downloaded from the QGroundControl S3 mirror")


def parse_args(args: list[str] | None = None) -> argparse.Namespace:
Expand Down
6 changes: 4 additions & 2 deletions tools/setup/install_dependencies/_macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@


def get_gstreamer_macos_urls(version: str) -> tuple[str, str]:
"""Get GStreamer download URLs for macOS."""
base_url = f"https://gstreamer.freedesktop.org/data/pkg/osx/{version}"
"""Get GStreamer download URLs for macOS (QGC S3 mirror)."""
base_url = "https://qgroundcontrol.s3.us-west-2.amazonaws.com/dependencies/gstreamer/macos"
runtime = f"{base_url}/gstreamer-1.0-{version}-universal.pkg"
devel = f"{base_url}/gstreamer-1.0-devel-{version}-universal.pkg"
return runtime, devel


def install_macos(dry_run: bool = False) -> bool:
"""Install macOS dependencies."""
_c.log_info("Installing macOS dependencies...")
Expand Down Expand Up @@ -100,4 +101,5 @@ def install_macos(dry_run: bool = False) -> bool:
print("\nmacOS dependencies installed successfully!")
return True


__all__ = ["get_gstreamer_macos_urls", "install_macos"]
10 changes: 2 additions & 8 deletions tools/setup/install_dependencies/_windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
WINDOWS_GSTREAMER_BASE_URL = (
"https://qgroundcontrol.s3.us-west-2.amazonaws.com/dependencies/gstreamer/windows"
)
_WINDOWS_GSTREAMER_OFFICIAL_URL = "https://gstreamer.freedesktop.org/data/pkg/windows"
WINDOWS_GSTREAMER_PREFIX = "C:\\gstreamer\\1.0\\msvc_x86_64"
WINDOWS_VULKAN_INSTALL_DIR = "C:\\VulkanSDK\\latest"
WINDOWS_VULKAN_URL = "https://sdk.lunarg.com/sdk/download/latest/windows/vulkan-sdk.exe"
Expand Down Expand Up @@ -124,16 +123,11 @@ def install_windows_gstreamer(version: str, dry_run: bool = False) -> bool:
print(f"\nInstalling GStreamer {version}...")
with tempfile.TemporaryDirectory() as tmpdir:
installer = Path(tmpdir) / installer_name
installer_urls = (
f"{WINDOWS_GSTREAMER_BASE_URL}/{installer_name}",
f"{_WINDOWS_GSTREAMER_OFFICIAL_URL}/{version}/msvc/{installer_name}",
)
if not _c.download_file(
installer_urls[0],
f"{WINDOWS_GSTREAMER_BASE_URL}/{installer_name}",
installer,
dry_run,
warn_on_failure=True,
) and not _c.download_file(installer_urls[1], installer, dry_run):
):
return False
if not _c.run_command(
[
Expand Down
20 changes: 6 additions & 14 deletions tools/tests/test_install_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,27 +463,19 @@ def test_install_windows_gstreamer(monkeypatch, tmp_path: Path) -> None:
monkeypatch.setenv("PROCESSOR_ARCHITECTURE", "AMD64")
monkeypatch.setattr(_windows, "WINDOWS_GSTREAMER_PREFIX", str(tmp_path))
with (
patch.object(_windows._c, "download_file", side_effect=[False, True]) as dl,
patch.object(_windows._c, "download_file", return_value=True) as dl,
patch.object(_windows._c, "run_command", return_value=True) as rc,
patch.object(_windows._c, "set_env_var"),
patch.object(_windows._c, "add_to_path"),
):
assert _windows.install_windows_gstreamer("1.28.4") is True

installer = dl.call_args_list[0].args[1]
dl.assert_called_once()
installer = dl.call_args.args[1]
assert installer.name == "gstreamer-1.0-msvc-x86_64-1.28.4.exe"
assert [call.args[0] for call in dl.call_args_list] == [
(
f"{_windows.WINDOWS_GSTREAMER_BASE_URL}/"
"gstreamer-1.0-msvc-x86_64-1.28.4.exe"
),
(
"https://gstreamer.freedesktop.org/data/pkg/windows/1.28.4/msvc/"
"gstreamer-1.0-msvc-x86_64-1.28.4.exe"
),
]
assert dl.call_args_list[0].kwargs == {"warn_on_failure": True}
assert dl.call_args_list[1].kwargs == {}
assert dl.call_args.args[0] == (
f"{_windows.WINDOWS_GSTREAMER_BASE_URL}/gstreamer-1.0-msvc-x86_64-1.28.4.exe"
)
assert rc.call_args.args[0] == [
str(installer),
"/VERYSILENT",
Expand Down
Loading