Skip to content
Snippets Groups Projects
Commit ee7fd634 authored by Arkerthan's avatar Arkerthan
Browse files

update building SC

parent 7b62c64f
No related branches found
No related tags found
No related merge requests found
This brief how-to guides through patching and building sugarcube (https://bitbucket.org/tmedwards/sugarcube) 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 either by cloning its Mercurial for the Free Cities. Sugarcube sources can be obtained locally by cloning its Git repository.
repository or downloading source archive from bitbucket (https://bitbucket.org/tmedwards/sugarcube/downloads/).
Prerequisites (listed NOT in the installation order, please read the list to the end first): Prerequisites (listed NOT in the installation order, please read the list to the end first):
1. Node.js with npm (https://nodejs.org). 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 2. To build some packages, Node.js requires python and a C/C++ compiler. On Windows you may want to
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
install Visual Studio (or just the build tools) and Python 2.7 first. As of now, SugarCube does not 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. depend on any of such packages.
...@@ -16,20 +12,9 @@ Windows: please choose to make the tools accessible from anywhere by allowing in ...@@ -16,20 +12,9 @@ Windows: please choose to make the tools accessible from anywhere by allowing in
the PATH environment variable. the PATH environment variable.
Retrieving SugarCube sources and preparing build environment for it. 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 1. Open a terminal window where you want to clone the repository, and run the following command:
run the following command: git clone https://github.com/tmedwards/sugarcube-2.git
hg clone https://bitbucket.org/tmedwards/sugarcube
Change working directory into the cloned repository. 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. 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: 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 ...@@ -40,28 +25,25 @@ commit to commit and it differs between branches! Make sure to install correct d
Patching and building SugarCube. Patching and building SugarCube.
3a. If you opted to use Mercurial, use it to apply the patch: 3. Apply the patch:
hg patch --no-commit <full path to sugarcube-fc-changes.patch> git apply <full path to sugarcube-fc-changes.patch>
3b. If you do not use Mercurial:
patch -p1 < <full path to sugarcube-fc-changes.patch>
Building Building
Run the build.js script. If you use Git bash, you can run the build.js file directly, otherwise run 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. it as "node build.js". See "build.js -h" for options, but reasonable sets are the following.
For release version: For release version:
./build.js -b 2 node ./build.js -b 2
and for the debug version: 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. Find result files in the dist directory.
APPENDIX Lists required steps very briefly. 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. 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. 4. Run npm install in the repo dir.
CAUTION: Requited dependencies change during the project lifetime and vary from branch to branch; CAUTION: Requited dependencies change during the project lifetime and vary from branch to branch;
...@@ -71,9 +53,9 @@ case of strange build errors. ...@@ -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: 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 1. git reset --hard to clean any local changes
2. hg checkout v2.28.2 (any tag or head here, of course) 2. (Optionally) git checkout v2.30.1 (any tag or head here, of course)
3. hg patch --no-commit ~/games/fc-pregmod/devNotes/sugarcube\ stuff/sugarcube-fc-changes.patch 3. git apply ~/games/fc-pregmod/devNotes/sugarcube\ stuff/sugarcube-fc-changes.patch
4. node build.js -b 2 to build release version 4. node build.js -b 2 to build release version
5. cp dist/twine2/sugarcube-2/format.js <whenever you want> 5. cp dist/twine2/sugarcube-2/format.js <whenever you want>
6. node build.js -b 2 -u -d to build debug version 6. node build.js -b 2 -u -d to build debug version
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment