Adding a command-line tool in Mountain Lion - osx-mountain-lion

I'm trying to install astyle, and i was wondering how i would add this into the toolchain? I would like to access this tool in the same way we use 'ls', 'vim', 'git', etc.
I've been searching google, however I can't find anything referring to the subject.

Related

Why do I have to use 'arch -arm64' before brew terminal commands on m1?

I am literally fighting for my life to get this machine setup for react native development. There have been crazy amount of problems and brew install do not work without arch -arm64. Is this a problem? Why is this?
PS: I am new to mac OS
Its just a question for knowledge
I encourage you to take a look at this repo, mac-dev-setup. All the formulae are pretty well maintained in the homebrew-core.
If you have further doubt, you can also raise in the discussions to get quicker response.

How to install Haskell on Mac

I am trying to install Haskell on Mac, and doing it as instructed on Haskell site Haskell site.
When I run the script from above website on terminal, it says to install "ghcup", "ghc" and "cabal". However, it seems that it installs "ghcup" successfully, but an error occurs when it comes to install "ghc".
Error: ghc: unknown version :lion
how can I fix this? or, is there another way to install Haskell on Mac?
(I saw similar posts but they are too old)
You seem to be running macOS Lion, which is ancient, insecure, and no longer supported by Apple. As such, most modern software isn't tested for compatibility with it anymore, and a lot of it won't work. Upgrading to a modern version of macOS such as Catalina will make it work.
There are different options to get a working Haskell development environment on your Mac. The most popular seem to be
Haskell Platform
Install via homebrew
The Haskell Tool Stack
Of course, you can also install most tools individually by hand or compile everything from source.
Together with the type of installation, you need to choose how to build your projects: Using Cabal or Stack.
My personal preferences as a beginner is Stack, because (a) the entire Haskell tool stack is installed locally for each project, so you don't get into problems with conflicting versions of certain tools; (b) dependencies are curated, such that you do not need to deal with incompatible versions of libraries. From a beginner's perspective, it is very helpful that I can focus on actual development work and less on infrastructure and tooling.

Create a ruby script installer for Linux OS

I wrote an application using ruby and I want to create an installer for that. I'm using Linux as OS.
I know there's the ruby script setup.rb written by Minero Aoki, but It's a bit harsh to understand by reading the source code and I'd like to write my own setup.rb. This is my final objective.
This is the first time that I try to write an installer and I don't know how to start. I carried out some research on Google but I can't find what I'm really looking for.
Can anyone suggest me any books or manual where I can learn to put the files on the right place (or whatever the installers do on Linux OS)? To put it better I would like to learn the basics of "how to install source code" in Linux systems and then apply the theory to try to install my ruby scripts.
Any suggestion is accepted.
Why don't you write a gem for it ? This is the best packaging system we know for ruby and you can just distribute a .gem file that can be installed with a simple gem command.
Check http://guides.rubygems.org/make-your-own-gem

How can I create debian package (*.deb) from ruby application written with qt4?

I found a lot of tutorials how to build application with Ruby and Qt, but i have no idea how anybody else will be able to run it! I am using Ubuntu 11.10, ruby 1.9.2 with rvm and:
rbqtapi -v output "QtRuby 2.0.5 using Qt-4.7.4"
P.S. I have no idea how to build *.deb, it will be my first desktop app, not web.
please have a look on http://shoesrb.com/ this is the best way I heard off for writing GUI apps.
Shoes has now not it's greatest time, but we put our best time to make it better, give it a try and someone will help you.
In case you are in need of assistance just ask as question on #shoes IRC channel on freenode servers.
If you're sold on QT, then you will need your users to install all the support libraries for QT (and anything else), then you can upload a rubygem to rubygems.org for your users to download.
Once, they've installed the support libraries, you'd only need to update your rubygem, which is fairly quick and easy for updates.
You may also wan to look at visualruby. It uses GTK. Then you'd install the GTK libraries instead of the QT ones.
http://www.visualruby.net
As far as .deb packages go, I tried to research the same thing with little success. The rubygems packaging system is designed to distribute ruby programs, so it is the best way to go. Also, you'll need to install different support libraries for different platforms. If you look at visualruby's install page, you can see how to install GTK for Linux and Windows.
Good Luck.

Is there a way to install gcc in OSX without installing Xcode?

I've googled the hell out of it, and it seems like there is no way to install gcc on OS X without installing Xcode (which takes at leats 1.5GB of space). All I need is gcc and none of the other junk that comes with Xcode. And at this point, I'll take any other kind of C compiler.
I know I could simply install Xcode, but that is beside the point since I neither have my original installation disc nor a quick internet connection.
So... does anyone have any suggestions?
EDIT: Sorry if I was unclear, but I need the headers as well. I'm currently installing gcc4 via fink and it's downloading the shared libraries as well. I'll update on the progress.
EDIT 2: Ok, so I successfully installed gcc using fink. BUT, it's pretty much useless: "error: C compiler cannot create executables". After googling around, I found that not having Apple's Developer Tools installed is the cause of the error. Probably because I need all the libraries, headers, etc that are only available through Xcode.
Checkout command line tools for Xcode from apple. It's official support from apple to only create the command line tools.
Try the osx-gcc-installer on github.
I've been doing this for a long time, and I've done things like this, and I've concluded it's simply never worth doing. :-(
The reason is that no one expects you to do such things, so there are assumptions all over the system that "everything" is there. You might not run into this today - or worse, you might not even realize later that this is the cause of your issues.
Instead of wasting your smart time on things like this which don't actually produce any working code you can use, following the approved method, run the download overnight, and spend your time instead on planning and writing the top-level code (you shouldn't need a compiler for that anyway!)
I'm fairly certain that this is not possible. However, I'm also not sure if you need the whole developer suite to get the developer tools installed. Quite a few tools get installed along with XCode that might be optional. However, I think you're out of luck for not needing to bite the bullet and use wget or DownThemAll or some other download manager that will let you slowly download the developer tools in chunks.
Whenever I install OS X I install the developer tools as a rule, just because it opens up the world of available software tremendously. Perhaps you should consider doing this in the future as well.
The first thing you want to try is called Pacifist - what Pacifist lets you do is to open a large package (such as XCode) and to access parts of it directly. I'm pretty sure you'll be able to find a smaller package inside the XCode package that just has gcc.
HOWEVER it's not clear to me that this is the best route. If you are planning to do Cocoa or Carbon developing I strongly suggest installing the entire package because you will need all the documentation and headers. If you're only planning on doing command-line stuff, you still may find you need to poke around inside XCode to identify all the packages you will need - things such as libraries, headers, man pages and so on.
All in all you're probably still better off installing the whole thing - if HD space is really tight (because you're on a tiny old iMac for example) then look at tools like Monolingual - Monolingual removes all the international support from all the various OS X applications, which can easily reduce the size of an application by 50%.
There's fink and MacPorts, if you want an easy installer/updater.
Install the GCC package from the Packages directory in Xcode's disk image and you'll have just GCC. Note that of course you won't have autotools or other standard build tools, for which you will have to install more packages from that folder.
I found this googling around that appears to install it without XCode.
install Command Line Tool separately.
refer to
http://osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x
http://osxdaily.com/2012/07/06/install-gcc-without-xcode-in-mac-os-x/
yes i could do it with port but you need at least to accept the code license.

Resources