Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fc-pregmod
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
macaronideath
fc-pregmod
Commits
ee7fd634
Commit
ee7fd634
authored
5 years ago
by
Arkerthan
Browse files
Options
Downloads
Patches
Plain Diff
update building SC
parent
7b62c64f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
devNotes/sugarcube stuff/building sugarcube.txt
+14
-32
14 additions, 32 deletions
devNotes/sugarcube stuff/building sugarcube.txt
with
14 additions
and
32 deletions
devNotes/sugarcube stuff/building sugarcube.txt
+
14
−
32
View file @
ee7fd634
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:
h
g clone https://
b
it
bucket.org
/tmedwards/sugarcube
1. Clone Sugarcube repo: g
it
clone https://
g
it
hub.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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment