[vlc-devel] [vlc-commits] macosx/sparkle: set feed URL based on architecture and add debug
David Fuhrmann
david.fuhrmann at gmail.com
Mon Dec 7 11:18:06 CET 2020
> Am 07.12.2020 um 07:01 schrieb Felix Paul Kühne <git at videolan.org>:
>
> vlc/vlc-3.0 | branch: master | Felix Paul Kühne <felix at feepk.net> | Mon Nov 30 19:12:16 2020 +0100| [4fec28243a48c7a7b6cf1da598297f7274eabf2f] | committer: Felix Paul Kühne
>
> macosx/sparkle: set feed URL based on architecture and add debug
>
>> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=4fec28243a48c7a7b6cf1da598297f7274eabf2f
> ---
>
> modules/gui/macosx/VLCMain.m | 29 ++++++++++++++++++++++++++++-
> share/Info.plist.in | 2 --
> 2 files changed, 28 insertions(+), 3 deletions(-)
>
> diff --git a/modules/gui/macosx/VLCMain.m b/modules/gui/macosx/VLCMain.m
> index 3e08c48da9..ef1f6f7c0e 100644
> --- a/modules/gui/macosx/VLCMain.m
> +++ b/modules/gui/macosx/VLCMain.m
> @@ -1,7 +1,7 @@
> /*****************************************************************************
> * VLCMain.m: MacOS X interface module
> *****************************************************************************
> - * Copyright (C) 2002-2016 VLC authors and VideoLAN
> + * Copyright (C) 2002-2020 VLC authors and VideoLAN
> * $Id$
> *
> * Authors: Derk-Jan Hartman <hartman at videolan.org>
> @@ -385,6 +385,33 @@ static VLCMain *sharedInstance = nil;
>
> return YES;
> }
> +
> +/* use the correct feed depending on the hardware architecture */
> +- (nullable NSString *)feedURLStringForUpdater:(SUUpdater *)updater
> +{
> +#ifdef __x86_64__
> + return @"https://update.videolan.org/vlc/sparkle/vlc-intel64.xml";
> +#elif __arm64__
> + return @"https://update.videolan.org/vlc/sparkle/vlc-arm64.xml";
> +#else
> + #warning unsupported architecture
> +#endif
I would probably make this an error, so we see the compiler bailing out in case.
Additionally to this patch (which seems fine otherwise), shall we also consider auto-updating an intel-version of VLC to the arm version, if it runs in translation mode on an ARM mac?
In this case we might want to add a runtime detection if an application runs in translation mode (like you did with the nag screen patch), and change the URL to the arm version in this case.
> +}
> +
> +- (void)updaterDidNotFindUpdate:(SUUpdater *)updater
> +{
> + msg_Dbg(p_intf, "No update found");
> +}
> +
> +- (void)updater:(SUUpdater *)updater failedToDownloadUpdate:(SUAppcastItem *)item error:(NSError *)error
> +{
> + msg_Warn(p_intf, "Failed to download update with error %li", error.code);
> +}
> +
> +- (void)updater:(SUUpdater *)updater didAbortWithError:(NSError *)error
> +{
> + msg_Err(p_intf, "Updater aborted with error %li", error.code);
> +}
> #endif
>
> #pragma mark -
> diff --git a/share/Info.plist.in b/share/Info.plist.in
> index 0fe1a4682d..711721fdee 100644
> --- a/share/Info.plist.in
> +++ b/share/Info.plist.in
> @@ -1520,8 +1520,6 @@
> <string>VLCApplication</string>
> <key>NSSupportsAutomaticGraphicsSwitching</key>
> <true/>
> - <key>SUFeedURL</key>
> - <string>https://update.videolan.org/vlc/sparkle/vlc-intel64.xml</string>
> <key>SUPublicDSAKeyFile</key>
> <string>dsa_pub.pem</string>
> <key>UTExportedTypeDeclarations</key>
>
> _______________________________________________
> vlc-commits mailing list
> vlc-commits at videolan.org
> https://mailman.videolan.org/listinfo/vlc-commits
More information about the vlc-devel
mailing list