# How to install application from source?



## notooth (Jun 23, 2015)

Hello,

I am trying to install an application from source which is not included in the FreeBSD ports. Can anyone tell me how to do this?


----------



## DutchDaemon (Jun 23, 2015)

Have you already unpacked the source? In that case, look for a README or INSTALL file. Usually you would run `./configure`, followed by `make all install` or variations thereof. Be sure to check where files will be installed, e.g. by inspecting the Makefile. You don't want to install in /usr/bin. Also, make sure you have the actual source, not some unpacked Linux package.


----------



## notooth (Jun 23, 2015)

I think it is the actual source code, but there is no ./configure file in it. Can you take a look at the source at: https://github.com/adobe/brackets/releases


----------



## SirDice (Jun 23, 2015)

Perhaps you should read the documentation? 

https://github.com/adobe/brackets/wiki/How-to-Hack-on-Brackets


----------



## hukadan (Jun 23, 2015)

It is a node project so the way to install it is a bit different. There is a fork that seems easier to use. Here are the steps I followed:

```
# pkg install npm
$ mkdir ~/brackets
$ cd brackets
$ mkdir root data
$ npm install node-ide@1.4.0-1
$ npm install path http
$ cd node_modules
```
Then you create a startbracket file (see project website) with the following lines:

```
var path =require("path"),
http =require("http"),
brackets =require("node-ide/lib/server"),
server = http.createServer(function(req,res){});
var options ={
httpRoot:"/brackets",

projectsDir: path.join(__dirname,"..","root"),
supportDir: path.join(__dirname,"..","data"),
allowUserDomains:false,
};

brackets(server, options);
server.listen(9092);
console.log("You can access Brackets on http://localhost:9092/brackets/")
```
Then you do `node startbracket` and open the link with your browser.

I just did a quick test out of curiosity and I am not sure it works perfectly. It has some limitations: for instance, you cannot create a file (I did not have time to investigate). You can however, as a work around, create an empty file that you can save as new each time you need a new file.

With some tweaking and more time, I am sure you can make it work properly. Let us know in such a case, there are people interested by this project: Thread html-css-editor-brackets.50704.

-- Edited --

I just modified the creation of root and data folders. They should be in ~/brackets. Sorry for that.


----------



## hukadan (Jun 23, 2015)

Reading again my post, I may have forgotten some details. So here are some precisions for the OP. www/node is a platform based on the Chrome's Javascript runtime ideal to build network applications (description stolen from their website!). Usually, Node.js applications are made of different packages. These packages can be found on some repositories over the web (such as https://www.npmjs.com/). A convenient way to manage them is to use www/npm. It is similar to devel/py-pip for Python or devel/ruby-gems for Ruby.

When you read the source code, you can spot Node.js packages by the package.json file they have on the root directory that gives information about the package and its requirements (among other information).

So basically the `npm install node-ide@1.4.0-1` command install the *node-ide* package with a given version (I had to give the version otherwise I got error messages). The startbracket file is just a Node.js script that uses the *node-ide* package. But we also see on top of the script that it requires two other packages : *http* and *path*. It is why we need the second `npm install path http` command. Note that the two commands are executed as normal user.

The root and data folders are needed by the *node-ide* package. Note that you could change these folders by modifying the following two lines.


```
projectsDir: path.join(__dirname,"..","root"),
supportDir: path.join(__dirname,"..","data"),
```
I hope it makes things clearer.


----------



## notooth (Jun 25, 2015)

The script worked fine on web browser, but I cannot create a new file. Maybe I should look for another application.

Thank you all.


----------



## srobert (Jun 25, 2015)

DutchDaemon said:


> Have you already unpacked the source? In that case, look for a README or INSTALL file. Usually you would run `./configure`, followed by `make all install` or variations thereof. Be sure to check where files will be installed, e.g. by inspecting the Makefile. You don't want to install in /usr/bin. Also, make sure you have the actual source, not some unpacked Linux package.


The FreeBSD consistent path can set with the option `./configure --prefix=/usr/local`.
Sometimes, even though the README or INSTALL file calls for `make`, it will really require `gmake`, which can be installed with `pkg install  gmake` or from the port devel/gmake.


----------



## hukadan (Jun 26, 2015)

notooth said:


> Maybe I should look for another application.


In the same look and feel, there is Atom developped by GitHub which is not on the port tree but still provides instruction to install it on FreeBSD.


----------

