Skip to content

Commit

Permalink
Merge pull request #33 from lisaychuang/patch-1
Browse files Browse the repository at this point in the history
Updated CONTRIBUTING.md
  • Loading branch information
emhoracek authored Oct 2, 2017
2 parents 1bda477 + 3630eaa commit 3ceac03
Showing 1 changed file with 74 additions and 21 deletions.
95 changes: 74 additions & 21 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ and all of them would mean so much to this project.
* [Contributing code](#contributing-code)
* [Frontend](#frontend-javascripthtmlcss)
* [Backend](#backend-haskell)
* [Running Smooch on your computer](#running-smooch-on-your-computer)
* [Running Smooch on your computer](#run-smooch-on-your-computer)

## Filing an issue

You'll need to try and [get Smooch working on your own computer]() first (for
You'll need to try and [get Smooch working on your own computer](https://github.com/emhoracek/smooch/blob/master/CONTRIBUTING.md#run-smooch-on-your-computer) first (for
now anyway), but one of the easiest ways you can contribute to Smooch is by
trying to load a set and see if it works!

Expand Down Expand Up @@ -80,7 +80,7 @@ Smooch.
* Improve performance
* Move cel and palette parsing into JavaScript from cel2pnm`*`
* Add editing capabilities `*`
* Artists change the layering of cels (raising or lowering in relation to other items)
* Artists can change the layering of cels (raising or lowering in relation to other items)
* Artists can change the offset of a cel in relation its object
* Artists can change which palette a cel uses
* Artists can edit a palette
Expand Down Expand Up @@ -108,36 +108,89 @@ Items maked a `*` will need work on the frontend as well.

## Run Smooch on your computer

If any of this is confusing or doesn't work -- don't hesitate to let me know and
If any of this is confusing or doesn't work -- don't hesitate to let me know by opening an issue @emhoracek and
I'll help you out.

## General Packages

Please make sure you have the following general software installed

| Required | Library | Version Range | Notes |
| ------------- | ------------- | ---| --- |
|| [GCC compiler](https://gcc.gnu.org/) | >= 7.2 | GCC is the compiler for [GNU operating system](http://www.gnu.org/gnu/thegnuproject.html), which includes C, C++, Objective-C, Fortran, Ada, and Go |
|| [stack](https://docs.haskellstack.org/en/stable/README/#the-haskell-tool-stack) | >= 1.5.1 | `stack` is a Haskell dependency management tool |
|| [Netpbm](http://brewformulas.org/Netpbm) | >= 10.73.14 | Netpbm is a toolkit for manipulation of graphic images, including conversion of images between a variety of different formats |
| | [Homebrew](https://brew.sh/) | >= 1.3.4 | Homebrew is the missing package manager for macOS |

### Install `GCC`

You'll need a C compiler to compile the `cel2pnm` program for smooch, let's install the GCC compiler.

* On Mac OSX you can use `Homebrew` to install `gcc`, copy and past this command into your Terminal: `brew install gcc`
* On Windows / Linux or other OS, follow the [GCC installation guide](https://gcc.gnu.org/install/).

![alt text](https://preview.ibb.co/fmhcrG/brew_install.png "Brew install screenshot")

### Install `Netpbm`

This is how the images are converted from the *.pnm format that `cel2pnm` creates into a PNG image that a browser can display.
* On Mac OSX you can use `Homebrew` to install `netpbm`, copy and past this command into your Terminal: `brew install netpbm`
* On Windows / Linux or other OS, follow the [Netpbm installation guide](http://netpbm.sourceforge.net/getting_netpbm.php).


### Install `Homebrew`

Following the [Homebrew install guide here](https://brew.sh/).
* Open your terminal, copy and paste this command into your Terminal:
`/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"`

## Project setup

First, clone this project from Github

```
git clone https://github.com/emhoracek/smooch.git
cd smooch
```
![alt text](https://preview.ibb.co/exRHQb/gitclone.png "Git clone repo")


### Install `cel2pnm`
Now change to the `cel2pnm` directory.

* Now that you are in the top-level folder of this project, change into the `cel2pnm` directory: `cd cel2pnm`
* Compile Smooch's `cel2pnm` program by running this command:

You'll need a C compiler to compile the program.
```
gcc cel2pnm.c -o cel2pnm
```
![alt text](https://preview.ibb.co/npWqdw/compile_smooch.png "Compile cel2pnm program")

* Put `cel2pnm` in your [$PATH](https://askubuntu.com/questions/551990/what-does-path-mean).

On Mac OSX you can use [Homebrew] to install `gcc` with `brew install gcc`
### Install `stack`

Now change to the `cel2pnm` directory. Run `gcc cel2pnm.c -o cel2pnm`. That will
result in the compiled program, `cel2pnm`.
You'll need `stack` to build Smooch. [`stack`](https://github.com/commercialhaskell/stack) is a Haskell dependency management
tool (kinda like `npm` for JavaScript).

Put `cel2pnm` in your PATH.
* Following the `stack` [install guide here](https://docs.haskellstack.org/en/stable/README/#how-to-install)
* Copy and paste this command into your Terminal:

```
curl -sSL https://get.haskellstack.org/ | sh
```

(A really helpful contribution would be to make this section irrelevant by
moving the functionality of `cel2pnm` to JavaScript or Haskell! Or, providing
more documentation of how to compile and install `cel2pnm` on different
platforms.)
![alt text](https://preview.ibb.co/cYhc8w/install_stack.png "Install stack")

### Build Smooch
* Once you have `stack` installed, change to the `app` directory and run `stack setup`.
This will install the correct Haskell version (this will take a while if you don't already have it).

You'll need `stack` to build Smooch. `stack` is a Haskell dependency management
tool (kinda like `npm` for JavaScript). You can learn how to install it for
various platforms in the [`stack` documentation].
![alt text](https://preview.ibb.co/dNNoFb/stack_setup.png "stack setup")

Once you have `stack` installed, change to the `haskell` directory and run
`stack setup`. That will install the correct Haskell version (this will take a
while if you don't already have it).
* Run `stack install rivet-autoimporter`, this is a tool for migrating the database.

Next, run `stack build`. That will compile the Smooch app.
* Finally, run `stack build` which will install project dependencies and compile the Smooch app.
![alt text](https://preview.ibb.co/iC64ow/stack_build.png "stack build")

### Setting up your database

Expand Down

0 comments on commit 3ceac03

Please sign in to comment.