diff --git a/devNotes/sugarcube stuff/building sugarcube.txt b/devNotes/sugarcube stuff/building sugarcube.txt index e0ae54e0f31e705ee007d14e135c77e9411f8c5c..35ef1dac1c18bcc22a852db564c0ddc9ec0080ce 100644 --- a/devNotes/sugarcube stuff/building sugarcube.txt +++ b/devNotes/sugarcube stuff/building sugarcube.txt @@ -1,14 +1,10 @@ -This brief how-to guides through patching and building sugarcube (https://bitbucket.org/tmedwards/sugarcube) -for the Free Cities. Sugarcube sources can be obtained locally either by cloning its Mercurial -repository or downloading source archive from bitbucket (https://bitbucket.org/tmedwards/sugarcube/downloads/). +This brief how-to guides through patching and building sugarcube (https://github.com/tmedwards/sugarcube-2) +for the Free Cities. Sugarcube sources can be obtained locally by cloning its Git repository. Prerequisites (listed NOT in the installation order, please read the list to the end first): 1. Node.js with npm (https://nodejs.org). -2. Mercurial (https://www.mercurial-scm.org/) if you want to clone the sugarcube repository (so it is -optional). Please note that when downloading Windows version, the Mercurial web site lists source -download first (and linked it to the main page), while we need binaries. -3. To build some packages, Node.js requires python and a C/C++ compiler. On Windows you may want to +2. To build some packages, Node.js requires python and a C/C++ compiler. On Windows you may want to install Visual Studio (or just the build tools) and Python 2.7 first. As of now, SugarCube does not depend on any of such packages. @@ -16,20 +12,9 @@ Windows: please choose to make the tools accessible from anywhere by allowing in the PATH environment variable. Retrieving SugarCube sources and preparing build environment for it. -1a. If you opted to use Mercurial, open a terminal window where you want to clone the repository, and -run the following command: - hg clone https://bitbucket.org/tmedwards/sugarcube +1. Open a terminal window where you want to clone the repository, and run the following command: + git clone https://github.com/tmedwards/sugarcube-2.git Change working directory into the cloned repository. -Now choose the branch. Let's suppose we want the latest officially released version 2. The branch name -is "v2-release" then: - hg checkout v2-release -Please note that branch switching in Mercurial requires a clean local tree (without modifications). -To achieve that, run: - hg update --clean - -1b. If you decided not to use Mercurial, you can download a snapshot of a branch or a tag from the -"Downloads" tab of the bitbucket repository page. Unpack it and open a terminal in the directory -with the source files. 2. The last step we need is downloading required JavaScript libraries that are used during the build. Run the node package manager (npm) in the repository: @@ -40,28 +25,25 @@ commit to commit and it differs between branches! Make sure to install correct d Patching and building SugarCube. -3a. If you opted to use Mercurial, use it to apply the patch: - hg patch --no-commit <full path to sugarcube-fc-changes.patch> - -3b. If you do not use Mercurial: - patch -p1 < <full path to sugarcube-fc-changes.patch> +3. Apply the patch: + git apply <full path to sugarcube-fc-changes.patch> Building Run the build.js script. If you use Git bash, you can run the build.js file directly, otherwise run it as "node build.js". See "build.js -h" for options, but reasonable sets are the following. For release version: - ./build.js -b 2 + node ./build.js -b 2 and for the debug version: - ./build.js -b 2 -u -d + node ./build.js -b 2 -u -d Find result files in the dist directory. APPENDIX Lists required steps very briefly. -1. Clone Sugarcube repo: hg clone https://bitbucket.org/tmedwards/sugarcube +1. Clone Sugarcube repo: git clone https://github.com/tmedwards/sugarcube-2.git 2. Change active directory into the directory of the sugarcube clone. -3. Set active branch to "v2-release": hg checkout v2-release +3. Set active branch to "master": git checkout master 4. Run npm install in the repo dir. CAUTION: Requited dependencies change during the project lifetime and vary from branch to branch; @@ -71,9 +53,9 @@ case of strange build errors. The next is done in the directory where SC repo was cloned. Loop over required SugarCube versions: -1. hg update --clean to clean any local changes -2. hg checkout v2.28.2 (any tag or head here, of course) -3. hg patch --no-commit ~/games/fc-pregmod/devNotes/sugarcube\ stuff/sugarcube-fc-changes.patch +1. git reset --hard to clean any local changes +2. (Optionally) git checkout v2.30.1 (any tag or head here, of course) +3. git apply ~/games/fc-pregmod/devNotes/sugarcube\ stuff/sugarcube-fc-changes.patch 4. node build.js -b 2 to build release version 5. cp dist/twine2/sugarcube-2/format.js <whenever you want> 6. node build.js -b 2 -u -d to build debug version