Macvim: Disable Sparkle auto-update in Homebrew builds

Created on 7 Feb 2019  路  10Comments  路  Source: macvim-dev/macvim

MacVim is available as a Homebrew formula. In general Homebrew needs to manage updating itself, so the Sparkle updater should be disabled in those cases. While the user can manually disable the updater, it's much better for this to be default as there's basically no good reason to do auto-update in a Homebrew-managed build.

This can be done by exposing build parameters that Homebrew can call in the formula.

Updater

Most helpful comment

@lilyball Ah ok right. I have heard of xcbuild before. If you get it to work I think it could be worth merging it to MacVim as a configure option so people can choose either xcodebuild or xcbuild when they configure the project.

All 10 comments

If this would be done, the same change could be propagaded to MacPorts which just strips out Sparkle from source. The same procedure is done for almost all software included as well.

Nevertheless, a switch to exclude Sparkle will be a better solution, and I hope other applications will use the same.

Yes that's the plan. We just need a generic way to disable Sparkle updater when building/configuring MacVim that MacPorts and Homebrew can both use.

The same procedure is done for almost all software included as well.

Do you mean other software packaged via MacPorts? Do you have any examples just for reference?

There's a link to a patch for HandBrake to disable Sparkle. It's pretty common to search for such strings to exclude (as Sparkle itself is common)

https://github.com/macports/macports-ports/blob/master/multimedia/HandBrake/files/0009-MP-MacGui-Disable-Sparkle.patch

I see. Thanks for the info. Seems like they actually have quite a few patches! It will be good to remove the reliance on custom patches though and use compile flags if possible.

I would really love to see a build-time option for this as well. I maintain the Nix package for MacVim and it currently has to include a patch to strip out Sparkle, as well as invoking ibtool to recompile the nibs, and I'd really love to get rid of that (especially the reliance on ibtool as it's the biggest issue I know of preventing me from even investigating breaking our reliance on the user having Xcode installed).

@lilyball I just made a pull-request (#982) to support disabling Sparkle. You can just modify your build scripts to call ./configure --disable-sparkle and then just build normally and Sparkle will be disabled by MacVim. One caveat is that in the build phase, Sparkle.framework will still be copied over to the built MacVim.app, because I couldn't find an easy way to disable the copy build phase conditionally, and I didn't want to set up a whole new build target just for this. I did test that if you configure MacVim to have Sparkle disabled, you could manually remove the framework (rm -rf src/MacVim/build/Release/MacVim.app/Contents/Frameworks/Sparkle.framework) and MacVim will still work, because it won't call any Sparkle related functionality at all. If you don't want to bundle Sparkle's framework, you could just do that.

I'll merge the PR in a bit, but just letting it sit a little bit first.

especially the reliance on ibtool as it's the biggest issue I know of preventing me from even investigating breaking our reliance on the user having Xcode installed

@lilyball Sorry I'm not too familiar with Nix, but out of curiosity, how would you not have a dependency on Xcode? If you are asking your users to build MacVim on their machines, currently you have to use xcodebuild to do so as MacVim's project is managed by Xcode instead of a third-party build system.

@ychin Facebook maintains xcbuild, an Xcode-compatible build tool. It doesn't work for everything but it's something I want to investigate using once I no longer need to invoke ibtool.

@lilyball Ah ok right. I have heard of xcbuild before. If you get it to work I think it could be worth merging it to MacVim as a configure option so people can choose either xcodebuild or xcbuild when they configure the project.

Was this page helpful?
0 / 5 - 0 ratings