hsxkpasswd icon indicating copy to clipboard operation
hsxkpasswd copied to clipboard

Consider creating a Homebrew formula

Open PlotCitizen opened this issue 9 years ago • 7 comments

I use Homebrew exclusively for installing any CLI applications, but aside from the few simple commands I know, getting under the hood and creating the formula myself seems a bit tricky to me.

Being the lead developer, it would be very convenient if you created a formula for HSXKPasswd yourself in order to avoid any errors a formula created by somebody else in the future would have, as well as to help expose HSXKPasswd to more people who may find it useful.

Thanks :blush:

PlotCitizen avatar Aug 12 '15 01:08 PlotCitizen

I'd be happy to take a stab at this.

dburr avatar Aug 12 '15 01:08 dburr

I believe that cpan is installed in /usr/bin/cpan by default on OSX, and so the installation method of using "sudo cpan Crypt::HSXKPasswd" should work.

No?

bknowles avatar Aug 12 '15 04:08 bknowles

@bknowles I haven't tried, but it definitely should work, as you said. However I am a bit cautious to start using CPAN or any other package manager (especially one confined to programs of a specific language, like, in this case, Perl) because that only adds complexity to my existing build, and speaking from past experience will probably be forgotten in a few weeks and linger on my system. That's the reason I would like to see it added to Homebrew, even though I also have no problem compiling and/or running the program as it is currently distributed.

PlotCitizen avatar Aug 12 '15 06:08 PlotCitizen

I just installed hsxkpasswd using cpan on Yosemite 10.10.4, and it worked fine. Just take the defaults, and you're good to go.

However, I can see the desire to take that and make it even more fully automated by creating a Homebrew formula to make that process completely invisible to the user.

bknowles avatar Aug 12 '15 06:08 bknowles

I'm not sure Homebrew is a good fit here. The terminal command is in fact a Perl script, so you really do need a working Perl environment to run it.

If you like the homebrew mentality of installing stuff into your home dir and leaving the system un-changed, then I would suggest using perlbrew to install the module. This is how I test the module on different versions of Perl.

You can get perlbrew here: http://perlbrew.pl

Once perlbrew is installed, you need to install at least one version of perl, you can see all available versions with: perlbrew available

The latest stable version is 5.22, so I would suggest installing that perl with: perlbrew install perl-5.22.0 (HSXKPasswd works in all versions from 5.16.0 up).

Once you have a perl installed, you need to start using it with a command like perlbrew switch perl-5.22.0

Next you need to enable perlbrew's CPAN client: perlbrew install-cpanm

Finally, use perlbrew's CPAN client to install the module: cpanm Crypt::HSXKPasswd

If someone else wants to do a homebrew recipe, go ahead, but it's not something I feel comfortable providing at the moment, I simply don't have enough homebrew experience.

bbusschots avatar Aug 12 '15 21:08 bbusschots

I just installed hsxkpasswd using cpan on Yosemite 10.10.4, and it worked fine.

Does that also install the "hsxkpasswd" terminal command? If so, where is it?

I think it's quite confusing, would be nice if the steps needed to install and run the terminal command on OS X would be documented somewhere (for normal users, without all kind of kung fu like perlbrew).

notDavid avatar Nov 29 '15 18:11 notDavid

Ignore my comment, the problem was caused by a permission problem on my system. sudo cpan Crypt::HSXKPasswd works indeed, the script is installed in /usr/local/bin/hsxkpasswd

notDavid avatar Nov 29 '15 19:11 notDavid