Git

From MZXWiki
Revision as of 00:26, 8 July 2013 by Lachesis (talk | contribs) (→‎Setting up a development folder)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Git is a revision control system developed by Linus Torvalds, the creator of Linux. The latest unstable/work-in-progress/between-release MegaZeux source code is kept in a git repository that can be found here.

Windows

Installation

Download Git, which includes a posix-style terminal called msys, and a copy of MinGW32. You do not need to install a copy of msys with MinGW32 because one is already included with Git.

An easier way can be to install msysGit, a version of Git that includes both msys and MinGW32. Git#Setting up msysGit

Once Git is installed, it may be used from the command line by starting msys and typing "git [command]". You will now need to configure Git's copy of msys to be able to use MinGW32. MinGW32's default installation directory is C:\MinGW32\, so to add it to the path variable.

notepad /etc/bash_profile

This will open up notepad and prompt you to create a new file. Copy this into the new file and save it:

PATH = "$PATH:/c/MinGW32/bin"

This will create a file at /etc/bash_profile. Change /c/MinGW32/bin as necessary to point to your MinGW32 binary folder.

Load /etc/bash_profile:

. /etc/bash_profile

Test to make sure the MinGW32 binaries are accessible:

gcc.exe

Setting up a development folder

Make a directory in the msys root called "megazeux" and navigate to it. This is will be your new home folder.

mkdir /megazeux
mkdir /megazeux/src

Download and extract dependencies:

cd /megazeux
wget http://mzx.devzero.co.uk/docs/mingw32.zip
unzip mingw32.zip

Add this to /etc/bash_profile and save:

HOME="/megazeux"
PATH="$PATH:$HOME/bin/mingw32/bin"

Load /etc/bash_profile:

. /etc/bash_profile

Clone the GIT repository into /megazeux/src

git clone https://github.com/[YourRepository]/megazeux.git /megazeux/src

Once you have created a duplicate repository on your machine, you can pull the most recent changes by navigating to the repository folder and running git pull:

cd /megazeux/src
git pull https://github.com/AliceLR/megazeux.git master

Compiling MegaZeux

cd /megazeux/src
./config.sh --platform win[32|64] --prefix $HOME/bin/mingw32
make

Another option to note is --enable-libsdl2, which enables the latest version of SDL. The updated dependencies for using SDL 2.0 can be found in /megazeux/src/scripts/deps/mingw32.zip

Setting up msysGit

An easier way to set up Git than to configure a separate Git and MinGW32 is to download msysGit and install it. It is available here; install packages can be found by searching for "msysgit" on the Downloads page. The latest full install package can be found here.

Before you can build with msysGit, you may have to download a package of the latest mingw32 or mingw64 compilers for the platform you're attempting to build on. For example, make may not be able to find

i686-w64-mingw32-gcc.exe

which means you will have to download the i686-w64-mingw32 compiler package and extract it into /mingw/bin/.

Other utilities will also be found missing if this happens that are not included in the compiler package. The errors during building should be helpful enough to inform you of what you need to copy, for example:

cp /mingw/bin/windres.exe /mingw/bin/i686-w64-mingw32-windres.exe

Mac OS X

TBA

Linux

Installation

sudo apt-get install git

Setting up a development folder

mkdir ~/mzxdev
cd ~/mzxdev
git clone git@github.com/[YourRepository]/megazeux.git .