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

added brew #55

Closed
wants to merge 1 commit into from
Closed

added brew #55

wants to merge 1 commit into from

Conversation

RnbWd
Copy link

@RnbWd RnbWd commented Apr 2, 2016

This is my first attempt at making a brew - I just followed the instructions from their cookbook - https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Formula-Cookbook.md

brew create https://github.com/hypriot/flash/archive/0.2.0.tar.gz

that creates the formula - what I submitted works.. I literally have no idea what I'm doing.... but on my local machine typing brew install flash installs the library :)

edit: i did not submit a pull request to home-brew for this - just local

@RnbWd
Copy link
Author

RnbWd commented Apr 2, 2016

Also this file technically would go into home-brew's repo. I just submitted the pull request to pass along a working formula instead of just asking someone to make one.

@fxstein
Copy link
Contributor

fxstein commented Apr 2, 2016

Awesome! I was just thinking about that. Are you creating a pull request for HomeBrew? Do you need help doing so? The name might have to change to something like hypriot-flash to make sure it does not conflict with other scripts or tools out here.

@StefanScherer
Copy link
Member

@RnbWd This is awesome! Thank you for making this happen.

I think we have to update the flash script to show the version number and prepare a new release as the 0.2.0 is a little outdated.

@RnbWd
Copy link
Author

RnbWd commented Apr 3, 2016

This was my first time trying to create a brew :)
There's an option to put the script on '--head' for latest, but I'm not sure how to pull the latest build because the API looks for a tar. I think they accept pull requests so it shouldn't matter who pushes it, but there's an option for tests that I skipped (I copied a random template from their Formulas).

There's no formula named 'flash', so the name's open. I think I've been using this since the first hypriot release, I just wanted to brew it - but I think it makes more sense for y'all to submit it.

url "https://github.com/hypriot/flash/archive/0.2.0.tar.gz"
sha256 "4a5af238c22f0792594b5f0e9520e9e62e18ab1d4be6f94e83b41128a417e770"
depends_on "pv"
depends_on "awscli"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if we should add this hard dependency to awscli. Nobody but the Hypriot team needs this ;-) And we are moving that part to GitHub releases as well, so only https is used for downloads.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They have a formula cookbook that explains most of the options, but I think you could write something like:

depends_on "awcli" => :optional // or :recommended

@StefanScherer
Copy link
Member

When we start to package the script we should use version numbers for both the flash script, download the right version in the brew etc.
I think of adding a travis/circle yml for a build and release step that could create the brew (haven't looked at what steps are needed for that).

@RnbWd
Copy link
Author

RnbWd commented Apr 4, 2016

I could write an npm script really easily - it's much simpler than homebrew, easier to maintain and publish.

npm install -g hypriot-flash

it'll symlink flash in the cli path, I can also point to the head of this directory. I'm much better with node. It won't link the other libraries though, basically just automates these commands:

wget https://raw.githubusercontent.com/hypriot/flash/master/$(uname -s)/flash
chmod +x flash
sudo mv flash /usr/local/bin/flash

it'll also work on linux / OS X equally -

@StefanScherer
Copy link
Member

@RnbWd Thanks for the suggestion, but using a npm package leads into a wrong direction. Not everybody has Node.js installed. Installing a bash script should not depend on other frameworks than a package manager itself.

So brew on Mac should be the right way.

There is another http://www.bpkg.io, but not very popular, I've just googled it. 😃

@RnbWd
Copy link
Author

RnbWd commented Apr 5, 2016

I totally agree - and I don't expect the npm-module to be the a main source for downloading flash - brew is definitely the way to go (which is why I started this pull request). But I don't know much about brew so I'm not sure I help much more on that front...

but I can publish an npm package cli-script for flash in 15 minutes using the bin-wrapper module. I've contributed to electron-prebuilt so I'm fairly component with how the process works, I've published 4-5 of these modules on npm already.Everything is basically automated on my part, so it'd be fairly trivial to do - just wanted feedback :)

node's path module isn't working on my computer for some reason - node 6.0.0 is about to be released so i'll wait for that before trying anymore

@RnbWd
Copy link
Author

RnbWd commented Apr 7, 2016

I was browsing through FB's repo and I noticed they have a homebrew-tap - then I realized it would make more sense to just create a hypriot tap for homebrew . There are so many libraries in this org can be hosted via brew - and taps are technically independent of homebrew, any github repo can become a tap. It makes sense, and I'd volunteer creating a seed tap repo as a proof of concept. I really like the repos here and use them all the time, so with all the change each month, it's nice to just brew upgrade sometimes :)

@RnbWd
Copy link
Author

RnbWd commented Jun 9, 2016

I hate home-brew I just wrote an npm script that works for linux and OS X - i'm going to take namespace while it's available - but I give you 100% credit. It links directly to this repo - it will always install the lastest version and is uses the global npm space to link the flash as a global method, npm install -g rpi-flash - but the method will be invoked with the name flash locally, not rbi-flash which is just used for downloading the file

@RnbWd RnbWd closed this Jun 9, 2016
@StefanScherer
Copy link
Member

@RnbWd That's awesome!

Maybe after we have implemented #60 you may use the version number in your package.json to download the exact released version.

@RnbWd
Copy link
Author

RnbWd commented Jun 10, 2016

The npm library will link to these urls:

https://raw.githubusercontent.com/hypriot/flash/master/Linux/flash

https://raw.githubusercontent.com/hypriot/flash/master/Darwin/flash

So (for now) it'll download the latest file from master. with home-brew it's possible to declare wget as a dependency, but npm is simple / cross-platform. I'm basically copying what I wrote for nut, which was a similar situation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants