- Fork the project on github. You will need a github account.
- Set the GOPATH environment variable to something like ~/hacking or ~/fun or like I do ~/work (though I must say my work is full of fun hacking :-). You can set it directly with export GOPATH=~/hacking but I would recommend to add it to your ~/.profile file. Note that it will only be used on the next login so you can also set it directly or source the ~/.profile file with . ~/.profile after you've made the change.
- Set PATH to include $GOPATH/bin -- you will need this to run some of the programs you build and install (export PATH=$PATH:$GOPATH/bin) -- also make this persistent as described above
- Create $GOPATH/src/snapcore (mkdir -p $GOPATH/src/github.com/snapcore) and enter that directory (cd $GOPATH/src/github.com/snapcore)
- Clone your fork here (git clone firstname.lastname@example.org:zyga/snapd -- do replace zyga with your github account name)
- Add the upstream repository as a remote (git remote add upstream email@example.com:snapcore/snapd) - you will use this later to get latest changes from everyone
- Run the ./get-deps.sh script. You will probably need a few extra things (sudo apt-get install golang-go bzr)
- You are now good to go :-)
At this stage you can go build and go test individual packages. I would also advise you to have a look at my devtools repository where I've prepared useful scripts for various tasks. One thing you may want to use is the refresh-bits script. Having followed steps 1 through 8 above, let's use refresh-bits to run our locally built version of snapd and snap.
- Clone devtools to anywhere you want (git clone firstname.lastname@example.org:zyga/devtools) and enter the cloned repository (cd devtools)
- Assuming your GOPATH is still set, run ./refresh-bits snap snapd setup run-snapd restore
- Look at what is printed on screen, at some point you will notice that locally started snapd is running (you can always stop it by pressing ctrl+c) along with instructions on how to run your locally built snap executable to talk to it
- In another terminal, in the same directory, run sudo ./snap.amd64 --version
If you have any questions about that, please use the comments section below. Thanks!