Skip to content

Truly independent web browser

Meta: Add Sparkle to the dependencies of macOS

Jelle Raaijmakersa1b831984cd8
diff --git a/Documentation/BuildInstructionsLadybird.md b/Documentation/BuildInstructionsLadybird.md
index 3602f0fad3b..397fbe704bc 100644
--- a/Documentation/BuildInstructionsLadybird.md
+++ b/Documentation/BuildInstructionsLadybird.md
@@ -133,14 +133,14 @@ building with Nix, please create an issue there.
### macOS:
-Xcode 15 or clang from homebrew is required to successfully build ladybird.
+Xcode 26 or newer is required to build Ladybird. Install it from the App Store, open it once to finish its setup, and
+then install the other dependencies:
```
-xcode-select --install
brew install autoconf autoconf-archive automake ccache cmake libtool make nasm ninja pkg-config
```
-If you wish to use clang from homebrew instead:
+If you wish to build with clang from homebrew instead of the one of Xcode:
```
brew install llvm@22
```
diff --git a/Meta/CMake/vcpkg/overlay-ports/sparkle/no-swift-packages.patch b/Meta/CMake/vcpkg/overlay-ports/sparkle/no-swift-packages.patch
new file mode 100644
index 00000000000..08f48fb2343
--- /dev/null
+++ b/Meta/CMake/vcpkg/overlay-ports/sparkle/no-swift-packages.patch
@@ -0,0 +1,12 @@
+diff --git a/Sparkle.xcodeproj/project.pbxproj b/Sparkle.xcodeproj/project.pbxproj
+index da97d52..c811fff 100644
+--- a/Sparkle.xcodeproj/project.pbxproj
++++ b/Sparkle.xcodeproj/project.pbxproj
+@@ -3104,7 +3104,6 @@
+ );
+ mainGroup = 0867D691FE84028FC02AAC07 /* Sparkle */;
+ packageReferences = (
+- 727DBAE326B5BBFD00111F0C /* XCRemoteSwiftPackageReference "swift-argument-parser" */,
+ );
+ productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
+ projectDirPath = "";
diff --git a/Meta/CMake/vcpkg/overlay-ports/sparkle/portfile.cmake b/Meta/CMake/vcpkg/overlay-ports/sparkle/portfile.cmake
new file mode 100644
index 00000000000..3d6b5025b46
--- /dev/null
+++ b/Meta/CMake/vcpkg/overlay-ports/sparkle/portfile.cmake
@@ -0,0 +1,67 @@
+# Sparkle is built by its Xcode project, so this port needs Xcode rather than only the Command Line Tools.
+set(VCPKG_BUILD_TYPE release)
+set(VCPKG_POLICY_DLLS_IN_STATIC_LIBRARY enabled)
+set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
+# The framework finds its own parts relative to itself, so its install names and rpaths stay as Xcode made them.
+set(VCPKG_FIXUP_MACHO_RPATH OFF)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO sparkle-project/Sparkle
+ REF "${VERSION}"
+ SHA512 2eb619b6a4791895041200c0b8f0973b68879df99d43a95528fc9c8f0e6ef483939b04483c321d342a12a7287b2398ad86f2c5df0a72f7599033fda837f7729e
+ HEAD_REF 2.x
+ PATCHES
+ # Only Sparkle's command line tools use swift-argument-parser, and Xcode would fetch it while building.
+ no-swift-packages.patch
+)
+
+if(DEFINED ENV{DEVELOPER_DIR})
+ set(developer_dir "$ENV{DEVELOPER_DIR}")
+else()
+ execute_process(COMMAND xcode-select --print-path OUTPUT_VARIABLE developer_dir OUTPUT_STRIP_TRAILING_WHITESPACE)
+endif()
+if(NOT EXISTS "${developer_dir}/usr/bin/xcodebuild" AND EXISTS "/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild")
+ set(developer_dir "/Applications/Xcode.app/Contents/Developer")
+endif()
+if(NOT EXISTS "${developer_dir}/usr/bin/xcodebuild")
+ message(FATAL_ERROR "Building Sparkle needs Xcode. Install it, or point DEVELOPER_DIR at its Developer directory.")
+endif()
+
+# Ladybird is not sandboxed, so it needs none of Sparkle's XPC services. It also needs none of the support for older
+# updaters, DSA signatures, older delta updates or installer packages.
+set(build_settings)
+if(VCPKG_OSX_ARCHITECTURES)
+ list(JOIN VCPKG_OSX_ARCHITECTURES " " archs)
+ list(APPEND build_settings "ARCHS=${archs}")
+endif()
+if(VCPKG_OSX_DEPLOYMENT_TARGET)
+ list(APPEND build_settings "MACOSX_DEPLOYMENT_TARGET=${VCPKG_OSX_DEPLOYMENT_TARGET}")
+endif()
+
+set(build_dir "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel")
+file(REMOVE_RECURSE "${build_dir}")
+vcpkg_execute_build_process(
+ COMMAND "${CMAKE_COMMAND}" -E env "DEVELOPER_DIR=${developer_dir}"
+ xcodebuild build
+ -project "${SOURCE_PATH}/Sparkle.xcodeproj"
+ -target Sparkle
+ -configuration Release
+ ${build_settings}
+ CODE_SIGNING_ALLOWED=NO
+ "SYMROOT=${build_dir}"
+ "OBJROOT=${build_dir}/obj"
+ SPARKLE_EMBED_INSTALLER_LAUNCHER_XPC_SERVICE=0
+ SPARKLE_EMBED_DOWNLOADER_XPC_SERVICE=0
+ SPARKLE_BUILD_LEGACY_SUUPDATER=0
+ SPARKLE_BUILD_LEGACY_DSA_SUPPORT=0
+ SPARKLE_BUILD_LEGACY_DELTA_SUPPORT=0
+ SPARKLE_BUILD_PACKAGE_SUPPORT=0
+ WORKING_DIRECTORY "${SOURCE_PATH}"
+ LOGNAME "build-${TARGET_TRIPLET}-rel"
+)
+
+file(COPY "${build_dir}/Release/Sparkle.framework" DESTINATION "${CURRENT_PACKAGES_DIR}/Frameworks")
+file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/unofficial-sparkle-config.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/unofficial-sparkle")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
diff --git a/Meta/CMake/vcpkg/overlay-ports/sparkle/unofficial-sparkle-config.cmake b/Meta/CMake/vcpkg/overlay-ports/sparkle/unofficial-sparkle-config.cmake
new file mode 100644
index 00000000000..a6ad3c454f2
--- /dev/null
+++ b/Meta/CMake/vcpkg/overlay-ports/sparkle/unofficial-sparkle-config.cmake
@@ -0,0 +1,12 @@
+get_filename_component(_sparkle_prefix "${CMAKE_CURRENT_LIST_DIR}/../.." ABSOLUTE)
+
+if(NOT TARGET unofficial::sparkle::Sparkle)
+ add_library(unofficial::sparkle::Sparkle SHARED IMPORTED)
+ set_target_properties(unofficial::sparkle::Sparkle PROPERTIES
+ FRAMEWORK TRUE
+ IMPORTED_LOCATION "${_sparkle_prefix}/Frameworks/Sparkle.framework"
+ INTERFACE_INCLUDE_DIRECTORIES "${_sparkle_prefix}/Frameworks/Sparkle.framework"
+ )
+endif()
+
+unset(_sparkle_prefix)
diff --git a/Meta/CMake/vcpkg/overlay-ports/sparkle/vcpkg.json b/Meta/CMake/vcpkg/overlay-ports/sparkle/vcpkg.json
new file mode 100644
index 00000000000..958866ca8c7
--- /dev/null
+++ b/Meta/CMake/vcpkg/overlay-ports/sparkle/vcpkg.json
@@ -0,0 +1,8 @@
+{
+ "name": "sparkle",
+ "version": "2.10.1",
+ "description": "A software update framework for macOS",
+ "homepage": "https://sparkle-project.org",
+ "license": "MIT",
+ "supports": "osx"
+}
diff --git a/Meta/Linters/check_flatpak.py b/Meta/Linters/check_flatpak.py
index 04aafc8433d..134a8187a02 100755
--- a/Meta/Linters/check_flatpak.py
+++ b/Meta/Linters/check_flatpak.py
@@ -65,6 +65,7 @@ vcpkg_not_linux = [
"md4c",
"mman",
"pthread",
+ "sparkle",
]
diff --git a/vcpkg.json b/vcpkg.json
index e669336b0b0..e7edef6b5fe 100644
--- a/vcpkg.json
+++ b/vcpkg.json
@@ -249,6 +249,10 @@
"vulkan"
]
},
+ {
+ "name": "sparkle",
+ "platform": "osx"
+ },
"sqlite3",
{
"name": "tiff",
@@ -429,6 +433,10 @@
"name": "skia",
"version": "148#0"
},
+ {
+ "name": "sparkle",
+ "version": "2.10.1#0"
+ },
{
"name": "sqlite3",
"version": "3.53.4#2"