Hacker News new | ask | show | jobs
by git-pull 2534 days ago
1. Clone the source

2. Try to build it

3. If there are tests, try to run them

Just from doing this many times over, I learned a lot about programming.

Also fork the repo, then do `git clone <url>` for the original repo, `cd repo`, then do `git remote add yourusername <yourgithubforkurl>`

To ease the above process, I created vcspull: https://vcspull.git-pull.com

Here is an example of my vcspull file: https://github.com/tony/.dot-config/blob/master/.vcspull.yam...

This also helps studying, read code, and also do open source in general since it's easy to setup the original repo and the fork.

For generic open source: Download source, check README.md/rst to see if they are testing/development instructions. Check .travis.yml commands, those are showing what packages/steps are taken to build and probably test the code

If it's node: do `npm install` and check the "scripts" in the package.json. Those commands can be run like "npm run <task>"

If it has CMakeLists.txt, it uses CMake. Download and install cmake, then do `cmake .`. cmake will let you know if you're missing libraries and those are easy to google package names for. Then `make && [sudo] make install`

If it has Makefile.am/autogen.sh... download and install autotools/autoconf/automake. Run `./autogen.sh`, then `./configure` (google for package names of any libraries that show missing headers, .h, or symbols). Then `make && [sudo] make install`

If it is python, and there's a Pipfile, download and install pipenv. Then do `pipenv install .`. If it has requirements.txt, `pip install -r requirements.txt`

Carried foreward, if the project has anything resembling a package manifest (e.g. Gemfile, composer.json) google them to find the appropriate package manager for your OS. That gets you 75%-100% of the way to running locally a lot of the time.

For the more complex projects, they typically have dedicated setup instructions and sometimes very detailed overviews (e.g. https://github.com/OpenTTD/OpenTTD/blob/master/docs/Readme_W..., https://devguide.python.org/setup/, https://www.kernel.org/doc/html/latest/process/index.html)

Reading the source of your favorite interpreted programming language can be rewarded, e.g. https://github.com/python/cpython