Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Homebrew formula #19

Closed
jspahrsummers opened this issue Oct 11, 2014 · 27 comments
Closed

Homebrew formula #19

jspahrsummers opened this issue Oct 11, 2014 · 27 comments

Comments

@jspahrsummers
Copy link
Member

Write and submit a formula to Homebrew, for even easier installation.

Depends on #18.

@jspahrsummers
Copy link
Member Author

From Homebrew's Acceptable Formulae guide:

We frown on authors submitting their own work unless it is very popular.

We probably can't take action here.

@swizzlr
Copy link
Contributor

swizzlr commented Nov 18, 2014

@jspahrsummers pkg installer is cool but if it's effort you could just make a tap, so it would be:

brew tap Carthage/Carthage-Tap
brew install carthage

@jspahrsummers
Copy link
Member Author

Taps are a lot more work to maintain, from what I understand of them. It'll just suffice to let a third party provide a formula eventually.

@gfontenot
Copy link

IMO, it's actually harder to maintain an official formula than a tap. We manage our own tap at thoughtbot/homebrew-formulae and it's worked really well for us. It lets us ship on our own schedule without having to wait for the Homebrew folks accepting PRs. I don't see the added brew tap command as a barrier wrt overhead.

@keith
Copy link
Contributor

keith commented Nov 19, 2014

I agree that dealing with the official homebrew formula process seems like a pain. I'm glad to submit a formula to the official repo if that's the route @jspahrsummers would prefer to go though.

@jspahrsummers
Copy link
Member Author

As it stands right now, I'm very happy with our OS X Installer packages on this repo (via GitHub Releases).

I think an official Homebrew formula could be awesome for discoverability and getting started, but I'm not sure who we'd be reaching with a custom tap. Would the benefit be the ability to build from source?

@gfontenot
Copy link

Speaking personally, I'm lazy and using my mouse seems like a lot of work. 🚎

Arguably: updating would be easier, since it would be managed by Homebrew. So unless you want to integrate Sparkle or something, users would need to come back here, download a new package, install it, vs brew update && brew upgrade carthage

I guess you could say that building HEAD might be useful for pre-release, but even then that's not a huge deal for me. It's just the way I prefer to manage things.

@keith
Copy link
Contributor

keith commented Nov 19, 2014

Right now this is actually an issue as well. What we would ideally do is download the tar.gz from the releases. When doing that since we don't actually get the git repo included with that we cannot initialize and clone the submodules. Therefore we cannot build it locally. This may change if the dependencies end up being managed differently but without this the formula would have to be a HEAD only solution which isn't ideal.

@jspahrsummers
Copy link
Member Author

@Keithbsmiley Doesn't Homebrew support “bottled” releases? The pkg installer is probably not helpful in that regard, but we could add other types of binaries for a formula if it would be helpful.

@keith
Copy link
Contributor

keith commented Nov 19, 2014

Yep that could definitely be done. This along with /usr/sbin/installer could be all we'd need.

@keith
Copy link
Contributor

keith commented Nov 19, 2014

Actually I take that back. It looks like you need admin privileges to install packages from the command line like that. Which is against homebrew rules.

@jspahrsummers
Copy link
Member Author

But you don't need the same admin privileges to install frameworks if they're built from source?

@keith
Copy link
Contributor

keith commented Nov 19, 2014

Good point. I hadn't gotten that far since make install isn't installing for me locally.

@mxcl
Copy link
Contributor

mxcl commented Nov 19, 2014

We frown on authors submitting their own work unless it is very popular.

I'll merge it for you, this statement was introduced to dissuade people from submitting toy-projects.

@jspahrsummers
Copy link
Member Author

@mxcl Ah, awesome! ✨

I'm still not sure what to do about our need to install CarthageKit.framework to /Library/Frameworks, but there are definitely formulas that do this (python?), so we could look at them.

@keith
Copy link
Contributor

keith commented Nov 19, 2014

It looks like formulas, including python's, place the framework in $(brew --prefix)/Frameworks

@mxcl
Copy link
Contributor

mxcl commented Nov 19, 2014

Formula that must do this advise it in the caveats.

Though I agree the limitation is just a PITA nowadays. If I were to do brew again, I'd rethink this.

Is it possible to add framework search paths to the carthage script after the #!? As if so, you can (in the formula) generate a stub script and place it in bin that includes the full path to the installed framework.

@jspahrsummers
Copy link
Member Author

@mxcl The problem is that carthage needs to be able to find the framework at runtime. 😕

We could perhaps add the default Homebrew location to the Runpath Search Paths, though.

@mxcl
Copy link
Contributor

mxcl commented Nov 19, 2014

Often we generate stub scripts during installation that force the tool to add an additional path (to whatever is required) before invoking the unmodified distributed tool.

@gfontenot
Copy link

I did play around with using a thin script executable with a custom shebang that added a search path at runtime: https://github.com/gfontenot/swiftoff/blob/master/bin/swiftoff

There might be some speed issues there. I didn't investigate too much.

@jspahrsummers
Copy link
Member Author

Ah, I see what you mean now. A stub sounds great.

@keith
Copy link
Contributor

keith commented Nov 19, 2014

Here's a starting point for the formula. Right now this doesn't work because of issues mentioned above:

require 'formula'

class Xcode62 < Requirement
  fatal true
  satisfy { MacOS::Xcode.version >= "6.2" }
end

class Carthage < Formula
  homepage 'https://github.com/Carthage/Carthage'
  head 'https://github.com/Carthage/Carthage.git'
  url 'https://github.com/Carthage/Carthage/archive/0.2.tar.gz'
  sha1 '6f28a3d821b8ad4d396779dad5239441a5996602'
  version '0.2'

  depends_on Xcode62
  depends_on 'git'
  depends_on 'xctool'

  def install
    system "make install"
  end

  test do
    system "carthage help"
  end
end

@RSully
Copy link

RSully commented Nov 21, 2014

[...] but I'm not sure who we'd be reaching with a custom tap. Would the benefit be the ability to build from source?

I agree with @gfontenot.

Personally, I would install this without thinking twice if it were in homebrew. It gives me a sense of safety knowing exactly what the installation is doing (.rb) and easily being able to remove it with one command (without worrying about package receipts or leftovers). A .pkg feels like too much of a blackbox - yeah I know: Carthage is open source, but it still just feels weird installing like that. /2¢

@robrix
Copy link
Contributor

robrix commented Nov 21, 2014

A .pkg feels like too much of a blackbox

Agreed.

@jspahrsummers
Copy link
Member Author

@RSully @robrix There is currently no opposition to doing it—we just need someone to submit a PR. 😉

@robrix
Copy link
Contributor

robrix commented Dec 4, 2014

@jspahrsummers
Copy link
Member Author

This was done. ✨

natanrolnik pushed a commit to natanrolnik/Carthage that referenced this issue Feb 2, 2017
Move testing dependencies to private Cartfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants